[Openmp-commits] [openmp] 71fb11f - [Libomptarget] Fix disabling amdgpu on non-Linux.

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Sat Feb 4 05:45:13 PST 2023


Author: Samuel Thibault
Date: 2023-02-04T07:45:03-06:00
New Revision: 71fb11ff34691ab08cdb0d174ea058e44ad2fea6

URL: https://github.com/llvm/llvm-project/commit/71fb11ff34691ab08cdb0d174ea058e44ad2fea6
DIFF: https://github.com/llvm/llvm-project/commit/71fb11ff34691ab08cdb0d174ea058e44ad2fea6.diff

LOG: [Libomptarget] Fix disabling amdgpu on non-Linux.

Previously, on non-Linux, amdgpu would get enabled whatever the CPU architecture.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D143017

Added: 
    

Modified: 
    openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
    openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
    openmp/libomptarget/plugins/cuda/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt b/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
index b469850297ecc..c59a9e3d1804e 100644
--- a/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
+++ b/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
@@ -22,7 +22,7 @@ endif()
 # 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")
+if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
   libomptarget_say("Not building AMDGPU NextGen plugin: only support AMDGPU in Linux x86_64, ppc64le, or aarch64 hosts")
   return()
 endif()

diff  --git a/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt b/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
index d51403d3e0bcb..63359c0ca78ef 100644
--- a/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
+++ b/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
@@ -16,7 +16,7 @@ if (NOT LIBOMPTARGET_BUILD_CUDA_PLUGIN)
   return()
 endif()
 
-if (NOT(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
+if (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
   libomptarget_say("Not building CUDA NextGen offloading plugin: only support CUDA in Linux x86_64, ppc64le, or aarch64 hosts.")
   return()
 endif()

diff  --git a/openmp/libomptarget/plugins/cuda/CMakeLists.txt b/openmp/libomptarget/plugins/cuda/CMakeLists.txt
index a16cdbe87c2a3..b1442722e1242 100644
--- a/openmp/libomptarget/plugins/cuda/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/cuda/CMakeLists.txt
@@ -16,7 +16,7 @@ if (NOT LIBOMPTARGET_BUILD_CUDA_PLUGIN)
   return()
 endif()
 
-if (NOT(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
+if (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
   libomptarget_say("Not building CUDA offloading plugin: only support CUDA in Linux x86_64, ppc64le, or aarch64 hosts.")
   return()
 endif()


        


More information about the Openmp-commits mailing list