[clang] [Clang] Fix __cpuidex conflict with CUDA (PR #152556)
Aiden Grossman via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 7 10:39:48 PDT 2025
================
@@ -345,10 +345,15 @@ static __inline int __get_cpuid_count (unsigned int __leaf,
// In some configurations, __cpuidex is defined as a builtin (primarily
// -fms-extensions) which will conflict with the __cpuidex definition below.
#if !(__has_builtin(__cpuidex))
+// In some cases, offloading will set the host as the aux triple and define the
+// builtin. Given __has_builtin does not detect builtins on aux triples, we need
+// to explicitly check for some offloading cases.
+#ifndef __NVPTX__
----------------
boomanaiden154 wrote:
Good point. I've filed https://github.com/llvm/llvm-project/issues/152558 to track this.
https://github.com/llvm/llvm-project/pull/152556
More information about the cfe-commits
mailing list