From: Jon Chesterfield Date: Sun, 25 Jul 2021 20:03:51 +0000 (+0100) Subject: Revert "[libomptarget] Build amdgpu plugin without hsa" X-Git-Tag: llvmorg-14-init~335 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e3251f2ec44bd65f440d215517f135c39f22d1b9;p=platform%2Fupstream%2Fllvm.git Revert "[libomptarget] Build amdgpu plugin without hsa" Inaccurate error handling around hsa_init This reverts commit e30b3b23a4eddbc08b5648e643f0a0b456a57832. --- diff --git a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt index 2904bb3..d7d11c2 100644 --- a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt +++ b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt @@ -15,6 +15,10 @@ # 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") @@ -50,7 +54,7 @@ include_directories( set(LIBOMPTARGET_DLOPEN_LIBHSA OFF) option(LIBOMPTARGET_FORCE_DLOPEN_LIBHSA "Build with dlopened libhsa" ${LIBOMPTARGET_DLOPEN_LIBHSA}) -if (${hsa-runtime64_FOUND} AND NOT LIBOMPTARGET_FORCE_DLOPEN_LIBHSA) +if (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)