[libc] Fix LIBC_GPU_ARCHITECTURES not being used
authorJoseph Huber <jhuber6@vols.utk.edu>
Tue, 21 Feb 2023 18:59:02 +0000 (12:59 -0600)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 21 Feb 2023 19:00:16 +0000 (13:00 -0600)
Summary:
This variable is supposed to control the architectures to build for. At
some point this was changes out for testing and never fixed.

libc/cmake/modules/LLVMLibCObjectRules.cmake
libc/cmake/modules/prepare_libc_gpu_build.cmake

index 806859a..9a3fc5a 100644 (file)
@@ -86,7 +86,7 @@ function(_build_gpu_objects fq_target_name internal_target_name)
 
   # The packaged version will be built for every target GPU architecture. We do
   # this so we can support multiple accelerators on the same machine.
-  foreach(gpu_arch ${all_gpu_architectures})
+  foreach(gpu_arch ${LIBC_GPU_ARCHITECTURES})
     set(gpu_target_name ${fq_target_name}.${gpu_arch})
     set(compile_options ${ADD_GPU_OBJ_COMPILE_OPTIONS})
     # Derive the triple from the specified architecture.
index 942d825..1f9b68a 100644 (file)
@@ -18,7 +18,7 @@ if(LIBC_GPU_ARCHITECTURES STREQUAL "all")
   set(LIBC_GPU_ARCHITECTURES ${all_gpu_architectures} FORCE)
 endif()
 message(STATUS "Building libc for the following GPU architectures: "
-               "${all_gpu_architectures}")
+               "${LIBC_GPU_ARCHITECTURES}")
 
 # Ensure the compiler is a valid clang when building the GPU target.
 set(req_ver "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")