Package org.lwjgl.opencl
Class KHRSemaphore
- java.lang.Object
-
- org.lwjgl.opencl.KHRSemaphore
-
public class KHRSemaphore extends java.lang.ObjectNative bindings to the khr_semaphore extension.OpenCL provides
cl_eventas 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
Fields Modifier and Type Field Description static intCL_COMMAND_SEMAPHORE_SIGNAL_KHR
CL_COMMAND_SEMAPHORE_WAIT_KHRstatic intCL_DEVICE_HANDLE_LIST_END_KHR
CL_DEVICE_HANDLE_LIST_KHRNew attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr.static intCL_DEVICE_SEMAPHORE_TYPES_KHRAccepted value for theparam_nameparameter toGetDeviceInfoto query the semaphore types supported by an OpenCL device.static intCL_INVALID_SEMAPHORE_KHRThe following error codes can be returned by APIs introduced as part of this specification or the specifications that depend on this.static intCL_PLATFORM_SEMAPHORE_TYPES_KHRAccepted value for theparam_nameparameter toGetPlatformInfoto query the semaphore types supported by an OpenCL platform.static intCL_SEMAPHORE_CONTEXT_KHR
CL_SEMAPHORE_PAYLOAD_KHR
CL_SEMAPHORE_PROPERTIES_KHR
CL_SEMAPHORE_REFERENCE_COUNT_KHRNew attributes that can be passed as part ofcl_semaphore_info_khr.static intCL_SEMAPHORE_TYPE_BINARY_KHRSemaphore types.static intCL_SEMAPHORE_TYPE_KHRNew attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longclCreateSemaphoreWithPropertiesKHR(long context, long[] sema_props, int[] errcode_ret)Array version of:CreateSemaphoreWithPropertiesKHRstatic longclCreateSemaphoreWithPropertiesKHR(long context, java.nio.LongBuffer sema_props, java.nio.IntBuffer errcode_ret)static intclEnqueueSignalSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, long[] sema_payload_list, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)Array version of:EnqueueSignalSemaphoresKHRstatic intclEnqueueSignalSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, java.nio.LongBuffer sema_payload_list, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)static intclEnqueueWaitSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, long[] sema_payload_list, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)Array version of:EnqueueWaitSemaphoresKHRstatic intclEnqueueWaitSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, java.nio.LongBuffer sema_payload_list, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)static intclGetSemaphoreInfoKHR(long sema_object, int param_name, int[] param_value, org.lwjgl.PointerBuffer param_value_size_ret)Array version of:GetSemaphoreInfoKHRstatic intclGetSemaphoreInfoKHR(long sema_object, int param_name, java.nio.ByteBuffer param_value, org.lwjgl.PointerBuffer param_value_size_ret)static intclGetSemaphoreInfoKHR(long sema_object, int param_name, java.nio.IntBuffer param_value, org.lwjgl.PointerBuffer param_value_size_ret)static intclGetSemaphoreInfoKHR(long sema_object, int param_name, org.lwjgl.PointerBuffer param_value, 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 Detail
-
CL_PLATFORM_SEMAPHORE_TYPES_KHR
Accepted value for theparam_nameparameter toGetPlatformInfoto query the semaphore types supported by an OpenCL platform.
-
CL_DEVICE_SEMAPHORE_TYPES_KHR
Accepted value for theparam_nameparameter toGetDeviceInfoto query the semaphore types supported by an OpenCL device.
-
CL_SEMAPHORE_TYPE_BINARY_KHR
Semaphore types.
-
CL_SEMAPHORE_CONTEXT_KHR, CL_SEMAPHORE_REFERENCE_COUNT_KHR, CL_SEMAPHORE_PROPERTIES_KHR, CL_SEMAPHORE_PAYLOAD_KHR
New attributes that can be passed as part ofcl_semaphore_info_khr.
-
CL_SEMAPHORE_TYPE_KHR, CL_DEVICE_HANDLE_LIST_KHR, CL_DEVICE_HANDLE_LIST_END_KHR
New attributes that can be passed as part ofcl_semaphore_info_khrorcl_semaphore_properties_khr.
-
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.
-
-
Method Detail
-
nclCreateSemaphoreWithPropertiesKHR
public static long nclCreateSemaphoreWithPropertiesKHR(long context, long sema_props, long errcode_ret)Unsafe version of:CreateSemaphoreWithPropertiesKHR
-
clCreateSemaphoreWithPropertiesKHR
public static long clCreateSemaphoreWithPropertiesKHR(long context, java.nio.LongBuffer sema_props, @Nullable java.nio.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 java.nio.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, java.nio.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 java.nio.ByteBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, @Nullable java.nio.IntBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) 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, @Nullable int[] errcode_ret)Array version of:CreateSemaphoreWithPropertiesKHR
-
clEnqueueWaitSemaphoresKHR
public static int clEnqueueWaitSemaphoresKHR(long command_queue, org.lwjgl.PointerBuffer sema_objects, @Nullable long[] 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, @Nullable int[] param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret)Array version of:GetSemaphoreInfoKHR
-
-