[libc] Remove duplicate architecture from the detected list
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 14 Apr 2023 20:05:40 +0000 (15:05 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 14 Apr 2023 20:14:08 +0000 (15:14 -0500)
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.

libc/cmake/modules/prepare_libc_gpu_build.cmake

index 2185128..5d7d8ac 100644 (file)
@@ -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})