AMReX-Codes / amrex

AMReX: Software Framework for Block Structured AMR
https://amrex-codes.github.io/amrex
Other
506 stars 337 forks source link

amrex::tupleToArray #3880

Closed WeiqunZhang closed 3 months ago

WeiqunZhang commented 3 months ago

Add a utility function that can convert an amrex::GpuTuple whose types are the same to an array.

AlexanderSinn commented 3 months ago

Looks good! I think constexpr should be added to the functions. Possibly also AMREX_GPU_HOST_DEVICE but that would only make sense if it would return an amrex::GpuArray instead of std::array.

WeiqunZhang commented 3 months ago

Yes, constexpr should be added. As for having it return GpuArray, I thought about it, but wasn't entirely sure if we should do it. Thinking about it again, there is probably not much downside.