Skip to content

Commit

Permalink
Change hip target to be compatible with hip-clang (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
amdkila authored Mar 5, 2020
1 parent ae5fed6 commit 4989200
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
5 changes: 1 addition & 4 deletions clients/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ endif()
#target_link_libraries( rocsolver-bench PRIVATE ${ROCM_PATH}/rocblas/lib/librocblas.so ) #${ROCBLAS_LIBRARY})
target_link_libraries( rocsolver-bench PRIVATE roc::rocblas ) #${ROCBLAS_LIBRARY})


get_target_property( HIPHCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )

if( CUDA_FOUND )
target_include_directories( rocsolver-bench
PRIVATE
Expand All @@ -135,7 +132,7 @@ if( CUDA_FOUND )
target_link_libraries( rocsolver-bench PRIVATE ${CUDA_LIBRARIES} )
else( )
target_compile_definitions( rocsolver-bench PRIVATE __HIP_PLATFORM_HCC__ )
target_link_libraries( rocsolver-bench PRIVATE ${HIPHCC_LOCATION} )
target_link_libraries( rocsolver-bench PRIVATE hip::device )
endif( )

#target_link_libraries( rocsolver-bench PRIVATE ${ROCM_PATH}/rocblas/lib/librocblas.so ) #${ROCBLAS_LIBRARY})
Expand Down
5 changes: 1 addition & 4 deletions clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ endif()
target_link_libraries( rocsolver-test PRIVATE roc::rocblas ) #${ROCBLAS_LIBRARY})
#target_link_libraries( rocsolver-test PRIVATE ${ROCM_PATH}/rocblas/lib/librocblas.so ) #${ROCBLAS_LIBRARY})


get_target_property( HIPHCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )

if( CUDA_FOUND )
target_include_directories( rocsolver-test
PRIVATE
Expand All @@ -171,7 +168,7 @@ if( CUDA_FOUND )
target_link_libraries( rocsolver-test PRIVATE ${CUDA_LIBRARIES} )
else( )
target_compile_definitions( rocsolver-test PRIVATE __HIP_PLATFORM_HCC__ )
target_link_libraries( rocsolver-test PRIVATE ${HIPHCC_LOCATION} )
target_link_libraries( rocsolver-test PRIVATE hip::device )
endif( )

#target_link_libraries( rocsolver-test PRIVATE ${ROCM_PATH}/rocblas/lib/librocblas.so ) #${ROCBLAS_LIBRARY})
Expand Down
6 changes: 3 additions & 3 deletions library/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ add_library( rocsolver
add_library( roc::rocsolver ALIAS rocsolver )

# Remove this check when we no longer build with older rocm stack(ie < 1.8.2)
if(TARGET hip::device)
target_link_libraries( rocsolver PRIVATE hip::device )
if(CMAKE_CXX_COMPILER MATCHES ".*/hipcc$")
target_link_libraries( rocsolver PRIVATE hip::device )
else()
target_link_libraries( rocsolver PRIVATE hip::hip_hcc hip::hip_device hcc::hccshared )
target_link_libraries( rocsolver PRIVATE hip::device hcc::hccshared )
endif()

set_target_properties( rocsolver PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON )
Expand Down

0 comments on commit 4989200

Please sign in to comment.