[Openmp-commits] [openmp] e30b3b2 - [libomptarget] Build amdgpu plugin without hsa

Jon Chesterfield via Openmp-commits openmp-commits at lists.llvm.org
Sun Jul 25 11:35:11 PDT 2021


Author: Jon Chesterfield
Date: 2021-07-25T19:33:36+01:00
New Revision: e30b3b23a4eddbc08b5648e643f0a0b456a57832

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

LOG: [libomptarget] Build amdgpu plugin without hsa

Default to building the amdgpu plugin to use dlopen when hsa is
not found instead of disabling it.

Reviewed By: jdoerfert

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

Added: 
    

Modified: 
    openmp/libomptarget/plugins/amdgpu/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
index d7d11c20bd951..2904bb386c00d 100644
--- a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
@@ -15,10 +15,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 ${hsa-runtime64_FOUND})
-  libomptarget_say("Not building AMDGPU plugin: hsa-runtime64 not found")
-  return()
-endif()
 
 if(NOT LIBOMPTARGET_DEP_LIBELF_FOUND)
   libomptarget_say("Not building AMDGPU plugin: LIBELF not found")
@@ -54,7 +50,7 @@ include_directories(
 set(LIBOMPTARGET_DLOPEN_LIBHSA OFF)
 option(LIBOMPTARGET_FORCE_DLOPEN_LIBHSA "Build with dlopened libhsa" ${LIBOMPTARGET_DLOPEN_LIBHSA})
 
-if (NOT LIBOMPTARGET_FORCE_DLOPEN_LIBHSA)
+if (${hsa-runtime64_FOUND} AND NOT LIBOMPTARGET_FORCE_DLOPEN_LIBHSA)
   libomptarget_say("Building AMDGPU plugin linked against libhsa")
   set(LIBOMPTARGET_EXTRA_SOURCE)
   set(LIBOMPTARGET_DEP_LIBRARIES hsa-runtime64::hsa-runtime64)


        


More information about the Openmp-commits mailing list