C Specification
To query information about a semaphore object, call the function
// Provided by cl_khr_semaphore
cl_int clGetSemaphoreInfoKHR(
cl_semaphore_khr sema_object,
cl_semaphore_info_khr param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
clGetSemaphoreInfoKHR is provided by the cl_khr_semaphore extension.
|
Parameters
-
sema_object specifies the semaphore object being queried.
-
param_name is a constant that specifies the semaphore information to query, and must be one of the values shown in the Semaphore Queries table.
-
param_value is a pointer to memory where the result of the query is returned as described in the Semaphore Queries table. If param_value is
NULL, it is ignored. -
param_value_size specifies the size in bytes of memory pointed to by param_value. This size must be greater than or equal to the size of the return type specified in the Semaphore Queries table. If param_value is
NULL, it is ignored. -
param_value_size_ret returns the actual size in bytes of data being queried by param_value. If param_value_size_ret is
NULL, it is ignored.
Description
| Semaphore Info | Return Type | Description |
|---|---|---|
|
|
Returns the context specified when the semaphore is created. |
|
|
Returns the semaphore reference count. |
|
|
Return the properties argument specified in clCreateSemaphoreWithPropertiesKHR. The implementation must return the values specified in the properties argument in the same order and without including additional properties. |
|
|
Returns the semaphore type. |
|
|
Returns the semaphore payload value.
For semaphores of type |
|
|
Returns the list of OpenCL devices the semaphore is associated with. |
|
|
Returns the list of external semaphore handle types that may be used for exporting. The size of this query may be 0 indicating that this semaphore does not support any handle types for exporting. |
|
|
Returns |
clGetSemaphoreInfoKHR returns CL_SUCCESS if the information is queried
successfully.
Otherwise, it returns one of the following errors:
-
CL_INVALID_if sema_object is not a valid semaphore.SEMAPHORE_ KHR -
CL_INVALID_if param_name is not one of the supported values, or if the size in bytes specified by param_value_size is less than size of the return type specified in the Semaphore Queries table and param_value is notVALUE NULL. -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
Document Notes
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.