9 Commits

Author SHA1 Message Date
Dr-Noob
27655dc601 Show chip name 2025-10-15 08:21:10 +02:00
Dr-Noob
abc21365b1 These changes should go later in another commit - lets keep this HSA only 2025-10-15 07:45:34 +02:00
Dr-Noob
3e8b87a888 Include common uarch.h in all backends (fixes include issue) 2025-10-15 07:36:36 +02:00
Dr-Noob
044a52aab7 Cleanup includes 2025-10-15 07:31:49 +02:00
Dr-Noob
f9d5ba3a1c Move get_str_process to common 2025-10-15 07:29:53 +02:00
Dr-Noob
1337ebede4 Actually no one is calling this guy 2025-10-15 07:28:15 +02:00
Dr-Noob
fd038963f1 Make sure uarch is valid before attempting to access it 2025-10-15 07:26:15 +02:00
Dr-Noob
d83904e28e Fixes 2025-10-14 08:54:25 +02:00
Dr-Noob
2d74d66f79 Push all code; needs testing + review 2025-10-14 08:39:17 +02:00

View File

@@ -27,7 +27,8 @@ if(ENABLE_CUDA_BACKEND)
endif()
if(ENABLE_HSA_BACKEND)
find_package(ROCmCMakeBuildTools QUIET)
# TODO: Needs rocm-cmake, what if its not insalled?
find_package(ROCmCMakeBuildTools)
if (ROCmCMakeBuildTools_FOUND)
find_package(hsa-runtime64 1.0 REQUIRED)
link_directories(hsa_backend hsa-runtime64::hsa-runtime64)
@@ -47,22 +48,9 @@ if(ENABLE_HSA_BACKEND)
message(STATUS "${BoldYellow}HSA not found, disabling HSA backend${ColorReset}")
set(ENABLE_HSA_BACKEND false)
endif()
else()
# 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()
message(STATUS "${BoldYellow}ROCm not found${ColorReset}")
endif()
endif()
@@ -146,13 +134,9 @@ if(ENABLE_HSA_BACKEND)
endif()
target_include_directories(hsa_backend PRIVATE "${HSA_INCLUDE_DIR}")
message(STATUS "Found HSA: ${HSA_INCLUDE_DIR}")
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()