Class: OpenCL::SVMPointer

Inherits:
FFI::Pointer show all
Defined in:
lib/opencl_ruby_ffi/SVM.rb

Overview

maps the SVM pointer type

Instance Method Summary collapse

Methods inherited from FFI::Pointer

#method_missing, #orig_method_missing

Constructor Details

#initialize(address, context) ⇒ SVMPointer

create a new SVMPointer from its address and the context it pertains to



7
8
9
10
# File 'lib/opencl_ruby_ffi/SVM.rb', line 7

def initialize( address, context )
  super( address )
  @context = context
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FFI::Pointer

Instance Method Details

#+(offset) ⇒ Object

creates a new SVMPointer relative to an existing one from an offset



13
14
15
# File 'lib/opencl_ruby_ffi/SVM.rb', line 13

def +( offset )
  return OpenCL::SVMPointer::new(  self.address + offset, @context )
end

#freeObject

frees the SVMPointer (must not be called on an SVMPointer obtained from an offset)



18
19
20
# File 'lib/opencl_ruby_ffi/SVM.rb', line 18

def free
  return OpenCL::svm_free( @context, self )
end