[clang] [OFFLOAD] Introduce OpenMP cmath wrappers for SPIRV backend (PR #195386)

via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 10:37:37 PDT 2026


================
@@ -26,107 +26,40 @@
 
 // We need limits because __clang_cuda_cmath.h below uses `std::numeric_limit`.
 #include <limits>
-
+#ifdef __NVPTX__
 #pragma omp begin declare variant match(                                       \
-    device = {arch(nvptx, nvptx64)}, implementation = {extension(match_any, allow_templates)})
+        device = {arch(nvptx, nvptx64)},                                       \
+            implementation = {extension(match_any, allow_templates)})
 
 #define __CUDA__
 #define __OPENMP_NVPTX__
-#include <__clang_cuda_cmath.h>
+#include <__clang_spirv_cmath.h>
----------------
fineg74 wrote:

Fixed

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


More information about the cfe-commits mailing list