From 7d002c91f7f6612af551cde7132e860ceea1dcff Mon Sep 17 00:00:00 2001 From: "Li, Ian" Date: Wed, 31 Jul 2024 13:24:45 -0700 Subject: [PATCH 1/2] Added missing &, as otherwise auto causes copy --- sycl/source/backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/backend.cpp b/sycl/source/backend.cpp index 24e0386c72f45..210aedd641b9a 100644 --- a/sycl/source/backend.cpp +++ b/sycl/source/backend.cpp @@ -102,7 +102,7 @@ __SYCL_EXPORT context make_context(ur_native_handle_t NativeHandle, Properties.stype = UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES; Properties.isNativeHandleOwned = false; std::vector DeviceHandles; - for (auto Dev : DeviceList) { + for (auto &Dev : DeviceList) { DeviceHandles.push_back(detail::getSyclObjImpl(Dev)->getHandleRef()); } Plugin->call(urContextCreateWithNativeHandle, NativeHandle, From 7aeb306614032e006eb281b6980fb4a355f5374a Mon Sep 17 00:00:00 2001 From: Ian Li Date: Tue, 6 Aug 2024 11:05:35 -0400 Subject: [PATCH 2/2] Add const quantifier Co-authored-by: Marcos Maronas --- sycl/source/backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/backend.cpp b/sycl/source/backend.cpp index 210aedd641b9a..1fd90609276f4 100644 --- a/sycl/source/backend.cpp +++ b/sycl/source/backend.cpp @@ -102,7 +102,7 @@ __SYCL_EXPORT context make_context(ur_native_handle_t NativeHandle, Properties.stype = UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES; Properties.isNativeHandleOwned = false; std::vector DeviceHandles; - for (auto &Dev : DeviceList) { + for (const auto &Dev : DeviceList) { DeviceHandles.push_back(detail::getSyclObjImpl(Dev)->getHandleRef()); } Plugin->call(urContextCreateWithNativeHandle, NativeHandle,