Skip to content

Commit 6032f6f

Browse files
authored
Merge pull request intel#1259 from igchor/fix_sync
[L0] do not ignore returned values from zeHostSynchronize
2 parents 92f44da + f9ad3d4 commit 6032f6f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

source/adapters/level_zero/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWait(
108108
/* IsInternal */ false));
109109
}
110110

111-
Queue->synchronize();
111+
UR_CALL(Queue->synchronize());
112112

113113
if (OutEvent) {
114114
Queue->LastCommandEvent = reinterpret_cast<ur_event_handle_t>(*OutEvent);

source/adapters/level_zero/queue.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueRelease(
438438
return Res;
439439

440440
// Make sure all commands get executed.
441-
Queue->synchronize();
441+
UR_CALL(Queue->synchronize());
442442

443443
// Destroy all the fences created associated with this queue.
444444
for (auto it = Queue->CommandListMap.begin();
@@ -654,7 +654,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueFinish(
654654
// Lock automatically releases when this goes out of scope.
655655
std::scoped_lock<ur_shared_mutex> Lock(UrQueue->Mutex);
656656

657-
UrQueue->synchronize();
657+
UR_CALL(UrQueue->synchronize());
658658
} else {
659659
std::unique_lock<ur_shared_mutex> Lock(UrQueue->Mutex);
660660
std::vector<ze_command_queue_handle_t> ZeQueues;
@@ -1241,7 +1241,7 @@ ur_queue_handle_t_::executeCommandList(ur_command_list_ptr_t CommandList,
12411241
// Check global control to make every command blocking for debugging.
12421242
if (IsBlocking || (UrL0Serialize & UrL0SerializeBlock) != 0) {
12431243
if (UsingImmCmdLists) {
1244-
synchronize();
1244+
UR_CALL(synchronize());
12451245
} else {
12461246
// Wait until command lists attached to the command queue are executed.
12471247
ZE2UR_CALL(zeHostSynchronize, (ZeCommandQueue));
@@ -1445,7 +1445,7 @@ ur_result_t ur_queue_handle_t_::synchronize() {
14451445
for (auto &QueueGroup : QueueMap) {
14461446
if (UsingImmCmdLists) {
14471447
for (auto &ImmCmdList : QueueGroup.second.ImmCmdLists)
1448-
syncImmCmdList(this, ImmCmdList);
1448+
UR_CALL(syncImmCmdList(this, ImmCmdList));
14491449
} else {
14501450
for (auto &ZeQueue : QueueGroup.second.ZeQueues)
14511451
if (ZeQueue)

source/adapters/level_zero/queue.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ struct ur_queue_handle_t_ : _ur_object {
408408
bool isImmediateSubmission() const;
409409

410410
// Wait for all commandlists associated with this Queue to finish operations.
411-
ur_result_t synchronize();
411+
[[nodiscard]] ur_result_t synchronize();
412412

413413
// Get event from the queue's cache.
414414
// Returns nullptr if the cache doesn't contain any reusable events or if the

0 commit comments

Comments
 (0)