Skip to content

Commit

Permalink
CR-1217444 Callback on xrt::run causes "kds monitor died" and hang (#…
Browse files Browse the repository at this point in the history
…8562)

Trap unsupposed managed execution earlier.

We don't plan on supporting callbacks for xrt::run objects for
RyzenAI.  This would kill performance.  Callbacks are used under the
hood in the OpenCL implementation and are indeed supported for XRT
native APIs on Alveo, but not for RyzenAI

This PR changes code such that an exception is thrown when an xrt::run
object is started after adding a callback on the run object.

Signed-off-by: Soren Soe <[email protected]>
  • Loading branch information
stsoe authored Nov 26, 2024
1 parent 3d6e914 commit dc1eea8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/runtime_src/core/common/api/hw_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class hw_queue_impl : public command_manager::executor

// Managed start uses command manager for monitoring command
// completion
void
virtual void
managed_start(xrt_core::command* cmd)
{
get_cmd_manager()->launch(cmd);
Expand Down Expand Up @@ -440,6 +440,16 @@ class qds_device : public hw_queue_impl
, m_qhdl(qhdl)
{}

// Managed start is invoked when application has added a callback
// function for notification of command completion. This is not
// supported for platforms that implement hwqueue_handle (see
// details in wait(size_t) comments.
void
managed_start(xrt_core::command*) override
{
throw std::runtime_error("Managed execution is not supported for this device");
}

std::cv_status
wait(size_t /*timeout_ms*/) override
{
Expand Down

0 comments on commit dc1eea8

Please sign in to comment.