CExA-project / ddc

DDC is a discrete domain computation library.
https://ddc.mdls.fr
Other
33 stars 5 forks source link

Dimension reordering operator #554

Open EmilyBourne opened 4 months ago

EmilyBourne commented 4 months ago

It would be nice to have an operator/constructor in DDC which can reorder dimensions. This is a kind of transpose operator. E.g. build ddc::Chunk<double, ddc::DiscreteDimension<DimX, DimY>> from ddc::Chunk<double, ddc::DiscreteDimension<DimY, DimX>>

Ideally such an operator would use blocking to be efficient.

If the operator is added the functions create_transpose_mirror_view_and_copy and create_transpose_mirror_view should also be implemented

blegouix commented 4 months ago

Maybe there are some ideas to take from https://github.com/CExA-project/ddc/pull/511/files#diff-a120a1119000f5d36cb8a669f09e5b36ac36fdea28981ae6ae5f034f60e3801dR900

But Kokkos::deep_copy relies only on CudaMemcpy1d, so maybe not the most efficient.