[clang] [clang][CUDA] Define _NV_RSQRT_SPECIFIER for glibc-2.42/cuda-13.2 compatibility (PR #185701)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 10 10:34:19 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- clang/lib/Headers/__clang_cuda_runtime_wrapper.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
index 3ed023b9c..9a9f70d56 100644
--- a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -48,16 +48,16 @@
 // math_functions.h from CUDA 13.2+ defines _NV_RSQRT_SPECIFIER.
 // Clang does not include it, so we need to define it ourselves.
 #if defined(__GNUC__)
-# include <features.h> /* For GLIBC macros */
-# if defined(__GLIBC_PREREQ)
-#  if __GLIBC_PREREQ(2, 42)
-#   define _NV_RSQRT_SPECIFIER noexcept(true)
-#  endif
-# endif
+#include <features.h> /* For GLIBC macros */
+#if defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 42)
+#define _NV_RSQRT_SPECIFIER noexcept(true)
+#endif
+#endif
 #endif
 
 #ifndef _NV_RSQRT_SPECIFIER
-# define _NV_RSQRT_SPECIFIER
+#define _NV_RSQRT_SPECIFIER
 #endif
 
 // Preserve common macros that will be changed below by us or by CUDA

``````````

</details>


https://github.com/llvm/llvm-project/pull/185701


More information about the cfe-commits mailing list