You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are deleted to prevent mistakes. For example, the code below currently compiles with DPC++ but produces the wrong answer, because the lambda is passed a private copy of the reducer argument. The code is only correct if the final parameter is declared as auto& reducer.
q.parallel_for(sycl::range<1>{N}, sycl::reduction(sum, sycl::plus<>), [=](sycl::id<1>, auto reducer) {
reducer++;
});
The text was updated successfully, but these errors were encountered:
According to the SYCL 2020 specification, the reducer class should be
neither moveable nor copyable. This commit deletes these constructors
and assignment operators.
Fixes#6065
---------
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
SYCL 2020 explicitly deletes the following:
These are deleted to prevent mistakes. For example, the code below currently compiles with DPC++ but produces the wrong answer, because the lambda is passed a private copy of the
reducer
argument. The code is only correct if the final parameter is declared asauto& reducer
.The text was updated successfully, but these errors were encountered: