This is an automated email from the ASF dual-hosted git repository.

masahi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 1d7a9e9  [ROCM] Fix undefined symbols by adding library (#8446)
1d7a9e9 is described below

commit 1d7a9e9dff1983cd4b12104f93b32bfe4b4c4f7e
Author: mvermeulen <[email protected]>
AuthorDate: Sun Jul 11 21:29:11 2021 -0500

    [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 b908df2..8b064d2 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 7d4e282..4d895ff 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)

Reply via email to