lib/opencl_ruby_ffi/Platform.rb
def devices(type = Device::Type::ALL)
      ptr1 = MemoryPointer::new(:cl_uint , 1)
      error = OpenCL.clGetDeviceIDs(self, type, 0, nil, ptr1)
      error_check(error)
      ptr2 = MemoryPointer::new(:pointer, ptr1.read_uint)
      error = OpenCL.clGetDeviceIDs(self, type, ptr1.read_uint(), ptr2, nil)
      error_check(error)
      return ptr2.get_array_of_pointer(0, ptr1.read_uint()).collect { |device_ptr|
        Device::new(device_ptr, false)
      }
    end
# Returns an Array of Device corresponding to the available devices on the Platform
# The type of the desired devices can be specified
Returns an Array of Device corresponding to the available devices on the Platform
The type of the desired devices can be specified
Returns an Array of Device corresponding to the available devices on the Platform The type of the desired devices can be specified
def devices(type = Device::Type::ALL)
      ptr1 = MemoryPointer::new(:cl_uint , 1)
      error = OpenCL.clGetDeviceIDs(self, type, 0, nil, ptr1)
      error_check(error)
      ptr2 = MemoryPointer::new(:pointer, ptr1.read_uint)
      error = OpenCL.clGetDeviceIDs(self, type, ptr1.read_uint(), ptr2, nil)
      error_check(error)
      return ptr2.get_array_of_pointer(0, ptr1.read_uint()).collect { |device_ptr|
        Device::new(device_ptr, false)
      }
    end
def devices ( type = Device :: Type :: ALL ) ptr1 = MemoryPointer :: new ( :cl_uint , 1 ) error = OpenCL . clGetDeviceIDs ( self , type , 0 , nil , ptr1 ) error_check ( error ) ptr2 = MemoryPointer :: new ( :pointer , ptr1 . read_uint ) error = OpenCL . clGetDeviceIDs ( self , type , ptr1 . read_uint ( ) , ptr2 , nil ) error_check ( error ) return ptr2 . get_array_of_pointer ( 0 , ptr1 . read_uint ( ) ) . collect { | device_ptr | Device :: new ( device_ptr , false ) } end
Returns an Array of Device corresponding to the available devices on the Platform
The type of the desired devices can be specified
Returns an Array of Device corresponding to the available devices on the Platform The type of the desired devices can be specified
type