- type CLEvent = Ptr ()
- data CLCommandType
- = CL_COMMAND_NDRANGE_KERNEL
- | CL_COMMAND_TASK
- | CL_COMMAND_NATIVE_KERNEL
- | CL_COMMAND_READ_BUFFER
- | CL_COMMAND_WRITE_BUFFER
- | CL_COMMAND_COPY_BUFFER
- | CL_COMMAND_READ_IMAGE
- | CL_COMMAND_WRITE_IMAGE
- | CL_COMMAND_COPY_IMAGE
- | CL_COMMAND_COPY_BUFFER_TO_IMAGE
- | CL_COMMAND_COPY_IMAGE_TO_BUFFER
- | CL_COMMAND_MAP_BUFFER
- | CL_COMMAND_MAP_IMAGE
- | CL_COMMAND_UNMAP_MEM_OBJECT
- | CL_COMMAND_MARKER
- | CL_COMMAND_ACQUIRE_GL_OBJECTS
- | CL_COMMAND_RELEASE_GL_OBJECTS
- data CLProfilingInfo
- data CLCommandExecutionStatus
- = CL_QUEUED
- | CL_SUBMITTED
- | CL_RUNNING
- | CL_COMPLETE
- | CL_EXEC_ERROR
- clWaitForEvents :: [CLEvent] -> IO Bool
- clRetainEvent :: CLEvent -> IO Bool
- clReleaseEvent :: CLEvent -> IO Bool
- clGetEventCommandQueue :: CLEvent -> IO CLCommandQueue
- clGetEventCommandType :: CLEvent -> IO CLCommandType
- clGetEventReferenceCount :: CLEvent -> IO CLint
- clGetEventCommandExecutionStatus :: CLEvent -> IO CLCommandExecutionStatus
- clGetEventProfilingInfo :: CLEvent -> CLProfilingInfo -> IO CLulong
Types
data CLCommandType Source
Command associated with an event.
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
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.