[clang] [Clang] Fix 'gpuintrin.h' match when included with no arch set (PR #129927)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 5 16:35:51 PST 2025


================
@@ -179,8 +179,10 @@ __gpu_shuffle_idx_u64(uint64_t __lane_mask, uint32_t __idx, uint64_t __x,
 _DEFAULT_FN_ATTRS static __inline__ uint64_t
 __gpu_match_any_u32(uint64_t __lane_mask, uint32_t __x) {
   // Newer targets can use the dedicated CUDA support.
-  if (__CUDA_ARCH__ >= 700 || __nvvm_reflect("__CUDA_ARCH") >= 700)
+#if __CUDA_ARCH__ >= 700
+  if (__nvvm_reflect("__CUDA_ARCH") >= 700)
----------------
Artem-B wrote:

Is there a particular reason that `__CUDA_ARCH__` got removed from `if` here but not in other places?

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


More information about the cfe-commits mailing list