[all-commits] [llvm/llvm-project] 9893f6: [HIP] Fix return type in __clang_hip_cmath.h (#139...

Juan Manuel Martinez Caamaño via All-commits all-commits at lists.llvm.org
Thu May 15 01:38:26 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9893f6bed3ab707383dc1901a237f0d4481049d6
      https://github.com/llvm/llvm-project/commit/9893f6bed3ab707383dc1901a237f0d4481049d6
  Author: Juan Manuel Martinez Caamaño <jmartinezcaamao at gmail.com>
  Date:   2025-05-15 (Thu, 15 May 2025)

  Changed paths:
    M clang/lib/Headers/__clang_hip_cmath.h
    M clang/test/Headers/__clang_hip_cmath-return_types.hip

  Log Message:
  -----------
  [HIP] Fix return type in __clang_hip_cmath.h (#139697)

Before, some functions like `isgreater(float, double)` would return a
`double` instead of a `bool`.

Stumbled upon this bug while trying to adapt
[`External/CUDA/cmath.cu`](https://github.com/llvm/llvm-test-suite/blob/main/External/CUDA/cmath.cu)
to HIP.

```
/_llvm-test-suite/External/HIP/../CUDA/math_h.cu:617:20: error: static assertion failed due to requirement 'std::is_same<double, bool>::value':
617 |     static_assert((std::is_same<decltype(isgreater((float)0, (double)0)), bool>::value), "");
```



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