Compare commits
4 Commits
master
...
amd-suppor
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc7c46a389 | ||
|
|
66387ab7a7 | ||
|
|
d24a737317 | ||
|
|
62e358a017 |
@@ -27,8 +27,7 @@ if(ENABLE_CUDA_BACKEND)
|
||||
endif()
|
||||
|
||||
if(ENABLE_HSA_BACKEND)
|
||||
# TODO: Needs rocm-cmake, what if its not insalled?
|
||||
find_package(ROCmCMakeBuildTools)
|
||||
find_package(ROCmCMakeBuildTools QUIET)
|
||||
if (ROCmCMakeBuildTools_FOUND)
|
||||
find_package(hsa-runtime64 1.0 REQUIRED)
|
||||
link_directories(hsa_backend hsa-runtime64::hsa-runtime64)
|
||||
@@ -49,8 +48,21 @@ if(ENABLE_HSA_BACKEND)
|
||||
set(ENABLE_HSA_BACKEND false)
|
||||
endif()
|
||||
else()
|
||||
set(ENABLE_HSA_BACKEND false)
|
||||
message(STATUS "${BoldYellow}ROCm not found${ColorReset}")
|
||||
# rocm-cmake is not installed, try to manually find neccesary files.
|
||||
message(STATUS "${BoldYellow}Could NOT find HSA automatically, running manual search...${ColorReset}")
|
||||
if (NOT DEFINED ROCM_PATH)
|
||||
set(ROCM_PATH "/opt/rocm" CACHE PATH "Path to ROCm")
|
||||
endif()
|
||||
|
||||
find_path(HSA_INCLUDE_DIR hsa/hsa.h HINTS ${ROCM_PATH}/include)
|
||||
find_library(HSA_LIBRARY hsa-runtime64 HINTS ${ROCM_PATH}/lib ${ROCM_PATH}/lib64)
|
||||
|
||||
if (HSA_INCLUDE_DIR AND HSA_LIBRARY)
|
||||
message(STATUS "${BoldYellow}HSA was found manually${ColorReset}")
|
||||
else()
|
||||
set(ENABLE_HSA_BACKEND false)
|
||||
message(STATUS "${BoldYellow}HSA was not found manually${ColorReset}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -134,9 +146,13 @@ if(ENABLE_HSA_BACKEND)
|
||||
endif()
|
||||
|
||||
target_include_directories(hsa_backend PRIVATE "${HSA_INCLUDE_DIR}")
|
||||
message(STATUS "Found HSA: ${HSA_INCLUDE_DIR}")
|
||||
|
||||
target_link_libraries(hsa_backend PRIVATE hsa-runtime64::hsa-runtime64)
|
||||
if (HSA_LIBRARY)
|
||||
target_link_libraries(hsa_backend PRIVATE ${HSA_LIBRARY})
|
||||
else()
|
||||
target_link_libraries(hsa_backend PRIVATE hsa-runtime64::hsa-runtime64)
|
||||
endif()
|
||||
|
||||
target_link_libraries(gpufetch hsa_backend)
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user