Data race in SYCL Guide code

I’ve been trying to write a sum function in SYCL, so I took a look at the example given here
I believe there is a data race occuring in the full code since it doesn’t always give the correct sum. I guess there is no guarantee the work groups will work on the data at the start of the array first, so a partial sum could already be written to the buffer, and then read by another work group.

I thought I should flag it so others don’t get confused.


Hi Finlay, thanks for reporting this. We will take a look and see if we need to make some adjustments to the code.