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.

Hello @finlaystudent,
Thanks for your feedback, We were able to find a data-race in the code and it should be fixed now. Can you tell us if it works ?