[all-commits] [llvm/llvm-project] bfd558: [Pre-commit test]

Juan Manuel Martinez Caamaño via All-commits all-commits at lists.llvm.org
Thu Jun 4 05:15:45 PDT 2026


  Branch: refs/heads/users/jmmartinez/fix_hip_build_in_windows_electric_boogaloo
  Home:   https://github.com/llvm/llvm-project
  Commit: bfd55859d5f1473f93dc2411f216d79e1cc4e4b4
      https://github.com/llvm/llvm-project/commit/bfd55859d5f1473f93dc2411f216d79e1cc4e4b4
  Author: Juan Manuel Martinez Caamaño <jmartinezcaamao at gmail.com>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    A clang/test/Headers/hip-constexpr-cmath.hip

  Log Message:
  -----------
  [Pre-commit test]


  Commit: 22b18bdd97feef33708001005dab50ae2deb1478
      https://github.com/llvm/llvm-project/commit/22b18bdd97feef33708001005dab50ae2deb1478
  Author: Juan Manuel Martinez Caamaño <jmartinezcaamao at gmail.com>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M clang/lib/Headers/__clang_hip_runtime_wrapper.h
    M clang/test/Headers/hip-constexpr-cmath.hip

  Log Message:
  -----------
  [Clang][HIP] Include `__clang_cuda_math_forward_declares.h` before `<cmath>`

This patch should fix the following error on windows: https://github.com/ggml-org/llama.cpp/issues/22570

In HIP, constexpr functions are treated as both __host__ and __device__.

A new version of the MS STL shipped with the build tools version
14.51.36231 has constexpr definitions for some cmath functions when the
compiler in use is Clang.

These definitions conflict with the __device__ declarations we provide
in the header wrappers.

There is a workaround for this: It is possible to overload constexpr
functions **that are defined in a system header** by declaring a __device__
version before.

By moving `__clang_cuda_math_forward_declares.h` before `<cmath>` is
included we're able to benefit from this behavour.


Compare: https://github.com/llvm/llvm-project/compare/bfd55859d5f1%5E...22b18bdd97fe

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