From c5142fc99b4d4cdf9f94c42e5e2b95aaf0e7c098 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Wed, 21 Oct 2026 14:04:54 -0600 Subject: [PATCH] refactor(hipsparse): retire 4.8 feature flags Remove the HIPSPARSE_ENABLE_SPGEAM option and the HIPSPARSE_WITH_SPGEAM config macro; the generic SpGEAM API is now always built (still gated on CUDA >= 13.3 for the NVIDIA backend). --- projects/hipsparse/CMakeLists.txt | 1 - .../clients/include/hipsparse_test_unique_ptr.hpp | 2 +- .../hipsparse/clients/include/testing_spgeam_csr.hpp | 4 ++-- .../generic/example_hipsparse_spgeam_cpp.cpp | 8 -------- projects/hipsparse/clients/tests/test_spgeam_csr.cpp | 2 +- projects/hipsparse/docs/doxygen/Doxyfile | 3 +-- projects/hipsparse/library/include/CMakeLists.txt | 2 -- .../hipsparse/library/include/hipsparse-config.h.in | 3 --- .../library/include/hipsparse-generic-types.h | 4 ++-- .../include/internal/generic/hipsparse_spgeam.h | 11 +++++------ .../src/amd_detail/generic/hipsparse_spgeam.cpp | 4 ---- .../src/nvidia_detail/generic/hipsparse_spgeam.cpp | 2 +- .../hipsparse/library/src/nvidia_detail/utility.h | 2 +- 13 files changed, 14 insertions(+), 34 deletions(-) diff --git a/projects/hipsparse/CMakeLists.txt b/projects/hipsparse/CMakeLists.txt index 9794f496fd7c..6708f00b1e07 100644 --- a/projects/hipsparse/CMakeLists.txt +++ b/projects/hipsparse/CMakeLists.txt @@ -68,7 +68,6 @@ if(HIPSPARSE_ENABLE_CLIENT) endif() option(HIPSPARSE_BUILD_TESTING "Build test client." OFF) -option(HIPSPARSE_ENABLE_SPGEAM "Build hipSPARSE with the generic SpGEAM (sparse matrix sparse matrix addition) API." ON) option(HIPSPARSE_ENABLE_COVERAGE "Build with code coverage enabled." OFF) option(HIPSPARSE_ENABLE_ASAN "Build with address sanitizer enabled." OFF) option(HIPSPARSE_BUILD_DOCS "Build documentation." OFF) diff --git a/projects/hipsparse/clients/include/hipsparse_test_unique_ptr.hpp b/projects/hipsparse/clients/include/hipsparse_test_unique_ptr.hpp index eda2939fa563..e3cc10eb5ae1 100644 --- a/projects/hipsparse/clients/include/hipsparse_test_unique_ptr.hpp +++ b/projects/hipsparse/clients/include/hipsparse_test_unique_ptr.hpp @@ -345,7 +345,7 @@ namespace hipsparse_test // clang-format 19 (math-ci) rewrites "#if(" to "#if (", which clang-format // 18 (the repo pre-commit hook) reverts; disable so both formatters agree. // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on struct spgeam_struct { diff --git a/projects/hipsparse/clients/include/testing_spgeam_csr.hpp b/projects/hipsparse/clients/include/testing_spgeam_csr.hpp index 28ea51df6eda..691585820b80 100644 --- a/projects/hipsparse/clients/include/testing_spgeam_csr.hpp +++ b/projects/hipsparse/clients/include/testing_spgeam_csr.hpp @@ -45,7 +45,7 @@ void testing_spgeam_csr_bad_arg(const Arguments& argus) // clang-format 19 (math-ci) rewrites "#if(" to "#if (", which clang-format // 18 (the repo pre-commit hook) reverts; disable so both formatters agree. // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on int64_t m = 100; int64_t n = 100; @@ -293,7 +293,7 @@ template void testing_spgeam_csr(Arguments argus) { // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on int m = argus.M; int n = argus.N; diff --git a/projects/hipsparse/clients/samples/documentation_examples/generic/example_hipsparse_spgeam_cpp.cpp b/projects/hipsparse/clients/samples/documentation_examples/generic/example_hipsparse_spgeam_cpp.cpp index aecd587627c3..58e654fca7e2 100644 --- a/projects/hipsparse/clients/samples/documentation_examples/generic/example_hipsparse_spgeam_cpp.cpp +++ b/projects/hipsparse/clients/samples/documentation_examples/generic/example_hipsparse_spgeam_cpp.cpp @@ -44,7 +44,6 @@ } \ } -#ifdef HIPSPARSE_WITH_SPGEAM //! [doc example start] int main() { @@ -254,10 +253,3 @@ int main() return 0; } //! [doc example end] -#else -int main() -{ - // hipSPARSE was built with the generic SpGEAM API disabled (HIPSPARSE_WITH_SPGEAM off). - return 0; -} -#endif diff --git a/projects/hipsparse/clients/tests/test_spgeam_csr.cpp b/projects/hipsparse/clients/tests/test_spgeam_csr.cpp index d54252ac9384..fbe84e68dbdc 100644 --- a/projects/hipsparse/clients/tests/test_spgeam_csr.cpp +++ b/projects/hipsparse/clients/tests/test_spgeam_csr.cpp @@ -27,7 +27,7 @@ // clang-format 19 (math-ci) rewrites "#if(" to "#if (", which clang-format // 18 (the repo pre-commit hook) reverts; disable so both formatters agree. // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on TEST_ROUTINE(spgeam_csr, generic, diff --git a/projects/hipsparse/docs/doxygen/Doxyfile b/projects/hipsparse/docs/doxygen/Doxyfile index 27cab7922a11..8d311cf9d6e4 100644 --- a/projects/hipsparse/docs/doxygen/Doxyfile +++ b/projects/hipsparse/docs/doxygen/Doxyfile @@ -2168,8 +2168,7 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = __attribute__(x)= \ __inline= \ HIPSPARSE_EXPORT= \ - HIPSPARSE_DEPRECATED_MSG(x)= \ - HIPSPARSE_WITH_SPGEAM + HIPSPARSE_DEPRECATED_MSG(x)= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/projects/hipsparse/library/include/CMakeLists.txt b/projects/hipsparse/library/include/CMakeLists.txt index 5999b63c4273..1e14e8e99eb8 100644 --- a/projects/hipsparse/library/include/CMakeLists.txt +++ b/projects/hipsparse/library/include/CMakeLists.txt @@ -6,8 +6,6 @@ include(GenerateExportHeader) # Configure the version header (version numbers only) and the config header # (build-time feature flags). Variables consumed by #cmakedefine in the .h.in # templates must be set (or unset) prior to the configure_file() calls. -set(HIPSPARSE_WITH_SPGEAM ${HIPSPARSE_ENABLE_SPGEAM}) - configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/hipsparse-version.h.in" "${PROJECT_BINARY_DIR}/include/hipsparse/hipsparse-version.h" diff --git a/projects/hipsparse/library/include/hipsparse-config.h.in b/projects/hipsparse/library/include/hipsparse-config.h.in index 7f7e0debeaf8..c96f15f2a25c 100644 --- a/projects/hipsparse/library/include/hipsparse-config.h.in +++ b/projects/hipsparse/library/include/hipsparse-config.h.in @@ -36,7 +36,4 @@ /* Build-time feature flags baked in at compile time. */ -/* hipSPARSE 5.1 */ -#cmakedefine HIPSPARSE_WITH_SPGEAM - #endif /* HIPSPARSE_CONFIG_H */ diff --git a/projects/hipsparse/library/include/hipsparse-generic-types.h b/projects/hipsparse/library/include/hipsparse-generic-types.h index d6f88f02e9d0..7bc9754ad126 100644 --- a/projects/hipsparse/library/include/hipsparse-generic-types.h +++ b/projects/hipsparse/library/include/hipsparse-generic-types.h @@ -166,7 +166,7 @@ typedef struct hipsparseSpGEMMDescr* hipsparseSpGEMMDescr_t; // clang-format 19 (math-ci) rewrites "#if(" to "#if (", which clang-format // 18 (the repo pre-commit hook) reverts; disable so both formatters agree. // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on typedef struct hipsparseSpGEAMDescr* hipsparseSpGEAMDescr_t; #endif @@ -617,7 +617,7 @@ typedef enum * library to perform sparse matrix sparse matrix addition. */ // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on typedef enum { diff --git a/projects/hipsparse/library/include/internal/generic/hipsparse_spgeam.h b/projects/hipsparse/library/include/internal/generic/hipsparse_spgeam.h index 4058563f829a..a87448625833 100644 --- a/projects/hipsparse/library/include/internal/generic/hipsparse_spgeam.h +++ b/projects/hipsparse/library/include/internal/generic/hipsparse_spgeam.h @@ -24,7 +24,6 @@ #ifndef HIPSPARSE_SPGEAM_H #define HIPSPARSE_SPGEAM_H -// The generic SpGEAM API is gated behind the HIPSPARSE_WITH_SPGEAM build-time feature flag. // Use the include-root-relative path so it resolves both in the hipSPARSE build and for // downstream consumers that only add the include root (e.g. -I /include) to their path. #include "hipsparse/hipsparse-config.h" @@ -43,7 +42,7 @@ extern "C" { // clang-format 19 (math-ci) rewrites "#if(" to "#if (", which clang-format // 18 (the repo pre-commit hook) reverts; disable so both formatters agree. // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpGEAM_createDescr(hipsparseSpGEAMDescr_t* descr); @@ -57,7 +56,7 @@ hipsparseStatus_t hipsparseSpGEAM_createDescr(hipsparseSpGEAMDescr_t* descr); * resources used by the descriptor. */ // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpGEAM_destroyDescr(hipsparseSpGEAMDescr_t descr); @@ -108,7 +107,7 @@ hipsparseStatus_t hipsparseSpGEAM_destroyDescr(hipsparseSpGEAMDescr_t descr); * \p opB != \ref HIPSPARSE_OPERATION_NON_TRANSPOSE. */ // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpGEAM_bufferSize(hipsparseHandle_t handle, @@ -172,7 +171,7 @@ hipsparseStatus_t hipsparseSpGEAM_bufferSize(hipsparseHandle_t handle, * \p opB != \ref HIPSPARSE_OPERATION_NON_TRANSPOSE. */ // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpGEAM_nnz(hipsparseHandle_t handle, @@ -253,7 +252,7 @@ hipsparseStatus_t hipsparseSpGEAM_nnz(hipsparseHandle_t handle, * \p opB != \ref HIPSPARSE_OPERATION_NON_TRANSPOSE. */ // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && (!defined(CUDART_VERSION) || CUDART_VERSION >= 13030)) +#if(!defined(CUDART_VERSION) || CUDART_VERSION >= 13030) // clang-format on HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpGEAM(hipsparseHandle_t handle, diff --git a/projects/hipsparse/library/src/amd_detail/generic/hipsparse_spgeam.cpp b/projects/hipsparse/library/src/amd_detail/generic/hipsparse_spgeam.cpp index daa0b508899b..6c2fcb45aa2f 100644 --- a/projects/hipsparse/library/src/amd_detail/generic/hipsparse_spgeam.cpp +++ b/projects/hipsparse/library/src/amd_detail/generic/hipsparse_spgeam.cpp @@ -31,8 +31,6 @@ #include -#ifdef HIPSPARSE_WITH_SPGEAM - // hipSPARSE SpGEAM descriptor. Wraps the staged rocSPARSE SpGEAM descriptor and // caches the analysis buffer size so that it can be shared by the nnz and compute // steps (matching the single-buffer cuSPARSE SpGEAM interface). @@ -622,5 +620,3 @@ hipsparseStatus_t hipsparseSpGEAM(hipsparseHandle_t handle, return HIPSPARSE_STATUS_SUCCESS; } - -#endif /* HIPSPARSE_WITH_SPGEAM */ diff --git a/projects/hipsparse/library/src/nvidia_detail/generic/hipsparse_spgeam.cpp b/projects/hipsparse/library/src/nvidia_detail/generic/hipsparse_spgeam.cpp index 6d0698cec585..cf5e0fc1baf8 100644 --- a/projects/hipsparse/library/src/nvidia_detail/generic/hipsparse_spgeam.cpp +++ b/projects/hipsparse/library/src/nvidia_detail/generic/hipsparse_spgeam.cpp @@ -31,7 +31,7 @@ // clang-format 19 (math-ci) rewrites "#if(" to "#if (", which clang-format // 18 (the repo pre-commit hook) reverts; disable so both formatters agree. // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && CUDART_VERSION >= 13030) +#if(CUDART_VERSION >= 13030) // clang-format on namespace { diff --git a/projects/hipsparse/library/src/nvidia_detail/utility.h b/projects/hipsparse/library/src/nvidia_detail/utility.h index 1b244bd47d5c..eca288fcea4b 100644 --- a/projects/hipsparse/library/src/nvidia_detail/utility.h +++ b/projects/hipsparse/library/src/nvidia_detail/utility.h @@ -1051,7 +1051,7 @@ namespace hipsparse // clang-format 19 (math-ci) rewrites "#if(" to "#if (", which clang-format // 18 (the repo pre-commit hook) reverts; disable so both formatters agree. // clang-format off -#if(defined(HIPSPARSE_WITH_SPGEAM) && CUDART_VERSION >= 13030) +#if(CUDART_VERSION >= 13030) // clang-format on inline cusparseSpGEAMAlg_t hipSpGEAMAlgToCudaSpGEAMAlg(hipsparseSpGEAMAlg_t alg) {