@@ -238,7 +238,7 @@ template <class Reducer> class combiner {
238
238
auto AtomicRef = sycl::atomic_ref<T, memory_order::relaxed,
239
239
getMemoryScope<Space>(), Space>(
240
240
address_space_cast<Space, access::decorated::no>(ReduVarPtr)[E]);
241
- Functor (AtomicRef, reducer->getElement (E));
241
+ Functor (std::move ( AtomicRef) , reducer->getElement (E));
242
242
}
243
243
}
244
244
@@ -258,7 +258,7 @@ template <class Reducer> class combiner {
258
258
IsPlus<_T, _BinaryOperation>::value>
259
259
atomic_combine (_T *ReduVarPtr) const {
260
260
atomic_combine_impl<Space>(
261
- ReduVarPtr, [](auto Ref, auto Val) { return Ref.fetch_add (Val); });
261
+ ReduVarPtr, [](auto && Ref, auto Val) { return Ref.fetch_add (Val); });
262
262
}
263
263
264
264
// / Atomic BITWISE OR operation: *ReduVarPtr |= MValue;
@@ -269,7 +269,7 @@ template <class Reducer> class combiner {
269
269
IsBitOR<_T, _BinaryOperation>::value>
270
270
atomic_combine (_T *ReduVarPtr) const {
271
271
atomic_combine_impl<Space>(
272
- ReduVarPtr, [](auto Ref, auto Val) { return Ref.fetch_or (Val); });
272
+ ReduVarPtr, [](auto && Ref, auto Val) { return Ref.fetch_or (Val); });
273
273
}
274
274
275
275
// / Atomic BITWISE XOR operation: *ReduVarPtr ^= MValue;
@@ -280,7 +280,7 @@ template <class Reducer> class combiner {
280
280
IsBitXOR<_T, _BinaryOperation>::value>
281
281
atomic_combine (_T *ReduVarPtr) const {
282
282
atomic_combine_impl<Space>(
283
- ReduVarPtr, [](auto Ref, auto Val) { return Ref.fetch_xor (Val); });
283
+ ReduVarPtr, [](auto && Ref, auto Val) { return Ref.fetch_xor (Val); });
284
284
}
285
285
286
286
// / Atomic BITWISE AND operation: *ReduVarPtr &= MValue;
@@ -293,7 +293,7 @@ template <class Reducer> class combiner {
293
293
Space == access::address_space::local_space)>
294
294
atomic_combine (_T *ReduVarPtr) const {
295
295
atomic_combine_impl<Space>(
296
- ReduVarPtr, [](auto Ref, auto Val) { return Ref.fetch_and (Val); });
296
+ ReduVarPtr, [](auto && Ref, auto Val) { return Ref.fetch_and (Val); });
297
297
}
298
298
299
299
// / Atomic MIN operation: *ReduVarPtr = sycl::minimum(*ReduVarPtr, MValue);
@@ -305,7 +305,7 @@ template <class Reducer> class combiner {
305
305
IsMinimum<_T, _BinaryOperation>::value>
306
306
atomic_combine (_T *ReduVarPtr) const {
307
307
atomic_combine_impl<Space>(
308
- ReduVarPtr, [](auto Ref, auto Val) { return Ref.fetch_min (Val); });
308
+ ReduVarPtr, [](auto && Ref, auto Val) { return Ref.fetch_min (Val); });
309
309
}
310
310
311
311
// / Atomic MAX operation: *ReduVarPtr = sycl::maximum(*ReduVarPtr, MValue);
@@ -317,7 +317,7 @@ template <class Reducer> class combiner {
317
317
IsMaximum<_T, _BinaryOperation>::value>
318
318
atomic_combine (_T *ReduVarPtr) const {
319
319
atomic_combine_impl<Space>(
320
- ReduVarPtr, [](auto Ref, auto Val) { return Ref.fetch_max (Val); });
320
+ ReduVarPtr, [](auto && Ref, auto Val) { return Ref.fetch_max (Val); });
321
321
}
322
322
};
323
323
} // namespace detail
0 commit comments