Class: OpenCL::SVMPointer
- Defined in:
- lib/opencl_ruby_ffi/SVM.rb
Overview
maps the SVM pointer type
Instance Method Summary collapse
-
#+(offset) ⇒ Object
creates a new SVMPointer relative to an existing one from an offset.
-
#free ⇒ Object
frees the parent memory region associated to this SVMPointer.
-
#initialize(address, context, size, base = nil) ⇒ SVMPointer
constructor
create a new SVMPointer from its address and the context it pertains to.
- #inspect ⇒ Object
Constructor Details
#initialize(address, context, size, base = nil) ⇒ SVMPointer
create a new SVMPointer from its address and the context it pertains to
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 8 def initialize( address, context, size, base = nil ) super( address ) @context = context if base then @base = base else @base = address end @size = size end |
Instance Method Details
#+(offset) ⇒ Object
creates a new SVMPointer relative to an existing one from an offset
24 25 26 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 24 def +( offset ) return SVMPointer::new( self.address + offset, @context, @size, @base ) end |
#free ⇒ Object
frees the parent memory region associated to this SVMPointer
29 30 31 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 29 def free return OpenCL::svm_free( @context, @base ) end |
#inspect ⇒ Object
19 20 21 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 19 def inspect return "#<#{self.class.name}: #{@size}>" end |