File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -229,12 +229,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferRead(
229229 &hBuffer->LastEventWritingToMemObj ));
230230 }
231231
232- ScopedContext Active (Device);
233-
234232 // Use the default stream if copying from another device
235233 UR_CHECK_ERROR (enqueueEventsWait (hQueue, HIPStream, numEventsInWaitList,
236234 phEventWaitList));
237235
236+ // enqueueEventsWait may set a different context
237+ ScopedContext Active (Device);
238+
238239 if (phEvent) {
239240 RetImplEvent =
240241 std::unique_ptr<ur_event_handle_t_>(ur_event_handle_t_::makeNative (
@@ -596,11 +597,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferReadRect(
596597 &hBuffer->LastEventWritingToMemObj ));
597598 }
598599
599- ScopedContext Active (Device);
600-
601600 UR_CHECK_ERROR (enqueueEventsWait (hQueue, HIPStream, numEventsInWaitList,
602601 phEventWaitList));
603602
603+ // enqueueEventsWait may set a different context
604+ ScopedContext Active (Device);
605+
604606 if (phEvent) {
605607 RetImplEvent =
606608 std::unique_ptr<ur_event_handle_t_>(ur_event_handle_t_::makeNative (
You can’t perform that action at this time.
0 commit comments