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 authored Dec 16, 2023
1 parent bef03d6 commit b17d080
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
8 changes: 6 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b17d080

Please sign in to comment.