parthenon-hpc-lab / parthenon

Parthenon AMR infrastructure
https://parthenon-hpc-lab.github.io/parthenon/
Other
105 stars 33 forks source link

Enable `parthenon::par_reduce` for MD loops with Kokkos 1D Range #1130

Closed acreyes closed 3 days ago

acreyes commented 1 week ago

PR Summary

Replaces KOKKOS_LAMBDAs with templated functors in par_dispatch(LoopPatternFlatRange, ...) that deduce the signature of the provided function to allow for extra arguments used in reductions.

Makes it possible to use par_reduce(DEFAULT_LOOP_PATTERN, ..) & par_reduce(name, ...)

PR Checklist

acreyes commented 4 days ago

Thanks for the PR!

Out of curiosity, was there a specific use and/or performance consideration that inspired these changes?

Not any performance consideration. I was wanting to use par_reduce with similar default arguments as I was with par_for

pgrete commented 3 days ago

All tests pass. I'm force merging.