I am on the way to remove the last usage of __shared__ in PMacc.
I found that CUSTL is using the wrong index order to allocate N-dimensional shared memory.
CUSTL is using int mem[x][y][z]; but it must be int mem[z][y][x]; link to the code
Maybe it breaks nothing because later on the array is handled as 1-dimensional array and the plain data size is in both cases equal.
Currently it is not clear if this can have any side effects, never the less I marked this as BUG and that this effects the latest release.
Well spotted, here is one usage in the phasespace plugin that I am aware of.
In my opinion this is not a bug because the order of dimensions at instantiation is not relevant for the access pattern. Plus, the amount of allocated memory is the same.
If the current case doesn't look well to you, I'd propose to make it more explicit: int mem[x*y*z];
Yes I am currently flat out this shared memory and the same in PMacc::memory. We always touch the memory with own memory calculations, therefore we should use a flat memory storage.
fixed with #1929
Most helpful comment
Yes I am currently flat out this shared memory and the same in
PMacc::memory. We always touch the memory with own memory calculations, therefore we should use a flat memory storage.