From 12c1a0ebb7a65befe74f9ccaaff36024c7463f62 Mon Sep 17 00:00:00 2001 From: Soren Soe <2106410+stsoe@users.noreply.github.com> Date: Fri, 30 Jun 2023 09:36:05 -0700 Subject: [PATCH] CR-1167063 Fix hwqueue_handle::wait_command() API comment Remove comment about cmd nullptr waiting for any command to complete. Throw if nullptr is passed. This means that OpenCL is not supported with platforms that implement hwqueue. If OpenCL support is needed, the command monitor needs to track order of submitted commands and wait on first submitted command before checking status of all running commands. Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com> --- src/runtime_src/core/common/api/hw_queue.cpp | 9 ++++++--- src/runtime_src/core/common/shim/hwqueue_handle.h | 3 --- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/runtime_src/core/common/api/hw_queue.cpp b/src/runtime_src/core/common/api/hw_queue.cpp index 5b6bea81e38..489efff7350 100644 --- a/src/runtime_src/core/common/api/hw_queue.cpp +++ b/src/runtime_src/core/common/api/hw_queue.cpp @@ -401,9 +401,12 @@ class qds_device : public hw_queue_impl std::cv_status wait(size_t timeout_ms) override { - return m_qhdl->wait_command(nullptr, static_cast(timeout_ms)) - ? std::cv_status::no_timeout - : std::cv_status::timeout; + // OpenCL uses this function, but it is not implemented for + // platforms that implement hwqueue_handle. Rework this if OpenCL + // needs to support shim hw queues. Probably use a combination of + // counters or cached commands, or change command monitor to track + // order of submitted commands. + throw std::runtime_error("qds_device::wait() not implemented"); } std::cv_status diff --git a/src/runtime_src/core/common/shim/hwqueue_handle.h b/src/runtime_src/core/common/shim/hwqueue_handle.h index 5d2c55035ce..6cdbb97aaba 100644 --- a/src/runtime_src/core/common/shim/hwqueue_handle.h +++ b/src/runtime_src/core/common/shim/hwqueue_handle.h @@ -33,9 +33,6 @@ class hwqueue_handle // @cmd Handle to command to wait for // @timeout_ms Timout in ms, 0 implies infinite wait. // @return 0 indicates timeout, anything else indicates completion - // - // If cmd buffer handle is nullptr, then this function is supposed to wait - // until any command completes execution. virtual int wait_command(buffer_handle* cmd, uint32_t timeout_ms) const = 0;