-
Notifications
You must be signed in to change notification settings - Fork 797
Closed
Labels
bugSomething isn't workingSomething isn't workingconfirmedgood first issueGood for newcomersGood for newcomers
Description
SYCL 2020 explicitly deletes the following:
reducer(const reducer&) = delete;
reducer(reducer&&) = delete;
reducer& operator=(const reducer&) = delete;
reducer& operator=(reducer&&) = delete;
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++;
});
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingconfirmedgood first issueGood for newcomersGood for newcomers