[Openmp-commits] [PATCH] D106600: [libomptarget] Build amdgpu plugin without hsa

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 22 14:47:04 PDT 2021


JonChesterfield created this revision.
JonChesterfield added reviewers: jdoerfert, tianshilei1992, pdhaliwal, ronlieb, tra, grokos, ABataev.
Herald added subscribers: kerbowa, t-tye, tpr, dstuttard, yaxunl, mgorny, nhaehnle, jvesely, kzhuravl.
JonChesterfield requested review of this revision.
Herald added subscribers: openmp-commits, wdng.
Herald added a project: OpenMP.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106600

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


Index: openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
===================================================================
--- openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
+++ 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 @@
 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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106600.360985.patch
Type: text/x-patch
Size: 1097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210722/e4c91640/attachment.bin>


More information about the Openmp-commits mailing list