Module: OpenCL::Program::OpenCL20

Included in:
OpenCL::Program
Defined in:
lib/opencl_ruby_ffi/Program.rb

Instance Method Summary collapse

Instance Method Details

#build_global_variable_total_size(devs = nil) ⇒ Object

Returns the total amount in byte used by the Program variables in the global address space for the Device(s) specified. Returns an Array of tuple [ Device, size ] (2.0 only)



490
491
492
493
494
495
496
497
498
499
# File 'lib/opencl_ruby_ffi/Program.rb', line 490

def build_global_variable_total_size(devs = nil)
  devs = self.devices if not devs
  devs = [devs].flatten
  ptr = MemoryPointer::new( :size_t )
  return devs.collect { |dev|
    error = OpenCL.clGetProgramBuildInfo(self, dev, BUILD_GLOBAL_VARIABLE_TOTAL_SIZE, ptr.size, ptr, nil)
    error_check(error)
    [dev, ptr.read_size_t]
  }
end