Module: OpenCL::Kernel::OpenCL12
- Included in:
- OpenCL::Kernel
- Defined in:
- lib/opencl_ruby_ffi/Kernel.rb
Instance Method Summary collapse
-
#attributes ⇒ Object
returns a String containing the attributes qualifier used at kernel definition.
- #global_work_size(device = program.devices.first) ⇒ Object
Instance Method Details
#attributes ⇒ Object
returns a String containing the attributes qualifier used at kernel definition
269 270 271 272 273 274 275 276 277 278 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 269 def attributes attributes_size = MemoryPointer::new( :size_t ) error = OpenCL.clGetKernelInfo( self, ATTRIBUTES, 0, nil, attributes_size) error_check(error) attr = MemoryPointer::new( attributes_size.read_size_t ) error = OpenCL.clGetKernelInfo( self, ATTRIBUTES, attributes_size.read_size_t, attr, nil) error_check(error) attr_string = attr.read_string return attr_string.split(" ") end |
#global_work_size(device = program.devices.first) ⇒ Object
280 281 282 283 284 285 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 280 def global_work_size(device = program.devices.first) ptr = MemoryPointer::new( :size_t, 3 ) error = OpenCL.clGetKernelWorkGroupInfo(self, device, GLOBAL_WORK_SIZE, ptr.size, ptr, nil) error_check(error) return ptr.get_array_of_size_t(0,3) end |