mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
The following tests create an OpenCL semaphore using (fd == -1) then call `clEnqueueSignalSemaphoresKHR` on that semaphore. (fd == -1) refers to an object that has already signaled and enqueueing a signal command on it will lead to undefined behavior. Quoting OpenCL specification: ``` The special value -1 for fd is treated like a valid sync file descriptor referring to an object that has already signaled. ``` And ``` Signaling the same binary semaphore twice without an interleaving wait may lead to undefined behavior. ``` - external_semaphores_simple_1 - external_semaphores_reuse - external_semaphores_cross_queues_ooo - external_semaphores_cross_queues_io - external_semaphores_cross_queues_io2 This commit changes the tests to avoid signaling an already signaled semaphore and correctly re-import the semaphore's fd after enqueueing a wait successfully. Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com> Co-authored-by: Michael Rizkalla <michael.rizkalla@arm.com>