Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions Libraries/hipSPARSELt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ include(CTest)
file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})

# see https://github.com/ROCm/rocm-libraries/blob/40bbc75960836d1b9e0573606df9dd79800e412a/projects/hipsparselt/cmake/hipsparselt_supported_architectures.cmake#L10-L21
set(HIPSPARSELT_SUPPORTED_ARCH gfx942 gfx950)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPSPARSELT_SUPPORTED_ARCH)
message(WARNING "hipSPARSELt does not support architecture: ${ARCH}, not building hipSPARSELt examples")
return()
endif()
endforeach()

include("${CMAKE_CURRENT_LIST_DIR}/../../Common/ROCmPath.cmake")

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand All @@ -47,6 +37,12 @@ else()
if(NOT hipsparselt_FOUND)
message(WARNING "hipSPARSELt could not be found, not building hipSPARSELt examples")
else()
include("${CMAKE_CURRENT_LIST_DIR}/../../Common/FilterHIPArchitectures.cmake")
filter_hip_architectures("hipSPARSELt" "gfx942;gfx950" SHOULD_SKIP)
if(SHOULD_SKIP)
return()
endif()

add_subdirectory(spmm)
add_subdirectory(spmm_advanced)
endif()
Expand Down
15 changes: 6 additions & 9 deletions Libraries/hipSPARSELt/spmm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,17 @@ select_gpu_language()
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
select_hip_platform()

# see https://github.com/ROCm/rocm-libraries/blob/40bbc75960836d1b9e0573606df9dd79800e412a/projects/hipsparselt/cmake/hipsparselt_supported_architectures.cmake#L10-L21
set(HIPSPARSELT_SUPPORTED_ARCH gfx942 gfx950)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPSPARSELT_SUPPORTED_ARCH)
message(FATAL_ERROR "hipSPARSELt does not support architecture: ${ARCH}, not building hipSPARSELt examples")
endif()
endforeach()

include("${CMAKE_CURRENT_LIST_DIR}/../../../Common/ROCmPath.cmake")

find_package(hip REQUIRED)
find_package(hipsparselt REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/../../../Common/FilterHIPArchitectures.cmake")
filter_hip_architectures("hipSPARSELt" "gfx942;gfx950" SHOULD_SKIP)
if(SHOULD_SKIP)
return()
endif()

add_executable(${example_name} main.cpp)
# Make example runnable using CTest
add_test(NAME ${example_name} COMMAND ${example_name})
Expand Down
15 changes: 6 additions & 9 deletions Libraries/hipSPARSELt/spmm_advanced/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,17 @@ select_gpu_language()
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
select_hip_platform()

# see https://github.com/ROCm/rocm-libraries/blob/40bbc75960836d1b9e0573606df9dd79800e412a/projects/hipsparselt/cmake/hipsparselt_supported_architectures.cmake#L10-L21
set(HIPSPARSELT_SUPPORTED_ARCH gfx942 gfx950)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPSPARSELT_SUPPORTED_ARCH)
message(FATAL_ERROR "hipSPARSELt does not support architecture: ${ARCH}, not building hipSPARSELt examples")
endif()
endforeach()

include("${CMAKE_CURRENT_LIST_DIR}/../../../Common/ROCmPath.cmake")

find_package(hip REQUIRED)
find_package(hipsparselt REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/../../../Common/FilterHIPArchitectures.cmake")
filter_hip_architectures("hipSPARSELt" "gfx942;gfx950" SHOULD_SKIP)

@zichguan-amd zichguan-amd May 20, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get these archs from hipSPARSELt so we don't need to maintain the list here?

if(SHOULD_SKIP)
return()
endif()

add_executable(${example_name} main.cpp)
# Make example runnable using CTest
add_test(NAME ${example_name} COMMAND ${example_name})
Expand Down
Loading