Skip to content

Conversation

@EwanC
Copy link
Contributor

@EwanC EwanC commented Jan 16, 2026

This PR tries to resolve the issue highlighted in #326 where the "Coalesced Global Memory" exercise README was asking a user to manually calculate a linear id that would be used to index memory.

However, the exercise code itself uses 2d buffers/accessors which are indexed with a sycl::id<2> rather than a size_t. So the current exercise request doesn't make sense, or could only be achieved with modifications beyond what is reasonably expected for a beginner.

Instead, I've updated the README to state the usage of the 2d buffer/accessors and ask the user to experiment with flipping the dimension indexes, as this is the only difference between this exercise solution, and the solution from the previous lesson

$ diff Code_Exercises/Coalesced_Global_Memory/solution.cpp Code_Exercises/Image_Convolution/reference.cpp
59a60
>
77a79
>                     globalId = sycl::id{globalId[1], globalId[0]};

This PR tries to resolve the issue highlighted in
KhronosGroup#326
where the "Coalesced Global Memory" exercise README was
asking a user to manually calculate a linear id that
would be used to index memory. However, the exercise
code itself uses 2d buffers/accessors which are
indexed with a `sycl::id<2>`. So the current exercise
request doesn't make sense, or could only be achieved with
modifications beyond what is reasonably expected for a beginner.

Instead, I've updated the README to state the usage
of the 2d buffer/accessors and ask the user to experiment
with flipping the dimension indexes, as this is the only
difference between this exercise solution, and the
solution from the previous lesson

```sh
$ diff Code_Exercises/Coalesced_Global_Memory/solution.cpp Code_Exercises/Image_Convolution/reference.cpp
59a60
>
77a79
>                     globalId = sycl::id{globalId[1], globalId[0]};
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant