Skip to content
Snippets Groups Projects
Commit 9d11577f authored by Frederik Hennig's avatar Frederik Hennig
Browse files

fix SYCL order of dimensions

parent 8687cd94
No related branches found
No related tags found
1 merge request!384Fundamental GPU Support
Pipeline #67502 passed
......@@ -101,7 +101,13 @@ class SyclPlatform(GenericGpu):
indexing_decls = [id_decl]
conds = []
for i, dim in enumerate(dimensions[::-1]):
# Other than in CUDA, SYCL ids are linearized in C order
# The leftmost entry of an ID varies slowest, and the rightmost entry varies fastest
# See https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:multi-dim-linearization
for i, dim in enumerate(dimensions):
# Slowest to fastest
coord = PsExpression.make(PsConstant(i, self._ctx.index_dtype))
work_item_idx = PsSubscript(id_symbol, coord)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment