[Mesa-dev] [PATCH 2/2] st/clover: Always flush the queue when waiting on an hard_event

Niels Ole Salscheider niels_ole at salscheider-online.de
Fri Sep 6 08:07:49 PDT 2013


The OpenCL spec says:
"Any blocking commands queued in a command-queue and clReleaseCommandQueue
perform an implicit flush of the command-queue. These blocking commands are
[...] or clWaitForEvents."

Flushing the queue unconditionally also helps to actually clear the
queued_events list of the queue object.

Signed-off-by: Niels Ole Salscheider <niels_ole at salscheider-online.de>
---
 src/gallium/state_trackers/clover/core/event.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/clover/core/event.cpp b/src/gallium/state_trackers/clover/core/event.cpp
index cbb97bf..8b5acd0 100644
--- a/src/gallium/state_trackers/clover/core/event.cpp
+++ b/src/gallium/state_trackers/clover/core/event.cpp
@@ -153,8 +153,7 @@ void
 hard_event::wait() const {
    pipe_screen *screen = queue()->dev.pipe;
 
-   if (status() == CL_QUEUED)
-      queue()->flush();
+   queue()->flush();
 
    if (!__fence ||
        !screen->fence_finish(screen, __fence, PIPE_TIMEOUT_INFINITE))
-- 
1.8.4



More information about the mesa-dev mailing list