Skip to content

Commit 160f941

Browse files
manuelbb-upbamontoison
authored andcommitted
lib/cusparse/helpers.jl: CuSparseMatrixDescriptor args
1 parent 1a006ea commit 160f941

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/cusparse/helpers.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,14 @@ mutable struct CuSparseMatrixDescriptor
239239

240240
function CuSparseMatrixDescriptor(A::CuSparseMatrixBSR, IndexBase::Char)
241241
desc_ref = Ref{cusparseSpMatDescr_t}()
242+
brows, bcols = cld.(size(A), A.blockDim)
242243
cusparseCreateBsr(
243244
desc_ref,
244-
size(A)..., nnz(A),
245+
brows, bcols, A.nnzb,
245246
A.blockDim, A.blockDim,
246-
A.rowPtr, A.colVal, nonzeros(A),
247+
A.rowPtr, A.colVal, A.nzVal,
247248
eltype(A.rowPtr), eltype(A.colVal), IndexBase,
248-
eltype(nonzeros(A)), A.dir
249+
eltype(A.nzVal), A.dir
249250
)
250251
obj = new(desc_ref[])
251252
finalizer(cusparseDestroySpMat, obj)

0 commit comments

Comments
 (0)