Skip to content

Commit

Permalink
Use context to get active device
Browse files Browse the repository at this point in the history
An event made with a native handle will not have an initialized queue. So it is better
to get the scoped context device through the context, which is always guaranteed to
be initialized.
  • Loading branch information
hdelan authored and kbenzie committed Apr 12, 2024
1 parent 68e525a commit 35a6899
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/adapters/hip/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ urEventWait(uint32_t numEvents, const ur_event_handle_t *phEventWaitList) {
UR_ASSERT(numEvents > 0, UR_RESULT_ERROR_INVALID_VALUE);

try {
ScopedContext Active(phEventWaitList[0]->getDevice());
ScopedContext Active(phEventWaitList[0]->getContext()->getDevices()[0]);
auto WaitFunc = [](ur_event_handle_t Event) -> ur_result_t {
UR_ASSERT(Event, UR_RESULT_ERROR_INVALID_EVENT);

Expand Down

0 comments on commit 35a6899

Please sign in to comment.