[Mesa-dev] [PATCH] [RFC] clover: flush event queue when sequencing new event
Vedran Miletić
vedran at miletic.net
Mon Mar 13 19:46:14 UTC 2017
OpenMM holds events created during runtime in the queue and destroys
them at the end, which causes a stack overflow in nontrivial examples.
This patch forces flushing of the event queue and destruction of
events which are CL_COMPLETE.
I am pretty sure this isn't the nicest solution and probably not
performance optimal either. Should flushing be done elsewhere? If yes,
where?
P.S.
This patch also fixes cl/custom/r600-create-release-buffer-bug.c test
in Piglit, but I haven't looked into why exactly that happens.
---
src/gallium/state_trackers/clover/core/queue.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/state_trackers/clover/core/queue.cpp b/src/gallium/state_trackers/clover/core/queue.cpp
index c91b97a..7503eea 100644
--- a/src/gallium/state_trackers/clover/core/queue.cpp
+++ b/src/gallium/state_trackers/clover/core/queue.cpp
@@ -94,6 +94,8 @@ command_queue::profiling_enabled() const {
void
command_queue::sequence(hard_event &ev) {
+ flush();
+
std::lock_guard<std::mutex> lock(queued_events_mutex);
if (!queued_events.empty())
queued_events.back()().chain(ev);
--
2.9.3
More information about the mesa-dev
mailing list