Update cuDSS to 1.0.0 Require cuDSS 1.0.0 in CMakeLists.txt, update the Linux (Ubuntu 24.04 CUDA 12 and Ubuntu 26.04 CUDA 13) and Windows CI workflows to cuDSS 1.0.0 (1.0.0.35), and remove the pre-1.0 CUDSS_VERSION compatibility shims and CuDSSDataType aliases from cuda_sparse_cholesky.cc. Change-Id: I845b0c4b26e9c23939429fa3ff942c04c7aa626d
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b8d9aa5..534c1f9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml
@@ -30,9 +30,9 @@ - no-cuda include: - os: ubuntu:24.04 - cudss: 0.3.0.9_cuda12 + cudss: 1.0.0.35_cuda12 - os: ubuntu:26.04 - cudss: 0.8.0.10_cuda13 + cudss: 1.0.0.35_cuda13 steps: - name: Setup Dependencies
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9fe8b28..62a7ed5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml
@@ -140,21 +140,21 @@ id: cache-cudss uses: actions/cache@v4 with: - path: ${{github.workspace}}/libcudss-windows-x86_64-0.8.0.10_cuda13-archive - key: ${{runner.os}}-${{matrix.msvc}}-cudss-0.8.0.10-cuda13-v1 + path: ${{github.workspace}}/libcudss-windows-x86_64-1.0.0.35_cuda13-archive + key: ${{runner.os}}-${{matrix.msvc}}-cudss-1.0.0.35-cuda13-v1 - name: Download and extract cuDSS if: matrix.gpu == 'cuda' && steps.cache-cudss.outputs.cache-hit != 'true' run: | - $CUDSS_ARCHIVE = "${{github.workspace}}/libcudss-windows-x86_64-0.8.0.10_cuda13-archive.zip" - Invoke-WebRequest https://developer.download.nvidia.com/compute/cudss/redist/libcudss/windows-x86_64/libcudss-windows-x86_64-0.8.0.10_cuda13-archive.zip -OutFile $CUDSS_ARCHIVE + $CUDSS_ARCHIVE = "${{github.workspace}}/libcudss-windows-x86_64-1.0.0.35_cuda13-archive.zip" + Invoke-WebRequest https://developer.download.nvidia.com/compute/cudss/redist/libcudss/windows-x86_64/libcudss-windows-x86_64-1.0.0.35_cuda13-archive.zip -OutFile $CUDSS_ARCHIVE Expand-Archive -Path $CUDSS_ARCHIVE -DestinationPath "${{github.workspace}}" Remove-Item $CUDSS_ARCHIVE - name: Setup cuDSS environment if: matrix.gpu == 'cuda' run: | - $CUDSS_PATH = "${{github.workspace}}/libcudss-windows-x86_64-0.8.0.10_cuda13-archive/" + $CUDSS_PATH = "${{github.workspace}}/libcudss-windows-x86_64-1.0.0.35_cuda13-archive/" echo "cudss_DIR=$CUDSS_PATH/lib/cmake/cudss" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "$CUDSS_PATH/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4007bb1..48ce3eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -156,7 +156,7 @@ find_package(BLAS) find_package(LAPACK) find_package(CUDAToolkit) -find_package(cudss NO_MODULE) +find_package(cudss 1.0.0 NO_MODULE) # Eigen3's CMake package prior to version 5.0.0 does not support version # ranges with different major version components.
diff --git a/internal/ceres/cuda_sparse_cholesky.cc b/internal/ceres/cuda_sparse_cholesky.cc index bb39ec1..75f1c6e 100644 --- a/internal/ceres/cuda_sparse_cholesky.cc +++ b/internal/ceres/cuda_sparse_cholesky.cc
@@ -48,23 +48,6 @@ namespace ceres::internal { -// cuDSS 0.8 replaced cudaDataType_t with cudssDataType_t in the matrix -// creation APIs. The enumerators of cudssDataType_t mirror the values of -// their cudaDataType_t counterparts, but the two enum types are not -// implicitly convertible, so pick the right type and enumerators at compile -// time to stay compatible with both versions of the API. -#if CUDSS_VERSION >= 800 -using CuDSSDataType = cudssDataType_t; -constexpr CuDSSDataType kCuDSSR32I = CUDSS_R_32I; -constexpr CuDSSDataType kCuDSSR32F = CUDSS_R_32F; -constexpr CuDSSDataType kCuDSSR64F = CUDSS_R_64F; -#else -using CuDSSDataType = cudaDataType_t; -constexpr CuDSSDataType kCuDSSR32I = CUDA_R_32I; -constexpr CuDSSDataType kCuDSSR32F = CUDA_R_32F; -constexpr CuDSSDataType kCuDSSR64F = CUDA_R_64F; -#endif // CUDSS_VERSION >= 800 - inline std::string cuDSSStatusToString(cudssStatus_t status) { switch (status) { case CUDSS_STATUS_SUCCESS: @@ -81,10 +64,8 @@ return "CUDSS_STATUS_EXECUTION_FAILED"; case CUDSS_STATUS_INTERNAL_ERROR: return "CUDSS_STATUS_INTERNAL_ERROR"; -#if CUDSS_VERSION >= 800 case CUDSS_STATUS_IR_FAILED: return "CUDSS_STATUS_IR_FAILED"; -#endif // CUDSS_VERSION >= 800 default: return "unknown cuDSS status: " + std::to_string(status); } @@ -141,8 +122,8 @@ void* rows_end, void* cols, void* values, - CuDSSDataType index_type, - CuDSSDataType value_type, + cudaDataType_t index_type, + cudaDataType_t value_type, cudssMatrixType_t matrix_type, cudssMatrixViewType_t matrix_storage_type, cudssIndexBase_t index_base) { @@ -156,12 +137,7 @@ rows_end, cols, values, -#if CUDSS_VERSION >= 800 - // cuDSS 0.8 takes the type of the row offsets - // separately from the type of the column - // indices; Ceres uses the same type for both. index_type, -#endif // CUDSS_VERSION >= 800 index_type, value_type, matrix_type, @@ -176,7 +152,7 @@ int64_t num_cols, int64_t leading_dimension_size, void* values, - CuDSSDataType value_type, + cudaDataType_t value_type, cudssLayout_t layout) { CUDSS_STATUS_OK_OR_RETURN_CUDSS_STATUS(Free()); @@ -214,8 +190,8 @@ public: static_assert(std::is_same_v<Scalar, float> || std::is_same_v<Scalar, double>, "Scalar type is unsupported by cuDSS"); - static constexpr CuDSSDataType kCuDSSScalar = - std::is_same_v<Scalar, float> ? kCuDSSR32F : kCuDSSR64F; + static constexpr cudaDataType_t kCuDSSScalar = + std::is_same_v<Scalar, float> ? CUDA_R_32F : CUDA_R_64F; CudaSparseCholeskyImpl(ContextImpl* context) : context_(context), @@ -404,7 +380,7 @@ nullptr, lhs_cols_d_.data(), lhs_values_d_.data(), - kCuDSSR32I, + CUDA_R_32I, kCuDSSScalar, CUDSS_MTYPE_SPD, CUDSS_MVIEW_LOWER,