Top Description Fields Constructors Methods
org.lwjgl.opencl

public Class KHRSemaphore

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

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:

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:

Requires CL12.

Field Summary

Modifier and TypeField and Description
public static final int
CL_COMMAND_SEMAPHORE_SIGNAL_KHR

New return values from GetEventInfo when param_name is EVENT_COMMAND_TYPE.

public static final int
CL_COMMAND_SEMAPHORE_WAIT_KHR

New return values from GetEventInfo when param_name is EVENT_COMMAND_TYPE.

public static final int
CL_DEVICE_HANDLE_LIST_END_KHR

New attributes that can be passed as part of cl_semaphore_info_khr or cl_semaphore_properties_khr.

public static final int
CL_DEVICE_HANDLE_LIST_KHR

New attributes that can be passed as part of cl_semaphore_info_khr or cl_semaphore_properties_khr.

public static final int
CL_DEVICE_SEMAPHORE_TYPES_KHR

Accepted value for the param_name parameter to GetDeviceInfo to query the semaphore types supported by an OpenCL device.

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 param_name parameter to GetPlatformInfo to query the semaphore types supported by an OpenCL platform.

public static final int
CL_SEMAPHORE_CONTEXT_KHR

New attributes that can be passed as part of cl_semaphore_info_khr.

public static final int
CL_SEMAPHORE_PAYLOAD_KHR

New attributes that can be passed as part of cl_semaphore_info_khr.

public static final int
CL_SEMAPHORE_PROPERTIES_KHR

New attributes that can be passed as part of cl_semaphore_info_khr.

public static final int
CL_SEMAPHORE_REFERENCE_COUNT_KHR

New attributes that can be passed as part of cl_semaphore_info_khr.

public static final int
public static final int
CL_SEMAPHORE_TYPE_KHR

New attributes that can be passed as part of cl_semaphore_info_khr or cl_semaphore_properties_khr.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static long
clCreateSemaphoreWithPropertiesKHR(long context, LongBuffer sema_props, IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

public static long
clCreateSemaphoreWithPropertiesKHR(long context, long[] sema_props, int[] errcode_ret)

Array version of: CreateSemaphoreWithPropertiesKHR

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 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.
event_wait_list
,
PointerBuffer
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 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.
event
)

public static int
clEnqueueSignalSemaphoresKHR(long command_queue, PointerBuffer sema_objects, long[] sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event)

Array version of: EnqueueSignalSemaphoresKHR

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 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.
event_wait_list
,
PointerBuffer
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 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.
event
)

public static int
clEnqueueWaitSemaphoresKHR(long command_queue, PointerBuffer sema_objects, long[] sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event)

Array version of: EnqueueWaitSemaphoresKHR

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. If NULL, it is ignored.
param_value_size_ret
)

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. If NULL, it is ignored.
param_value_size_ret
)

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. If NULL, it is ignored.
param_value_size_ret
)

public static int
clGetSemaphoreInfoKHR(long sema_object, int param_name, int[] param_value, PointerBuffer param_value_size_ret)

Array version of: GetSemaphoreInfoKHR

public static int
clReleaseSemaphoreKHR(long sema_object)

public static int
clRetainSemaphoreKHR(long sema_object)

public static long
nclCreateSemaphoreWithPropertiesKHR(long context, long sema_props, long errcode_ret)

Unsafe version of: CreateSemaphoreWithPropertiesKHR

