Package org.lwjgl.opencl
Class KHRSemaphore
java.lang.Object
org.lwjgl.opencl.KHRSemaphore
Native bindings to the khr_semaphore extension.
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:
- They are immutable.
- They are not reusable.
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:
- A new type called
cl_semaphore_khrto represent the semaphore objects. - A new type called
cl_semaphore_properties_khrto specify metadata associated with semaphores. - Routines to create, retain, and release semaphores.
- Routines to wait on and signal semaphore objects.
- Routine to query the properties of semaphore objects.
Requires CL12.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intNew attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr.static final intNew attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr.static final intAccepted value for theparam_nameparameter toGetDeviceInfoto query the semaphore types supported by an OpenCL device.static final intThe following error codes can be returned by APIs introduced as part of this specification or the specifications that depend on this.static final intAccepted value for theparam_nameparameter toGetPlatformInfoto query the semaphore types supported by an OpenCL platform.static final intNew attributes that can be passed as part ofcl_semaphore_info_khr.static final intNew attributes that can be passed as part ofcl_semaphore_info_khr.static final intNew attributes that can be passed as part ofcl_semaphore_info_khr.static final intNew attributes that can be passed as part ofcl_semaphore_info_khr.static final intSemaphore types.static final intNew attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr. -
Method Summary
Modifier and TypeMethodDescriptionstatic longclCreateSemaphoreWithPropertiesKHR(long context, long[] sema_props, int @Nullable [] errcode_ret) Array version of:CreateSemaphoreWithPropertiesKHRstatic longclCreateSemaphoreWithPropertiesKHR(long context, LongBuffer sema_props, @Nullable IntBuffer errcode_ret) static intclEnqueueSignalSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, long[] sema_payload_list, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event) Array version of:EnqueueSignalSemaphoresKHRstatic intclEnqueueSignalSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, LongBuffer sema_payload_list, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event) static intclEnqueueWaitSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, long @Nullable [] sema_payload_list, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event) Array version of:EnqueueWaitSemaphoresKHRstatic intclEnqueueWaitSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, @Nullable LongBuffer sema_payload_list, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event) static intclGetSemaphoreInfoKHR(long sema_object, int param_name, int @Nullable [] param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) Array version of:GetSemaphoreInfoKHRstatic intclGetSemaphoreInfoKHR(long sema_object, int param_name, @Nullable ByteBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) static intclGetSemaphoreInfoKHR(long sema_object, int param_name, @Nullable IntBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) static intclGetSemaphoreInfoKHR(long sema_object, int param_name, @Nullable org.lwjgl.PointerBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) static intclReleaseSemaphoreKHR(long sema_object) static intclRetainSemaphoreKHR(long sema_object) static longnclCreateSemaphoreWithPropertiesKHR(long context, long sema_props, long errcode_ret) Unsafe version of:CreateSemaphoreWithPropertiesKHRstatic intnclEnqueueSignalSemaphoresKHR(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:EnqueueSignalSemaphoresKHRstatic intnclEnqueueWaitSemaphoresKHR(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:EnqueueWaitSemaphoresKHRstatic intnclGetSemaphoreInfoKHR(long sema_object, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetSemaphoreInfoKHR
-
Field Details
-
CL_PLATFORM_SEMAPHORE_TYPES_KHR
public static final int CL_PLATFORM_SEMAPHORE_TYPES_KHRAccepted value for theparam_nameparameter toGetPlatformInfoto query the semaphore types supported by an OpenCL platform.- See Also:
-
CL_DEVICE_SEMAPHORE_TYPES_KHR
public static final int CL_DEVICE_SEMAPHORE_TYPES_KHRAccepted value for theparam_nameparameter toGetDeviceInfoto query the semaphore types supported by an OpenCL device.- See Also:
-
CL_SEMAPHORE_TYPE_BINARY_KHR
public static final int CL_SEMAPHORE_TYPE_BINARY_KHRSemaphore types.- See Also:
-
CL_SEMAPHORE_CONTEXT_KHR
public static final int CL_SEMAPHORE_CONTEXT_KHRNew attributes that can be passed as part ofcl_semaphore_info_khr.- See Also:
-
CL_SEMAPHORE_REFERENCE_COUNT_KHR
public static final int CL_SEMAPHORE_REFERENCE_COUNT_KHRNew attributes that can be passed as part ofcl_semaphore_info_khr.- See Also:
-
CL_SEMAPHORE_PROPERTIES_KHR
public static final int CL_SEMAPHORE_PROPERTIES_KHRNew attributes that can be passed as part ofcl_semaphore_info_khr.- See Also:
-
CL_SEMAPHORE_PAYLOAD_KHR
public static final int CL_SEMAPHORE_PAYLOAD_KHRNew attributes that can be passed as part ofcl_semaphore_info_khr.- See Also:
-
CL_SEMAPHORE_TYPE_KHR
public static final int CL_SEMAPHORE_TYPE_KHRNew attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr.- See Also:
-
CL_DEVICE_HANDLE_LIST_KHR
public static final int CL_DEVICE_HANDLE_LIST_KHRNew attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr.- See Also:
-
CL_DEVICE_HANDLE_LIST_END_KHR
public static final int CL_DEVICE_HANDLE_LIST_END_KHRNew attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr.- See Also:
-
CL_COMMAND_SEMAPHORE_WAIT_KHR
public static final int CL_COMMAND_SEMAPHORE_WAIT_KHR- See Also:
-
CL_COMMAND_SEMAPHORE_SIGNAL_KHR
public static final int CL_COMMAND_SEMAPHORE_SIGNAL_KHR- See Also:
-
CL_INVALID_SEMAPHORE_KHR
public static final int CL_INVALID_SEMAPHORE_KHRThe following error codes can be returned by APIs introduced as part of this specification or the specifications that depend on this.- See Also:
-
-
Method Details
-
nclCreateSemaphoreWithPropertiesKHR
public static long nclCreateSemaphoreWithPropertiesKHR(long context, long sema_props, long errcode_ret) Unsafe version of:CreateSemaphoreWithPropertiesKHR -
clCreateSemaphoreWithPropertiesKHR
public static long clCreateSemaphoreWithPropertiesKHR(long context, LongBuffer sema_props, @Nullable IntBuffer errcode_ret) - Parameters:
errcode_ret- will return an appropriate error code. Iferrcode_retisNULL, no error code is returned.
-
nclEnqueueWaitSemaphoresKHR
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:EnqueueWaitSemaphoresKHR- Parameters:
num_events_in_wait_list- the number of events inevent_wait_list
-
clEnqueueWaitSemaphoresKHR
public static int clEnqueueWaitSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, @Nullable LongBuffer sema_payload_list, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event) - Parameters:
event_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust be the same.event- 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.eventcan beNULLin 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 theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.
-
nclEnqueueSignalSemaphoresKHR
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:EnqueueSignalSemaphoresKHR- Parameters:
num_events_in_wait_list- the number of events inevent_wait_list
-
clEnqueueSignalSemaphoresKHR
public static int clEnqueueSignalSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, LongBuffer sema_payload_list, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event) - Parameters:
event_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust be the same.event- 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.eventcan beNULLin 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 theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.
-
nclGetSemaphoreInfoKHR
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:GetSemaphoreInfoKHR- Parameters:
param_value_size- the size in bytes of memory pointed to byparam_value. This size must be ≥ size of return type. Ifparam_valueisNULL, it is ignored.
-
clGetSemaphoreInfoKHR
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, @Nullable ByteBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) - Parameters:
param_value_size_ret- the actual size in bytes of data being queried byparam_value. IfNULL, it is ignored.
-
clGetSemaphoreInfoKHR
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, @Nullable IntBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) - Parameters:
param_value_size_ret- the actual size in bytes of data being queried byparam_value. IfNULL, it is ignored.
-
clGetSemaphoreInfoKHR
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, @Nullable org.lwjgl.PointerBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) - Parameters:
param_value_size_ret- the actual size in bytes of data being queried byparam_value. IfNULL, it is ignored.
-
clReleaseSemaphoreKHR
public static int clReleaseSemaphoreKHR(long sema_object) -
clRetainSemaphoreKHR
public static int clRetainSemaphoreKHR(long sema_object) -
clCreateSemaphoreWithPropertiesKHR
public static long clCreateSemaphoreWithPropertiesKHR(long context, long[] sema_props, int @Nullable [] errcode_ret) Array version of:CreateSemaphoreWithPropertiesKHR -
clEnqueueWaitSemaphoresKHR
public static int clEnqueueWaitSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, long @Nullable [] sema_payload_list, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event) Array version of:EnqueueWaitSemaphoresKHR -
clEnqueueSignalSemaphoresKHR
public static int clEnqueueSignalSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, long[] sema_payload_list, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event) Array version of:EnqueueSignalSemaphoresKHR -
clGetSemaphoreInfoKHR
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, int @Nullable [] param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) Array version of:GetSemaphoreInfoKHR
-