Skip to content

Commit 35a6899

Browse files
Hugh Delaneykbenzie
authored andcommitted
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.
1 parent 68e525a commit 35a6899

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/adapters/hip/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ urEventWait(uint32_t numEvents, const ur_event_handle_t *phEventWaitList) {
190190
UR_ASSERT(numEvents > 0, UR_RESULT_ERROR_INVALID_VALUE);
191191

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

0 commit comments

Comments
 (0)