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



149
150
151
152
153
154
155
156
# File 'lib/opencl_ruby_ffi/Event.rb', line 149

def context
  @_context ||= begin
    ptr = MemoryPointer::new( Context )
    error = OpenCL.clGetEventInfo(self, CONTEXT, Context.size, ptr, nil)
    error_check(error)
    Context::new( ptr.read_pointer )
  end
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



176
177
178
# File 'lib/opencl_ruby_ffi/Event.rb', line 176

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



159
160
161
# File 'lib/opencl_ruby_ffi/Event.rb', line 159

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