[libc-commits] [libc] 22838f6 - [libc] Do not attempt to determine CPU features in GPU mode

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Wed Mar 15 18:44:23 PDT 2023


Author: Joseph Huber
Date: 2023-03-15T20:44:12-05:00
New Revision: 22838f6084ccfab7fe0df802873de5d4a75c6573

URL: https://github.com/llvm/llvm-project/commit/22838f6084ccfab7fe0df802873de5d4a75c6573
DIFF: https://github.com/llvm/llvm-project/commit/22838f6084ccfab7fe0df802873de5d4a75c6573.diff

LOG: [libc] Do not attempt to determine CPU features in GPU mode

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.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake b/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake
index 9a18ac018d77..adcec772938a 100644
--- a/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake
+++ b/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake
@@ -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)


        


More information about the libc-commits mailing list