[libc] Do not attempt to determine CPU features in GPU mode
authorJoseph Huber <jhuber6@vols.utk.edu>
Thu, 16 Mar 2023 01:44:00 +0000 (20:44 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Thu, 16 Mar 2023 01:44:12 +0000 (20:44 -0500)
Summary:
We don't use these features in the GPU build, trying to determine them
can cause errors. We should just return early if this is the case.

libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake

index 9a18ac0..adcec77 100644 (file)
@@ -5,6 +5,10 @@
 # Initialize ALL_CPU_FEATURES as empty list.
 set(ALL_CPU_FEATURES "")
 
+if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
+  return()
+endif()
+
 if(${LIBC_TARGET_ARCHITECTURE_IS_X86})
   set(ALL_CPU_FEATURES SSE2 SSE4_2 AVX2 AVX512F AVX512BW FMA)
   set(LIBC_COMPILE_OPTIONS_NATIVE -march=native)