[libc-commits] [libc] 77f4e38 - [libc] Remove duplicate architecture from the detected list

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Apr 14 13:14:25 PDT 2023


Author: Joseph Huber
Date: 2023-04-14T15:14:08-05:00
New Revision: 77f4e38d0b8a19f6265e1341f962666e29de1c05

URL: https://github.com/llvm/llvm-project/commit/77f4e38d0b8a19f6265e1341f962666e29de1c05
DIFF: https://github.com/llvm/llvm-project/commit/77f4e38d0b8a19f6265e1341f962666e29de1c05.diff

LOG: [libc] Remove duplicate architecture from the detected list

Summary:
When we detect the architectures via `native` we can have systems with
multiple of the same GPU. We need to remove duplicates or else we will
try to build the same target multiple times.

Added: 
    

Modified: 
    libc/cmake/modules/prepare_libc_gpu_build.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/prepare_libc_gpu_build.cmake b/libc/cmake/modules/prepare_libc_gpu_build.cmake
index 21851285c624..5d7d8ac2b0fc 100644
--- a/libc/cmake/modules/prepare_libc_gpu_build.cmake
+++ b/libc/cmake/modules/prepare_libc_gpu_build.cmake
@@ -49,6 +49,7 @@ foreach(arch_tool ${LIBC_NVPTX_ARCH} ${LIBC_AMDGPU_ARCH})
     list(APPEND detected_gpu_architectures "${arch_list}")
   endif()
 endforeach()
+list(REMOVE_DUPLICATES detected_gpu_architectures)
 
 if(LIBC_GPU_ARCHITECTURES STREQUAL "all")
   set(LIBC_GPU_ARCHITECTURES ${all_gpu_architectures})


        


More information about the libc-commits mailing list