Skip to content

Commit

Permalink
[SYCL][NFC] Fix auto-causes-copy Coverity hits (#14771)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-semenov authored Jul 26, 2024
1 parent 847f4dd commit e4ad627
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sycl/include/sycl/ext/oneapi/backend/level_zero.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ inline std::optional<sycl::device> find_matching_descendent_device(
auto sub_devices = d.create_sub_devices<
info::partition_property::partition_by_affinity_domain>(
info::partition_affinity_domain::next_partitionable);
for (auto sub_dev : sub_devices) {
for (auto &sub_dev : sub_devices) {
if (auto maybe_device =
find_matching_descendent_device(sub_dev, BackendObject))
return maybe_device;
Expand Down Expand Up @@ -111,11 +111,11 @@ template <>
inline device make_device<backend::ext_oneapi_level_zero>(
const backend_input_t<backend::ext_oneapi_level_zero, device>
&BackendObject) {
for (auto p : platform::get_platforms()) {
for (auto &p : platform::get_platforms()) {
if (p.get_backend() != backend::ext_oneapi_level_zero)
continue;

for (auto d : p.get_devices()) {
for (auto &d : p.get_devices()) {
if (auto maybe_device = find_matching_descendent_device(d, BackendObject))
return *maybe_device;
}
Expand Down

0 comments on commit e4ad627

Please sign in to comment.