Module: OpenCL::Event::OpenCL11

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

Instance Method Summary collapse

Instance Method Details

#contextObject

Returns the Context associated with the Event



142
143
144
145
146
147
# File 'lib/opencl_ruby_ffi/Event.rb', line 142

def context
  ptr = MemoryPointer::new( Context )
  error = OpenCL.clGetEventInfo(self, CONTEXT, Context.size, ptr, nil)
  error_check(error)
  return Context::new( ptr.read_pointer )
end

#set_event_callback(command_exec_callback_type, options = {}, &proc) ⇒ Object Also known as: set_callback

Attaches a callback to the Event that will be called on the given transition

Attributes

  • command_exec_callback_type - a CommandExecutionStatus

  • options - a hash containing named options

  • block - a callback invoked when the given Event occurs. Signature of the callback is { |Event, :cl_int event_command_exec_status, 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



167
168
169
# File 'lib/opencl_ruby_ffi/Event.rb', line 167

def set_event_callback( command_exec_callback_type, options={}, &proc )
  return OpenCL.set_event_callback( self, command_exec_callback_type, options, &proc )
end

#set_user_event_status(execution_status) ⇒ Object Also known as: set_status

Sets the satus of Event (a user event) to the given execution status



150
151
152
# File 'lib/opencl_ruby_ffi/Event.rb', line 150

def set_user_event_status( execution_status )
  return OpenCL.set_user_event_status( self, execution_status )
end