From 06b57d174555163275cde76df5639888d1623422 Mon Sep 17 00:00:00 2001 From: amontoison Date: Wed, 11 Dec 2024 12:38:53 -0600 Subject: [PATCH] Support cuDSS v0.4.0 --- gen/Project.toml | 4 +-- src/libcudss.jl | 79 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/gen/Project.toml b/gen/Project.toml index 86c7d36..416896a 100644 --- a/gen/Project.toml +++ b/gen/Project.toml @@ -5,6 +5,6 @@ Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31" JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" [compat] -CUDA_SDK_jll = "12.5.1" -CUDSS_jll = "0.3.0" +CUDA_SDK_jll = "12.6.3" +CUDSS_jll = "0.4.0" julia = "1.6" diff --git a/src/libcudss.jl b/src/libcudss.jl index 3bebe10..8b88a5a 100644 --- a/src/libcudss.jl +++ b/src/libcudss.jl @@ -70,6 +70,7 @@ end CUDSS_DATA_USER_PERM = 9 CUDSS_DATA_HYBRID_DEVICE_MEMORY_MIN = 10 CUDSS_DATA_COMM = 11 + CUDSS_DATA_MEMORY_ESTIMATES = 12 end @cenum cudssPhase_t::UInt32 begin @@ -255,6 +256,35 @@ end indexBase::cudssIndexBase_t)::cudssStatus_t end +@checked function cudssMatrixCreateBatchDn(matrix, batchCount, nrows, ncols, ld, values, + valueType, layout) + initialize_context() + @gcsafe_ccall libcudss.cudssMatrixCreateBatchDn(matrix::Ptr{cudssMatrix_t}, + batchCount::Int64, nrows::Ptr{Cvoid}, + ncols::Ptr{Cvoid}, ld::Ptr{Cvoid}, + values::Ptr{Ptr{Cvoid}}, + valueType::cudaDataType_t, + layout::cudssLayout_t)::cudssStatus_t +end + +@checked function cudssMatrixCreateBatchCsr(matrix, batchCount, nrows, ncols, nnz, rowStart, + rowEnd, colIndices, values, indexType, + valueType, mtype, mview, indexBase) + initialize_context() + @gcsafe_ccall libcudss.cudssMatrixCreateBatchCsr(matrix::Ptr{cudssMatrix_t}, + batchCount::Int64, nrows::Ptr{Cvoid}, + ncols::Ptr{Cvoid}, nnz::Ptr{Cvoid}, + rowStart::Ptr{Ptr{Cvoid}}, + rowEnd::Ptr{Ptr{Cvoid}}, + colIndices::Ptr{Ptr{Cvoid}}, + values::Ptr{Ptr{Cvoid}}, + indexType::cudaDataType_t, + valueType::cudaDataType_t, + mtype::cudssMatrixType_t, + mview::cudssMatrixViewType_t, + indexBase::cudssIndexBase_t)::cudssStatus_t +end + @checked function cudssMatrixDestroy(matrix) initialize_context() @gcsafe_ccall libcudss.cudssMatrixDestroy(matrix::cudssMatrix_t)::cudssStatus_t @@ -300,6 +330,55 @@ end values::CuPtr{Cvoid})::cudssStatus_t end +@checked function cudssMatrixGetBatchDn(matrix, batchCount, nrows, ncols, ld, values, type, + layout) + initialize_context() + @gcsafe_ccall libcudss.cudssMatrixGetBatchDn(matrix::cudssMatrix_t, + batchCount::Ptr{Int64}, + nrows::Ptr{Ptr{Cvoid}}, + ncols::Ptr{Ptr{Cvoid}}, + ld::Ptr{Ptr{Cvoid}}, + values::Ptr{Ptr{Ptr{Cvoid}}}, + type::Ptr{cudaDataType_t}, + layout::Ptr{cudssLayout_t})::cudssStatus_t +end + +@checked function cudssMatrixGetBatchCsr(matrix, batchCount, nrows, ncols, nnz, rowStart, + rowEnd, colIndices, values, indexType, valueType, + mtype, mview, indexBase) + initialize_context() + @gcsafe_ccall libcudss.cudssMatrixGetBatchCsr(matrix::cudssMatrix_t, + batchCount::Ptr{Int64}, + nrows::Ptr{Ptr{Cvoid}}, + ncols::Ptr{Ptr{Cvoid}}, + nnz::Ptr{Ptr{Cvoid}}, + rowStart::Ptr{Ptr{Ptr{Cvoid}}}, + rowEnd::Ptr{Ptr{Ptr{Cvoid}}}, + colIndices::Ptr{Ptr{Ptr{Cvoid}}}, + values::Ptr{Ptr{Ptr{Cvoid}}}, + indexType::Ptr{cudaDataType_t}, + valueType::Ptr{cudaDataType_t}, + mtype::Ptr{cudssMatrixType_t}, + mview::Ptr{cudssMatrixViewType_t}, + indexBase::Ptr{cudssIndexBase_t})::cudssStatus_t +end + +@checked function cudssMatrixSetBatchValues(matrix, values) + initialize_context() + @gcsafe_ccall libcudss.cudssMatrixSetBatchValues(matrix::cudssMatrix_t, + values::Ptr{Ptr{Cvoid}})::cudssStatus_t +end + +@checked function cudssMatrixSetBatchCsrPointers(matrix, rowOffsets, rowEnd, colIndices, + values) + initialize_context() + @gcsafe_ccall libcudss.cudssMatrixSetBatchCsrPointers(matrix::cudssMatrix_t, + rowOffsets::Ptr{Ptr{Cvoid}}, + rowEnd::Ptr{Ptr{Cvoid}}, + colIndices::Ptr{Ptr{Cvoid}}, + values::Ptr{Ptr{Cvoid}})::cudssStatus_t +end + @checked function cudssMatrixGetFormat(matrix, format) initialize_context() @gcsafe_ccall libcudss.cudssMatrixGetFormat(matrix::cudssMatrix_t,