From 507f5a39f024823212cb1301032399b4c4ae4cb9 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Tue, 3 Sep 2024 10:17:18 -0700 Subject: [PATCH] clarify no implicit dependencies when waiting on or signaling semaphores (#1231) --- api/opencl_runtime_layer.asciidoc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/api/opencl_runtime_layer.asciidoc b/api/opencl_runtime_layer.asciidoc index 276b56d2..feb7c88c 100644 --- a/api/opencl_runtime_layer.asciidoc +++ b/api/opencl_runtime_layer.asciidoc @@ -13266,6 +13266,16 @@ events in _event_wait_list_ when {clEnqueueWaitSemaphoresKHR} returns. Waiting on the same binary semaphore twice without an interleaving signal may lead to undefined behavior. +[NOTE] +==== +When _command_queue_ is an out-of-order command-queue there are no implicit +dependencies between the semaphore wait command and commands enqueued into the +command-queue after the semaphore wait command. +If such dependencies are required, applications may enqueue a command-queue +barrier after the semaphore wait command, to explicitly add dependencies between +the semaphore wait command and subsequent commands. +==== + // refError {clEnqueueWaitSemaphoresKHR} returns {CL_SUCCESS} if the function is @@ -13355,6 +13365,16 @@ events in _event_wait_list_ when {clEnqueueSignalSemaphoresKHR} returns. Signaling the same binary semaphore twice without an interleaving wait may lead to undefined behavior. +[NOTE] +==== +When _command_queue_ is an out-of-order command-queue there are no implicit +dependencies between commands enqueued into the command-queue before the +semaphore signal command and the semaphore signal command. +If such dependencies are required, applications may enqueue a command-queue +barrier before the semaphore signal command, to explicitly add dependencies between +the preceding commands and the semaphore signal command. +==== + // refError {clEnqueueSignalSemaphoresKHR} returns {CL_SUCCESS} if the function is