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 committed Mar 13, 2024
1 parent cc268e5 commit 3d3407a
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 @@ -192,7 +192,7 @@ urEventWait(uint32_t numEvents, const ur_event_handle_t *phEventWaitList) {
try {

auto Context = phEventWaitList[0]->getContext();
ScopedContext Active(phEventWaitList[0]->getDevice());
ScopedContext Active(Context->getDevices()[0]);

auto WaitFunc = [Context](ur_event_handle_t Event) -> ur_result_t {
UR_ASSERT(Event, UR_RESULT_ERROR_INVALID_EVENT);
Expand Down

0 comments on commit 3d3407a

Please sign in to comment.