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
263 264 265 266 267 268 269 270 271 272 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 263 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
274 275 276 277 278 279 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 274 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 |