Class: OpenCL::USMPointer
- Defined in:
- lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb
Instance Method Summary collapse
- #+(offset) ⇒ Object
- #alloc_base_ptr_intel ⇒ Object
- #alloc_device_intel ⇒ Object
- #alloc_flags_intel ⇒ Object
- #alloc_size_intel ⇒ Object
- #alloc_type_intel ⇒ Object
- #free ⇒ Object
-
#initialize(address, context) ⇒ USMPointer
constructor
A new instance of USMPointer.
- #inspect ⇒ Object
- #slice(offset, size) ⇒ Object
Constructor Details
#initialize(address, context) ⇒ USMPointer
Returns a new instance of USMPointer.
254 255 256 257 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 254 def initialize(address, context) super(address) @context = context end |
Instance Method Details
#+(offset) ⇒ Object
268 269 270 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 268 def +( offset ) self.slice(offset, self.size - offset) end |
#alloc_base_ptr_intel ⇒ Object
284 285 286 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 284 def alloc_base_ptr_intel @context.mem_alloc_base_ptr_intel(self) end |
#alloc_device_intel ⇒ Object
292 293 294 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 292 def alloc_device_intel context.mem_alloc_device_intel(self) end |
#alloc_flags_intel ⇒ Object
280 281 282 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 280 def alloc_flags_intel @context.mem_alloc_flags_intel(self) end |
#alloc_size_intel ⇒ Object
288 289 290 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 288 def alloc_size_intel @context.mem_alloc_size_intel(self) end |
#alloc_type_intel ⇒ Object
276 277 278 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 276 def alloc_type_intel @context.mem_alloc_type_intel(self) end |
#free ⇒ Object
272 273 274 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 272 def free @context.mem_free_intel(alloc_base_ptr_intel) end |
#inspect ⇒ Object
259 260 261 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 259 def inspect return "#<#{self.class.name}: 0x#{address.to_s(16)} (#{size})>" end |
#slice(offset, size) ⇒ Object
263 264 265 266 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 263 def slice(offset, size) res = super(offset, size) self.class.new(res, context) end |