Method: OpenCL::Context#devices

Defined in:
lib/opencl_ruby_ffi/Context.rb

#devicesObject

Returns an Array of Device associated to the Context



80
81
82
83
84
85
86
87
88
# File 'lib/opencl_ruby_ffi/Context.rb', line 80

def devices
  n = self.num_devices
  ptr2 = MemoryPointer::new( Device, n )
  error = OpenCL.clGetContextInfo(self, DEVICES, Device.size*n, ptr2, nil)
  error_check(error)
  return ptr2.get_array_of_pointer(0, n).collect { |device_ptr|
    Device::new(device_ptr)
  }
end