Module: OpenCL::Context::OpenCL30

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

Instance Method Summary collapse

Instance Method Details

#set_destructor_callback(options = {}, &block) ⇒ Object

Attaches a callback to context that will be called on context destruction

Attributes

  • options - a hash containing named options

  • block - if provided, a callback invoked when program is released. Signature of the callback is { |Pointer to the context, Pointer to user_data| … }

Options

  • :user_data - a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback



523
524
525
526
# File 'lib/opencl_ruby_ffi/Context.rb', line 523

def set_destructor_callback( options = {}, &block )
  OpenCL.set_context_destructor_callback( self, option, &block )
  return self
end