Skip to content

Commit

Permalink
Fix linking
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuron committed Oct 10, 2018
1 parent c77268e commit 039a7f7
Show file tree
Hide file tree
Showing 4 changed files with 800 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,20 @@ if (WITH_CUDA)
target_link_libraries(${target} "cufft")
endfunction()
else()
list(APPEND CMAKE_MODULE_PATH "/opt/rocm/hip/cmake")
find_package(HIP QUIET MODULE)
if(HIP_FOUND)
set(HCC_PATH "${HIP_ROOT_DIR}")
find_package(HIP MODULE)
message(STATUS "Found HIP compiler: ${HIP_HIPCC_EXECUTABLE}")
set(CUDA 1)
list(APPEND HIP_HCC_FLAGS "-DAMDGPU_TARGETS=gfx900 -Wno-macro-redefined")
HIP_INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/src/core" "${CMAKE_SOURCE_DIR}/src/core")
function(cuda_include_directories)
HIP_INCLUDE_DIRECTORIES(${ARGV})
endfunction()
function(cuda_add_library)
HIP_ADD_LIBRARY(${ARGV})
set_target_properties(${ARGV0} PROPERTIES LINKER_LANGUAGE HIP)
endfunction()
find_library(ROCFFT_LIB name "rocfft" PATHS "${HIP_ROOT_DIR}/lib")
function(CUDA_ADD_CUFFT_TO_TARGET target)
Expand Down
Loading

0 comments on commit 039a7f7

Please sign in to comment.