Currently, a LLAMA View's iterator iterates through the MD-array by iterating the index space and passing those indices to the mapping function. This is inefficient for some mappings, like AoSoA or Bitpacked*. A better approach would be to provide two iteration schemes:
Use ArrayIndexRange to iterate the index space, and explicitely pass those indices to a view. This iterates with a fixed traversal, independent of the mapping
A view's iterators should be customizable by the mapping, and not give any guarantee on the iteration order. This way, mappings can provide more optimal iterations. Alternatively, a for_each primitive could be offered, which also allows for mapping aware iteration.
Currently, a LLAMA View's iterator iterates through the MD-array by iterating the index space and passing those indices to the mapping function. This is inefficient for some mappings, like AoSoA or Bitpacked*. A better approach would be to provide two iteration schemes:
ArrayIndexRange
to iterate the index space, and explicitely pass those indices to a view. This iterates with a fixed traversal, independent of the mappingfor_each
primitive could be offered, which also allows for mapping aware iteration.See also Bryce's talk on Multidimensional C++: https://youtu.be/aFCLmQEkPUw?t=1933