[lamikr@localhost hipcc_bug]$ ./testcase_hip_x_hip
std::min of -inf and nan: nan
std::min of nan and -inf: -inf
std::max of -inf and nan: -inf
std::max of nan and -inf: nan
[lamikr@localhost hipcc_bug]$ ./testcase_hip_x_c++
std::min of -inf and nan: -inf
std::min of nan and -inf: nan
std::max of -inf and nan: -inf
std::max of nan and -inf: nan
[lamikr@localhost hipcc_bug]$ ./testcase_us
[lamikr@localhost hipcc_bug]$ ./testcase_usr_bin_clang
std::min of -inf and nan: -inf
std::min of nan and -inf: nan
std::max of -inf and nan: -inf
std::max of nan and -inf: nan
[lamikr@localhost hipcc_bug]$ ./testcase_usr_bin_g++
std::min of -inf and nan: -inf
std::min of nan and -inf: nan
std::max of -inf and nan: -inf
std::max of nan and -inf: nan
So when compiled with hipcc -x option, results are different than with 3 other compilers. This can affect to the functions expecting "well known" behavior for example in pytorch when using min, max or clamp functions.
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
Problem Description
I added the description to old 2209 bug that I tested with rocm 6.1.1 version.
Operating System
Fedora 40
CPU
AMD Ryzen 5700x
GPU
AMD Radeon RX 7900 XT
ROCm Version
ROCm 6.1.0
ROCm Component
HIP
Steps to Reproduce
Use this test app
Install hipcc and regular clang and gnu-c++ of your linux distro and execute this scipt to get results from all 4 compilers.
Results:
So when compiled with hipcc -x option, results are different than with 3 other compilers. This can affect to the functions expecting "well known" behavior for example in pytorch when using min, max or clamp functions.
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response