From b17d08055137563a0e5b286cf4b587cd6a9a6ec7 Mon Sep 17 00:00:00 2001 From: JD Date: Fri, 15 Dec 2023 19:14:15 -0600 Subject: [PATCH] [hipRTC] resolve symbol issues by explicitly link with hipRTC (#2612) * explicitly link with hipRTC * Update formatting * Consider MIOPEN_USE_HIPRTC=Off * Clean up --------- Co-authored-by: Jun Liu --- CMakeLists.txt | 4 +--- src/CMakeLists.txt | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdf6829c4e..2fd18fce13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -381,9 +381,7 @@ if(MIOPEN_USE_HIPRTC) if(NOT MIOPEN_USE_COMGR) message(FATAL_ERROR "HIPRTC can be used only together with COMGR") endif() - if(WIN32) - find_package(hiprtc REQUIRED) - endif() + find_package(hiprtc REQUIRED) message(STATUS "Build with HIPRTC") endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ed162ae92..1d5548db7e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -761,8 +761,12 @@ if( MIOPEN_BACKEND STREQUAL "OpenCL") elseif(MIOPEN_BACKEND STREQUAL "HIPOC" OR MIOPEN_BACKEND STREQUAL "HIP") target_link_libraries( MIOpen PRIVATE hip::device ) target_link_libraries( MIOpen INTERFACE hip::host ) - if(MIOPEN_USE_HIPRTC AND WIN32) - target_link_libraries( MIOpen PRIVATE hiprtc::hiprtc ) + if(MIOPEN_USE_HIPRTC) + if(WIN32) + target_link_libraries( MIOpen PRIVATE hiprtc::hiprtc ) + else() + target_link_libraries( MIOpen PRIVATE hiprtc) + endif() endif() if(ENABLE_HIP_WORKAROUNDS) # Workaround hip not setting its usage requirements correctly