Command-buffers enable a reduction in overhead when enqueuing the same workload multiple times. By separating the command-queue setup from dispatch, the ability to replay a set of previously created commands is introduced.
Device-side cl_sync_point_khr synchronization-points can be used within command-buffers to define command dependencies. This allows the
commands of a command-buffer to execute out-of-order on a single compatible command-queue. The command-buffer itself has no inherent
in-order/out-of-order property, this ordering is inferred from the command-queue used on command recording. Out-of-order enqueues without event
dependencies of both regular commands, such as EnqueueFillBuffer, and command-buffers are allowed to execute concurrently, and it is up to the user
to express any dependencies using events.
The command-queues a command-buffer will be executed on can be set on replay via parameters to EnqueueCommandBufferKHR, provided they are compatible
with the command-queues used on command-buffer recording.
Requires CL12.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | CL_COMMAND_BUFFER_CAPABILITY_DEVICE_SIDE_ENQUEUE_KHR
Bits for |
| public static final int | CL_COMMAND_BUFFER_CAPABILITY_KERNEL_PRINTF_KHR
Bits for |
| public static final int | CL_COMMAND_BUFFER_CAPABILITY_OUT_OF_ORDER_KHR
Bits for |
| public static final int | CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR
Bits for |
| public static final int | CL_COMMAND_BUFFER_FLAGS_KHR
Bitfield to |
| public static final int | CL_COMMAND_BUFFER_NUM_QUEUES_KHR
|
| public static final int | CL_COMMAND_BUFFER_PROPERTIES_ARRAY_KHR
|
| public static final int | CL_COMMAND_BUFFER_QUEUES_KHR
|
| public static final int | CL_COMMAND_BUFFER_REFERENCE_COUNT_KHR
|
| public static final int | CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR
Bits for |
| public static final int | CL_COMMAND_BUFFER_STATE_EXECUTABLE_KHR
Values for |
| public static final int | CL_COMMAND_BUFFER_STATE_INVALID_KHR
Values for |
| public static final int | CL_COMMAND_BUFFER_STATE_KHR
|
| public static final int | CL_COMMAND_BUFFER_STATE_PENDING_KHR
Values for |
| public static final int | CL_COMMAND_BUFFER_STATE_RECORDING_KHR
Values for |
| public static final int | CL_COMMAND_COMMAND_BUFFER_KHR
|
| public static final int | CL_DEVICE_COMMAND_BUFFER_CAPABILITIES_KHR
Accepted values for the |
| public static final int | CL_DEVICE_COMMAND_BUFFER_REQUIRED_QUEUE_PROPERTIES_KHR
Accepted values for the |
| public static final int | CL_INCOMPATIBLE_COMMAND_QUEUE_KHR
Error codes. |
| public static final int | CL_INVALID_COMMAND_BUFFER_KHR
Error codes. |
| public static final int | CL_INVALID_SYNC_POINT_WAIT_LIST_KHR
Error codes. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static int | clCommandBarrierWithWaitListKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a barrier operation used as a synchronization point. |
| public static int | clCommandBarrierWithWaitListKHR(long command_buffer, long command_queue, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandCopyBufferKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long src_buffer, long dst_buffer, long src_offset, long dst_offset, long size, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to copy from one buffer object to another. |
| public static int | clCommandCopyBufferKHR(long command_buffer, long command_queue, long src_buffer, long dst_buffer, long src_offset, long dst_offset, long size, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandCopyBufferRectKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long src_buffer, long dst_buffer, PointerBuffer src_origin, PointerBuffer dst_origin, PointerBuffer region, long src_row_pitch, long src_slice_pitch, long dst_row_pitch, long dst_slice_pitch, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to copy a rectangular region from a buffer object to another buffer object. |
| public static int | clCommandCopyBufferRectKHR(long command_buffer, long command_queue, long src_buffer, long dst_buffer, PointerBuffer src_origin, PointerBuffer dst_origin, PointerBuffer region, long src_row_pitch, long src_slice_pitch, long dst_row_pitch, long dst_slice_pitch, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandCopyBufferToImageKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long src_buffer, long dst_image, long src_offset, PointerBuffer dst_origin, PointerBuffer region, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to copy a buffer object to an image object. |
| public static int | clCommandCopyBufferToImageKHR(long command_buffer, long command_queue, long src_buffer, long dst_image, long src_offset, PointerBuffer dst_origin, PointerBuffer region, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandCopyImageKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long src_image, long dst_image, PointerBuffer src_origin, PointerBuffer dst_origin, PointerBuffer region, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to copy image objects. |
| public static int | clCommandCopyImageKHR(long command_buffer, long command_queue, long src_image, long dst_image, PointerBuffer src_origin, PointerBuffer dst_origin, PointerBuffer region, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandCopyImageToBufferKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long src_image, long dst_buffer, PointerBuffer src_origin, PointerBuffer region, long dst_offset, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to copy an image object to a buffer object. |
| public static int | clCommandCopyImageToBufferKHR(long command_buffer, long command_queue, long src_image, long dst_buffer, PointerBuffer src_origin, PointerBuffer region, long dst_offset, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandFillBufferKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long buffer, ByteBuffer pattern, long offset, long size, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to fill a buffer object with a pattern of a given pattern size. |
| public static int | clCommandFillBufferKHR(long command_buffer, long command_queue, long buffer, ByteBuffer pattern, long offset, long size, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandFillImageKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long image, ByteBuffer fill_color, PointerBuffer origin, PointerBuffer region, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to fill an image object with a specified color. |
| public static int | clCommandFillImageKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long image, IntBuffer fill_color, PointerBuffer origin, PointerBuffer region, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to fill an image object with a specified color. |
| public static int | clCommandFillImageKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, long image, FloatBuffer fill_color, PointerBuffer origin, PointerBuffer region, IntBuffer Parameter is unused by this extension as only a single command-queue is supported and must be the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to fill an image object with a specified color. |
| public static int | clCommandFillImageKHR(long command_buffer, long command_queue, long image, ByteBuffer fill_color, PointerBuffer origin, PointerBuffer region, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandFillImageKHR(long command_buffer, long command_queue, long image, int[] fill_color, PointerBuffer origin, PointerBuffer region, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandFillImageKHR(long command_buffer, long command_queue, long image, float[] fill_color, PointerBuffer origin, PointerBuffer region, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static int | clCommandNDRangeKernelKHR(long
a valid command-buffer object command_buffer, long the command-queue the command will be recorded to.
command_queue, LongBuffer properties, long Parameter is unused by this extension as only a single command-queue is supported and must be a valid kernel object kernel, int work_dim, PointerBuffer global_work_offset, PointerBuffer global_work_size, PointerBuffer local_work_size, IntBuffer the synchronization-points that need to complete before this particular command can be executed.
sync_point_wait_list, IntBuffer If If returns a synchronization-point ID that identifies this particular command.
sync_point, PointerBuffer Synchronization-point objects are unique and can be used to identify this barrier command later on. returns a handle to the command.
mutable_handle)Handle is unused by this extension and must be passed as Records a command to execute a kernel on a device. |
| public static int | clCommandNDRangeKernelKHR(long command_buffer, long command_queue, long[] properties, long kernel, int work_dim, PointerBuffer global_work_offset, PointerBuffer global_work_size, PointerBuffer local_work_size, int[] sync_point_wait_list, int[] sync_point, PointerBuffer mutable_handle)
Array version of: |
| public static long | clCreateCommandBufferKHR(PointerBuffer
a pointer to a command-queue that the command-buffer commands will be recorded to. queues, LongBuffer queues must be a non-NULL value.a list of properties for the command-buffer and their corresponding values.
properties, IntBuffer Each property name is immediately followed by the corresponding desired value. The list is terminated with 0. If a supported property and its value
is not specified in properties, its default value will be used. will return an appropriate error code. If errcode_ret)errcode_ret is NULL, no error code is returned.Creates a command-buffer that can record commands to the specified queues. |
| public static long | clCreateCommandBufferKHR(PointerBuffer queues, long[] properties, int[] errcode_ret)
Array version of: |
| public static int | clEnqueueCommandBufferKHR(PointerBuffer
a pointer to an ordered list of command-queues compatible with the command-queues used on recording.
queues, long
a valid command-buffer object command_buffer, PointerBuffer a list of events that need to complete before this particular command can be executed. If event_wait_list, PointerBuffer event_wait_list is NULL, then this particular command
does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in
event_wait_list and command_queue must be the same.Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete.
event)event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to
complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the
event_wait_list array.Enqueues a command-buffer to execute on command-queues specified by |
| public static int | clFinalizeCommandBufferKHR(long
a valid command-buffer object command_buffer)Finalizes command recording ready for enqueuing the command-buffer on a command-queue. |
| public static int | clGetCommandBufferInfoKHR(long
the command-buffer being queried command_buffer, int the information to query param_name, ByteBuffer a pointer to memory where the appropriate result being queried is returned. If param_value, PointerBuffer param_value is NULL, it is ignored.the actual size in bytes of data being queried by param_value_size_ret)param_value. If NULL, it is ignored.Queries information about a command-buffer. |
| public static int | clGetCommandBufferInfoKHR(long
the command-buffer being queried command_buffer, int the information to query param_name, IntBuffer a pointer to memory where the appropriate result being queried is returned. If param_value, PointerBuffer param_value is NULL, it is ignored.the actual size in bytes of data being queried by param_value_size_ret)param_value. If NULL, it is ignored.Queries information about a command-buffer. |
| public static int | clGetCommandBufferInfoKHR(long
the command-buffer being queried command_buffer, int the information to query param_name, PointerBuffer a pointer to memory where the appropriate result being queried is returned. If param_value, PointerBuffer param_value is NULL, it is ignored.the actual size in bytes of data being queried by param_value_size_ret)param_value. If NULL, it is ignored.Queries information about a command-buffer. |
| public static int | clGetCommandBufferInfoKHR(long command_buffer, int param_name, int[] param_value, PointerBuffer param_value_size_ret)
Array version of: |
| public static int | clReleaseCommandBufferKHR(long
the command-buffer to release command_buffer)Decrements the |
| public static int | clRetainCommandBufferKHR(long
the command-buffer to retain command_buffer)Increments the |
| public static int | nclCommandBarrierWithWaitListKHR(long command_buffer, long command_queue, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static int | nclCommandCopyBufferKHR(long command_buffer, long command_queue, long src_buffer, long dst_buffer, long src_offset, long dst_offset, long size, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static int | nclCommandCopyBufferRectKHR(long command_buffer, long command_queue, long src_buffer, long dst_buffer, long src_origin, long dst_origin, long region, long src_row_pitch, long src_slice_pitch, long dst_row_pitch, long dst_slice_pitch, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static int | nclCommandCopyBufferToImageKHR(long command_buffer, long command_queue, long src_buffer, long dst_image, long src_offset, long dst_origin, long region, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static int | nclCommandCopyImageKHR(long command_buffer, long command_queue, long src_image, long dst_image, long src_origin, long dst_origin, long region, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static int | nclCommandCopyImageToBufferKHR(long command_buffer, long command_queue, long src_image, long dst_buffer, long src_origin, long region, long dst_offset, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static int | nclCommandFillBufferKHR(long command_buffer, long command_queue, long buffer, long pattern, long pattern_size, long offset, long size, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static int | nclCommandFillImageKHR(long command_buffer, long command_queue, long image, long fill_color, long origin, long region, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static int | nclCommandNDRangeKernelKHR(long command_buffer, long command_queue, long properties, long kernel, int work_dim, long global_work_offset, long global_work_size, long local_work_size, int num_sync_points_in_wait_list, long sync_point_wait_list, long sync_point, long mutable_handle)
Unsafe version of: |
| public static long | nclCreateCommandBufferKHR(int
the number of command-queues listed in num_queues, long queues, long properties, long errcode_ret)queues. This extension only supports a single command-queue, so this must be one.Unsafe version of: |
| public static int | nclEnqueueCommandBufferKHR(int
the number of command-queues listed in num_queues, long queues, long command_buffer, int queuesthe number of events in num_events_in_wait_list, long event_wait_list, long event)event_wait_listUnsafe version of: |
| public static int | nclGetCommandBufferInfoKHR(long command_buffer, int param_name, long
the size in bytes of memory pointed to by param_value_size, long param_value, long param_value_size_ret)param_value. This size must be ≥ size of return type. If param_value is NULL, it is ignored.Unsafe version of: |