Skip to content

Commit

Permalink
[hipRTC] resolve symbol issues by explicitly link with hipRTC (#2612)
Browse files Browse the repository at this point in the history
* explicitly link with hipRTC

* Update formatting

* Consider MIOPEN_USE_HIPRTC=Off

* Clean up

---------

Co-authored-by: Jun Liu <Liu.Jun@amd.com>
  • Loading branch information
JehandadKhan and junliume committed Dec 16, 2023
1 parent f34a90f commit 5290fa5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ endif()
if(MIOPEN_USE_HIPRTC)
if(NOT MIOPEN_USE_COMGR)
message(FATAL_ERROR "HIPRTC can be used only together with COMGR")
else()
message(STATUS "Build with HIPRTC")
endif()
find_package(hiprtc REQUIRED)
message(STATUS "Build with HIPRTC")
endif()

option(Boost_USE_STATIC_LIBS "Use boost static libraries" ON)
Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,13 @@ 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)
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
target_compile_definitions( MIOpen PRIVATE -D__HIP_PLATFORM_HCC__=1 )
Expand Down

0 comments on commit 5290fa5

Please sign in to comment.