Skip to content

Commit

Permalink
Fix hip-clang cmake symbols (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
amdkila authored May 11, 2020
1 parent e5a6047 commit 87d7229
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ rocm_setup_version( VERSION ${VERSION_STRING} )
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )

# NOTE: workaround until hcc & hip cmake modules fixes symlink logic in their config files; remove when fixed
list( APPEND CMAKE_PREFIX_PATH /opt/rocm/hcc /opt/rocm/hip )
list( APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/hcc /opt/rocm/hip )

option( BUILD_VERBOSE "Output additional build information" OFF )

Expand Down Expand Up @@ -82,13 +82,6 @@ find_library(
HINTS "${CMAKE_PREFIX_PATH}/lib" )
message("amdhip64: ${LIBAMDHIP64_LIBRARY}")

# Look for libamdhip64
find_library(
LIBAMDHIP64_LIBRARY
NAMES libamdhip64.so
HINTS "${CMAKE_PREFIX_PATH}/lib" )
message("amdhip64: ${LIBAMDHIP64_LIBRARY}")

# Quietly look for CUDA, but if not found it's not an error
# The presense of hip is not sufficient to determine if we want a rocm or cuda backend
option(TRY_CUDA "Look for CUDA and use that as a backend if found" ON)
Expand Down
4 changes: 2 additions & 2 deletions clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ if( NOT CUDA_FOUND )
target_compile_options( hipblas-test PRIVATE -mf16c)

if( CUSTOM_TARGET )
target_link_libraries( hipblas-test PRIVATE hip::${CUSTOM_TARGET} )
target_link_libraries( hipblas-test PRIVATE hip::${CUSTOM_TARGET} hip::host )
else( )
if ( LIBAMDHIP64_LIBRARY )
target_link_libraries( hipblas-test PRIVATE hip::amdhip64 )
target_link_libraries( hipblas-test PRIVATE hip::amdhip64 hip::host )
else ( )
get_target_property( HIP_HCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )
target_link_libraries( hipblas-test PRIVATE ${HIP_HCC_LOCATION} )
Expand Down
4 changes: 2 additions & 2 deletions clients/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ foreach( exe example-sscal;example-sgemm;example-sgemm-strided-batched;example-c
target_compile_options( ${exe} PRIVATE -mf16c)

if( CUSTOM_TARGET )
target_link_libraries( ${exe} PRIVATE hip::${CUSTOM_TARGET} )
target_link_libraries( ${exe} PRIVATE hip::${CUSTOM_TARGET} hip::host )
else( )
if( LIBAMDHIP64_LIBRARY )
target_link_libraries( ${exe} PRIVATE hip::amdhip64 )
target_link_libraries( ${exe} PRIVATE hip::amdhip64 hip::host )
else( )
get_target_property( HIP_HCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )
target_link_libraries( ${exe} PRIVATE ${HIP_HCC_LOCATION} )
Expand Down
2 changes: 1 addition & 1 deletion library/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if( NOT CUDA_FOUND )

# Remove following when hcc is fixed; hcc emits following spurious warning ROCm v1.6.3
# "clang-5.0: warning: argument unused during compilation: '-isystem /opt/rocm/include'"
if( CMAKE_CXX_COMPILER MATCHES ".*/hcc$|.*/hipcc$" )
if( CMAKE_CXX_COMPILER MATCHES ".*/hcc$" )
target_link_libraries( hipblas PRIVATE hip::hip_hcc )
endif( )

Expand Down

0 comments on commit 87d7229

Please sign in to comment.