work_group_reduce documentation typo?

Hey

I was reading the documentation of the work_group_reduce function (work_group_reduce).

“For the example above, let’s assume that the work-group size is 8 and p points to the following elements [3 1 7 0 4 1 6 3]. Work-item 0 calls work_group_scan_inclusive_add with 3 and returns 3. Work-item 1 calls work_group_scan_inclusive_add with 1 and returns 4. The full set of values returned by work_group_scan_inclusive_add for work-items 0 … 7 are [3 4 11 11 14 16 22 25].”

According to the documentation the result is [3 4 11 11 14 16 22 25] but shouldn’t it be [3 4 11 11 15 16 22 25]? Is this just a small typo or am I not getting this correctly?

Cheers

Yes this is a typo in the documentation. If you check the OpenCL C specification, the description is correct:
https://www.khronos.org/registry/cl/specs/opencl-2.0-openclc.pdf