C Specification
To re-import a handle of type CL_SEMAPHORE_ into an
existing semaphore, call the function:
// Provided by cl_khr_external_semaphore_sync_fd
cl_int clReImportSemaphoreSyncFdKHR(
cl_semaphore_khr sema_object,
cl_semaphore_reimport_properties_khr* reimport_props,
int fd);
Parameters
-
sema_object specifies a valid semaphore object with importable properties.
-
reimport_props is an optional list of properties that affect the re-import behavior. The list is terminated with the special property
0. If no properties are required, reimport_props may beNULL. This extension does not define any optional properties. -
fd specifies an external file descriptor handle to import
Description
Calling clReImportSemaphoreSyncFdKHR is equivalent to destroying
sema_object and re-creating it with the original sema_props from
clCreateSemaphoreWithPropertiesKHR, except a handle specified by fd will
be imported.
The semaphore sema_object must have originally imported an external handle
of type CL_SEMAPHORE_.
clReImportSemaphoreSyncFdKHR returns CL_SUCCESS if the semaphore
handle is re-imported successfully.
Otherwise, it returns one of the following errors:
-
CL_INVALID_SEMAPHORE_ KHR -
if sema_object is not a valid semaphore
-
-
CL_INVALID_if aSEMAPHORE_ KHR CL_SEMAPHORE_handle was not imported when sema_object was created.HANDLE_ SYNC_ FD_ KHR -
CL_INVALID_if fd is invalid.VALUE -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES
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.