@@ -86,7 +86,7 @@ CL_API_ENTRY void *CL_API_CALL clHostMemAllocINTEL(
86
86
// lot, this guarantees that the alignment will work for all devices. If the
87
87
// min alignment of one device is greater that the max alignment of another,
88
88
// an error will be generated during allocation.
89
- for (const auto dev : devices) {
89
+ for (const auto & dev : devices) {
90
90
alignment = std::max<cl_uint>(alignment,
91
91
(cl_uint)dev->def .min_host_mem_alignment );
92
92
same_device &= dev->def .autodiscovery_def .name ==
@@ -119,7 +119,7 @@ CL_API_ENTRY void *CL_API_CALL clHostMemAllocINTEL(
119
119
properties += 2 ;
120
120
}
121
121
122
- for (const auto dev : devices) {
122
+ for (const auto & dev : devices) {
123
123
if (!acl_usm_has_access_capability (dev,
124
124
CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL)) {
125
125
BAIL_INFO (
@@ -355,7 +355,7 @@ clSharedMemAllocINTEL(cl_context context, cl_device_id device,
355
355
devices = std::vector<cl_device_id>(context->device ,
356
356
context->device + context->num_devices );
357
357
}
358
- for (const auto dev : devices) {
358
+ for (const auto & dev : devices) {
359
359
if (!acl_usm_has_access_capability (
360
360
dev, CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL)) {
361
361
BAIL_INFO (
@@ -1202,7 +1202,7 @@ void l_cl_mem_blocking_free(cl_context context, void *ptr) {
1202
1202
for (int i = 0 ; i < num_command_queues; i++) {
1203
1203
cl_command_queue current_cq = context->command_queue [i];
1204
1204
// check events in commands
1205
- for (auto event : current_cq->commands ) {
1205
+ for (const auto & event : current_cq->commands ) {
1206
1206
if (event->execution_status != CL_COMPLETE) {
1207
1207
// check if ptr is used by kernels when we submit to queue
1208
1208
if (event->ptr_hashtable .find (ptr) != event->ptr_hashtable .end ()) {
@@ -1223,7 +1223,7 @@ void l_cl_mem_blocking_free(cl_context context, void *ptr) {
1223
1223
}
1224
1224
}
1225
1225
// check events in inorder commands
1226
- for (auto event : current_cq->inorder_commands ) {
1226
+ for (const auto & event : current_cq->inorder_commands ) {
1227
1227
if (event->execution_status != CL_COMPLETE) {
1228
1228
// check if ptr is used by kernels when we submit to queue
1229
1229
if (event->ptr_hashtable .find (ptr) != event->ptr_hashtable .end ()) {
0 commit comments