diff --git a/sycl/source/backend.cpp b/sycl/source/backend.cpp index 24e0386c72f45..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,