You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the proposal
Different C++ standard library implementations implement std::min, std::max and std::clamp in incompatible ways. We can avoid this by implementing these functions ourselves, e.g. by copying the implementation from Kokkos: https://github.com/kokkos/kokkos/blob/master/core/src/Kokkos_MinMaxClamp.hpp
Additional context
There are weird numerical edge cases with comparisons with different compilers and different C++ standard libraries with comparisons of NaN, inf, and denormals.
The text was updated successfully, but these errors were encountered:
Describe the proposal
Different C++ standard library implementations implement
std::min
,std::max
andstd::clamp
in incompatible ways. We can avoid this by implementing these functions ourselves, e.g. by copying the implementation from Kokkos:https://github.com/kokkos/kokkos/blob/master/core/src/Kokkos_MinMaxClamp.hpp
Describe alternatives you've considered
We could use the
amrex::min
andamrex::max
implementation, but those actually call the C++ standard library implementation: https://github.com/AMReX-Codes/amrex/blob/3fe7aadc23c94a038b306af54ff732ce5564c3d1/Src/Base/AMReX_Algorithm.H#L23, which leaves us with the same problem as before.Additional context
There are weird numerical edge cases with comparisons with different compilers and different C++ standard libraries with comparisons of NaN, inf, and denormals.
The text was updated successfully, but these errors were encountered: