[all-commits] [llvm/llvm-project] 55783b: [HIP] fix host min/max in header (#82956)

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Tue Feb 27 07:53:06 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 55783bd0f9cfc30aa93c718919dab5419d86a2c6
      https://github.com/llvm/llvm-project/commit/55783bd0f9cfc30aa93c718919dab5419d86a2c6
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2024-02-27 (Tue, 27 Feb 2024)

  Changed paths:
    M clang/lib/Headers/__clang_hip_math.h

  Log Message:
  -----------
  [HIP] fix host min/max in header (#82956)

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.

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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list