Skip to content

Commit

Permalink
CR-1167063 Fix hwqueue_handle::wait_command() API comment (#7609)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* fix windows build error

Signed-off-by: Soren Soe <[email protected]>

---------

Signed-off-by: Soren Soe <[email protected]>
  • Loading branch information
stsoe committed Jul 24, 2023
1 parent 925945d commit 7e731cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/runtime_src/core/common/api/hw_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,14 @@ class qds_device : public hw_queue_impl
{}

std::cv_status
wait(size_t timeout_ms) override
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 7e731cc

Please sign in to comment.