From 1d7a9e9dff1983cd4b12104f93b32bfe4b4c4f7e Mon Sep 17 00:00:00 2001 From: mvermeulen <5479696+mvermeulen@users.noreply.github.com> Date: Sun, 11 Jul 2021 21:29:11 -0500 Subject: [PATCH] [ROCM] Fix undefined symbols by adding library (#8446) * Add libhsa-runtime64 reference. * Remove lib in library definition. --- cmake/modules/ROCM.cmake | 3 +++ cmake/utils/FindROCM.cmake | 1 + 2 files changed, 4 insertions(+) diff --git a/cmake/modules/ROCM.cmake b/cmake/modules/ROCM.cmake index b908df2f869b..8b064d2eb2eb 100644 --- a/cmake/modules/ROCM.cmake +++ b/cmake/modules/ROCM.cmake @@ -34,6 +34,9 @@ if(USE_ROCM) file(GLOB RUNTIME_ROCM_SRCS src/runtime/rocm/*.cc) list(APPEND RUNTIME_SRCS ${RUNTIME_ROCM_SRCS}) list(APPEND TVM_RUNTIME_LINKER_LIBS ${ROCM_HIPHCC_LIBRARY}) + if (ROCM_HSA_LIBRARY) + list(APPEND TVM_RUNTIME_LINKER_LIBS ${ROCM_HSA_LIBRARY}) + endif() if(USE_MIOPEN) message(STATUS "Build with MIOpen support") diff --git a/cmake/utils/FindROCM.cmake b/cmake/utils/FindROCM.cmake index 7d4e282956d9..4d895ff89d13 100644 --- a/cmake/utils/FindROCM.cmake +++ b/cmake/utils/FindROCM.cmake @@ -55,6 +55,7 @@ macro(find_rocm use_rocm) endif() find_library(ROCM_MIOPEN_LIBRARY MIOpen ${__rocm_sdk}/lib) find_library(ROCM_ROCBLAS_LIBRARY rocblas ${__rocm_sdk}/lib) + find_library(ROCM_HSA_LIBRARY hsa-runtime64 ${__rocm_sdk}/lib) if(ROCM_HIPHCC_LIBRARY) set(ROCM_FOUND TRUE)