Skip to content

[Offload] Fix enabling plugins on unsupported platforms #93186

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
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions offload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,25 @@ set(LIBOMPTARGET_PLUGINS_TO_BUILD "all" CACHE STRING
if(LIBOMPTARGET_PLUGINS_TO_BUILD STREQUAL "all")
set(LIBOMPTARGET_PLUGINS_TO_BUILD ${LIBOMPTARGET_ALL_PLUGIN_TARGETS})
endif()

if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux" AND
"host" IN_LIST LIBOMPTARGET_PLUGINS_TO_BUILD)
message(STATUS "Not building host plugin: only Linux systems are supported")
list(REMOVE_ITEM LIBOMPTARGET_PLUGINS_TO_BUILD "host")
endif()
if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$"
AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
if("amdgpu" IN_LIST LIBOMPTARGET_PLUGINS_TO_BUILD)
message(STATUS "Not building AMDGPU plugin: only support AMDGPU in "
"Linux x86_64, ppc64le, or aarch64 hosts")
list(REMOVE_ITEM LIBOMPTARGET_PLUGINS_TO_BUILD "amdgpu")
endif()
if("nvptx" IN_LIST LIBOMPTARGET_PLUGINS_TO_BUILD)
message(STATUS "Not building CUDA plugin: only support AMDGPU in "
"Linux x86_64, ppc64le, or aarch64 hosts")
list(REMOVE_ITEM LIBOMPTARGET_PLUGINS_TO_BUILD "cuda")
endif()
endif()
message(STATUS "Building the offload library with support for "
"the \"${LIBOMPTARGET_PLUGINS_TO_BUILD}\" plugins")

Expand Down
5 changes: 0 additions & 5 deletions offload/plugins-nextgen/amdgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# As of rocm-3.7, hsa is installed with cmake packages and kmt is found via hsa
find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)

if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
message(STATUS "Not building AMDGPU NextGen plugin: only support AMDGPU in Linux x86_64, ppc64le, or aarch64 hosts")
return()
endif()

# Create the library and add the default arguments.
add_target_library(omptarget.rtl.amdgpu AMDGPU)

Expand Down
7 changes: 0 additions & 7 deletions offload/plugins-nextgen/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
if (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
message(STATUS "Not building CUDA NextGen offloading plugin: only support CUDA in Linux x86_64, ppc64le, or aarch64 hosts.")
return()
endif()

message(STATUS "Building CUDA NextGen offloading plugin.")

# Create the library and add the default arguments.
add_target_library(omptarget.rtl.cuda CUDA)

Expand Down
4 changes: 0 additions & 4 deletions offload/plugins-nextgen/host/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
return()
endif()

set(supported_targets x86_64 aarch64 ppc64 ppc64le s390x)
if(NOT ${CMAKE_SYSTEM_PROCESSOR} IN_LIST supported_targets)
message(STATUS "Not building ${machine} NextGen offloading plugin")
Expand Down
Loading