Fence#
oneAPI Level Zero Specification - Version 1.18.31
Fence Functions#
zeFenceCreate#
Added in version 1.0
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceCreate(ze_command_queue_handle_t hCommandQueue, const ze_fence_desc_t *desc, ze_fence_handle_t *phFence)#
Creates a fence for the command queue.
A fence is a heavyweight synchronization primitive used to communicate to the host that command list execution has completed.
The application must only use the fence for the command queue which was provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
Remark
Analogues
vkCreateFence
- Parameters:
hCommandQueue – [in] handle of command queue
desc – [in] pointer to fence descriptor
phFence – [out] pointer to handle of fence object created
- Returns:
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandQueue
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == descnullptr == phFence
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x1 < desc->flags
zeFenceDestroy#
Added in version 1.0
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceDestroy(ze_fence_handle_t hFence)#
Deletes a fence object.
The application must ensure the device is not currently referencing the fence before it is deleted.
The implementation of this function may immediately free all Host and Device allocations associated with this fence.
The application must not call this function from simultaneous threads with the same fence handle.
The implementation of this function must be thread-safe.
Remark
Analogues
vkDestroyFence
- Parameters:
hFence – [in][release] handle of fence object to destroy
- Returns:
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hFence
zeFenceHostSynchronize#
Added in version 1.0
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceHostSynchronize(ze_fence_handle_t hFence, uint64_t timeout)#
The current host thread waits on a fence to be signaled.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkWaitForFences
- Parameters:
hFence – [in] handle of the fence
timeout – [in] if non-zero, then indicates the maximum time (in nanoseconds) to yield before returning ZE_RESULT_SUCCESS or ZE_RESULT_NOT_READY; if zero, then operates exactly like zeFenceQueryStatus; if
UINT64_MAX, then function will not return until complete or device is lost. Due to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.
- Returns:
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hFence
timeout expired
zeFenceQueryStatus#
Added in version 1.0
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceQueryStatus(ze_fence_handle_t hFence)#
Queries a fence object’s status.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkGetFenceStatus
- Parameters:
hFence – [in] handle of the fence
- Returns:
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hFence
not signaled
zeFenceReset#
Added in version 1.0
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceReset(ze_fence_handle_t hFence)#
Reset a fence back to the not signaled state.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkResetFences
- Parameters:
hFence – [in] handle of the fence
- Returns:
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hFence
Fence Enums#
ze_fence_flags_t#
Added in version 1.0
Fence Structures#
ze_fence_desc_t#
Added in version 1.0
-
struct ze_fence_desc_t#
Fence descriptor.
Public Members
-
ze_structure_type_t stype#
[in] type of this structure
-
const void *pNext#
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
-
ze_fence_flags_t flags#
[in] creation flags. must be 0 (default) or a valid combination of ze_fence_flag_t.
-
ze_structure_type_t stype#