Skip to content

Commit a12c4a4

Browse files
author
Jaime Arteaga
authored
[SYCL][UR][L0] Use auto & to avoid copies on missing loops (#10023)
Signed-off-by: Jaime Arteaga <[email protected]>
1 parent 1854b26 commit a12c4a4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier(
271271
if (Queue->Device->ImmCommandListUsed) {
272272
// If immediate command lists are being used, each will act as their own
273273
// queue, so we must insert a barrier into each.
274-
for (auto ImmCmdList : QueueGroup.second.ImmCmdLists)
274+
for (auto &ImmCmdList : QueueGroup.second.ImmCmdLists)
275275
if (ImmCmdList != Queue->CommandListMap.end())
276276
CmdLists.push_back(ImmCmdList);
277277
} else {

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_queue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ ur_result_t ur_queue_handle_t_::synchronize() {
13901390
for (auto &QueueMap : {ComputeQueueGroupsByTID, CopyQueueGroupsByTID}) {
13911391
for (auto &QueueGroup : QueueMap) {
13921392
if (Device->ImmCommandListUsed) {
1393-
for (auto ImmCmdList : QueueGroup.second.ImmCmdLists) {
1393+
for (auto &ImmCmdList : QueueGroup.second.ImmCmdLists) {
13941394
if (ImmCmdList == this->CommandListMap.end())
13951395
continue;
13961396
// Cleanup all events from the synced command list.
@@ -1406,7 +1406,7 @@ ur_result_t ur_queue_handle_t_::synchronize() {
14061406
for (auto &QueueMap : {ComputeQueueGroupsByTID, CopyQueueGroupsByTID}) {
14071407
for (auto &QueueGroup : QueueMap) {
14081408
if (Device->ImmCommandListUsed) {
1409-
for (auto ImmCmdList : QueueGroup.second.ImmCmdLists)
1409+
for (auto &ImmCmdList : QueueGroup.second.ImmCmdLists)
14101410
syncImmCmdList(this, ImmCmdList);
14111411
} else {
14121412
for (auto &ZeQueue : QueueGroup.second.ZeQueues)

0 commit comments

Comments
 (0)