Minor improvements

This commit is contained in:
Dr-Noob
2025-10-16 07:23:50 +02:00
parent 66387ab7a7
commit fc7c46a389

View File

@@ -27,7 +27,7 @@ if(ENABLE_CUDA_BACKEND)
endif() endif()
if(ENABLE_HSA_BACKEND) if(ENABLE_HSA_BACKEND)
find_package(ROCmCMakeBuildTools) find_package(ROCmCMakeBuildTools QUIET)
if (ROCmCMakeBuildTools_FOUND) if (ROCmCMakeBuildTools_FOUND)
find_package(hsa-runtime64 1.0 REQUIRED) find_package(hsa-runtime64 1.0 REQUIRED)
link_directories(hsa_backend hsa-runtime64::hsa-runtime64) link_directories(hsa_backend hsa-runtime64::hsa-runtime64)
@@ -49,6 +49,7 @@ if(ENABLE_HSA_BACKEND)
endif() endif()
else() else()
# rocm-cmake is not installed, try to manually find neccesary files. # 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) if (NOT DEFINED ROCM_PATH)
set(ROCM_PATH "/opt/rocm" CACHE PATH "Path to ROCm") set(ROCM_PATH "/opt/rocm" CACHE PATH "Path to ROCm")
endif() endif()
@@ -57,10 +58,10 @@ if(ENABLE_HSA_BACKEND)
find_library(HSA_LIBRARY hsa-runtime64 HINTS ${ROCM_PATH}/lib ${ROCM_PATH}/lib64) find_library(HSA_LIBRARY hsa-runtime64 HINTS ${ROCM_PATH}/lib ${ROCM_PATH}/lib64)
if (HSA_INCLUDE_DIR AND HSA_LIBRARY) if (HSA_INCLUDE_DIR AND HSA_LIBRARY)
message(STATUS "${BoldYellow}Found ROCm manually${ColorReset}") message(STATUS "${BoldYellow}HSA was found manually${ColorReset}")
else() else()
set(ENABLE_HSA_BACKEND false) set(ENABLE_HSA_BACKEND false)
message(STATUS "${BoldYellow}ROCm not found${ColorReset}") message(STATUS "${BoldYellow}HSA was not found manually${ColorReset}")
endif() endif()
endif() endif()
endif() endif()
@@ -145,7 +146,6 @@ if(ENABLE_HSA_BACKEND)
endif() endif()
target_include_directories(hsa_backend PRIVATE "${HSA_INCLUDE_DIR}") target_include_directories(hsa_backend PRIVATE "${HSA_INCLUDE_DIR}")
message(STATUS "Found HSA: ${HSA_INCLUDE_DIR}")
if (HSA_LIBRARY) if (HSA_LIBRARY)
target_link_libraries(hsa_backend PRIVATE ${HSA_LIBRARY}) target_link_libraries(hsa_backend PRIVATE ${HSA_LIBRARY})