OpenCL-1.0.3.0: Haskell high-level wrapper for OpenCL

Control.Parallel.OpenCL.Event

Contents

Synopsis

Types

data CLProfilingInfo Source

Specifies the profiling data.

  • CL_PROFILING_COMMAND_QUEUED, A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event is enqueued in a command-queue by the host.
  • CL_PROFILING_COMMAND_SUBMIT, A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event that has been enqueued is submitted by the host to the device associated with the commandqueue.
  • CL_PROFILING_COMMAND_START, A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event starts execution on the device.
  • CL_PROFILING_COMMAND_END, A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event has finished execution on the device.

data CLCommandExecutionStatus Source

  • CL_QUEUED, command has been enqueued in the command-queue.
  • CL_SUBMITTED, enqueued command has been submitted by the host to the device associated with the command-queue.
  • CL_RUNNING, device is currently executing this command.
  • CL_COMPLETE, the command has completed.
  • CL_EXEC_ERROR, command was abnormally terminated.

Functions

clWaitForEvents :: [CLEvent] -> IO BoolSource

Waits on the host thread for commands identified by event objects in event_list to complete. A command is considered complete if its execution status is CL_COMPLETE or a negative value. Returns True if the function was executed successfully. It returns False if the list of events is empty, or if events specified in event_list do not belong to the same context, or if event objects specified in event_list are not valid event objects.

clRetainEvent :: CLEvent -> IO BoolSource

Increments the event reference count. The OpenCL commands that return an event perform an implicit retain. Returns True if the function is executed successfully. It returns False if event is not a valid event object.

clReleaseEvent :: CLEvent -> IO BoolSource

Decrements the event reference count. Decrements the event reference count. The event object is deleted once the reference count becomes zero, the specific command identified by this event has completed (or terminated) and there are no commands in the command-queues of a context that require a wait for this event to complete. Returns True if the function is executed successfully. It returns False if event is not a valid event object.

clGetEventCommandQueue :: CLEvent -> IO CLCommandQueueSource

Return the command-queue associated with event.

This function execute OpenCL clGetEventInfo with CL_EVENT_COMMAND_QUEUE.

clGetEventCommandType :: CLEvent -> IO CLCommandTypeSource

Return the command associated with event.

This function execute OpenCL clGetEventInfo with CL_EVENT_COMMAND_TYPE.

clGetEventReferenceCount :: CLEvent -> IO CLintSource

Return the event reference count. The reference count returned should be considered immediately stale. It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.

This function execute OpenCL clGetEventInfo with CL_EVENT_REFERENCE_COUNT.

clGetEventCommandExecutionStatus :: CLEvent -> IO CLCommandExecutionStatusSource

Return the execution status of the command identified by event.

This function execute OpenCL clGetEventInfo with CL_EVENT_COMMAND_EXECUTION_STATUS.

clGetEventProfilingInfo :: CLEvent -> CLProfilingInfo -> IO CLulongSource

Returns profiling information for the command associated with event if profiling is enabled. The unsigned 64-bit values returned can be used to measure the time in nano-seconds consumed by OpenCL commands.

OpenCL devices are required to correctly track time across changes in device frequency and power states. The CL_DEVICE_PROFILING_TIMER_RESOLUTION specifies the resolution of the timer i.e. the number of nanoseconds elapsed before the timer is incremented.

Event objects can be used to capture profiling information that measure execution time of a command. Profiling of OpenCL commands can be enabled either by using a command-queue created with CL_QUEUE_PROFILING_ENABLE flag set in properties argument to clCreateCommandQueue or by setting the CL_QUEUE_PROFILING_ENABLE flag in properties argument to clSetCommandQueueProperty.

clGetEventProfilingInfo returns the valueif the function is executed successfully and the profiling information has been recorded, and returns Nothing if the CL_QUEUE_PROFILING_ENABLE flag is not set for the command-queue and if the profiling information is currently not available (because the command identified by event has not completed), or if event is a not a valid event object.