[llvm] [offload] Support LIBOMPTARGET_DEVICE_ARCHITECTURES={amdgpu|nvptx} (PR #119070)

via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 7 05:53:36 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-offload

Author: Michał Górny (mgorny)

<details>
<summary>Changes</summary>

Add two more special values for LIBOMPTARGET_DEVICE_ARCHITECTURES: `amdgpu` and `nvptx`, to support building for all AMDGPU and NVPTX targets respectively.  This can be used in place of `all` when offload is built with one of the GPU plugins only.

---
Full diff: https://github.com/llvm/llvm-project/pull/119070.diff


1 Files Affected:

- (modified) offload/DeviceRTL/CMakeLists.txt (+4) 


``````````diff
diff --git a/offload/DeviceRTL/CMakeLists.txt b/offload/DeviceRTL/CMakeLists.txt
index 32a7510be980d8..1bf3eb9da38aa1 100644
--- a/offload/DeviceRTL/CMakeLists.txt
+++ b/offload/DeviceRTL/CMakeLists.txt
@@ -57,6 +57,10 @@ 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 "amdgpu")
+  set(LIBOMPTARGET_DEVICE_ARCHITECTURES ${all_amdgpu_architectures})
+elseif(LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "nvptx")
+  set(LIBOMPTARGET_DEVICE_ARCHITECTURES ${all_nvptx_architectures})
 elseif(LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "auto" OR
        LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "native")
   if(NOT LIBOMPTARGET_NVPTX_ARCH AND NOT LIBOMPTARGET_AMDGPU_ARCH)

``````````

</details>


https://github.com/llvm/llvm-project/pull/119070


More information about the llvm-commits mailing list