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(
229
229
&hBuffer->LastEventWritingToMemObj ));
230
230
}
231
231
232
- ScopedContext Active (Device);
233
-
234
232
// Use the default stream if copying from another device
235
233
UR_CHECK_ERROR (enqueueEventsWait (hQueue, HIPStream, numEventsInWaitList,
236
234
phEventWaitList));
237
235
236
+ // enqueueEventsWait may set a different context
237
+ ScopedContext Active (Device);
238
+
238
239
if (phEvent) {
239
240
RetImplEvent =
240
241
std::unique_ptr<ur_event_handle_t_>(ur_event_handle_t_::makeNative (
@@ -596,11 +597,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferReadRect(
596
597
&hBuffer->LastEventWritingToMemObj ));
597
598
}
598
599
599
- ScopedContext Active (Device);
600
-
601
600
UR_CHECK_ERROR (enqueueEventsWait (hQueue, HIPStream, numEventsInWaitList,
602
601
phEventWaitList));
603
602
603
+ // enqueueEventsWait may set a different context
604
+ ScopedContext Active (Device);
605
+
604
606
if (phEvent) {
605
607
RetImplEvent =
606
608
std::unique_ptr<ur_event_handle_t_>(ur_event_handle_t_::makeNative (
You can’t perform that action at this time.
0 commit comments