public static int
nclEnqueueSignalSemaphoresKHR(long command_queue, int num_sema_objects, long sema_objects, long sema_payload_list, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueSignalSemaphoresKHR

public static int
nclEnqueueWaitSemaphoresKHR(long command_queue, int num_sema_objects, long sema_objects, long sema_payload_list, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueWaitSemaphoresKHR

public static int
nclGetSemaphoreInfoKHR(long sema_object, int param_name, long
the size in bytes of memory pointed to by param_value. This size must be ≥ size of return type. If param_value is NULL, it is ignored.
param_value_size
,
long param_value, long param_value_size_ret)

Unsafe version of: GetSemaphoreInfoKHR

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CL_COMMAND_SEMAPHORE_SIGNAL_KHRback to summary
public static final int CL_COMMAND_SEMAPHORE_SIGNAL_KHR

New return values from GetEventInfo when param_name is EVENT_COMMAND_TYPE.

CL_COMMAND_SEMAPHORE_WAIT_KHRback to summary
public static final int CL_COMMAND_SEMAPHORE_WAIT_KHR

New return values from GetEventInfo when param_name is EVENT_COMMAND_TYPE.

CL_DEVICE_HANDLE_LIST_END_KHRback to summary
public static final int CL_DEVICE_HANDLE_LIST_END_KHR

New attributes that can be passed as part of cl_semaphore_info_khr or cl_semaphore_properties_khr.

CL_DEVICE_HANDLE_LIST_KHRback to summary
public static final int CL_DEVICE_HANDLE_LIST_KHR

New attributes that can be passed as part of cl_semaphore_info_khr or cl_semaphore_properties_khr.

CL_DEVICE_SEMAPHORE_TYPES_KHRback to summary
public static final int CL_DEVICE_SEMAPHORE_TYPES_KHR

Accepted value for the param_name parameter to GetDeviceInfo to query the semaphore types supported by an OpenCL device.

CL_INVALID_SEMAPHORE_KHRback 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_KHRback to summary
public static final int CL_PLATFORM_SEMAPHORE_TYPES_KHR

Accepted value for the param_name parameter to GetPlatformInfo to query the semaphore types supported by an OpenCL platform.

CL_SEMAPHORE_CONTEXT_KHRback to summary
public static final int CL_SEMAPHORE_CONTEXT_KHR

New attributes that can be passed as part of cl_semaphore_info_khr.

CL_SEMAPHORE_PAYLOAD_KHRback to summary
public static final int CL_SEMAPHORE_PAYLOAD_KHR

New attributes that can be passed as part of cl_semaphore_info_khr.

CL_SEMAPHORE_PROPERTIES_KHRback to summary
public static final int CL_SEMAPHORE_PROPERTIES_KHR

New attributes that can be passed as part of cl_semaphore_info_khr.

CL_SEMAPHORE_REFERENCE_COUNT_KHRback to summary
public static final int CL_SEMAPHORE_REFERENCE_COUNT_KHR

New attributes that can be passed as part of cl_semaphore_info_khr.

CL_SEMAPHORE_TYPE_BINARY_KHRback to summary
public static final int CL_SEMAPHORE_TYPE_BINARY_KHR

Semaphore types.

CL_SEMAPHORE_TYPE_KHRback to summary
public static final int CL_SEMAPHORE_TYPE_KHR

New attributes that can be passed as part of cl_semaphore_info_khr or cl_semaphore_properties_khr.

Constructor Detail

KHRSemaphoreback to summary
protected KHRSemaphore()

Method Detail

clCreateSemaphoreWithPropertiesKHRback to summary
public static long clCreateSemaphoreWithPropertiesKHR(long context, LongBuffer sema_props, IntBuffer errcode_ret)
Parameters
errcode_ret:IntBuffer

will return an appropriate error code. If errcode_ret is NULL, no error code is returned.

Annotations
@NativeType:cl_semaphore_khr
clCreateSemaphoreWithPropertiesKHRback to summary
public static long clCreateSemaphoreWithPropertiesKHR(long context, long[] sema_props, int[] errcode_ret)

Array version of: CreateSemaphoreWithPropertiesKHR

Annotations
@NativeType:cl_semaphore_khr
clEnqueueSignalSemaphoresKHRback to summary
public static int clEnqueueSignalSemaphoresKHR(long command_queue, PointerBuffer sema_objects, LongBuffer sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event)
Parameters
event_wait_list:PointerBuffer

a list of events that need to complete before this particular command can be executed. If 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.

event:PointerBuffer

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 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.

Annotations
@NativeType:cl_int
clEnqueueSignalSemaphoresKHRback 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: EnqueueSignalSemaphoresKHR

Annotations
@NativeType:cl_int
clEnqueueWaitSemaphoresKHRback to summary
public static int clEnqueueWaitSemaphoresKHR(long command_queue, PointerBuffer sema_objects, LongBuffer sema_payload_list, PointerBuffer event_wait_list, PointerBuffer event)
Parameters
event_wait_list:PointerBuffer

a list of events that need to complete before this particular command can be executed. If 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.

event:PointerBuffer

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 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.

Annotations
@NativeType:cl_int
clEnqueueWaitSemaphoresKHRback 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: EnqueueWaitSemaphoresKHR

Annotations
@NativeType:cl_int
clGetSemaphoreInfoKHRback to summary
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret)
Parameters
param_value_size_ret:PointerBuffer

the actual size in bytes of data being queried by param_value. If NULL, it is ignored.

Annotations
@NativeType:cl_int
clGetSemaphoreInfoKHRback to summary
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret)
Parameters
param_value_size_ret:PointerBuffer

the actual size in bytes of data being queried by param_value. If NULL, it is ignored.

Annotations
@NativeType:cl_int
clGetSemaphoreInfoKHRback to summary
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret)
Parameters
param_value_size_ret:PointerBuffer

the actual size in bytes of data being queried by param_value. If NULL, it is ignored.

Annotations
@NativeType:cl_int
clGetSemaphoreInfoKHRback to summary
public static int clGetSemaphoreInfoKHR(long sema_object, int param_name, int[] param_value, PointerBuffer param_value_size_ret)

Array version of: GetSemaphoreInfoKHR

Annotations
@NativeType:cl_int
clReleaseSemaphoreKHRback to summary
public static int clReleaseSemaphoreKHR(long sema_object)
Annotations
@NativeType:cl_int
clRetainSemaphoreKHRback to summary
public static int clRetainSemaphoreKHR(long sema_object)
Annotations
@NativeType:cl_int
nclCreateSemaphoreWithPropertiesKHRback to summary
public static long nclCreateSemaphoreWithPropertiesKHR(long context, long sema_props, long errcode_ret)

Unsafe version of: CreateSemaphoreWithPropertiesKHR

nclEnqueueSignalSemaphoresKHRback 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: EnqueueSignalSemaphoresKHR

Parameters
num_events_in_wait_list:int

the number of events in event_wait_list

nclEnqueueWaitSemaphoresKHRback 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: EnqueueWaitSemaphoresKHR

Parameters
num_events_in_wait_list:int

the number of events in event_wait_list

nclGetSemaphoreInfoKHRback 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: GetSemaphoreInfoKHR

Parameters
param_value_size:long

the size in bytes of memory pointed to by param_value. This size must be ≥ size of return type. If param_value is NULL, it is ignored.