Skip to content

refactor: use constexpr for host and device code in LBM library

When functions are compiled with constexpr syntax and cuda code is compiled with --expt-relaxed-constexpr flag, they can be used on cpu and gpu (see https://www.youtube.com/watch?v=TRQWxkRdPUI)

Advantage:

And biggest advantage: other constexpr functions can be called and used, also for example from the c++ standard library. So far, std::max is now used on gpu. std::abs will be constexpr from C++23. More and more functions will be constexpr in the future (see YT video link)

Merge request reports