Skip to content

Commit 1d7dbbd

Browse files
Hugh Delaneycallumfare
authored andcommitted
Get scopedcontext device from UR context
An event created with interop doesn't have an associated queue. So get an active device through the context.
1 parent 28261b1 commit 1d7dbbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/adapters/cuda/event.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventSetCallback(ur_event_handle_t,
219219
UR_APIEXPORT ur_result_t UR_APICALL
220220
urEventWait(uint32_t numEvents, const ur_event_handle_t *phEventWaitList) {
221221
try {
222-
ScopedContext Active(phEventWaitList[0]->getQueue()->getDevice());
222+
// Interop events don't have an associated queue, so get device through
223+
// context
224+
ScopedContext Active(phEventWaitList[0]->getContext()->getDevices()[0]);
223225

224226
auto WaitFunc = [](ur_event_handle_t Event) -> ur_result_t {
225227
UR_ASSERT(Event, UR_RESULT_ERROR_INVALID_EVENT);

0 commit comments

Comments
 (0)