Don't use HIP overloads for std::min
The HIP overloads for std::min don't return the first parameter when the two values are equal which causes problems when inputs such as nan.
Reported upstream: https://github.com/ROCm-Developer-Tools/HIP/issues/2209