diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2025-03-31 20:28:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-31 20:28:29 -0400 |
commit | 0248d277cabab370b48114cc62aff393b273971b (patch) | |
tree | 5162b6c46c4c5872f0d746a4ccb2059d2bfe0351 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | 091051fb7f48dd9f1d3f119aa7dcbd38d9d6f076 (diff) | |
download | llvm-0248d277cabab370b48114cc62aff393b273971b.zip llvm-0248d277cabab370b48114cc62aff393b273971b.tar.gz llvm-0248d277cabab370b48114cc62aff393b273971b.tar.bz2 |
Reland [HIP] fix host min/max in header (#133590)
CUDA defines min/max functions for host in global namespace. HIP header
needs to define them too to be compatible. Currently only min/max(int,
int) is defined. This causes wrong result for arguments that are out of
range for int. This patch defines host min/max functions to be
compatible with CUDA.
Since some HIP apps defined min/max functions by themselves, newly added
min/max function are under the control of macro
`__HIP_DEFINE_EXTENDED_HOST_MIN_MAX__`, which is 0 by default. In the
future, this will change to 1 by
default after most existing HIP apps adopt this change.
Also allows users to define
`__HIP_NO_HOST_MIN_MAX_IN_GLOBAL_NAMESPACE__` to disable host max/min in
global namespace.
min/max functions with mixed signed/unsigned integer parameters are not
defined unless
`__HIP_DEFINE_MIXED_HOST_MIN_MAX__` is defined.
Fixes: SWDEV-446564
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions