@@ -158,12 +158,7 @@ function mv!(transa::SparseChar, alpha::Number, A::Union{CuSparseMatrixCSC{TA},C
158158 # Support transa = 'C' for real matrices
159159 transa = T <: Real && transa == ' C' ? ' T' : transa
160160
161- if CUSPARSE. version () < v " 12.0" && isa (A, CuSparseMatrixCSC) && transa == ' C' && TA <: Complex
162- throw (ArgumentError (" Matrix-vector multiplication with the adjoint of a complex CSC matrix" *
163- " is not supported by the current CUDA version. Use a CSR or COO matrix instead." ))
164- end
165-
166- if CUSPARSE. version () < v " 12.0" && isa (A, CuSparseMatrixCSC)
161+ if isa (A, CuSparseMatrixCSC)
167162 # cusparseSpMV completely supports CSC matrices with CUSPARSE.version() ≥ v"12.0".
168163 # We use Aᵀ to model them as CSR matrices for older versions of CUSPARSE.
169164 descA = CuSparseMatrixDescriptor (A, index, transposed= true )
@@ -186,9 +181,9 @@ function mv!(transa::SparseChar, alpha::Number, A::Union{CuSparseMatrixCSC{TA},C
186181 # operations with 16-bit numbers always imply mixed-precision computation
187182 # TODO : we should better model the supported combinations here,
188183 # and error if using an unsupported one (like with gemmEx!)
189- compute_type = if version () >= v " 11.4 " && T == Float16
184+ compute_type = if T == Float16
190185 Float32
191- elseif version () >= v " 11.7.2 " && T == ComplexF16
186+ elseif T == ComplexF16
192187 ComplexF32
193188 else
194189 T
@@ -216,21 +211,8 @@ function mm!(transa::SparseChar, transb::SparseChar, alpha::Number, A::CuSparseM
216211 transa = T <: Real && transa == ' C' ? ' T' : transa
217212 transb = T <: Real && transb == ' C' ? ' T' : transb
218213
219- if CUSPARSE. version () < v " 12.0" && isa (A, CuSparseMatrixCSC) && transa == ' C' && T <: Complex
220- throw (ArgumentError (" Matrix-matrix multiplication with the adjoint of a complex CSC matrix" *
221- " is not supported by the current CUDA version. Use a CSR or COO matrix instead." ))
222- end
223-
224- if CUSPARSE. version () < v " 12.0" && isa (A, CuSparseMatrixCSC)
225- # cusparseSpMM completely supports CSC matrices with CUSPARSE.version() ≥ v"12.0".
226- # We use Aᵀ to model them as CSR matrices for older versions of CUSPARSE.
227- descA = CuSparseMatrixDescriptor (A, index, transposed= true )
228- k,m = size (A)
229- transa = transa == ' N' ? ' T' : ' N'
230- else
231- descA = CuSparseMatrixDescriptor (A, index)
232- m,k = size (A)
233- end
214+ descA = CuSparseMatrixDescriptor (A, index)
215+ m,k = size (A)
234216 n = size (C)[2 ]
235217
236218 if transa == ' N' && transb == ' N'
288270function bmm! (transa:: SparseChar , transb:: SparseChar , alpha:: Number , A:: CuSparseArrayCSR{T,Ti,3} ,
289271 B:: DenseCuArray{T,3} , beta:: Number , C:: DenseCuArray{T,3} , index:: SparseChar , algo:: cusparseSpMMAlg_t = CUSPARSE_SPMM_ALG_DEFAULT) where {T,Ti}
290272
291- if CUSPARSE. version () < v " 11.7.2"
292- throw (ErrorException (" Batched dense-matrix times batched sparse-matrix (bmm!) requires a CUSPARSE version ≥ 11.7.2 (yours: $(CUSPARSE. version ()) )." ))
293- end
294-
295273 # Support transa = 'C' and `transb = 'C' for real matrices
296274 transa = T <: Real && transa == ' C' ? ' T' : transa
297275 transb = T <: Real && transb == ' C' ? ' T' : transb
@@ -341,7 +319,7 @@ function bmm!(transa::SparseChar, transb::SparseChar, alpha::Number, A::CuSparse
341319 end
342320 with_workspace (bufferSize) do buffer
343321 # We should find a way to reuse the buffer (issue #1362)
344- if ! (A isa CuSparseMatrixCOO) && (CUSPARSE . version () ≥ v " 11.7.2 " )
322+ if ! (A isa CuSparseMatrixCOO)
345323 cusparseSpMM_preprocess (
346324 handle (), transa, transb, Ref {T} (alpha), descA, descB, Ref {T} (beta),
347325 descC, T, algo, buffer)
@@ -357,8 +335,6 @@ function mm!(transa::SparseChar, transb::SparseChar, alpha::Number, A::DenseCuMa
357335 B:: Union{CuSparseMatrixCSC{T},CuSparseMatrixCSR{T},CuSparseMatrixCOO{T}} , beta:: Number ,
358336 C:: DenseCuMatrix{T} , index:: SparseChar , algo:: cusparseSpMMAlg_t = CUSPARSE_SPMM_ALG_DEFAULT) where {T}
359337
360- CUSPARSE. version () < v " 11.7.4" && throw (ErrorException (" This operation is not supported by the current CUDA version." ))
361-
362338 # Support transa = 'C' and `transb = 'C' for real matrices
363339 transa = T <: Real && transa == ' C' ? ' T' : transa
364340 transb = T <: Real && transb == ' C' ? ' T' : transb
@@ -369,11 +345,6 @@ function mm!(transa::SparseChar, transb::SparseChar, alpha::Number, A::DenseCuMa
369345 # Cc = α * Ac * Bᴴ + β * Cc → α * B̅ * Ar + β * Cr
370346 # where B is a sparse matrix, Ac and Cc indicate column-major layout, while Ar and Cr refer to row-major layout.
371347
372- if CUSPARSE. version () < v " 12.0" && isa (B, CuSparseMatrixCSR) && transb == ' C' && T <: Complex
373- throw (ArgumentError (" Matrix-matrix multiplication with the adjoint of a complex CSR matrix" *
374- " is not supported by the current CUDA version. Use a CSC or COO matrix instead." ))
375- end
376-
377348 m,k = size (A)
378349 n = size (C)[2 ]
379350
@@ -402,7 +373,7 @@ function mm!(transa::SparseChar, transb::SparseChar, alpha::Number, A::DenseCuMa
402373 end
403374 with_workspace (bufferSize) do buffer
404375 # We should find a way to reuse the buffer (issue #1362)
405- if ! (B isa CuSparseMatrixCOO) && (CUSPARSE . version () ≥ v " 11.7.2 " )
376+ if ! (B isa CuSparseMatrixCOO)
406377 cusparseSpMM_preprocess (
407378 handle (), transb, transa, Ref {T} (alpha), descB, descA, Ref {T} (beta),
408379 descC, T, algo, buffer)
824795function sddmm! (transa:: SparseChar , transb:: SparseChar , alpha:: Number , A:: DenseCuMatrix{T} , B:: DenseCuMatrix{T} ,
825796 beta:: Number , C:: Union{CuSparseMatrixCSR{T},CuSparseMatrixBSR{T}} , index:: SparseChar , algo:: cusparseSDDMMAlg_t = CUSPARSE_SDDMM_ALG_DEFAULT) where {T}
826797
827- CUSPARSE. version () < v " 11.4.1" && throw (ErrorException (" This operation is not supported by the current CUDA version." ))
828798 (C isa CuSparseMatrixBSR) && (CUSPARSE. version () < v " 12.1.0" ) && throw (ErrorException (" This operation is not supported by the current CUDA version." ))
829799
830800 # Support transa = 'C' and `transb = 'C' for real matrices
0 commit comments