From 35a6899da86fb261b3bf81fb3f62c6c23427a566 Mon Sep 17 00:00:00 2001 From: Hugh Delaney Date: Wed, 13 Mar 2024 16:01:52 +0000 Subject: [PATCH] Use context to get active device 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. --- source/adapters/hip/event.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/adapters/hip/event.cpp b/source/adapters/hip/event.cpp index 0af2ee02ab..7478c0e778 100644 --- a/source/adapters/hip/event.cpp +++ b/source/adapters/hip/event.cpp @@ -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);