From 4eb27445d0237b0c718c873aa95a8f7ab8c698eb Mon Sep 17 00:00:00 2001 From: Tianqi Chen Date: Fri, 28 Aug 2020 14:42:15 -0700 Subject: [PATCH] [CMAKE] Compatible for ROCm before 3.7 (#6359) --- cmake/util/FindROCM.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/util/FindROCM.cmake b/cmake/util/FindROCM.cmake index cf9524ba57b8..78b242c8bec3 100644 --- a/cmake/util/FindROCM.cmake +++ b/cmake/util/FindROCM.cmake @@ -49,8 +49,13 @@ macro(find_rocm use_rocm) if(__rocm_sdk) set(ROCM_INCLUDE_DIRS ${__rocm_sdk}/include) find_library(ROCM_HIPHCC_LIBRARY amdhip64 ${__rocm_sdk}/lib) + # Backward compatible with before ROCm3.7 + if(NOT ROCM_HIPHCC_LIBRARY) + find_library(ROCM_HIPHCC_LIBRARY hip_hcc ${__rocm_sdk}/lib) + endif() find_library(ROCM_MIOPEN_LIBRARY MIOpen ${__rocm_sdk}/lib) find_library(ROCM_ROCBLAS_LIBRARY rocblas ${__rocm_sdk}/lib) + if(ROCM_HIPHCC_LIBRARY) set(ROCM_FOUND TRUE) endif()