Skip to content

[offload] Support LIBOMPTARGET_DEVICE_ARCHITECTURES={amdgpu|nvptx} #119070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

mgorny
Copy link
Member

@mgorny mgorny commented Dec 7, 2024

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.

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.
@mgorny mgorny requested review from thesamesam and jhuber6 December 7, 2024 13:52
@llvmbot llvmbot added the offload label Dec 7, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 7, 2024

@llvm/pr-subscribers-offload

Author: Michał Górny (mgorny)

Changes

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 --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)

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know how much good this will do since I'm liable to delete all of this code relatively soon, but not like it hurts anything.

@mgorny
Copy link
Member Author

mgorny commented Dec 7, 2024

Thanks!

@mgorny mgorny merged commit 69227a1 into llvm:main Dec 7, 2024
8 checks passed
@mgorny mgorny deleted the offload-one-gpu branch December 7, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants