summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-04-12 15:08:59 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-04-14 15:14:08 -0500
commit909344c7ac4d77823127c3470c5270f7882fdfd4 (patch)
tree487a7c77e4c0724a510b93984ba8bd9efa20a89b /openmp
parent77f4e38d0b8a19f6265e1341f962666e29de1c05 (diff)
downloadllvm-909344c7ac4d77823127c3470c5270f7882fdfd4.tar.gz
[OpenMP] Remove duplicates from the list if using 'auto'
Summary: We can detect the user's GPUs via the `auto` option. But if the user has multiple GPUs installed or set the list incorrectly, we need to remove the duplicates.
Diffstat (limited to 'openmp')
-rw-r--r--openmp/libomptarget/DeviceRTL/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
index 53da2661011e..f123105fc21b 100644
--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -70,7 +70,8 @@ set(LIBOMPTARGET_DEVICE_ARCHITECTURES "all" CACHE STRING
if(LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "all")
set(LIBOMPTARGET_DEVICE_ARCHITECTURES ${all_gpu_architectures})
-elseif(LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "auto")
+elseif(LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "auto" OR
+ LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "native")
if(NOT LIBOMPTARGET_NVPTX_ARCH AND NOT LIBOMPTARGET_AMDGPU_ARCH)
libomptarget_error_say(
"Could not find 'amdgpu-arch' and 'nvptx-arch' tools required for 'auto'")
@@ -80,6 +81,7 @@ elseif(LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "auto")
set(LIBOMPTARGET_DEVICE_ARCHITECTURES
"${LIBOMPTARGET_NVPTX_DETECTED_ARCH_LIST};${LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST}")
endif()
+list(REMOVE_DUPLICATES LIBOMPTARGET_DEVICE_ARCHITECTURES)
set(include_files
${include_directory}/Configuration.h