OpenCL provides cl_event as a primary mechanism of synchronization between host and device as well as across devices. While events can be
waited on or can be passed as dependencies across work-submissions, they suffer from following limitations:
This extension introduces a new type of synchronization object to represent semaphores that can be reused, waited on, and signaled multiple times by OpenCL work-submissions.
In particular, this extension defines:
cl_semaphore_khr to represent the semaphore objects.cl_semaphore_properties_khr to specify metadata associated with semaphores.Requires CL12.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | CL_COMMAND_SEMAPHORE_SIGNAL_KHR
New return values from |
| public static final int | CL_COMMAND_SEMAPHORE_WAIT_KHR
New return values from |
| public static final int | CL_DEVICE_HANDLE_LIST_END_KHR
New attributes that can be passed as part of |
| public static final int | CL_DEVICE_HANDLE_LIST_KHR
New attributes that can be passed as part of |
| public static final int | CL_DEVICE_SEMAPHORE_TYPES_KHR
Accepted value for the |
| public static final int | CL_INVALID_SEMAPHORE_KHR
The following error codes can be returned by APIs introduced as part of this specification or the specifications that depend on this. |
| public static final int | CL_PLATFORM_SEMAPHORE_TYPES_KHR
Accepted value for the |
| public static final int | CL_SEMAPHORE_CONTEXT_KHR
New attributes that can be passed as part of |
| public static final int | CL_SEMAPHORE_PAYLOAD_KHR
New attributes that can be passed as part of |
| public static final int | CL_SEMAPHORE_PROPERTIES_KHR
New attributes that can be passed as part of |
| public static final int | CL_SEMAPHORE_REFERENCE_COUNT_KHR
New attributes that can be passed as part of |
| public static final int | CL_SEMAPHORE_TYPE_BINARY_KHR
Semaphore types. |
| public static final int | CL_SEMAPHORE_TYPE_KHR
New attributes that can be passed as part of |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static long | clCreateSemaphoreWithPropertiesKHR(long context, LongBuffer sema_props, IntBuffer
will return an appropriate error code. If errcode_ret)errcode_ret is NULL, no error code is returned.
|
| public static long | clCreateSemaphoreWithPropertiesKHR(long context, long[] sema_props, int[] errcode_ret)
Array version of: |
| public static int | clEnqueueSignalSemaphoresKHR(long command_queue, PointerBuffer sema_objects, LongBuffer sema_payload_list, 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.
|
| public static int | clEnqueueSignalSemaphoresKHR(long command_queue, PointerBuffer sema_objects, long[] sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event)
Array version of: |
| public static int | clEnqueueWaitSemaphoresKHR(long command_queue, PointerBuffer sema_objects, LongBuffer sema_payload_list, 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.
|
| public static int | clEnqueueWaitSemaphoresKHR(long command_queue, PointerBuffer sema_objects, long[] sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event)
Array version of: |
| public static int | clGetSemaphoreInfoKHR(long sema_object, int param_name, ByteBuffer param_value, PointerBuffer
the actual size in bytes of data being queried by param_value_size_ret)param_value. If NULL, it is ignored.
|
| public static int | clGetSemaphoreInfoKHR(long sema_object, int param_name, IntBuffer param_value, PointerBuffer
the actual size in bytes of data being queried by param_value_size_ret)param_value. If NULL, it is ignored.
|
| public static int | clGetSemaphoreInfoKHR(long sema_object, int param_name, PointerBuffer param_value, PointerBuffer
the actual size in bytes of data being queried by param_value_size_ret)param_value. If NULL, it is ignored.
|
| public static int | clGetSemaphoreInfoKHR(long sema_object, int param_name, int[] param_value, PointerBuffer param_value_size_ret)
Array version of: |
| public static int | |
| public static int | |
| public static long | nclCreateSemaphoreWithPropertiesKHR(long context, long sema_props, long errcode_ret)
Unsafe version of: |
| public static int | nclEnqueueSignalSemaphoresKHR(long command_queue, int num_sema_objects, long sema_objects, long sema_payload_list, int
the number of events in num_events_in_wait_list, long event_wait_list, long event)event_wait_listUnsafe version of: |
| public static int | nclEnqueueWaitSemaphoresKHR(long command_queue, int num_sema_objects, long sema_objects, long sema_payload_list, int
the number of events in num_events_in_wait_list, long event_wait_list, long event)event_wait_listUnsafe version of: |
| public static int | nclGetSemaphoreInfoKHR(long sema_object, 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: |
| CL_COMMAND_SEMAPHORE_SIGNAL_KHR | back to summary |
|---|---|
| public static final int CL_COMMAND_SEMAPHORE_SIGNAL_KHR New return values from | |
| CL_COMMAND_SEMAPHORE_WAIT_KHR | back to summary |
|---|---|
| public static final int CL_COMMAND_SEMAPHORE_WAIT_KHR New return values from | |
| CL_DEVICE_HANDLE_LIST_END_KHR | back to summary |
|---|---|
| public static final int CL_DEVICE_HANDLE_LIST_END_KHR New attributes that can be passed as part of | |
| CL_DEVICE_HANDLE_LIST_KHR | back to summary |
|---|---|
| public static final int CL_DEVICE_HANDLE_LIST_KHR New attributes that can be passed as part of | |
| CL_DEVICE_SEMAPHORE_TYPES_KHR | back to summary |
|---|---|
| public static final int CL_DEVICE_SEMAPHORE_TYPES_KHR Accepted value for the | |
| CL_INVALID_SEMAPHORE_KHR | back to summary |
|---|---|
| public static final int CL_INVALID_SEMAPHORE_KHR The following error codes can be returned by APIs introduced as part of this specification or the specifications that depend on this. | |
| CL_PLATFORM_SEMAPHORE_TYPES_KHR | back to summary |
|---|---|
| public static final int CL_PLATFORM_SEMAPHORE_TYPES_KHR Accepted value for the | |
| CL_SEMAPHORE_CONTEXT_KHR | back to summary |
|---|---|
| public static final int CL_SEMAPHORE_CONTEXT_KHR New attributes that can be passed as part of | |
| CL_SEMAPHORE_PAYLOAD_KHR | back to summary |
|---|---|
| public static final int CL_SEMAPHORE_PAYLOAD_KHR New attributes that can be passed as part of | |
| CL_SEMAPHORE_PROPERTIES_KHR | back to summary |
|---|---|
| public static final int CL_SEMAPHORE_PROPERTIES_KHR New attributes that can be passed as part of | |
| CL_SEMAPHORE_REFERENCE_COUNT_KHR | back to summary |
|---|---|
| public static final int CL_SEMAPHORE_REFERENCE_COUNT_KHR New attributes that can be passed as part of | |
| CL_SEMAPHORE_TYPE_BINARY_KHR | back to summary |
|---|---|
| public static final int CL_SEMAPHORE_TYPE_BINARY_KHR Semaphore types. | |
| CL_SEMAPHORE_TYPE_KHR | back to summary |
|---|---|
| public static final int CL_SEMAPHORE_TYPE_KHR New attributes that can be passed as part of | |
| KHRSemaphore | back to summary |
|---|---|
| protected KHRSemaphore() | |
| clCreateSemaphoreWithPropertiesKHR | back to summary |
|---|---|
public static long clCreateSemaphoreWithPropertiesKHR(long context, LongBuffer sema_props, IntBuffer errcode_ret)
| |
| clCreateSemaphoreWithPropertiesKHR | back to summary |
|---|---|
| public static long clCreateSemaphoreWithPropertiesKHR(long context, long[] sema_props, int[] errcode_ret) Array version of:
| |
| clEnqueueSignalSemaphoresKHR | back to summary |
|---|---|
public static int clEnqueueSignalSemaphoresKHR(long command_queue, PointerBuffer sema_objects, LongBuffer sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event)
| |
| clEnqueueSignalSemaphoresKHR | back to summary |
|---|---|
| public static int clEnqueueSignalSemaphoresKHR(long command_queue, PointerBuffer sema_objects, long[] sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event) Array version of:
| |
| clEnqueueWaitSemaphoresKHR | back to summary |
|---|---|
public static int clEnqueueWaitSemaphoresKHR(long command_queue, PointerBuffer sema_objects, LongBuffer sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event)
| |
| clEnqueueWaitSemaphoresKHR | back to summary |
|---|---|
| public static int clEnqueueWaitSemaphoresKHR(long command_queue, PointerBuffer sema_objects, long[] sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event) Array version of:
| |
| clGetSemaphoreInfoKHR | back to summary |
|---|---|
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret)
| |
| clGetSemaphoreInfoKHR | back to summary |
|---|---|
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret)
| |
| clGetSemaphoreInfoKHR | back to summary |
|---|---|
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret)
| |
| clGetSemaphoreInfoKHR | back to summary |
|---|---|
| public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:
| |
| clReleaseSemaphoreKHR | back to summary |
|---|---|
public static int clReleaseSemaphoreKHR(long sema_object)
| |
| clRetainSemaphoreKHR | back to summary |
|---|---|
public static int clRetainSemaphoreKHR(long sema_object)
| |
| nclCreateSemaphoreWithPropertiesKHR | back to summary |
|---|---|
| public static long nclCreateSemaphoreWithPropertiesKHR(long context, long sema_props, long errcode_ret) Unsafe version of: | |
| nclEnqueueSignalSemaphoresKHR | back to summary |
|---|---|
| public static int nclEnqueueSignalSemaphoresKHR(long command_queue, int num_sema_objects, long sema_objects, long sema_payload_list, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:
| |
| nclEnqueueWaitSemaphoresKHR | back to summary |
|---|---|
| public static int nclEnqueueWaitSemaphoresKHR(long command_queue, int num_sema_objects, long sema_objects, long sema_payload_list, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:
| |
| nclGetSemaphoreInfoKHR | back to summary |
|---|---|
| public static int nclGetSemaphoreInfoKHR(long sema_object, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:
| |