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
| 294 295 296 297 298 299 300 301 302 303 304 305 | # File 'lib/opencl_ruby_ffi/Kernel.rb', line 294 def attributes @_attributes ||= begin 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 attr_string.split(" ") end end | 
#global_work_size(device = program.devices.first) ⇒ Object
| 307 308 309 310 311 312 | # File 'lib/opencl_ruby_ffi/Kernel.rb', line 307 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 |