Class: OpenCL::AcceleratorINTEL

Inherits:
ExtendedStruct show all
Defined in:
lib/opencl_ruby_ffi/intel/accelerator.rb

Defined Under Namespace

Classes: AcceleratorINTELPointer

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ExtendedStruct

register_extension

Constructor Details

#initialize(ptr, context = ptr.context, retain = true) ⇒ AcceleratorINTEL

Returns a new instance of AcceleratorINTEL.



72
73
74
75
76
# File 'lib/opencl_ruby_ffi/intel/accelerator.rb', line 72

def initialize(ptr, context = ptr.context, retain = true)
  super(AcceleratorINTELPointer::new(ptr, context))
  @context = context
  context.__retain_accelerator_intel(ptr) if retain
end

Class Method Details

.release(ptr) ⇒ Object



78
79
80
# File 'lib/opencl_ruby_ffi/intel/accelerator.rb', line 78

def self.release(ptr)
  ptr.context.__release_accelerator_intel(ptr)
end

Instance Method Details

#context_intelObject



96
97
98
99
100
101
102
103
104
105
# File 'lib/opencl_ruby_ffi/intel/accelerator.rb', line 96

def context_intel
  f = platform.get_extension_function("clGetAcceleratorInfoINTEL", :cl_int,
        [OpenCL::AcceleratorINTEL, :cl_accelerator_info_intel, :size_t, :pointer, :pointer])
  error_check(OpenCL::INVALID_OPERATION) unless f

  ptr = MemoryPointer::new( Context )
  error = f.call(self, CONTEXT_INTEL, Context.size, ptr, nil)
  error_check(error)
  return Context::new( ptr.read_pointer )
end

#descriptor_intelObject



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/opencl_ruby_ffi/intel/accelerator.rb', line 82

def descriptor_intel
  f = platform.get_extension_function("clGetAcceleratorInfoINTEL", :cl_int,
        [OpenCL::AcceleratorINTEL, :cl_accelerator_info_intel, :size_t, :pointer, :pointer])
  error_check(OpenCL::INVALID_OPERATION) unless f

  ptr1 = MemoryPointer::new( :size_t, 1)
  error = f.call(self, DESCRIPTOR_INTEL, 0, nil, ptr1)
  error_check(error)
  ptr2 = MemoryPointer::new( ptr1.read_size_t )
  error = f.call(self, DESCRIPTOR_INTEL, ptr1.read_size_t, ptr2, nil)
  error_check(error)
  return ptr2
end

#platformObject



68
69
70
# File 'lib/opencl_ruby_ffi/intel/accelerator.rb', line 68

def platform
  @context.platform
end

#reference_count_intelObject

Returns the OpenCL::AcceleratorINTEL::reference_count_intel info

Returns:

  • cl_uint



107
# File 'lib/opencl_ruby_ffi/intel/accelerator.rb', line 107

get_info_ext("AcceleratorINTEL", :cl_uint, "reference_count_intel", "clGetAcceleratorInfoINTEL")

#type_intelObject

Returns the OpenCL::AcceleratorINTEL::type_intel info

Returns:

  • cl_uint



108
# File 'lib/opencl_ruby_ffi/intel/accelerator.rb', line 108

get_info_ext("AcceleratorINTEL", :cl_uint, "type_intel", "clGetAcceleratorInfoINTEL")

Constant Summary collapse

DESCRIPTOR_INTEL =
0x4090
REFERENCE_COUNT_INTEL =
0x4091
CONTEXT_INTEL =
0x4092
TYPE_INTEL =
0x4093