Hi @MasterSkepticista,
I’m glad you were able to resolve this, and thanks for creating the StackOverflow question.
To answer your earlier questions, non-contiguous data is not supported by SYCL buffers because the SYCL runtime needs to be able to marshal the data between the host and device memory regions, and it cannot deduce the data layout within host memory if it’s non-contiguous.
SYCL encourages contiguous data as it’s generally much less efficient to copy data if it involves pointer indirections and multiple distinct copies, having fragmented can also make it difficult to achieve pinned memory and other such optimizations. Additionally, once in device memory such as on a GPU having data fragmented rather than contiguous can also interfere with common optimizations such as ensuring coalesced global memory access.
In terms of how best to represent these data structures in C++, I would recommend as you’ve done, using a std::vector where the multi-dimensionality is linearized into a single linear allocation. Unfortunately, C++ does not yet have a way to represent data in a multi-dimensional space, though this is in the works in the form of std::md_span, as @keryell1 mentioned.
I hope this helps.
Gordon