Skip to content

Commit

Permalink
CR-1167063 Fix hwqueue_handle::wait_command() API comment
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stsoe committed Jun 30, 2023
1 parent ca4279a commit 12c1a0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/runtime_src/core/common/api/hw_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(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
Expand Down
3 changes: 0 additions & 3 deletions src/runtime_src/core/common/shim/hwqueue_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 12c1a0e

Please sign in to comment.