muSPARSE API 参考
目录
- musparse-auxiliary.h File
- musparseCreateCsr Function
- musparseCreateDnVec Function
- _MUSPARSE_AUXILIARY_H_ Macro
- musparseCreate Function
- musparseDestroy Function
- musparseSetStream Function
- musparseGetStream Function
- musparseSetPointerMode Function
- musparseGetPointerMode Function
- musparseGetVersion Function
- musparseGetGitRev Function
- musparseCreateMatDescr Function
- musparseCopyMatDescr Function
- musparseDestroyMatDescr Function
- musparseSetMatIndexBase Function
- musparseGetMatIndexBase Function
- musparseSetMatType Function
- musparseGetMatType Function
- musparseSetMatFillMode Function
- musparseGetMatFillMode Function
- musparseSetMatDiagType Function
- musparseGetMatDiagType Function
- musparseSetMatStorageMode Function
- musparseGetMatStorageMode Function
- musparseCreateHybMat Function
- musparseCopyHybMat Function
- musparseDestroyHybMat Function
- musparseCreateMatInfo Function
- musparseCopyMatInfo Function
- musparseDestroyMatInfo Function
- musparseCreateColorInfo Function
- musparseCopyColorInfo Function
- musparseDestroyColorInfo Function
- musparseCreateSpVec Function
- musparseCreateConstSpVec Function
- musparseDestroySpVec Function
- musparseSpVecGet Function
- musparseSpVecGetIndexBase Function
- musparseSpVecGetValues Function
- musparseSpVecSetValues Function
- musparseCreateCoo Function
- musparseCreateCooAos Function
- musparseCreateConstCsr Function
- musparseCreateCsc Function
- musparseCreateEll Function
- musparseCreateBlockedEll_legacy Function
- musparseDestroySpMat Function
- musparseCooAosGet Function
- musparseCooGet Function
- musparseCsrGet Function
- musparseEllGet Function
- musparseBlockedEllGet_legacy Function
- musparseCooSetPointers Function
- musparseCooAosSetPointers Function
- musparseCsrSetPointers Function
- musparseCscSetPointers Function
- musparseEllSetPointers Function
- musparseSpMatGetSize Function
- musparseSpMatGetFormat Function
- musparseSpMatGetIndexBase Function
- musparseSpMatGetValues Function
- musparseSpMatSetValues Function
- musparseSpMatGetAttribute Function
- musparseSpMatSetAttribute Function
- musparseDestroyDnVec Function
- musparseDnVecGet Function
- musparseDnVecGetValues Function
- musparseDnVecSetValues Function
- musparseCreateDnMat Function
- musparseDestroyDnMat Function
- musparseDnMatGet Function
- musparseDnMatGetValues Function
- musparseDnMatSetValues Function
- musparseDnMatGetStridedBatch Function
- musparseDnMatSetStridedBatch Function
- musparseSpMatGetStridedBatch Function
- musparseSpMatSetStridedBatch Function
- musparseCooSetStridedBatch Function
- musparseCsrSetStridedBatch Function
- musparseCscSetStridedBatch Function
- musparseGetErrorName Function
- musparseGetErrorString Function
- musparseGetProperty Function
- musparse-compatible.h File
- _MUSPARSE_WRAPPER_H Macro
- musparseLoggerCallback_t Typedef
- musparseCreateCsric02Info Function
- musparseDestroyCsric02Info Function
- musparseCreateBsric02Info Function
- musparseDestroyBsric02Info Function
- musparseCreateCsrilu02Info Function
- musparseDestroyCsrilu02Info Function
- musparseCreateBsrilu02Info Function
- musparseDestroyBsrilu02Info Function
- musparseCreateBsrsv2Info Function
- musparseDestroyBsrsv2Info Function
- musparseCreateBsrsm2Info Function
- musparseDestroyBsrsm2Info Function
- musparseCreateCsru2csrInfo Function
- musparseDestroyCsru2csrInfo Function
- musparseCreatePruneInfo Function
- musparseDestroyPruneInfo Function
- musparseScsrilu02_numericBoost Function
- musparseDcsrilu02_numericBoost Function
- musparseCcsrilu02_numericBoost Function
- musparseZcsrilu02_numericBoost Function
- musparseXcsrilu02_zeroPivot Function
- musparseScsrilu02_bufferSize Function
- musparseDcsrilu02_bufferSize Function
- musparseCcsrilu02_bufferSize Function
- musparseZcsrilu02_bufferSize Function
- musparseScsrilu02_analysis Function
- musparseDcsrilu02_analysis Function
- musparseCcsrilu02_analysis Function
- musparseZcsrilu02_analysis Function
- musparseScsrilu02 Function
- musparseDcsrilu02 Function
- musparseCcsrilu02 Function
- musparseZcsrilu02 Function
- musparseXcsrilu02_clear Function
- musparseSpSV_createDescr Function
- musparseSpSV_destroyDescr Function
- musparseSpSV_bufferSize Function
- musparseSpSV_analysis Function
- musparseSpSV_solve Function
- musparseSbsrilu02_numericBoost Function
- musparseDbsrilu02_numericBoost Function
- musparseCbsrilu02_numericBoost Function
- musparseZbsrilu02_numericBoost Function
- musparseXbsrilu02_zeroPivot Function
- musparseSbsrilu02_bufferSize Function
- musparseDbsrilu02_bufferSize Function
- musparseCbsrilu02_bufferSize Function
- musparseZbsrilu02_bufferSize Function
- musparseSbsrilu02_bufferSizeExt Function
- musparseDbsrilu02_bufferSizeExt Function
- musparseCbsrilu02_bufferSizeExt Function
- musparseZbsrilu02_bufferSizeExt Function
- musparseSbsrilu02_analysis Function
- musparseDbsrilu02_analysis Function
- musparseCbsrilu02_analysis Function
- musparseZbsrilu02_analysis Function
- musparseSbsrilu02 Function
- musparseDbsrilu02 Function
- musparseCbsrilu02 Function
- musparseZbsrilu02 Function
- musparseXcsric02_zeroPivot Function
- musparseScsric02_bufferSize Function
- musparseDcsric02_bufferSize Function
- musparseCcsric02_bufferSize Function
- musparseZcsric02_bufferSize Function
- musparseScsric02_bufferSizeExt Function
- musparseDcsric02_bufferSizeExt Function
- musparseCcsric02_bufferSizeExt Function
- musparseZcsric02_bufferSizeExt Function
- musparseScsric02_analysis Function
- musparseDcsric02_analysis Function
- musparseCcsric02_analysis Function
- musparseZcsric02_analysis Function
- musparseScsric02 Function
- musparseDcsric02 Function
- musparseCcsric02 Function
- musparseZcsric02 Function
- musparseXbsric02_zeroPivot Function
- musparseSbsric02_bufferSize Function
- musparseDbsric02_bufferSize Function
- musparseCbsric02_bufferSize Function
- musparseZbsric02_bufferSize Function
- musparseSbsric02_bufferSizeExt Function
- musparseDbsric02_bufferSizeExt Function
- musparseCbsric02_bufferSizeExt Function
- musparseZbsric02_bufferSizeExt Function
- musparseSbsric02_analysis Function
- musparseDbsric02_analysis Function
- musparseCbsric02_analysis Function
- musparseZbsric02_analysis Function
- musparseSbsric02 Function
- musparseDbsric02 Function
- musparseCbsric02 Function
- musparseZbsric02 Function
- musparseXbsrsm2_zeroPivot Function
- musparseSbsrsm2_bufferSize Function
- musparseDbsrsm2_bufferSize Function
- musparseCbsrsm2_bufferSize Function
- musparseZbsrsm2_bufferSize Function
- musparseSbsrsm2_bufferSizeExt Function
- musparseDbsrsm2_bufferSizeExt Function
- musparseCbsrsm2_bufferSizeExt Function
- musparseZbsrsm2_bufferSizeExt Function
- musparseSbsrsm2_analysis Function
- musparseDbsrsm2_analysis Function
- musparseCbsrsm2_analysis Function
- musparseZbsrsm2_analysis Function
- musparseSbsrsm2_solve Function
- musparseDbsrsm2_solve Function
- musparseCbsrsm2_solve Function
- musparseZbsrsm2_solve Function
- musparseXbsrsv2_zeroPivot Function
- musparseSbsrsv2_bufferSize Function
- musparseDbsrsv2_bufferSize Function
- musparseCbsrsv2_bufferSize Function
- musparseZbsrsv2_bufferSize Function
- musparseSbsrsv2_bufferSizeExt Function
- musparseDbsrsv2_bufferSizeExt Function
- musparseCbsrsv2_bufferSizeExt Function
- musparseZbsrsv2_bufferSizeExt Function
- musparseSbsrsv2_analysis Function
- musparseDbsrsv2_analysis Function
- musparseCbsrsv2_analysis Function
- musparseZbsrsv2_analysis Function
- musparseSbsrsv2_solve Function
- musparseDbsrsv2_solve Function
- musparseCbsrsv2_solve Function
- musparseZbsrsv2_solve Function
- musparseScsr2gebsr_bufferSize Function
- musparseDcsr2gebsr_bufferSize Function
- musparseCcsr2gebsr_bufferSize Function
- musparseZcsr2gebsr_bufferSize Function
- musparseScsrmm2 Function
- musparseDcsrmm2 Function
- musparseCcsrmm2 Function
- musparseZcsrmm2 Function
- musparseScsrgeam2_bufferSizeExt Function
- musparseDcsrgeam2_bufferSizeExt Function
- musparseCcsrgeam2_bufferSizeExt Function
- musparseZcsrgeam2_bufferSizeExt Function
- musparseXcsrgeam2Nnz Function
- musparseScsrgeam2 Function
- musparseDcsrgeam2 Function
- musparseCcsrgeam2 Function
- musparseZcsrgeam2 Function
- musparseHpruneCsr2csr_bufferSizeExt Function
- musparseSpruneCsr2csr_bufferSizeExt Function
- musparseDpruneCsr2csr_bufferSizeExt Function
- musparseHpruneCsr2csrNnz Function
- musparseSpruneCsr2csrNnz Function
- musparseDpruneCsr2csrNnz Function
- musparseHpruneCsr2csr Function
- musparseHpruneCsr2csrNnzByPercentage Function
- musparseSpruneCsr2csrNnzByPercentage Function
- musparseDpruneCsr2csrNnzByPercentage Function
- musparseHpruneCsr2csrByPercentage Function
- musparseHpruneCsr2csrByPercentage_bufferSizeExt Function
- musparseSpruneCsr2csrByPercentage_bufferSizeExt Function
- musparseDpruneCsr2csrByPercentage_bufferSizeExt Function
- musparseHpruneDense2csr_bufferSizeExt Function
- musparseSpruneDense2csr_bufferSizeExt Function
- musparseDpruneDense2csr_bufferSizeExt Function
- musparseHpruneDense2csrNnz Function
- musparseSpruneDense2csrNnz Function
- musparseDpruneDense2csrNnz Function
- musparseHpruneDense2csr Function
- musparseHpruneDense2csrByPercentage_bufferSizeExt Function
- musparseSpruneDense2csrByPercentage_bufferSizeExt Function
- musparseDpruneDense2csrByPercentage_bufferSizeExt Function
- musparseHpruneDense2csrNnzByPercentage Function
- musparseSpruneDense2csrNnzByPercentage Function
- musparseDpruneDense2csrNnzByPercentage Function
- musparseXcoosort_bufferSizeExt Function
- musparseXcscsort_bufferSizeExt Function
- musparseXcsr2bsrNnz Function
- musparseScsru2csr_bufferSizeExt Function
- musparseDcsru2csr_bufferSizeExt Function
- musparseCcsru2csr_bufferSizeExt Function
- musparseZcsru2csr_bufferSizeExt Function
- musparseScsru2csr Function
- musparseDcsru2csr Function
- musparseCcsru2csr Function
- musparseZcsru2csr Function
- musparseScsr2csru Function
- musparseDcsr2csru Function
- musparseCcsr2csru Function
- musparseZcsr2csru Function
- musparseXcsrsort_bufferSizeExt Function
- musparseSpSV_updateMatrix Function
- musparseConstSpVecGet Function
- musparseConstSpVecGetValues Function
- musparseXgebsr2gebsrNnz Function
- musparseCreateSlicedEll Function
- musparseCreateConstSlicedEll Function
- musparseCreateBlockedEll Function
- musparseCreateConstBlockedEll Function
- musparseBlockedEllGet Function
- musparseConstBlockedEllGet Function
- musparseCreateBsr Function
- musparseCscGet Function
- musparseBsrSetStridedBatch Function
- musparseSpVV_bufferSize Function
- musparseSpVV Function
- musparseSparseToDense_bufferSize Function
- musparseSparseToDense Function
- musparseXcsr2gebsrNnz Function
- musparseCgebsr2gebsc_bufferSize Function
- musparseCgtsv2 Function
- musparseCgtsv2StridedBatch Function
- musparseCgtsv2StridedBatch_bufferSizeExt Function
- musparseCgtsv2_bufferSizeExt Function
- musparseCgtsv2_nopivot Function
- musparseCgtsv2_nopivot_bufferSizeExt Function
- musparseCgtsvInterleavedBatch Function
- musparseCgtsvInterleavedBatch_bufferSizeExt Function
- musparseCgebsr2gebsr_bufferSize Function
- musparseCgemvi_bufferSize Function
- musparseCgpsvInterleavedBatch Function
- musparseCgpsvInterleavedBatch_bufferSizeExt Function
- musparseDgebsr2gebsc_bufferSize Function
- musparseDgebsr2gebsr_bufferSize Function
- musparseDgemvi_bufferSize Function
- musparseDgpsvInterleavedBatch Function
- musparseDgpsvInterleavedBatch_bufferSizeExt Function
- musparseDgtsv2 Function
- musparseDgtsv2StridedBatch Function
- musparseDgtsv2StridedBatch_bufferSizeExt Function
- musparseDgtsv2_bufferSizeExt Function
- musparseDgtsv2_nopivot Function
- musparseDgtsv2_nopivot_bufferSizeExt Function
- musparseDgtsvInterleavedBatch Function
- musparseDgtsvInterleavedBatch_bufferSizeExt Function
- musparseSgebsr2gebsc_bufferSize Function
- musparseSgebsr2gebsr_bufferSize Function
- musparseSgemvi_bufferSize Function
- musparseSgpsvInterleavedBatch Function
- musparseSgpsvInterleavedBatch_bufferSizeExt Function
- musparseSgtsv2 Function
- musparseSgtsv2StridedBatch Function
- musparseSgtsv2StridedBatch_bufferSizeExt Function
- musparseSgtsv2_bufferSizeExt Function
- musparseSgtsv2_nopivot Function
- musparseSgtsv2_nopivot_bufferSizeExt Function
- musparseSgtsvInterleavedBatch Function
- musparseSgtsvInterleavedBatch_bufferSizeExt Function
- musparseZgebsr2gebsc_bufferSize Function
- musparseZgebsr2gebsr_bufferSize Function
- musparseZgemvi_bufferSize Function
- musparseZgpsvInterleavedBatch Function
- musparseZgpsvInterleavedBatch_bufferSizeExt Function
- musparseZgtsv2 Function
- musparseZgtsv2StridedBatch Function
- musparseZgtsv2StridedBatch_bufferSizeExt Function
- musparseZgtsv2_bufferSizeExt Function
- musparseZgtsv2_nopivot Function
- musparseZgtsv2_nopivot_bufferSizeExt Function
- musparseZgtsvInterleavedBatch Function
- musparseZgtsvInterleavedBatch_bufferSizeExt Function
- musparseConstCooGet Function
- musparseConstCscGet Function
- musparseConstCsrGet Function
- musparseConstDnMatGet Function
- musparseConstDnMatGetValues Function
- musparseConstDnVecGet Function
- musparseConstDnVecGetValues Function
- musparseConstSpMatGetValues Function
- musparseCreateConstBsr Function
- musparseCreateConstCoo Function
- musparseCreateConstCsc Function
- musparseCreateConstDnMat Function
- musparseCreateConstDnVec Function
- musparseLoggerSetCallback Function
- musparseLoggerSetFile Function
- musparseLoggerOpenFile Function
- musparseLoggerSetLevel Function
- musparseLoggerSetMask Function
- musparseLoggerForceDisable Function
- musparseCreateCsrgemm2Info Function
- musparseDestroyCsrgemm2Info Function
- musparse-functions.h File
- musparseCsr2CscAlg_t Enumeration type
- MUSPARSE_CSR2CSC_ALG_DEFAULT Enumerator
- MUSPARSE_CSR2CSC_ALG1 Enumerator
- musparseScsr2csc Function
- musparseDcsr2csc Function
- musparseCcsr2csc Function
- musparseZcsr2csc Function
- musparseCsr2cscEx2 Function
- musparseCsr2cscEx2_bufferSize Function
- musparseSaxpyi Function
- musparseDaxpyi Function
- musparseCaxpyi Function
- musparseZaxpyi Function
- musparseSdoti Function
- musparseDdoti Function
- musparseCdoti Function
- musparseZdoti Function
- musparseCdotci Function
- musparseZdotci Function
- musparseSgthr Function
- musparseDgthr Function
- musparseCgthr Function
- musparseZgthr Function
- musparseSgthrz Function
- musparseDgthrz Function
- musparseCgthrz Function
- musparseZgthrz Function
- musparseSroti Function
- musparseDroti Function
- musparseSsctr Function
- musparseDsctr Function
- musparseCsctr Function
- musparseZsctr Function
- musparseIsctr Function
- musparseSbsrmv Function
- musparseDbsrmv Function
- musparseCbsrmv Function
- musparseZbsrmv Function
- musparseSbsrxmv Function
- musparseDbsrxmv Function
- musparseCbsrxmv Function
- musparseZbsrxmv Function
- musparseSbsrsv_bufferSize Function
- musparseDbsrsv_bufferSize Function
- musparseCbsrsv_bufferSize Function
- musparseZbsrsv_bufferSize Function
- musparseSbsrsv_analysis Function
- musparseDbsrsv_analysis Function
- musparseCbsrsv_analysis Function
- musparseZbsrsv_analysis Function
- musparseSbsrsv_solve Function
- musparseDbsrsv_solve Function
- musparseCbsrsv_solve Function
- musparseZbsrsv_solve Function
- musparseScoomv Function
- musparseDcoomv Function
- musparseCcoomv Function
- musparseZcoomv Function
- musparseScsrmv_analysis Function
- musparseDcsrmv_analysis Function
- musparseCcsrmv_analysis Function
- musparseZcsrmv_analysis Function
- musparseScsrmv Function
- musparseDcsrmv Function
- musparseCcsrmv Function
- musparseZcsrmv Function
- musparseScsrsv_bufferSize Function
- musparseDcsrsv_bufferSize Function
- musparseCcsrsv_bufferSize Function
- musparseZcsrsv_bufferSize Function
- musparseScsrsv_analysis Function
- musparseDcsrsv_analysis Function
- musparseCcsrsv_analysis Function
- musparseZcsrsv_analysis Function
- musparseScsrsv_solve Function
- musparseDcsrsv_solve Function
- musparseCcsrsv_solve Function
- musparseZcsrsv_solve Function
- musparseSellmv Function
- musparseDellmv Function
- musparseCellmv Function
- musparseZellmv Function
- musparseShybmv Function
- musparseDhybmv Function
- musparseChybmv Function
- musparseZhybmv Function
- musparseSgebsrmv Function
- musparseDgebsrmv Function
- musparseCgebsrmv Function
- musparseZgebsrmv Function
- musparseSgemvi_bufferSize_legacy Function
- musparseDgemvi_bufferSize_legacy Function
- musparseCgemvi_bufferSize_legacy Function
- musparseZgemvi_bufferSize_legacy Function
- musparseSgemvi Function
- musparseDgemvi Function
- musparseCgemvi Function
- musparseZgemvi Function
- musparseSbsrmm Function
- musparseDbsrmm Function
- musparseCbsrmm Function
- musparseZbsrmm Function
- musparseSgebsrmm Function
- musparseDgebsrmm Function
- musparseCgebsrmm Function
- musparseZgebsrmm Function
- musparseScsrmm Function
- musparseDcsrmm Function
- musparseCcsrmm Function
- musparseZcsrmm Function
- musparseScsrsm_bufferSize Function
- musparseDcsrsm_bufferSize Function
- musparseCcsrsm_bufferSize Function
- musparseZcsrsm_bufferSize Function
- musparseScsrsm_analysis Function
- musparseDcsrsm_analysis Function
- musparseCcsrsm_analysis Function
- musparseZcsrsm_analysis Function
- musparseScsrsm_solve Function
- musparseDcsrsm_solve Function
- musparseCcsrsm_solve Function
- musparseZcsrsm_solve Function
- musparseSbsrsm_bufferSize Function
- musparseDbsrsm_bufferSize Function
- musparseCbsrsm_bufferSize Function
- musparseZbsrsm_bufferSize Function
- musparseSbsrsm_analysis Function
- musparseDbsrsm_analysis Function
- musparseCbsrsm_analysis Function
- musparseZbsrsm_analysis Function
- musparseSbsrsm_solve Function
- musparseDbsrsm_solve Function
- musparseCbsrsm_solve Function
- musparseZbsrsm_solve Function
- musparseSgemmi Function
- musparseDgemmi Function
- musparseCgemmi Function
- musparseZgemmi Function
- musparseScsrgeam Function
- musparseDcsrgeam Function
- musparseCcsrgeam Function
- musparseZcsrgeam Function
- musparseScsrgemm_bufferSize Function
- musparseDcsrgemm_bufferSize Function
- musparseCcsrgemm_bufferSize Function
- musparseZcsrgemm_bufferSize Function
- musparseScsrgemm Function
- musparseDcsrgemm Function
- musparseCcsrgemm Function
- musparseZcsrgemm Function
- musparseXcsrgemm_symbolic Function
- musparseScsrgemm_numeric Function
- musparseDcsrgemm_numeric Function
- musparseCcsrgemm_numeric Function
- musparseZcsrgemm_numeric Function
- musparseSbsric0_bufferSize Function
- musparseDbsric0_bufferSize Function
- musparseCbsric0_bufferSize Function
- musparseZbsric0_bufferSize Function
- musparseSbsric0_analysis Function
- musparseDbsric0_analysis Function
- musparseCbsric0_analysis Function
- musparseZbsric0_analysis Function
- musparseSbsric0 Function
- musparseDbsric0 Function
- musparseCbsric0 Function
- musparseZbsric0 Function
- musparseSbsrilu0_numericBoost Function
- musparseDbsrilu0_numericBoost Function
- musparseCbsrilu0_numericBoost Function
- musparseZbsrilu0_numericBoost Function
- musparseDSbsrilu0_numericBoost Function
- musparseDCbsrilu0_numericBoost Function
- musparseSbsrilu0_bufferSize Function
- musparseDbsrilu0_bufferSize Function
- musparseCbsrilu0_bufferSize Function
- musparseZbsrilu0_bufferSize Function
- musparseSbsrilu0_analysis Function
- musparseDbsrilu0_analysis Function
- musparseCbsrilu0_analysis Function
- musparseZbsrilu0_analysis Function
- musparseSbsrilu0 Function
- musparseDbsrilu0 Function
- musparseCbsrilu0 Function
- musparseZbsrilu0 Function
- musparseScsric0_bufferSize Function
- musparseDcsric0_bufferSize Function
- musparseCcsric0_bufferSize Function
- musparseZcsric0_bufferSize Function
- musparseScsric0_analysis Function
- musparseDcsric0_analysis Function
- musparseCcsric0_analysis Function
- musparseZcsric0_analysis Function
- musparseScsric0 Function
- musparseDcsric0 Function
- musparseCcsric0 Function
- musparseZcsric0 Function
- musparseScsrilu0_numericBoost Function
- musparseDcsrilu0_numericBoost Function
- musparseCcsrilu0_numericBoost Function
- musparseZcsrilu0_numericBoost Function
- musparseDScsrilu0_numericBoost Function
- musparseDCcsrilu0_numericBoost Function
- musparseScsrilu0_bufferSize Function
- musparseDcsrilu0_bufferSize Function
- musparseCcsrilu0_bufferSize Function
- musparseZcsrilu0_bufferSize Function
- musparseScsrilu0_analysis Function
- musparseDcsrilu0_analysis Function
- musparseCcsrilu0_analysis Function
- musparseZcsrilu0_analysis Function
- musparseScsrilu0 Function
- musparseDcsrilu0 Function
- musparseCcsrilu0 Function
- musparseZcsrilu0 Function
- musparseSgtsv_bufferSize Function
- musparseDgtsv_bufferSize Function
- musparseCgtsv_bufferSize Function
- musparseZgtsv_bufferSize Function
- musparseSgtsv Function
- musparseDgtsv Function
- musparseCgtsv Function
- musparseZgtsv Function
- musparseSgtsv_nopivot_bufferSize Function
- musparseDgtsv_nopivot_bufferSize Function
- musparseCgtsv_nopivot_bufferSize Function
- musparseZgtsv_nopivot_bufferSize Function
- musparseSgtsv_nopivot Function
- musparseDgtsv_nopivot Function
- musparseCgtsv_nopivot Function
- musparseZgtsv_nopivot Function
- musparseSgtsvStridedBatch_bufferSizeExt Function
- musparseDgtsvStridedBatch_bufferSizeExt Function
- musparseCgtsvStridedBatch_bufferSizeExt Function
- musparseZgtsvStridedBatch_bufferSizeExt Function
- musparseSgtsvStridedBatch Function
- musparseDgtsvStridedBatch Function
- musparseCgtsvStridedBatch Function
- musparseZgtsvStridedBatch Function
- musparseSgtsvInterleavedBatch_bufferSize Function
- musparseDgtsvInterleavedBatch_bufferSize Function
- musparseCgtsvInterleavedBatch_bufferSize Function
- musparseZgtsvInterleavedBatch_bufferSize Function
- musparseSgtsvInterleavedBatch_legacy Function
- musparseDgtsvInterleavedBatch_legacy Function
- musparseCgtsvInterleavedBatch_legacy Function
- musparseZgtsvInterleavedBatch_legacy Function
- musparseSgpsvInterleavedBatch_bufferSize Function
- musparseDgpsvInterleavedBatch_bufferSize Function
- musparseCgpsvInterleavedBatch_bufferSize Function
- musparseZgpsvInterleavedBatch_bufferSize Function
- musparseSgpsvInterleavedBatch_legacy Function
- musparseDgpsvInterleavedBatch_legacy Function
- musparseCgpsvInterleavedBatch_legacy Function
- musparseZgpsvInterleavedBatch_legacy Function
- musparseSnnz Function
- musparseDnnz Function
- musparseCnnz Function
- musparseZnnz Function
- musparseSdense2csr Function
- musparseDdense2csr Function
- musparseCdense2csr Function
- musparseZdense2csr Function
- musparseSpruneDense2csr_bufferSize Function
- musparseDpruneDense2csr_bufferSize Function
- musparseSpruneDense2csr_nnz Function
- musparseDpruneDense2csr_nnz Function
- musparseHpruneDense2csr_nnz Function
- musparseSpruneDense2csr Function
- musparseDpruneDense2csr Function
- musparseHpruneDense2csr Function
- musparseSpruneDense2csrByPercentage_bufferSize Function
- musparseDpruneDense2csrByPercentage_bufferSize Function
- musparseHpruneDense2csrByPercentage_bufferSize Function
- musparseSpruneDense2csr_nnzByPercentage Function
- musparseDpruneDense2csr_nnzByPercentage Function
- musparseHpruneDense2csr_nnzByPercentage Function
- musparseSpruneDense2csrByPercentage Function
- musparseDpruneDense2csrByPercentage Function
- musparseHpruneDense2csrByPercentage Function
- musparseSdense2csc Function
- musparseDdense2csc Function
- musparseCdense2csc Function
- musparseZdense2csc Function
- musparseSdense2coo Function
- musparseDdense2coo Function
- musparseCdense2coo Function
- musparseZdense2coo Function
- musparseScsr2dense Function
- musparseDcsr2dense Function
- musparseCcsr2dense Function
- musparseZcsr2dense Function
- musparseScsc2dense Function
- musparseDcsc2dense Function
- musparseCcsc2dense Function
- musparseZcsc2dense Function
- musparseScoo2dense Function
- musparseDcoo2dense Function
- musparseCcoo2dense Function
- musparseZcoo2dense Function
- musparseSnnz_compress Function
- musparseDnnz_compress Function
- musparseCnnz_compress Function
- musparseZnnz_compress Function
- musparseSgebsr2gebsc_bufferSize_legacy Function
- musparseDgebsr2gebsc_bufferSize_legacy Function
- musparseCgebsr2gebsc_bufferSize_legacy Function
- musparseZgebsr2gebsc_bufferSize_legacy Function
- musparseSgebsr2gebsc Function
- musparseDgebsr2gebsc Function
- musparseCgebsr2gebsc Function
- musparseZgebsr2gebsc Function
- musparseScsr2ell Function
- musparseDcsr2ell Function
- musparseCcsr2ell Function
- musparseZcsr2ell Function
- musparseScsr2hyb Function
- musparseDcsr2hyb Function
- musparseCcsr2hyb Function
- musparseZcsr2hyb Function
- musparseScsr2bsr Function
- musparseDcsr2bsr Function
- musparseCcsr2bsr Function
- musparseZcsr2bsr Function
- musparseScsr2gebsr_bufferSize_legacy Function
- musparseDcsr2gebsr_bufferSize_legacy Function
- musparseCcsr2gebsr_bufferSize_legacy Function
- musparseZcsr2gebsr_bufferSize_legacy Function
- musparseXcsr2gebsr_nnz Function
- musparseScsr2gebsr Function
- musparseDcsr2gebsr Function
- musparseCcsr2gebsr Function
- musparseZcsr2gebsr Function
- musparseScsr2csr_compress Function
- musparseDcsr2csr_compress Function
- musparseCcsr2csr_compress Function
- musparseZcsr2csr_compress Function
- musparseSpruneCsr2csr_bufferSize Function
- musparseDpruneCsr2csr_bufferSize Function
- musparseHpruneCsr2csr_bufferSize Function
- musparseHpruneDense2csr_bufferSize Function
- musparseSpruneCsr2csr_nnz Function
- musparseDpruneCsr2csr_nnz Function
- musparseHpruneCsr2csr_nnz Function
- musparseSpruneCsr2csr Function
- musparseDpruneCsr2csr Function
- musparseHpruneCsr2csr Function
- musparseSpruneCsr2csrByPercentage_bufferSize Function
- musparseDpruneCsr2csrByPercentage_bufferSize Function
- musparseHpruneCsr2csrByPercentage_bufferSize Function
- musparseSpruneCsr2csr_nnzByPercentage Function
- musparseDpruneCsr2csr_nnzByPercentage Function
- musparseHpruneCsr2csr_nnzByPercentage Function
- musparseSpruneCsr2csrByPercentage Function
- musparseDpruneCsr2csrByPercentage Function
- musparseHpruneCsr2csrByPercentage Function
- musparseSell2csr Function
- musparseDell2csr Function
- musparseCell2csr Function
- musparseZell2csr Function
- musparseShyb2csr Function
- musparseDhyb2csr Function
- musparseChyb2csr Function
- musparseZhyb2csr Function
- musparseSbsr2csr Function
- musparseDbsr2csr Function
- musparseCbsr2csr Function
- musparseZbsr2csr Function
- musparseSgebsr2csr Function
- musparseDgebsr2csr Function
- musparseCgebsr2csr Function
- musparseZgebsr2csr Function
- musparseSgebsr2gebsr_bufferSize_legacy Function
- musparseDgebsr2gebsr_bufferSize_legacy Function
- musparseCgebsr2gebsr_bufferSize_legacy Function
- musparseZgebsr2gebsr_bufferSize_legacy Function
- musparseSgebsr2gebsr Function
- musparseDgebsr2gebsr Function
- musparseCgebsr2gebsr Function
- musparseZgebsr2gebsr Function
- musparseScsrcolor Function
- musparseDcsrcolor Function
- musparseCcsrcolor Function
- musparseZcsrcolor Function
- _MUSPARSE_FUNCTIONS_H_ Macro
- musparseSpMMOpAlg_t Enumeration type
- MUSPARSE_SPMM_OP_ALG_DEFAULT Enumerator
- musparseSpSMDescr_t Typedef
- musparseSpMMOpPlan_t Typedef
- musparseSpGEMMDescr_t Typedef
- musparseXbsrsv_zeroPivot Function
- musparseXbsrsv_clear Function
- musparseXcsrmv_clear Function
- musparseXcsrmv_zeroPivot Function
- musparseXcsrsv_clear Function
- musparseXcsrsm_zeroPivot Function
- musparseXcsrsm_clear Function
- musparseXbsrsm_zeroPivot Function
- musparseXbsrsm_clear Function
- musparseXcsrgeam_nnz Function
- musparseXcsrgemm_nnz Function
- musparseXbsric0_zeroPivot Function
- musparseXbsric0_clear Function
- musparseXbsrilu0_zeroPivot Function
- musparseXbsrilu0_clear Function
- musparseXcsric0_zeroPivot Function
- musparseXcsric0_clear Function
- musparseXcsrilu0_zeroPivot Function
- musparseXcsrilu0_clear Function
- musparseXcsr2coo Function
- musparseXcsr2csc_bufferSize Function
- musparseXcsr2csr2ell_width Function
- musparseXcsr2bsr_nnz Function
- musparseXcoo2csr Function
- musparseXcsr2ell2csr_nnz Function
- musparseXhyb2csr_bufferSize Function
- musparseCreateIdentityPermutation Function
- musparseXcsrsort_bufferSize Function
- musparseXcsrsort Function
- musparseXcscsort_bufferSize Function
- musparseXcscsort Function
- musparseXcoosort_bufferSize Function
- musparseXcoosortByRow Function
- musparseXcoosortByColumn Function
- musparseXgebsr2gebsr_nnz Function
- musparseAxpby Function
- musparseGather Function
- musparseScatter Function
- musparseRot Function
- musparseSparseToDense_legacy Function
- musparseDenseToSparse Function
- musparseDenseToSparse_bufferSize Function
- musparseDenseToSparse_analysis Function
- musparseDenseToSparse_convert Function
- musparseSpVV_legacy Function
- musparseSpMV_legacy Function
- musparseSpMV_legacy_bufferSize Function
- musparseSpMV Function
- musparseSpMV_bufferSize Function
- musparseSpMV_preprocess Function
- musparseSpSV Function
- musparseSpSM Function
- musparseSpSM_createDescr Function
- musparseSpSM_destroyDescr Function
- musparseSpSM_bufferSize Function
- musparseSpSM_analysis Function
- musparseSpSM_solve Function
- musparseSpMM_ex Function
- musparseSpMM_legacy Function
- musparseSpMM_bufferSize Function
- musparseSpMM_preprocess Function
- musparseSpMM Function
- musparseSpMMOp_createPlan Function
- musparseSpMMOp Function
- musparseSpMMOp_destroyPlan Function
- musparseSpGEMM Function
- musparseSpGEMM_createDescr Function
- musparseSpGEMM_destroyDescr Function
- musparseSpGEMM_workEstimation Function
- musparseSpGEMM_getNumProducts Function
- musparseSpGEMM_estimateMemory Function
- musparseSpGEMM_compute Function
- musparseSpGEMM_copy Function
- musparseSpGEMMreuse_workEstimation Function
- musparseSpGEMMreuse_nnz Function
- musparseSpGEMMreuse_copy Function
- musparseSpGEMMreuse_compute Function
- musparseSDDMM Function
- musparseSDDMM_bufferSize Function
- musparseSDDMM_preprocess Function
Files
- musparse-auxiliary.h: musparse-auxiliary.h provides auxilary functions in musparse
- musparse-compatible.h
- musparse-functions.h: musparse-functions.h provides Sparse Linear Algebra Subprograms of Level 1, 2 and 3, using MUSA optimized for MT GPU hardware.
File musparse-auxiliary.h
Location: musparse-auxiliary.h
musparse-auxiliary.h provides auxilary functions in musparse
Includes
- <stdint.h>
- musparse-export.h
- musparse-types.h
Function musparseCreateCsr
MUSPARSE_EXPORT musparseStatus_t musparseCreateCsr(musparseSpMatDescr_t `descr, int64_t rows, int64_t cols, int64_t nnz, void `csr_row_ptr, void `csr_col_ind, void `csr_val, musparseIndexType_t row_ptr_type, musparseIndexType_t col_ind_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Create a sparse CSR matrix descriptor.
musparseCreateCsr creates a sparse CSR matrix descriptor. It should be destroyed at the end using musparseDestroySpMat.
Parameters:
descr: the pointer to the sparse CSR matrix descriptor.rows: number of rows in the CSR matrix.cols: number of columns in the CSR matrixnnz: number of non-zeros in the CSR matrix.csr_row_ptr: row offsets of the CSR matrix (must be array of lengthrows+1).csr_col_ind: column indices of the CSR matrix (must be array of lengthnnz).csr_val: values of the CSR matrix (must be array of lengthnnz).row_ptr_type: MUSPARSE_INDEX_32I or MUSPARSE_INDEX_64I.col_ind_type: MUSPARSE_INDEX_32I or MUSPARSE_INDEX_64I.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.data_type: MUSA_R_32F, MUSA_R_64F, MUSA_C_32F or MUSA_C_64F.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER: ifdescrorcsr_row_ptrorcsr_col_indorcsr_valis invalid.MUSPARSE_STATUS_INVALID_SIZE: ifrowsorcolsornnzis invalid.MUSPARSE_STATUS_INVALID_VALUE: ifrow_ptr_typeorcol_ind_typeoridx_baseordata_typeis invalid.
Parameters:
musparseSpMatDescr_t descr
- int64_t
rows - int64_t
cols - int64_t
nnzvoidcsr_row_ptrvoidcsr_col_indvoidcsr_val - musparseIndexType_t
row_ptr_type - musparseIndexType_t
col_ind_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateDnVec
MUSPARSE_EXPORT musparseStatus_t musparseCreateDnVec(musparseDnVecDescr_t `descr, int64_t size, void `values, musparseDataType_t data_type)
Create a dense vector descriptor.
musparseCreateDnVec creates a dense vector descriptor. It should be destroyed at the end using musparseDestroyDnVec.
Parameters:
descr: the pointer to the dense vector descriptor.size: size of the dense vector.values: non-zero values in the dense vector (must be array of lengthsize).data_type: MUSA_R_32F, MUSA_R_64F, MUSA_C_32F or MUSA_C_64F.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER: ifdescrorvaluesis invalid.MUSPARSE_STATUS_INVALID_SIZE: ifsizeis invalid.MUSPARSE_STATUS_INVALID_VALUE: ifdata_typeis invalid.
Parameters:
musparseDnVecDescr_t descr
- int64_t
sizevoidvalues - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Macros
Functions
Function musparseCreate
MUSPARSE_EXPORT musparseStatus_t musparseCreate(musparseHandle_t *handle)
Create a musparse handle.
musparseCreate creates the musparse library context. It must be initialized before any other musparse API function is invoked and must be passed to all subsequent library function calls. The handle should be destroyed at the end using musparseDestroy().
Parameters:
handle: the pointer to the handle to the musparse library context.
Return values:
MUSPARSE_STATUS_SUCCESS: the initialization succeeded.MUSPARSE_STATUS_INVALID_HANDLE:handlepointer is invalid.MUSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
Parameters:
musparseHandle_t handle
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroy
MUSPARSE_EXPORT musparseStatus_t musparseDestroy(musparseHandle_t handle)
Destroy a musparse handle.
musparseDestroy destroys the musparse library context and releases all resources used by the musparse library.
Parameters:
handle: the handle to the musparse library context.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE:handleis invalid.MUSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
Parameters:
- musparseHandle_t
handle
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSetStream
MUSPARSE_EXPORT musparseStatus_t musparseSetStream(musparseHandle_t handle, musaStream_t stream)
Specify user defined MUSA stream.
musparseSetStream specifies the stream to be used by the musparse library context and all subsequent function calls.
Parameters:
handle: the handle to the musparse library context.stream: the stream to be used by the musparse library context.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE:handleis invalid.
Example:
This example illustrates, how a user defined stream can be used in musparse.
// Create musparse handle
musparseHandle_t handle;
musparseCreate(&handle);
// Create stream
MUstream stream;
musaStreamCreate(&stream);
// Set stream to musparse handle
musparseSetStream(handle, stream);
// Do some work
// ...
// Clean up
musparseDestroy(handle);
musaStreamDestroy(stream);
Parameters:
- musparseHandle_t
handle - musaStream_t
stream
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetStream
MUSPARSE_EXPORT musparseStatus_t musparseGetStream(musparseHandle_t handle, musaStream_t *stream)
Get current stream from library context.
musparseGetStream gets the musparse library context stream which is currently used for all subsequent function calls.
Parameters:
handle: the handle to the musparse library context.stream: the stream currently used by the musparse library context.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE:handleis invalid.
Parameters:
- musparseHandle_t
handlemusaStream_tstream
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSetPointerMode
MUSPARSE_EXPORT musparseStatus_t musparseSetPointerMode(musparseHandle_t handle, musparsePointerMode_t pointer_mode)
Specify pointer mode.
musparseSetPointerMode specifies the pointer mode to be used by the musparse library context and all subsequent function calls. By default, all values are passed by reference on the host. Valid pointer modes are MUSPARSE_POINTER_MODE_HOST or MUSPARSE_POINTER_MODE_DEVICE.
Parameters:
handle: the handle to the musparse library context.pointer_mode: the pointer mode to be used by the musparse library context.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE:handleis invalid.
Parameters:
- musparseHandle_t
handle - musparsePointerMode_t
pointer_mode
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetPointerMode
MUSPARSE_EXPORT musparseStatus_t musparseGetPointerMode(musparseHandle_t handle, musparsePointerMode_t *pointer_mode)
Get current pointer mode from library context.
musparseGetPointerMode gets the musparse library context pointer mode which is currently used for all subsequent function calls.
Parameters:
handle: the handle to the musparse library context.pointer_mode: the pointer mode that is currently used by the musparse library context.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE:handleis invalid.
Parameters:
- musparseHandle_t
handlemusparsePointerMode_tpointer_mode
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetVersion
MUSPARSE_EXPORT musparseStatus_t musparseGetVersion(musparseHandle_t handle, int *version)
Get musparse version.
musparseGetVersion gets the musparse library version number.
-
patch = version % 100
-
minor = version / 100 % 1000
-
major = version / 100000
Parameters:
handle: the handle to the musparse library context.version: the version number of the musparse library.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE:handleis invalid.
Parameters:
- musparseHandle_t
handleintversion
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetGitRev
MUSPARSE_EXPORT musparseStatus_t musparseGetGitRev(musparseHandle_t handle, char *rev)
Get musparse git revision.
musparseGetGitRev gets the musparse library git commit revision (SHA-1).
Parameters:
handle: the handle to the musparse library context.rev: the git commit revision (SHA-1).
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE:handleis invalid.
Parameters:
- musparseHandle_t
handlecharrev
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateMatDescr
MUSPARSE_EXPORT musparseStatus_t musparseCreateMatDescr(musparseMatDescr_t *descr)
Create a matrix descriptor.
musparseCreateMatDescr creates a matrix descriptor. It initializes musparseMatrixType_t to MUSPARSE_MATRIX_TYPE_GENERAL and musparseIndexBase_t to MUSPARSE_INDEX_BASE_ZERO. It should be destroyed at the end using musparseDestroyMatDescr().
Parameters:
descr: the pointer to the matrix descriptor.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:descrpointer is invalid.
Parameters:
musparseMatDescr_t descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCopyMatDescr
MUSPARSE_EXPORT musparseStatus_t musparseCopyMatDescr(musparseMatDescr_t dest, const musparseMatDescr_t src)
Copy a matrix descriptor.
musparseCopyMatDescr copies a matrix descriptor. Both, source and destination matrix descriptors must be initialized prior to calling musparseCopyMatDescr.
Parameters:
dest: the pointer to the destination matrix descriptor.src: the pointer to the source matrix descriptor.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:srcordestpointer is invalid.
Parameters:
- musparseMatDescr_t
dest - const musparseMatDescr_t
src
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyMatDescr
MUSPARSE_EXPORT musparseStatus_t musparseDestroyMatDescr(musparseMatDescr_t descr)
Destroy a matrix descriptor.
musparseDestroyMatDescr destroys a matrix descriptor and releases all resources used by the descriptor.
Parameters:
descr: the matrix descriptor.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:descris invalid.
Parameters:
- musparseMatDescr_t
descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSetMatIndexBase
MUSPARSE_EXPORT musparseStatus_t musparseSetMatIndexBase(musparseMatDescr_t descr, musparseIndexBase_t base)
Specify the index base of a matrix descriptor.
musparseSetMatIndexBase sets the index base of a matrix descriptor. Valid options are MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Parameters:
descr: the matrix descriptor.base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:descrpointer is invalid.MUSPARSE_STATUS_INVALID_VALUE:baseis invalid.
Parameters:
- musparseMatDescr_t
descr - musparseIndexBase_t
base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetMatIndexBase
MUSPARSE_EXPORT musparseIndexBase_t musparseGetMatIndexBase(const musparseMatDescr_t descr)
Get the index base of a matrix descriptor.
musparseGetMatIndexBase returns the index base of a matrix descriptor.
Parameters:
descr: the matrix descriptor.
Returns:
MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Parameters:
- const musparseMatDescr_t
descr
Return type: MUSPARSE_EXPORT musparseIndexBase_t
Function musparseSetMatType
MUSPARSE_EXPORT musparseStatus_t musparseSetMatType(musparseMatDescr_t descr, musparseMatrixType_t type)
Specify the matrix type of a matrix descriptor.
musparseSetMatType sets the matrix type of a matrix descriptor. Valid matrix types are MUSPARSE_MATRIX_TYPE_GENERAL, MUSPARSE_MATRIX_TYPE_SYMMETRIC, MUSPARSE_MATRIX_TYPE_HERMITIAN or MUSPARSE_MATRIX_TYPE_TRIANGULAR.
Parameters:
descr: the matrix descriptor.type: MUSPARSE_MATRIX_TYPE_GENERAL, MUSPARSE_MATRIX_TYPE_SYMMETRIC, MUSPARSE_MATRIX_TYPE_HERMITIAN or MUSPARSE_MATRIX_TYPE_TRIANGULAR.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:descrpointer is invalid.MUSPARSE_STATUS_INVALID_VALUE:typeis invalid.
Parameters:
- musparseMatDescr_t
descr - musparseMatrixType_t
type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetMatType
MUSPARSE_EXPORT musparseMatrixType_t musparseGetMatType(const musparseMatDescr_t descr)
Get the matrix type of a matrix descriptor.
musparseGetMatType returns the matrix type of a matrix descriptor.
Parameters:
descr: the matrix descriptor.
Returns:
MUSPARSE_MATRIX_TYPE_GENERAL, MUSPARSE_MATRIX_TYPE_SYMMETRIC, MUSPARSE_MATRIX_TYPE_HERMITIAN or MUSPARSE_MATRIX_TYPE_TRIANGULAR.
Parameters:
- const musparseMatDescr_t
descr
Return type: MUSPARSE_EXPORT musparseMatrixType_t
Function musparseSetMatFillMode
MUSPARSE_EXPORT musparseStatus_t musparseSetMatFillMode(musparseMatDescr_t descr, musparseFillMode_t fill_mode)
Specify the matrix fill mode of a matrix descriptor.
musparseSetMatFillMode sets the matrix fill mode of a matrix descriptor. Valid fill modes are MUSPARSE_FILL_MODE_LOWER or MUSPARSE_FILL_MODE_UPPER.
Parameters:
descr: the matrix descriptor.fill_mode: MUSPARSE_FILL_MODE_LOWER or MUSPARSE_FILL_MODE_UPPER.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:descrpointer is invalid.MUSPARSE_STATUS_INVALID_VALUE:fill_modeis invalid.
Parameters:
- musparseMatDescr_t
descr - musparseFillMode_t
fill_mode
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetMatFillMode
MUSPARSE_EXPORT musparseFillMode_t musparseGetMatFillMode(const musparseMatDescr_t descr)
Get the matrix fill mode of a matrix descriptor.
musparseGetMatFillMode returns the matrix fill mode of a matrix descriptor.
Parameters:
descr: the matrix descriptor.
Returns:
MUSPARSE_FILL_MODE_LOWER or MUSPARSE_FILL_MODE_UPPER.
Parameters:
- const musparseMatDescr_t
descr
Return type: MUSPARSE_EXPORT musparseFillMode_t
Function musparseSetMatDiagType
MUSPARSE_EXPORT musparseStatus_t musparseSetMatDiagType(musparseMatDescr_t descr, musparseDiagType_t diag_type)
Specify the matrix diagonal type of a matrix descriptor.
musparseSetMatDiagType sets the matrix diagonal type of a matrix descriptor. Valid diagonal types are MUSPARSE_DIAG_TYPE_UNIT or MUSPARSE_DIAG_TYPE_NON_UNIT.
Parameters:
descr: the matrix descriptor.diag_type: MUSPARSE_DIAG_TYPE_UNIT or MUSPARSE_DIAG_TYPE_NON_UNIT.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:descrpointer is invalid.MUSPARSE_STATUS_INVALID_VALUE:diag_typeis invalid.
Parameters:
- musparseMatDescr_t
descr - musparseDiagType_t
diag_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetMatDiagType
MUSPARSE_EXPORT musparseDiagType_t musparseGetMatDiagType(const musparseMatDescr_t descr)
Get the matrix diagonal type of a matrix descriptor.
musparseGetMatDiagType returns the matrix diagonal type of a matrix descriptor.
Parameters:
descr: the matrix descriptor.
Returns:
MUSPARSE_DIAG_TYPE_UNIT or MUSPARSE_DIAG_TYPE_NON_UNIT.
Parameters:
- const musparseMatDescr_t
descr
Return type: MUSPARSE_EXPORT musparseDiagType_t
Function musparseSetMatStorageMode
MUSPARSE_EXPORT musparseStatus_t musparseSetMatStorageMode(musparseMatDescr_t descr, musparseStorageMode_t storage_mode)
Specify the matrix storage mode of a matrix descriptor.
musparseSetMatStorageMode sets the matrix storage mode of a matrix descriptor. Valid fill modes are MUSPARSE_STORAGE_MODE_SORTED or MUSPARSE_STORAGE_MODE_UNSORTED.
Parameters:
descr: the matrix descriptor.storage_mode: MUSPARSE_STORAGE_MODE_SORTED or MUSPARSE_STORAGE_MODE_UNSORTED.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:descrpointer is invalid.MUSPARSE_STATUS_INVALID_VALUE:storage_modeis invalid.
Parameters:
- musparseMatDescr_t
descr - musparseStorageMode_t
storage_mode
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetMatStorageMode
MUSPARSE_EXPORT musparseStorageMode_t musparseGetMatStorageMode(const musparseMatDescr_t descr)
Get the matrix storage mode of a matrix descriptor.
musparseGetMatStorageMode returns the matrix storage mode of a matrix descriptor.
Parameters:
descr: the matrix descriptor.
Returns:
MUSPARSE_STORAGE_MODE_SORTED or MUSPARSE_STORAGE_MODE_UNSORTED.
Parameters:
- const musparseMatDescr_t
descr
Return type: MUSPARSE_EXPORT musparseStorageMode_t
Function musparseCreateHybMat
MUSPARSE_EXPORT musparseStatus_t musparseCreateHybMat(musparseHybMat_t *hyb)
Create a HYB matrix structure.
musparseCreateHybMat creates a structure that holds the matrix in HYB storage format. It should be destroyed at the end using musparseDestroyHybMat().
Parameters:
hyb: the pointer to the hybrid matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:hybpointer is invalid.
Parameters:
musparseHybMat_t hyb
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCopyHybMat
MUSPARSE_EXPORT musparseStatus_t musparseCopyHybMat(musparseHybMat_t dest, const musparseHybMat_t src)
Copy a HYB matrix structure.
musparseCopyHybMat copies a matrix info structure. Both, source and destination matrix info structure must be initialized prior to calling musparseCopyHybMat.
Parameters:
dest: the pointer to the destination matrix info structure.src: the pointer to the source matrix info structure.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:hybpointer is invalid.
Parameters:
- musparseHybMat_t
dest - const musparseHybMat_t
src
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyHybMat
MUSPARSE_EXPORT musparseStatus_t musparseDestroyHybMat(musparseHybMat_t hyb)
Destroy a HYB matrix structure.
musparseDestroyHybMat destroys a HYB structure.
Parameters:
hyb: the hybrid matrix structure.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:hybpointer is invalid.MUSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
Parameters:
- musparseHybMat_t
hyb
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateMatInfo
MUSPARSE_EXPORT musparseStatus_t musparseCreateMatInfo(musparseMatInfo_t *info)
Create a matrix info structure.
musparseCreateMatInfo creates a structure that holds the matrix info data that is gathered during the analysis routines available. It should be destroyed at the end using musparseDestroyMatInfo().
Parameters:
info: the pointer to the info structure.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.
Parameters:
musparseMatInfo_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCopyMatInfo
MUSPARSE_EXPORT musparseStatus_t musparseCopyMatInfo(musparseMatInfo_t dest, const musparseMatInfo_t src)
Copy a matrix info structure.
musparseCopyMatInfo copies a matrix info structure. Both, source and destination matrix info structure must be initialized prior to calling musparseCopyMatInfo.
Parameters:
dest: the pointer to the destination matrix info structure.src: the pointer to the source matrix info structure.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:srcordestpointer is invalid.
Parameters:
- musparseMatInfo_t
dest - const musparseMatInfo_t
src
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyMatInfo
MUSPARSE_EXPORT musparseStatus_t musparseDestroyMatInfo(musparseMatInfo_t info)
Destroy a matrix info structure.
musparseDestroyMatInfo destroys a matrix info structure.
Parameters:
info: the info structure.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
Parameters:
- musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateColorInfo
MUSPARSE_EXPORT musparseStatus_t musparseCreateColorInfo(musparseColorInfo_t *info)
Create a color info structure.
musparseCreateColorInfo creates a structure that holds the color info data that is gathered during the analysis routines available. It should be destroyed at the end using musparseDestroyColorInfo().
Parameters:
info: the pointer to the info structure.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.
Parameters:
musparseColorInfo_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCopyColorInfo
MUSPARSE_EXPORT musparseStatus_t musparseCopyColorInfo(musparseColorInfo_t dest, const musparseColorInfo_t src)
Copy a color info structure.
musparseCopyColorInfo copies a color info structure. Both, source and destination color info structure must be initialized prior to calling musparseCopyColorInfo.
Parameters:
dest: the pointer to the destination color info structure.src: the pointer to the source color info structure.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:srcordestpointer is invalid.
Parameters:
- musparseColorInfo_t
dest - const musparseColorInfo_t
src
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyColorInfo
MUSPARSE_EXPORT musparseStatus_t musparseDestroyColorInfo(musparseColorInfo_t info)
Destroy a color info structure.
musparseDestroyColorInfo destroys a color info structure.
Parameters:
info: the info structure.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
Parameters:
- musparseColorInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateSpVec
MUSPARSE_EXPORT musparseStatus_t musparseCreateSpVec(musparseSpVecDescr_t `descr, int64_t size, int64_t nnz, void `indices, void *values, musparseIndexType_t idx_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseSpVecDescr_t descr
- int64_t
size - int64_t
nnzvoidindicesvoidvalues - musparseIndexType_t
idx_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstSpVec
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstSpVec(musparseConstSpVecDescr_t `descr, int64_t size, int64_t nnz, const void `indices, const void *values, musparseIndexType_t idx_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseConstSpVecDescr_t descr
- int64_t
size - int64_t
nnzconst voidindicesconst voidvalues - musparseIndexType_t
idx_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroySpVec
MUSPARSE_EXPORT musparseStatus_t musparseDestroySpVec(musparseConstSpVecDescr_t descr)
Parameters:
- musparseConstSpVecDescr_t
descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpVecGet
MUSPARSE_EXPORT musparseStatus_t musparseSpVecGet(musparseSpVecDescr_t descr, int64_t `size, int64_t `nnz, void `indices, void `values, musparseIndexType_t `idx_type, musparseIndexBase_t `idx_base, musparseDataType_t *data_type)
Parameters:
- musparseSpVecDescr_t
descrint64_tsizeint64_tnnzvoidindices*voidvalues*musparseIndexType_tidx_typemusparseIndexBase_tidx_basemusparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpVecGetIndexBase
MUSPARSE_EXPORT musparseStatus_t musparseSpVecGetIndexBase(musparseConstSpVecDescr_t descr, musparseIndexBase_t *idx_base)
Parameters:
- musparseConstSpVecDescr_t
descrmusparseIndexBase_tidx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpVecGetValues
MUSPARSE_EXPORT musparseStatus_t musparseSpVecGetValues(musparseSpVecDescr_t descr, void ``values)
Parameters:
- musparseSpVecDescr_t
descrvoidvalues*
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpVecSetValues
MUSPARSE_EXPORT musparseStatus_t musparseSpVecSetValues(musparseSpVecDescr_t descr, void *values)
Parameters:
- musparseSpVecDescr_t
descrvoidvalues
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateCoo
MUSPARSE_EXPORT musparseStatus_t musparseCreateCoo(musparseSpMatDescr_t `descr, int64_t rows, int64_t cols, int64_t nnz, void `coo_row_ind, void `coo_col_ind, void `coo_val, musparseIndexType_t idx_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseSpMatDescr_t descr
- int64_t
rows - int64_t
cols - int64_t
nnzvoidcoo_row_indvoidcoo_col_indvoidcoo_val - musparseIndexType_t
idx_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateCooAos
MUSPARSE_EXPORT musparseStatus_t musparseCreateCooAos(musparseSpMatDescr_t `descr, int64_t rows, int64_t cols, int64_t nnz, void `coo_ind, void *coo_val, musparseIndexType_t idx_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseSpMatDescr_t descr
- int64_t
rows - int64_t
cols - int64_t
nnzvoidcoo_indvoidcoo_val - musparseIndexType_t
idx_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstCsr
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstCsr(musparseConstSpMatDescr_t `spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void `csrRowOffsets, const void `csrColInd, const void `csrValues, musparseIndexType_t csrRowOffsetsType, musparseIndexType_t csrColIndType, musparseIndexBase_t idxBase, musaDataType valueType)
Parameters:
musparseConstSpMatDescr_t spMatDescr
- int64_t
rows - int64_t
cols - int64_t
nnzconst voidcsrRowOffsetsconst voidcsrColIndconst voidcsrValues - musparseIndexType_t
csrRowOffsetsType - musparseIndexType_t
csrColIndType - musparseIndexBase_t
idxBase - musaDataType
valueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateCsc
MUSPARSE_EXPORT musparseStatus_t musparseCreateCsc(musparseSpMatDescr_t `descr, int64_t rows, int64_t cols, int64_t nnz, void `csc_col_ptr, void `csc_row_ind, void `csc_val, musparseIndexType_t col_ptr_type, musparseIndexType_t row_ind_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseSpMatDescr_t descr
- int64_t
rows - int64_t
cols - int64_t
nnzvoidcsc_col_ptrvoidcsc_row_indvoidcsc_val - musparseIndexType_t
col_ptr_type - musparseIndexType_t
row_ind_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateEll
MUSPARSE_EXPORT musparseStatus_t musparseCreateEll(musparseSpMatDescr_t `descr, int64_t rows, int64_t cols, void `ell_col_ind, void *ell_val, int64_t ell_width, musparseIndexType_t idx_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseSpMatDescr_t descr
- int64_t
rows - int64_t
colsvoidell_col_indvoidell_val - int64_t
ell_width - musparseIndexType_t
idx_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateBlockedEll_legacy
MUSPARSE_EXPORT musparseStatus_t musparseCreateBlockedEll_legacy(musparseSpMatDescr_t `descr, int64_t rows, int64_t cols, musparseDirection_t ell_block_dir, int64_t ell_block_dim, int64_t ell_cols, void `ell_col_ind, void *ell_val, musparseIndexType_t idx_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseSpMatDescr_t descr
- int64_t
rows - int64_t
cols - musparseDirection_t
ell_block_dir - int64_t
ell_block_dim - int64_t
ell_colsvoidell_col_indvoidell_val - musparseIndexType_t
idx_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroySpMat
MUSPARSE_EXPORT musparseStatus_t musparseDestroySpMat(musparseConstSpMatDescr_t descr)
Parameters:
- musparseConstSpMatDescr_t
descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCooAosGet
MUSPARSE_EXPORT musparseStatus_t musparseCooAosGet(const musparseSpMatDescr_t descr, int64_t `rows, int64_t `cols, int64_t `nnz, void `coo_ind, void `coo_val, musparseIndexType_t `idx_type, musparseIndexBase_t `idx_base, musparseDataType_t `data_type)
Parameters:
- const musparseSpMatDescr_t
descrint64_trowsint64_tcolsint64_tnnzvoidcoo_ind*voidcoo_val*musparseIndexType_tidx_typemusparseIndexBase_tidx_basemusparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCooGet
MUSPARSE_EXPORT musparseStatus_t musparseCooGet(const musparseSpMatDescr_t descr, int64_t `rows, int64_t `cols, int64_t `nnz, void `coo_row_ind, void `coo_col_ind, void ``coo_val, musparseIndexType_t `idx_type, musparseIndexBase_t `idx_base, musparseDataType_t `data_type)
Parameters:
- const musparseSpMatDescr_t
descrint64_trowsint64_tcolsint64_tnnzvoidcoo_row_ind*voidcoo_col_ind*voidcoo_val*musparseIndexType_tidx_typemusparseIndexBase_tidx_basemusparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCsrGet
MUSPARSE_EXPORT musparseStatus_t musparseCsrGet(const musparseSpMatDescr_t descr, int64_t `rows, int64_t `cols, int64_t `nnz, void `csr_row_ptr, void `csr_col_ind, void ``csr_val, musparseIndexType_t `row_ptr_type, musparseIndexType_t `col_ind_type, musparseIndexBase_t `idx_base, musparseDataType_t *data_type)
Parameters:
- const musparseSpMatDescr_t
descrint64_trowsint64_tcolsint64_tnnzvoidcsr_row_ptr*voidcsr_col_ind*voidcsr_val*musparseIndexType_trow_ptr_typemusparseIndexType_tcol_ind_typemusparseIndexBase_tidx_basemusparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseEllGet
MUSPARSE_EXPORT musparseStatus_t musparseEllGet(const musparseSpMatDescr_t descr, int64_t `rows, int64_t `cols, void `ell_col_ind, void `ell_val, int64_t `ell_width, musparseIndexType_t `idx_type, musparseIndexBase_t `idx_base, musparseDataType_t `data_type)
Parameters:
- const musparseSpMatDescr_t
descrint64_trowsint64_tcolsvoidell_col_ind*voidell_val*int64_tell_widthmusparseIndexType_tidx_typemusparseIndexBase_tidx_basemusparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseBlockedEllGet_legacy
MUSPARSE_EXPORT musparseStatus_t musparseBlockedEllGet_legacy(const musparseSpMatDescr_t descr, int64_t `rows, int64_t `cols, musparseDirection_t `ell_block_dir, int64_t `ell_block_dim, int64_t `ell_cols, void `ell_col_ind, void `ell_val, musparseIndexType_t `idx_type, musparseIndexBase_t `idx_base, musparseDataType_t `data_type)
Parameters:
- const musparseSpMatDescr_t
descrint64_trowsint64_tcolsmusparseDirection_tell_block_dirint64_tell_block_dimint64_tell_colsvoidell_col_ind*voidell_val*musparseIndexType_tidx_typemusparseIndexBase_tidx_basemusparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCooSetPointers
MUSPARSE_EXPORT musparseStatus_t musparseCooSetPointers(musparseSpMatDescr_t descr, void `coo_row_ind, void `coo_col_ind, void *coo_val)
Parameters:
- musparseSpMatDescr_t
descrvoidcoo_row_indvoidcoo_col_indvoidcoo_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCooAosSetPointers
MUSPARSE_EXPORT musparseStatus_t musparseCooAosSetPointers(musparseSpMatDescr_t descr, void `coo_ind, void `coo_val)
Parameters:
- musparseSpMatDescr_t
descrvoidcoo_indvoidcoo_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCsrSetPointers
MUSPARSE_EXPORT musparseStatus_t musparseCsrSetPointers(musparseSpMatDescr_t descr, void `csr_row_ptr, void `csr_col_ind, void *csr_val)
Parameters:
- musparseSpMatDescr_t
descrvoidcsr_row_ptrvoidcsr_col_indvoidcsr_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCscSetPointers
MUSPARSE_EXPORT musparseStatus_t musparseCscSetPointers(musparseSpMatDescr_t descr, void `csc_col_ptr, void `csc_row_ind, void *csc_val)
Parameters:
- musparseSpMatDescr_t
descrvoidcsc_col_ptrvoidcsc_row_indvoidcsc_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseEllSetPointers
MUSPARSE_EXPORT musparseStatus_t musparseEllSetPointers(musparseSpMatDescr_t descr, void `ell_col_ind, void `ell_val)
Parameters:
- musparseSpMatDescr_t
descrvoidell_col_indvoidell_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatGetSize
MUSPARSE_EXPORT musparseStatus_t musparseSpMatGetSize(musparseConstSpMatDescr_t descr, int64_t `rows, int64_t `cols, int64_t *nnz)
Parameters:
- musparseConstSpMatDescr_t
descrint64_trowsint64_tcolsint64_tnnz
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatGetFormat
MUSPARSE_EXPORT musparseStatus_t musparseSpMatGetFormat(const musparseSpMatDescr_t descr, musparseFormat_t *format)
Parameters:
- const musparseSpMatDescr_t
descrmusparseFormat_tformat
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatGetIndexBase
MUSPARSE_EXPORT musparseStatus_t musparseSpMatGetIndexBase(const musparseConstSpMatDescr_t descr, musparseIndexBase_t *idx_base)
Parameters:
- const musparseConstSpMatDescr_t
descrmusparseIndexBase_tidx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatGetValues
MUSPARSE_EXPORT musparseStatus_t musparseSpMatGetValues(musparseSpMatDescr_t descr, void ``values)
Parameters:
- musparseSpMatDescr_t
descrvoidvalues*
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatSetValues
MUSPARSE_EXPORT musparseStatus_t musparseSpMatSetValues(musparseSpMatDescr_t descr, void *values)
Parameters:
- musparseSpMatDescr_t
descrvoidvalues
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatGetAttribute
MUSPARSE_EXPORT musparseStatus_t musparseSpMatGetAttribute(musparseSpMatDescr_t descr, musparseSpMatAttribute_t attribute, void *data, size_t data_size)
Parameters:
- musparseSpMatDescr_t
descr - musparseSpMatAttribute_t
attributevoiddata - size_t
data_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatSetAttribute
MUSPARSE_EXPORT musparseStatus_t musparseSpMatSetAttribute(musparseSpMatDescr_t descr, musparseSpMatAttribute_t attribute, const void *data, size_t data_size)
Parameters:
- musparseSpMatDescr_t
descr - musparseSpMatAttribute_t
attributeconst voiddata - size_t
data_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyDnVec
MUSPARSE_EXPORT musparseStatus_t musparseDestroyDnVec(musparseDnVecDescr_t descr)
Destroy a dense vector descriptor.
musparseDestroyDnVec destroys a dense vector descriptor and releases all resources used by the descriptor.
Parameters:
descr: the matrix descriptor.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER:descris invalid.
Parameters:
- musparseDnVecDescr_t
descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnVecGet
MUSPARSE_EXPORT musparseStatus_t musparseDnVecGet(const musparseDnVecDescr_t descr, int64_t `size, void ``values, musparseDataType_t `data_type)
Parameters:
- const musparseDnVecDescr_t
descrint64_tsizevoidvalues*musparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnVecGetValues
MUSPARSE_EXPORT musparseStatus_t musparseDnVecGetValues(const musparseDnVecDescr_t descr, void ``values)
Parameters:
- const musparseDnVecDescr_t
descrvoidvalues*
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnVecSetValues
MUSPARSE_EXPORT musparseStatus_t musparseDnVecSetValues(musparseDnVecDescr_t descr, void *values)
Parameters:
- musparseDnVecDescr_t
descrvoidvalues
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateDnMat
MUSPARSE_EXPORT musparseStatus_t musparseCreateDnMat(musparseDnMatDescr_t `descr, int64_t rows, int64_t cols, int64_t ld, void `values, musparseDataType_t data_type, musparseOrder_t order)
Parameters:
musparseDnMatDescr_t descr
- int64_t
rows - int64_t
cols - int64_t
ldvoidvalues - musparseDataType_t
data_type - musparseOrder_t
order
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyDnMat
MUSPARSE_EXPORT musparseStatus_t musparseDestroyDnMat(musparseDnMatDescr_t descr)
Parameters:
- musparseDnMatDescr_t
descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnMatGet
MUSPARSE_EXPORT musparseStatus_t musparseDnMatGet(const musparseDnMatDescr_t descr, int64_t `rows, int64_t `cols, int64_t `ld, void ``values, musparseDataType_t `data_type, musparseOrder_t *order)
Parameters:
- const musparseDnMatDescr_t
descrint64_trowsint64_tcolsint64_tldvoidvalues*musparseDataType_tdata_typemusparseOrder_torder
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnMatGetValues
MUSPARSE_EXPORT musparseStatus_t musparseDnMatGetValues(const musparseDnMatDescr_t descr, void ``values)
Parameters:
- const musparseDnMatDescr_t
descrvoidvalues*
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnMatSetValues
MUSPARSE_EXPORT musparseStatus_t musparseDnMatSetValues(musparseDnMatDescr_t descr, void *values)
Parameters:
- musparseDnMatDescr_t
descrvoidvalues
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnMatGetStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseDnMatGetStridedBatch(musparseConstDnMatDescr_t descr, int `batch_count, int64_t `batch_stride)
Get the batch count and batch stride from the dense matrix descriptor.
Parameters:
descr: the pointer to the dense matrix descriptor.batch_count: the batch count in the dense matrix.batch_stride: the batch stride in the dense matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER: ifdescris invalid.MUSPARSE_STATUS_INVALID_SIZE: ifbatch_countorbatch_strideis invalid.
Parameters:
- musparseConstDnMatDescr_t
descrintbatch_countint64_tbatch_stride
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnMatSetStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseDnMatSetStridedBatch(musparseDnMatDescr_t descr, int batch_count, int64_t batch_stride)
Set the batch count and batch stride in the dense matrix descriptor.
Parameters:
descr: the pointer to the dense matrix descriptor.batch_count: the batch count in the dense matrix.batch_stride: the batch stride in the dense matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER: ifdescris invalid.MUSPARSE_STATUS_INVALID_SIZE: ifbatch_countorbatch_strideis invalid.
Parameters:
- musparseDnMatDescr_t
descr - int
batch_count - int64_t
batch_stride
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatGetStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseSpMatGetStridedBatch(musparseConstSpMatDescr_t descr, int *batch_count)
Parameters:
- musparseConstSpMatDescr_t
descrintbatch_count
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMatSetStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseSpMatSetStridedBatch(musparseSpMatDescr_t descr, int batch_count)
Set the strided batch count in the sparse matrix descriptor.
Parameters:
descr: the pointer to the sparse matrix descriptor.batch_count: batch_count of the sparse matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER: ifdescris invalid.MUSPARSE_STATUS_INVALID_SIZE: ifbatch_countis invalid.
Parameters:
- musparseSpMatDescr_t
descr - int
batch_count
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCooSetStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseCooSetStridedBatch(musparseSpMatDescr_t descr, int batch_count, int64_t batch_stride)
Set the batch count and batch stride in the sparse COO matrix descriptor.
Parameters:
descr: the pointer to the sparse COO matrix descriptor.batch_count: batch_count of the sparse COO matrix.batch_stride: batch stride of the sparse COO matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER: ifdescris invalid.MUSPARSE_STATUS_INVALID_SIZE: ifbatch_countorbatch_strideis invalid.
Parameters:
- musparseSpMatDescr_t
descr - int
batch_count - int64_t
batch_stride
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCsrSetStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseCsrSetStridedBatch(musparseSpMatDescr_t descr, int batch_count, int64_t offsets_batch_stride, int64_t columns_values_batch_stride)
Set the batch count, row offset batch stride and the column indices batch stride in the sparse CSR matrix descriptor.
Parameters:
descr: the pointer to the sparse CSR matrix descriptor.batch_count: batch_count of the sparse CSR matrix.offsets_batch_stride: row offset batch stride of the sparse CSR matrix.columns_values_batch_stride: column indices batch stride of the sparse CSR matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER: ifdescris invalid.MUSPARSE_STATUS_INVALID_SIZE: ifbatch_countoroffsets_batch_strideorcolumns_values_batch_strideis invalid.
Parameters:
- musparseSpMatDescr_t
descr - int
batch_count - int64_t
offsets_batch_stride - int64_t
columns_values_batch_stride
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCscSetStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseCscSetStridedBatch(musparseSpMatDescr_t descr, int batch_count, int64_t offsets_batch_stride, int64_t rows_values_batch_stride)
Set the batch count, column offset batch stride and the row indices batch stride in the sparse CSC matrix descriptor.
Parameters:
descr: the pointer to the sparse CSC matrix descriptor.batch_count: batch_count of the sparse CSC matrix.offsets_batch_stride: column offset batch stride of the sparse CSC matrix.rows_values_batch_stride: row indices batch stride of the sparse CSC matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_POINTER: ifdescris invalid.MUSPARSE_STATUS_INVALID_SIZE: ifbatch_countoroffsets_batch_strideorrows_values_batch_strideis invalid.
Parameters:
- musparseSpMatDescr_t
descr - int
batch_count - int64_t
offsets_batch_stride - int64_t
rows_values_batch_stride
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGetErrorName
MUSPARSE_EXPORT const char * musparseGetErrorName(musparseStatus_t status)
Get the number of rows, columns and non-zeros from the sparse matrix descriptor.
Parameters:
descr: the pointer to the sparse matrix descriptor.rows: number of rows in the sparse matrix.cols: number of columns in the sparse matrix.nnz: number of non-zeros in sparse matrix.
Return values:
musparse_status_success: the operation completed successfully.musparse_status_invalid_pointer: ifdescris invalid.musparse_status_invalid_size: ifrowsorcolsornnzis invalid.
Parameters:
- musparseStatus_t
status
Return type: MUSPARSE_EXPORT const char *
Function musparseGetErrorString
MUSPARSE_EXPORT const char * musparseGetErrorString(musparseStatus_t status)
Parameters:
- musparseStatus_t
status
Return type: MUSPARSE_EXPORT const char *
Function musparseGetProperty
MUSPARSE_EXPORT musparseStatus_t musparseGetProperty(libraryPropertyType type, int *value)
Parameters:
- libraryPropertyType
typeintvalue
Return type: MUSPARSE_EXPORT musparseStatus_t
File musparse-compatible.h
Location: musparse-compatible.h
Macros
Typedefs
Typedef musparseLoggerCallback_t
Definition: musparse-compatible.h (line 3109)
typedef void(` musparseLoggerCallback_t) (int logLevel, const char `functionName, const char *message)
Return type: void(*
Functions
Function musparseCreateCsric02Info
MUSPARSE_EXPORT musparseStatus_t musparseCreateCsric02Info(csric02Info_t *info)
Parameters:
csric02Info_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyCsric02Info
MUSPARSE_EXPORT musparseStatus_t musparseDestroyCsric02Info(csric02Info_t info)
Parameters:
- csric02Info_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateBsric02Info
MUSPARSE_EXPORT musparseStatus_t musparseCreateBsric02Info(bsric02Info_t *info)
Parameters:
bsric02Info_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyBsric02Info
MUSPARSE_EXPORT musparseStatus_t musparseDestroyBsric02Info(bsric02Info_t info)
Parameters:
- bsric02Info_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateCsrilu02Info
MUSPARSE_EXPORT musparseStatus_t musparseCreateCsrilu02Info(csrilu02Info_t *info)
Parameters:
csrilu02Info_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyCsrilu02Info
MUSPARSE_EXPORT musparseStatus_t musparseDestroyCsrilu02Info(csrilu02Info_t info)
Parameters:
- csrilu02Info_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateBsrilu02Info
MUSPARSE_EXPORT musparseStatus_t musparseCreateBsrilu02Info(bsrilu02Info_t *info)
Parameters:
bsrilu02Info_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyBsrilu02Info
MUSPARSE_EXPORT musparseStatus_t musparseDestroyBsrilu02Info(bsrilu02Info_t info)
Parameters:
- bsrilu02Info_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateBsrsv2Info
MUSPARSE_EXPORT musparseStatus_t musparseCreateBsrsv2Info(bsrsv2Info_t *info)
Parameters:
bsrsv2Info_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyBsrsv2Info
MUSPARSE_EXPORT musparseStatus_t musparseDestroyBsrsv2Info(bsrsv2Info_t info)
Parameters:
- bsrsv2Info_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateBsrsm2Info
MUSPARSE_EXPORT musparseStatus_t musparseCreateBsrsm2Info(bsrsm2Info_t *info)
Parameters:
bsrsm2Info_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyBsrsm2Info
MUSPARSE_EXPORT musparseStatus_t musparseDestroyBsrsm2Info(bsrsm2Info_t info)
Parameters:
- bsrsm2Info_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateCsru2csrInfo
MUSPARSE_EXPORT musparseStatus_t musparseCreateCsru2csrInfo(csru2csrInfo_t *info)
Parameters:
csru2csrInfo_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyCsru2csrInfo
MUSPARSE_EXPORT musparseStatus_t musparseDestroyCsru2csrInfo(csru2csrInfo_t info)
Parameters:
- csru2csrInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreatePruneInfo
MUSPARSE_EXPORT musparseStatus_t musparseCreatePruneInfo(pruneInfo_t *info)
Parameters:
pruneInfo_t info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyPruneInfo
MUSPARSE_EXPORT musparseStatus_t musparseDestroyPruneInfo(pruneInfo_t info)
Parameters:
- pruneInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrilu02_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseScsrilu02_numericBoost(musparseHandle_t handle, csrilu02Info_t info, muInt enable_boost, double `tol, float `boost_val)
Parameters:
- musparseHandle_t
handle - csrilu02Info_t
info - muInt
enable_boostdoubletolfloatboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrilu02_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseDcsrilu02_numericBoost(musparseHandle_t handle, csrilu02Info_t info, muInt enable_boost, double `tol, double `boost_val)
Parameters:
- musparseHandle_t
handle - csrilu02Info_t
info - muInt
enable_boostdoubletoldoubleboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrilu02_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseCcsrilu02_numericBoost(musparseHandle_t handle, csrilu02Info_t info, muInt enable_boost, double `tol, muComplex `boost_val)
Parameters:
- musparseHandle_t
handle - csrilu02Info_t
info - muInt
enable_boostdoubletolmuComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrilu02_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseZcsrilu02_numericBoost(musparseHandle_t handle, csrilu02Info_t info, muInt enable_boost, double `tol, muDoubleComplex `boost_val)
Parameters:
- musparseHandle_t
handle - csrilu02Info_t
info - muInt
enable_boostdoubletolmuDoubleComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrilu02_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXcsrilu02_zeroPivot(musparseHandle_t handle, csrilu02Info_t info, muInt *position)
Parameters:
- musparseHandle_t
handle - csrilu02Info_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrilu02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseScsrilu02_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, float `csrSortedValA, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, muInt `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAfloatcsrSortedValAconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
infomuIntpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrilu02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDcsrilu02_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, double `csrSortedValA, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, muInt `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAdoublecsrSortedValAconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
infomuIntpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrilu02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCcsrilu02_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, muComplex `csrSortedValA, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, muInt `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAmuComplexcsrSortedValAconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
infomuIntpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrilu02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZcsrilu02_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, muDoubleComplex `csrSortedValA, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, muInt `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAmuDoubleComplexcsrSortedValAconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
infomuIntpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrilu02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseScsrilu02_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, const float `csrSortedValA, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAconst floatcsrSortedValAconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrilu02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDcsrilu02_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, const double `csrSortedValA, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAconst doublecsrSortedValAconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrilu02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCcsrilu02_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, const muComplex `csrSortedValA, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAconst muComplexcsrSortedValAconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrilu02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZcsrilu02_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, const muDoubleComplex `csrSortedValA, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAconst muDoubleComplexcsrSortedValAconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrilu02
MUSPARSE_EXPORT musparseStatus_t musparseScsrilu02(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, float `csrSortedValA_valM, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAfloatcsrSortedValA_valMconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrilu02
MUSPARSE_EXPORT musparseStatus_t musparseDcsrilu02(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, double `csrSortedValA_valM, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAdoublecsrSortedValA_valMconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrilu02
MUSPARSE_EXPORT musparseStatus_t musparseCcsrilu02(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, muComplex `csrSortedValA_valM, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAmuComplexcsrSortedValA_valMconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrilu02
MUSPARSE_EXPORT musparseStatus_t musparseZcsrilu02(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descrA, muDoubleComplex `csrSortedValA_valM, const muInt `csrSortedRowPtrA, const muInt `csrSortedColIndA, csrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrAmuDoubleComplexcsrSortedValA_valMconst muIntcsrSortedRowPtrAconst muIntcsrSortedColIndA - csrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrilu02_clear
MUSPARSE_EXPORT musparseStatus_t musparseXcsrilu02_clear(musparseHandle_t handle, musparseMatInfo_t info)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSV_createDescr
MUSPARSE_EXPORT musparseStatus_t musparseSpSV_createDescr(musparseSpSVDescr_t *spsvDescr)
Parameters:
musparseSpSVDescr_t spsvDescr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSV_destroyDescr
MUSPARSE_EXPORT musparseStatus_t musparseSpSV_destroyDescr(musparseSpSVDescr_t spsvDescr)
Parameters:
- musparseSpSVDescr_t
spsvDescr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSV_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpSV_bufferSize(musparseHandle_t handle, musparseOperation_t trans, const void `alpha, musparseSpMatDescr_t mat, musparseDnVecDescr_t x, musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpSVAlg_t alg, musparseSpSVDescr_t spsvDescr, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - musparseSpMatDescr_t
mat - musparseDnVecDescr_t
x - musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpSVAlg_t
alg - musparseSpSVDescr_t
spsvDescrsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSV_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSpSV_analysis(musparseHandle_t handle, musparseOperation_t trans, const void `alpha, musparseSpMatDescr_t mat, musparseDnVecDescr_t x, musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpSVAlg_t alg, musparseSpSVDescr_t spsvDescr, void `buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - musparseSpMatDescr_t
mat - musparseDnVecDescr_t
x - musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpSVAlg_t
alg - musparseSpSVDescr_t
spsvDescrvoidbuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSV_solve
MUSPARSE_EXPORT musparseStatus_t musparseSpSV_solve(musparseHandle_t handle, musparseOperation_t trans, const void *alpha, musparseSpMatDescr_t mat, musparseDnVecDescr_t x, musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpSVAlg_t alg, musparseSpSVDescr_t spsvDescr)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - musparseSpMatDescr_t
mat - musparseDnVecDescr_t
x - musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpSVAlg_t
alg - musparseSpSVDescr_t
spsvDescr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu02_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu02_numericBoost(musparseHandle_t handle, bsrilu02Info_t info, int enable_boost, double `tol, float `boost_val)
Parameters:
- musparseHandle_t
handle - bsrilu02Info_t
info - int
enable_boostdoubletolfloatboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu02_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu02_numericBoost(musparseHandle_t handle, bsrilu02Info_t info, int enable_boost, double `tol, double `boost_val)
Parameters:
- musparseHandle_t
handle - bsrilu02Info_t
info - int
enable_boostdoubletoldoubleboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu02_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu02_numericBoost(musparseHandle_t handle, bsrilu02Info_t info, int enable_boost, double `tol, muComplex `boost_val)
Parameters:
- musparseHandle_t
handle - bsrilu02Info_t
info - int
enable_boostdoubletolmuComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu02_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu02_numericBoost(musparseHandle_t handle, bsrilu02Info_t info, int enable_boost, double `tol, muDoubleComplex `boost_val)
Parameters:
- musparseHandle_t
handle - bsrilu02Info_t
info - int
enable_boostdoubletolmuDoubleComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsrilu02_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXbsrilu02_zeroPivot(musparseHandle_t handle, bsrilu02Info_t info, int *position)
Parameters:
- musparseHandle_t
handle - bsrilu02Info_t
infointposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu02_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu02_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu02_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu02_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu02_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrilu02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrilu02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu02_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrilu02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrilu02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu02_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrilu02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrilu02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu02_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrilu02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrilu02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu02_analysis(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu02_analysis(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu02_analysis(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu02_analysis(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu02
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu02(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu02
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu02(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu02
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu02(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu02
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu02(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsrilu02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsrilu02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsric02_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXcsric02_zeroPivot(musparseHandle_t handle, csric02Info_t info, int *position)
Parameters:
- musparseHandle_t
handle - csric02Info_t
infointposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsric02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseScsric02_bufferSize(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, float `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAfloatcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsric02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDcsric02_bufferSize(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, double `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAdoublecsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsric02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCcsric02_bufferSize(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, muComplex `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAmuComplexcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsric02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZcsric02_bufferSize(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, muDoubleComplex `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAmuDoubleComplexcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsric02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseScsric02_bufferSizeExt(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, float `csrSortedVal, const int `csrSortedRowPtr, const int `csrSortedColInd, csric02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAfloatcsrSortedValconst intcsrSortedRowPtrconst intcsrSortedColInd - csric02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsric02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDcsric02_bufferSizeExt(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, double `csrSortedVal, const int `csrSortedRowPtr, const int `csrSortedColInd, csric02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAdoublecsrSortedValconst intcsrSortedRowPtrconst intcsrSortedColInd - csric02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsric02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCcsric02_bufferSizeExt(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, muComplex `csrSortedVal, const int `csrSortedRowPtr, const int `csrSortedColInd, csric02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAmuComplexcsrSortedValconst intcsrSortedRowPtrconst intcsrSortedColInd - csric02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsric02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZcsric02_bufferSizeExt(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, muDoubleComplex `csrSortedVal, const int `csrSortedRowPtr, const int `csrSortedColInd, csric02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAmuDoubleComplexcsrSortedValconst intcsrSortedRowPtrconst intcsrSortedColInd - csric02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsric02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseScsric02_analysis(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, const float `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAconst floatcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsric02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDcsric02_analysis(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, const double `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAconst doublecsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsric02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCcsric02_analysis(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, const muComplex `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAconst muComplexcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsric02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZcsric02_analysis(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, const muDoubleComplex `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAconst muDoubleComplexcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsric02
MUSPARSE_EXPORT musparseStatus_t musparseScsric02(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, float `csrSortedValA_valM, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAfloatcsrSortedValA_valMconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsric02
MUSPARSE_EXPORT musparseStatus_t musparseDcsric02(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, double `csrSortedValA_valM, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAdoublecsrSortedValA_valMconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsric02
MUSPARSE_EXPORT musparseStatus_t musparseCcsric02(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, muComplex `csrSortedValA_valM, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAmuComplexcsrSortedValA_valMconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsric02
MUSPARSE_EXPORT musparseStatus_t musparseZcsric02(musparseHandle_t handle, int m, int nnz, const musparseMatDescr_t descrA, muDoubleComplex `csrSortedValA_valM, const int `csrSortedRowPtrA, const int `csrSortedColIndA, csric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nnz - const musparseMatDescr_t
descrAmuDoubleComplexcsrSortedValA_valMconst intcsrSortedRowPtrAconst intcsrSortedColIndA - csric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsric02_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXbsric02_zeroPivot(musparseHandle_t handle, bsric02Info_t info, int *position)
Parameters:
- musparseHandle_t
handle - bsric02Info_t
infointposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsric02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSbsric02_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsric02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDbsric02_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsric02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCbsric02_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsric02_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZbsric02_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsric02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSbsric02_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsric02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsric02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsric02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDbsric02_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsric02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsric02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsric02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCbsric02_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsric02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsric02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsric02_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZbsric02_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsric02Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsric02Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsric02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSbsric02_analysis(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, const float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, musparseSolvePolicy_t policy, void `pInputBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAconst floatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
info - musparseSolvePolicy_t
policyvoidpInputBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsric02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDbsric02_analysis(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, const double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, musparseSolvePolicy_t policy, void `pInputBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAconst doublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
info - musparseSolvePolicy_t
policyvoidpInputBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsric02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCbsric02_analysis(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, const muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, musparseSolvePolicy_t policy, void `pInputBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAconst muComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
info - musparseSolvePolicy_t
policyvoidpInputBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsric02_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZbsric02_analysis(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, const muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, musparseSolvePolicy_t policy, void `pInputBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAconst muDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
info - musparseSolvePolicy_t
policyvoidpInputBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsric02
MUSPARSE_EXPORT musparseStatus_t musparseSbsric02(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsric02
MUSPARSE_EXPORT musparseStatus_t musparseDbsric02(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsric02
MUSPARSE_EXPORT musparseStatus_t musparseCbsric02(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsric02
MUSPARSE_EXPORT musparseStatus_t musparseZbsric02(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockDim, bsric02Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockDim - bsric02Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsrsm2_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXbsrsm2_zeroPivot(musparseHandle_t handle, bsrsm2Info_t info, int *position)
Parameters:
- musparseHandle_t
handle - bsrsm2Info_t
infointposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsm2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsm2_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsm2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsm2_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsm2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsm2_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsm2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsm2_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsm2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsm2_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transB, int mb, int n, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transB - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsm2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsm2_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transB, int mb, int n, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transB - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsm2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsm2_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transB, int mb, int n, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transB - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsm2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsm2_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transB, int mb, int n, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transB - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsm2_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsm2_analysis(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const musparseMatDescr_t descrA, const float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAconst floatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsm2_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsm2_analysis(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const musparseMatDescr_t descrA, const double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAconst doublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsm2_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsm2_analysis(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const musparseMatDescr_t descrA, const muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAconst muComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsm2_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsm2_analysis(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const musparseMatDescr_t descrA, const muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzb - const musparseMatDescr_t
descrAconst muDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsm2_solve
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsm2_solve(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const float `alpha, const musparseMatDescr_t descrA, const float `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, const float `B, int ldb, float `X, int ldx, musparseSolvePolicy_t policy, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzbconst floatalpha - const musparseMatDescr_t
descrAconst floatbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infoconst floatB - int
ldbfloatX - int
ldx - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsm2_solve
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsm2_solve(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const double `alpha, const musparseMatDescr_t descrA, const double `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, const double `B, int ldb, double `X, int ldx, musparseSolvePolicy_t policy, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzbconst doublealpha - const musparseMatDescr_t
descrAconst doublebsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infoconst doubleB - int
ldbdoubleX - int
ldx - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsm2_solve
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsm2_solve(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const muComplex `alpha, const musparseMatDescr_t descrA, const muComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, const muComplex `B, int ldb, muComplex `X, int ldx, musparseSolvePolicy_t policy, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzbconst muComplexalpha - const musparseMatDescr_t
descrAconst muComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infoconst muComplexB - int
ldbmuComplexX - int
ldx - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsm2_solve
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsm2_solve(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, musparseOperation_t transXY, int mb, int n, int nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descrA, const muDoubleComplex `bsrSortedVal, const int `bsrSortedRowPtr, const int `bsrSortedColInd, int blockSize, bsrsm2Info_t info, const muDoubleComplex `B, int ldb, muDoubleComplex `X, int ldx, musparseSolvePolicy_t policy, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - musparseOperation_t
transXY - int
mb - int
n - int
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrAconst muDoubleComplexbsrSortedValconst intbsrSortedRowPtrconst intbsrSortedColInd - int
blockSize - bsrsm2Info_t
infoconst muDoubleComplexB - int
ldbmuDoubleComplexX - int
ldx - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsrsv2_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXbsrsv2_zeroPivot(musparseHandle_t handle, bsrsv2Info_t info, int *position)
Parameters:
- musparseHandle_t
handle - bsrsv2Info_t
infointposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsv2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsv2_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsv2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsv2_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsv2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsv2_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsv2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsv2_bufferSize(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
infointpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsv2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsv2_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, float `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockSize, bsrsv2Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAfloatbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockSize - bsrsv2Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsv2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsv2_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, double `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockSize, bsrsv2Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAdoublebsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockSize - bsrsv2Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsv2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsv2_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, muComplex `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockSize, bsrsv2Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuComplexbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockSize - bsrsv2Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsv2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsv2_bufferSizeExt(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, muDoubleComplex `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockSize, bsrsv2Info_t info, size_t `pBufferSize)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAmuDoubleComplexbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockSize - bsrsv2Info_t
infosize_tpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsv2_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsv2_analysis(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, const float `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAconst floatbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsv2_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsv2_analysis(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, const double `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAconst doublebsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsv2_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsv2_analysis(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, const muComplex `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAconst muComplexbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsv2_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsv2_analysis(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const musparseMatDescr_t descrA, const muDoubleComplex `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, musparseSolvePolicy_t policy, void `pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzb - const musparseMatDescr_t
descrAconst muDoubleComplexbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
info - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsv2_solve
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsv2_solve(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const float `alpha, const musparseMatDescr_t descrA, const float `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const float `f, float `x, musparseSolvePolicy_t policy, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzbconst floatalpha - const musparseMatDescr_t
descrAconst floatbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
infoconst floatffloatx - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsv2_solve
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsv2_solve(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const double `alpha, const musparseMatDescr_t descrA, const double `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const double `f, double `x, musparseSolvePolicy_t policy, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzbconst doublealpha - const musparseMatDescr_t
descrAconst doublebsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
infoconst doublefdoublex - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsv2_solve
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsv2_solve(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const muComplex `alpha, const musparseMatDescr_t descrA, const muComplex `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const muComplex `f, muComplex `x, musparseSolvePolicy_t policy, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzbconst muComplexalpha - const musparseMatDescr_t
descrAconst muComplexbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
infoconst muComplexfmuComplexx - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsv2_solve
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsv2_solve(musparseHandle_t handle, musparseDirection_t dirA, musparseOperation_t transA, int mb, int nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descrA, const muDoubleComplex `bsrSortedValA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const muDoubleComplex `f, muDoubleComplex `x, musparseSolvePolicy_t policy, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - musparseOperation_t
transA - int
mb - int
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrAconst muDoubleComplexbsrSortedValAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
blockDim - bsrsv2Info_t
infoconst muDoubleComplexfmuDoubleComplexx - musparseSolvePolicy_t
policyvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2gebsr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseScsr2gebsr_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt row_block_dim, muInt col_block_dim, muInt `p_buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
row_block_dim - muInt
col_block_dimmuIntp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2gebsr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2gebsr_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt row_block_dim, muInt col_block_dim, muInt `p_buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
row_block_dim - muInt
col_block_dimmuIntp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2gebsr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2gebsr_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt row_block_dim, muInt col_block_dim, muInt `p_buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
row_block_dim - muInt
col_block_dimmuIntp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2gebsr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2gebsr_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt row_block_dim, muInt col_block_dim, muInt `p_buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
row_block_dim - muInt
col_block_dimmuIntp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrmm2
MUSPARSE_EXPORT musparseStatus_t musparseScsrmm2(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const float `alpha, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const float `B, muInt ldb, const float `beta, float *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst floatalpha - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst floatB - muInt
ldbconst floatbetafloatC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrmm2
MUSPARSE_EXPORT musparseStatus_t musparseDcsrmm2(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const double `alpha, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const double `B, muInt ldb, const double `beta, double *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst doublealpha - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst doubleB - muInt
ldbconst doublebetadoubleC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrmm2
MUSPARSE_EXPORT musparseStatus_t musparseCcsrmm2(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muComplex `B, muInt ldb, const muComplex `beta, muComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muComplexB - muInt
ldbconst muComplexbetamuComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrmm2
MUSPARSE_EXPORT musparseStatus_t musparseZcsrmm2(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muDoubleComplex `B, muInt ldb, const muDoubleComplex `beta, muDoubleComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muDoubleComplexB - muInt
ldbconst muDoubleComplexbetamuDoubleComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrgeam2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseScsrgeam2_bufferSizeExt(musparseHandle_t handle, int m, int n, const float `alpha, const musparseMatDescr_t descrA, int nnzA, const float `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const float `beta, const musparseMatDescr_t descrB, int nnzB, const float `csrSortedValB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, const float `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst floatalpha - const musparseMatDescr_t
descrA - int
nnzAconst floatcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst floatbeta - const musparseMatDescr_t
descrB - int
nnzBconst floatcsrSortedValBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCconst floatcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrgeam2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDcsrgeam2_bufferSizeExt(musparseHandle_t handle, int m, int n, const double `alpha, const musparseMatDescr_t descrA, int nnzA, const double `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const double `beta, const musparseMatDescr_t descrB, int nnzB, const double `csrSortedValB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, const double `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst doublealpha - const musparseMatDescr_t
descrA - int
nnzAconst doublecsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst doublebeta - const musparseMatDescr_t
descrB - int
nnzBconst doublecsrSortedValBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCconst doublecsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrgeam2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCcsrgeam2_bufferSizeExt(musparseHandle_t handle, int m, int n, const muComplex `alpha, const musparseMatDescr_t descrA, int nnzA, const muComplex `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const muComplex `beta, const musparseMatDescr_t descrB, int nnzB, const muComplex `csrSortedValB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, const muComplex `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst muComplexalpha - const musparseMatDescr_t
descrA - int
nnzAconst muComplexcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst muComplexbeta - const musparseMatDescr_t
descrB - int
nnzBconst muComplexcsrSortedValBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCconst muComplexcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrgeam2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZcsrgeam2_bufferSizeExt(musparseHandle_t handle, int m, int n, const muDoubleComplex `alpha, const musparseMatDescr_t descrA, int nnzA, const muDoubleComplex `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const muDoubleComplex `beta, const musparseMatDescr_t descrB, int nnzB, const muDoubleComplex `csrSortedValB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, const muDoubleComplex `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst muDoubleComplexalpha - const musparseMatDescr_t
descrA - int
nnzAconst muDoubleComplexcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst muDoubleComplexbeta - const musparseMatDescr_t
descrB - int
nnzBconst muDoubleComplexcsrSortedValBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCconst muDoubleComplexcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrgeam2Nnz
MUSPARSE_EXPORT musparseStatus_t musparseXcsrgeam2Nnz(musparseHandle_t handle, int m, int n, const musparseMatDescr_t descrA, int nnzA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const musparseMatDescr_t descrB, int nnzB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, int `csrSortedRowPtrC, int `nnzTotalDevHostPtr, void *workspace)
Parameters:
- musparseHandle_t
handle - int
m - int
n - const musparseMatDescr_t
descrA - int
nnzAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - const musparseMatDescr_t
descrB - int
nnzBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCintcsrSortedRowPtrCintnnzTotalDevHostPtrvoidworkspace
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrgeam2
MUSPARSE_EXPORT musparseStatus_t musparseScsrgeam2(musparseHandle_t handle, int m, int n, const float `alpha, const musparseMatDescr_t descrA, int nnzA, const float `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const float `beta, const musparseMatDescr_t descrB, int nnzB, const float `csrSortedValB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, float `csrSortedValC, int `csrSortedRowPtrC, int `csrSortedColIndC, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst floatalpha - const musparseMatDescr_t
descrA - int
nnzAconst floatcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst floatbeta - const musparseMatDescr_t
descrB - int
nnzBconst floatcsrSortedValBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCfloatcsrSortedValCintcsrSortedRowPtrCintcsrSortedColIndCvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrgeam2
MUSPARSE_EXPORT musparseStatus_t musparseDcsrgeam2(musparseHandle_t handle, int m, int n, const double `alpha, const musparseMatDescr_t descrA, int nnzA, const double `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const double `beta, const musparseMatDescr_t descrB, int nnzB, const double `csrSortedValB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, double `csrSortedValC, int `csrSortedRowPtrC, int `csrSortedColIndC, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst doublealpha - const musparseMatDescr_t
descrA - int
nnzAconst doublecsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst doublebeta - const musparseMatDescr_t
descrB - int
nnzBconst doublecsrSortedValBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCdoublecsrSortedValCintcsrSortedRowPtrCintcsrSortedColIndCvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrgeam2
MUSPARSE_EXPORT musparseStatus_t musparseCcsrgeam2(musparseHandle_t handle, int m, int n, const muComplex `alpha, const musparseMatDescr_t descrA, int nnzA, const muComplex `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const muComplex `beta, const musparseMatDescr_t descrB, int nnzB, const muComplex `csrSortedValB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, muComplex `csrSortedValC, int `csrSortedRowPtrC, int `csrSortedColIndC, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst muComplexalpha - const musparseMatDescr_t
descrA - int
nnzAconst muComplexcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst muComplexbeta - const musparseMatDescr_t
descrB - int
nnzBconst muComplexcsrSortedValBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCmuComplexcsrSortedValCintcsrSortedRowPtrCintcsrSortedColIndCvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrgeam2
MUSPARSE_EXPORT musparseStatus_t musparseZcsrgeam2(musparseHandle_t handle, int m, int n, const muDoubleComplex `alpha, const musparseMatDescr_t descrA, int nnzA, const muDoubleComplex `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const muDoubleComplex `beta, const musparseMatDescr_t descrB, int nnzB, const muDoubleComplex `csrSortedValB, const int `csrSortedRowPtrB, const int `csrSortedColIndB, const musparseMatDescr_t descrC, muDoubleComplex `csrSortedValC, int `csrSortedRowPtrC, int `csrSortedColIndC, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst muDoubleComplexalpha - const musparseMatDescr_t
descrA - int
nnzAconst muDoubleComplexcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst muDoubleComplexbeta - const musparseMatDescr_t
descrB - int
nnzBconst muDoubleComplexcsrSortedValBconst intcsrSortedRowPtrBconst intcsrSortedColIndB - const musparseMatDescr_t
descrCmuDoubleComplexcsrSortedValCintcsrSortedRowPtrCintcsrSortedColIndCvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const __half `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const __half `threshold, const musparseMatDescr_t descrC, const __half `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst __halfcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst __halfthreshold - const musparseMatDescr_t
descrCconst __halfcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const float `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const float `threshold, const musparseMatDescr_t descrC, const float `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst floatcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst floatthreshold - const musparseMatDescr_t
descrCconst floatcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const double `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const double `threshold, const musparseMatDescr_t descrC, const double `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst doublecsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst doublethreshold - const musparseMatDescr_t
descrCconst doublecsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csrNnz
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csrNnz(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const __half `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const __half `threshold, const musparseMatDescr_t descrC, int `csrSortedRowPtrC, int `nnzTotalDevHostPtr, void *pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst __halfcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst __halfthreshold - const musparseMatDescr_t
descrCintcsrSortedRowPtrCintnnzTotalDevHostPtrvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csrNnz
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csrNnz(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const float `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const float `threshold, const musparseMatDescr_t descrC, int `csrSortedRowPtrC, int `nnzTotalDevHostPtr, void *pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst floatcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst floatthreshold - const musparseMatDescr_t
descrCintcsrSortedRowPtrCintnnzTotalDevHostPtrvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csrNnz
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csrNnz(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const double `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const double `threshold, const musparseMatDescr_t descrC, int `csrSortedRowPtrC, int `nnzTotalDevHostPtr, void *pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst doublecsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst doublethreshold - const musparseMatDescr_t
descrCintcsrSortedRowPtrCintnnzTotalDevHostPtrvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csr(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const __half `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const __half `threshold, const musparseMatDescr_t descrC, __half `csrSortedValC, const int `csrSortedRowPtrC, int `csrSortedColIndC, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst __halfcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndAconst __halfthreshold - const musparseMatDescr_t
descrC__halfcsrSortedValCconst intcsrSortedRowPtrCintcsrSortedColIndCvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csrNnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csrNnzByPercentage(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const __half `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, float percentage, const musparseMatDescr_t descrC, int `csrSortedRowPtrC, int `nnzTotalDevHostPtr, pruneInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst __halfcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - float
percentage - const musparseMatDescr_t
descrCintcsrSortedRowPtrCintnnzTotalDevHostPtr - pruneInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csrNnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csrNnzByPercentage(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const float `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, float percentage, const musparseMatDescr_t descrC, int `csrSortedRowPtrC, int `nnzTotalDevHostPtr, pruneInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst floatcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - float
percentage - const musparseMatDescr_t
descrCintcsrSortedRowPtrCintnnzTotalDevHostPtr - pruneInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csrNnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csrNnzByPercentage(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const double `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, float percentage, const musparseMatDescr_t descrC, int `csrSortedRowPtrC, int `nnzTotalDevHostPtr, pruneInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst doublecsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - float
percentage - const musparseMatDescr_t
descrCintcsrSortedRowPtrCintnnzTotalDevHostPtr - pruneInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csrByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csrByPercentage(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const __half `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, float percentage, const musparseMatDescr_t descrC, __half `csrSortedValC, const int `csrSortedRowPtrC, int `csrSortedColIndC, pruneInfo_t info, void *pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst __halfcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - float
percentage - const musparseMatDescr_t
descrC__halfcsrSortedValCconst intcsrSortedRowPtrCintcsrSortedColIndC - pruneInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csrByPercentage_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csrByPercentage_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const __half `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, float percentage, const musparseMatDescr_t descrC, const __half `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, pruneInfo_t info, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst __halfcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - float
percentage - const musparseMatDescr_t
descrCconst __halfcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndC - pruneInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csrByPercentage_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csrByPercentage_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const float `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, float percentage, const musparseMatDescr_t descrC, const float `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, pruneInfo_t info, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst floatcsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - float
percentage - const musparseMatDescr_t
descrCconst floatcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndC - pruneInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csrByPercentage_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csrByPercentage_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnzA, const musparseMatDescr_t descrA, const double `csrSortedValA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, float percentage, const musparseMatDescr_t descrC, const double `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, pruneInfo_t info, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzA - const musparseMatDescr_t
descrAconst doublecsrSortedValAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - float
percentage - const musparseMatDescr_t
descrCconst doublecsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndC - pruneInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, const __half `A, int lda, const __half `threshold, const musparseMatDescr_t descrC, const __half `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst __halfA - int
ldaconst __halfthreshold - const musparseMatDescr_t
descrCconst __halfcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, const float `A, int lda, const float `threshold, const musparseMatDescr_t descrC, const float `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst floatA - int
ldaconst floatthreshold - const musparseMatDescr_t
descrCconst floatcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, const double `A, int lda, const double `threshold, const musparseMatDescr_t descrC, const double `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst doubleA - int
ldaconst doublethreshold - const musparseMatDescr_t
descrCconst doublecsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndCsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csrNnz
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csrNnz(musparseHandle_t handle, int m, int n, const __half `A, int lda, const __half `threshold, const musparseMatDescr_t descrC, int `csrRowPtrC, int `nnzTotalDevHostPtr, void *pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst __halfA - int
ldaconst __halfthreshold - const musparseMatDescr_t
descrCintcsrRowPtrCintnnzTotalDevHostPtrvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csrNnz
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csrNnz(musparseHandle_t handle, int m, int n, const float `A, int lda, const float `threshold, const musparseMatDescr_t descrC, int `csrRowPtrC, int `nnzTotalDevHostPtr, void *pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst floatA - int
ldaconst floatthreshold - const musparseMatDescr_t
descrCintcsrRowPtrCintnnzTotalDevHostPtrvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csrNnz
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csrNnz(musparseHandle_t handle, int m, int n, const double `A, int lda, const double `threshold, const musparseMatDescr_t descrC, int `csrSortedRowPtrC, int `nnzTotalDevHostPtr, void *pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst doubleA - int
ldaconst doublethreshold - const musparseMatDescr_t
descrCintcsrSortedRowPtrCintnnzTotalDevHostPtrvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csr
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csr(musparseHandle_t handle, int m, int n, const __half `A, int lda, const __half `threshold, const musparseMatDescr_t descrC, __half `csrSortedValC, const int `csrSortedRowPtrC, int `csrSortedColIndC, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst __halfA - int
ldaconst __halfthreshold - const musparseMatDescr_t
descrC__halfcsrSortedValCconst intcsrSortedRowPtrCintcsrSortedColIndCvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csrByPercentage_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csrByPercentage_bufferSizeExt(musparseHandle_t handle, int m, int n, const __half `A, int lda, float percentage, const musparseMatDescr_t descrC, const __half `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, pruneInfo_t info, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst __halfA - int
lda - float
percentage - const musparseMatDescr_t
descrCconst __halfcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndC - pruneInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csrByPercentage_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csrByPercentage_bufferSizeExt(musparseHandle_t handle, int m, int n, const float `A, int lda, float percentage, const musparseMatDescr_t descrC, const float `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, pruneInfo_t info, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst floatA - int
lda - float
percentage - const musparseMatDescr_t
descrCconst floatcsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndC - pruneInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csrByPercentage_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csrByPercentage_bufferSizeExt(musparseHandle_t handle, int m, int n, const double `A, int lda, float percentage, const musparseMatDescr_t descrC, const double `csrSortedValC, const int `csrSortedRowPtrC, const int `csrSortedColIndC, pruneInfo_t info, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst doubleA - int
lda - float
percentage - const musparseMatDescr_t
descrCconst doublecsrSortedValCconst intcsrSortedRowPtrCconst intcsrSortedColIndC - pruneInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csrNnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csrNnzByPercentage(musparseHandle_t handle, int m, int n, const __half `A, int lda, float percentage, const musparseMatDescr_t descrC, int `csrRowPtrC, int `nnzTotalDevHostPtr, pruneInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst __halfA - int
lda - float
percentage - const musparseMatDescr_t
descrCintcsrRowPtrCintnnzTotalDevHostPtr - pruneInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csrNnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csrNnzByPercentage(musparseHandle_t handle, int m, int n, const float `A, int lda, float percentage, const musparseMatDescr_t descrC, int `csrRowPtrC, int `nnzTotalDevHostPtr, pruneInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst floatA - int
lda - float
percentage - const musparseMatDescr_t
descrCintcsrRowPtrCintnnzTotalDevHostPtr - pruneInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csrNnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csrNnzByPercentage(musparseHandle_t handle, int m, int n, const double `A, int lda, float percentage, const musparseMatDescr_t descrC, int `csrRowPtrC, int `nnzTotalDevHostPtr, pruneInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
nconst doubleA - int
lda - float
percentage - const musparseMatDescr_t
descrCintcsrRowPtrCintnnzTotalDevHostPtr - pruneInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcoosort_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseXcoosort_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnz, const int `cooRowsA, const int `cooColsA, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzconst intcooRowsAconst intcooColsAsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcscsort_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseXcscsort_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnz, const int `cscColPtrA, const int `cscRowIndA, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzconst intcscColPtrAconst intcscRowIndAsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsr2bsrNnz
MUSPARSE_EXPORT musparseStatus_t musparseXcsr2bsrNnz(musparseHandle_t handle, musparseDirection_t dirA, int m, int n, const musparseMatDescr_t descrA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, int blockDim, const musparseMatDescr_t descrC, int `bsrSortedRowPtrC, int `nnzTotalDevHostPtr)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
m - int
n - const musparseMatDescr_t
descrAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - int
blockDim - const musparseMatDescr_t
descrCintbsrSortedRowPtrCintnnzTotalDevHostPtr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsru2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseScsru2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnz, float `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzfloatcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsru2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDcsru2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnz, double `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzdoublecsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsru2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCcsru2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnz, muComplex `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzmuComplexcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsru2csr_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZcsru2csr_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnz, muDoubleComplex `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, size_t `pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzmuDoubleComplexcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infosize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsru2csr
MUSPARSE_EXPORT musparseStatus_t musparseScsru2csr(musparseHandle_t handle, int m, int n, int nnz, const musparseMatDescr_t descrA, float `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnz - const musparseMatDescr_t
descrAfloatcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsru2csr
MUSPARSE_EXPORT musparseStatus_t musparseDcsru2csr(musparseHandle_t handle, int m, int n, int nnz, const musparseMatDescr_t descrA, double `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnz - const musparseMatDescr_t
descrAdoublecsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsru2csr
MUSPARSE_EXPORT musparseStatus_t musparseCcsru2csr(musparseHandle_t handle, int m, int n, int nnz, const musparseMatDescr_t descrA, muComplex `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnz - const musparseMatDescr_t
descrAmuComplexcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsru2csr
MUSPARSE_EXPORT musparseStatus_t musparseZcsru2csr(musparseHandle_t handle, int m, int n, int nnz, const musparseMatDescr_t descrA, muDoubleComplex `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnz - const musparseMatDescr_t
descrAmuDoubleComplexcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2csru
MUSPARSE_EXPORT musparseStatus_t musparseScsr2csru(musparseHandle_t handle, int m, int n, int nnz, const musparseMatDescr_t descrA, float `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnz - const musparseMatDescr_t
descrAfloatcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2csru
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2csru(musparseHandle_t handle, int m, int n, int nnz, const musparseMatDescr_t descrA, double `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnz - const musparseMatDescr_t
descrAdoublecsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2csru
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2csru(musparseHandle_t handle, int m, int n, int nnz, const musparseMatDescr_t descrA, muComplex `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnz - const musparseMatDescr_t
descrAmuComplexcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2csru
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2csru(musparseHandle_t handle, int m, int n, int nnz, const musparseMatDescr_t descrA, muDoubleComplex `csrVal, const int `csrRowPtr, int `csrColInd, csru2csrInfo_t info, void `pBuffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnz - const musparseMatDescr_t
descrAmuDoubleComplexcsrValconst intcsrRowPtrintcsrColInd - csru2csrInfo_t
infovoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrsort_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseXcsrsort_bufferSizeExt(musparseHandle_t handle, int m, int n, int nnz, const int `csrRowPtrA, const int `csrColIndA, size_t *pBufferSizeInBytes)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzconst intcsrRowPtrAconst intcsrColIndAsize_tpBufferSizeInBytes
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSV_updateMatrix
MUSPARSE_EXPORT musparseStatus_t musparseSpSV_updateMatrix(musparseHandle_t handle, musparseSpSVDescr_t spsvDescr, void *newValues, musparseSpSVUpdate_t updatePart)
Parameters:
- musparseHandle_t
handle - musparseSpSVDescr_t
spsvDescrvoidnewValues - musparseSpSVUpdate_t
updatePart
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstSpVecGet
MUSPARSE_EXPORT musparseStatus_t musparseConstSpVecGet(musparseConstSpVecDescr_t spVecDescr, int64_t `size, int64_t `nnz, const void `indices, const void `values, musparseIndexType_t `idxType, musparseIndexBase_t `idxBase, musaDataType *valueType)
Parameters:
- musparseConstSpVecDescr_t
spVecDescrint64_tsizeint64_tnnzconst voidindices*const voidvalues*musparseIndexType_tidxTypemusparseIndexBase_tidxBasemusaDataTypevalueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstSpVecGetValues
MUSPARSE_EXPORT musparseStatus_t musparseConstSpVecGetValues(musparseConstSpVecDescr_t spVecDescr, const void ``values)
Parameters:
- musparseConstSpVecDescr_t
spVecDescrconst voidvalues*
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXgebsr2gebsrNnz
MUSPARSE_EXPORT musparseStatus_t musparseXgebsr2gebsrNnz(musparseHandle_t handle, musparseDirection_t dirA, int mb, int nb, int nnzb, const musparseMatDescr_t descrA, const int `bsrSortedRowPtrA, const int `bsrSortedColIndA, int rowBlockDimA, int colBlockDimA, const musparseMatDescr_t descrC, int `bsrSortedRowPtrC, int rowBlockDimC, int colBlockDimC, int `nnzTotalDevHostPtr, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
mb - int
nb - int
nnzb - const musparseMatDescr_t
descrAconst intbsrSortedRowPtrAconst intbsrSortedColIndA - int
rowBlockDimA - int
colBlockDimA - const musparseMatDescr_t
descrCintbsrSortedRowPtrC - int
rowBlockDimC - int
colBlockDimCintnnzTotalDevHostPtrvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateSlicedEll
MUSPARSE_EXPORT musparseStatus_t musparseCreateSlicedEll(musparseSpMatDescr_t `spMatDescr, int64_t rows, int64_t cols, int64_t nnz, int64_t sellValuesSize, int64_t sliceSize, void `sellSliceOffsets, void `sellColInd, void `sellValues, musparseIndexType_t sellSliceOffsetsType, musparseIndexType_t sellColIndType, musparseIndexBase_t idxBase, musaDataType valueType)
Parameters:
musparseSpMatDescr_t spMatDescr
- int64_t
rows - int64_t
cols - int64_t
nnz - int64_t
sellValuesSize - int64_t
sliceSizevoidsellSliceOffsetsvoidsellColIndvoidsellValues - musparseIndexType_t
sellSliceOffsetsType - musparseIndexType_t
sellColIndType - musparseIndexBase_t
idxBase - musaDataType
valueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstSlicedEll
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstSlicedEll(musparseConstSpMatDescr_t `spMatDescr, int64_t rows, int64_t cols, int64_t nnz, int64_t sellValuesSize, int64_t sliceSize, const void `sellSliceOffsets, const void `sellColInd, const void `sellValues, musparseIndexType_t sellSliceOffsetsType, musparseIndexType_t sellColIndType, musparseIndexBase_t idxBase, musaDataType valueType)
Parameters:
musparseConstSpMatDescr_t spMatDescr
- int64_t
rows - int64_t
cols - int64_t
nnz - int64_t
sellValuesSize - int64_t
sliceSizeconst voidsellSliceOffsetsconst voidsellColIndconst voidsellValues - musparseIndexType_t
sellSliceOffsetsType - musparseIndexType_t
sellColIndType - musparseIndexBase_t
idxBase - musaDataType
valueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateBlockedEll
MUSPARSE_EXPORT musparseStatus_t musparseCreateBlockedEll(musparseSpMatDescr_t `spMatDescr, int64_t rows, int64_t cols, int64_t ellBlockSize, int64_t ellCols, void `ellColInd, void *ellValue, musparseIndexType_t ellIdxType, musparseIndexBase_t idxBase, musaDataType valueType)
Parameters:
musparseSpMatDescr_t spMatDescr
- int64_t
rows - int64_t
cols - int64_t
ellBlockSize - int64_t
ellColsvoidellColIndvoidellValue - musparseIndexType_t
ellIdxType - musparseIndexBase_t
idxBase - musaDataType
valueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstBlockedEll
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstBlockedEll(musparseConstSpMatDescr_t `spMatDescr, int64_t rows, int64_t cols, int64_t ellBlockSize, int64_t ellCols, const void `ellColInd, const void *ellValue, musparseIndexType_t ellIdxType, musparseIndexBase_t idxBase, musaDataType valueType)
Parameters:
musparseConstSpMatDescr_t spMatDescr
- int64_t
rows - int64_t
cols - int64_t
ellBlockSize - int64_t
ellColsconst voidellColIndconst voidellValue - musparseIndexType_t
ellIdxType - musparseIndexBase_t
idxBase - musaDataType
valueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseBlockedEllGet
MUSPARSE_EXPORT musparseStatus_t musparseBlockedEllGet(musparseSpMatDescr_t spMatDescr, int64_t `rows, int64_t `cols, int64_t `ellBlockSize, int64_t `ellCols, void `ellColInd, void `ellValue, musparseIndexType_t `ellIdxType, musparseIndexBase_t `idxBase, musaDataType *valueType)
Parameters:
- musparseSpMatDescr_t
spMatDescrint64_trowsint64_tcolsint64_tellBlockSizeint64_tellColsvoidellColInd*voidellValue*musparseIndexType_tellIdxTypemusparseIndexBase_tidxBasemusaDataTypevalueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstBlockedEllGet
MUSPARSE_EXPORT musparseStatus_t musparseConstBlockedEllGet(musparseConstSpMatDescr_t spMatDescr, int64_t `rows, int64_t `cols, int64_t `ellBlockSize, int64_t `ellCols, const void `ellColInd, const void `ellValue, musparseIndexType_t `ellIdxType, musparseIndexBase_t `idxBase, musaDataType *valueType)
Parameters:
- musparseConstSpMatDescr_t
spMatDescrint64_trowsint64_tcolsint64_tellBlockSizeint64_tellColsconst voidellColInd*const voidellValue*musparseIndexType_tellIdxTypemusparseIndexBase_tidxBasemusaDataTypevalueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateBsr
MUSPARSE_EXPORT musparseStatus_t musparseCreateBsr(musparseSpMatDescr_t `spMatDescr, int64_t brows, int64_t bcols, int64_t bnnz, int64_t rowBlockSize, int64_t colBlockSize, void `bsrRowOffsets, void `bsrColInd, void `bsrValues, musparseIndexType_t bsrRowOffsetsType, musparseIndexType_t bsrColIndType, musparseIndexBase_t idxBase, musaDataType valueType, musparseOrder_t order)
Parameters:
musparseSpMatDescr_t spMatDescr
- int64_t
brows - int64_t
bcols - int64_t
bnnz - int64_t
rowBlockSize - int64_t
colBlockSizevoidbsrRowOffsetsvoidbsrColIndvoidbsrValues - musparseIndexType_t
bsrRowOffsetsType - musparseIndexType_t
bsrColIndType - musparseIndexBase_t
idxBase - musaDataType
valueType - musparseOrder_t
order
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCscGet
MUSPARSE_EXPORT musparseStatus_t musparseCscGet(musparseSpMatDescr_t spMatDescr, int64_t `rows, int64_t `cols, int64_t `nnz, void `cscColOffsets, void `cscRowInd, void ``cscValues, musparseIndexType_t `cscColOffsetsType, musparseIndexType_t `cscRowIndType, musparseIndexBase_t `idxBase, musaDataType *valueType)
Parameters:
- musparseSpMatDescr_t
spMatDescrint64_trowsint64_tcolsint64_tnnzvoidcscColOffsets*voidcscRowInd*voidcscValues*musparseIndexType_tcscColOffsetsTypemusparseIndexType_tcscRowIndTypemusparseIndexBase_tidxBasemusaDataTypevalueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseBsrSetStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseBsrSetStridedBatch(musparseSpMatDescr_t spMatDescr, int batchCount, int64_t offsetsBatchStride, int64_t columnsBatchStride, int64_t ValuesBatchStride)
Parameters:
- musparseSpMatDescr_t
spMatDescr - int
batchCount - int64_t
offsetsBatchStride - int64_t
columnsBatchStride - int64_t
ValuesBatchStride
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpVV_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpVV_bufferSize(musparseHandle_t handle, musparseOperation_t opX, musparseConstSpVecDescr_t vecX, musparseConstDnVecDescr_t vecY, const void `result, musaDataType computeType, size_t `bufferSize)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opX - musparseConstSpVecDescr_t
vecX - musparseConstDnVecDescr_t
vecYconst voidresult - musaDataType
computeTypesize_tbufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpVV
MUSPARSE_EXPORT musparseStatus_t musparseSpVV(musparseHandle_t handle, musparseOperation_t opX, musparseConstSpVecDescr_t vecX, musparseConstDnVecDescr_t vecY, void `result, musaDataType computeType, void `externalBuffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opX - musparseConstSpVecDescr_t
vecX - musparseConstDnVecDescr_t
vecYvoidresult - musaDataType
computeTypevoidexternalBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSparseToDense_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSparseToDense_bufferSize(musparseHandle_t handle, musparseConstSpMatDescr_t matA, musparseDnMatDescr_t matB, musparseSparseToDenseAlg_t alg, size_t *bufferSize)
Parameters:
- musparseHandle_t
handle - musparseConstSpMatDescr_t
matA - musparseDnMatDescr_t
matB - musparseSparseToDenseAlg_t
algsize_tbufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSparseToDense
MUSPARSE_EXPORT musparseStatus_t musparseSparseToDense(musparseHandle_t handle, musparseConstSpMatDescr_t matA, musparseDnMatDescr_t matB, musparseSparseToDenseAlg_t alg, void *externalBuffer)
Parameters:
- musparseHandle_t
handle - musparseConstSpMatDescr_t
matA - musparseDnMatDescr_t
matB - musparseSparseToDenseAlg_t
algvoidexternalBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsr2gebsrNnz
MUSPARSE_EXPORT musparseStatus_t musparseXcsr2gebsrNnz(musparseHandle_t handle, musparseDirection_t dirA, int m, int n, const musparseMatDescr_t descrA, const int `csrSortedRowPtrA, const int `csrSortedColIndA, const musparseMatDescr_t descrC, int `bsrSortedRowPtrC, int rowBlockDim, int colBlockDim, int `nnzTotalDevHostPtr, void *pBuffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dirA - int
m - int
n - const musparseMatDescr_t
descrAconst intcsrSortedRowPtrAconst intcsrSortedColIndA - const musparseMatDescr_t
descrCintbsrSortedRowPtrC - int
rowBlockDim - int
colBlockDimintnnzTotalDevHostPtrvoidpBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsr2gebsc_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCgebsr2gebsc_bufferSize(musparseHandle_t handle, int mb, int nb, int nnzb, const muComplex `bsrVal, const int `bsrRowPtr, const int `bsrColInd, int rowBlockDim, int colBlockDim, int `pBufferSize)
Parameters:
- musparseHandle_t
handle - int
mb - int
nb - int
nnzbconst muComplexbsrValconst intbsrRowPtrconst intbsrColInd - int
rowBlockDim - int
colBlockDimintpBufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv2
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv2(musparseHandle_t handle, muInt m, muInt n, const muComplex `dl, const muComplex `d, const muComplex `du, muComplex `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexdlconst muComplexdconst muComplexdumuComplexB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv2StridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv2StridedBatch(musparseHandle_t handle, muInt m, const muComplex `dl, const muComplex `d, const muComplex `du, muComplex `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mconst muComplexdlconst muComplexdconst muComplexdumuComplexx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv2StridedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv2StridedBatch_bufferSizeExt(musparseHandle_t handle, muInt m, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mconst muComplexdlconst muComplexdconst muComplexduconst muComplexx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv2_bufferSizeExt(musparseHandle_t handle, muInt m, muInt n, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexdlconst muComplexdconst muComplexduconst muComplexB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv2_nopivot
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv2_nopivot(musparseHandle_t handle, muInt m, muInt n, const muComplex `dl, const muComplex `d, const muComplex `du, muComplex `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexdlconst muComplexdconst muComplexdumuComplexB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv2_nopivot_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv2_nopivot_bufferSizeExt(musparseHandle_t handle, muInt m, muInt n, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexdlconst muComplexdconst muComplexduconst muComplexB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsvInterleavedBatch
MUSPARSE_EXPORT musparseStatus_t musparseCgtsvInterleavedBatch(musparseHandle_t handle, int alg, muInt m, muComplex `dl, muComplex `d, muComplex `du, muComplex `x, muInt batch_count, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mmuComplexdlmuComplexdmuComplexdumuComplexx - muInt
batch_countvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsvInterleavedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCgtsvInterleavedBatch_bufferSizeExt(musparseHandle_t handle, int alg, muInt m, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `x, muInt batch_count, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mconst muComplexdlconst muComplexdconst muComplexduconst muComplexx - muInt
batch_countsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsr2gebsr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCgebsr2gebsr_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const muComplex `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, muInt row_block_dim_C, muInt col_block_dim_C, int `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst muComplexbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - muInt
row_block_dim_C - muInt
col_block_dim_Cintbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgemvi_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCgemvi_bufferSize(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgpsvInterleavedBatch
MUSPARSE_EXPORT musparseStatus_t musparseCgpsvInterleavedBatch(musparseHandle_t handle, int alg, muInt m, muComplex `ds, muComplex `dl, muComplex `d, muComplex `du, muComplex `dw, muComplex `x, muInt batch_count, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mmuComplexdsmuComplexdlmuComplexdmuComplexdumuComplexdwmuComplexx - muInt
batch_countvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgpsvInterleavedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCgpsvInterleavedBatch_bufferSizeExt(musparseHandle_t handle, int alg, muInt m, const muComplex `ds, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `dw, const muComplex `x, muInt batch_count, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mconst muComplexdsconst muComplexdlconst muComplexdconst muComplexduconst muComplexdwconst muComplexx - muInt
batch_countsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsr2gebsc_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDgebsr2gebsc_bufferSize(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, int `p_buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimintp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsr2gebsr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDgebsr2gebsr_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const double `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, muInt row_block_dim_C, muInt col_block_dim_C, int `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst doublebsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - muInt
row_block_dim_C - muInt
col_block_dim_Cintbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgemvi_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDgemvi_bufferSize(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgpsvInterleavedBatch
MUSPARSE_EXPORT musparseStatus_t musparseDgpsvInterleavedBatch(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, double `ds, double `dl, double `d, double `du, double `dw, double `x, muInt batch_count, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mdoubledsdoubledldoubleddoubledudoubledwdoublex - muInt
batch_countvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgpsvInterleavedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDgpsvInterleavedBatch_bufferSizeExt(musparseHandle_t handle, int alg, muInt m, const double `ds, const double `dl, const double `d, const double `du, const double `dw, const double `x, muInt batch_count, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mconst doubledsconst doubledlconst doubledconst doubleduconst doubledwconst doublex - muInt
batch_countsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv2
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv2(musparseHandle_t handle, muInt m, muInt n, const double `dl, const double `d, const double `du, double `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubledlconst doubledconst doubledudoubleB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv2StridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv2StridedBatch(musparseHandle_t handle, muInt m, const double `dl, const double `d, const double `du, double `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mconst doubledlconst doubledconst doubledudoublex - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv2StridedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv2StridedBatch_bufferSizeExt(musparseHandle_t handle, muInt m, const double `dl, const double `d, const double `du, const double `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mconst doubledlconst doubledconst doubleduconst doublex - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv2_bufferSizeExt(musparseHandle_t handle, muInt m, muInt n, const double `dl, const double `d, const double `du, const double `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubledlconst doubledconst doubleduconst doubleB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv2_nopivot
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv2_nopivot(musparseHandle_t handle, muInt m, muInt n, const double `dl, const double `d, const double `du, double `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubledlconst doubledconst doubledudoubleB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv2_nopivot_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv2_nopivot_bufferSizeExt(musparseHandle_t handle, muInt m, muInt n, const double `dl, const double `d, const double `du, const double `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubledlconst doubledconst doubleduconst doubleB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsvInterleavedBatch
MUSPARSE_EXPORT musparseStatus_t musparseDgtsvInterleavedBatch(musparseHandle_t handle, int alg, muInt m, double `dl, double `d, double `du, double `x, muInt batch_count, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mdoubledldoubleddoubledudoublex - muInt
batch_countvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsvInterleavedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDgtsvInterleavedBatch_bufferSizeExt(musparseHandle_t handle, int alg, muInt m, const double `dl, const double `d, const double `du, const double `x, muInt batch_count, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mconst doubledlconst doubledconst doubleduconst doublex - muInt
batch_countsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsr2gebsc_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSgebsr2gebsc_bufferSize(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, int `p_buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimintp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsr2gebsr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSgebsr2gebsr_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const float `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, muInt row_block_dim_C, muInt col_block_dim_C, int `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst floatbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - muInt
row_block_dim_C - muInt
col_block_dim_Cintbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgemvi_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSgemvi_bufferSize(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, int *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzintbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgpsvInterleavedBatch
MUSPARSE_EXPORT musparseStatus_t musparseSgpsvInterleavedBatch(musparseHandle_t handle, int alg, muInt m, float `ds, float `dl, float `d, float `du, float `dw, float `x, muInt batch_count, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mfloatdsfloatdlfloatdfloatdufloatdwfloatx - muInt
batch_countvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgpsvInterleavedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSgpsvInterleavedBatch_bufferSizeExt(musparseHandle_t handle, int alg, muInt m, const float `ds, const float `dl, const float `d, const float `du, const float `dw, const float `x, muInt batch_count, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mconst floatdsconst floatdlconst floatdconst floatduconst floatdwconst floatx - muInt
batch_countsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv2
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv2(musparseHandle_t handle, muInt m, muInt n, const float `dl, const float `d, const float `du, float `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatdlconst floatdconst floatdufloatB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv2StridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv2StridedBatch(musparseHandle_t handle, muInt m, const float `dl, const float `d, const float `du, float `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mconst floatdlconst floatdconst floatdufloatx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv2StridedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv2StridedBatch_bufferSizeExt(musparseHandle_t handle, muInt m, const float `dl, const float `d, const float `du, const float `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mconst floatdlconst floatdconst floatduconst floatx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv2_bufferSizeExt(musparseHandle_t handle, muInt m, muInt n, const float `dl, const float `d, const float `du, const float `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatdlconst floatdconst floatduconst floatB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv2_nopivot
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv2_nopivot(musparseHandle_t handle, muInt m, muInt n, const float `dl, const float `d, const float `du, float `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatdlconst floatdconst floatdufloatB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv2_nopivot_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv2_nopivot_bufferSizeExt(musparseHandle_t handle, muInt m, muInt n, const float `dl, const float `d, const float `du, const float `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatdlconst floatdconst floatduconst floatB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsvInterleavedBatch
MUSPARSE_EXPORT musparseStatus_t musparseSgtsvInterleavedBatch(musparseHandle_t handle, int alg, muInt m, float `dl, float `d, float `du, float `x, muInt batch_count, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mfloatdlfloatdfloatdufloatx - muInt
batch_countvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsvInterleavedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSgtsvInterleavedBatch_bufferSizeExt(musparseHandle_t handle, int alg, muInt m, const float `dl, const float `d, const float `du, const float `x, muInt batch_count, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mconst floatdlconst floatdconst floatduconst floatx - muInt
batch_countsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsr2gebsc_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZgebsr2gebsc_bufferSize(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, int `p_buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimintp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsr2gebsr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZgebsr2gebsr_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const muDoubleComplex `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, muInt row_block_dim_C, muInt col_block_dim_C, int `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst muDoubleComplexbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - muInt
row_block_dim_C - muInt
col_block_dim_Cintbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgemvi_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZgemvi_bufferSize(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, int *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzintbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgpsvInterleavedBatch
MUSPARSE_EXPORT musparseStatus_t musparseZgpsvInterleavedBatch(musparseHandle_t handle, int alg, muInt m, muDoubleComplex `ds, muDoubleComplex `dl, muDoubleComplex `d, muDoubleComplex `du, muDoubleComplex `dw, muDoubleComplex `x, muInt batch_count, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mmuDoubleComplexdsmuDoubleComplexdlmuDoubleComplexdmuDoubleComplexdumuDoubleComplexdwmuDoubleComplexx - muInt
batch_countvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgpsvInterleavedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZgpsvInterleavedBatch_bufferSizeExt(musparseHandle_t handle, int alg, muInt m, const muDoubleComplex `ds, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `dw, const muDoubleComplex `x, muInt batch_count, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - int
alg - muInt
mconst muDoubleComplexdsconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexdwconst muDoubleComplexx - muInt
batch_countsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv2
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv2(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, muDoubleComplex `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexdumuDoubleComplexB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv2StridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv2StridedBatch(musparseHandle_t handle, muInt m, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, muDoubleComplex `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexdumuDoubleComplexx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv2StridedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv2StridedBatch_bufferSizeExt(musparseHandle_t handle, muInt m, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv2_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv2_bufferSizeExt(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv2_nopivot
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv2_nopivot(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, muDoubleComplex `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexdumuDoubleComplexB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv2_nopivot_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv2_nopivot_bufferSizeExt(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsvInterleavedBatch
MUSPARSE_EXPORT musparseStatus_t musparseZgtsvInterleavedBatch(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, muDoubleComplex `dl, muDoubleComplex `d, muDoubleComplex `du, muDoubleComplex `x, muInt batch_count, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mmuDoubleComplexdlmuDoubleComplexdmuDoubleComplexdumuDoubleComplexx - muInt
batch_countvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsvInterleavedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZgtsvInterleavedBatch_bufferSizeExt(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `x, muInt batch_count, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexx - muInt
batch_countsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstCooGet
MUSPARSE_EXPORT musparseStatus_t musparseConstCooGet(musparseSpMatDescr_t descr, int64_t `rows, int64_t `cols, int64_t `nnz, void `coo_row_ind, void `coo_col_ind, void ``coo_val, musparseIndexType_t `idx_type, musparseIndexBase_t `idx_base, musparseDataType_t `data_type)
Parameters:
- musparseSpMatDescr_t
descrint64_trowsint64_tcolsint64_tnnzvoidcoo_row_ind*voidcoo_col_ind*voidcoo_val*musparseIndexType_tidx_typemusparseIndexBase_tidx_basemusparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstCscGet
MUSPARSE_EXPORT musparseStatus_t musparseConstCscGet(musparseSpMatDescr_t spMatDescr, int64_t `rows, int64_t `cols, int64_t `nnz, void `cscColOffsets, void `cscRowInd, void ``cscValues, musparseIndexType_t `cscColOffsetsType, musparseIndexType_t `cscRowIndType, musparseIndexBase_t `idxBase, musaDataType *valueType)
Parameters:
- musparseSpMatDescr_t
spMatDescrint64_trowsint64_tcolsint64_tnnzvoidcscColOffsets*voidcscRowInd*voidcscValues*musparseIndexType_tcscColOffsetsTypemusparseIndexType_tcscRowIndTypemusparseIndexBase_tidxBasemusaDataTypevalueType
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstCsrGet
MUSPARSE_EXPORT musparseStatus_t musparseConstCsrGet(musparseSpMatDescr_t descr, int64_t `rows, int64_t `cols, int64_t `nnz, void `csr_row_ptr, void `csr_col_ind, void ``csr_val, musparseIndexType_t `row_ptr_type, musparseIndexType_t `col_ind_type, musparseIndexBase_t `idx_base, musparseDataType_t *data_type)
Parameters:
- musparseSpMatDescr_t
descrint64_trowsint64_tcolsint64_tnnzvoidcsr_row_ptr*voidcsr_col_ind*voidcsr_val*musparseIndexType_trow_ptr_typemusparseIndexType_tcol_ind_typemusparseIndexBase_tidx_basemusparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstDnMatGet
MUSPARSE_EXPORT musparseStatus_t musparseConstDnMatGet(musparseDnMatDescr_t descr, int64_t `rows, int64_t `cols, int64_t `ld, void ``values, musparseDataType_t `data_type, musparseOrder_t *order)
Parameters:
- musparseDnMatDescr_t
descrint64_trowsint64_tcolsint64_tldvoidvalues*musparseDataType_tdata_typemusparseOrder_torder
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstDnMatGetValues
MUSPARSE_EXPORT musparseStatus_t musparseConstDnMatGetValues(musparseDnMatDescr_t descr, void ``values)
Parameters:
- musparseDnMatDescr_t
descrvoidvalues*
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstDnVecGet
MUSPARSE_EXPORT musparseStatus_t musparseConstDnVecGet(musparseDnVecDescr_t descr, int64_t `size, void ``values, musparseDataType_t `data_type)
Parameters:
- musparseDnVecDescr_t
descrint64_tsizevoidvalues*musparseDataType_tdata_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstDnVecGetValues
MUSPARSE_EXPORT musparseStatus_t musparseConstDnVecGetValues(musparseDnVecDescr_t descr, void ``values)
Parameters:
- musparseDnVecDescr_t
descrvoidvalues*
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseConstSpMatGetValues
MUSPARSE_EXPORT musparseStatus_t musparseConstSpMatGetValues(musparseSpMatDescr_t descr, void ``values)
Parameters:
- musparseSpMatDescr_t
descrvoidvalues*
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstBsr
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstBsr(musparseConstSpMatDescr_t `spMatDescr, int64_t brows, int64_t bcols, int64_t bnnz, int64_t rowBlockSize, int64_t colBlockSize, const void `bsrRowOffsets, const void `bsrColInd, const void `bsrValues, musparseIndexType_t bsrRowOffsetsType, musparseIndexType_t bsrColIndType, musparseIndexBase_t idxBase, musaDataType valueType, musparseOrder_t order)
Parameters:
musparseConstSpMatDescr_t spMatDescr
- int64_t
brows - int64_t
bcols - int64_t
bnnz - int64_t
rowBlockSize - int64_t
colBlockSizeconst voidbsrRowOffsetsconst voidbsrColIndconst voidbsrValues - musparseIndexType_t
bsrRowOffsetsType - musparseIndexType_t
bsrColIndType - musparseIndexBase_t
idxBase - musaDataType
valueType - musparseOrder_t
order
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstCoo
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstCoo(musparseConstSpMatDescr_t `descr, int64_t rows, int64_t cols, int64_t nnz, const void `coo_row_ind, const void `coo_col_ind, const void `coo_val, musparseIndexType_t idx_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseConstSpMatDescr_t descr
- int64_t
rows - int64_t
cols - int64_t
nnzconst voidcoo_row_indconst voidcoo_col_indconst voidcoo_val - musparseIndexType_t
idx_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstCsc
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstCsc(musparseConstSpMatDescr_t `descr, int64_t rows, int64_t cols, int64_t nnz, const void `csc_col_ptr, const void `csc_row_ind, const void `csc_val, musparseIndexType_t col_ptr_type, musparseIndexType_t row_ind_type, musparseIndexBase_t idx_base, musparseDataType_t data_type)
Parameters:
musparseConstSpMatDescr_t descr
- int64_t
rows - int64_t
cols - int64_t
nnzconst voidcsc_col_ptrconst voidcsc_row_indconst voidcsc_val - musparseIndexType_t
col_ptr_type - musparseIndexType_t
row_ind_type - musparseIndexBase_t
idx_base - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstDnMat
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstDnMat(musparseConstDnMatDescr_t `descr, int64_t rows, int64_t cols, int64_t ld, const void `values, musparseDataType_t data_type, musparseOrder_t order)
Parameters:
musparseConstDnMatDescr_t descr
- int64_t
rows - int64_t
cols - int64_t
ldconst voidvalues - musparseDataType_t
data_type - musparseOrder_t
order
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateConstDnVec
MUSPARSE_EXPORT musparseStatus_t musparseCreateConstDnVec(musparseConstDnVecDescr_t `descr, int64_t size, const void `values, musparseDataType_t data_type)
Parameters:
musparseConstDnVecDescr_t descr
- int64_t
sizeconst voidvalues - musparseDataType_t
data_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseLoggerSetCallback
MUSPARSE_EXPORT musparseStatus_t musparseLoggerSetCallback(musparseLoggerCallback_t callback)
Parameters:
- musparseLoggerCallback_t
callback
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseLoggerSetFile
MUSPARSE_EXPORT musparseStatus_t musparseLoggerSetFile(FILE *file)
Parameters:
FILE file
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseLoggerOpenFile
MUSPARSE_EXPORT musparseStatus_t musparseLoggerOpenFile(const char *logFile)
Parameters:
const char logFile
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseLoggerSetLevel
MUSPARSE_EXPORT musparseStatus_t musparseLoggerSetLevel(int level)
Parameters:
- int
level
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseLoggerSetMask
MUSPARSE_EXPORT musparseStatus_t musparseLoggerSetMask(int mask)
Parameters:
- int
mask
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseLoggerForceDisable
MUSPARSE_EXPORT musparseStatus_t musparseLoggerForceDisable()
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateCsrgemm2Info
MUSPARSE_EXPORT musparseStatus_t musparseCreateCsrgemm2Info(musparseHandle_t handle, csrgemm2Info_t *info)
Parameters:
- musparseHandle_t
handlecsrgemm2Info_tinfo
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDestroyCsrgemm2Info
MUSPARSE_EXPORT musparseStatus_t musparseDestroyCsrgemm2Info(musparseHandle_t handle, csrgemm2Info_t info)
Parameters:
- musparseHandle_t
handle - csrgemm2Info_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
File musparse-functions.h
Location: musparse-functions.h
musparse-functions.h provides Sparse Linear Algebra Subprograms of Level 1, 2 and 3, using MUSA optimized for MT GPU hardware.
Includes
- musparse-export.h
- musparse-types.h
Enumeration type musparseCsr2CscAlg_t
Definition: musparse-functions.h (line 10647)
enum musparseCsr2CscAlg_t \{
MUSPARSE_CSR2CSC_ALG_DEFAULT = 1,
MUSPARSE_CSR2CSC_ALG1 = 1
\}
Enumerator MUSPARSE_CSR2CSC_ALG_DEFAULT
Enumerator MUSPARSE_CSR2CSC_ALG1
Function musparseScsr2csc
MUSPARSE_EXPORT musparseStatus_t musparseScsr2csc(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, float `csc_val, muInt `csc_row_ind, muInt `csc_col_ptr, musparseAction_t copy_values, musparseIndexBase_t idx_base, void *temp_buffer)
Convert a sparse CSR matrix into a sparse CSC matrix.
musparseXcsr2csc converts a CSR matrix into a CSC matrix. musparseXcsr2csc can also be used to convert a CSC matrix into a CSR matrix. copy_values decides whether csc_val is being filled during conversion (MUSPARSE_ACTION_NUMERIC) or not (MUSPARSE_ACTION_SYMBOLIC).
musparseXcsr2csc requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by musparseXcsr2csc_bufferSize().
注意:The resulting matrix can also be seen as the transpose of the input matrix.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.csc_val: array ofnnzelements of the sparse CSC matrix.csc_row_ind: array ofnnzelements containing the row indices of the sparse CSC matrix.csc_col_ptr: array ofn+1elements that point to the start of every column of the sparse CSC matrix.copy_values: MUSPARSE_ACTION_SYMBOLIC or MUSPARSE_ACTION_NUMERIC.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseXcsr2csc_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p csr_val, csr_row_ptr, csr_col_ind, csc_val, csc_row_ind, csc_col_ptr or temp_buffer pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Example:
This example computes the transpose of a CSR matrix.
// 1 2 0 3 0
// A = 0 4 5 0 0
// 6 0 0 7 8
muInt m_A = 3;
muInt n_A = 5;
muInt nnz_A = 8;
csr_row_ptr_A[m+1] = \{0, 3, 5, 8\}; // device memory
csr_col_ind_A[nnz] = \{0, 1, 3, 1, 2, 0, 3, 4\}; // device memory
csr_val_A[nnz] = \{1, 2, 3, 4, 5, 6, 7, 8\}; // device memory
// Allocate memory for transposed CSR matrix
muInt m_T = n_A;
muInt n_T = m_A;
muInt nnz_T = nnz_A;
muInt* csr_row_ptr_T;
muInt* csr_col_ind_T;
float* csr_val_T;
musaMalloc((void``)&csr_row_ptr_T, sizeof(muInt) * (m_T + 1));
musaMalloc((void``)&csr_col_ind_T, sizeof(muInt) * nnz_T);
musaMalloc((void``)&csr_val_T, sizeof(float) * nnz_T);
// Obtain the temporary buffer size
size_t buffer_size;
musparseXcsr2csc_bufferSize(handle,
m_A,
n_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
MUSPARSE_ACTION_NUMERIC,
&buffer_size);
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
musparseScsr2csc(handle,
m_A,
n_A,
nnz_A,
csr_val_A,
csr_row_ptr_A,
csr_col_ind_A,
csr_val_T,
csr_col_ind_T,
csr_row_ptr_T,
MUSPARSE_ACTION_NUMERIC,
MUSPARSE_INDEX_BASE_ZERO,
temp_buffer);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indfloatcsc_valmuIntcsc_row_indmuIntcsc_col_ptr - musparseAction_t
copy_values - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2csc
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2csc(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, double `csc_val, muInt `csc_row_ind, muInt `csc_col_ptr, musparseAction_t copy_values, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_inddoublecsc_valmuIntcsc_row_indmuIntcsc_col_ptr - musparseAction_t
copy_values - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2csc
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2csc(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muComplex `csc_val, muInt `csc_row_ind, muInt `csc_col_ptr, musparseAction_t copy_values, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indmuComplexcsc_valmuIntcsc_row_indmuIntcsc_col_ptr - musparseAction_t
copy_values - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2csc
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2csc(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muDoubleComplex `csc_val, muInt `csc_row_ind, muInt `csc_col_ptr, musparseAction_t copy_values, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indmuDoubleComplexcsc_valmuIntcsc_row_indmuIntcsc_col_ptr - musparseAction_t
copy_values - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCsr2cscEx2
MUSPARSE_EXPORT musparseStatus_t musparseCsr2cscEx2(musparseHandle_t handle, int m, int n, int nnz, const void `csrVal, const int `csrRowPtr, const int `csrColInd, void `cscVal, int `cscColPtr, int `cscRowInd, musaDataType valType, musparseAction_t copyValues, musparseIndexBase_t idxBase, musparseCsr2CscAlg_t alg, void *buffer)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzconst voidcsrValconst intcsrRowPtrconst intcsrColIndvoidcscValintcscColPtrintcscRowInd - musaDataType
valType - musparseAction_t
copyValues - musparseIndexBase_t
idxBase - musparseCsr2CscAlg_t
algvoidbuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCsr2cscEx2_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCsr2cscEx2_bufferSize(musparseHandle_t handle, int m, int n, int nnz, const void `csrVal, const int `csrRowPtr, const int `csrColInd, void `cscVal, int `cscColPtr, int `cscRowInd, musaDataType valType, musparseAction_t copyValues, musparseIndexBase_t idxBase, musparseCsr2CscAlg_t alg, size_t *bufferSize)
Parameters:
- musparseHandle_t
handle - int
m - int
n - int
nnzconst voidcsrValconst intcsrRowPtrconst intcsrColIndvoidcscValintcscColPtrintcscRowInd - musaDataType
valType - musparseAction_t
copyValues - musparseIndexBase_t
idxBase - musparseCsr2CscAlg_t
algsize_tbufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSaxpyi
MUSPARSE_EXPORT musparseStatus_t musparseSaxpyi(musparseHandle_t handle, muInt nnz, const float `alpha, const float `x_val, const muInt `x_ind, float `y, musparseIndexBase_t idx_base)
Scale a sparse vector and add it to a dense vector.
musparseXaxpyi multiplies the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} with scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}, such that
formula \{"type":"element","name":"formula","attributes":\{"id":"3"\},"children":[\{"type":"text","text":"\\[\n y := y + \\alpha \\cdot x\n \\]"\}]\}
for(i = 0; i < nnz; ++i)
\{
y[x_ind[i]] = y[x_ind[i]] + alpha * x_val[i];
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.nnz: number of non-zero entries of vectorformula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.x_val: array ofnnzelements containing the values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_ind: array ofnnzelements containing the indices of the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.y: array of values in dense format.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_VALUE:idx_baseis invalid.MUSPARSE_STATUS_INVALID_SIZE:nnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:alpha,x_val,x_indorypointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
nnzconst floatalphaconst floatx_valconst muIntx_indfloaty - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDaxpyi
MUSPARSE_EXPORT musparseStatus_t musparseDaxpyi(musparseHandle_t handle, muInt nnz, const double `alpha, const double `x_val, const muInt `x_ind, double `y, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst doublealphaconst doublex_valconst muIntx_inddoubley - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCaxpyi
MUSPARSE_EXPORT musparseStatus_t musparseCaxpyi(musparseHandle_t handle, muInt nnz, const muComplex `alpha, const muComplex `x_val, const muInt `x_ind, muComplex `y, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muComplexalphaconst muComplexx_valconst muIntx_indmuComplexy - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZaxpyi
MUSPARSE_EXPORT musparseStatus_t musparseZaxpyi(musparseHandle_t handle, muInt nnz, const muDoubleComplex `alpha, const muDoubleComplex `x_val, const muInt `x_ind, muDoubleComplex `y, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muDoubleComplexalphaconst muDoubleComplexx_valconst muIntx_indmuDoubleComplexy - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSdoti
MUSPARSE_EXPORT musparseStatus_t musparseSdoti(musparseHandle_t handle, muInt nnz, const float `x_val, const muInt `x_ind, const float `y, float `result, musparseIndexBase_t idx_base)
Compute the dot product of a sparse vector with a dense vector.
musparseXdoti computes the dot product of the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} with the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"4"\},"children":[\{"type":"text","text":"\\[ \\text\{result\} := y^T x \\]"\}]\}
for(i = 0; i < nnz; ++i)
\{
result += x_val[i] * y[x_ind[i]];
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.nnz: number of non-zero entries of vectorformula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_val: array ofnnzvalues.x_ind: array ofnnzelements containing the indices of the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.y: array of values in dense format.result: pointer to the result, can be host or device memoryidx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_VALUE:idx_baseis invalid.MUSPARSE_STATUS_INVALID_SIZE:nnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:x_val,x_ind,yorresultpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer for the dot product reduction could not be allocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
nnzconst floatx_valconst muIntx_indconst floatyfloatresult - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDdoti
MUSPARSE_EXPORT musparseStatus_t musparseDdoti(musparseHandle_t handle, muInt nnz, const double `x_val, const muInt `x_ind, const double `y, double `result, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst doublex_valconst muIntx_indconst doubleydoubleresult - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCdoti
MUSPARSE_EXPORT musparseStatus_t musparseCdoti(musparseHandle_t handle, muInt nnz, const muComplex `x_val, const muInt `x_ind, const muComplex `y, muComplex `result, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muComplexx_valconst muIntx_indconst muComplexymuComplexresult - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZdoti
MUSPARSE_EXPORT musparseStatus_t musparseZdoti(musparseHandle_t handle, muInt nnz, const muDoubleComplex `x_val, const muInt `x_ind, const muDoubleComplex `y, muDoubleComplex `result, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muDoubleComplexx_valconst muIntx_indconst muDoubleComplexymuDoubleComplexresult - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCdotci
MUSPARSE_EXPORT musparseStatus_t musparseCdotci(musparseHandle_t handle, muInt nnz, const muComplex `x_val, const muInt `x_ind, const muComplex `y, muComplex `result, musparseIndexBase_t idx_base)
Compute the dot product of a complex conjugate sparse vector with a dense vector.
musparseXdotci computes the dot product of the complex conjugate sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} with the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"5"\},"children":[\{"type":"text","text":"\\[ \\text\{result\} :=\n\\bar\{x\}^H y \\]"\}]\}
for(i = 0; i < nnz; ++i)
\{
result += conj(x_val[i]) * y[x_ind[i]];
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.nnz: number of non-zero entries of vectorformula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_val: array ofnnzvalues.x_ind: array ofnnzelements containing the indices of the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.y: array of values in dense format.result: pointer to the result, can be host or device memoryidx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_VALUE:idx_baseis invalid.MUSPARSE_STATUS_INVALID_SIZE:nnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:x_val,x_ind,yorresultpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer for the dot product reduction could not be allocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muComplexx_valconst muIntx_indconst muComplexymuComplexresult - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZdotci
MUSPARSE_EXPORT musparseStatus_t musparseZdotci(musparseHandle_t handle, muInt nnz, const muDoubleComplex `x_val, const muInt `x_ind, const muDoubleComplex `y, muDoubleComplex `result, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muDoubleComplexx_valconst muIntx_indconst muDoubleComplexymuDoubleComplexresult - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgthr
MUSPARSE_EXPORT musparseStatus_t musparseSgthr(musparseHandle_t handle, muInt nnz, const float `y, float `x_val, const muInt *x_ind, musparseIndexBase_t idx_base)
Gather elements from a dense vector and store them into a sparse vector.
musparseXgthr gathers the elements that are listed in x_ind from the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} and stores them in the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.
for(i = 0; i < nnz; ++i)
\{
x_val[i] = y[x_ind[i]];
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.nnz: number of non-zero entries offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.y: array of values in dense format.x_val: array ofnnzelements containing the values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_ind: array ofnnzelements containing the indices of the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_VALUE:idx_baseis invalid.MUSPARSE_STATUS_INVALID_SIZE:nnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:y,x_valorx_indpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
nnzconst floatyfloatx_valconst muIntx_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgthr
MUSPARSE_EXPORT musparseStatus_t musparseDgthr(musparseHandle_t handle, muInt nnz, const double `y, double `x_val, const muInt *x_ind, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst doubleydoublex_valconst muIntx_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgthr
MUSPARSE_EXPORT musparseStatus_t musparseCgthr(musparseHandle_t handle, muInt nnz, const muComplex `y, muComplex `x_val, const muInt *x_ind, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muComplexymuComplexx_valconst muIntx_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgthr
MUSPARSE_EXPORT musparseStatus_t musparseZgthr(musparseHandle_t handle, muInt nnz, const muDoubleComplex `y, muDoubleComplex `x_val, const muInt *x_ind, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muDoubleComplexymuDoubleComplexx_valconst muIntx_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgthrz
MUSPARSE_EXPORT musparseStatus_t musparseSgthrz(musparseHandle_t handle, muInt nnz, float `y, float `x_val, const muInt *x_ind, musparseIndexBase_t idx_base)
Gather and zero out elements from a dense vector and store them into a sparse vector.
musparseXgthrz gathers the elements that are listed in x_ind from the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} and stores them in the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}. The gathered elements in formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} are replaced by zero.
for(i = 0; i < nnz; ++i)
\{
x_val[i] = y[x_ind[i]];
y[x_ind[i]] = 0;
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.nnz: number of non-zero entries offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.y: array of values in dense format.x_val: array ofnnzelements containing the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_ind: array ofnnzelements containing the indices of the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_VALUE:idx_baseis invalid.MUSPARSE_STATUS_INVALID_SIZE:nnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:y,x_valorx_indpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
nnzfloatyfloatx_valconst muIntx_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgthrz
MUSPARSE_EXPORT musparseStatus_t musparseDgthrz(musparseHandle_t handle, muInt nnz, double `y, double `x_val, const muInt *x_ind, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzdoubleydoublex_valconst muIntx_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgthrz
MUSPARSE_EXPORT musparseStatus_t musparseCgthrz(musparseHandle_t handle, muInt nnz, muComplex `y, muComplex `x_val, const muInt *x_ind, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzmuComplexymuComplexx_valconst muIntx_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgthrz
MUSPARSE_EXPORT musparseStatus_t musparseZgthrz(musparseHandle_t handle, muInt nnz, muDoubleComplex `y, muDoubleComplex `x_val, const muInt *x_ind, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzmuDoubleComplexymuDoubleComplexx_valconst muIntx_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSroti
MUSPARSE_EXPORT musparseStatus_t musparseSroti(musparseHandle_t handle, muInt nnz, float `x_val, const muInt `x_ind, float `y, const float `c, const float *s, musparseIndexBase_t idx_base)
Apply Givens rotation to a dense and a sparse vector.
musparseXroti applies the Givens rotation matrix formula \{"type":"element","name":"formula","attributes":\{"id":"6"\},"children":[\{"type":"text","text":"$G$"\}]\} to the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}, where formula \{"type":"element","name":"formula","attributes":\{"id":"7"\},"children":[\{"type":"text","text":"\\[ G = \\begin\{pmatrix\} c\n& s \\\\ -s & c \\end\{pmatrix\} \\]"\}]\}
for(i = 0; i < nnz; ++i)
\{
x_tmp = x_val[i];
y_tmp = y[x_ind[i]];
x_val[i] = c ` x_tmp + s ` y_tmp;
y[x_ind[i]] = c ` y_tmp - s ` x_tmp;
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.nnz: number of non-zero entries offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_val: array ofnnzelements containing the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_ind: array ofnnzelements containing the indices of the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.y: array of values in dense format.c: pointer to the cosine element offormula \{"type":"element","name":"formula","attributes":\{"id":"6"\},"children":[\{"type":"text","text":"$G$"\}]\}, can be on host or device.s: pointer to the sine element offormula \{"type":"element","name":"formula","attributes":\{"id":"6"\},"children":[\{"type":"text","text":"$G$"\}]\}, can be on host or device.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_VALUE:idx_baseis invalid.MUSPARSE_STATUS_INVALID_SIZE:nnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:c,s,x_val,x_indorypointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
nnzfloatx_valconst muIntx_indfloatyconst floatcconst floats - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDroti
MUSPARSE_EXPORT musparseStatus_t musparseDroti(musparseHandle_t handle, muInt nnz, double `x_val, const muInt `x_ind, double `y, const double `c, const double *s, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzdoublex_valconst muIntx_inddoubleyconst doublecconst doubles - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSsctr
MUSPARSE_EXPORT musparseStatus_t musparseSsctr(musparseHandle_t handle, muInt nnz, const float `x_val, const muInt `x_ind, float *y, musparseIndexBase_t idx_base)
Scatter elements from a dense vector across a sparse vector.
musparseXsctr scatters the elements that are listed in x_ind from the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} into the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}. Indices of formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that are not listed in x_ind remain unchanged.
for(i = 0; i < nnz; ++i)
\{
y[x_ind[i]] = x_val[i];
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.nnz: number of non-zero entries offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_val: array ofnnzelements containing the non-zero values offormula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.x_ind: array ofnnzelements containing the indices of the non-zero values of x.y: array of values in dense format.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_VALUE:idx_baseis invalid.MUSPARSE_STATUS_INVALID_SIZE:nnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:x_val,x_indorypointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
nnzconst floatx_valconst muIntx_indfloaty - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDsctr
MUSPARSE_EXPORT musparseStatus_t musparseDsctr(musparseHandle_t handle, muInt nnz, const double `x_val, const muInt `x_ind, double *y, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst doublex_valconst muIntx_inddoubley - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCsctr
MUSPARSE_EXPORT musparseStatus_t musparseCsctr(musparseHandle_t handle, muInt nnz, const muComplex `x_val, const muInt `x_ind, muComplex *y, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muComplexx_valconst muIntx_indmuComplexy - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZsctr
MUSPARSE_EXPORT musparseStatus_t musparseZsctr(musparseHandle_t handle, muInt nnz, const muDoubleComplex `x_val, const muInt `x_ind, muDoubleComplex *y, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muDoubleComplexx_valconst muIntx_indmuDoubleComplexy - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseIsctr
MUSPARSE_EXPORT musparseStatus_t musparseIsctr(musparseHandle_t handle, muInt nnz, const muInt `x_val, const muInt `x_ind, muInt *y, musparseIndexBase_t idx_base)
Parameters:
- musparseHandle_t
handle - muInt
nnzconst muIntx_valconst muIntx_indmuInty - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrmv
MUSPARSE_EXPORT musparseStatus_t musparseSbsrmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nb, muInt nnzb, const float `alpha, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const float `x, const float `beta, float *y)
Sparse matrix vector multiplication using BSR storage format.
musparseXbsrmv multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"8"\},"children":[\{"type":"text","text":"$(mb \\cdot \\text\{block_dim\}) \\times (nb \\cdot \\text\{block_dim\})$"\}]\} matrix, defined in BSR storage format, and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"10"\},"children":[\{"type":"text","text":"\\[ y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"11"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of BSR blocks.trans: matrix operation type.mb: number of block rows of the sparse BSR matrix.nb: number of block columns of the sparse BSR matrix.nnzb: number of non-zero blocks of the sparse BSR matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse BSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzbblocks of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: block dimension of the sparse BSR matrix.x: array ofnb*block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"12"\},"children":[\{"type":"text","text":"$op(A) = A$"\}]\}) ormb*block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"13"\},"children":[\{"type":"text","text":"$op(A) = A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"14"\},"children":[\{"type":"text","text":"$op(A) = A^H$"\}]\}).beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: array ofmb*block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"12"\},"children":[\{"type":"text","text":"$op(A) = A$"\}]\}) ornb*block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"13"\},"children":[\{"type":"text","text":"$op(A) = A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"14"\},"children":[\{"type":"text","text":"$op(A) = A^H$"\}]\}).
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nb,nnzborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,bsr_val,bsr_row_ind,bsr_col_ind,x,betaorypointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nb - muInt
nnzbconst floatalpha - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dimconst floatxconst floatbetafloaty
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrmv
MUSPARSE_EXPORT musparseStatus_t musparseDbsrmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nb, muInt nnzb, const double `alpha, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const double `x, const double `beta, double *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nb - muInt
nnzbconst doublealpha - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dimconst doublexconst doublebetadoubley
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrmv
MUSPARSE_EXPORT musparseStatus_t musparseCbsrmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nb, muInt nnzb, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const muComplex `x, const muComplex `beta, muComplex *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nb - muInt
nnzbconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dimconst muComplexxconst muComplexbetamuComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrmv
MUSPARSE_EXPORT musparseStatus_t musparseZbsrmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nb, muInt nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const muDoubleComplex `x, const muDoubleComplex `beta, muDoubleComplex *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nb - muInt
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dimconst muDoubleComplexxconst muDoubleComplexbetamuDoubleComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrxmv
MUSPARSE_EXPORT musparseStatus_t musparseSbsrxmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt size_of_mask, muInt mb, muInt nb, muInt nnzb, const float `alpha, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_mask_ptr, const muInt `bsr_row_ptr, const muInt `bsr_end_ptr, const muInt `bsr_col_ind, muInt block_dim, const float `x, const float `beta, float *y)
Sparse matrix vector multiplication with mask operation using BSR storage format.
musparseXbsrxmv multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"8"\},"children":[\{"type":"text","text":"$(mb \\cdot \\text\{block_dim\}) \\times (nb \\cdot \\text\{block_dim\})$"\}]\} modified matrix, defined in BSR storage format, and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"15"\},"children":[\{"type":"text","text":"\\[ y := \\left( \\alpha \\cdot op(A) \\cdot x +\n\\beta \\cdot y \\right)\\left( \\text\{mask\} \\right), \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"16"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
The formula \{"type":"element","name":"formula","attributes":\{"id":"17"\},"children":[\{"type":"text","text":"$\\text\{mask\}$"\}]\} is defined as an array of block row indices. The input sparse matrix is defined with a modified BSR storage format where the beginning and the end of each row is defined with two arrays, bsr_row_ptr and bsr_end_ptr (both of size mb), rather the usual bsr_row_ptr of size mb + 1.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans== MUSPARSE_OPERATION_NON_TRANSPOSE is supported. Currently,block_dim== 1 is not supported.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of BSR blocks.trans: matrix operation type.size_of_mask: number of updated block rows of the arrayy.mb: number of block rows of the sparse BSR matrix.nb: number of block columns of the sparse BSR matrix.nnzb: number of non-zero blocks of the sparse BSR matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse BSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzbblocks of the sparse BSR matrix.bsr_mask_ptr: array ofsize_of_maskelements that give the indices of the updated block rows.bsr_row_ptr: array ofmbelements that point to the start of every block row of the sparse BSR matrix.bsr_end_ptr: array ofmbelements that point to the end of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: block dimension of the sparse BSR matrix.x: array ofnb*block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"12"\},"children":[\{"type":"text","text":"$op(A) = A$"\}]\}) ormb*block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"13"\},"children":[\{"type":"text","text":"$op(A) = A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"14"\},"children":[\{"type":"text","text":"$op(A) = A^H$"\}]\}).beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: array ofmb*block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"12"\},"children":[\{"type":"text","text":"$op(A) = A$"\}]\}) ornb*block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"13"\},"children":[\{"type":"text","text":"$op(A) = A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"14"\},"children":[\{"type":"text","text":"$op(A) = A^H$"\}]\}).
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nb,nnzb,block_dimorsize_of_maskis invalid.MUSPARSE_STATUS_INVALID_VALUE:size_of_maskis greater thanmb.`MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,bsr_val,bsr_row_ind,bsr_col_ind,x,betaorypointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDblock_dim== 1,trans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
size_of_mask - muInt
mb - muInt
nb - muInt
nnzbconst floatalpha - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_mask_ptrconst muIntbsr_row_ptrconst muIntbsr_end_ptrconst muIntbsr_col_ind - muInt
block_dimconst floatxconst floatbetafloaty
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrxmv
MUSPARSE_EXPORT musparseStatus_t musparseDbsrxmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt size_of_mask, muInt mb, muInt nb, muInt nnzb, const double `alpha, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_mask_ptr, const muInt `bsr_row_ptr, const muInt `bsr_end_ptr, const muInt `bsr_col_ind, muInt block_dim, const double `x, const double `beta, double *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
size_of_mask - muInt
mb - muInt
nb - muInt
nnzbconst doublealpha - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_mask_ptrconst muIntbsr_row_ptrconst muIntbsr_end_ptrconst muIntbsr_col_ind - muInt
block_dimconst doublexconst doublebetadoubley
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrxmv
MUSPARSE_EXPORT musparseStatus_t musparseCbsrxmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt size_of_mask, muInt mb, muInt nb, muInt nnzb, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_mask_ptr, const muInt `bsr_row_ptr, const muInt `bsr_end_ptr, const muInt `bsr_col_ind, muInt block_dim, const muComplex `x, const muComplex `beta, muComplex *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
size_of_mask - muInt
mb - muInt
nb - muInt
nnzbconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_mask_ptrconst muIntbsr_row_ptrconst muIntbsr_end_ptrconst muIntbsr_col_ind - muInt
block_dimconst muComplexxconst muComplexbetamuComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrxmv
MUSPARSE_EXPORT musparseStatus_t musparseZbsrxmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt size_of_mask, muInt mb, muInt nb, muInt nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_mask_ptr, const muInt `bsr_row_ptr, const muInt `bsr_end_ptr, const muInt `bsr_col_ind, muInt block_dim, const muDoubleComplex `x, const muDoubleComplex `beta, muDoubleComplex *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
size_of_mask - muInt
mb - muInt
nb - muInt
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_mask_ptrconst muIntbsr_row_ptrconst muIntbsr_end_ptrconst muIntbsr_col_ind - muInt
block_dimconst muDoubleComplexxconst muDoubleComplexbetamuDoubleComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsv_bufferSize(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Sparse triangular solve using BSR storage format.
musparseXbsrsv_bufferSize returns the size of the temporary storage buffer that is required by musparseSbsrsv_analysis(), musparseDbsrsv_analysis(), musparseCbsrsv_analysis(), musparseZbsrsv_analysis(), musparseSbsrsv_solve(), musparseDbsrsv_solve(), musparseCbsrsv_solve() and musparseZbsrsv_solve(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of BSR blocks.trans: matrix operation type.mb: number of block rows of the sparse BSR matrix.nnzb: number of non-zero blocks of the sparse BSR matrix.descr: descriptor of the sparse BSR matrix.bsr_val: array ofnnzbblocks of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzcontaining the block column indices of the sparse BSR matrix.block_dim: block dimension of the sparse BSR matrix.info: structure that holds the information collected during the analysis step.buffer_size: number of bytes of the temporary storage buffer required by musparseSbsrsv_analysis(), musparseDbsrsv_analysis(), musparseCbsrsv_analysis(), musparseZbsrsv_analysis(), musparseSbsrsv_solve(), musparseDbsrsv_solve(), musparseCbsrsv_solve() and musparseZbsrsv_solve().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptr,bsr_col_ind,infoorbuffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsv_bufferSize(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsv_bufferSize(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsv_bufferSize(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsv_analysis(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Sparse triangular solve using BSR storage format.
musparseXbsrsv_analysis performs the analysis step for musparseSbsrsv_solve(), musparseDbsrsv_solve(), musparseCbsrsv_solve() and musparseZbsrsv_solve(). It is expected that this function will be executed only once for a given matrix and particular operation type. The analysis meta data can be cleared by musparseXbsrsv_clear().
musparseXbsrsv_analysis can share its meta data with musparseSbsrsm_analysis(), musparseDbsrsm_analysis(), musparseCbsrsm_analysis(), musparseZbsrsm_analysis(), musparseSbsrilu0_analysis(), musparseDbsrilu0_analysis(), musparseCbsrilu0_analysis(), musparseZbsrilu0_analysis(), musparseSbsric0_analysis(), musparseDbsric0_analysis(), musparseCbsric0_analysis() and musparseZbsric0_analysis(). Selecting MUSPARSE_ANALYSIS_POLICY_REUSE policy can greatly improve computation performance of meta data. However, the user need to make sure that the sparsity pattern remains unchanged. If this cannot be assured, MUSPARSE_ANALYSIS_POLICY_FORCE has to be used.
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of BSR blocks.trans: matrix operation type.mb: number of block rows of the sparse BSR matrix.nnzb: number of non-zero blocks of the sparse BSR matrix.descr: descriptor of the sparse BSR matrix.bsr_val: array ofnnzbblocks of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzcontaining the block column indices of the sparse BSR matrix.block_dim: block dimension of the sparse BSR matrix.info: structure that holds the information collected during the analysis step.analysis: MUSPARSE_ANALYSIS_POLICY_REUSE or MUSPARSE_ANALYSIS_POLICY_FORCE.solve: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_row_ptr,bsr_col_ind,infoortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsv_analysis(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsv_analysis(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsv_analysis(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsv_solve
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsv_solve(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const float `alpha, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, const float `x, float `y, musparseSolvePolicy_t policy, void *temp_buffer)
Sparse triangular solve using BSR storage format.
musparseXbsrsv_solve solves a sparse triangular linear system of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix, defined in BSR storage format, a dense solution vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} and the right-hand side formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"21"\},"children":[\{"type":"text","text":"\\[ op(A) \\cdot y = \\alpha \\cdot x, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"11"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
musparseXbsrsv_solve requires a user allocated temporary buffer. Its size is returned by musparseSbsrsv_bufferSize(), musparseDbsrsv_bufferSize(), musparseCbsrsv_bufferSize() or musparseZbsrsv_bufferSize(). Furthermore, analysis meta data is required. It can be obtained by musparseSbsrsv_analysis(), musparseDbsrsv_analysis(), musparseCbsrsv_analysis() or musparseZbsrsv_analysis(). musparseXbsrsv_solve reports the first zero pivot (either numerical or structural zero). The zero pivot status can be checked calling musparseXbsrsv_zeroPivot(). If musparseDiagType_t == MUSPARSE_DIAG_TYPE_UNIT, no zero pivot will be reported, even if formula \{"type":"element","name":"formula","attributes":\{"id":"22"\},"children":[\{"type":"text","text":"$A_\{j,j\} = 0$"\}]\} for some formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}.
注意:The sparse BSR matrix has to be sorted.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans== MUSPARSE_OPERATION_NON_TRANSPOSE andtrans== MUSPARSE_OPERATION_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of BSR blocks.trans: matrix operation type.mb: number of block rows of the sparse BSR matrix.nnzb: number of non-zero blocks of the sparse BSR matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse BSR matrix.bsr_val: array ofnnzbblocks of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzcontaining the block column indices of the sparse BSR matrix.block_dim: block dimension of the sparse BSR matrix.info: structure that holds the information collected during the analysis step.x: array ofmelements, holding the right-hand side.y: array ofmelements, holding the solution.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,bsr_val,bsr_row_ptr,bsr_col_ind,xorypointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
Consider the lower triangular formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"23"\},"children":[\{"type":"text","text":"$L$"\}]\}, stored in BSR storage format with unit diagonal. The following example solves formula \{"type":"element","name":"formula","attributes":\{"id":"24"\},"children":[\{"type":"text","text":"$L \\cdot y\n= x$"\}]\}.
// Create musparse handle
musparseHandle_t handle;
musparseCreate(&handle);
// Create matrix descriptor
musparseMatDescr_t descr;
musparseCreateMatDescr(&descr);
musparseSetMatFillMode(descr, MUSPARSE_FILL_MODE_LOWER);
musparseSetMatDiagType(descr, MUSPARSE_DIAG_TYPE_UNIT);
// Create matrix info structure
musparseMatInfo_t info;
musparseCreateMatInfo(&info);
// Obtain required buffer size
size_t buffer_size;
musparseDbsrsv_bufferSize(handle,
MUSPARSE_DIRECTION_COLUMN,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
&buffer_size);
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
// Perform analysis step
musparseDbsrsv_analysis(handle,
MUSPARSE_DIRECTION_COLUMN,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Solve Ly = x
musparseDbsrsv_solve(handle,
MUSPARSE_DIRECTION_COLUMN,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
&alpha,
descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
x,
y,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// No zero pivot should be found, with L having unit diagonal
// Clean up
musaFree(temp_buffer);
musparseDestroyMatInfo(info);
musparseDestroyMatDescr(descr);
musparseDestroy(handle);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzbconst floatalpha - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infoconst floatxfloaty - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsv_solve
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsv_solve(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const double `alpha, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, const double `x, double `y, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzbconst doublealpha - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infoconst doublexdoubley - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsv_solve
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsv_solve(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, const muComplex `x, muComplex `y, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzbconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infoconst muComplexxmuComplexy - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsv_solve
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsv_solve(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, const muDoubleComplex `x, muDoubleComplex `y, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infoconst muDoubleComplexxmuDoubleComplexy - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScoomv
MUSPARSE_EXPORT musparseStatus_t musparseScoomv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const float `alpha, const musparseMatDescr_t descr, const float `coo_val, const muInt `coo_row_ind, const muInt `coo_col_ind, const float `x, const float `beta, float *y)
Sparse matrix vector multiplication using COO storage format.
musparseXcoomv multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"25"\},"children":[\{"type":"text","text":"$m\n\\times n$"\}]\} matrix, defined in COO storage format, and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"26"\},"children":[\{"type":"text","text":"\\[ y := \\alpha \\cdot op(A) \\cdot x + \\beta\n\\cdot y, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"27"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
The COO matrix has to be sorted by row indices. This can be achieved by using musparseXcoosortByRow().
for(i = 0; i < m; ++i)
\{
y[i] = beta * y[i];
\}
for(i = 0; i < nnz; ++i)
\{
y[coo_row_ind[i]] += alpha ` coo_val[i] ` x[coo_col_ind[i]];
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the sparse COO matrix.n: number of columns of the sparse COO matrix.nnz: number of non-zero entries of the sparse COO matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse COO matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.coo_val: array ofnnzelements of the sparse COO matrix.coo_row_ind: array ofnnzelements containing the row indices of the sparse COO matrix.coo_col_ind: array ofnnzelements containing the column indices of the sparse COO matrix.x: array ofnelements (formula \{"type":"element","name":"formula","attributes":\{"id":"12"\},"children":[\{"type":"text","text":"$op(A) = A$"\}]\}) ormelements (formula \{"type":"element","name":"formula","attributes":\{"id":"13"\},"children":[\{"type":"text","text":"$op(A) = A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"14"\},"children":[\{"type":"text","text":"$op(A) = A^H$"\}]\}).beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: array ofmelements (formula \{"type":"element","name":"formula","attributes":\{"id":"12"\},"children":[\{"type":"text","text":"$op(A) = A$"\}]\}) ornelements (formula \{"type":"element","name":"formula","attributes":\{"id":"13"\},"children":[\{"type":"text","text":"$op(A) = A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"14"\},"children":[\{"type":"text","text":"$op(A) = A^H$"\}]\}).
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, alpha, coo_val, coo_row_ind, coo_col_ind, x, beta or y pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzconst floatalpha - const musparseMatDescr_t
descrconst floatcoo_valconst muIntcoo_row_indconst muIntcoo_col_indconst floatxconst floatbetafloaty
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcoomv
MUSPARSE_EXPORT musparseStatus_t musparseDcoomv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const double `alpha, const musparseMatDescr_t descr, const double `coo_val, const muInt `coo_row_ind, const muInt `coo_col_ind, const double `x, const double `beta, double *y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzconst doublealpha - const musparseMatDescr_t
descrconst doublecoo_valconst muIntcoo_row_indconst muIntcoo_col_indconst doublexconst doublebetadoubley
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcoomv
MUSPARSE_EXPORT musparseStatus_t musparseCcoomv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `coo_val, const muInt `coo_row_ind, const muInt `coo_col_ind, const muComplex `x, const muComplex `beta, muComplex *y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexcoo_valconst muIntcoo_row_indconst muIntcoo_col_indconst muComplexxconst muComplexbetamuComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcoomv
MUSPARSE_EXPORT musparseStatus_t musparseZcoomv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `coo_val, const muInt `coo_row_ind, const muInt `coo_col_ind, const muDoubleComplex `x, const muDoubleComplex `beta, muDoubleComplex *y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexcoo_valconst muIntcoo_row_indconst muIntcoo_col_indconst muDoubleComplexxconst muDoubleComplexbetamuDoubleComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrmv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseScsrmv_analysis(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt *csr_col_ind, musparseMatInfo_t info)
Sparse matrix vector multiplication using CSR storage format.
musparseXcsrmv_analysis performs the analysis step for musparseScsrmv(), musparseDcsrmv(), musparseCcsrmv() and musparseZcsrmv(). It is expected that this function will be executed only once for a given matrix and particular operation type. The gathered analysis meta data can be cleared by musparseXcsrmv_clear().
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_val, csr_row_ptr, csr_col_ind or info pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer for the gathered information could not be allocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED if musparseMatrixType_t is not one of MUSPARSE_MATRIX_TYPE_GENERAL, MUSPARSE_MATRIX_TYPE_SYMMETRIC, or MUSPARSE_MATRIX_TYPE_TRIANGULAR.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrmv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDcsrmv_analysis(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt *csr_col_ind, musparseMatInfo_t info)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrmv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCcsrmv_analysis(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt *csr_col_ind, musparseMatInfo_t info)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrmv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZcsrmv_analysis(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt *csr_col_ind, musparseMatInfo_t info)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrmv
MUSPARSE_EXPORT musparseStatus_t musparseScsrmv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const float `alpha, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, const float `x, const float `beta, float *y)
Sparse matrix vector multiplication using CSR storage format.
musparseXcsrmv multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"25"\},"children":[\{"type":"text","text":"$m\n\\times n$"\}]\} matrix, defined in CSR storage format, and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"26"\},"children":[\{"type":"text","text":"\\[ y := \\alpha \\cdot op(A) \\cdot x + \\beta\n\\cdot y, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"27"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
The info parameter is optional and contains information collected by musparseScsrmv_analysis(), musparseDcsrmv_analysis(), musparseCcsrmv_analysis() or musparseZcsrmv_analysis(). If present, the information will be used to speed up the csrmv computation. If info == NULL, general csrmv routine will be used instead.
for(i = 0; i < m; ++i)
\{
y[i] = beta * y[i];
for(j = csr_row_ptr[i]; j < csr_row_ptr[i + 1]; ++j)
\{
y[i] = y[i] + alpha ` csr_val[j] ` x[csr_col_ind[j]];
\}
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: information collected by musparseScsrmv_analysis(), musparseDcsrmv_analysis(), musparseCcsrmv_analysis() or musparseDcsrmv_analysis(), can beNULLif no information is available.x: array ofnelements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) ormelements (formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: array ofmelements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) ornelements (formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, alpha, csr_val, csr_row_ptr, csr_col_ind, x, beta or y pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example performs a sparse matrix vector multiplication in CSR format using additional meta data to improve performance.
// Create matrix info structure
musparseMatInfo_t info;
musparseCreateMatInfo(&info);
// Perform analysis step to obtain meta data
musparseScsrmv_analysis(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
nnz,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
info);
// Compute y = Ax
musparseScsrmv(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
nnz,
&alpha,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
x,
&beta,
y);
// Do more work
// ...
// Clean up
musparseDestroyMatInfo(info);
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzconst floatalpha - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infoconst floatxconst floatbetafloaty
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrmv
MUSPARSE_EXPORT musparseStatus_t musparseDcsrmv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const double `alpha, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, const double `x, const double `beta, double *y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzconst doublealpha - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infoconst doublexconst doublebetadoubley
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrmv
MUSPARSE_EXPORT musparseStatus_t musparseCcsrmv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, const muComplex `x, const muComplex `beta, muComplex *y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infoconst muComplexxconst muComplexbetamuComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrmv
MUSPARSE_EXPORT musparseStatus_t musparseZcsrmv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, const muDoubleComplex `x, const muDoubleComplex `beta, muDoubleComplex *y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infoconst muDoubleComplexxconst muDoubleComplexbetamuDoubleComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseScsrsv_bufferSize(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Sparse triangular solve using CSR storage format.
musparseXcsrsv_bufferSize returns the size of the temporary storage buffer that is required by musparseScsrsv_analysis(), musparseDcsrsv_analysis(), musparseCcsrsv_analysis(), musparseZcsrsv_analysis(), musparseScsrsv_solve(), musparseDcsrsv_solve(), musparseCcsrsv_solve() and musparseZcsrsv_solve(). The temporary storage buffer must be allocated by the user. The size of the temporary storage buffer is identical to the size returned by musparseScsrilu0_bufferSize(), musparseDcsrilu0_bufferSize(), musparseCcsrilu0_bufferSize() and musparseZcsrilu0_bufferSize() if the matrix sparsity pattern is identical. The user allocated buffer can thus be shared between subsequent calls to those functions.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.buffer_size: number of bytes of the temporary storage buffer required by musparseScsrsv_analysis(), musparseDcsrsv_analysis(), musparseCcsrsv_analysis(), musparseZcsrsv_analysis(), musparseScsrsv_solve(), musparseDcsrsv_solve(), musparseCcsrsv_solve() and musparseZcsrsv_solve().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_val, csr_row_ptr, csr_col_ind, info or buffer_size pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDcsrsv_bufferSize(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCcsrsv_bufferSize(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZcsrsv_bufferSize(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrsv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseScsrsv_analysis(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Sparse triangular solve using CSR storage format.
musparseXcsrsv_analysis performs the analysis step for musparseScsrsv_solve(), musparseDcsrsv_solve(), musparseCcsrsv_solve() and musparseZcsrsv_solve(). It is expected that this function will be executed only once for a given matrix and particular operation type. The analysis meta data can be cleared by musparseXcsrsv_clear().
musparseXcsrsv_analysis can share its meta data with musparseScsrsm_analysis(), musparseDcsrsm_analysis(), musparseCcsrsm_analysis(), musparseZcsrsm_analysis(), musparseScsrilu0_analysis(), musparseDcsrilu0_analysis(), musparseCcsrilu0_analysis(), musparseZcsrilu0_analysis(), musparseScsric0_analysis(), musparseDcsric0_analysis(), musparseCcsric0_analysis() and musparseZcsric0_analysis(). Selecting MUSPARSE_ANALYSIS_POLICY_REUSE policy can greatly improve computation performance of meta data. However, the user need to make sure that the sparsity pattern remains unchanged. If this cannot be assured, MUSPARSE_ANALYSIS_POLICY_FORCE has to be used.
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.analysis: MUSPARSE_ANALYSIS_POLICY_REUSE or MUSPARSE_ANALYSIS_POLICY_FORCE.solve: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_row_ptr, csr_col_ind, info or temp_buffer pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrsv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDcsrsv_analysis(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrsv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCcsrsv_analysis(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrsv_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZcsrsv_analysis(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrsv_solve
MUSPARSE_EXPORT musparseStatus_t musparseScsrsv_solve(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const float `alpha, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, const float `x, float `y, musparseSolvePolicy_t policy, void *temp_buffer)
Sparse triangular solve using CSR storage format.
musparseXcsrsv_solve solves a sparse triangular linear system of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix, defined in CSR storage format, a dense solution vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} and the right-hand side formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"21"\},"children":[\{"type":"text","text":"\\[ op(A) \\cdot y = \\alpha \\cdot x, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"11"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
musparseXcsrsv_solve requires a user allocated temporary buffer. Its size is returned by musparseScsrsv_bufferSize(), musparseDcsrsv_bufferSize(), musparseCcsrsv_bufferSize() or musparseZcsrsv_bufferSize(). Furthermore, analysis meta data is required. It can be obtained by musparseScsrsv_analysis(), musparseDcsrsv_analysis(), musparseCcsrsv_analysis() or musparseZcsrsv_analysis(). musparseXcsrsv_solve reports the first zero pivot (either numerical or structural zero). The zero pivot status can be checked calling musparseXcsrmv_zeroPivot(). If musparseDiagType_t == MUSPARSE_DIAG_TYPE_UNIT, no zero pivot will be reported, even if formula \{"type":"element","name":"formula","attributes":\{"id":"22"\},"children":[\{"type":"text","text":"$A_\{j,j\} = 0$"\}]\} for some formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}.
注意:The sparse CSR matrix has to be sorted. This can be achieved by calling musparseXcsrsort().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans== MUSPARSE_OPERATION_NON_TRANSPOSE andtrans== MUSPARSE_OPERATION_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.x: array ofmelements, holding the right-hand side.y: array ofmelements, holding the solution.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, alpha, csr_val, csr_row_ptr, csr_col_ind, x or y pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
Consider the lower triangular formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"23"\},"children":[\{"type":"text","text":"$L$"\}]\}, stored in CSR storage format with unit diagonal. The following example solves formula \{"type":"element","name":"formula","attributes":\{"id":"24"\},"children":[\{"type":"text","text":"$L \\cdot y\n= x$"\}]\}.
// Create musparse handle
musparseHandle_t handle;
musparseCreate(&handle);
// Create matrix descriptor
musparseMatDescr_t descr;
musparseCreateMatDescr(&descr);
musparseSetMatFillMode(descr, MUSPARSE_FILL_MODE_LOWER);
musparseSetMatDiagType(descr, MUSPARSE_DIAG_TYPE_UNIT);
// Create matrix info structure
musparseMatInfo_t info;
musparseCreateMatInfo(&info);
// Obtain required buffer size
size_t buffer_size;
musparseDcsrsv_bufferSize(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
&buffer_size);
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
// Perform analysis step
musparseDcsrsv_analysis(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Solve Ly = x
musparseDcsrsv_solve(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
&alpha,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
x,
y,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// No zero pivot should be found, with L having unit diagonal
// Clean up
musaFree(temp_buffer);
musparseDestroyMatInfo(info);
musparseDestroyMatDescr(descr);
musparseDestroy(handle);
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnzconst floatalpha - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infoconst floatxfloaty - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrsv_solve
MUSPARSE_EXPORT musparseStatus_t musparseDcsrsv_solve(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const double `alpha, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, const double `x, double `y, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnzconst doublealpha - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infoconst doublexdoubley - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrsv_solve
MUSPARSE_EXPORT musparseStatus_t musparseCcsrsv_solve(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, const muComplex `x, muComplex `y, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnzconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infoconst muComplexxmuComplexy - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrsv_solve
MUSPARSE_EXPORT musparseStatus_t musparseZcsrsv_solve(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt nnz, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, const muDoubleComplex `x, muDoubleComplex `y, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nnzconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infoconst muDoubleComplexxmuDoubleComplexy - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSellmv
MUSPARSE_EXPORT musparseStatus_t musparseSellmv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, const float `alpha, const musparseMatDescr_t descr, const float `ell_val, const muInt `ell_col_ind, muInt ell_width, const float `x, const float `beta, float `y)
Sparse matrix vector multiplication using ELL storage format.
musparseXellmv multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"25"\},"children":[\{"type":"text","text":"$m\n\\times n$"\}]\} matrix, defined in ELL storage format, and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"26"\},"children":[\{"type":"text","text":"\\[ y := \\alpha \\cdot op(A) \\cdot x + \\beta\n\\cdot y, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"27"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
for(i = 0; i < m; ++i)
\{
y[i] = beta * y[i];
for(p = 0; p < ell_width; ++p)
\{
idx = p * m + i;
if((ell_col_ind[idx] >= 0) && (ell_col_ind[idx] < n))
\{
y[i] = y[i] + alpha ` ell_val[idx] ` x[ell_col_ind[idx]];
\}
\}
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the sparse ELL matrix.n: number of columns of the sparse ELL matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse ELL matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.ell_val: array that contains the elements of the sparse ELL matrix. Padded elements should be zero.ell_col_ind: array that contains the column indices of the sparse ELL matrix. Padded column indices should be -1.ell_width: number of non-zero elements per row of the sparse ELL matrix.x: array ofnelements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) ormelements (formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: array ofmelements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) ornelements (formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,norell_widthis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,ell_val,ell_col_ind,x,betaorypointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nconst floatalpha - const musparseMatDescr_t
descrconst floatell_valconst muIntell_col_ind - muInt
ell_widthconst floatxconst floatbetafloaty
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDellmv
MUSPARSE_EXPORT musparseStatus_t musparseDellmv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, const double `alpha, const musparseMatDescr_t descr, const double `ell_val, const muInt `ell_col_ind, muInt ell_width, const double `x, const double `beta, double `y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nconst doublealpha - const musparseMatDescr_t
descrconst doubleell_valconst muIntell_col_ind - muInt
ell_widthconst doublexconst doublebetadoubley
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCellmv
MUSPARSE_EXPORT musparseStatus_t musparseCellmv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `ell_val, const muInt `ell_col_ind, muInt ell_width, const muComplex `x, const muComplex `beta, muComplex `y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexell_valconst muIntell_col_ind - muInt
ell_widthconst muComplexxconst muComplexbetamuComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZellmv
MUSPARSE_EXPORT musparseStatus_t musparseZellmv(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `ell_val, const muInt `ell_col_ind, muInt ell_width, const muDoubleComplex `x, const muDoubleComplex `beta, muDoubleComplex `y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexell_valconst muIntell_col_ind - muInt
ell_widthconst muDoubleComplexxconst muDoubleComplexbetamuDoubleComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseShybmv
MUSPARSE_EXPORT musparseStatus_t musparseShybmv(musparseHandle_t handle, musparseOperation_t trans, const float `alpha, const musparseMatDescr_t descr, const musparseHybMat_t hyb, const float `x, const float `beta, float `y)
Sparse matrix vector multiplication using HYB storage format.
musparseXhybmv multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"31"\},"children":[\{"type":"text","text":"$m\n \\times n$"\}]\} matrix, defined in HYB storage format, and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"32"\},"children":[\{"type":"text","text":"\\[ y := \\alpha \\cdot op(A) \\cdot x + \\beta\n \\cdot y, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"33"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse HYB matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.hyb: matrix in HYB storage format.x: array ofnelements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) ormelements (formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: array ofmelements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) ornelements (formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:hybstructure was not initialized with valid matrix sizes.MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,hyb,x,betaorypointer is invalid.MUSPARSE_STATUS_INVALID_VALUE:
p hyb structure was not initialized with a valid partitioning type.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer could not be allocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst floatalpha - const musparseMatDescr_t
descr - const musparseHybMat_t
hybconst floatxconst floatbetafloaty
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDhybmv
MUSPARSE_EXPORT musparseStatus_t musparseDhybmv(musparseHandle_t handle, musparseOperation_t trans, const double `alpha, const musparseMatDescr_t descr, const musparseHybMat_t hyb, const double `x, const double `beta, double `y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst doublealpha - const musparseMatDescr_t
descr - const musparseHybMat_t
hybconst doublexconst doublebetadoubley
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseChybmv
MUSPARSE_EXPORT musparseStatus_t musparseChybmv(musparseHandle_t handle, musparseOperation_t trans, const muComplex `alpha, const musparseMatDescr_t descr, const musparseHybMat_t hyb, const muComplex `x, const muComplex `beta, muComplex `y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst muComplexalpha - const musparseMatDescr_t
descr - const musparseHybMat_t
hybconst muComplexxconst muComplexbetamuComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZhybmv
MUSPARSE_EXPORT musparseStatus_t musparseZhybmv(musparseHandle_t handle, musparseOperation_t trans, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const musparseHybMat_t hyb, const muDoubleComplex `x, const muDoubleComplex `beta, muDoubleComplex `y)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst muDoubleComplexalpha - const musparseMatDescr_t
descr - const musparseHybMat_t
hybconst muDoubleComplexxconst muDoubleComplexbetamuDoubleComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsrmv
MUSPARSE_EXPORT musparseStatus_t musparseSgebsrmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nb, muInt nnzb, const float `alpha, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const float `x, const float `beta, float *y)
Sparse matrix vector multiplication using GEBSR storage format.
musparseXgebsrmv multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"34"\},"children":[\{"type":"text","text":"$(mb \\cdot \\text\{row_block_dim\}) \\times (nb \\cdot \\text\{col_block_dim\})$"\}]\} matrix, defined in GEBSR storage format, and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"10"\},"children":[\{"type":"text","text":"\\[ y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"11"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of GEBSR blocks.trans: matrix operation type.mb: number of block rows of the sparse GEBSR matrix.nb: number of block columns of the sparse GEBSR matrix.nnzb: number of non-zero blocks of the sparse GEBSR matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse GEBSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzbblocks of the sparse GEBSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse GEBSR matrix.bsr_col_ind: array ofnnzcontaining the block column indices of the sparse GEBSR matrix.row_block_dim: row block dimension of the sparse GEBSR matrix.col_block_dim: column block dimension of the sparse GEBSR matrix.x: array ofnb*col_block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"12"\},"children":[\{"type":"text","text":"$op(A) = A$"\}]\}) ormb*row_block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"13"\},"children":[\{"type":"text","text":"$op(A) = A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"14"\},"children":[\{"type":"text","text":"$op(A) = A^H$"\}]\}).beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: array ofmb*row_block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"12"\},"children":[\{"type":"text","text":"$op(A) = A$"\}]\}) ornb*col_block_dimelements (formula \{"type":"element","name":"formula","attributes":\{"id":"13"\},"children":[\{"type":"text","text":"$op(A) = A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"14"\},"children":[\{"type":"text","text":"$op(A) = A^H$"\}]\}).
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nb,nnzb,row_block_dimorcol_block_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,bsr_val,bsr_row_ind,bsr_col_ind,x,betaorypointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nb - muInt
nnzbconst floatalpha - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimconst floatxconst floatbetafloaty
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsrmv
MUSPARSE_EXPORT musparseStatus_t musparseDgebsrmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nb, muInt nnzb, const double `alpha, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const double `x, const double `beta, double *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nb - muInt
nnzbconst doublealpha - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimconst doublexconst doublebetadoubley
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsrmv
MUSPARSE_EXPORT musparseStatus_t musparseCgebsrmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nb, muInt nnzb, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const muComplex `x, const muComplex `beta, muComplex *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nb - muInt
nnzbconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimconst muComplexxconst muComplexbetamuComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsrmv
MUSPARSE_EXPORT musparseStatus_t musparseZgebsrmv(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans, muInt mb, muInt nb, muInt nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const muDoubleComplex `x, const muDoubleComplex `beta, muDoubleComplex *y)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans - muInt
mb - muInt
nb - muInt
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimconst muDoubleComplexxconst muDoubleComplexbetamuDoubleComplexy
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgemvi_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSgemvi_bufferSize_legacy(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, size_t *buffer_size)
Dense matrix sparse vector multiplication.
musparseXgemvi_bufferSize returns the size of the temporary storage buffer required by musparseSgemvi(), musparseDgemvi(), musparseCgemvi() or musparseZgemvi(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the dense matrix.n: number of columns of the dense matrix.nnz: number of non-zero entries in the sparse vector.buffer_size: temporary storage buffer size.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n, ornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:buffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgemvi_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseDgemvi_bufferSize_legacy(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgemvi_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseCgemvi_bufferSize_legacy(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgemvi_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseZgemvi_bufferSize_legacy(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, muInt nnz, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
n - muInt
nnzsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgemvi
MUSPARSE_EXPORT musparseStatus_t musparseSgemvi(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, const float `alpha, const float `A, muInt lda, muInt nnz, const float `x_val, const muInt `x_ind, const float `beta, float `y, musparseIndexBase_t idx_base, void *temp_buffer)
Dense matrix sparse vector multiplication.
musparseXgemvi multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a dense formula \{"type":"element","name":"formula","attributes":\{"id":"25"\},"children":[\{"type":"text","text":"$m\n\\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\} and the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"36"\},"children":[\{"type":"text","text":"\\[ y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"11"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
musparseXgemvi requires a user allocated temporary buffer. Its size is returned by musparseSgemvi_bufferSize(), musparseDgemvi_bufferSize(), musparseCgemvi_bufferSize() or musparseZgemvi_bufferSize().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.m: number of rows of the dense matrix.n: number of columns of the dense matrix.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.A: pointer to the dense matrix.lda: leading dimension of the dense matrixnnz: number of non-zero entries in the sparse vectorx_val: array ofnnzelements containing the values of the sparse vectorx_ind: array ofnnzelements containing the indices of the sparse vectorbeta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: array ofmelements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) ornelements (formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.temp_buffer: temporary storage buffer
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,ldaornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:alpha,A,x_val,x_ind,beta,yortemp_bufferpointer is```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans` != MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nconst floatalphaconst floatA - muInt
lda - muInt
nnzconst floatx_valconst muIntx_indconst floatbetafloaty - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgemvi
MUSPARSE_EXPORT musparseStatus_t musparseDgemvi(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, const double `alpha, const double `A, muInt lda, muInt nnz, const double `x_val, const muInt `x_ind, const double `beta, double `y, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nconst doublealphaconst doubleA - muInt
lda - muInt
nnzconst doublex_valconst muIntx_indconst doublebetadoubley - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgemvi
MUSPARSE_EXPORT musparseStatus_t musparseCgemvi(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, const muComplex `alpha, const muComplex `A, muInt lda, muInt nnz, const muComplex `x_val, const muInt `x_ind, const muComplex `beta, muComplex `y, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nconst muComplexalphaconst muComplexA - muInt
lda - muInt
nnzconst muComplexx_valconst muIntx_indconst muComplexbetamuComplexy - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgemvi
MUSPARSE_EXPORT musparseStatus_t musparseZgemvi(musparseHandle_t handle, musparseOperation_t trans, muInt m, muInt n, const muDoubleComplex `alpha, const muDoubleComplex `A, muInt lda, muInt nnz, const muDoubleComplex `x_val, const muInt `x_ind, const muDoubleComplex `beta, muDoubleComplex `y, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - muInt
m - muInt
nconst muDoubleComplexalphaconst muDoubleComplexA - muInt
lda - muInt
nnzconst muDoubleComplexx_valconst muIntx_indconst muDoubleComplexbetamuDoubleComplexy - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrmm
MUSPARSE_EXPORT musparseStatus_t musparseSbsrmm(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt mb, muInt n, muInt kb, muInt nnzb, const float `alpha, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const float `B, muInt ldb, const float `beta, float *C, muInt ldc)
Sparse matrix dense matrix multiplication using BSR storage format.
musparseXbsrmm multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"37"\},"children":[\{"type":"text","text":"$mb\n\\times kb$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, defined in BSR storage format, and the dense formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\} (where formula \{"type":"element","name":"formula","attributes":\{"id":"40"\},"children":[\{"type":"text","text":"$k = block\\_dim \\times kb$"\}]\}) and adds the result to the dense formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\} (where formula \{"type":"element","name":"formula","attributes":\{"id":"43"\},"children":[\{"type":"text","text":"$m =\nblock\\_dim \\times mb$"\}]\}) that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"44"\},"children":[\{"type":"text","text":"\\[ C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"45"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"46"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans_A== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks. Can be MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMN.trans_A: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type. Currently, only MUSPARSE_OPERATION_NON_TRANSPOSE is supported.trans_B: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type. Currently, only MUSPARSE_OPERATION_NON_TRANSPOSE and MUSPARSE_OPERATION_TRANSPOSE are supported.mb: number of block rows of the sparse BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.n: number of columns of the dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.kb: number of block columns of the sparse BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.nnzb: number of non-zero blocks of the sparse BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzb*block_dim*block_dimelements of the sparse BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.block_dim: size of the blocks in the sparse BSR matrix.B: array of dimensionformula \{"type":"element","name":"formula","attributes":\{"id":"48"\},"children":[\{"type":"text","text":"$ldb \\times n$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\}),formula \{"type":"element","name":"formula","attributes":\{"id":"50"\},"children":[\{"type":"text","text":"$ldb \\times k$"\}]\}otherwise.ldb: leading dimension offormula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, must be at leastformula \{"type":"element","name":"formula","attributes":\{"id":"51"\},"children":[\{"type":"text","text":"$\\max\{(1,\nk)\}$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"52"\},"children":[\{"type":"text","text":"$ op(B) == B$"\}]\}) whereformula \{"type":"element","name":"formula","attributes":\{"id":"40"\},"children":[\{"type":"text","text":"$k = block\\_dim \\times kb$"\}]\},formula \{"type":"element","name":"formula","attributes":\{"id":"53"\},"children":[\{"type":"text","text":"$\\max\{(1,\nn)\}$"\}]\}otherwise.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.C: array of dimensionformula \{"type":"element","name":"formula","attributes":\{"id":"54"\},"children":[\{"type":"text","text":"$ldc \\times n$"\}]\}.ldc: leading dimension offormula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, must be at leastformula \{"type":"element","name":"formula","attributes":\{"id":"55"\},"children":[\{"type":"text","text":"$\\max\{(1,\nm)\}$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"56"\},"children":[\{"type":"text","text":"$ op(A) == A$"\}]\}) whereformula \{"type":"element","name":"formula","attributes":\{"id":"57"\},"children":[\{"type":"text","text":"$m = block\\_dim \\times mb$"\}]\},formula \{"type":"element","name":"formula","attributes":\{"id":"51"\},"children":[\{"type":"text","text":"$\\max\{(1,\nk)\}$"\}]\}whereformula \{"type":"element","name":"formula","attributes":\{"id":"40"\},"children":[\{"type":"text","text":"$k = block\\_dim \\times kb$"\}]\}otherwise.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,n,kb,nnzb,ldborldcis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,bsr_val,bsr_row_ptr,bsr_col_ind,B,betaorCpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A!= MUSPARSE_OPERATION_NON_TRANSPOSE ortrans_B== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example multiplies a BSR matrix with a dense matrix.
// 1 2 0 3 0 0
// A = 0 4 5 0 0 0
// 0 0 0 7 8 0
// 0 0 1 2 4 1
muInt block_dim = 2;
muInt mb = 2;
muInt kb = 3;
muInt nnzb = 4;
musparseDirection_t dir = MUSPARSE_DIRECTION_ROW;
bsr_row_ptr[mb+1] = \{0, 2, 4\}; // device memory
bsr_col_ind[nnzb] = \{0, 1, 1, 2\}; // device memory
bsr_val[nnzb`block_dim`block_dim] = \{1, 2, 0, 4, 0, 3, 5, 0, 0, 7, 1, 2,
8, 0, 4, 1\}; // device memory
// Set dimension n of B
muInt n = 64;
muInt m = mb * block_dim;
muInt k = kb * block_dim;
// Allocate and generate dense matrix B
std::vector<float> hB(k * n);
for(muInt i = 0; i < k * n; ++i)
\{
hB[i] = static_cast<float>(rand()) / RAND_MAX;
\}
// Copy B to the device
float* B;
musaMalloc((void``)&B, sizeof(float) ` k ` n);
musaMemcpy(B, hB.data(), sizeof(float) ` k ` n, musaMemcpyHostToDevice);
// alpha and beta
float alpha = 1.0f;
float beta = 0.0f;
// Allocate memory for the resulting matrix C
float* C;
musaMalloc((void``)&C, sizeof(float) ` m ` n);
// Perform the matrix multiplication
musparseSbsrmm(handle,
dir,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
n,
kb,
nnzb,
&alpha,
descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
B,
k,
&beta,
C,
m);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
mb - muInt
n - muInt
kb - muInt
nnzbconst floatalpha - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dimconst floatB - muInt
ldbconst floatbetafloatC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrmm
MUSPARSE_EXPORT musparseStatus_t musparseDbsrmm(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt mb, muInt n, muInt kb, muInt nnzb, const double `alpha, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const double `B, muInt ldb, const double `beta, double *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
mb - muInt
n - muInt
kb - muInt
nnzbconst doublealpha - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dimconst doubleB - muInt
ldbconst doublebetadoubleC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrmm
MUSPARSE_EXPORT musparseStatus_t musparseCbsrmm(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt mb, muInt n, muInt kb, muInt nnzb, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const muComplex `B, muInt ldb, const muComplex `beta, muComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
mb - muInt
n - muInt
kb - muInt
nnzbconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dimconst muComplexB - muInt
ldbconst muComplexbetamuComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrmm
MUSPARSE_EXPORT musparseStatus_t musparseZbsrmm(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt mb, muInt n, muInt kb, muInt nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const muDoubleComplex `B, muInt ldb, const muDoubleComplex `beta, muDoubleComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
mb - muInt
n - muInt
kb - muInt
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dimconst muDoubleComplexB - muInt
ldbconst muDoubleComplexbetamuDoubleComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsrmm
MUSPARSE_EXPORT musparseStatus_t musparseSgebsrmm(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt mb, muInt n, muInt kb, muInt nnzb, const float `alpha, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const float `B, muInt ldb, const float `beta, float *C, muInt ldc)
Sparse matrix dense matrix multiplication using GEneral BSR storage format.
musparseXgebsrmm multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"37"\},"children":[\{"type":"text","text":"$mb\n\\times kb$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, defined in GEneral BSR storage format, and the dense formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\} (where formula \{"type":"element","name":"formula","attributes":\{"id":"58"\},"children":[\{"type":"text","text":"$k = col_block\\_dim \\times\nkb$"\}]\}) and adds the result to the dense formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\} (where formula \{"type":"element","name":"formula","attributes":\{"id":"59"\},"children":[\{"type":"text","text":"$m = row_block\\_dim \\times mb$"\}]\}) that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"60"\},"children":[\{"type":"text","text":"\\[ C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot\nC, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"61"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"46"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans_A== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks. Can be MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMN.trans_A: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type. Currently, only MUSPARSE_OPERATION_NON_TRANSPOSE is supported.trans_B: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type. Currently, only MUSPARSE_OPERATION_NON_TRANSPOSE and MUSPARSE_OPERATION_TRANSPOSE are supported.mb: number of block rows of the sparse GEneral BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.n: number of columns of the dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.kb: number of block columns of the sparse GEneral BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.nnzb: number of non-zero blocks of the sparse GEneral BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse GEneral BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzb*row_block_dim*col_block_dimelements of the sparse GEneral BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse GEneral BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse GEneral BSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.row_block_dim: row size of the blocks in the sparse GEneral BSR matrix.col_block_dim: column size of the blocks in the sparse GEneral BSR matrix.B: array of dimensionformula \{"type":"element","name":"formula","attributes":\{"id":"48"\},"children":[\{"type":"text","text":"$ldb \\times n$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\}),formula \{"type":"element","name":"formula","attributes":\{"id":"50"\},"children":[\{"type":"text","text":"$ldb \\times k$"\}]\}otherwise.ldb: leading dimension offormula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, must be at leastformula \{"type":"element","name":"formula","attributes":\{"id":"51"\},"children":[\{"type":"text","text":"$\\max\{(1,\nk)\}$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"52"\},"children":[\{"type":"text","text":"$ op(B) == B$"\}]\}) whereformula \{"type":"element","name":"formula","attributes":\{"id":"62"\},"children":[\{"type":"text","text":"$k = col\\_block\\_dim \\times kb$"\}]\},formula \{"type":"element","name":"formula","attributes":\{"id":"63"\},"children":[\{"type":"text","text":"$\\max\{(1, n)\}$"\}]\}otherwise.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.C: array of dimensionformula \{"type":"element","name":"formula","attributes":\{"id":"54"\},"children":[\{"type":"text","text":"$ldc \\times n$"\}]\}.ldc: leading dimension offormula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, must be at leastformula \{"type":"element","name":"formula","attributes":\{"id":"55"\},"children":[\{"type":"text","text":"$\\max\{(1,\nm)\}$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"56"\},"children":[\{"type":"text","text":"$ op(A) == A$"\}]\}) whereformula \{"type":"element","name":"formula","attributes":\{"id":"64"\},"children":[\{"type":"text","text":"$m = row\\_block\\_dim \\times mb$"\}]\},formula \{"type":"element","name":"formula","attributes":\{"id":"65"\},"children":[\{"type":"text","text":"$\\max\{(1, k)\}$"\}]\}whereformula \{"type":"element","name":"formula","attributes":\{"id":"62"\},"children":[\{"type":"text","text":"$k = col\\_block\\_dim \\times kb$"\}]\}otherwise.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,n,kb,nnzb,ldb,ldc,row_block_dimorcol_block_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,bsr_val,bsr_row_ptr,bsr_col_ind,B,betaorCpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A!= MUSPARSE_OPERATION_NON_TRANSPOSE ortrans_B== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example multiplies a GEneral BSR matrix with a dense matrix.
// 1 2 0 3 0 0
// A = 0 4 5 0 0 0
// 0 0 0 7 8 0
// 0 0 1 2 4 1
muInt row_block_dim = 2;
muInt col_block_dim = 3;
muInt mb = 2;
muInt kb = 2;
muInt nnzb = 4;
musparseDirection_t dir = MUSPARSE_DIRECTION_ROW;
bsr_row_ptr[mb+1] = \{0, 2, 4\}; // device memory
bsr_col_ind[nnzb] = \{0, 1, 0, 1\}; // device memory
bsr_val[nnzb`row_block_dim`col_block_dim] = \{1, 2, 0, 0, 4, 5, 3, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 8, 0, 2, 4, 1\}; // device memory
// Set dimension n of B
muInt n = 64;
muInt m = mb * row_block_dim;
muInt k = kb * col_block_dim;
// Allocate and generate dense matrix B
std::vector<float> hB(k * n);
for(muInt i = 0; i < k * n; ++i)
\{
hB[i] = static_cast<float>(rand()) / RAND_MAX;
\}
// Copy B to the device
float* B;
musaMalloc((void``)&B, sizeof(float) ` k ` n);
musaMemcpy(B, hB.data(), sizeof(float) ` k ` n, musaMemcpyHostToDevice);
// alpha and beta
float alpha = 1.0f;
float beta = 0.0f;
// Allocate memory for the resulting matrix C
float* C;
musaMalloc((void``)&C, sizeof(float) ` m ` n);
// Perform the matrix multiplication
musparseSgebsrmm(handle,
dir,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
n,
kb,
nnzb,
&alpha,
descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
row_block_dim,
col_block_dim,
B,
k,
&beta,
C,
m);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
mb - muInt
n - muInt
kb - muInt
nnzbconst floatalpha - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimconst floatB - muInt
ldbconst floatbetafloatC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsrmm
MUSPARSE_EXPORT musparseStatus_t musparseDgebsrmm(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt mb, muInt n, muInt kb, muInt nnzb, const double `alpha, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const double `B, muInt ldb, const double `beta, double *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
mb - muInt
n - muInt
kb - muInt
nnzbconst doublealpha - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimconst doubleB - muInt
ldbconst doublebetadoubleC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsrmm
MUSPARSE_EXPORT musparseStatus_t musparseCgebsrmm(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt mb, muInt n, muInt kb, muInt nnzb, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const muComplex `B, muInt ldb, const muComplex `beta, muComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
mb - muInt
n - muInt
kb - muInt
nnzbconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimconst muComplexB - muInt
ldbconst muComplexbetamuComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsrmm
MUSPARSE_EXPORT musparseStatus_t musparseZgebsrmm(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt mb, muInt n, muInt kb, muInt nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const muDoubleComplex `B, muInt ldb, const muDoubleComplex `beta, muDoubleComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
mb - muInt
n - muInt
kb - muInt
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimconst muDoubleComplexB - muInt
ldbconst muDoubleComplexbetamuDoubleComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrmm
MUSPARSE_EXPORT musparseStatus_t musparseScsrmm(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const float `alpha, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const float `B, muInt ldb, const float `beta, float *C, muInt ldc)
Sparse matrix dense matrix multiplication using CSR storage format.
musparseXcsrmm multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"66"\},"children":[\{"type":"text","text":"$m\n\\times k$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, defined in CSR storage format, and the dense formula \{"type":"element","name":"formula","attributes":\{"id":"67"\},"children":[\{"type":"text","text":"$k\n\\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\} and adds the result to the dense formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"68"\},"children":[\{"type":"text","text":"\\[ C\n:= \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"69"\},"children":[\{"type":"text","text":"\\[ op(A) =\n\\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"70"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
for(i = 0; i < ldc; ++i)
\{
for(j = 0; j < n; ++j)
\{
C[i][j] = beta * C[i][j];
for(k = csr_row_ptr[i]; k < csr_row_ptr[i + 1]; ++k)
\{
C[i][j] += alpha ` csr_val[k] ` B[csr_col_ind[k]][j];
\}
\}
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.trans_B: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.m: number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.n: number of columns of the dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.k: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.nnz: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array ofnnzelements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.B: array of dimensionformula \{"type":"element","name":"formula","attributes":\{"id":"48"\},"children":[\{"type":"text","text":"$ldb \\times n$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\}),formula \{"type":"element","name":"formula","attributes":\{"id":"50"\},"children":[\{"type":"text","text":"$ldb \\times k$"\}]\}otherwise.ldb: leading dimension offormula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, must be at leastformula \{"type":"element","name":"formula","attributes":\{"id":"51"\},"children":[\{"type":"text","text":"$\\max\{(1,\nk)\}$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\}),formula \{"type":"element","name":"formula","attributes":\{"id":"63"\},"children":[\{"type":"text","text":"$\\max\{(1, n)\}$"\}]\}otherwise.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.C: array of dimensionformula \{"type":"element","name":"formula","attributes":\{"id":"54"\},"children":[\{"type":"text","text":"$ldc \\times n$"\}]\}.ldc: leading dimension offormula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, must be at leastformula \{"type":"element","name":"formula","attributes":\{"id":"55"\},"children":[\{"type":"text","text":"$\\max\{(1,\nm)\}$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}),formula \{"type":"element","name":"formula","attributes":\{"id":"65"\},"children":[\{"type":"text","text":"$\\max\{(1, k)\}$"\}]\}otherwise.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,k,nnz,ldborldcis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,alpha,csr_val,csr_row_ptr,csr_col_ind,B,betaorCpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example multiplies a CSR matrix with a dense matrix.
// 1 2 0 3 0
// A = 0 4 5 0 0
// 6 0 0 7 8
muInt m = 3;
muInt k = 5;
muInt nnz = 8;
csr_row_ptr[m+1] = \{0, 3, 5, 8\}; // device memory
csr_col_ind[nnz] = \{0, 1, 3, 1, 2, 0, 3, 4\}; // device memory
csr_val[nnz] = \{1, 2, 3, 4, 5, 6, 7, 8\}; // device memory
// Set dimension n of B
muInt n = 64;
// Allocate and generate dense matrix B
std::vector<float> hB(k * n);
for(muInt i = 0; i < k * n; ++i)
\{
hB[i] = static_cast<float>(rand()) / RAND_MAX;
\}
// Copy B to the device
float* B;
musaMalloc((void``)&B, sizeof(float) ` k ` n);
musaMemcpy(B, hB.data(), sizeof(float) ` k ` n, musaMemcpyHostToDevice);
// alpha and beta
float alpha = 1.0f;
float beta = 0.0f;
// Allocate memory for the resulting matrix C
float* C;
musaMalloc((void``)&C, sizeof(float) ` m ` n);
// Perform the matrix multiplication
musparseScsrmm(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
nnz,
&alpha,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
B,
k,
&beta,
C,
m);
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst floatalpha - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst floatB - muInt
ldbconst floatbetafloatC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrmm
MUSPARSE_EXPORT musparseStatus_t musparseDcsrmm(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const double `alpha, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const double `B, muInt ldb, const double `beta, double *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst doublealpha - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst doubleB - muInt
ldbconst doublebetadoubleC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrmm
MUSPARSE_EXPORT musparseStatus_t musparseCcsrmm(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muComplex `B, muInt ldb, const muComplex `beta, muComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muComplexB - muInt
ldbconst muComplexbetamuComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrmm
MUSPARSE_EXPORT musparseStatus_t musparseZcsrmm(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muDoubleComplex `B, muInt ldb, const muDoubleComplex `beta, muDoubleComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muDoubleComplexB - muInt
ldbconst muDoubleComplexbetamuDoubleComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrsm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseScsrsm_bufferSize(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const float `alpha, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const float `B, muInt ldb, musparseMatInfo_t info, musparseSolvePolicy_t policy, size_t `buffer_size)
Sparse triangular system solve using CSR storage format.
musparseXcsrsm_bufferSize returns the size of the temporary storage buffer that is required by musparseScsrsm_analysis(), musparseDcsrsm_analysis(), musparseCcsrsm_analysis(), musparseZcsrsm_analysis(), musparseScsrsm_solve(), musparseDcsrsm_solve(), musparseCcsrsm_solve() and musparseZcsrsm_solve(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrix A operation type.trans_B: matrix B operation type.m: number of rows of the sparse CSR matrix A.nrhs: number of columns of the dense matrix op(B).nnz: number of non-zero entries of the sparse CSR matrix A.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse CSR matrix A.csr_val: array ofnnzelements of the sparse CSR matrix A.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix A.B: array ofmformula \{"type":"element","name":"formula","attributes":\{"id":"71"\},"children":[\{"type":"text","text":"$\\times$"\}]\}nrhselements of the rhs matrix B.ldb: leading dimension of rhs matrix B.info: structure that holds the information collected during the analysis step.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.buffer_size: number of bytes of the temporary storage buffer required by musparseScsrsm_analysis(), musparseDcsrsm_analysis(), musparseCcsrsm_analysis(), musparseZcsrsm_analysis(), musparseScsrsm_solve(), musparseDcsrsm_solve(), musparseCcsrsm_solve() and musparseZcsrsm_solve().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nrhsornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:alpha,descr,csr_val,csr_row_ptr,csr_col_ind,B,infoorbuffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE,trans_B== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst floatalpha - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst floatB - muInt
ldb - musparseMatInfo_t
info - musparseSolvePolicy_t
policysize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrsm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDcsrsm_bufferSize(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const double `alpha, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const double `B, muInt ldb, musparseMatInfo_t info, musparseSolvePolicy_t policy, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst doublealpha - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst doubleB - muInt
ldb - musparseMatInfo_t
info - musparseSolvePolicy_t
policysize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrsm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCcsrsm_bufferSize(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muComplex `B, muInt ldb, musparseMatInfo_t info, musparseSolvePolicy_t policy, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muComplexB - muInt
ldb - musparseMatInfo_t
info - musparseSolvePolicy_t
policysize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrsm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZcsrsm_bufferSize(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muDoubleComplex `B, muInt ldb, musparseMatInfo_t info, musparseSolvePolicy_t policy, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muDoubleComplexB - muInt
ldb - musparseMatInfo_t
info - musparseSolvePolicy_t
policysize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrsm_analysis
MUSPARSE_EXPORT musparseStatus_t musparseScsrsm_analysis(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const float `alpha, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const float `B, muInt ldb, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Sparse triangular system solve using CSR storage format.
musparseXcsrsm_analysis performs the analysis step for musparseScsrsm_solve(), musparseDcsrsm_solve(), musparseCcsrsm_solve() and musparseZcsrsm_solve(). It is expected that this function will be executed only once for a given matrix and particular operation type. The analysis meta data can be cleared by musparseXcsrsm_clear().
musparseXcsrsm_analysis can share its meta data with musparseScsrilu0_analysis(), musparseDcsrilu0_analysis(), musparseCcsrilu0_analysis(), musparseZcsrilu0_analysis(), musparseScsric0_analysis(), musparseDcsric0_analysis(), musparseCcsric0_analysis(), musparseZcsric0_analysis(), musparseScsrsv_analysis(), musparseDcsrsv_analysis(), musparseCcsrsv_analysis() and musparseZcsrsv_analysis(). Selecting MUSPARSE_ANALYSIS_POLICY_REUSE policy can greatly improve computation performance of meta data. However, the user need to make sure that the sparsity pattern remains unchanged. If this cannot be assured, MUSPARSE_ANALYSIS_POLICY_FORCE has to be used.
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrix A operation type.trans_B: matrix B operation type.m: number of rows of the sparse CSR matrix A.nrhs: number of columns of the dense matrix op(B).nnz: number of non-zero entries of the sparse CSR matrix A.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse CSR matrix A.csr_val: array ofnnzelements of the sparse CSR matrix A.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix A.B: array ofmformula \{"type":"element","name":"formula","attributes":\{"id":"71"\},"children":[\{"type":"text","text":"$\\times$"\}]\}nrhselements of the rhs matrix B.ldb: leading dimension of rhs matrix B.info: structure that holds the information collected during the analysis step.analysis: MUSPARSE_ANALYSIS_POLICY_REUSE or MUSPARSE_ANALYSIS_POLICY_FORCE.solve: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nrhsornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:alpha,descr,csr_val,csr_row_ptr,csr_col_ind,B,infoortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE,trans_B== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst floatalpha - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst floatB - muInt
ldb - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrsm_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDcsrsm_analysis(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const double `alpha, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const double `B, muInt ldb, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst doublealpha - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst doubleB - muInt
ldb - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrsm_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCcsrsm_analysis(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muComplex `B, muInt ldb, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muComplexB - muInt
ldb - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrsm_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZcsrsm_analysis(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muDoubleComplex `B, muInt ldb, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muDoubleComplexB - muInt
ldb - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrsm_solve
MUSPARSE_EXPORT musparseStatus_t musparseScsrsm_solve(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const float `alpha, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, float `B, muInt ldb, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Sparse triangular system solve using CSR storage format.
musparseXcsrsm_solve solves a sparse triangular linear system of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix, defined in CSR storage format, a dense solution matrix formula \{"type":"element","name":"formula","attributes":\{"id":"72"\},"children":[\{"type":"text","text":"$X$"\}]\} and the right-hand side matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"73"\},"children":[\{"type":"text","text":"\\[ op(A) \\cdot op(X) = \\alpha \\cdot\nop(B), \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"74"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} , formula \{"type":"element","name":"formula","attributes":\{"id":"70"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"75"\},"children":[\{"type":"text","text":"\\[\n op(X) = \\left\\\{\n \\begin\{array\}\{ll\}\n X, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n X^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n X^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
musparseXcsrsm_solve requires a user allocated temporary buffer. Its size is returned by musparseScsrsm_bufferSize(), musparseDcsrsm_bufferSize(), musparseCcsrsm_bufferSize() or musparseZcsrsm_bufferSize(). Furthermore, analysis meta data is required. It can be obtained by musparseScsrsm_analysis(), musparseDcsrsm_analysis(), musparseCcsrsm_analysis() or musparseZcsrsm_analysis(). musparseXcsrsm_solve reports the first zero pivot (either numerical or structural zero). The zero pivot status can be checked calling musparseXcsrsm_zeroPivot(). If musparseDiagType_t == MUSPARSE_DIAG_TYPE_UNIT, no zero pivot will be reported, even if formula \{"type":"element","name":"formula","attributes":\{"id":"22"\},"children":[\{"type":"text","text":"$A_\{j,j\} = 0$"\}]\} for some formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}.
注意:The sparse CSR matrix has to be sorted. This can be achieved by calling musparseXcsrsort().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans_A!= MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE andtrans_B!= MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrix A operation type.trans_B: matrix B operation type.m: number of rows of the sparse CSR matrix A.nrhs: number of columns of the dense matrix op(B).nnz: number of non-zero entries of the sparse CSR matrix A.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse CSR matrix A.csr_val: array ofnnzelements of the sparse CSR matrix A.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix A.B: array ofmformula \{"type":"element","name":"formula","attributes":\{"id":"71"\},"children":[\{"type":"text","text":"$\\times$"\}]\}nrhselements of the rhs matrix B.ldb: leading dimension of rhs matrix B.info: structure that holds the information collected during the analysis step.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nrhsornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:alpha,descr,csr_val,csr_row_ptr,csr_col_ind,B,infoortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE,trans_B== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
Consider the lower triangular formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"23"\},"children":[\{"type":"text","text":"$L$"\}]\}, stored in CSR storage format with unit diagonal. The following example solves formula \{"type":"element","name":"formula","attributes":\{"id":"76"\},"children":[\{"type":"text","text":"$L \\cdot X\n= B$"\}]\}.
// Create musparse handle
musparseHandle_t handle;
musparseCreate(&handle);
// Create matrix descriptor
musparseMatDescr_t descr;
musparseCreateMatDescr(&descr);
musparseSetMatFillMode(descr, MUSPARSE_FILL_MODE_LOWER);
musparseSetMatDiagType(descr, MUSPARSE_DIAG_TYPE_UNIT);
// Create matrix info structure
musparseMatInfo_t info;
musparseCreateMatInfo(&info);
// Obtain required buffer size
size_t buffer_size;
musparseDcsrsm_bufferSize(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nrhs,
nnz,
&alpha,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
B,
ldb,
info,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
&buffer_size);
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
// Perform analysis step
musparseDcsrsm_analysis(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nrhs,
nnz,
&alpha,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
B,
ldb,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Solve LX = B
musparseDcsrsm_solve(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nrhs,
nnz,
&alpha,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
B,
ldb,
info,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// No zero pivot should be found, with L having unit diagonal
// Clean up
musaFree(temp_buffer);
musparseDestroyMatInfo(info);
musparseDestroyMatDescr(descr);
musparseDestroy(handle);
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst floatalpha - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indfloatB - muInt
ldb - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrsm_solve
MUSPARSE_EXPORT musparseStatus_t musparseDcsrsm_solve(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const double `alpha, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, double `B, muInt ldb, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst doublealpha - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_inddoubleB - muInt
ldb - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrsm_solve
MUSPARSE_EXPORT musparseStatus_t musparseCcsrsm_solve(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muComplex `B, muInt ldb, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indmuComplexB - muInt
ldb - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrsm_solve
MUSPARSE_EXPORT musparseStatus_t musparseZcsrsm_solve(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt nrhs, muInt nnz, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muDoubleComplex `B, muInt ldb, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
nrhs - muInt
nnzconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indmuDoubleComplexB - muInt
ldb - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsm_bufferSize(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Sparse triangular system solve using BSR storage format.
musparseXbsrsm_bufferSize returns the size of the temporary storage buffer that is required by musparseSbsrsm_analysis(), musparseDbsrsm_analysis(), musparseCbsrsm_analysis(), musparseZbsrsm_analysis(), musparseSbsrsm_solve(), musparseDbsrsm_solve(), musparseCbsrsm_solve() and musparseZbsrsm_solve(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of BSR blocks.trans_A: matrix A operation type.trans_X: matrix X operation type.mb: number of block rows of the sparse BSR matrix A.nrhs: number of columns of the dense matrix op(X).nnzb: number of non-zero blocks of the sparse BSR matrix A.descr: descriptor of the sparse BSR matrix A.bsr_val: array ofnnzbblocks of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbcontaining the block column indices of the sparse BSR matrix.block_dim: block dimension of the sparse BSR matrix.info: structure that holds the information collected during the analysis step.buffer_size: number of bytes of the temporary storage buffer required by musparseSbsrsm_analysis(), musparseDbsrsm_analysis(), musparseCbsrsm_analysis(), musparseZbsrsm_analysis(), musparseSbsrsm_solve(), musparseDbsrsm_solve(), musparseCbsrsm_solve() and musparseZbsrsm_solve().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nrhs,nnzborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptr,bsr_col_ind,infoorbuffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE,trans_X== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzb - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsm_bufferSize(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzb - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsm_bufferSize(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzb - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsm_bufferSize(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzb - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsm_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsm_analysis(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Sparse triangular system solve using BSR storage format.
musparseXbsrsm_analysis performs the analysis step for musparseSbsrsm_solve(), musparseDbsrsm_solve(), musparseCbsrsm_solve() and musparseZbsrsm_solve(). It is expected that this function will be executed only once for a given matrix and particular operation type. The analysis meta data can be cleared by musparseXbsrsm_clear().
musparseXbsrsm_analysis can share its meta data with musparseSbsrilu0_analysis(), musparseDbsrilu0_analysis(), musparseCbsrilu0_analysis(), musparseZbsrilu0_analysis(), musparseSbsric0_analysis(), musparseDbsric0_analysis(), musparseCbsric0_analysis(), musparseZbsric0_analysis(), musparseSbsrsv_analysis(), musparseDbsrsv_analysis(), musparseCbsrsv_analysis() and musparseZbsrsv_analysis(). Selecting MUSPARSE_ANALYSIS_POLICY_REUSE policy can greatly improve computation performance of meta data. However, the user need to make sure that the sparsity pattern remains unchanged. If this cannot be assured, MUSPARSE_ANALYSIS_POLICY_FORCE has to be used.
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of BSR blocks.trans_A: matrix A operation type.trans_X: matrix X operation type.mb: number of block rows of the sparse BSR matrix A.nrhs: number of columns of the dense matrix op(X).nnzb: number of non-zero blocks of the sparse BSR matrix A.descr: descriptor of the sparse BSR matrix A.bsr_val: array ofnnzbblocks of the sparse BSR matrix A.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix A.bsr_col_ind: array ofnnzbcontaining the block column indices of the sparse BSR matrix A.block_dim: block dimension of the sparse BSR matrix A.info: structure that holds the information collected during the analysis step.analysis: MUSPARSE_ANALYSIS_POLICY_REUSE or MUSPARSE_ANALYSIS_POLICY_FORCE.solve: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nrhs,nnzborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptr,bsr_col_ind,infoortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE,trans_X== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzb - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsm_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsm_analysis(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzb - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsm_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsm_analysis(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzb - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsm_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsm_analysis(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzb - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrsm_solve
MUSPARSE_EXPORT musparseStatus_t musparseSbsrsm_solve(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const float `alpha, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, const float `B, muInt ldb, float `X, muInt ldx, musparseSolvePolicy_t policy, void *temp_buffer)
Sparse triangular system solve using BSR storage format.
musparseXbsrsm_solve solves a sparse triangular linear system of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix, defined in BSR storage format, a dense solution matrix formula \{"type":"element","name":"formula","attributes":\{"id":"72"\},"children":[\{"type":"text","text":"$X$"\}]\} and the right-hand side matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"73"\},"children":[\{"type":"text","text":"\\[ op(A) \\cdot op(X) = \\alpha \\cdot\nop(B), \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"74"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} , formula \{"type":"element","name":"formula","attributes":\{"id":"77"\},"children":[\{"type":"text","text":"\\[\n op(X) = \\left\\\{\n \\begin\{array\}\{ll\}\n X, & \\text\{if trans_X == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n X^T, & \\text\{if trans_X == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n X^H, & \\text\{if trans_X == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
musparseXbsrsm_solve requires a user allocated temporary buffer. Its size is returned by musparseSbsrsm_bufferSize(), musparseDbsrsm_bufferSize(), musparseCbsrsm_bufferSize() or musparseZbsrsm_bufferSize(). Furthermore, analysis meta data is required. It can be obtained by musparseSbsrsm_analysis(), musparseDbsrsm_analysis(), musparseCbsrsm_analysis() or musparseZbsrsm_analysis(). musparseXbsrsm_solve reports the first zero pivot (either numerical or structural zero). The zero pivot status can be checked calling musparseXbsrsm_zeroPivot(). If musparseDiagType_t == MUSPARSE_DIAG_TYPE_UNIT, no zero pivot will be reported, even if formula \{"type":"element","name":"formula","attributes":\{"id":"22"\},"children":[\{"type":"text","text":"$A_\{j,j\} = 0$"\}]\} for some formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}.
注意:The sparse BSR matrix has to be sorted.
注意:Operation type of B and X must match, if
formula \{"type":"element","name":"formula","attributes":\{"id":"78"\},"children":[\{"type":"text","text":"$op(B)=B, op(X)=X$"\}]\}.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans_A!= MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE andtrans_X!= MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.dir: matrix storage of BSR blocks.trans_A: matrix A operation type.trans_X: matrix X operation type.mb: number of block rows of the sparse BSR matrix A.nrhs: number of columns of the dense matrix op(X).nnzb: number of non-zero blocks of the sparse BSR matrix A.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr: descriptor of the sparse BSR matrix A.bsr_val: array ofnnzbblocks of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbcontaining the block column indices of the sparse BSR matrix.block_dim: block dimension of the sparse BSR matrix.info: structure that holds the information collected during the analysis step.B: rhs matrix B with leading dimensionldb.ldb: leading dimension of rhs matrix B.X: solution matrix X with leading dimensionldx.ldx: leading dimension of solution matrix X.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nrhs,nnzborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:alpha,descr,bsr_val,bsr_row_ptr,bsr_col_ind,B,Xinfoortemp_bufferpointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. ` *MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE,trans_X== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzbconst floatalpha - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infoconst floatB - muInt
ldbfloatX - muInt
ldx - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrsm_solve
MUSPARSE_EXPORT musparseStatus_t musparseDbsrsm_solve(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const double `alpha, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, const double `B, muInt ldb, double `X, muInt ldx, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzbconst doublealpha - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infoconst doubleB - muInt
ldbdoubleX - muInt
ldx - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrsm_solve
MUSPARSE_EXPORT musparseStatus_t musparseCbsrsm_solve(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const muComplex `alpha, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, const muComplex `B, muInt ldb, muComplex `X, muInt ldx, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzbconst muComplexalpha - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infoconst muComplexB - muInt
ldbmuComplexX - muInt
ldx - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrsm_solve
MUSPARSE_EXPORT musparseStatus_t musparseZbsrsm_solve(musparseHandle_t handle, musparseDirection_t dir, musparseOperation_t trans_A, musparseOperation_t trans_X, muInt mb, muInt nrhs, muInt nnzb, const muDoubleComplex `alpha, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, const muDoubleComplex `B, muInt ldb, muDoubleComplex `X, muInt ldx, musparseSolvePolicy_t policy, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - musparseOperation_t
trans_A - musparseOperation_t
trans_X - muInt
mb - muInt
nrhs - muInt
nnzbconst muDoubleComplexalpha - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infoconst muDoubleComplexB - muInt
ldbmuDoubleComplexX - muInt
ldx - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgemmi
MUSPARSE_EXPORT musparseStatus_t musparseSgemmi(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const float `alpha, const float `A, muInt lda, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const float `beta, float *C, muInt ldc)
Dense matrix sparse matrix multiplication using CSR storage format.
musparseXgemmi multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a dense formula \{"type":"element","name":"formula","attributes":\{"id":"66"\},"children":[\{"type":"text","text":"$m\n\\times k$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\} and the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, defined in CSR storage format and adds the result to the dense formula \{"type":"element","name":"formula","attributes":\{"id":"79"\},"children":[\{"type":"text","text":"$m \\times\nn$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"80"\},"children":[\{"type":"text","text":"\\[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C\n \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"81"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"70"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.trans_B: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.m: number of rows of the dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.n: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.k: number of columns of the dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.nnz: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.A: array of dimensionformula \{"type":"element","name":"formula","attributes":\{"id":"82"\},"children":[\{"type":"text","text":"$lda \\times k$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) orformula \{"type":"element","name":"formula","attributes":\{"id":"83"\},"children":[\{"type":"text","text":"$lda \\times m$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).lda: leading dimension offormula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, must be at leastformula \{"type":"element","name":"formula","attributes":\{"id":"84"\},"children":[\{"type":"text","text":"$m$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\}) orformula \{"type":"element","name":"formula","attributes":\{"id":"85"\},"children":[\{"type":"text","text":"$k$"\}]\}(formula \{"type":"element","name":"formula","attributes":\{"id":"29"\},"children":[\{"type":"text","text":"$op(A) == A^T$"\}]\}orformula \{"type":"element","name":"formula","attributes":\{"id":"30"\},"children":[\{"type":"text","text":"$op(A) == A^H$"\}]\}).descr: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array ofnnzelements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.C: array of dimensionformula \{"type":"element","name":"formula","attributes":\{"id":"54"\},"children":[\{"type":"text","text":"$ldc \\times n$"\}]\}that holds the values offormula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.ldc: leading dimension offormula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, must be at leastformula \{"type":"element","name":"formula","attributes":\{"id":"84"\},"children":[\{"type":"text","text":"$m$"\}]\}.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,k,nnz,ldaorldcis invalid.MUSPARSE_STATUS_INVALID_POINTER:alpha,A,csr_val,csr_row_ptr,csr_col_ind,betaorCpointer is invalid.
Example:
This example multiplies a dense matrix with a CSC matrix.
muInt m = 2;
muInt n = 5;
muInt k = 3;
muInt nnz = 8;
muInt lda = m;
muInt ldc = m;
// Matrix A (m x k)
// ( 9.0 10.0 11.0 )
// ( 12.0 13.0 14.0 )
// Matrix B (k x n)
// ( 1.0 2.0 0.0 3.0 0.0 )
// ( 0.0 4.0 5.0 0.0 0.0 )
// ( 6.0 0.0 0.0 7.0 8.0 )
// Matrix C (m x n)
// ( 15.0 16.0 17.0 18.0 19.0 )
// ( 20.0 21.0 22.0 23.0 24.0 )
A[lda * k] = \{9.0, 12.0, 10.0, 13.0, 11.0, 14.0\}; //
device memory csc_col_ptr_B[n + 1] = \{0, 2, 4, 5, 7, 8\}; // device memory
csc_row_ind_B[nnz] = \{0, 0, 1, 1, 2, 3, 3, 4\}; //
device memory csc_val_B[nnz] =
\{1.0, 6.0, 2.0, 4.0, 5.0, 3.0, 7.0, 8.0\}; // device memory C[ldc * n] =
\{15.0, 20.0, 16.0, 21.0, 17.0, 22.0, // device memory
18.0, 23.0, 19.0, 24.0\};
// alpha and beta
float alpha = 1.0f;
float beta = 0.0f;
// Perform the matrix multiplication
musparseSgemmi(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_TRANSPOSE,
m,
n,
k,
nnz,
&alpha,
A,
lda,
descr_B,
csc_val_B,
csc_col_ptr_B,
csc_row_ind_B,
&beta,
C,
ldc);
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst floatalphaconst floatA - muInt
lda - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst floatbetafloatC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgemmi
MUSPARSE_EXPORT musparseStatus_t musparseDgemmi(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const double `alpha, const double `A, muInt lda, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const double `beta, double *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst doublealphaconst doubleA - muInt
lda - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst doublebetadoubleC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgemmi
MUSPARSE_EXPORT musparseStatus_t musparseCgemmi(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const muComplex `alpha, const muComplex `A, muInt lda, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muComplex `beta, muComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst muComplexalphaconst muComplexA - muInt
lda - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muComplexbetamuComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgemmi
MUSPARSE_EXPORT musparseStatus_t musparseZgemmi(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, muInt nnz, const muDoubleComplex `alpha, const muDoubleComplex `A, muInt lda, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const muDoubleComplex `beta, muDoubleComplex *C, muInt ldc)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - muInt
nnzconst muDoubleComplexalphaconst muDoubleComplexA - muInt
lda - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst muDoubleComplexbetamuDoubleComplexC - muInt
ldc
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrgeam
MUSPARSE_EXPORT musparseStatus_t musparseScsrgeam(musparseHandle_t handle, muInt m, muInt n, const float `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const float `beta, const musparseMatDescr_t descr_B, muInt nnz_B, const float `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const musparseMatDescr_t descr_C, float `csr_val_C, const muInt `csr_row_ptr_C, muInt *csr_col_ind_C)
Sparse matrix sparse matrix addition using CSR storage format.
musparseXcsrgeam multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, defined in CSR storage format, multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\} with the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, defined in CSR storage format, and adds both resulting matrices to obtain the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, defined in CSR storage format, such that formula \{"type":"element","name":"formula","attributes":\{"id":"86"\},"children":[\{"type":"text","text":"\\[ C := \\alpha \\cdot A + \\beta \\cdot B. \\]"\}]\}
It is assumed that csr_row_ptr_C has already been filled and that csr_val_C and csr_col_ind_C are allocated by the user. csr_row_ptr_C and allocation size of csr_col_ind_C and csr_val_C is defined by the number of non-zero elements of the sparse CSR matrix C. Both can be obtained by musparseXcsrgeam_nnz().
注意:Both scalars
formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"87"\},"children":[\{"type":"text","text":"$beta$"\}]\}have to be valid.
注意:Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\},formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.n: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\},formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr_A: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_A: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_val_A: array ofnnz_Aelements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.descr_B: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_B: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_val_B: array ofnnz_Belements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_row_ptr_B: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_col_ind_B: array ofnnz_Belements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.descr_C: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_C: array of elements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_col_ind_C: array of elements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,nnz_Aornnz_Bis invalid.MUSPARSE_STATUS_INVALID_POINTER:alpha,descr_A,csr_val_A,csr_row_ptr_A,csr_col_ind_A,beta,descr_B,csr_val_B,csr_row_ptr_B,csr_col_ind_B,descr_C,csr_val_C,csr_row_ptr_Corcsr_col_ind_Cis```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDmusparseMatrixType_t` != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example adds two CSR matrices.
// Initialize scalar multipliers
float alpha = 1.0f;
float beta = 1.0f;
// Create matrix descriptors
musparseMatDescr_t descr_A;
musparseMatDescr_t descr_B;
musparseMatDescr_t descr_C;
musparseCreateMatDescr(&descr_A);
musparseCreateMatDescr(&descr_B);
musparseCreateMatDescr(&descr_C);
// Set pointer mode
musparseSetPointerMode(handle, MUSPARSE_POINTER_MODE_HOST);
// Obtain number of total non-zero entries in C and row pointers of C
muInt nnz_C;
musaMalloc((void``)&csr_row_ptr_C, sizeof(muInt) * (m + 1));
musparseXcsrgeam_nnz(handle,
m,
n,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
descr_C,
csr_row_ptr_C,
&nnz_C);
// Compute column indices and values of C
musaMalloc((void``)&csr_col_ind_C, sizeof(muInt) * nnz_C);
musaMalloc((void``)&csr_val_C, sizeof(float) * nnz_C);
musparseScsrgeam(handle,
m,
n,
&alpha,
descr_A,
nnz_A,
csr_val_A,
csr_row_ptr_A,
csr_col_ind_A,
&beta,
descr_B,
nnz_B,
csr_val_B,
csr_row_ptr_B,
csr_col_ind_B,
descr_C,
csr_val_C,
csr_row_ptr_C,
csr_col_ind_C);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst floatbeta - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst floatcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_B - const musparseMatDescr_t
descr_Cfloatcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrgeam
MUSPARSE_EXPORT musparseStatus_t musparseDcsrgeam(musparseHandle_t handle, muInt m, muInt n, const double `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const double `beta, const musparseMatDescr_t descr_B, muInt nnz_B, const double `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const musparseMatDescr_t descr_C, double `csr_val_C, const muInt `csr_row_ptr_C, muInt *csr_col_ind_C)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doublealpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst doublebeta - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst doublecsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_B - const musparseMatDescr_t
descr_Cdoublecsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrgeam
MUSPARSE_EXPORT musparseStatus_t musparseCcsrgeam(musparseHandle_t handle, muInt m, muInt n, const muComplex `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muComplex `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const muComplex `beta, const musparseMatDescr_t descr_B, muInt nnz_B, const muComplex `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const musparseMatDescr_t descr_C, muComplex `csr_val_C, const muInt `csr_row_ptr_C, muInt *csr_col_ind_C)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muComplexcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst muComplexbeta - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muComplexcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_B - const musparseMatDescr_t
descr_CmuComplexcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrgeam
MUSPARSE_EXPORT musparseStatus_t musparseZcsrgeam(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muDoubleComplex `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const muDoubleComplex `beta, const musparseMatDescr_t descr_B, muInt nnz_B, const muDoubleComplex `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const musparseMatDescr_t descr_C, muDoubleComplex `csr_val_C, const muInt `csr_row_ptr_C, muInt *csr_col_ind_C)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muDoubleComplexcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst muDoubleComplexbeta - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muDoubleComplexcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_B - const musparseMatDescr_t
descr_CmuDoubleComplexcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrgemm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseScsrgemm_bufferSize(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const float `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const float `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, musparseMatInfo_t info_C, size_t *buffer_size)
Sparse matrix sparse matrix multiplication using CSR storage format.
musparseXcsrgemm_bufferSize returns the size of the temporary storage buffer that is required by musparseXcsrgemm_nnz(), musparseScsrgemm(), musparseDcsrgemm(), musparseCcsrgemm() and musparseZcsrgemm(). The temporary storage buffer must be allocated by the user.
注意:Please note, that for matrix products with more than 4096 non-zero entries per row, additional temporary storage buffer is allocated by the algorithm.
注意:Please note, that for matrix products with more than 8192 intermediate products per row, additional temporary storage buffer is allocated by the algorithm.
注意:Currently, only
trans_A==trans_B== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.trans_B: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.m: number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.n: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.k: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}and number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr_A: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_A: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_row_ptr_A: array ofm+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\},k+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.descr_B: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_B: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_row_ptr_B: array ofk+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\},m+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.csr_col_ind_B: array ofnnz_Belements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.descr_D: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_D: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_row_ptr_D: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_col_ind_D: array ofnnz_Delements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.info_C: structure that holds meta data for the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.buffer_size: number of bytes of the temporary storage buffer required by musparseXcsrgemm_nnz(), musparseScsrgemm(), musparseDcsrgemm(), musparseCcsrgemm() and musparseZcsrgemm().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,k,nnz_A,nnz_Bornnz_Dis invalid.MUSPARSE_STATUS_INVALID_POINTER:alphaandbetaare invalid,descr_A,csr_row_ptr_A,csr_col_ind_A,descr_B,csr_row_ptr_Borcsr_col_ind_Bare invalid ifalphais valid,descr_D,csr_row_ptr_Dorcsr_col_ind_Dis invalid ifbetais valid,info_Corbuffer_sizeis```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A!= MUSPARSE_OPERATION_NON_TRANSPOSE,trans_B!= MUSPARSE_OPERATION_NON_TRANSPOSE, ormusparseMatrixType_t` != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst floatalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst floatbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - musparseMatInfo_t
info_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrgemm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDcsrgemm_bufferSize(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const double `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const double `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, musparseMatInfo_t info_C, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst doublealpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst doublebeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - musparseMatInfo_t
info_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrgemm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCcsrgemm_bufferSize(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const muComplex `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const muComplex `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, musparseMatInfo_t info_C, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst muComplexalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst muComplexbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - musparseMatInfo_t
info_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrgemm_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZcsrgemm_bufferSize(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const muDoubleComplex `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const muDoubleComplex `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, musparseMatInfo_t info_C, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst muDoubleComplexalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst muDoubleComplexbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - musparseMatInfo_t
info_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrgemm
MUSPARSE_EXPORT musparseStatus_t musparseScsrgemm(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const float `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const float `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const float `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const float `csr_val_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, float `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Sparse matrix sparse matrix multiplication using CSR storage format.
musparseXcsrgemm multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"90"\},"children":[\{"type":"text","text":"$m \\times k$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, defined in CSR storage format, and the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, defined in CSR storage format, and adds the result to the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}. The final result is stored in the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"31"\},"children":[\{"type":"text","text":"$m\n \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, defined in CSR storage format, such that formula \{"type":"element","name":"formula","attributes":\{"id":"91"\},"children":[\{"type":"text","text":"\\[ C :=\n \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot D, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"92"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"93"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
It is assumed that csr_row_ptr_C has already been filled and that csr_val_C and csr_col_ind_C are allocated by the user. csr_row_ptr_C and allocation size of csr_col_ind_C and csr_val_C is defined by the number of non-zero elements of the sparse CSR matrix C. Both can be obtained by musparseXcsrgemm_nnz(). The required buffer size for the computation can be obtained by musparseScsrgemm_bufferSize(), musparseDcsrgemm_bufferSize(), musparseCcsrgemm_bufferSize() and musparseZcsrgemm_bufferSize(), respectively.
注意:If
formula \{"type":"element","name":"formula","attributes":\{"id":"94"\},"children":[\{"type":"text","text":"$\\alpha == 0$"\}]\}, thenformula \{"type":"element","name":"formula","attributes":\{"id":"95"\},"children":[\{"type":"text","text":"$C = \\beta \\cdot D$"\}]\}will be computed.
注意:If
formula \{"type":"element","name":"formula","attributes":\{"id":"96"\},"children":[\{"type":"text","text":"$\\beta == 0$"\}]\}, thenformula \{"type":"element","name":"formula","attributes":\{"id":"97"\},"children":[\{"type":"text","text":"$C = \\alpha \\cdot op(A) \\cdot op(B)$"\}]\}will be computed.
注意:
formula \{"type":"element","name":"formula","attributes":\{"id":"98"\},"children":[\{"type":"text","text":"$\\alpha == beta == 0$"\}]\}is invalid.
注意:Currently, only
trans_A== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only
trans_B== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Please note, that for matrix products with more than 4096 non-zero entries per row, additional temporary storage buffer is allocated by the algorithm.
注意:This function supports unsorted CSR matrices as input, while output will be sorted. Please note that matrices B and D can only be unsorted up to 4096 non-zero entries per row. If this number is exceeded, MUSPARSE_EXPORT MUSPARSE_STATUS_REQUIRES_SORTED_STORAGE will be returned.
@param[in]
handle handle to the musparse library context queue.
@param[in]
trans_A matrix \f$A\f$ operation type.
@param[in]
trans_B matrix \f$B\f$ operation type.
@param[in]
m number of rows of the sparse CSR matrix \f$op(A)\f$ and
formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.
Parameters:
n: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.k: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}and number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr_A: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_A: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_val_A: array ofnnz_Aelements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_row_ptr_A: array ofm+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\},k+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.descr_B: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_B: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_val_B: array ofnnz_Belements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_row_ptr_B: array ofk+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\},m+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.csr_col_ind_B: array ofnnz_Belements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.descr_D: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_D: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_val_D: array ofnnz_Delements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_row_ptr_D: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_col_ind_D: array ofnnz_Delements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.descr_C: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_C: array ofnnz_Celements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_col_ind_C: array ofnnz_Celements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.info_C: structure that holds meta data for the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseScsrgemm_bufferSize(), musparseDcsrgemm_bufferSize(), musparseCcsrgemm_bufferSize() or musparseZcsrgemm_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,k,nnz_A,nnz_Bornnz_Dis invalid.MUSPARSE_STATUS_INVALID_POINTER:alphaandbetaare invalid,descr_A,csr_val_A,csr_row_ptr_A,csr_col_ind_A,descr_B,csr_val_B,csr_row_ptr_Borcsr_col_ind_Bare invalid ifalphais valid,descr_D,csr_val_D,csr_row_ptr_Dorcsr_col_ind_Dis invalid ifbetais valid,csr_val_C,csr_row_ptr_C,csr_col_ind_C,info_Cortemp_bufferis invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR additional buffer for long rows could not be allocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A!= MUSPARSE_OPERATION_NON_TRANSPOSE,trans_B!= MUSPARSE_OPERATION_NON_TRANSPOSE, ormusparseMatrixType_t!= MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example multiplies two CSR matrices with a scalar alpha and adds the result to another CSR matrix.
// Initialize scalar multipliers
float alpha = 2.0f;
float beta = 1.0f;
// Create matrix descriptors
musparseMatDescr_t descr_A;
musparseMatDescr_t descr_B;
musparseMatDescr_t descr_C;
musparseMatDescr_t descr_D;
musparseCreateMatDescr(&descr_A);
musparseCreateMatDescr(&descr_B);
musparseCreateMatDescr(&descr_C);
musparseCreateMatDescr(&descr_D);
// Create matrix info structure
musparseMatInfo_t info_C;
musparseCreateMatInfo(&info_C);
// Set pointer mode
musparseSetPointerMode(handle, MUSPARSE_POINTER_MODE_HOST);
// Query musparse for the required buffer size
size_t buffer_size;
musparseScsrgemm_bufferSize(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
&alpha,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
&beta,
descr_D,
nnz_D,
csr_row_ptr_D,
csr_col_ind_D,
info_C,
&buffer_size);
// Allocate buffer
void* buffer;
musaMalloc(&buffer, buffer_size);
// Obtain number of total non-zero entries in C and row pointers of C
muInt nnz_C;
musaMalloc((void``)&csr_row_ptr_C, sizeof(muInt) * (m + 1));
musparseXcsrgemm_nnz(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
descr_D,
nnz_D,
csr_row_ptr_D,
csr_col_ind_D,
descr_C,
csr_row_ptr_C,
&nnz_C,
info_C,
buffer);
// Compute column indices and values of C
musaMalloc((void``)&csr_col_ind_C, sizeof(muInt) * nnz_C);
musaMalloc((void``)&csr_val_C, sizeof(float) * nnz_C);
musparseScsrgemm(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
&alpha,
descr_A,
nnz_A,
csr_val_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_val_B,
csr_row_ptr_B,
csr_col_ind_B,
&beta,
descr_D,
nnz_D,
csr_val_D,
csr_row_ptr_D,
csr_col_ind_D,
descr_C,
csr_val_C,
csr_row_ptr_C,
csr_col_ind_C,
info_C,
buffer);
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst floatalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst floatcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst floatbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst floatcsr_val_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_Cfloatcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrgemm
MUSPARSE_EXPORT musparseStatus_t musparseDcsrgemm(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const double `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const double `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const double `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const double `csr_val_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, double `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst doublealpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst doublecsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst doublebeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst doublecsr_val_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_Cdoublecsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrgemm
MUSPARSE_EXPORT musparseStatus_t musparseCcsrgemm(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const muComplex `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muComplex `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muComplex `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const muComplex `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const muComplex `csr_val_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, muComplex `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst muComplexalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muComplexcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muComplexcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst muComplexbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muComplexcsr_val_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_CmuComplexcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrgemm
MUSPARSE_EXPORT musparseStatus_t musparseZcsrgemm(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const muDoubleComplex `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muDoubleComplex `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muDoubleComplex `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const muDoubleComplex `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const muDoubleComplex `csr_val_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, muDoubleComplex `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst muDoubleComplexalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muDoubleComplexcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muDoubleComplexcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst muDoubleComplexbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muDoubleComplexcsr_val_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_CmuDoubleComplexcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrgemm_symbolic
MUSPARSE_EXPORT musparseStatus_t musparseXcsrgemm_symbolic(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const musparseMatDescr_t descr_A, muInt nnz_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const musparseMatDescr_t descr_D, muInt nnz_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, muInt nnz_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Sparse matrix sparse matrix symbolic multiplication using CSR storage format.
musparseXcsrgemm_symbolic multiplies two sparsity patterns and add an extra one: formula \{"type":"element","name":"formula","attributes":\{"id":"99"\},"children":[\{"type":"text","text":"\\[ opA \\cdot op(B) + D \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"90"\},"children":[\{"type":"text","text":"$m \\times k$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, defined in CSR storage format, the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, defined in CSR storage format and the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}. The * final result is stored in the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, defined in CSR storage format, such that formula \{"type":"element","name":"formula","attributes":\{"id":"100"\},"children":[\{"type":"text","text":"\\[ C := op(A) \\cdot op(B) + D, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"81"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"70"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
It is assumed that csr_row_ptr_C has already been filled and that and csr_col_ind_C is allocated by the user. csr_row_ptr_C and allocation size of csr_col_ind_C is defined by the number of non-zero elements of the sparse CSR matrix C. Both can be obtained by musparseXcsrgemm_nnz(). The required buffer size for the computation can be obtained by musparseScsrgemm_bufferSize(), musparseDcsrgemm_bufferSize(), musparseCcsrgemm_bufferSize() and musparseZcsrgemm_bufferSize(), respectively.
注意:Currently, only
trans_A== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only
trans_B== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Please note, that for matrix products with more than 4096 non-zero entries per row, additional temporary storage buffer is allocated by the algorithm.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.trans_B: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.m: number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.n: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.k: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}and number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.descr_A: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_A: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_row_ptr_A: array ofm+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\},k+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.descr_B: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_B: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_row_ptr_B: array ofk+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\},m+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.csr_col_ind_B: array ofnnz_Belements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.descr_D: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_D: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_row_ptr_D: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_col_ind_D: array ofnnz_Delements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.descr_C: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_C: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_col_ind_C: array ofnnz_Celements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.info_C: structure that holds meta data for the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseScsrgemm_bufferSize(), musparseDcsrgemm_bufferSize(), musparseCcsrgemm_bufferSize() or musparseZcsrgemm_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,k,nnz_A,nnz_Bornnz_Dis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr_A,csr_row_ptr_A,csr_col_ind_A,descr_B,csr_row_ptr_Borcsr_col_ind_B,descr_D,csr_row_ptr_D,csr_col_ind_Dcsr_row_ptr_C,csr_col_ind_C,info_Cortemp_bufferis invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR additional buffer for long rows could not be allocated. `MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A!= MUSPARSE_OPERATION_NON_TRANSPOSE,trans_B!= MUSPARSE_OPERATION_NON_TRANSPOSE, ormusparseMatrixType_t!= MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example multiplies symbolically two CSR matrices and adds the result to another CSR matrix.
// Initialize scalar multipliers
float alpha = 2.0f;
float beta = 1.0f;
// Create matrix descriptors
musparseMatDescr_t descr_A;
musparseMatDescr_t descr_B;
musparseMatDescr_t descr_C;
musparseMatDescr_t descr_D;
musparseCreateMatDescr(&descr_A);
musparseCreateMatDescr(&descr_B);
musparseCreateMatDescr(&descr_C);
musparseCreateMatDescr(&descr_D);
// Create matrix info structure
musparseMatInfo_t info_C;
musparseCreateMatInfo(&info_C);
// Set pointer mode
musparseSetPointerMode(handle, MUSPARSE_POINTER_MODE_HOST);
// Query musparse for the required buffer size
size_t buffer_size;
musparseScsrgemm_bufferSize(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
&alpha,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
&beta,
descr_D,
nnz_D,
csr_row_ptr_D,
csr_col_ind_D,
info_C,
&buffer_size);
// Allocate buffer
void* buffer;
musaMalloc(&buffer, buffer_size);
// Obtain number of total non-zero entries in C and row pointers of C
muInt nnz_C;
musaMalloc((void``)&csr_row_ptr_C, sizeof(muInt) * (m + 1));
musparseXcsrgemm_nnz(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
descr_D,
nnz_D,
csr_row_ptr_D,
csr_col_ind_D,
descr_C,
csr_row_ptr_C,
&nnz_C,
info_C,
buffer);
// Compute column indices of C
musaMalloc((void``)&csr_col_ind_C, sizeof(muInt) * nnz_C);
musparseXcsrgemm_symbolic(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
descr_D,
nnz_D,
csr_row_ptr_D,
csr_col_ind_D,
descr_C,
nnz_C,
csr_row_ptr_C,
csr_col_ind_C,
info_C,
buffer);
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_B - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_C - muInt
nnz_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrgemm_numeric
MUSPARSE_EXPORT musparseStatus_t musparseScsrgemm_numeric(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const float `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const float `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const float `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const float `csr_val_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, muInt nnz_C, float `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Sparse matrix sparse matrix numeric multiplication using CSR storage format.
musparseXcsrgemm_numeric multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"90"\},"children":[\{"type":"text","text":"$m \\times k$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, defined in CSR storage format, and the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, defined in CSR storage format, and adds the result to the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}. The final result is stored in the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"25"\},"children":[\{"type":"text","text":"$m\n\\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, predefined in CSR storage format, such that formula \{"type":"element","name":"formula","attributes":\{"id":"101"\},"children":[\{"type":"text","text":"\\[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot D,\n \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"81"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"70"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
The symbolic part of the csr matrix C can be obtained by musparseXcsrgemm_symbolic(). It is assumed that csr_row_ptr_C and csr_col_ind_C have already been filled and that csr_val_C is allocated by the user. csr_row_ptr_C and allocation size of csr_col_ind_C and csr_val_C is defined by the number of non-zero elements of the sparse CSR matrix C. Both can be obtained by musparseXcsrgemm_nnz(). The required buffer size for the computation can be obtained by musparseScsrgemm_bufferSize(), musparseDcsrgemm_bufferSize(), musparseCcsrgemm_bufferSize() and musparseZcsrgemm_bufferSize(), respectively.
注意:If
formula \{"type":"element","name":"formula","attributes":\{"id":"94"\},"children":[\{"type":"text","text":"$\\alpha == 0$"\}]\}, thenformula \{"type":"element","name":"formula","attributes":\{"id":"95"\},"children":[\{"type":"text","text":"$C = \\beta \\cdot D$"\}]\}will be computed.
注意:If
formula \{"type":"element","name":"formula","attributes":\{"id":"96"\},"children":[\{"type":"text","text":"$\\beta == 0$"\}]\}, thenformula \{"type":"element","name":"formula","attributes":\{"id":"97"\},"children":[\{"type":"text","text":"$C = \\alpha \\cdot op(A) \\cdot op(B)$"\}]\}will be computed.
注意:
formula \{"type":"element","name":"formula","attributes":\{"id":"98"\},"children":[\{"type":"text","text":"$\\alpha == beta == 0$"\}]\}is invalid.
注意:Currently, only
trans_A== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only
trans_B== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Please note, that for matrix products with more than 4096 non-zero entries per row, additional temporary storage buffer is allocated by the algorithm.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.trans_B: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.m: number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.n: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.k: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}and number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.descr_A: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_A: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_val_A: array ofnnz_Aelements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_row_ptr_A: array ofm+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\},k+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.descr_B: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_B: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_val_B: array ofnnz_Belements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_row_ptr_B: array ofk+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\},m+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.csr_col_ind_B: array ofnnz_Belements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.descr_D: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_D: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_val_D: array ofnnz_Delements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_row_ptr_D: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_col_ind_D: array ofnnz_Delements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.descr_C: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_C: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_val_C: array ofnnz_Celements of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.csr_col_ind_C: array ofnnz_Celements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.info_C: structure that holds meta data for the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseScsrgemm_bufferSize(), musparseDcsrgemm_bufferSize(), musparseCcsrgemm_bufferSize() or musparseZcsrgemm_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,k,nnz_A,nnz_Bornnz_Dis invalid.MUSPARSE_STATUS_INVALID_POINTER:alphaandbetaare invalid,descr_A,csr_val_A,csr_row_ptr_A,csr_col_ind_A,descr_B,csr_val_B,csr_row_ptr_Borcsr_col_ind_Bare invalid ifalphais valid,descr_D,csr_val_D,csr_row_ptr_Dorcsr_col_ind_Dis invalid ifbetais valid,csr_val_C,csr_row_ptr_C,csr_col_ind_C,info_Cortemp_bufferis invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR additional buffer for long rows could not be allocated. `MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A!= MUSPARSE_OPERATION_NON_TRANSPOSE,trans_B!= MUSPARSE_OPERATION_NON_TRANSPOSE, ormusparseMatrixType_t!= MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example multiplies two CSR matrices with a scalar alpha and adds the result to another CSR matrix.
// Initialize scalar multipliers
float alpha = 2.0f;
float beta = 1.0f;
// Create matrix descriptors
musparseMatDescr_t descr_A;
musparseMatDescr_t descr_B;
musparseMatDescr_t descr_C;
musparseMatDescr_t descr_D;
musparseCreateMatDescr(&descr_A);
musparseCreateMatDescr(&descr_B);
musparseCreateMatDescr(&descr_C);
musparseCreateMatDescr(&descr_D);
// Create matrix info structure
musparseMatInfo_t info_C;
musparseCreateMatInfo(&info_C);
// Set pointer mode
musparseSetPointerMode(handle, MUSPARSE_POINTER_MODE_HOST);
// Query musparse for the required buffer size
size_t buffer_size;
musparseScsrgemm_bufferSize(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
&alpha,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
&beta,
descr_D,
nnz_D,
csr_row_ptr_D,
csr_col_ind_D,
info_C,
&buffer_size);
// Allocate buffer
void* buffer;
musaMalloc(&buffer, buffer_size);
// Obtain number of total non-zero entries in C and row pointers of C
muInt nnz_C;
musaMalloc((void``)&csr_row_ptr_C, sizeof(muInt) * (m + 1));
musparseXcsrgemm_nnz(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
descr_D,
nnz_D,
csr_row_ptr_D,
csr_col_ind_D,
descr_C,
csr_row_ptr_C,
&nnz_C,
info_C,
buffer);
// Compute column indices and values of C
musaMalloc((void``)&csr_col_ind_C, sizeof(muInt) * nnz_C);
musparseXcsrgemm_symbolic(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
descr_A,
nnz_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_row_ptr_B,
csr_col_ind_B,
descr_D,
nnz_D,
csr_row_ptr_D,
csr_col_ind_D,
descr_C,
nnz_C,
csr_row_ptr_C,
csr_col_ind_C,
info_C,
buffer);
musaMalloc((void``)&csr_val_C, sizeof(float) * nnz_C);
musparseScsrgemm_numeric(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
n,
k,
&alpha,
descr_A,
nnz_A,
csr_val_A,
csr_row_ptr_A,
csr_col_ind_A,
descr_B,
nnz_B,
csr_val_B,
csr_row_ptr_B,
csr_col_ind_B,
&beta,
descr_D,
nnz_D,
csr_val_D,
csr_row_ptr_D,
csr_col_ind_D,
descr_C,
nnz_C,
csr_val_C,
csr_row_ptr_C,
csr_col_ind_C,
info_C,
buffer);
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst floatalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst floatcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst floatbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst floatcsr_val_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_C - muInt
nnz_Cfloatcsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrgemm_numeric
MUSPARSE_EXPORT musparseStatus_t musparseDcsrgemm_numeric(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const double `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const double `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const double `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const double `csr_val_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, muInt nnz_C, double `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst doublealpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst doublecsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst doublebeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst doublecsr_val_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_C - muInt
nnz_Cdoublecsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrgemm_numeric
MUSPARSE_EXPORT musparseStatus_t musparseCcsrgemm_numeric(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const muComplex `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muComplex `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muComplex `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const muComplex `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const muComplex `csr_val_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, muInt nnz_C, muComplex `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst muComplexalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muComplexcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muComplexcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst muComplexbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muComplexcsr_val_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_C - muInt
nnz_CmuComplexcsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrgemm_numeric
MUSPARSE_EXPORT musparseStatus_t musparseZcsrgemm_numeric(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const muDoubleComplex `alpha, const musparseMatDescr_t descr_A, muInt nnz_A, const muDoubleComplex `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muDoubleComplex `csr_val_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const muDoubleComplex `beta, const musparseMatDescr_t descr_D, muInt nnz_D, const muDoubleComplex `csr_val_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, muInt nnz_C, muDoubleComplex `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, const musparseMatInfo_t info_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
kconst muDoubleComplexalpha - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muDoubleComplexcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muDoubleComplexcsr_val_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_Bconst muDoubleComplexbeta - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muDoubleComplexcsr_val_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_C - muInt
nnz_CmuDoubleComplexcsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsric0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSbsric0_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsric0_bufferSize returns the size of the temporary storage buffer that is required by musparseSbsric0_analysis(), musparseDbsric0_analysis(), musparseCbsric0_analysis(), musparseZbsric0_analysis(), musparseSbsric0(), musparseDbsric0(), musparseSbsric0() and musparseDbsric0(). The temporary storage buffer must be allocated by the user. The size of the temporary storage buffer is identical to the size returned by musparseSbsrsv_bufferSize(), musparseDbsrsv_bufferSize(), musparseCbsrsv_bufferSize(), musparseZbsrsv_bufferSize(), musparseSbsrilu0_bufferSize(), musparseDbsrilu0_bufferSize(), musparseCbsrilu0_bufferSize() and musparseZbsrilu0_bufferSize() if the matrix sparsity pattern is identical. The user allocated buffer can thus be shared between subsequent calls to those functions.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specifies whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.mb: number of block rows in the sparse BSR matrix.nnzb: number of non-zero block entries of the sparse BSR matrix.descr: descriptor of the sparse BSR matrix.bsr_val: array of lengthnnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: the block dimension of the BSR matrix. Between 1 and m wherem=mb*block_dim.info: structure that holds the information collected during the analysis step.buffer_size: number of bytes of the temporary storage buffer required by musparseSbsric0_analysis(), musparseDbsric0_analysis(), musparseCbsric0_analysis(), musparseZbsric0_analysis(), musparseSbsric0(), musparseDbsric0(), musparseCbsric0() and musparseZbsric0().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzb, orblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptr,bsr_col_ind,infoorbuffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsric0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDbsric0_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsric0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCbsric0_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsric0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZbsric0_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsric0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSbsric0_analysis(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsric0_analysis performs the analysis step for musparseSbsric0() musparseDbsric0(), musparseCbsric0(), and musparseZbsric0(). It is expected that this function will be executed only once for a given matrix and particular operation type. The analysis meta data can be cleared by musparseXbsric0_clear().
musparseXbsric0_analysis can share its meta data with musparseSbsrilu0_analysis(), musparseDbsrilu0_analysis(), musparseCbsrilu0_analysis(), musparseZbsrilu0_analysis(), musparseSbsrsv_analysis(), musparseDbsrsv_analysis(), musparseCbsrsv_analysis(), musparseZbsrsv_analysis(), musparseSbsrsm_analysis(), musparseDbsrsm_analysis(), musparseCbsrsm_analysis() and musparseZbsrsm_analysis(). Selecting MUSPARSE_ANALYSIS_POLICY_REUSE policy can greatly improve computation performance of meta data. However, the user need to make sure that the sparsity pattern remains unchanged. If this cannot be assured, MUSPARSE_ANALYSIS_POLICY_FORCE has to be used.
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specified whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.mb: number of block rows in the sparse BSR matrix.nnzb: number of non-zero block entries of the sparse BSR matrix.descr: descriptor of the sparse BSR matrix.bsr_val: array of lengthnnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: the block dimension of the BSR matrix. Between 1 and m wherem=mb*block_dim.info: structure that holds the information collected during the analysis step.analysis: MUSPARSE_ANALYSIS_POLICY_REUSE or MUSPARSE_ANALYSIS_POLICY_FORCE.solve: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzb, orblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptr,bsr_col_ind,infoortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsric0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDbsric0_analysis(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsric0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCbsric0_analysis(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsric0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZbsric0_analysis(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsric0
MUSPARSE_EXPORT musparseStatus_t musparseSbsric0(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsric0 computes the incomplete Cholesky factorization with 0 fill-ins and no pivoting of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"102"\},"children":[\{"type":"text","text":"$mb \\times mb$"\}]\} BSR matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"103"\},"children":[\{"type":"text","text":"\\[ A \\approx LL^T \\]"\}]\}
musparseXbsric0 requires a user allocated temporary buffer. Its size is returned by musparseSbsric0_bufferSize(), musparseDbsric0_bufferSize(), musparseCbsric0_bufferSize() or musparseZbsric0_bufferSize(). Furthermore, analysis meta data is required. It can be obtained by musparseSbsric0_analysis(), musparseDbsric0_analysis(), musparseCbsric0_analysis() or musparseZbsric0_analysis(). musparseXbsric0 reports the first zero pivot (either numerical or structural zero). The zero pivot status can be obtained by calling musparseXbsric0_zeroPivot().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specified whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.mb: number of block rows in the sparse BSR matrix.nnzb: number of non-zero block entries of the sparse BSR matrix.descr: descriptor of the sparse BSR matrix.bsr_val: array of lengthnnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: the block dimension of the BSR matrix. Between 1 and m wherem=mb*block_dim.info: structure that holds the information collected during the analysis step.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzb, orblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptrorbsr_col_indpointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. ` *MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
Consider the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, stored in BSR storage format. The following example computes the incomplete Cholesky factorization formula \{"type":"element","name":"formula","attributes":\{"id":"104"\},"children":[\{"type":"text","text":"$M \\approx LL^T$"\}]\} and solves the preconditioned system formula \{"type":"element","name":"formula","attributes":\{"id":"105"\},"children":[\{"type":"text","text":"$My\n = x$"\}]\}.
// Create musparse handle
musparseHandle_t handle;
musparseCreate(&handle);
// Create matrix descriptor for M
musparseMatDescr_t descr_M;
musparseCreateMatDescr(&descr_M);
// Create matrix descriptor for L
musparseMatDescr_t descr_L;
musparseCreateMatDescr(&descr_L);
musparseSetMatFillMode(descr_L, MUSPARSE_FILL_MODE_LOWER);
musparseSetMatDiagType(descr_L, MUSPARSE_DIAG_TYPE_UNIT);
// Create matrix descriptor for L'
musparseMatDescr_t descr_Lt;
musparseCreateMatDescr(&descr_Lt);
musparseSetMatFillMode(descr_Lt, MUSPARSE_FILL_MODE_UPPER);
musparseSetMatDiagType(descr_Lt, MUSPARSE_DIAG_TYPE_NON_UNIT);
// Create matrix info structure
musparseMatInfo_t info;
musparseCreateMatInfo(&info);
// Obtain required buffer size
size_t buffer_size_M;
size_t buffer_size_L;
size_t buffer_size_Lt;
musparseDbsric0_bufferSize(handle,
MUSPARSE_DIRECTION_ROW,
mb,
nnzb,
descr_M,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
&buffer_size_M);
musparseDbsrsv_bufferSize(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
descr_L,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
&buffer_size_L);
musparseDbsrsv_bufferSize(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_TRANSPOSE,
mb,
nnzb,
descr_Lt,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
&buffer_size_Lt);
size_t buffer_size = max(buffer_size_M, max(buffer_size_L,
buffer_size_Lt));
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
// Perform analysis steps, using MUSPARSE_ANALYSIS_POLICY_REUSE to
improve
// computation performance
musparseDbsric0_analysis(handle,
MUSPARSE_DIRECTION_ROW,
mb,
nnzb,
descr_M,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
musparseDbsrsv_analysis(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
descr_L,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
musparseDbsrsv_analysis(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_TRANSPOSE,
mb,
nnzb,
descr_Lt,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Check for zero pivot
muInt position;
if(MUSPARSE_EXPORT
MUSPARSE_STATUS_ZERO_PIVOT == musparseXbsric0_zeroPivot(handle,
info,
&position))
\{
printf("A has structural zero at A(%d,%d)\n", position, position);
\}
// Compute incomplete Cholesky factorization M = LL'
musparseDbsric0(handle,
MUSPARSE_DIRECTION_ROW,
mb,
nnzb,
descr_M,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Check for zero pivot
if(MUSPARSE_EXPORT
MUSPARSE_STATUS_ZERO_PIVOT == musparseXbsric0_zeroPivot(handle,
info,
&position))
\{
printf("L has structural and/or numerical zero at L(%d,%d)\n",
position,
position);
\}
// Solve Lz = x
musparseDbsrsv_solve(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
&alpha,
descr_L,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
x,
z,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Solve L'y = z
musparseDbsrsv_solve(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_TRANSPOSE,
mb,
nnzb,
&alpha,
descr_Lt,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
z,
y,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Clean up
musaFree(temp_buffer);
musparseDestroyMatInfo(info);
musparseDestroyMatDescr(descr_M);
musparseDestroyMatDescr(descr_L);
musparseDestroyMatDescr(descr_Lt);
musparseDestroy(handle);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrfloatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsric0
MUSPARSE_EXPORT musparseStatus_t musparseDbsric0(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrdoublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsric0
MUSPARSE_EXPORT musparseStatus_t musparseCbsric0(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrmuComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsric0
MUSPARSE_EXPORT musparseStatus_t musparseZbsric0(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrmuDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const float `boost_tol, const float `boost_val)
Incomplete LU factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsrilu0_numericBoost enables the user to replace a numerical value in an incomplete LU factorization. tol is used to determine whether a numerical value is replaced by boost_val, such that formula \{"type":"element","name":"formula","attributes":\{"id":"107"\},"children":[\{"type":"text","text":"$A_\{j,j\} =\n\\text\{boost_val\}$"\}]\} if formula \{"type":"element","name":"formula","attributes":\{"id":"108"\},"children":[\{"type":"text","text":"$\\text\{tol\} \\ge \\left|A_\{j,j\}\\right|$"\}]\}.
注意:The boost value is enabled by setting
enable_boostto 1 or disabled by settingenable_boostto 0.
注意:
tolandboost_valcan be in host or device memory.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.enable_boost: enable/disable numeric boost.boost_tol: tolerance to determine whether a numerical value is replaced or not.boost_val: boost value to replace a numerical value.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:info,tolorboost_valpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst floatboost_tolconst floatboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const double `boost_tol, const double `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst doubleboost_tolconst doubleboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const float `boost_tol, const muComplex `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst floatboost_tolconst muComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const double `boost_tol, const muDoubleComplex `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst doubleboost_tolconst muDoubleComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDSbsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseDSbsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const double `boost_tol, const float `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst doubleboost_tolconst floatboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDCbsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseDCbsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const double `boost_tol, const muComplex `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst doubleboost_tolconst muComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu0_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Incomplete LU factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsrilu0_bufferSize returns the size of the temporary storage buffer that is required by musparseSbsrilu0_analysis(), musparseDbsrilu0_analysis(), musparseCbsrilu0_analysis(), musparseZbsrilu0_analysis(), musparseSbsrilu0(), musparseDbsrilu0(), musparseSbsrilu0() and musparseDbsrilu0(). The temporary storage buffer must be allocated by the user. The size of the temporary storage buffer is identical to the size returned by musparseSbsrsv_bufferSize(), musparseDbsrsv_bufferSize(), musparseCbsrsv_bufferSize(), musparseZbsrsv_bufferSize(), musparseSbsric0_bufferSize(), musparseDbsric0_bufferSize(), musparseCbsric0_bufferSize() and musparseZbsric0_bufferSize() if the matrix sparsity pattern is identical. The user allocated buffer can thus be shared between subsequent calls to those functions.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specifies whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.mb: number of block rows in the sparse BSR matrix.nnzb: number of non-zero block entries of the sparse BSR matrix.descr: descriptor of the sparse BSR matrix.bsr_val: array of lengthnnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: the block dimension of the BSR matrix. Between 1 and m wherem=mb*block_dim.info: structure that holds the information collected during the analysis step.buffer_size: number of bytes of the temporary storage buffer required by musparseSbsrilu0_analysis(), musparseDbsrilu0_analysis(), musparseCbsrilu0_analysis(), musparseZbsrilu0_analysis(), musparseSbsrilu0(), musparseDbsrilu0(), musparseCbsrilu0() and musparseZbsrilu0().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzb, orblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptr,bsr_col_ind,infoorbuffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu0_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu0_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu0_bufferSize(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu0_analysis(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Incomplete LU factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsrilu0_analysis performs the analysis step for musparseSbsrilu0() musparseDbsrilu0(), musparseCbsrilu0(), and musparseZbsrilu0(). It is expected that this function will be executed only once for a given matrix. The analysis meta data can be cleared by musparseXbsrilu0_clear().
musparseXbsrilu0_analysis can share its meta data with musparseSbsric0_analysis(), musparseDbsric0_analysis(), musparseCbsric0_analysis(), musparseZbsric0_analysis(), musparseSbsrsv_analysis(), musparseDbsrsv_analysis(), musparseCbsrsv_analysis(), musparseZbsrsv_analysis(), musparseSbsrsm_analysis(), musparseDbsrsm_analysis(), musparseCbsrsm_analysis() and musparseZbsrsm_analysis(). Selecting MUSPARSE_ANALYSIS_POLICY_REUSE policy can greatly improve computation performance of meta data. However, the user need to make sure that the sparsity pattern remains unchanged. If this cannot be assured, MUSPARSE_ANALYSIS_POLICY_FORCE has to be used.
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specified whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.mb: number of block rows in the sparse BSR matrix.nnzb: number of non-zero block entries of the sparse BSR matrix.descr: descriptor of the sparse BSR matrix.bsr_val: array of lengthnnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: the block dimension of the BSR matrix. Between 1 and m wherem=mb*block_dim.info: structure that holds the information collected during the analysis step.analysis: MUSPARSE_ANALYSIS_POLICY_REUSE or MUSPARSE_ANALYSIS_POLICY_FORCE.solve: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzb, orblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptr,bsr_col_ind,infoortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu0_analysis(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu0_analysis(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu0_analysis(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsrilu0
MUSPARSE_EXPORT musparseStatus_t musparseSbsrilu0(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Incomplete LU factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsrilu0 computes the incomplete LU factorization with 0 fill-ins and no pivoting of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"102"\},"children":[\{"type":"text","text":"$mb \\times mb$"\}]\} BSR matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"109"\},"children":[\{"type":"text","text":"\\[ A \\approx LU \\]"\}]\}
musparseXbsrilu0 requires a user allocated temporary buffer. Its size is returned by musparseSbsrilu0_bufferSize(), musparseDbsrilu0_bufferSize(), musparseCbsrilu0_bufferSize() or musparseZbsrilu0_bufferSize(). Furthermore, analysis meta data is required. It can be obtained by musparseSbsrilu0_analysis(), musparseDbsrilu0_analysis(), musparseCbsrilu0_analysis() or musparseZbsrilu0_analysis(). musparseXbsrilu0 reports the first zero pivot (either numerical or structural zero). The zero pivot status can be obtained by calling musparseXbsrilu0_zeroPivot().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specified whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.mb: number of block rows in the sparse BSR matrix.nnzb: number of non-zero block entries of the sparse BSR matrix.descr: descriptor of the sparse BSR matrix.bsr_val: array of lengthnnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: the block dimension of the BSR matrix. Between 1 and m wherem=mb*block_dim.info: structure that holds the information collected during the analysis step.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nnzb, orblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,bsr_val,bsr_row_ptrorbsr_col_indpointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. ` *MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
Consider the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, stored in BSR storage format. The following example computes the incomplete LU factorization formula \{"type":"element","name":"formula","attributes":\{"id":"110"\},"children":[\{"type":"text","text":"$M \\approx LU$"\}]\} and solves the preconditioned system formula \{"type":"element","name":"formula","attributes":\{"id":"111"\},"children":[\{"type":"text","text":"$My =\n x$"\}]\}.
// Create musparse handle
musparseHandle_t handle;
musparseCreate(&handle);
// Create matrix descriptor for M
musparseMatDescr_t descr_M;
musparseCreateMatDescr(&descr_M);
// Create matrix descriptor for L
musparseMatDescr_t descr_L;
musparseCreateMatDescr(&descr_L);
musparseSetMatFillMode(descr_L, MUSPARSE_FILL_MODE_LOWER);
musparseSetMatDiagType(descr_L, MUSPARSE_DIAG_TYPE_UNIT);
// Create matrix descriptor for U
musparseMatDescr_t descr_U;
musparseCreateMatDescr(&descr_U);
musparseSetMatFillMode(descr_U, MUSPARSE_FILL_MODE_UPPER);
musparseSetMatDiagType(descr_U, MUSPARSE_DIAG_TYPE_NON_UNIT);
// Create matrix info structure
musparseMatInfo_t info;
musparseCreateMatInfo(&info);
// Obtain required buffer size
size_t buffer_size_M;
size_t buffer_size_L;
size_t buffer_size_U;
musparseDbsrilu0_bufferSize(handle,
MUSPARSE_DIRECTION_ROW,
mb,
nnzb,
descr_M,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
&buffer_size_M);
musparseDbsrsv_bufferSize(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
descr_L,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
&buffer_size_L);
musparseDbsrsv_bufferSize(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_TRANSPOSE,
mb,
nnzb,
descr_U,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
&buffer_size_U);
size_t buffer_size = max(buffer_size_M, max(buffer_size_L,
buffer_size_U));
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
// Perform analysis steps, using MUSPARSE_ANALYSIS_POLICY_REUSE to
improve
// computation performance
musparseDbsrilu0_analysis(handle,
MUSPARSE_DIRECTION_ROW,
mb,
nnzb,
descr_M,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
musparseDbsrsv_analysis(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
descr_L,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
musparseDbsrsv_analysis(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_TRANSPOSE,
mb,
nnzb,
descr_U,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Check for zero pivot
muInt position;
if(MUSPARSE_EXPORT
MUSPARSE_STATUS_ZERO_PIVOT == musparseXbsrilu0_zeroPivot(handle,
info,
&position))
\{
printf("A has structural zero at A(%d,%d)\n", position, position);
\}
// Compute incomplete LU factorization M = LU
musparseDbsrilu0(handle,
MUSPARSE_DIRECTION_ROW,
mb,
nnzb,
descr_M,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Check for zero pivot
if(MUSPARSE_EXPORT
MUSPARSE_STATUS_ZERO_PIVOT == musparseXbsrilu0_zeroPivot(handle,
info,
&position))
\{
printf("L has structural and/or numerical zero at L(%d,%d)\n",
position,
position);
\}
// Solve Lz = x
musparseDbsrsv_solve(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_NON_TRANSPOSE,
mb,
nnzb,
&alpha,
descr_L,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
x,
z,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Solve Uy = z
musparseDbsrsv_solve(handle,
MUSPARSE_DIRECTION_ROW,
MUSPARSE_OPERATION_TRANSPOSE,
mb,
nnzb,
&alpha,
descr_U,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
info,
z,
y,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Clean up
musaFree(temp_buffer);
musparseDestroyMatInfo(info);
musparseDestroyMatDescr(descr_M);
musparseDestroyMatDescr(descr_L);
musparseDestroyMatDescr(descr_U);
musparseDestroy(handle);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrfloatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsrilu0
MUSPARSE_EXPORT musparseStatus_t musparseDbsrilu0(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrdoublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsrilu0
MUSPARSE_EXPORT musparseStatus_t musparseCbsrilu0(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrmuComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsrilu0
MUSPARSE_EXPORT musparseStatus_t musparseZbsrilu0(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nnzb, const musparseMatDescr_t descr, muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nnzb - const musparseMatDescr_t
descrmuDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsric0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseScsric0_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsric0_bufferSize returns the size of the temporary storage buffer that is required by musparseScsric0_analysis(), musparseDcsric0_analysis(), musparseScsric0() and musparseDcsric0(). The temporary storage buffer must be allocated by the user. The size of the temporary storage buffer is identical to the size returned by musparseScsrsv_bufferSize(), musparseDcsrsv_bufferSize(), musparseScsrilu0_bufferSize() and musparseDcsrilu0_bufferSize() if the matrix sparsity pattern is identical. The user allocated buffer can thus be shared between subsequent calls to those functions.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.buffer_size: number of bytes of the temporary storage buffer required by musparseScsric0_analysis(), musparseDcsric0_analysis(), musparseScsric0() and musparseDcsric0().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_val, csr_row_ptr, csr_col_ind, info or buffer_size pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsric0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDcsric0_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsric0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCcsric0_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsric0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZcsric0_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsric0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseScsric0_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsric0_analysis performs the analysis step for musparseScsric0() and musparseDcsric0(). It is expected that this function will be executed only once for a given matrix and particular operation type. The analysis meta data can be cleared by musparseXcsric0_clear().
musparseXcsric0_analysis can share its meta data with musparseScsrilu0_analysis(), musparseDcsrilu0_analysis(), musparseCcsrilu0_analysis(), musparseZcsrilu0_analysis(), musparseScsrsv_analysis(), musparseDcsrsv_analysis(), musparseCcsrsv_analysis(), musparseZcsrsv_analysis(), musparseScsrsm_analysis(), musparseDcsrsm_analysis(), musparseScsrsm_analysis() and musparseDcsrsm_analysis(). Selecting MUSPARSE_ANALYSIS_POLICY_REUSE policy can greatly improve computation performance of meta data. However, the user need to make sure that the sparsity pattern remains unchanged. If this cannot be assured, MUSPARSE_ANALYSIS_POLICY_FORCE has to be used.
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.analysis: MUSPARSE_ANALYSIS_POLICY_REUSE or MUSPARSE_ANALYSIS_POLICY_FORCE.solve: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_val, csr_row_ptr, csr_col_ind, info or temp_buffer pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsric0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDcsric0_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsric0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCcsric0_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsric0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZcsric0_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsric0
MUSPARSE_EXPORT musparseStatus_t musparseScsric0(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsric0 computes the incomplete Cholesky factorization with 0 fill-ins and no pivoting of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} CSR matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"103"\},"children":[\{"type":"text","text":"\\[ A \\approx LL^T \\]"\}]\}
musparseXcsric0 requires a user allocated temporary buffer. Its size is returned by musparseScsric0_bufferSize() or musparseDcsric0_bufferSize(). Furthermore, analysis meta data is required. It can be obtained by musparseScsric0_analysis() or musparseDcsric0_analysis(). musparseXcsric0 reports the first zero pivot (either numerical or structural zero). The zero pivot status can be obtained by calling musparseXcsric0_zeroPivot().
注意:The sparse CSR matrix has to be sorted. This can be achieved by calling musparseXcsrsort().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_val, csr_row_ptr or csr_col_ind pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. ` *MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
Consider the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, stored in CSR storage format. The following example computes the incomplete Cholesky factorization formula \{"type":"element","name":"formula","attributes":\{"id":"104"\},"children":[\{"type":"text","text":"$M \\approx LL^T$"\}]\} and solves the preconditioned system formula \{"type":"element","name":"formula","attributes":\{"id":"105"\},"children":[\{"type":"text","text":"$My\n = x$"\}]\}.
// Create musparse handle
musparseHandle_t handle;
musparseCreate(&handle);
// Create matrix descriptor for M
musparseMatDescr_t descr_M;
musparseCreateMatDescr(&descr_M);
// Create matrix descriptor for L
musparseMatDescr_t descr_L;
musparseCreateMatDescr(&descr_L);
musparseSetMatFillMode(descr_L, MUSPARSE_FILL_MODE_LOWER);
musparseSetMatDiagType(descr_L, MUSPARSE_DIAG_TYPE_UNIT);
// Create matrix descriptor for L'
musparseMatDescr_t descr_Lt;
musparseCreateMatDescr(&descr_Lt);
musparseSetMatFillMode(descr_Lt, MUSPARSE_FILL_MODE_UPPER);
musparseSetMatDiagType(descr_Lt, MUSPARSE_DIAG_TYPE_NON_UNIT);
// Create matrix info structure
musparseMatInfo_t info;
musparseCreateMatInfo(&info);
// Obtain required buffer size
size_t buffer_size_M;
size_t buffer_size_L;
size_t buffer_size_Lt;
musparseDcsric0_bufferSize(handle,
m,
nnz,
descr_M,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
&buffer_size_M);
musparseDcsrsv_bufferSize(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
descr_L,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
&buffer_size_L);
musparseDcsrsv_bufferSize(handle,
MUSPARSE_OPERATION_TRANSPOSE,
m,
nnz,
descr_Lt,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
&buffer_size_Lt);
size_t buffer_size = max(buffer_size_M, max(buffer_size_L,
buffer_size_Lt));
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
// Perform analysis steps, using MUSPARSE_ANALYSIS_POLICY_REUSE to
improve
// computation performance
musparseDcsric0_analysis(handle,
m,
nnz,
descr_M,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
musparseDcsrsv_analysis(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
descr_L,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
musparseDcsrsv_analysis(handle,
MUSPARSE_OPERATION_TRANSPOSE,
m,
nnz,
descr_Lt,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Check for zero pivot
muInt position;
if(MUSPARSE_EXPORT
MUSPARSE_STATUS_ZERO_PIVOT == musparseXcsric0_zeroPivot(handle,
info,
&position))
\{
printf("A has structural zero at A(%d,%d)\n", position, position);
\}
// Compute incomplete Cholesky factorization M = LL'
musparseDcsric0(handle,
m,
nnz,
descr_M,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Check for zero pivot
if(MUSPARSE_EXPORT
MUSPARSE_STATUS_ZERO_PIVOT == musparseXcsric0_zeroPivot(handle,
info,
&position))
\{
printf("L has structural and/or numerical zero at L(%d,%d)\n",
position,
position);
\}
// Solve Lz = x
musparseDcsrsv_solve(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
&alpha,
descr_L,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
x,
z,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Solve L'y = z
musparseDcsrsv_solve(handle,
MUSPARSE_OPERATION_TRANSPOSE,
m,
nnz,
&alpha,
descr_Lt,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
z,
y,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Clean up
musaFree(temp_buffer);
musparseDestroyMatInfo(info);
musparseDestroyMatDescr(descr_M);
musparseDestroyMatDescr(descr_L);
musparseDestroyMatDescr(descr_Lt);
musparseDestroy(handle);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrfloatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsric0
MUSPARSE_EXPORT musparseStatus_t musparseDcsric0(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrdoublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsric0
MUSPARSE_EXPORT musparseStatus_t musparseCcsric0(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrmuComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsric0
MUSPARSE_EXPORT musparseStatus_t musparseZcsric0(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrmuDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseScsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const float `boost_tol, const float `boost_val)
Incomplete LU factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsrilu0_numericBoost enables the user to replace a numerical value in an incomplete LU factorization. tol is used to determine whether a numerical value is replaced by boost_val, such that formula \{"type":"element","name":"formula","attributes":\{"id":"107"\},"children":[\{"type":"text","text":"$A_\{j,j\} =\n\\text\{boost_val\}$"\}]\} if formula \{"type":"element","name":"formula","attributes":\{"id":"108"\},"children":[\{"type":"text","text":"$\\text\{tol\} \\ge \\left|A_\{j,j\}\\right|$"\}]\}.
注意:The boost value is enabled by setting
enable_boostto 1 or disabled by settingenable_boostto 0.
注意:
tolandboost_valcan be in host or device memory.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.enable_boost: enable/disable numeric boost.boost_tol: tolerance to determine whether a numerical value is replaced or not.boost_val: boost value to replace a numerical value.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:info,tolorboost_valpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst floatboost_tolconst floatboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseDcsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const double `boost_tol, const double `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst doubleboost_tolconst doubleboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseCcsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const float `boost_tol, const muComplex `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst floatboost_tolconst muComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseZcsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const double `boost_tol, const muDoubleComplex `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst doubleboost_tolconst muDoubleComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDScsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseDScsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const double `boost_tol, const float `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst doubleboost_tolconst floatboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDCcsrilu0_numericBoost
MUSPARSE_EXPORT musparseStatus_t musparseDCcsrilu0_numericBoost(musparseHandle_t handle, musparseMatInfo_t info, muInt enable_boost, const double `boost_tol, const muComplex `boost_val)
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info - muInt
enable_boostconst doubleboost_tolconst muComplexboost_val
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrilu0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseScsrilu0_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Incomplete LU factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsrilu0_bufferSize returns the size of the temporary storage buffer that is required by musparseScsrilu0_analysis(), musparseDcsrilu0_analysis(), musparseCcsrilu0_analysis(), musparseZcsrilu0_analysis(), musparseScsrilu0(), musparseDcsrilu0(), musparseCcsrilu0() and musparseZcsrilu0(). The temporary storage buffer must be allocated by the user. The size of the temporary storage buffer is identical to the size returned by musparseScsrsv_bufferSize(), musparseDcsrsv_bufferSize(), musparseCcsrsv_bufferSize() and musparseZcsrsv_bufferSize() if the matrix sparsity pattern is identical. The user allocated buffer can thus be shared between subsequent calls to those functions.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.buffer_size: number of bytes of the temporary storage buffer required by musparseScsrilu0_analysis(), musparseDcsrilu0_analysis(), musparseCcsrilu0_analysis(), musparseZcsrilu0_analysis(), musparseScsrilu0(), musparseDcsrilu0(), musparseCcsrilu0() and musparseZcsrilu0().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_val, csr_row_ptr, csr_col_ind, info or buffer_size pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrilu0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDcsrilu0_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrilu0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCcsrilu0_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrilu0_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZcsrilu0_bufferSize(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrilu0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseScsrilu0_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Incomplete LU factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsrilu0_analysis performs the analysis step for musparseScsrilu0(), musparseDcsrilu0(), musparseCcsrilu0() and musparseZcsrilu0(). It is expected that this function will be executed only once for a given matrix and particular operation type. The analysis meta data can be cleared by musparseXcsrilu0_clear().
musparseXcsrilu0_analysis can share its meta data with musparseScsric0_analysis(), musparseDcsric0_analysis(), musparseCcsric0_analysis(), musparseZcsric0_analysis(), musparseScsrsv_analysis(), musparseDcsrsv_analysis(), musparseCcsrsv_analysis(), musparseZcsrsv_analysis(), musparseScsrsm_analysis(), musparseDcsrsm_analysis(), musparseScsrsm_analysis() and musparseDcsrsm_analysis(). Selecting MUSPARSE_ANALYSIS_POLICY_REUSE policy can greatly improve computation performance of meta data. However, the user need to make sure that the sparsity pattern remains unchanged. If this cannot be assured, MUSPARSE_ANALYSIS_POLICY_FORCE has to be used.
注意:If the matrix sparsity pattern changes, the gathered information will become invalid.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.analysis: MUSPARSE_ANALYSIS_POLICY_REUSE or MUSPARSE_ANALYSIS_POLICY_FORCE.solve: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_val, csr_row_ptr, csr_col_ind, info or temp_buffer pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrilu0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDcsrilu0_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrilu0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseCcsrilu0_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrilu0_analysis
MUSPARSE_EXPORT musparseStatus_t musparseZcsrilu0_analysis(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseAnalysisPolicy_t analysis, musparseSolvePolicy_t solve, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseAnalysisPolicy_t
analysis - musparseSolvePolicy_t
solvevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrilu0
MUSPARSE_EXPORT musparseStatus_t musparseScsrilu0(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Incomplete LU factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsrilu0 computes the incomplete LU factorization with 0 fill-ins and no pivoting of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} CSR matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"109"\},"children":[\{"type":"text","text":"\\[ A \\approx LU \\]"\}]\}
musparseXcsrilu0 requires a user allocated temporary buffer. Its size is returned by musparseScsrilu0_bufferSize(), musparseDcsrilu0_bufferSize(), musparseCcsrilu0_bufferSize() or musparseZcsrilu0_bufferSize(). Furthermore, analysis meta data is required. It can be obtained by musparseScsrilu0_analysis(), musparseDcsrilu0_analysis(), musparseCcsrilu0_analysis() or musparseZcsrilu0_analysis(). musparseXcsrilu0 reports the first zero pivot (either numerical or structural zero). The zero pivot status can be obtained by calling musparseXcsrilu0_zeroPivot().
注意:The sparse CSR matrix has to be sorted. This can be achieved by calling musparseXcsrsort().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.policy: MUSPARSE_SOLVE_POLICY_USE_LEVEL.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_val, csr_row_ptr or csr_col_ind pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the device is not supported. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. ` *MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans!= MUSPARSE_OPERATION_NON_TRANSPOSE or musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
Consider the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, stored in CSR storage format. The following example computes the incomplete LU factorization formula \{"type":"element","name":"formula","attributes":\{"id":"110"\},"children":[\{"type":"text","text":"$M \\approx LU$"\}]\} and solves the preconditioned system formula \{"type":"element","name":"formula","attributes":\{"id":"111"\},"children":[\{"type":"text","text":"$My =\n x$"\}]\}.
// Create musparse handle
musparseHandle_t handle;
musparseCreate(&handle);
// Create matrix descriptor for M
musparseMatDescr_t descr_M;
musparseCreateMatDescr(&descr_M);
// Create matrix descriptor for L
musparseMatDescr_t descr_L;
musparseCreateMatDescr(&descr_L);
musparseSetMatFillMode(descr_L, MUSPARSE_FILL_MODE_LOWER);
musparseSetMatDiagType(descr_L, MUSPARSE_DIAG_TYPE_UNIT);
// Create matrix descriptor for U
musparseMatDescr_t descr_U;
musparseCreateMatDescr(&descr_U);
musparseSetMatFillMode(descr_U, MUSPARSE_FILL_MODE_UPPER);
musparseSetMatDiagType(descr_U, MUSPARSE_DIAG_TYPE_NON_UNIT);
// Create matrix info structure
musparseMatInfo_t info;
musparseCreateMatInfo(&info);
// Obtain required buffer size
size_t buffer_size_M;
size_t buffer_size_L;
size_t buffer_size_U;
musparseDcsrilu0_bufferSize(handle,
m,
nnz,
descr_M,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
&buffer_size_M);
musparseDcsrsv_bufferSize(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
descr_L,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
&buffer_size_L);
musparseDcsrsv_bufferSize(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
descr_U,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
&buffer_size_U);
size_t buffer_size = max(buffer_size_M, max(buffer_size_L,
buffer_size_U));
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
// Perform analysis steps, using MUSPARSE_ANALYSIS_POLICY_REUSE to
improve
// computation performance
musparseDcsrilu0_analysis(handle,
m,
nnz,
descr_M,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
musparseDcsrsv_analysis(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
descr_L,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
musparseDcsrsv_analysis(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
descr_U,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_ANALYSIS_POLICY_REUSE,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Check for zero pivot
muInt position;
if(MUSPARSE_EXPORT
MUSPARSE_STATUS_ZERO_PIVOT == musparseXcsrilu0_zeroPivot(handle,
info,
&position))
\{
printf("A has structural zero at A(%d,%d)\n", position, position);
\}
// Compute incomplete LU factorization
musparseDcsrilu0(handle,
m,
nnz,
descr_M,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Check for zero pivot
if(MUSPARSE_EXPORT
MUSPARSE_STATUS_ZERO_PIVOT == musparseXcsrilu0_zeroPivot(handle,
info,
&position))
\{
printf("U has structural and/or numerical zero at U(%d,%d)\n",
position,
position);
\}
// Solve Lz = x
musparseDcsrsv_solve(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
&alpha,
descr_L,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
x,
z,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Solve Uy = z
musparseDcsrsv_solve(handle,
MUSPARSE_OPERATION_NON_TRANSPOSE,
m,
nnz,
&alpha,
descr_U,
csr_val,
csr_row_ptr,
csr_col_ind,
info,
z,
y,
MUSPARSE_SOLVE_POLICY_USE_LEVEL,
temp_buffer);
// Clean up
musaFree(temp_buffer);
musparseDestroyMatInfo(info);
musparseDestroyMatDescr(descr_M);
musparseDestroyMatDescr(descr_L);
musparseDestroyMatDescr(descr_U);
musparseDestroy(handle);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrfloatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrilu0
MUSPARSE_EXPORT musparseStatus_t musparseDcsrilu0(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrdoublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrilu0
MUSPARSE_EXPORT musparseStatus_t musparseCcsrilu0(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrmuComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrilu0
MUSPARSE_EXPORT musparseStatus_t musparseZcsrilu0(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, musparseSolvePolicy_t policy, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrmuDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
info - musparseSolvePolicy_t
policyvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv_bufferSize(musparseHandle_t handle, muInt m, muInt n, const float `dl, const float `d, const float `du, const float `B, muInt ldb, size_t *buffer_size)
Tridiagonal solver with pivoting.
musparseXgtsv_bufferSize returns the size of the temporary storage buffer that is required by musparseSgtsv(), musparseDgtsv(), musparseCgtsv() and musparseZgtsv(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: size of the tri-diagonal linear system (must be >= 2).n: number of columns in the dense matrix B.dl: lower diagonal of tri-diagonal system. First entry must be zero.d: main diagonal of tri-diagonal system.du: upper diagonal of tri-diagonal system. Last entry must be zero.B: Dense matrix of size (ldb,n).ldb: Leading dimension of B. Must satisfyldb>= max(1, m).buffer_size: number of bytes of the temporary storage buffer required by musparseSgtsv(), musparseDgtsv(), musparseCgtsv() and musparseZgtsv().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,norldbis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p dl, d, du, B or buffer_size pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatdlconst floatdconst floatduconst floatB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv_bufferSize(musparseHandle_t handle, muInt m, muInt n, const double `dl, const double `d, const double `du, const double `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubledlconst doubledconst doubleduconst doubleB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv_bufferSize(musparseHandle_t handle, muInt m, muInt n, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexdlconst muComplexdconst muComplexduconst muComplexB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv_bufferSize(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv(musparseHandle_t handle, muInt m, muInt n, const float `dl, const float `d, const float `du, float `B, muInt ldb, void *temp_buffer)
Tridiagonal solver with pivoting.
musparseXgtsv solves a tridiagonal system for multiple right hand sides using pivoting.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: size of the tri-diagonal linear system (must be >= 2).n: number of columns in the dense matrix B.dl: lower diagonal of tri-diagonal system. First entry must be zero.d: main diagonal of tri-diagonal system.du: upper diagonal of tri-diagonal system. Last entry must be zero.B: Dense matrix of size (ldb,n).ldb: Leading dimension of B. Must satisfyldb>= max(1, m).temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,norldbis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p dl, d, du, B or temp_buffer pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatdlconst floatdconst floatdufloatB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv(musparseHandle_t handle, muInt m, muInt n, const double `dl, const double `d, const double `du, double `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubledlconst doubledconst doubledudoubleB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv(musparseHandle_t handle, muInt m, muInt n, const muComplex `dl, const muComplex `d, const muComplex `du, muComplex `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexdlconst muComplexdconst muComplexdumuComplexB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, muDoubleComplex `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexdumuDoubleComplexB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv_nopivot_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv_nopivot_bufferSize(musparseHandle_t handle, muInt m, muInt n, const float `dl, const float `d, const float `du, const float `B, muInt ldb, size_t *buffer_size)
Tridiagonal solver (no pivoting)
musparseXgtsv_nopivot_bufferSize returns the size of the temporary storage buffer that is required by musparseSgtsv_nopivot(), musparseDgtsv_nopivot(), musparseCgtsv_nopivot() and musparseZgtsv_nopivot(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: size of the tri-diagonal linear system (must be >= 2).n: number of columns in the dense matrix B.dl: lower diagonal of tri-diagonal system. First entry must be zero.d: main diagonal of tri-diagonal system.du: upper diagonal of tri-diagonal system. Last entry must be zero.B: Dense matrix of size (ldb,n).ldb: Leading dimension of B. Must satisfyldb>= max(1, m).buffer_size: number of bytes of the temporary storage buffer required by musparseSgtsv_nopivot(), musparseDgtsv_nopivot(), musparseCgtsv_nopivot() and musparseZgtsv_nopivot().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,norldbis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p dl, d, du, B or buffer_size pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatdlconst floatdconst floatduconst floatB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv_nopivot_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv_nopivot_bufferSize(musparseHandle_t handle, muInt m, muInt n, const double `dl, const double `d, const double `du, const double `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubledlconst doubledconst doubleduconst doubleB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv_nopivot_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv_nopivot_bufferSize(musparseHandle_t handle, muInt m, muInt n, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexdlconst muComplexdconst muComplexduconst muComplexB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv_nopivot_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv_nopivot_bufferSize(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `B, muInt ldb, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexB - muInt
ldbsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsv_nopivot
MUSPARSE_EXPORT musparseStatus_t musparseSgtsv_nopivot(musparseHandle_t handle, muInt m, muInt n, const float `dl, const float `d, const float `du, float `B, muInt ldb, void *temp_buffer)
Tridiagonal solver (no pivoting)
musparseXgtsv_nopivot solves a tridiagonal linear system for multiple right-hand sides
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: size of the tri-diagonal linear system (must be >= 2).n: number of columns in the dense matrix B.dl: lower diagonal of tri-diagonal system. First entry must be zero.d: main diagonal of tri-diagonal system.du: upper diagonal of tri-diagonal system. Last entry must be zero.B: Dense matrix of size (ldb,n).ldb: Leading dimension of B. Must satisfyldb>= max(1, m).temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,norldbis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p dl, d, du, B or temp_buffer pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatdlconst floatdconst floatdufloatB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsv_nopivot
MUSPARSE_EXPORT musparseStatus_t musparseDgtsv_nopivot(musparseHandle_t handle, muInt m, muInt n, const double `dl, const double `d, const double `du, double `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubledlconst doubledconst doubledudoubleB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsv_nopivot
MUSPARSE_EXPORT musparseStatus_t musparseCgtsv_nopivot(musparseHandle_t handle, muInt m, muInt n, const muComplex `dl, const muComplex `d, const muComplex `du, muComplex `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muComplexdlconst muComplexdconst muComplexdumuComplexB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsv_nopivot
MUSPARSE_EXPORT musparseStatus_t musparseZgtsv_nopivot(musparseHandle_t handle, muInt m, muInt n, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, muDoubleComplex `B, muInt ldb, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexdumuDoubleComplexB - muInt
ldbvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsvStridedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseSgtsvStridedBatch_bufferSizeExt(musparseHandle_t handle, muInt m, const float `dl, const float `d, const float `du, const float `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Strided Batch tridiagonal solver (no pivoting)
musparseXgtsv_noPivot_stridedBatch_bufferSize returns the size of the temporary storage buffer that is required by musparseSgtsvStridedBatch(), musparseDgtsvStridedBatch(), musparseCgtsvStridedBatch() and musparseZgtsvStridedBatch(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: size of the tri-diagonal linear system.dl: lower diagonal of tri-diagonal system where the ith system lower diagonal starts atdl+batch_stride*i.d: main diagonal of tri-diagonal system where the ith system diagonal starts atd+batch_stride*i.du: upper diagonal of tri-diagonal system where the ith system upper diagonal starts atdu+batch_stride*i.x: Dense array of righthand-sides where the ith righthand-side starts atx+batch_stride*i.batch_count: The number of systems to solve.batch_stride: The number of elements that separate each system. Must satisfybatch_stride>= m.buffer_size: number of bytes of the temporary storage buffer required by musparseSgtsvStridedBatch(), musparseDgtsvStridedBatch(), musparseCgtsvStridedBatch() and musparseZgtsvStridedBatch().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,batch_countorbatch_strideis invalid.MUSPARSE_STATUS_INVALID_POINTER:dl,d,du,xorbuffer_sizepointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
mconst floatdlconst floatdconst floatduconst floatx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsvStridedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseDgtsvStridedBatch_bufferSizeExt(musparseHandle_t handle, muInt m, const double `dl, const double `d, const double `du, const double `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mconst doubledlconst doubledconst doubleduconst doublex - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsvStridedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseCgtsvStridedBatch_bufferSizeExt(musparseHandle_t handle, muInt m, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mconst muComplexdlconst muComplexdconst muComplexduconst muComplexx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsvStridedBatch_bufferSizeExt
MUSPARSE_EXPORT musparseStatus_t musparseZgtsvStridedBatch_bufferSizeExt(musparseHandle_t handle, muInt m, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsvStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseSgtsvStridedBatch(musparseHandle_t handle, muInt m, const float `dl, const float `d, const float `du, float `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Strided Batch tridiagonal solver (no pivoting)
musparseXgtsv_noPivot_stridedBatch solves a batched tridiagonal linear system
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: size of the tri-diagonal linear system (must be >= 2).dl: lower diagonal of tri-diagonal system. First entry must be zero.d: main diagonal of tri-diagonal system.du: upper diagonal of tri-diagonal system. Last entry must be zero.x: Dense array of righthand-sides where the ith righthand-side starts atx+batch_stride*i.batch_count: The number of systems to solve.batch_stride: The number of elements that separate each system. Must satisfybatch_stride>= m.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,batch_countorbatch_strideis invalid.MUSPARSE_STATUS_INVALID_POINTER:dl,d,du,xortemp_bufferpointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
mconst floatdlconst floatdconst floatdufloatx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsvStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseDgtsvStridedBatch(musparseHandle_t handle, muInt m, const double `dl, const double `d, const double `du, double `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mconst doubledlconst doubledconst doubledudoublex - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsvStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseCgtsvStridedBatch(musparseHandle_t handle, muInt m, const muComplex `dl, const muComplex `d, const muComplex `du, muComplex `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mconst muComplexdlconst muComplexdconst muComplexdumuComplexx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsvStridedBatch
MUSPARSE_EXPORT musparseStatus_t musparseZgtsvStridedBatch(musparseHandle_t handle, muInt m, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, muDoubleComplex `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexdumuDoubleComplexx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsvInterleavedBatch_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSgtsvInterleavedBatch_bufferSize(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, const float `dl, const float `d, const float `du, const float `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Interleaved Batch tridiagonal solver.
musparseXgtsvInterleavedBatch_bufferSize returns the size of the temporary storage buffer that is required by musparseSgtsvInterleavedBatch(), musparseDgtsvInterleavedBatch(), musparseCgtsvInterleavedBatch() and musparseZgtsvInterleavedBatch(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.alg: Algorithm to use when solving tridiagonal systems. Options are thomas (musparse_gtsv_interleaved_thomas), LU (musparse_gtsv_interleaved_lu), or QR (musparse_gtsv_interleaved_qr). Passingmusparse_gtsv_interleaved_defaultdefaults the algorithm to use QR. Thomas algorithm is the fastest but is not stable while LU and QR are slower but are stable.m: size of the tri-diagonal linear system.dl: lower diagonal of tri-diagonal system. The first element of the lower diagonal must be zero.d: main diagonal of tri-diagonal system.du: upper diagonal of tri-diagonal system. The last element of the upper diagonal must be zero.x: Dense array of righthand-sides with dimensionbatch_stridebym.batch_count: The number of systems to solve.batch_stride: The number of elements that separate consecutive elements in a system. Must satisfybatch_stride>= batch_count.buffer_size: number of bytes of the temporary storage buffer required by musparseSgtsvInterleavedBatch(), musparseDgtsvInterleavedBatch(), musparseCgtsvInterleavedBatch() and musparseZgtsvInterleavedBatch().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,batch_count,batch_strideis invalid.MUSPARSE_STATUS_INVALID_POINTER:dl,d,du,xorbuffer_sizepointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mconst floatdlconst floatdconst floatduconst floatx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsvInterleavedBatch_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDgtsvInterleavedBatch_bufferSize(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, const double `dl, const double `d, const double `du, const double `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mconst doubledlconst doubledconst doubleduconst doublex - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsvInterleavedBatch_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCgtsvInterleavedBatch_bufferSize(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mconst muComplexdlconst muComplexdconst muComplexduconst muComplexx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsvInterleavedBatch_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZgtsvInterleavedBatch_bufferSize(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgtsvInterleavedBatch_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSgtsvInterleavedBatch_legacy(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, float `dl, float `d, float `du, float `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Interleaved Batch tridiagonal solver.
musparseXgtsvInterleavedBatch solves a batched tridiagonal linear system. The routine requires a temporary storage buffer that must be allocated by the user. The size of this buffer can be determined by first calling musparseXgtsvInterleavedBatch_bufferSize. The user can specify different algorithms for musparseXgtsvInterleavedBatch to use. Options are thomas ( musparse_gtsv_interleaved_thomas ), LU ( musparse_gtsv_interleaved_lu ), or QR ( musparse_gtsv_interleaved_qr ). Passing musparse_gtsv_interleaved_default defaults the algorithm to use QR.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.alg: Algorithm to use when solving tridiagonal systems. Options are thomas (musparse_gtsv_interleaved_thomas), LU (musparse_gtsv_interleaved_lu), or QR (musparse_gtsv_interleaved_qr). Passingmusparse_gtsv_interleaved_defaultdefaults the algorithm to use QR. Thomas algorithm is the fastest but is not stable while LU and QR are slower but are stable.m: size of the tri-diagonal linear system.dl: lower diagonal of tri-diagonal system. The first element of the lower diagonal must be zero.d: main diagonal of tri-diagonal system.du: upper diagonal of tri-diagonal system. The last element of the upper diagonal must be zero.x: Dense array of righthand-sides with dimensionbatch_stridebym.batch_count: The number of systems to solve.batch_stride: The number of elements that separate consecutive elements in a system. Must satisfybatch_stride>= batch_count.temp_buffer: temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:morbatch_countorbatch_strideis invalid.MUSPARSE_STATUS_INVALID_POINTER:dl,d,du,xortemp_bufferpointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mfloatdlfloatdfloatdufloatx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgtsvInterleavedBatch_legacy
MUSPARSE_EXPORT musparseStatus_t musparseDgtsvInterleavedBatch_legacy(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, double `dl, double `d, double `du, double `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mdoubledldoubleddoubledudoublex - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgtsvInterleavedBatch_legacy
MUSPARSE_EXPORT musparseStatus_t musparseCgtsvInterleavedBatch_legacy(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, muComplex `dl, muComplex `d, muComplex `du, muComplex `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mmuComplexdlmuComplexdmuComplexdumuComplexx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgtsvInterleavedBatch_legacy
MUSPARSE_EXPORT musparseStatus_t musparseZgtsvInterleavedBatch_legacy(musparseHandle_t handle, musparseGtsvInterleavedAlg_t alg, muInt m, muDoubleComplex `dl, muDoubleComplex `d, muDoubleComplex `du, muDoubleComplex `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseGtsvInterleavedAlg_t
alg - muInt
mmuDoubleComplexdlmuDoubleComplexdmuDoubleComplexdumuDoubleComplexx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgpsvInterleavedBatch_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSgpsvInterleavedBatch_bufferSize(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, const float `ds, const float `dl, const float `d, const float `du, const float `dw, const float `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Batched Pentadiagonal solver.
musparseXgpsvInterleavedBatch_bufferSize calculates the required buffer size for musparseXgpsvInterleavedBatch(). It is the users responsibility to allocate this buffer.
Parameters:
handle: handle to the musparse library context queue.alg: algorithm to solve the linear system.m: size of the pentadiagonal linear system.ds: lower diagonal (distance 2) of pentadiagonal system. First two entries must be zero.dl: lower diagonal of pentadiagonal system. First entry must be zero.d: main diagonal of pentadiagonal system.du: upper diagonal of pentadiagonal system. Last entry must be zero.dw: upper diagonal (distance 2) of pentadiagonal system. Last two entries must be zero.x: Dense array of right-hand-sides with dimensionbatch_stridebym.batch_count: The number of systems to solve.batch_stride: The number of elements that separate consecutive elements in a system. Must satisfybatch_stride>= batch_count.buffer_size: Number of bytes of the temporary storage buffer required.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,alg,batch_countorbatch_strideis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p ds, dl, d, du, dw, x or temp_buffer pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mconst floatdsconst floatdlconst floatdconst floatduconst floatdwconst floatx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgpsvInterleavedBatch_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDgpsvInterleavedBatch_bufferSize(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, const double `ds, const double `dl, const double `d, const double `du, const double `dw, const double `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mconst doubledsconst doubledlconst doubledconst doubleduconst doubledwconst doublex - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgpsvInterleavedBatch_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseCgpsvInterleavedBatch_bufferSize(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, const muComplex `ds, const muComplex `dl, const muComplex `d, const muComplex `du, const muComplex `dw, const muComplex `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mconst muComplexdsconst muComplexdlconst muComplexdconst muComplexduconst muComplexdwconst muComplexx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgpsvInterleavedBatch_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseZgpsvInterleavedBatch_bufferSize(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, const muDoubleComplex `ds, const muDoubleComplex `dl, const muDoubleComplex `d, const muDoubleComplex `du, const muDoubleComplex `dw, const muDoubleComplex `x, muInt batch_count, muInt batch_stride, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mconst muDoubleComplexdsconst muDoubleComplexdlconst muDoubleComplexdconst muDoubleComplexduconst muDoubleComplexdwconst muDoubleComplexx - muInt
batch_count - muInt
batch_stridesize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgpsvInterleavedBatch_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSgpsvInterleavedBatch_legacy(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, float `ds, float `dl, float `d, float `du, float `dw, float `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Batched Pentadiagonal solver.
musparseXgpsvInterleavedBatch solves a batch of pentadiagonal linear systems. The coefficient matrix of each pentadiagonal linear system is defined by five vectors for the lower part (ds, dl), main diagonal (d) and upper part (du, dw).
The function requires a temporary buffer. The size of the required buffer is returned by musparseXgpsvInterleavedBatch_bufferSize().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:The routine is numerically stable because it uses QR to solve the linear systems.
注意:m need to be at least 3, to be a valid pentadiagonal matrix.
Parameters:
handle: handle to the musparse library context queue.alg: algorithm to solve the linear system.m: size of the pentadiagonal linear system.ds: lower diagonal (distance 2) of pentadiagonal system. First two entries must be zero.dl: lower diagonal of pentadiagonal system. First entry must be zero.d: main diagonal of pentadiagonal system.du: upper diagonal of pentadiagonal system. Last entry must be zero.dw: upper diagonal (distance 2) of pentadiagonal system. Last two entries must be zero.x: Dense array of right-hand-sides with dimensionbatch_stridebym.batch_count: The number of systems to solve.batch_stride: The number of elements that separate consecutive elements in a system. Must satisfybatch_stride>= batch_count.temp_buffer: Temporary storage buffer allocated by the user.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,alg,batch_countorbatch_strideis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p ds, dl, d, du, dw, x or temp_buffer pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mfloatdsfloatdlfloatdfloatdufloatdwfloatx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgpsvInterleavedBatch_legacy
MUSPARSE_EXPORT musparseStatus_t musparseDgpsvInterleavedBatch_legacy(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, double `ds, double `dl, double `d, double `du, double `dw, double `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mdoubledsdoubledldoubleddoubledudoubledwdoublex - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgpsvInterleavedBatch_legacy
MUSPARSE_EXPORT musparseStatus_t musparseCgpsvInterleavedBatch_legacy(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, muComplex `ds, muComplex `dl, muComplex `d, muComplex `du, muComplex `dw, muComplex `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mmuComplexdsmuComplexdlmuComplexdmuComplexdumuComplexdwmuComplexx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgpsvInterleavedBatch_legacy
MUSPARSE_EXPORT musparseStatus_t musparseZgpsvInterleavedBatch_legacy(musparseHandle_t handle, musparseGpsvInterleavedAlg_t alg, muInt m, muDoubleComplex `ds, muDoubleComplex `dl, muDoubleComplex `d, muDoubleComplex `du, muDoubleComplex `dw, muDoubleComplex `x, muInt batch_count, muInt batch_stride, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseGpsvInterleavedAlg_t
alg - muInt
mmuDoubleComplexdsmuDoubleComplexdlmuDoubleComplexdmuDoubleComplexdumuDoubleComplexdwmuDoubleComplexx - muInt
batch_count - muInt
batch_stridevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSnnz
MUSPARSE_EXPORT musparseStatus_t musparseSnnz(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t descr, const float `A, muInt ld, muInt `nnz_per_row_columns, muInt *nnz_total_dev_host_ptr)
This function computes the number of nonzero elements per row or column and the total number of nonzero elements in a dense matrix.
The routine does support asynchronous execution if the pointer mode is set to device.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specified whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.descr: the descriptor of the dense matrixA.A: array of dimensions (ld,n)ld: leading dimension of dense arrayA.nnz_per_row_columns: array of sizemorncontaining the number of nonzero elements per row or column, respectively.nnz_total_dev_host_ptr: total number of nonzero elements in device or host memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p A or nnz_per_row_columns or nnz_total_dev_host_ptr pointer is invalid.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
descrconst floatA - muInt
ldmuIntnnz_per_row_columnsmuIntnnz_total_dev_host_ptr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnnz
MUSPARSE_EXPORT musparseStatus_t musparseDnnz(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t descr, const double `A, muInt ld, muInt `nnz_per_row_columns, muInt *nnz_total_dev_host_ptr)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
descrconst doubleA - muInt
ldmuIntnnz_per_row_columnsmuIntnnz_total_dev_host_ptr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCnnz
MUSPARSE_EXPORT musparseStatus_t musparseCnnz(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t descr, const muComplex `A, muInt ld, muInt `nnz_per_row_columns, muInt *nnz_total_dev_host_ptr)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muComplexA - muInt
ldmuIntnnz_per_row_columnsmuIntnnz_total_dev_host_ptr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZnnz
MUSPARSE_EXPORT musparseStatus_t musparseZnnz(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t descr, const muDoubleComplex `A, muInt ld, muInt `nnz_per_row_columns, muInt *nnz_total_dev_host_ptr)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muDoubleComplexA - muInt
ldmuIntnnz_per_row_columnsmuIntnnz_total_dev_host_ptr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSdense2csr
MUSPARSE_EXPORT musparseStatus_t musparseSdense2csr(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const float `A, muInt ld, const muInt `nnz_per_rows, float `csr_val, muInt `csr_row_ptr, muInt *csr_col_ind)
This function converts the matrix A in dense format into a sparse matrix in CSR format. All the parameters are assumed to have been pre-allocated by the user and the arrays are filled in based on nnz_per_row, which can be pre-computed with musparse_xnnz(). It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.A: array of dimensions (ld,n)ld: leading dimension of dense arrayA.nnz_per_rows: array of sizencontaining the number of non-zero elements per row.csr_val: array of nnz ( =csr_row_ptr[m] -csr_row_ptr[0] ) nonzero elements of matrixA.csr_row_ptr: integer array of m+1 elements that contains the start of every row and the end of the last row plus one.csr_col_ind: integer array of nnz ( =csr_row_ptr[m] - csr_row_ptr[0] ) column indices of the non-zero elements of matrixA.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p A or nnz_per_rows or csr_val csr_row_ptr or csr_col_ind pointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst floatA - muInt
ldconst muIntnnz_per_rowsfloatcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDdense2csr
MUSPARSE_EXPORT musparseStatus_t musparseDdense2csr(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const double `A, muInt ld, const muInt `nnz_per_rows, double `csr_val, muInt `csr_row_ptr, muInt *csr_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst doubleA - muInt
ldconst muIntnnz_per_rowsdoublecsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCdense2csr
MUSPARSE_EXPORT musparseStatus_t musparseCdense2csr(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muComplex `A, muInt ld, const muInt `nnz_per_rows, muComplex `csr_val, muInt `csr_row_ptr, muInt *csr_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muComplexA - muInt
ldconst muIntnnz_per_rowsmuComplexcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZdense2csr
MUSPARSE_EXPORT musparseStatus_t musparseZdense2csr(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muDoubleComplex `A, muInt ld, const muInt `nnz_per_rows, muDoubleComplex `csr_val, muInt `csr_row_ptr, muInt *csr_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muDoubleComplexA - muInt
ldconst muIntnnz_per_rowsmuDoubleComplexcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csr_bufferSize(musparseHandle_t handle, muInt m, muInt n, const float `A, muInt lda, const float `threshold, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, size_t `buffer_size)
This function computes the the size of the user allocated temporary storage buffer used when converting and pruning a dense matrix to a CSR matrix.
musparseXpruneDense2csr_bufferSize returns the size of the temporary storage buffer that is required by musparseSpruneDense2csr_nnz(), musparseDpruneDense2csr_nnz(), musparseSpruneDense2csr(), and musparseDpruneDense2csr(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.A: array of dimensions (lda,n)lda: leading dimension of dense arrayA.threshold: pointer to the pruning non-negative threshold which can exist in either host or device memory.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.csr_val: array of nnz ( =csr_row_ptr[m] -csr_row_ptr[0] ) nonzero elements of matrixA.csr_row_ptr: integer array ofm+1elements that contains the start of every row and the end of the last row plus one.csr_col_ind: integer array of nnz ( =csr_row_ptr[m] - csr_row_ptr[0] ) column indices of the non-zero elements of matrixA.buffer_size: number of bytes of the temporary storage buffer required by musparseSpruneDense2csr_nnz(), musparseDpruneDense2csr_nnz(), musparseSpruneDense2csr() and musparseDpruneDense2csr().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:buffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatA - muInt
ldaconst floatthreshold - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csr_bufferSize(musparseHandle_t handle, muInt m, muInt n, const double `A, muInt lda, const double `threshold, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubleA - muInt
ldaconst doublethreshold - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csr_nnz(musparseHandle_t handle, muInt m, muInt n, const float `A, muInt lda, const float `threshold, const musparseMatDescr_t descr, muInt `csr_row_ptr, muInt `nnz_total_dev_host_ptr, void *temp_buffer)
This function computes the number of nonzero elements per row and the total number of nonzero elements in a dense matrix once elements less than the threshold are pruned from the matrix.
The routine does support asynchronous execution if the pointer mode is set to device.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.A: array of dimensions (lda,n)lda: leading dimension of dense arrayA.threshold: pointer to the pruning non-negative threshold which can exist in either host or device memory.descr: the descriptor of the dense matrixA.csr_row_ptr: integer array ofm+1elements that contains the start of every row and the end of the last row plus one.nnz_total_dev_host_ptr: total number of nonzero elements in device or host memory.temp_buffer: buffer allocated by the user whose size is determined by calling musparse_xprune_dense2csr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldais invalid.MUSPARSE_STATUS_INVALID_POINTER:Aorthresholdordescrorcsr_row_ptrornnz_total_dev_host_ptrortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatA - muInt
ldaconst floatthreshold - const musparseMatDescr_t
descrmuIntcsr_row_ptrmuIntnnz_total_dev_host_ptrvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csr_nnz(musparseHandle_t handle, muInt m, muInt n, const double `A, muInt lda, const double `threshold, const musparseMatDescr_t descr, muInt `csr_row_ptr, muInt `nnz_total_dev_host_ptr, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubleA - muInt
ldaconst doublethreshold - const musparseMatDescr_t
descrmuIntcsr_row_ptrmuIntnnz_total_dev_host_ptrvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csr_nnz(musparseHandle_t handle, muInt m, muInt n, const __half `A, muInt lda, const __half `threshold, const musparseMatDescr_t descr, muInt `csr_row_ptr, muInt `nnz_total_dev_host_ptr, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst __halfA - muInt
ldaconst __halfthreshold - const musparseMatDescr_t
descrmuIntcsr_row_ptrmuIntnnz_total_dev_host_ptrvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csr
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csr(musparseHandle_t handle, muInt m, muInt n, const float `A, muInt lda, const float `threshold, const musparseMatDescr_t descr, float `csr_val, const muInt `csr_row_ptr, muInt `csr_col_ind, void `temp_buffer)
This function converts the matrix A in dense format into a sparse matrix in CSR format while pruning values that are less than the threshold. All the parameters are assumed to have been pre-allocated by the user.
The user first allocates csr_row_ptr to have m+1 elements and then calls musparse_xprune_dense2csr_nnz() which fills in the csr_row_ptr array and stores the number of elements that are larger than the pruning threshold in nnz_total_dev_host_ptr. The user then allocates csr_col_ind and csr_val to have size nnz_total_dev_host_ptr and completes the conversion by calling musparse_xprune_dense2csr(). A temporary storage buffer is used by both musparse_xprune_dense2csr_nnz() and musparse_xprune_dense2csr() and must be allocated by the user and whose size is determined by musparse_xprune_dense2csr_buffer_size(). The routine musparse_xprune_dense2csr() is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.A: array of dimensions (lda,n)lda: leading dimension of dense arrayA.threshold: pointer to the non-negative pruning threshold which can exist in either host or device memory.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.csr_val: array of nnz ( =csr_row_ptr[m] -csr_row_ptr[0] ) nonzero elements of matrixA.csr_row_ptr: integer array ofm+1elements that contains the start of every row and the end of the last row plus one.csr_col_ind: integer array of nnz ( =csr_row_ptr[m] - csr_row_ptr[0] ) column indices of the non-zero elements of matrixA.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparse_xprune_dense2csr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldais invalid.MUSPARSE_STATUS_INVALID_POINTER:Aordescrorthresholdorcsr_valorcsr_row_ptrorcsr_col_indortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatA - muInt
ldaconst floatthreshold - const musparseMatDescr_t
descrfloatcsr_valconst muIntcsr_row_ptrmuIntcsr_col_indvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csr
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csr(musparseHandle_t handle, muInt m, muInt n, const double `A, muInt lda, const double `threshold, const musparseMatDescr_t descr, double `csr_val, const muInt `csr_row_ptr, muInt `csr_col_ind, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubleA - muInt
ldaconst doublethreshold - const musparseMatDescr_t
descrdoublecsr_valconst muIntcsr_row_ptrmuIntcsr_col_indvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csr
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csr(musparseHandle_t handle, muInt m, muInt n, const __half `A, muInt lda, const __half `threshold, const musparseMatDescr_t descr, __half `csr_val, const muInt `csr_row_ptr, muInt `csr_col_ind, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst __halfA - muInt
ldaconst __halfthreshold - const musparseMatDescr_t
descr__halfcsr_valconst muIntcsr_row_ptrmuIntcsr_col_indvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csrByPercentage_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csrByPercentage_bufferSize(musparseHandle_t handle, muInt m, muInt n, const float `A, muInt lda, float percentage, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t *buffer_size)
This function computes the size of the user allocated temporary storage buffer used when converting and pruning by percentage a dense matrix to a CSR matrix.
When converting and pruning a dense matrix A to a CSR matrix by percentage the following steps are performed. First the user calls musparseXpruneDense2csrByPercentage_bufferSize which determines the size of the temporary storage buffer. Once determined, this buffer must be allocated by the user. Next the user allocates the csr_row_ptr array to have m+1 elements and calls musparseXpruneDense2csr_nnzByPercentage. Finally the user finishes the conversion by allocating the csr_col_ind and csr_val arrays (whos size is determined by the value at nnz_total_dev_host_ptr) and calling musparseXpruneDense2csrByPercentage.
The pruning by percentage works by first sorting the absolute values of the dense matrix A. We then determine a position in this sorted array by formula \{"type":"element","name":"formula","attributes":\{"id":"112"\},"children":[\{"type":"text","text":"\\[\n pos = ceil(mn(percentage/100)) - 1\n pos = min(pos, m*n-1)\n pos = max(pos, 0)\n threshold = sorted_A[pos]\n \\]"\}]\} Once we have this threshold we prune values in the dense matrix A as in musparseXpruneDense2csr. It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.A: array of dimensions (lda,n)lda: leading dimension of dense arrayA.percentage: percentage >= 0 and percentage <= 100.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.csr_val: array of nnz ( =csr_row_ptr[m] -csr_row_ptr[0] ) nonzero elements of matrixA.csr_row_ptr: integer array ofm+1elements that contains the start of every row and the end of the last row plus one.csr_col_ind: integer array of nnz ( =csr_row_ptr[m] - csr_row_ptr[0] ) column indices of the non-zero elements of matrixA.info: prune information structurebuffer_size: number of bytes of the temporary storage buffer required by musparseSpruneDense2csr_nnzByPercentage(), musparseDpruneDense2csr_nnzByPercentage(), musparseSpruneDense2csrByPercentage() and musparseDpruneDense2csrByPercentage().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:buffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatA - muInt
lda - float
percentage - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csrByPercentage_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csrByPercentage_bufferSize(musparseHandle_t handle, muInt m, muInt n, const double `A, muInt lda, double percentage, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubleA - muInt
lda - double
percentage - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csrByPercentage_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csrByPercentage_bufferSize(musparseHandle_t handle, muInt m, muInt n, const __half `A, muInt lda, float percentage, const musparseMatDescr_t descr, const __half `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseMatInfo_t info, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst __halfA - muInt
lda - float
percentage - const musparseMatDescr_t
descrconst __halfcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csr_nnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csr_nnzByPercentage(musparseHandle_t handle, muInt m, muInt n, const float `A, muInt lda, float percentage, const musparseMatDescr_t descr, muInt `csr_row_ptr, muInt `nnz_total_dev_host_ptr, musparseMatInfo_t info, void `temp_buffer)
This function computes the number of nonzero elements per row and the total number of nonzero elements in a dense matrix when converting and pruning by percentage a dense matrix to a CSR matrix.
When converting and pruning a dense matrix A to a CSR matrix by percentage the following steps are performed. First the user calls musparseXpruneDense2csrByPercentage_bufferSize which determines the size of the temporary storage buffer. Once determined, this buffer must be allocated by the user. Next the user allocates the csr_row_ptr array to have m+1 elements and calls musparseXpruneDense2csr_nnzByPercentage. Finally the user finishes the conversion by allocating the csr_col_ind and csr_val arrays (whos size is determined by the value at nnz_total_dev_host_ptr) and calling musparseXpruneDense2csrByPercentage.
The pruning by percentage works by first sorting the absolute values of the dense matrix A. We then determine a position in this sorted array by formula \{"type":"element","name":"formula","attributes":\{"id":"112"\},"children":[\{"type":"text","text":"\\[\n pos = ceil(mn(percentage/100)) - 1\n pos = min(pos, m*n-1)\n pos = max(pos, 0)\n threshold = sorted_A[pos]\n \\]"\}]\} Once we have this threshold we prune values in the dense matrix A as in musparseXpruneDense2csr. The routine does support asynchronous execution if the pointer mode is set to device.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.A: array of dimensions (lda,n)lda: leading dimension of dense arrayA.percentage: percentage >= 0 and percentage <= 100.descr: the descriptor of the dense matrixA.csr_row_ptr: integer array ofm+1elements that contains the start of every row and the end of the last row plus one.nnz_total_dev_host_ptr: total number of nonzero elements in device or host memory.info: prune information structuretemp_buffer: buffer allocated by the user whose size is determined by calling musparse_xprune_dense2csr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldaorpercentageis invalid.MUSPARSE_STATUS_INVALID_POINTER:Aordescrorinfoorcsr_row_ptrornnz_total_dev_host_ptrortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatA - muInt
lda - float
percentage - const musparseMatDescr_t
descrmuIntcsr_row_ptrmuIntnnz_total_dev_host_ptr - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csr_nnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csr_nnzByPercentage(musparseHandle_t handle, muInt m, muInt n, const double `A, muInt lda, double percentage, const musparseMatDescr_t descr, muInt `csr_row_ptr, muInt `nnz_total_dev_host_ptr, musparseMatInfo_t info, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubleA - muInt
lda - double
percentage - const musparseMatDescr_t
descrmuIntcsr_row_ptrmuIntnnz_total_dev_host_ptr - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csr_nnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csr_nnzByPercentage(musparseHandle_t handle, muInt m, muInt n, const __half `A, muInt lda, float percentage, const musparseMatDescr_t descr, muInt `csr_row_ptr, muInt `nnz_total_dev_host_ptr, musparseMatInfo_t info, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst __halfA - muInt
lda - float
percentage - const musparseMatDescr_t
descrmuIntcsr_row_ptrmuIntnnz_total_dev_host_ptr - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneDense2csrByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseSpruneDense2csrByPercentage(musparseHandle_t handle, muInt m, muInt n, const float `A, muInt lda, float percentage, const musparseMatDescr_t descr, float `csr_val, const muInt `csr_row_ptr, muInt `csr_col_ind, musparseMatInfo_t info, void *temp_buffer)
This function converts the matrix A in dense format into a sparse matrix in CSR format while pruning values based on percentage.
When converting and pruning a dense matrix A to a CSR matrix by percentage the following steps are performed. First the user calls musparseXpruneDense2csrByPercentage_bufferSize which determines the size of the temporary storage buffer. Once determined, this buffer must be allocated by the user. Next the user allocates the csr_row_ptr array to have m+1 elements and calls musparseXpruneDense2csr_nnzByPercentage. Finally the user finishes the conversion by allocating the csr_col_ind and csr_val arrays (whos size is determined by the value at nnz_total_dev_host_ptr) and calling musparseXpruneDense2csrByPercentage.
The pruning by percentage works by first sorting the absolute values of the dense matrix A. We then determine a position in this sorted array by formula \{"type":"element","name":"formula","attributes":\{"id":"112"\},"children":[\{"type":"text","text":"\\[\n pos = ceil(mn(percentage/100)) - 1\n pos = min(pos, m*n-1)\n pos = max(pos, 0)\n threshold = sorted_A[pos]\n \\]"\}]\} Once we have this threshold we prune values in the dense matrix A as in musparseXpruneDense2csr. It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.A: array of dimensions (lda,n)lda: leading dimension of dense arrayA.percentage: percentage >= 0 and percentage <= 100.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.csr_val: array of nnz ( =csr_row_ptr[m] -csr_row_ptr[0] ) nonzero elements of matrixA.csr_row_ptr: integer array ofm+1elements that contains the start of every row and the end of the last row plus one.csr_col_ind: integer array of nnz ( =csr_row_ptr[m] - csr_row_ptr[0] ) column indices of the non-zero elements of matrixA.info: prune information structuretemp_buffer: temporary storage buffer allocated by the user, size is returned by musparse_xprune_dense2csr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldaorpercentageis invalid.MUSPARSE_STATUS_INVALID_POINTER:Aordescrorinfoorcsr_valorcsr_row_ptrorcsr_col_indortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst floatA - muInt
lda - float
percentage - const musparseMatDescr_t
descrfloatcsr_valconst muIntcsr_row_ptrmuIntcsr_col_ind - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneDense2csrByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseDpruneDense2csrByPercentage(musparseHandle_t handle, muInt m, muInt n, const double `A, muInt lda, double percentage, const musparseMatDescr_t descr, double `csr_val, const muInt `csr_row_ptr, muInt `csr_col_ind, musparseMatInfo_t info, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst doubleA - muInt
lda - double
percentage - const musparseMatDescr_t
descrdoublecsr_valconst muIntcsr_row_ptrmuIntcsr_col_ind - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csrByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csrByPercentage(musparseHandle_t handle, muInt m, muInt n, const __half `A, muInt lda, float percentage, const musparseMatDescr_t descr, __half `csr_val, const muInt `csr_row_ptr, muInt `csr_col_ind, musparseMatInfo_t info, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst __halfA - muInt
lda - float
percentage - const musparseMatDescr_t
descr__halfcsr_valconst muIntcsr_row_ptrmuIntcsr_col_ind - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSdense2csc
MUSPARSE_EXPORT musparseStatus_t musparseSdense2csc(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const float `A, muInt ld, const muInt `nnz_per_columns, float `csc_val, muInt `csc_col_ptr, muInt *csc_row_ind)
This function converts the matrix A in dense format into a sparse matrix in CSC format. All the parameters are assumed to have been pre-allocated by the user and the arrays are filled in based on nnz_per_columns, which can be pre-computed with musparse_xnnz(). It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.A: array of dimensions (ld,n)ld: leading dimension of dense arrayA.nnz_per_columns: array of sizencontaining the number of non-zero elements per column.csc_val: array of nnz ( =csc_col_ptr[m] -csc_col_ptr[0] ) nonzero elements of matrixA.csc_col_ptr: integer array of m+1 elements that contains the start of every column and the end of the last column plus one.csc_row_ind: integer array of nnz ( =csc_col_ptr[m] - csc_col_ptr[0] ) column indices of the non-zero elements of matrixA.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p A or nnz_per_columns or csc_val csc_col_ptr or csc_row_ind pointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst floatA - muInt
ldconst muIntnnz_per_columnsfloatcsc_valmuIntcsc_col_ptrmuIntcsc_row_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDdense2csc
MUSPARSE_EXPORT musparseStatus_t musparseDdense2csc(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const double `A, muInt ld, const muInt `nnz_per_columns, double `csc_val, muInt `csc_col_ptr, muInt *csc_row_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst doubleA - muInt
ldconst muIntnnz_per_columnsdoublecsc_valmuIntcsc_col_ptrmuIntcsc_row_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCdense2csc
MUSPARSE_EXPORT musparseStatus_t musparseCdense2csc(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muComplex `A, muInt ld, const muInt `nnz_per_columns, muComplex `csc_val, muInt `csc_col_ptr, muInt *csc_row_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muComplexA - muInt
ldconst muIntnnz_per_columnsmuComplexcsc_valmuIntcsc_col_ptrmuIntcsc_row_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZdense2csc
MUSPARSE_EXPORT musparseStatus_t musparseZdense2csc(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muDoubleComplex `A, muInt ld, const muInt `nnz_per_columns, muDoubleComplex `csc_val, muInt `csc_col_ptr, muInt *csc_row_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muDoubleComplexA - muInt
ldconst muIntnnz_per_columnsmuDoubleComplexcsc_valmuIntcsc_col_ptrmuIntcsc_row_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSdense2coo
MUSPARSE_EXPORT musparseStatus_t musparseSdense2coo(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const float `A, muInt ld, const muInt `nnz_per_rows, float `coo_val, muInt `coo_row_ind, muInt *coo_col_ind)
This function converts the matrix A in dense format into a sparse matrix in COO format. All the parameters are assumed to have been pre-allocated by the user and the arrays are filled in based on nnz_per_rows, which can be pre-computed with musparse_xnnz().
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.A: array of dimensions (ld,n)ld: leading dimension of dense arrayA.nnz_per_rows: array of sizencontaining the number of non-zero elements per row.coo_val: array of nnz nonzero elements of matrixA.coo_row_ind: integer array of nnz row indices of the non-zero elements of matrixA.coo_col_ind: integer array of nnz column indices of the non-zero elements of matrixA.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p A or nnz_per_rows or coo_val coo_col_ind or coo_row_ind pointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst floatA - muInt
ldconst muIntnnz_per_rowsfloatcoo_valmuIntcoo_row_indmuIntcoo_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDdense2coo
MUSPARSE_EXPORT musparseStatus_t musparseDdense2coo(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const double `A, muInt ld, const muInt `nnz_per_rows, double `coo_val, muInt `coo_row_ind, muInt *coo_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst doubleA - muInt
ldconst muIntnnz_per_rowsdoublecoo_valmuIntcoo_row_indmuIntcoo_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCdense2coo
MUSPARSE_EXPORT musparseStatus_t musparseCdense2coo(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muComplex `A, muInt ld, const muInt `nnz_per_rows, muComplex `coo_val, muInt `coo_row_ind, muInt *coo_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muComplexA - muInt
ldconst muIntnnz_per_rowsmuComplexcoo_valmuIntcoo_row_indmuIntcoo_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZdense2coo
MUSPARSE_EXPORT musparseStatus_t musparseZdense2coo(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muDoubleComplex `A, muInt ld, const muInt `nnz_per_rows, muDoubleComplex `coo_val, muInt `coo_row_ind, muInt *coo_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muDoubleComplexA - muInt
ldconst muIntnnz_per_rowsmuDoubleComplexcoo_valmuIntcoo_row_indmuIntcoo_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2dense
MUSPARSE_EXPORT musparseStatus_t musparseScsr2dense(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, float `A, muInt ld)
This function converts the sparse matrix in CSR format into a dense matrix. It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.csr_val: array of nnz ( =csr_row_ptr[m] -csr_row_ptr[0] ) nonzero elements of matrixA.csr_row_ptr: integer array of m+1 elements that contains the start of every row and the end of the last row plus one.csr_col_ind: integer array of nnz ( =csr_row_ptr[m] - csr_row_ptr[0] ) column indices of the non-zero elements of matrixA.A: array of dimensions (ld,n)ld: leading dimension of dense arrayA.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p A or csr_val csr_row_ptr or csr_col_ind pointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indfloatA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2dense
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2dense(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, double `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_inddoubleA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2dense
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2dense(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muComplex `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indmuComplexA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2dense
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2dense(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muDoubleComplex `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indmuDoubleComplexA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsc2dense
MUSPARSE_EXPORT musparseStatus_t musparseScsc2dense(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const float `csc_val, const muInt `csc_col_ptr, const muInt `csc_row_ind, float `A, muInt ld)
This function converts the sparse matrix in CSC format into a dense matrix. It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.csc_val: array of nnz ( =csc_col_ptr[m] -csc_col_ptr[0] ) nonzero elements of matrixA.csc_col_ptr: integer array of m+1 elements that contains the start of every row and the end of the last row plus one.csc_row_ind: integer array of nnz ( =csc_col_ptr[m] - csc_col_ptr[0] ) column indices of the non-zero elements of matrixA.A: array of dimensions (ld,n)ld: leading dimension of dense arrayA.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorldis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p A or csc_val csc_col_ptr or csc_row_ind pointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst floatcsc_valconst muIntcsc_col_ptrconst muIntcsc_row_indfloatA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsc2dense
MUSPARSE_EXPORT musparseStatus_t musparseDcsc2dense(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const double `csc_val, const muInt `csc_col_ptr, const muInt `csc_row_ind, double `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst doublecsc_valconst muIntcsc_col_ptrconst muIntcsc_row_inddoubleA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsc2dense
MUSPARSE_EXPORT musparseStatus_t musparseCcsc2dense(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muComplex `csc_val, const muInt `csc_col_ptr, const muInt `csc_row_ind, muComplex `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muComplexcsc_valconst muIntcsc_col_ptrconst muIntcsc_row_indmuComplexA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsc2dense
MUSPARSE_EXPORT musparseStatus_t musparseZcsc2dense(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muDoubleComplex `csc_val, const muInt `csc_col_ptr, const muInt `csc_row_ind, muDoubleComplex `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muDoubleComplexcsc_valconst muIntcsc_col_ptrconst muIntcsc_row_indmuDoubleComplexA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScoo2dense
MUSPARSE_EXPORT musparseStatus_t musparseScoo2dense(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const float `coo_val, const muInt `coo_row_ind, const muInt `coo_col_ind, float `A, muInt ld)
This function converts the sparse matrix in COO format into a dense matrix. It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the dense matrixA.n: number of columns of the dense matrixA.nnz: number of non-zero entries of the sparse COO matrix.descr: the descriptor of the dense matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.coo_val: array of nnz nonzero elements of matrixA.coo_row_ind: integer array of nnz row indices of the non-zero elements of matrixA.coo_col_ind: integer array of nnz column indices of the non-zero elements of matrixA.A: array of dimensions (ld,n)ld: leading dimension of dense arrayA.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornornnzorldis invalid.MUSPARSE_STATUS_INVALID_POINTER:Aorcoo_valcoo_col_indorcoo_row_indpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst floatcoo_valconst muIntcoo_row_indconst muIntcoo_col_indfloatA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcoo2dense
MUSPARSE_EXPORT musparseStatus_t musparseDcoo2dense(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const double `coo_val, const muInt `coo_row_ind, const muInt `coo_col_ind, double `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst doublecoo_valconst muIntcoo_row_indconst muIntcoo_col_inddoubleA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcoo2dense
MUSPARSE_EXPORT musparseStatus_t musparseCcoo2dense(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const muComplex `coo_val, const muInt `coo_row_ind, const muInt `coo_col_ind, muComplex `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcoo_valconst muIntcoo_row_indconst muIntcoo_col_indmuComplexA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcoo2dense
MUSPARSE_EXPORT musparseStatus_t musparseZcoo2dense(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `coo_val, const muInt `coo_row_ind, const muInt `coo_col_ind, muDoubleComplex `A, muInt ld)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcoo_valconst muIntcoo_row_indconst muIntcoo_col_indmuDoubleComplexA - muInt
ld
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSnnz_compress
MUSPARSE_EXPORT musparseStatus_t musparseSnnz_compress(musparseHandle_t handle, muInt m, const musparseMatDescr_t descr_A, const float `csr_val_A, const muInt `csr_row_ptr_A, muInt `nnz_per_row, muInt `nnz_C, float tol)
Given a sparse CSR matrix and a non-negative tolerance, this function computes how many entries would be left in each row of the matrix if elements less than the tolerance were removed. It also computes the total number of remaining elements in the matrix.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.descr_A: the descriptor of the sparse CSR matrix.csr_val_A: array ofnnz_Aelements of the sparse CSR matrix.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the uncompressed sparse CSR matrix.nnz_per_row: array of lengthmcontaining the number of entries that will be kept per row in the final compressed CSR matrix.nnz_C: number of elements in the column indices and values arrays of the compressed sparse CSR matrix. Can be either host or device pointer.tol: the non-negative tolerance used for compression. Iftolis complex then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in output compressed CSR matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornis invalid.MUSPARSE_STATUS_INVALID_VALUE:tolis invalid.MUSPARSE_STATUS_INVALID_POINTER:csr_val_Aorcsr_row_ptr_Aornnz_per_rowornnz_Cpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
descr_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_AmuIntnnz_per_rowmuIntnnz_C - float
tol
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDnnz_compress
MUSPARSE_EXPORT musparseStatus_t musparseDnnz_compress(musparseHandle_t handle, muInt m, const musparseMatDescr_t descr_A, const double `csr_val_A, const muInt `csr_row_ptr_A, muInt `nnz_per_row, muInt `nnz_C, double tol)
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
descr_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_AmuIntnnz_per_rowmuIntnnz_C - double
tol
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCnnz_compress
MUSPARSE_EXPORT musparseStatus_t musparseCnnz_compress(musparseHandle_t handle, muInt m, const musparseMatDescr_t descr_A, const muComplex `csr_val_A, const muInt `csr_row_ptr_A, muInt `nnz_per_row, muInt `nnz_C, muComplex tol)
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
descr_Aconst muComplexcsr_val_Aconst muIntcsr_row_ptr_AmuIntnnz_per_rowmuIntnnz_C - muComplex
tol
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZnnz_compress
MUSPARSE_EXPORT musparseStatus_t musparseZnnz_compress(musparseHandle_t handle, muInt m, const musparseMatDescr_t descr_A, const muDoubleComplex `csr_val_A, const muInt `csr_row_ptr_A, muInt `nnz_per_row, muInt `nnz_C, muDoubleComplex tol)
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
descr_Aconst muDoubleComplexcsr_val_Aconst muIntcsr_row_ptr_AmuIntnnz_per_rowmuIntnnz_C - muDoubleComplex
tol
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsr2gebsc_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSgebsr2gebsc_bufferSize_legacy(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, size_t `p_buffer_size)
Convert a sparse GEneral BSR matrix into a sparse GEneral BSC matrix.
musparseXgebsr2gebsc_bufferSize returns the size of the temporary storage buffer required by musparseSgebsr2gebsc(), musparseDgebsr2gebsc(), musparseCgebsr2gebsc() and musparseZgebsr2gebsc(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.mb: number of rows of the sparse GEneral BSR matrix.nb: number of columns of the sparse GEneral BSR matrix.nnzb: number of non-zero entries of the sparse GEneral BSR matrix.bsr_val: array ofnnzb*row_block_dim*col_block_dimcontaining the values of the sparse GEneral BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every row of the sparse GEneral BSR matrix.bsr_col_ind: array ofnnzbelements containing the column indices of the sparse GEneral BSR matrix.row_block_dim: row size of the blocks in the sparse general BSR matrix.col_block_dim: col size of the blocks in the sparse general BSR matrix.p_buffer_size: number of bytes of the temporary storage buffer required by musparseSgebsr2gebsc(), musparseDgebsr2gebsc(), musparseCgebsr2gebsc() and musparseZgebsr2gebsc().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nbornnzbis invalid.MUSPARSE_STATUS_INVALID_POINTER:bsr_row_ptr,bsr_col_indorbuffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimsize_tp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsr2gebsc_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseDgebsr2gebsc_bufferSize_legacy(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, size_t `p_buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimsize_tp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsr2gebsc_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseCgebsr2gebsc_bufferSize_legacy(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, size_t `p_buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimsize_tp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsr2gebsc_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseZgebsr2gebsc_bufferSize_legacy(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, size_t `p_buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimsize_tp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsr2gebsc
MUSPARSE_EXPORT musparseStatus_t musparseSgebsr2gebsc(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, float `bsc_val, muInt `bsc_row_ind, muInt `bsc_col_ptr, musparseAction_t copy_values, musparseIndexBase_t idx_base, void *temp_buffer)
Convert a sparse GEneral BSR matrix into a sparse GEneral BSC matrix.
musparseXgebsr2gebsc converts a GEneral BSR matrix into a GEneral BSC matrix. musparseXgebsr2gebsc can also be used to convert a GEneral BSC matrix into a GEneral BSR matrix. copy_values decides whether bsc_val is being filled during conversion (MUSPARSE_ACTION_NUMERIC) or not (MUSPARSE_ACTION_SYMBOLIC).
musparseXgebsr2gebsc requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by musparseXgebsr2gebsc_bufferSize().
注意:The resulting matrix can also be seen as the transpose of the input matrix.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.mb: number of rows of the sparse GEneral BSR matrix.nb: number of columns of the sparse GEneral BSR matrix.nnzb: number of non-zero entries of the sparse GEneral BSR matrix.bsr_val: array ofnnzbrow_block_dim*col_block_dim` elements of the sparse GEneral BSR matrix.bsr_row_ptr: array ofm+1elements that point to the start of every row of the sparse GEneral BSR matrix.bsr_col_ind: array ofnnzelements containing the column indices of the sparse GEneral BSR matrix.row_block_dim: row size of the blocks in the sparse general BSR matrix.col_block_dim: col size of the blocks in the sparse general BSR matrix.bsc_val: array ofnnzelements of the sparse BSC matrix.bsc_row_ind: array ofnnzelements containing the row indices of the sparse BSC matrix.bsc_col_ptr: array ofn+1elements that point to the start of every column of the sparse BSC matrix.copy_values: MUSPARSE_ACTION_SYMBOLIC or MUSPARSE_ACTION_NUMERIC.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseXgebsr2gebsc_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mb,nbornnzbis invalid.MUSPARSE_STATUS_INVALID_POINTER:bsr_val,bsr_row_ptr,bsr_col_ind,bsc_val,bsc_row_ind,bsc_col_ptrortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Example:
This example computes the transpose of a GEneral BSR matrix.
// 1 2 0 3
// A = 0 4 5 0
// 6 0 0 7
// 1 2 3 4
muInt mb_A = 2;
muInt row_block_dim = 2;
muInt col_block_dim = 2;
muInt nb_A = 2;
muInt nnzb_A = 4;
bsr_row_ptr_A[mb_A+1] = \{0, 2, 4\}; // device memory
bsr_col_ind_A[nnzb_A] = \{0, 1, 0, 1\}; // device memory
bsr_val_A[nnzb_A] = \{1, 0, 2, 4, 0, 5, 3, 0, 6, 1, 0, 2, 0, 3, 7,
4\}; // device memory
// Allocate memory for transposed BSR matrix
muInt mb_T = nb_A;
muInt nb_T = mb_A;
muInt nnzb_T = nnzb_A;
muInt* bsr_row_ptr_T;
muInt* bsr_col_ind_T;
float* bsr_val_T;
musaMalloc((void``)&bsr_row_ptr_T, sizeof(muInt) * (mb_T + 1));
musaMalloc((void``)&bsr_col_ind_T, sizeof(muInt) * nnzb_T);
musaMalloc((void``)&bsr_val_T, sizeof(float) * nnzb_T);
// Obtain the temporary buffer size
size_t buffer_size;
musparseXgebsr2gebsc_bufferSize(handle,
mb_A,
nb_A,
nnzb_A,
bsr_row_ptr_A,
bsr_col_ind_A,
MUSPARSE_ACTION_NUMERIC,
&buffer_size);
// Allocate temporary buffer
void* temp_buffer;
musaMalloc(&temp_buffer, buffer_size);
musparseSgebsr2gebsc(handle,
mb_A,
nb_A,
nnzb_A,
bsr_val_A,
bsr_row_ptr_A,
bsr_col_ind_A,
row_block_dim,
col_block_dim,
bsr_val_T,
bsr_col_ind_T,
bsr_row_ptr_T,
MUSPARSE_ACTION_NUMERIC,
MUSPARSE_INDEX_BASE_ZERO,
temp_buffer);
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimfloatbsc_valmuIntbsc_row_indmuIntbsc_col_ptr - musparseAction_t
copy_values - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsr2gebsc
MUSPARSE_EXPORT musparseStatus_t musparseDgebsr2gebsc(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, double `bsc_val, muInt `bsc_row_ind, muInt `bsc_col_ptr, musparseAction_t copy_values, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimdoublebsc_valmuIntbsc_row_indmuIntbsc_col_ptr - musparseAction_t
copy_values - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsr2gebsc
MUSPARSE_EXPORT musparseStatus_t musparseCgebsr2gebsc(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, muComplex `bsc_val, muInt `bsc_row_ind, muInt `bsc_col_ptr, musparseAction_t copy_values, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimmuComplexbsc_valmuIntbsc_row_indmuIntbsc_col_ptr - musparseAction_t
copy_values - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsr2gebsc
MUSPARSE_EXPORT musparseStatus_t musparseZgebsr2gebsc(musparseHandle_t handle, muInt mb, muInt nb, muInt nnzb, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, muDoubleComplex `bsc_val, muInt `bsc_row_ind, muInt `bsc_col_ptr, musparseAction_t copy_values, musparseIndexBase_t idx_base, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
mb - muInt
nb - muInt
nnzbconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimmuDoubleComplexbsc_valmuIntbsc_row_indmuIntbsc_col_ptr - musparseAction_t
copy_values - musparseIndexBase_t
idx_basevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2ell
MUSPARSE_EXPORT musparseStatus_t musparseScsr2ell(musparseHandle_t handle, muInt m, const musparseMatDescr_t csr_descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t ell_descr, muInt ell_width, float `ell_val, muInt *ell_col_ind)
Convert a sparse CSR matrix into a sparse ELL matrix.
musparseXcsr2ell converts a CSR matrix into an ELL matrix. It is assumed, that ell_val and ell_col_ind are allocated. Allocation size is computed by the number of rows times the number of ELL non-zero elements per row, such that formula \{"type":"element","name":"formula","attributes":\{"id":"113"\},"children":[\{"type":"text","text":"$\\text\{nnz\}_\{\\text\{ELL\}\} = m \\cdot \\text\{ell_width\}$"\}]\}. The number of ELL non-zero elements per row is obtained by musparseXcsr2csr2ell_width().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array containing the values of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array containing the column indices of the sparse CSR matrix.ell_descr: descriptor of the sparse ELL matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.ell_width: number of non-zero elements per row in ELL storage format.ell_val: array ofmtimesell_widthelements of the sparse ELL matrix.ell_col_ind: array ofmtimesell_widthelements containing the column indices of the sparse ELL matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:morell_widthis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p csr_descr, csr_val, csr_row_ptr, csr_col_ind, ell_descr, ell_val or ell_col_ind pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example converts a CSR matrix into an ELL matrix.
// 1 2 0 3 0
// A = 0 4 5 0 0
// 6 0 0 7 8
muInt m = 3;
muInt n = 5;
muInt nnz = 8;
csr_row_ptr[m+1] = \{0, 3, 5, 8\}; // device memory
csr_col_ind[nnz] = \{0, 1, 3, 1, 2, 0, 3, 4\}; // device memory
csr_val[nnz] = \{1, 2, 3, 4, 5, 6, 7, 8\}; // device memory
// Create ELL matrix descriptor
musparseMatDescr_t ell_descr;
musparseCreateMatDescr(&ell_descr);
// Obtain the ELL width
muInt ell_width;
musparseXcsr2csr2ell_width(handle,
m,
csr_descr,
csr_row_ptr,
ell_descr,
&ell_width);
// Compute ELL non-zero entries
muInt ell_nnz = m * ell_width;
// Allocate ELL column and value arrays
muInt* ell_col_ind;
musaMalloc((void``)&ell_col_ind, sizeof(muInt) * ell_nnz);
float* ell_val;
musaMalloc((void``)&ell_val, sizeof(float) * ell_nnz);
// Format conversion
musparseScsr2ell(handle,
m,
csr_descr,
csr_val,
csr_row_ptr,
csr_col_ind,
ell_descr,
ell_width,
ell_val,
ell_col_ind);
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
csr_descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
ell_descr - muInt
ell_widthfloatell_valmuIntell_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2ell
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2ell(musparseHandle_t handle, muInt m, const musparseMatDescr_t csr_descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t ell_descr, muInt ell_width, double `ell_val, muInt *ell_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
csr_descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
ell_descr - muInt
ell_widthdoubleell_valmuIntell_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2ell
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2ell(musparseHandle_t handle, muInt m, const musparseMatDescr_t csr_descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t ell_descr, muInt ell_width, muComplex `ell_val, muInt *ell_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
csr_descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
ell_descr - muInt
ell_widthmuComplexell_valmuIntell_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2ell
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2ell(musparseHandle_t handle, muInt m, const musparseMatDescr_t csr_descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t ell_descr, muInt ell_width, muDoubleComplex `ell_val, muInt *ell_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
csr_descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
ell_descr - muInt
ell_widthmuDoubleComplexell_valmuIntell_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2hyb
MUSPARSE_EXPORT musparseStatus_t musparseScsr2hyb(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt *csr_col_ind, musparseHybMat_t hyb, muInt user_ell_width, musparseHybPartition_t partition_type)
Convert a sparse CSR matrix into a sparse HYB matrix.
musparseXcsr2hyb converts a CSR matrix into a HYB matrix. It is assumed that hyb has been initialized with musparseCreateHybMat().
注意:This function requires a significant amount of storage for the HYB matrix, depending on the matrix structure.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array containing the values of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array containing the column indices of the sparse CSR matrix.hyb: sparse matrix in HYB format.user_ell_width: width of the ELL part of the HYB matrix (only required ifpartition_type== MUSPARSE_HYB_PARTITION_USER).partition_type: MUSPARSE_HYB_PARTITION_AUTO (recommended), MUSPARSE_HYB_PARTITION_USER or MUSPARSE_HYB_PARTITION_MAX.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,noruser_ell_widthis invalid.MUSPARSE_STATUS_INVALID_VALUE:partition_typeis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,hyb,csr_val,csr_row_ptrorcsr_col_indpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer for the HYB matrix could not be allocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example converts a CSR matrix into a HYB matrix using user defined partitioning.
// Create HYB matrix structure
musparseHybMat_t hyb;
musparseCreateHybMat(&hyb);
// User defined ell width
muInt user_ell_width = 5;
// Perform the conversion
musparseScsr2hyb(handle,
m,
n,
descr,
csr_val,
csr_row_ptr,
csr_col_ind,
hyb,
user_ell_width,
MUSPARSE_HYB_PARTITION_USER);
// Do some work
// Clean up
musparseDestroyHybMat(hyb);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseHybMat_t
hyb - muInt
user_ell_width - musparseHybPartition_t
partition_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2hyb
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2hyb(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt *csr_col_ind, musparseHybMat_t hyb, muInt user_ell_width, musparseHybPartition_t partition_type)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseHybMat_t
hyb - muInt
user_ell_width - musparseHybPartition_t
partition_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2hyb
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2hyb(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt *csr_col_ind, musparseHybMat_t hyb, muInt user_ell_width, musparseHybPartition_t partition_type)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseHybMat_t
hyb - muInt
user_ell_width - musparseHybPartition_t
partition_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2hyb
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2hyb(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt *csr_col_ind, musparseHybMat_t hyb, muInt user_ell_width, musparseHybPartition_t partition_type)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseHybMat_t
hyb - muInt
user_ell_width - musparseHybPartition_t
partition_type
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2bsr
MUSPARSE_EXPORT musparseStatus_t musparseScsr2bsr(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt block_dim, const musparseMatDescr_t bsr_descr, float `bsr_val, muInt `bsr_row_ptr, muInt `bsr_col_ind)
Convert a sparse CSR matrix into a sparse BSR matrix.
musparseXcsr2bsr converts a CSR matrix into a BSR matrix. It is assumed, that bsr_val, bsr_col_ind and bsr_row_ptr are allocated. Allocation size for bsr_row_ptr is computed as mb+1 where mb is the number of block rows in the BSR matrix. Allocation size for bsr_val and bsr_col_ind is computed using csr2bsr_nnz() which also fills in bsr_row_ptr.
musparseXcsr2bsr requires extra temporary storage that is allocated internally if block_dim\>16
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks, MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMNm: number of rows in the sparse CSR matrix.n: number of columns in the sparse CSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array ofnnzelements containing the values of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.block_dim: size of the blocks in the sparse BSR matrix.bsr_descr: descriptor of the sparse BSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:bsr_val,bsr_row_ptr,bsr_col_ind,csr_val,csr_row_ptrorcsr_col_indpointer is invalid.
Example:
This example converts a CSR matrix into an BSR matrix.
// 1 4 0 0 0 0
// A = 0 2 3 0 0 0
// 5 0 0 7 8 0
// 0 0 9 0 6 0
muInt m = 4;
muInt n = 6;
muInt block_dim = 2;
muInt nnz = 9;
muInt mb = (m + block_dim - 1) / block_dim;
muInt nb = (n + block_dim - 1) / block_dim;
csr_row_ptr[m+1] = \{0, 2, 4, 7, 9\}; // device memory
csr_col_ind[nnz] = \{0, 1, 1, 2, 0, 3, 4, 2, 4\}; // device memory
csr_val[nnz] = \{1, 4, 2, 3, 5, 7, 8, 9, 6\}; // device memory
musaMalloc(&bsr_row_ptr, sizeof(muInt) *(mb + 1));
muInt nnzb;
muInt* nnzTotalHostPtr = &nnzb;
csr2bsr_nnz(handle,
MUSPARSE_DIRECTION_ROW,
m,
n,
csr_descr,
csr_row_ptr,
csr_col_ind,
block_dim,
bsr_descr,
bsr_row_ptr,
nnzTotalHostPtr);
nnzb = *nnzTotalDevHostPtr;
musaMalloc(&bsr_col_ind, sizeof(muInt)*nnzb);
musaMalloc(&bsr_val, sizeof(float)`(block_dim ` block_dim) * nnzb);
scsr2bsr(handle,
MUSPARSE_DIRECTION_ROW,
m,
n,
csr_descr,
csr_val,
csr_row_ptr,
csr_col_ind,
block_dim,
bsr_descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
block_dim - const musparseMatDescr_t
bsr_descrfloatbsr_valmuIntbsr_row_ptrmuIntbsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2bsr
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2bsr(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt block_dim, const musparseMatDescr_t bsr_descr, double `bsr_val, muInt `bsr_row_ptr, muInt `bsr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
block_dim - const musparseMatDescr_t
bsr_descrdoublebsr_valmuIntbsr_row_ptrmuIntbsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2bsr
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2bsr(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt block_dim, const musparseMatDescr_t bsr_descr, muComplex `bsr_val, muInt `bsr_row_ptr, muInt `bsr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
block_dim - const musparseMatDescr_t
bsr_descrmuComplexbsr_valmuIntbsr_row_ptrmuIntbsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2bsr
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2bsr(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt block_dim, const musparseMatDescr_t bsr_descr, muDoubleComplex `bsr_val, muInt `bsr_row_ptr, muInt `bsr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
block_dim - const musparseMatDescr_t
bsr_descrmuDoubleComplexbsr_valmuIntbsr_row_ptrmuIntbsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2gebsr_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseScsr2gebsr_bufferSize_legacy(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt row_block_dim, muInt col_block_dim, size_t `p_buffer_size)
musparseXcsr2gebsr_bufferSize returns the size of the temporary buffer that is required by musparse_csr2gebcsr_nnz, musparse_scsr2gebcsr, musparseDcsr2gebsr, musparseCcsr2gebsr and musparseZcsr2gebsr. The temporary storage buffer must be allocated by the user.
This function computes the number of nonzero block columns per row and the total number of nonzero blocks in a sparse GEneral BSR matrix given a sparse CSR matrix as input.
The routine does support asynchronous execution if the pointer mode is set to device.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specified whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array ofnnzelements containing the values of the sparse CSR matrix.csr_row_ptr: integer array containingm+1elements that point to the start of each row of the CSR matrixcsr_col_ind: integer array of the column indices for each non-zero element in the CSR matrixrow_block_dim: the row block dimension of the GEneral BSR matrix. Between 1 andmcol_block_dim: the col block dimension of the GEneral BSR matrix. Between 1 andnp_buffer_size: (host/device) number of bytes of the temporary storage buffer required bymusparseXcsr2gebsr_nnzandmusparseScsr2gebsr.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorrow_block_dimcol_block_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:csr_valorcsr_row_ptrorcsr_col_indorbsr_row_ptrorp_buffer_sizepointer is invalid.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
row_block_dim - muInt
col_block_dimsize_tp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2gebsr_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2gebsr_bufferSize_legacy(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt row_block_dim, muInt col_block_dim, size_t `p_buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
row_block_dim - muInt
col_block_dimsize_tp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2gebsr_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2gebsr_bufferSize_legacy(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt row_block_dim, muInt col_block_dim, size_t `p_buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
row_block_dim - muInt
col_block_dimsize_tp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2gebsr_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2gebsr_bufferSize_legacy(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt row_block_dim, muInt col_block_dim, size_t `p_buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
row_block_dim - muInt
col_block_dimsize_tp_buffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsr2gebsr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseXcsr2gebsr_nnz(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t bsr_descr, muInt `bsr_row_ptr, muInt row_block_dim, muInt col_block_dim, muInt `bsr_nnz_devhost, void *p_buffer)
This function computes the number of nonzero block columns per row and the total number of nonzero blocks in a sparse GEneral BSR matrix given a sparse CSR matrix as input.
The routine does support asynchronous execution if the pointer mode is set to device.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specified whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr: integer array containingm+1elements that point to the start of each row of the CSR matrixcsr_col_ind: integer array of the column indices for each non-zero element in the CSR matrixbsr_descr: descriptor of the sparse GEneral BSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_row_ptr: integer array containingmb+1elements that point to the start of each block row of the General BSR matrixrow_block_dim: the row block dimension of the GEneral BSR matrix. Between 1 and min(m, n)col_block_dim: the col block dimension of the GEneral BSR matrix. Between 1 and min(m, n)bsr_nnz_devhost: total number of nonzero elements in device or host memory.p_buffer: buffer allocated by the user whose size is determined by callingmusparse_xcsr2gebsr_buffer_size.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorrow_block_dimcol_block_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p csr_row_ptr or csr_col_ind or bsr_row_ptr or bsr_nnz_devhost pointer is invalid.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
bsr_descrmuIntbsr_row_ptr - muInt
row_block_dim - muInt
col_block_dimmuIntbsr_nnz_devhostvoidp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2gebsr
MUSPARSE_EXPORT musparseStatus_t musparseScsr2gebsr(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t bsr_descr, float `bsr_val, muInt `bsr_row_ptr, muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, void *p_buffer)
Convert a sparse CSR matrix into a sparse GEneral BSR matrix.
musparseXcsr2gebsr converts a CSR matrix into a GEneral BSR matrix. It is assumed, that bsr_val, bsr_col_ind and bsr_row_ptr are allocated. Allocation size for bsr_row_ptr is computed as mb+1 where mb is the number of block rows in the GEneral BSR matrix. Allocation size for bsr_val and bsr_col_ind is computed using csr2gebsr_nnz() which also fills in bsr_row_ptr.
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks, MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMNm: number of rows in the sparse CSR matrix.n: number of columns in the sparse CSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array ofnnzelements containing the values of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.bsr_descr: descriptor of the sparse BSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzb*row_block_dim*col_block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.row_block_dim: row size of the blocks in the sparse GEneral BSR matrix.col_block_dim: col size of the blocks in the sparse GEneral BSR matrix.p_buffer: buffer allocated by the user whose size is determined by callingmusparse_xcsr2gebsr_buffer_size.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorrow_block_dimorcol_block_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p bsr_val, bsr_row_ptr, bsr_col_ind, csr_val, csr_row_ptr or csr_col_ind pointer is invalid.
Example:
This example converts a CSR matrix into an BSR matrix.
// 1 4 0 0 0 0
// A = 0 2 3 0 0 0
// 5 0 0 7 8 0
// 0 0 9 0 6 0
muInt m = 4;
muInt n = 6;
muInt row_block_dim = 2;
muInt col_block_dim = 3;
muInt nnz = 9;
muInt mb = (m + row_block_dim - 1) / row_block_dim;
muInt nb = (n + col_block_dim - 1) / col_block_dim;
csr_row_ptr[m+1] = \{0, 2, 4, 7, 9\}; // device memory
csr_col_ind[nnz] = \{0, 1, 1, 2, 0, 3, 4, 2, 4\}; // device memory
csr_val[nnz] = \{1, 4, 2, 3, 5, 7, 8, 9, 6\}; // device memory
musaMalloc(&bsr_row_ptr, sizeof(muInt) *(mb + 1));
muInt nnzb;
muInt* nnzTotalHostPtr = &nnzb;
csr2gebsr_nnz(handle,
MUSPARSE_DIRECTION_ROW,
m,
n,
csr_descr,
csr_row_ptr,
csr_col_ind,
row_block_dim,
col_block_dim,
bsr_descr,
bsr_row_ptr,
nnzTotalHostPtr);
nnzb = *nnzTotalDevHostPtr;
musaMalloc(&bsr_col_ind, sizeof(muInt)*nnzb);
musaMalloc(&bsr_val, sizeof(float)`(row_block_dim ` col_block_dim) *
nnzb); scsr2gebsr(handle, MUSPARSE_DIRECTION_ROW, m, n, csr_descr, csr_val,
csr_row_ptr,
csr_col_ind,
row_block_dim,
col_block_dim,
bsr_descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
bsr_descrfloatbsr_valmuIntbsr_row_ptrmuIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimvoidp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2gebsr
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2gebsr(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t bsr_descr, double `bsr_val, muInt `bsr_row_ptr, muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, void *p_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
bsr_descrdoublebsr_valmuIntbsr_row_ptrmuIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimvoidp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2gebsr
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2gebsr(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t bsr_descr, muComplex `bsr_val, muInt `bsr_row_ptr, muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, void *p_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
bsr_descrmuComplexbsr_valmuIntbsr_row_ptrmuIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimvoidp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2gebsr
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2gebsr(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const musparseMatDescr_t bsr_descr, muDoubleComplex `bsr_val, muInt `bsr_row_ptr, muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, void *p_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_ind - const musparseMatDescr_t
bsr_descrmuDoubleComplexbsr_valmuIntbsr_row_ptrmuIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dimvoidp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsr2csr_compress
MUSPARSE_EXPORT musparseStatus_t musparseScsr2csr_compress(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, muInt nnz_A, const muInt `nnz_per_row, float `csr_val_C, muInt `csr_row_ptr_C, muInt *csr_col_ind_C, float tol)
Convert a sparse CSR matrix into a compressed sparse CSR matrix.
musparseXcsr2csr_compress converts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative threshold tol
注意:In the case of complex matrices only the magnitude of the real part of
tolis used.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.descr_A: matrix descriptor for the CSR matrixcsr_val_A: array ofnnz_Aelements of the sparse CSR matrix.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the uncompressed sparse CSR matrix.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the uncompressed sparse CSR matrix.nnz_A: number of elements in the column indices and values arrays of the uncompressed sparse CSR matrix.nnz_per_row: array of lengthmcontaining the number of entries that will be kept per row in the final compressed CSR matrix.csr_val_C: array ofnnz_Celements of the compressed sparse CSC matrix.csr_row_ptr_C: array ofm+1elements that point to the start of every column of the compressed sparse CSR matrix.csr_col_ind_C: array ofnnz_Celements containing the row indices of the compressed sparse CSR matrix.tol: the non-negative tolerance used for compression. Iftolis complex then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in output compressed CSR matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnz_Ais invalid.MUSPARSE_STATUS_INVALID_VALUE:tolis invalid.MUSPARSE_STATUS_INVALID_POINTER:csr_val_A,csr_row_ptr_A,csr_col_ind_A,csr_val_C,csr_row_ptr_C,csr_col_ind_Cornnz_per_rowpointer is invalid.
Example:
This example demonstrates how to compress a CSR matrix. Compressing a CSR matrix involves two steps. First we use nnz_compress() to determine how many entries will be in the final compressed CSR matrix. Then we call csr2csr_compress() to finish the compression and fill in the column indices and values arrays of the compressed CSR matrix.
// 1 2 0 3 0
// A = 0 4 5 0 0
// 6 0 0 7 8
float tol = 0.0f;
muInt m = 3;
muInt n = 5;
muInt nnz_A = 8;
csr_row_ptr_A[m+1] = \{0, 3, 5, 8\}; // device memory
csr_col_ind_A[nnz_A] = \{0, 1, 3, 1, 2, 0, 3, 4\}; // device memory
csr_val_A[nnz_A] = \{1, 0, 3, 4, 0, 6, 7, 0\}; // device memory
// Allocate memory for the row pointer array of the compressed CSR
matrix muInt* csr_row_ptr_C; musaMalloc(csr_row_ptr_C,
sizeof(muInt) * (m + 1));
// Allocate memory for the nnz_per_row array
muInt* nnz_per_row;
musaMalloc(nnz_per_row, sizeof(muInt) * m);
// Call nnz_compress() which fills in nnz_per_row array and finds the
number
// of entries that will be in the compressed CSR matrix
muInt nnz_C;
nnz_compress(handle,
m,
descr_A,
csr_val_A,
csr_row_ptr_A,
nnz_per_row,
&nnz_C,
tol);
// Allocate column indices and values array for the compressed CSR
matrix muInt` csr_col_ind_C; muInt` csr_val_C;
musaMalloc(csr_col_ind_C, sizeof(muInt) * nnz_C;
musaMalloc(csr_val_C, sizeof(muInt) * nnz_C;
// Finish compression by calling csr2csr_compress()
csr2csr_compress(handle,
m,
n,
descr_A,
csr_val_A,
csr_row_ptr_A,
csr_col_ind_A,
nnz_A,
nnz_per_row,
csr_val_C,
csr_row_ptr_C,
csr_col_ind_C,
tol);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descr_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - muInt
nnz_Aconst muIntnnz_per_rowfloatcsr_val_CmuIntcsr_row_ptr_CmuIntcsr_col_ind_C - float
tol
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsr2csr_compress
MUSPARSE_EXPORT musparseStatus_t musparseDcsr2csr_compress(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, muInt nnz_A, const muInt `nnz_per_row, double `csr_val_C, muInt `csr_row_ptr_C, muInt *csr_col_ind_C, double tol)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descr_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - muInt
nnz_Aconst muIntnnz_per_rowdoublecsr_val_CmuIntcsr_row_ptr_CmuIntcsr_col_ind_C - double
tol
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsr2csr_compress
MUSPARSE_EXPORT musparseStatus_t musparseCcsr2csr_compress(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr_A, const muComplex `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, muInt nnz_A, const muInt `nnz_per_row, muComplex `csr_val_C, muInt `csr_row_ptr_C, muInt *csr_col_ind_C, muComplex tol)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descr_Aconst muComplexcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - muInt
nnz_Aconst muIntnnz_per_rowmuComplexcsr_val_CmuIntcsr_row_ptr_CmuIntcsr_col_ind_C - muComplex
tol
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsr2csr_compress
MUSPARSE_EXPORT musparseStatus_t musparseZcsr2csr_compress(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr_A, const muDoubleComplex `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, muInt nnz_A, const muInt `nnz_per_row, muDoubleComplex `csr_val_C, muInt `csr_row_ptr_C, muInt *csr_col_ind_C, muDoubleComplex tol)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descr_Aconst muDoubleComplexcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - muInt
nnz_Aconst muIntnnz_per_rowmuDoubleComplexcsr_val_CmuIntcsr_row_ptr_CmuIntcsr_col_ind_C - muDoubleComplex
tol
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csr_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const float `threshold, const musparseMatDescr_t csr_descr_C, const float `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, size_t `buffer_size)
Convert and prune sparse CSR matrix into a sparse CSR matrix.
musparseXpruneCsr2csr_bufferSize returns the size of the temporary buffer that is required by musparseSpruneCsr2csr_nnz, musparseDpruneCsr2csr_nnz, musparseSpruneCsr2csr, and musparseDpruneCsr2csr. The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: number of rows in the sparse CSR matrix.n: number of columns in the sparse CSR matrix.nnz_A: number of non-zeros in the sparse CSR matrix A.csr_descr_A: descriptor of the sparse CSR matrix A. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_A: array ofnnz_Aelements containing the values of the sparse CSR matrix A.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrix A.threshold: pointer to the non-negative pruning threshold which can exist in either host or device memory.csr_descr_C: descriptor of the sparse CSR matrix C. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_C: array ofnnz_Celements containing the values of the sparse CSR matrix C.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrix C.csr_col_ind_C: array ofnnz_Celements containing the column indices of the sparse CSR matrix C.buffer_size: number of bytes of the temporary storage buffer required bymusparseSpruneCsr2csr_nnz,musparseDpruneCsr2csr_nnz,musparseSpruneCsr2csr, andmusparseDpruneCsr2csr.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:buffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst floatthreshold - const musparseMatDescr_t
csr_descr_Cconst floatcsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csr_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const double `threshold, const musparseMatDescr_t csr_descr_C, const double `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst doublethreshold - const musparseMatDescr_t
csr_descr_Cconst doublecsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csr_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const __half `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const __half `threshold, const musparseMatDescr_t csr_descr_C, const __half `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst __halfcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst __halfthreshold - const musparseMatDescr_t
csr_descr_Cconst __halfcsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneDense2csr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseHpruneDense2csr_bufferSize(musparseHandle_t handle, muInt m, muInt n, const __half `A, muInt lda, const __half `threshold, const musparseMatDescr_t descr, const __half `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nconst __halfA - muInt
ldaconst __halfthreshold - const musparseMatDescr_t
descrconst __halfcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csr_nnz(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const float `threshold, const musparseMatDescr_t csr_descr_C, muInt `csr_row_ptr_C, muInt `nnz_total_dev_host_ptr, void *temp_buffer)
Convert and prune sparse CSR matrix into a sparse CSR matrix.
musparseXpruneCsr2csr_nnz computes the number of nonzero elements per row and the total number of nonzero elements in a sparse CSR matrix once elements less than the threshold are pruned from the matrix.
注意:The routine does support asynchronous execution if the pointer mode is set to device.
Parameters:
handle: handle to the musparse library context queue.m: number of rows in the sparse CSR matrix.n: number of columns in the sparse CSR matrix.nnz_A: number of non-zeros in the sparse CSR matrix A.csr_descr_A: descriptor of the sparse CSR matrix A. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_A: array ofnnz_Aelements containing the values of the sparse CSR matrix A.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrix A.threshold: pointer to the non-negative pruning threshold which can exist in either host or device memory.csr_descr_C: descriptor of the sparse CSR matrix C. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrix C.nnz_total_dev_host_ptr: total number of nonzero elements in device or host memory.temp_buffer: buffer allocated by the user whose size is determined by callingmusparse_xprune_csr2csr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornornnz_Ais invalid.MUSPARSE_STATUS_INVALID_POINTER:thresholdorcsr_descr_Aorcsr_descr_Corcsr_val_Aorcsr_row_ptr_Aorcsr_col_ind_Aorcsr_row_ptr_Cornnz_total_dev_host_ptrortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst floatthreshold - const musparseMatDescr_t
csr_descr_CmuIntcsr_row_ptr_CmuIntnnz_total_dev_host_ptrvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csr_nnz(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const double `threshold, const musparseMatDescr_t csr_descr_C, muInt `csr_row_ptr_C, muInt `nnz_total_dev_host_ptr, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst doublethreshold - const musparseMatDescr_t
csr_descr_CmuIntcsr_row_ptr_CmuIntnnz_total_dev_host_ptrvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csr_nnz(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const __half `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const __half `threshold, const musparseMatDescr_t csr_descr_C, muInt `csr_row_ptr_C, muInt `nnz_total_dev_host_ptr, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst __halfcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst __halfthreshold - const musparseMatDescr_t
csr_descr_CmuIntcsr_row_ptr_CmuIntnnz_total_dev_host_ptrvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csr(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const float `threshold, const musparseMatDescr_t csr_descr_C, float `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, void `temp_buffer)
Convert and prune sparse CSR matrix into a sparse CSR matrix.
This function converts the sparse CSR matrix A into a sparse CSR matrix C by pruning values in A that are less than the threshold. All the parameters are assumed to have been pre-allocated by the user. The user first calls musparse_xprune_csr2csr_buffer_size() to determine the size of the buffer used by musparse_xprune_csr2csr_nnz() and musparse_xprune_csr2csr() which the user then allocates. The user then allocates csr_row_ptr_C to have m+1 elements and then calls musparse_xprune_csr2csr_nnz() which fills in the csr_row_ptr_C array stores then number of elements that are larger than the pruning threshold in nnz_total_dev_host_ptr. The user then calls musparse_xprune_csr2csr() to complete the conversion. It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows in the sparse CSR matrix.n: number of columns in the sparse CSR matrix.nnz_A: number of non-zeros in the sparse CSR matrix A.csr_descr_A: descriptor of the sparse CSR matrix A. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_A: array ofnnz_Aelements containing the values of the sparse CSR matrix A.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrix A.threshold: pointer to the non-negative pruning threshold which can exist in either host or device memory.csr_descr_C: descriptor of the sparse CSR matrix C. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_C: array ofnnz_Celements containing the values of the sparse CSR matrix C.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrix C.csr_col_ind_C: array ofnnz_Celements containing the column indices of the sparse CSR matrix C.temp_buffer: buffer allocated by the user whose size is determined by callingmusparse_xprune_csr2csr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornornnz_Ais invalid.MUSPARSE_STATUS_INVALID_POINTER:thresholdorcsr_descr_Aorcsr_descr_Corcsr_val_Aorcsr_row_ptr_Aorcsr_col_ind_Aorcsr_val_Corcsr_row_ptr_Corcsr_col_ind_Cortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst floatthreshold - const musparseMatDescr_t
csr_descr_Cfloatcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csr(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const double `threshold, const musparseMatDescr_t csr_descr_C, double `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst doublethreshold - const musparseMatDescr_t
csr_descr_Cdoublecsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csr
musparseStatus_t musparseHpruneCsr2csr(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const __half `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const __half `threshold, const musparseMatDescr_t csr_descr_C, __half `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst __halfcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_Aconst __halfthreshold - const musparseMatDescr_t
csr_descr_C__halfcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_Cvoidtemp_buffer
Return type: musparseStatus_t
Function musparseSpruneCsr2csrByPercentage_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csrByPercentage_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, float percentage, const musparseMatDescr_t csr_descr_C, const float `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, musparseMatInfo_t info, size_t *buffer_size)
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.
musparse_prune_csr2csr__by_percentage_buffer_size returns the size of the temporary buffer that is required by musparseSpruneCsr2csr_nnzByPercentage, musparseDpruneCsr2csr_nnzByPercentage, musparseSpruneCsr2csrByPercentage, and musparseDpruneCsr2csrByPercentage. The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: number of rows in the sparse CSR matrix.n: number of columns in the sparse CSR matrix.nnz_A: number of non-zeros in the sparse CSR matrix A.csr_descr_A: descriptor of the sparse CSR matrix A. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_A: array ofnnz_Aelements containing the values of the sparse CSR matrix A.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrix A.percentage: percentage >= 0 and percentage <= 100.csr_descr_C: descriptor of the sparse CSR matrix C. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_C: array ofnnz_Celements containing the values of the sparse CSR matrix C.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrix C.csr_col_ind_C: array ofnnz_Celements containing the column indices of the sparse CSR matrix C.info: prune info structure.buffer_size: number of bytes of the temporary storage buffer required bymusparseSpruneCsr2csr_nnzByPercentage,musparseDpruneCsr2csr_nnzByPercentage,musparseSpruneCsr2csrByPercentage, andmusparseDpruneCsr2csrByPercentage.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:buffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - float
percentage - const musparseMatDescr_t
csr_descr_Cconst floatcsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_C - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csrByPercentage_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csrByPercentage_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, double percentage, const musparseMatDescr_t csr_descr_C, const double `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, musparseMatInfo_t info, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - double
percentage - const musparseMatDescr_t
csr_descr_Cconst doublecsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_C - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csrByPercentage_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csrByPercentage_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const __half `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, float percentage, const musparseMatDescr_t csr_descr_C, const __half `csr_val_C, const muInt `csr_row_ptr_C, const muInt `csr_col_ind_C, musparseMatInfo_t info, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst __halfcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - float
percentage - const musparseMatDescr_t
csr_descr_Cconst __halfcsr_val_Cconst muIntcsr_row_ptr_Cconst muIntcsr_col_ind_C - musparseMatInfo_t
infosize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csr_nnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csr_nnzByPercentage(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, float percentage, const musparseMatDescr_t csr_descr_C, muInt `csr_row_ptr_C, muInt `nnz_total_dev_host_ptr, musparseMatInfo_t info, void `temp_buffer)
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.
musparseXpruneCsr2csr_nnzByPercentage computes the number of nonzero elements per row and the total number of nonzero elements in a sparse CSR matrix once elements less than the threshold are pruned from the matrix.
注意:The routine does support asynchronous execution if the pointer mode is set to device.
Parameters:
handle: handle to the musparse library context queue.m: number of rows in the sparse CSR matrix.n: number of columns in the sparse CSR matrix.nnz_A: number of non-zeros in the sparse CSR matrix A.csr_descr_A: descriptor of the sparse CSR matrix A. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_A: array ofnnz_Aelements containing the values of the sparse CSR matrix A.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrix A.percentage: percentage >= 0 and percentage <= 100.csr_descr_C: descriptor of the sparse CSR matrix C. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrix C.nnz_total_dev_host_ptr: total number of nonzero elements in device or host memory.info: prune info structure.temp_buffer: buffer allocated by the user whose size is determined by callingmusparse_xprune_csr2csr_by_percentage_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornornnz_Aorpercentageis invalid.MUSPARSE_STATUS_INVALID_POINTER:csr_descr_Aorcsr_descr_Corinfoorcsr_val_Aorcsr_row_ptr_Aorcsr_col_ind_Aorcsr_row_ptr_Cornnz_total_dev_host_ptrortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - float
percentage - const musparseMatDescr_t
csr_descr_CmuIntcsr_row_ptr_CmuIntnnz_total_dev_host_ptr - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csr_nnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csr_nnzByPercentage(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, double percentage, const musparseMatDescr_t csr_descr_C, muInt `csr_row_ptr_C, muInt `nnz_total_dev_host_ptr, musparseMatInfo_t info, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - double
percentage - const musparseMatDescr_t
csr_descr_CmuIntcsr_row_ptr_CmuIntnnz_total_dev_host_ptr - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csr_nnzByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csr_nnzByPercentage(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const __half `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, float percentage, const musparseMatDescr_t csr_descr_C, muInt `csr_row_ptr_C, muInt `nnz_total_dev_host_ptr, musparseMatInfo_t info, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst __halfcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - float
percentage - const musparseMatDescr_t
csr_descr_CmuIntcsr_row_ptr_CmuIntnnz_total_dev_host_ptr - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpruneCsr2csrByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseSpruneCsr2csrByPercentage(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const float `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, float percentage, const musparseMatDescr_t csr_descr_C, float `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, musparseMatInfo_t info, void *temp_buffer)
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.
This function converts the sparse CSR matrix A into a sparse CSR matrix C by pruning values in A that are less than the threshold. All the parameters are assumed to have been pre-allocated by the user. The user first calls musparse_xprune_csr2csr_buffer_size() to determine the size of the buffer used by musparse_xprune_csr2csr_nnz() and musparse_xprune_csr2csr() which the user then allocates. The user then allocates csr_row_ptr_C to have m+1 elements and then calls musparse_xprune_csr2csr_nnz() which fills in the csr_row_ptr_C array stores then number of elements that are larger than the pruning threshold in nnz_total_dev_host_ptr. The user then calls musparse_xprune_csr2csr() to complete the conversion. It is executed asynchronously with respect to the host and may return control to the application on the host before the entire result is ready.
Parameters:
handle: handle to the musparse library context queue.m: number of rows in the sparse CSR matrix.n: number of columns in the sparse CSR matrix.nnz_A: number of non-zeros in the sparse CSR matrix A.csr_descr_A: descriptor of the sparse CSR matrix A. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_A: array ofnnz_Aelements containing the values of the sparse CSR matrix A.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the sparse CSR matrix A.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrix A.percentage: percentage >= 0 and percentage <= 100.csr_descr_C: descriptor of the sparse CSR matrix C. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val_C: array ofnnz_Celements containing the values of the sparse CSR matrix C.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrix C.csr_col_ind_C: array ofnnz_Celements containing the column indices of the sparse CSR matrix C.info: prune info structure.temp_buffer: buffer allocated by the user whose size is determined by callingmusparse_xprune_csr2csr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornornnz_Aorpercentageis invalid.MUSPARSE_STATUS_INVALID_POINTER:csr_descr_Aorcsr_descr_Corinfoorcsr_val_Aorcsr_row_ptr_Aorcsr_col_ind_Aorcsr_val_Corcsr_row_ptr_Corcsr_col_ind_Cortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst floatcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - float
percentage - const musparseMatDescr_t
csr_descr_Cfloatcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDpruneCsr2csrByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseDpruneCsr2csrByPercentage(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const double `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, double percentage, const musparseMatDescr_t csr_descr_C, double `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, musparseMatInfo_t info, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst doublecsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - double
percentage - const musparseMatDescr_t
csr_descr_Cdoublecsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseHpruneCsr2csrByPercentage
MUSPARSE_EXPORT musparseStatus_t musparseHpruneCsr2csrByPercentage(musparseHandle_t handle, muInt m, muInt n, muInt nnz_A, const musparseMatDescr_t csr_descr_A, const __half `csr_val_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, float percentage, const musparseMatDescr_t csr_descr_C, __half `csr_val_C, const muInt `csr_row_ptr_C, muInt `csr_col_ind_C, musparseMatInfo_t info, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz_A - const musparseMatDescr_t
csr_descr_Aconst __halfcsr_val_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - float
percentage - const musparseMatDescr_t
csr_descr_C__halfcsr_val_Cconst muIntcsr_row_ptr_CmuIntcsr_col_ind_C - musparseMatInfo_t
infovoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSell2csr
MUSPARSE_EXPORT musparseStatus_t musparseSell2csr(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t ell_descr, muInt ell_width, const float `ell_val, const muInt `ell_col_ind, const musparseMatDescr_t csr_descr, float `csr_val, const muInt `csr_row_ptr, muInt *csr_col_ind)
Convert a sparse ELL matrix into a sparse CSR matrix.
musparseXell2csr converts an ELL matrix into a CSR matrix. It is assumed that csr_row_ptr has already been filled and that csr_val and csr_col_ind are allocated by the user. csr_row_ptr and allocation size of csr_col_ind and csr_val is defined by the number of CSR non-zero elements. Both can be obtained by musparseXcsr2ell2csr_nnz().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse ELL matrix.n: number of columns of the sparse ELL matrix.ell_descr: descriptor of the sparse ELL matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.ell_width: number of non-zero elements per row in ELL storage format.ell_val: array ofmtimesell_widthelements of the sparse ELL matrix.ell_col_ind: array ofmtimesell_widthelements containing the column indices of the sparse ELL matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array containing the values of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array containing the column indices of the sparse CSR matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,norell_widthis invalid.MUSPARSE_STATUS_INVALID_POINTER:csr_descr,csr_val,csr_row_ptr,csr_col_ind,ell_descr,ell_valorell_col_indpointer is ` ```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example converts an ELL matrix into a CSR matrix.
// 1 2 0 3 0
// A = 0 4 5 0 0
// 6 0 0 7 8
muInt m = 3;
muInt n = 5;
muInt nnz = 9;
muInt ell_width = 3;
ell_col_ind[nnz] = \{0, 1, 0, 1, 2, 3, 3, -1, 4\}; // device memory
ell_val[nnz] = \{1, 4, 6, 2, 5, 7, 3, 0, 8\}; // device memory
// Create CSR matrix descriptor
musparseMatDescr_t csr_descr;
musparseCreateMatDescr(&csr_descr);
// Allocate csr_row_ptr array for row offsets
muInt* csr_row_ptr;
musaMalloc((void``)&csr_row_ptr, sizeof(muInt) * (m + 1));
// Obtain the number of CSR non-zero entries
// and fill csr_row_ptr array with row offsets
muInt csr_nnz;
musparseXcsr2ell2csr_nnz(handle,
m,
n,
ell_descr,
ell_width,
ell_col_ind,
csr_descr,
csr_row_ptr,
&csr_nnz);
// Allocate CSR column and value arrays
muInt* csr_col_ind;
musaMalloc((void``)&csr_col_ind, sizeof(muInt) * csr_nnz);
float* csr_val;
musaMalloc((void``)&csr_val, sizeof(float) * csr_nnz);
// Format conversion
musparseSell2csr(handle,
m,
n,
ell_descr,
ell_width,
ell_val,
ell_col_ind,
csr_descr,
csr_val,
csr_row_ptr,
csr_col_ind);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
ell_descr - muInt
ell_widthconst floatell_valconst muIntell_col_ind - const musparseMatDescr_t
csr_descrfloatcsr_valconst muIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDell2csr
MUSPARSE_EXPORT musparseStatus_t musparseDell2csr(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t ell_descr, muInt ell_width, const double `ell_val, const muInt `ell_col_ind, const musparseMatDescr_t csr_descr, double `csr_val, const muInt `csr_row_ptr, muInt *csr_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
ell_descr - muInt
ell_widthconst doubleell_valconst muIntell_col_ind - const musparseMatDescr_t
csr_descrdoublecsr_valconst muIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCell2csr
MUSPARSE_EXPORT musparseStatus_t musparseCell2csr(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t ell_descr, muInt ell_width, const muComplex `ell_val, const muInt `ell_col_ind, const musparseMatDescr_t csr_descr, muComplex `csr_val, const muInt `csr_row_ptr, muInt *csr_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
ell_descr - muInt
ell_widthconst muComplexell_valconst muIntell_col_ind - const musparseMatDescr_t
csr_descrmuComplexcsr_valconst muIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZell2csr
MUSPARSE_EXPORT musparseStatus_t musparseZell2csr(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t ell_descr, muInt ell_width, const muDoubleComplex `ell_val, const muInt `ell_col_ind, const musparseMatDescr_t csr_descr, muDoubleComplex `csr_val, const muInt `csr_row_ptr, muInt *csr_col_ind)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
ell_descr - muInt
ell_widthconst muDoubleComplexell_valconst muIntell_col_ind - const musparseMatDescr_t
csr_descrmuDoubleComplexcsr_valconst muIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseShyb2csr
MUSPARSE_EXPORT musparseStatus_t musparseShyb2csr(musparseHandle_t handle, const musparseMatDescr_t descr, const musparseHybMat_t hyb, float `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind, void `temp_buffer)
Convert a sparse HYB matrix into a sparse CSR matrix.
musparseXhyb2csr converts a HYB matrix into a CSR matrix.
musparseXhyb2csr requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by musparseXhyb2csr_bufferSize().
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.descr: descriptor of the sparse HYB matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.hyb: sparse matrix in HYB format.csr_val: array containing the values of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array containing the column indices of the sparse CSR matrix.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseXhyb2csr_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:descr,hyb,csr_val,csr_row_ptr,csr_col_indortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
This example converts a HYB matrix into a CSR matrix.
// Create CSR matrix arrays
muInt* csr_row_ptr;
muInt* csr_col_ind;
float* csr_val;
musaMalloc((void``)&csr_row_ptr, sizeof(muInt) * (m + 1));
musaMalloc((void``)&csr_col_ind, sizeof(muInt) * nnz);
musaMalloc((void``)&csr_val, sizeof(float) * nnz);
// Get required size of temporary buffer
size_t size;
musparseXhyb2csr_bufferSize(handle,
descr,
hyb,
csr_row_ptr,
&size);
// Allocate temporary buffer
void* buffer;
musaMalloc(&buffer, size);
// Perform the conversion
musparseShyb2csr(handle,
descr,
hyb,
csr_val,
csr_row_ptr,
csr_col_ind,
buffer);
Parameters:
- musparseHandle_t
handle - const musparseMatDescr_t
descr - const musparseHybMat_t
hybfloatcsr_valmuIntcsr_row_ptrmuIntcsr_col_indvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDhyb2csr
MUSPARSE_EXPORT musparseStatus_t musparseDhyb2csr(musparseHandle_t handle, const musparseMatDescr_t descr, const musparseHybMat_t hyb, double `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - const musparseMatDescr_t
descr - const musparseHybMat_t
hybdoublecsr_valmuIntcsr_row_ptrmuIntcsr_col_indvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseChyb2csr
MUSPARSE_EXPORT musparseStatus_t musparseChyb2csr(musparseHandle_t handle, const musparseMatDescr_t descr, const musparseHybMat_t hyb, muComplex `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - const musparseMatDescr_t
descr - const musparseHybMat_t
hybmuComplexcsr_valmuIntcsr_row_ptrmuIntcsr_col_indvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZhyb2csr
MUSPARSE_EXPORT musparseStatus_t musparseZhyb2csr(musparseHandle_t handle, const musparseMatDescr_t descr, const musparseHybMat_t hyb, muDoubleComplex `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - const musparseMatDescr_t
descr - const musparseHybMat_t
hybmuDoubleComplexcsr_valmuIntcsr_row_ptrmuIntcsr_col_indvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSbsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseSbsr2csr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, const musparseMatDescr_t bsr_descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const musparseMatDescr_t csr_descr, float `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind)
Convert a sparse BSR matrix into a sparse CSR matrix.
musparseXbsr2csr converts a BSR matrix into a CSR matrix. It is assumed, that csr_val, csr_col_ind and csr_row_ptr are allocated. Allocation size for csr_row_ptr is computed by the number of block rows multiplied by the block dimension plus one. Allocation for csr_val and csr_col_ind is computed by the the number of blocks in the BSR matrix multiplied by the block dimension squared.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks, MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMNmb: number of block rows in the sparse BSR matrix.nb: number of block columns in the sparse BSR matrix.bsr_descr: descriptor of the sparse BSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.block_dim: size of the blocks in the sparse BSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array ofnnzb*block_dim*block_dimelements containing the values of the sparse CSR matrix.csr_row_ptr: array ofm+1wherem=mb*block_dimelements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzb*block_dim*block_dimelements containing the column indices of the sparse CSR matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mbornborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:bsr_val,bsr_row_ptr,bsr_col_ind,csr_val,csr_row_ptrorcsr_col_indpointer is invalid.
Example:
This example converts a BSR matrix into an CSR matrix.
// 1 4 0 0 0 0
// A = 0 2 3 0 0 0
// 5 0 0 7 8 0
// 0 0 9 0 6 0
muInt mb = 2;
muInt nb = 3;
muInt block_dim = 2;
muInt m = Mb * block_dim;
muInt n = Nb * block_dim;
bsr_row_ptr[mb+1] = \{0, 2, 5\}; // device memory
bsr_col_ind[nnzb] = \{0, 1, 0, 1, 2\}; // device memory
bsr_val[nnzb`block_dim`block_dim] = \{1, 0, 4, 2, 0, 3, 0, 0, 5, 0, 0, 0,
0, 9, 7, 0, 8, 6, 0, 0\}; // device memory
muInt nnzb = bsr_row_ptr[mb] - bsr_row_ptr[0];
// Create CSR arrays on device
muInt* csr_row_ptr;
muInt* csr_col_ind;
float* csr_val;
musaMalloc((void``)&csr_row_ptr, sizeof(muInt) * (m + 1));
musaMalloc((void``)&csr_col_ind, sizeof(muInt) ` nnzb `
block_dim ` block_dim); musaMalloc((void``)&csr_val, sizeof(float) ` nnzb *
block_dim * block_dim);
// Create musparse handle
musparse_local_handle handle;
musparseMatDescr_t bsr_descr = nullptr;
musparseCreateMatDescr(&bsr_descr);
musparseMatDescr_t csr_descr = nullptr;
musparseCreateMatDescr(&csr_descr);
musparseSetMatIndexBase(bsr_descr, MUSPARSE_INDEX_BASE_ZERO);
musparseSetMatIndexBase(csr_descr, MUSPARSE_INDEX_BASE_ZERO);
// Format conversion
musparseSbsr2csr(handle,
MUSPARSE_DIRECTION_COLUMN,
mb,
nb,
bsr_descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
block_dim,
csr_descr,
csr_val,
csr_row_ptr,
csr_col_ind);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - const musparseMatDescr_t
bsr_descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - const musparseMatDescr_t
csr_descrfloatcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDbsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseDbsr2csr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, const musparseMatDescr_t bsr_descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const musparseMatDescr_t csr_descr, double `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - const musparseMatDescr_t
bsr_descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - const musparseMatDescr_t
csr_descrdoublecsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCbsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseCbsr2csr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, const musparseMatDescr_t bsr_descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const musparseMatDescr_t csr_descr, muComplex `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - const musparseMatDescr_t
bsr_descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - const musparseMatDescr_t
csr_descrmuComplexcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZbsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseZbsr2csr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, const musparseMatDescr_t bsr_descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt block_dim, const musparseMatDescr_t csr_descr, muDoubleComplex `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - const musparseMatDescr_t
bsr_descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
block_dim - const musparseMatDescr_t
csr_descrmuDoubleComplexcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseSgebsr2csr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, const musparseMatDescr_t bsr_descr, const float `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const musparseMatDescr_t csr_descr, float `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind)
Convert a sparse general BSR matrix into a sparse CSR matrix.
musparseXgebsr2csr converts a BSR matrix into a CSR matrix. It is assumed, that csr_val, csr_col_ind and csr_row_ptr are allocated. Allocation size for csr_row_ptr is computed by the number of block rows multiplied by the block dimension plus one. Allocation for csr_val and csr_col_ind is computed by the the number of blocks in the BSR matrix multiplied by the product of the block dimensions.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks, MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMNmb: number of block rows in the sparse general BSR matrix.nb: number of block columns in the sparse general BSR matrix.bsr_descr: descriptor of the sparse general BSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_val: array ofnnzb*row_block_dim*col_block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr: array ofmb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind: array ofnnzbelements containing the block column indices of the sparse BSR matrix.row_block_dim: row size of the blocks in the sparse general BSR matrix.col_block_dim: column size of the blocks in the sparse general BSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_val: array ofnnzb*row_block_dim*col_block_dimelements containing the values of the sparse CSR matrix.csr_row_ptr: array ofm+1wherem=mb*row_block_dimelements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzb*block_dim*block_dimelements containing the column indices of the sparse CSR matrix.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mbornborblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:bsr_val,bsr_row_ptr,bsr_col_ind,csr_val,csr_row_ptrorcsr_col_indpointer is invalid.
Example:
This example converts a general BSR matrix into an CSR matrix.
// 1 4 0 0 0 0
// A = 0 2 3 0 0 0
// 5 0 0 7 8 0
// 0 0 9 0 6 0
muInt mb = 2;
muInt nb = 2;
muInt row_block_dim = 2;
muInt col_block_dim = 3;
muInt m = Mb * row_block_dim;
muInt n = Nb * col_block_dim;
bsr_row_ptr[mb+1] = \{0, 1, 3\}; // device memory
bsr_col_ind[nnzb] = \{0, 0, 1\}; // device memory
bsr_val[nnzb`block_dim`block_dim] = \{1, 0, 4, 2, 0, 3, 5, 0, 0, 0, 0, 9,
7, 0, 8, 6, 0, 0\}; // device memory
muInt nnzb = bsr_row_ptr[mb] - bsr_row_ptr[0];
// Create CSR arrays on device
muInt* csr_row_ptr;
muInt* csr_col_ind;
float* csr_val;
musaMalloc((void``)&csr_row_ptr, sizeof(muInt) * (m + 1));
musaMalloc((void``)&csr_col_ind, sizeof(muInt) ` nnzb `
row_block_dim ` col_block_dim); musaMalloc((void``)&csr_val, sizeof(float) `
nnzb ` row_block_dim ` col_block_dim);
// Create musparse handle
musparse_local_handle handle;
musparseMatDescr_t bsr_descr = nullptr;
musparseCreateMatDescr(&bsr_descr);
musparseMatDescr_t csr_descr = nullptr;
musparseCreateMatDescr(&csr_descr);
musparseSetMatIndexBase(bsr_descr, MUSPARSE_INDEX_BASE_ZERO);
musparseSetMatIndexBase(csr_descr, MUSPARSE_INDEX_BASE_ZERO);
// Format conversion
musparseSgebsr2csr(handle,
MUSPARSE_DIRECTION_COLUMN,
mb,
nb,
bsr_descr,
bsr_val,
bsr_row_ptr,
bsr_col_ind,
row_block_dim,
col_block_dim,
csr_descr,
csr_val,
csr_row_ptr,
csr_col_ind);
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - const musparseMatDescr_t
bsr_descrconst floatbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dim - const musparseMatDescr_t
csr_descrfloatcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseDgebsr2csr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, const musparseMatDescr_t bsr_descr, const double `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const musparseMatDescr_t csr_descr, double `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - const musparseMatDescr_t
bsr_descrconst doublebsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dim - const musparseMatDescr_t
csr_descrdoublecsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseCgebsr2csr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, const musparseMatDescr_t bsr_descr, const muComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const musparseMatDescr_t csr_descr, muComplex `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - const musparseMatDescr_t
bsr_descrconst muComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dim - const musparseMatDescr_t
csr_descrmuComplexcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsr2csr
MUSPARSE_EXPORT musparseStatus_t musparseZgebsr2csr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, const musparseMatDescr_t bsr_descr, const muDoubleComplex `bsr_val, const muInt `bsr_row_ptr, const muInt `bsr_col_ind, muInt row_block_dim, muInt col_block_dim, const musparseMatDescr_t csr_descr, muDoubleComplex `csr_val, muInt `csr_row_ptr, muInt `csr_col_ind)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - const musparseMatDescr_t
bsr_descrconst muDoubleComplexbsr_valconst muIntbsr_row_ptrconst muIntbsr_col_ind - muInt
row_block_dim - muInt
col_block_dim - const musparseMatDescr_t
csr_descrmuDoubleComplexcsr_valmuIntcsr_row_ptrmuIntcsr_col_ind
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsr2gebsr_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSgebsr2gebsr_bufferSize_legacy(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const float `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, muInt row_block_dim_C, muInt col_block_dim_C, size_t `buffer_size)
This function computes the the size of the user allocated temporary storage buffer used when converting a sparse general BSR matrix to another sparse general BSR matrix.
musparseXgebsr2gebsr_bufferSize returns the size of the temporary storage buffer that is required by musparseXgebsr2gebsr_nnz(), musparseSgebsr2gebsr(), musparseDgebsr2gebsr(), musparseCgebsr2gebsr(), and musparseZgebsr2gebsr(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks, MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMNmb: number of block rows of the general BSR sparse matrixA.nb: number of block columns of the general BSR sparse matrixA.nnzb: number of blocks in the general BSR sparse matrixA.descr_A: the descriptor of the general BSR sparse matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.bsr_val_A: array ofnnzb*row_block_dim_A*col_block_dim_Acontaining the values of the sparse general BSR matrixA.bsr_row_ptr_A: array ofmb+1elements that point to the start of every block row of the sparse general BSR matrixA.bsr_col_ind_A: array ofnnzbelements containing the block column indices of the sparse general BSR matrixA.row_block_dim_A: row size of the blocks in the sparse general BSR matrixA.col_block_dim_A: column size of the blocks in the sparse general BSR matrixA.row_block_dim_C: row size of the blocks in the sparse general BSR matrixC.col_block_dim_C: column size of the blocks in the sparse general BSR matrixC.buffer_size: number of bytes of the temporary storage buffer required by musparseXgebsr2gebsr_nnz(), musparseSgebsr2gebsr(), musparseDgebsr2gebsr(), musparseCgebsr2gebsr(), and musparseZgebsr2gebsr().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mbornbornnzborrow_block_dim_Aorcol_block_dim_Aorrow_block_dim_Corcol_block_dim_Cis invalid.MUSPARSE_STATUS_INVALID_POINTER:bsr_row_ptr_Aorbsr_col_ind_Aordescr_Aorbuffer_sizepointer is invalid.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst floatbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - muInt
row_block_dim_C - muInt
col_block_dim_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsr2gebsr_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseDgebsr2gebsr_bufferSize_legacy(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const double `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, muInt row_block_dim_C, muInt col_block_dim_C, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst doublebsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - muInt
row_block_dim_C - muInt
col_block_dim_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsr2gebsr_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseCgebsr2gebsr_bufferSize_legacy(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const muComplex `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, muInt row_block_dim_C, muInt col_block_dim_C, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst muComplexbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - muInt
row_block_dim_C - muInt
col_block_dim_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsr2gebsr_bufferSize_legacy
MUSPARSE_EXPORT musparseStatus_t musparseZgebsr2gebsr_bufferSize_legacy(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const muDoubleComplex `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, muInt row_block_dim_C, muInt col_block_dim_C, size_t `buffer_size)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst muDoubleComplexbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - muInt
row_block_dim_C - muInt
col_block_dim_Csize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSgebsr2gebsr
MUSPARSE_EXPORT musparseStatus_t musparseSgebsr2gebsr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const float `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, const musparseMatDescr_t descr_C, float `bsr_val_C, muInt `bsr_row_ptr_C, muInt `bsr_col_ind_C, muInt row_block_dim_C, muInt col_block_dim_C, void *temp_buffer)
This function converts the general BSR sparse matrix A to another general BSR sparse matrix C.
The conversion uses three steps. First, the user calls musparse_xgebsr2gebsr_buffer_size() to determine the size of the required temporary storage buffer. The user then allocates this buffer. Secondly, the user then allocates mb_C+1 integers for the row pointer array for C where mb_C=(m+row_block_dim_C-1)/row_block_dim_C. The user then calls musparse_xgebsr2gebsr_nnz() to fill in the row pointer array for C ( bsr_row_ptr_C ) and determine the number of non-zero blocks that will exist in C. Finally, the user allocates space for the colimn indices array of C to have nnzb_C elements and space for the values array of C to have nnzb_C*row_block_dim_C*col_block_dim_C and then calls musparse_xgebsr2gebsr() to complete the conversion.
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks, MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMNmb: number of block rows of the general BSR sparse matrixA.nb: number of block columns of the general BSR sparse matrixA.nnzb: number of blocks in the general BSR sparse matrixA.descr_A: the descriptor of the general BSR sparse matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.bsr_val_A: array ofnnzb*row_block_dim_A*col_block_dim_Acontaining the values of the sparse general BSR matrixA.bsr_row_ptr_A: array ofmb+1elements that point to the start of every block row of the sparse general BSR matrixA.bsr_col_ind_A: array ofnnzbelements containing the block column indices of the sparse general BSR matrixA.row_block_dim_A: row size of the blocks in the sparse general BSR matrixA.col_block_dim_A: column size of the blocks in the sparse general BSR matrixA.descr_C: the descriptor of the general BSR sparse matrixC, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.bsr_val_C: array ofnnzb_C*row_block_dim_C*col_block_dim_Ccontaining the values of the sparse general BSR matrixC.bsr_row_ptr_C: array ofmb_C+1elements that point to the start of every block row of the sparse general BSR matrixC.bsr_col_ind_C: array ofnnzb_Celements containing the block column indices of the sparse general BSR matrixC.row_block_dim_C: row size of the blocks in the sparse general BSR matrixC.col_block_dim_C: column size of the blocks in the sparse general BSR matrixC.temp_buffer: buffer allocated by the user whose size is determined by calling musparse_xgebsr2gebsr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mbornbornnzborrow_block_dim_Aorcol_block_dim_Aorrow_block_dim_Corcol_block_dim_Cis invalid.MUSPARSE_STATUS_INVALID_POINTER:bsr_row_ptr_Aorbsr_col_ind_Aorbsr_val_Aorbsr_row_ptr_Corbsr_col_ind_Corbsr_val_Cordescr_Aordescr_Cortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst floatbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - const musparseMatDescr_t
descr_Cfloatbsr_val_CmuIntbsr_row_ptr_CmuIntbsr_col_ind_C - muInt
row_block_dim_C - muInt
col_block_dim_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDgebsr2gebsr
MUSPARSE_EXPORT musparseStatus_t musparseDgebsr2gebsr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const double `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, const musparseMatDescr_t descr_C, double `bsr_val_C, muInt `bsr_row_ptr_C, muInt `bsr_col_ind_C, muInt row_block_dim_C, muInt col_block_dim_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst doublebsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - const musparseMatDescr_t
descr_Cdoublebsr_val_CmuIntbsr_row_ptr_CmuIntbsr_col_ind_C - muInt
row_block_dim_C - muInt
col_block_dim_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCgebsr2gebsr
MUSPARSE_EXPORT musparseStatus_t musparseCgebsr2gebsr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const muComplex `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, const musparseMatDescr_t descr_C, muComplex `bsr_val_C, muInt `bsr_row_ptr_C, muInt `bsr_col_ind_C, muInt row_block_dim_C, muInt col_block_dim_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst muComplexbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - const musparseMatDescr_t
descr_CmuComplexbsr_val_CmuIntbsr_row_ptr_CmuIntbsr_col_ind_C - muInt
row_block_dim_C - muInt
col_block_dim_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZgebsr2gebsr
MUSPARSE_EXPORT musparseStatus_t musparseZgebsr2gebsr(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const muDoubleComplex `bsr_val_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, const musparseMatDescr_t descr_C, muDoubleComplex `bsr_val_C, muInt `bsr_row_ptr_C, muInt `bsr_col_ind_C, muInt row_block_dim_C, muInt col_block_dim_C, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst muDoubleComplexbsr_val_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - const musparseMatDescr_t
descr_CmuDoubleComplexbsr_val_CmuIntbsr_row_ptr_CmuIntbsr_col_ind_C - muInt
row_block_dim_C - muInt
col_block_dim_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScsrcolor
MUSPARSE_EXPORT musparseStatus_t musparseScsrcolor(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const float `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const float `fraction_to_color, muInt `ncolors, muInt `coloring, muInt *reordering, const musparseColorInfo_t info)
Coloring of the adjacency graph of the matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\} stored in the CSR format.
musparseXcsrcolor performs the coloring of the undirected graph represented by the (symmetric) sparsity pattern of the matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\} stored in CSR format. Graph coloring is a way of coloring the nodes of a graph such that no two adjacent nodes are of the same color. The fraction_to_color is a parameter to only color a given percentage of the graph nodes, the remaining uncolored nodes receive distinct new colors. The optional reordering array is a permutation array such that unknowns of the same color are grouped. The matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\} must be stored as a general matrix with a symmetric sparsity pattern, and if the matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\} is non-symmetric then the user is responsible to provide the symmetric part formula \{"type":"element","name":"formula","attributes":\{"id":"128"\},"children":[\{"type":"text","text":"$\\frac\{A+A^T\}\{2\}$"\}]\}.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.nnz: number of non-zero entries of sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.descr: sparse matrix descriptor.csr_val: array ofnnzelements of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.fraction_to_color: fraction of nodes to be colored, which should be in the interval [0.0,1.0], for example 0.8 implies that 80 percent of nodes will be colored.ncolors: resulting number of distinct colors.coloring: resulting mapping of colors.reordering: optional resulting reordering permutation ifreorderingis a non-null pointer.info: structure that holds the information collected during the coloring algorithm.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr,csr_val,csr_row_ptr,csr_col_ind,fraction_to_color,ncolors,coloringorinfopointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst floatcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst floatfraction_to_colormuIntncolorsmuIntcoloringmuIntreordering - const musparseColorInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDcsrcolor
MUSPARSE_EXPORT musparseStatus_t musparseDcsrcolor(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const double `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const double `fraction_to_color, muInt `ncolors, muInt `coloring, muInt *reordering, const musparseColorInfo_t info)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst doublecsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst doublefraction_to_colormuIntncolorsmuIntcoloringmuIntreordering - const musparseColorInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCcsrcolor
MUSPARSE_EXPORT musparseStatus_t musparseCcsrcolor(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const float `fraction_to_color, muInt `ncolors, muInt `coloring, muInt *reordering, const musparseColorInfo_t info)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst floatfraction_to_colormuIntncolorsmuIntcoloringmuIntreordering - const musparseColorInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseZcsrcolor
MUSPARSE_EXPORT musparseStatus_t musparseZcsrcolor(musparseHandle_t handle, muInt m, muInt nnz, const musparseMatDescr_t descr, const muDoubleComplex `csr_val, const muInt `csr_row_ptr, const muInt `csr_col_ind, const double `fraction_to_color, muInt `ncolors, muInt `coloring, muInt *reordering, const musparseColorInfo_t info)
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
nnz - const musparseMatDescr_t
descrconst muDoubleComplexcsr_valconst muIntcsr_row_ptrconst muIntcsr_col_indconst doublefraction_to_colormuIntncolorsmuIntcoloringmuIntreordering - const musparseColorInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Macros
Enumeration types
Enumeration type musparseSpMMOpAlg_t
Definition: musparse-functions.h (line 15084)
enum musparseSpMMOpAlg_t \{
MUSPARSE_SPMM_OP_ALG_DEFAULT
\}
Enumerator MUSPARSE_SPMM_OP_ALG_DEFAULT
Typedefs
Typedef musparseSpSMDescr_t
Definition: musparse-functions.h (line 14859)
typedef struct musparseSpSMDescr* musparseSpSMDescr_t
Return type: struct musparseSpSMDescr *
Typedef musparseSpMMOpPlan_t
Definition: musparse-functions.h (line 15082)
typedef struct musparseSpMMOpPlan* musparseSpMMOpPlan_t
Return type: struct musparseSpMMOpPlan *
Typedef musparseSpGEMMDescr_t
Definition: musparse-functions.h (line 15226)
typedef struct musparseSpGEMMDescr* musparseSpGEMMDescr_t
Return type: struct musparseSpGEMMDescr *
Functions
Function musparseXbsrsv_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXbsrsv_zeroPivot(musparseHandle_t handle, musparseMatInfo_t info, muInt *position)
Sparse triangular solve using BSR storage format.
musparseXbsrsv_zeroPivot returns MUSPARSE_EXPORT MUSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during musparseSbsrsv_solve(), musparseDbsrsv_solve(), musparseCbsrsv_solve() or musparseZbsrsv_solve() computation. The first zero pivot formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\} at formula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\} is stored in position, using same index base as the BSR matrix.
position can be in host or device memory. If no zero pivot has been found, position is set to -1 and MUSPARSE_STATUS_SUCCESS is returned instead.
注意:
musparseXbsrsv_zeroPivotis a blocking function. It might influence performance negatively.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.position: pointer to zero pivotformula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}, can be in host or device memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infoorpositionpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_ZERO_PIVOT zero pivot has been found.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsrsv_clear
MUSPARSE_EXPORT musparseStatus_t musparseXbsrsv_clear(musparseHandle_t handle, musparseMatInfo_t info)
Sparse triangular solve using BSR storage format.
musparseXbsrsv_clear deallocates all memory that was allocated by musparseSbsrsv_analysis(), musparseDbsrsv_analysis(), musparseCbsrsv_analysis() or musparseZbsrsv_analysis(). This is especially useful, if memory is an issue and the analysis data is not required for further computation, e.g. when switching to another sparse matrix format. Calling musparseXbsrsv_clear is optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer holding the meta data could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrmv_clear
MUSPARSE_EXPORT musparseStatus_t musparseXcsrmv_clear(musparseHandle_t handle, musparseMatInfo_t info)
Sparse matrix vector multiplication using CSR storage format.
musparseXcsrmv_clear deallocates all memory that was allocated by musparseScsrmv_analysis(), musparseDcsrmv_analysis(), musparseCcsrmv_analysis() or musparseZcsrmv_analysis(). This is especially useful, if memory is an issue and the analysis data is not required anymore for further computation, e.g. when switching to another sparse matrix format.
注意:Calling
musparseXcsrmv_clearis optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer for the gathered information could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrmv_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXcsrmv_zeroPivot(musparseHandle_t handle, const musparseMatDescr_t descr, musparseMatInfo_t info, muInt *position)
Sparse triangular solve using CSR storage format.
musparseXcsrmv_zeroPivot returns MUSPARSE_EXPORT MUSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during musparseScsrsv_solve(), musparseDcsrsv_solve(), musparseCcsrsv_solve() or musparseZcsrsv_solve() computation. The first zero pivot formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\} at formula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\} is stored in position, using same index base as the CSR matrix.
position can be in host or device memory. If no zero pivot has been found, position is set to -1 and MUSPARSE_STATUS_SUCCESS is returned instead.
注意:
musparseXcsrmv_zeroPivotis a blocking function. It might influence performance negatively.
Parameters:
handle: handle to the musparse library context queue.descr: descriptor of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.position: pointer to zero pivotformula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}, can be in host or device memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infoorpositionpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_ZERO_PIVOT zero pivot has been found.
Parameters:
- musparseHandle_t
handle - const musparseMatDescr_t
descr - musparseMatInfo_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrsv_clear
MUSPARSE_EXPORT musparseStatus_t musparseXcsrsv_clear(musparseHandle_t handle, const musparseMatDescr_t descr, musparseMatInfo_t info)
Sparse triangular solve using CSR storage format.
musparseXcsrsv_clear deallocates all memory that was allocated by musparseScsrsv_analysis(), musparseDcsrsv_analysis(), musparseCcsrsv_analysis() or musparseZcsrsv_analysis(). This is especially useful, if memory is an issue and the analysis data is not required for further computation, e.g. when switching to another sparse matrix format. Calling musparseXcsrsv_clear is optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.descr: descriptor of the sparse CSR matrix.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer holding the meta data could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - const musparseMatDescr_t
descr - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrsm_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXcsrsm_zeroPivot(musparseHandle_t handle, musparseMatInfo_t info, muInt *position)
Sparse triangular system solve using CSR storage format.
musparseXcsrsm_zeroPivot returns MUSPARSE_EXPORT MUSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during musparseScsrsm_solve(), musparseDcsrsm_solve(), musparseCcsrsm_solve() or musparseZcsrsm_solve() computation. The first zero pivot formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\} at formula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\} is stored in position, using same index base as the CSR matrix.
position can be in host or device memory. If no zero pivot has been found, position is set to -1 and MUSPARSE_STATUS_SUCCESS is returned instead.
注意:
musparseXcsrsm_zeroPivotis a blocking function. It might influence performance negatively.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.position: pointer to zero pivotformula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}, can be in host or device memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infoorpositionpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_ZERO_PIVOT zero pivot has been found.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrsm_clear
MUSPARSE_EXPORT musparseStatus_t musparseXcsrsm_clear(musparseHandle_t handle, musparseMatInfo_t info)
Sparse triangular system solve using CSR storage format.
musparseXcsrsm_clear deallocates all memory that was allocated by musparseScsrsm_analysis(), musparseDcsrsm_analysis(), musparseCcsrsm_analysis() or musparseZcsrsm_analysis(). This is especially useful, if memory is an issue and the analysis data is not required for further computation, e.g. when switching to another sparse matrix format. Calling musparseXcsrsm_clear is optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer holding the meta data could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsrsm_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXbsrsm_zeroPivot(musparseHandle_t handle, musparseMatInfo_t info, muInt *position)
Sparse triangular system solve using BSR storage format.
musparseXbsrsm_zeroPivot returns MUSPARSE_EXPORT MUSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during musparseSbsrsm_solve(), musparseDbsrsm_solve(), musparseCbsrsm_solve() or musparseZbsrsm_solve() computation. The first zero pivot formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\} at formula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\} is stored in position, using same index base as the BSR matrix.
position can be in host or device memory. If no zero pivot has been found, position is set to -1 and MUSPARSE_STATUS_SUCCESS is returned instead.
注意:
musparseXbsrsm_zeroPivotis a blocking function. It might influence performance negatively.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.position: pointer to zero pivotformula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}, can be in host or device memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infoorpositionpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_ZERO_PIVOT zero pivot has been found.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsrsm_clear
MUSPARSE_EXPORT musparseStatus_t musparseXbsrsm_clear(musparseHandle_t handle, musparseMatInfo_t info)
Sparse triangular system solve using BSR storage format.
musparseXbsrsm_clear deallocates all memory that was allocated by musparseSbsrsm_analysis(), musparseDbsrsm_analysis(), musparseCbsrsm_analysis() or musparseZbsrsm_analysis(). This is especially useful, if memory is an issue and the analysis data is not required for further computation, e.g. when switching to another sparse matrix format. Calling musparseXbsrsm_clear is optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer holding the meta data could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrgeam_nnz
MUSPARSE_EXPORT musparseStatus_t musparseXcsrgeam_nnz(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t descr_A, muInt nnz_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const musparseMatDescr_t descr_C, muInt `csr_row_ptr_C, muInt `nnz_C)
Sparse matrix sparse matrix addition using CSR storage format.
musparseXcsrgeam_nnz computes the total CSR non-zero elements and the CSR row offsets, that point to the start of every row of the sparse CSR matrix, of the resulting matrix C. It is assumed that csr_row_ptr_C has been allocated with size m + 1.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\},formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.n: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\},formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.descr_A: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_A: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_row_ptr_A: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.descr_B: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_B: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_row_ptr_B: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_col_ind_B: array ofnnz_Belements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.descr_C: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.nnz_C: pointer to the number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.nnz_Ccan be a host or device pointer.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,nnz_Aornnz_Bis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr_A,csr_row_ptr_A,csr_col_ind_A,descr_B,csr_row_ptr_B,csr_col_ind_B,descr_C,csr_row_ptr_Cornnz_Cis invalid.```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDmusparseMatrixType_t` != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_B - const musparseMatDescr_t
descr_CmuIntcsr_row_ptr_CmuIntnnz_C
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrgemm_nnz
MUSPARSE_EXPORT musparseStatus_t musparseXcsrgemm_nnz(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, muInt m, muInt n, muInt k, const musparseMatDescr_t descr_A, muInt nnz_A, const muInt `csr_row_ptr_A, const muInt `csr_col_ind_A, const musparseMatDescr_t descr_B, muInt nnz_B, const muInt `csr_row_ptr_B, const muInt `csr_col_ind_B, const musparseMatDescr_t descr_D, muInt nnz_D, const muInt `csr_row_ptr_D, const muInt `csr_col_ind_D, const musparseMatDescr_t descr_C, muInt `csr_row_ptr_C, muInt `nnz_C, const musparseMatInfo_t info_C, void *temp_buffer)
Sparse matrix sparse matrix multiplication using CSR storage format.
musparseXcsrgemm_nnz computes the total CSR non-zero elements and the CSR row offsets, that point to the start of every row of the sparse CSR matrix, of the resulting multiplied matrix C. It is assumed that csr_row_ptr_C has been allocated with size m + 1. The required buffer size can be obtained by musparseScsrgemm_bufferSize(), musparseDcsrgemm_bufferSize(), musparseCcsrgemm_bufferSize() and musparseZcsrgemm_bufferSize(), respectively.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Please note, that for matrix products with more than 8192 intermediate products per row, additional temporary storage buffer is allocated by the algorithm.
注意:This function supports unsorted CSR matrices as input, while output will be sorted. Please note that matrices B and D can only be unsorted up to 8192 intermediate products per row. If this number is exceeded, MUSPARSE_EXPORT MUSPARSE_STATUS_REQUIRES_SORTED_STORAGE will be returned.
注意:Currently, only
trans_A==trans_B== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.trans_B: matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.m: number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.n: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.k: number of columns of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}and number of rows of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.descr_A: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_A: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.csr_row_ptr_A: array ofm+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"28"\},"children":[\{"type":"text","text":"$op(A) == A$"\}]\},k+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"88"\},"children":[\{"type":"text","text":"$op(A)$"\}]\}.csr_col_ind_A: array ofnnz_Aelements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}.descr_B: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_B: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.csr_row_ptr_B: array ofk+1elements (formula \{"type":"element","name":"formula","attributes":\{"id":"49"\},"children":[\{"type":"text","text":"$op(B) == B$"\}]\},m+1otherwise) that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"47"\},"children":[\{"type":"text","text":"$op(B)$"\}]\}.csr_col_ind_B: array ofnnz_Belements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}.descr_D: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.nnz_D: number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_row_ptr_D: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.csr_col_ind_D: array ofnnz_Delements containing the column indices of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}.descr_C: descriptor of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}. Currenty, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr_C: array ofm+1elements that point to the start of every row of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.nnz_C: pointer to the number of non-zero entries of the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.info_C: structure that holds meta data for the sparse CSR matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseScsrgemm_bufferSize(), musparseDcsrgemm_bufferSize(), musparseCcsrgemm_bufferSize() or musparseZcsrgemm_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,n,k,nnz_A,nnz_Bornnz_Dis invalid.MUSPARSE_STATUS_INVALID_POINTER:descr_A,csr_row_ptr_A,csr_col_ind_A,descr_B,csr_row_ptr_B,csr_col_ind_B,descr_D,csr_row_ptr_D,csr_col_ind_D,descr_C,csr_row_ptr_C,nnz_C,info_Cortemp_bufferis invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR additional buffer for long rows could not be allocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A!= MUSPARSE_OPERATION_NON_TRANSPOSE,trans_B!= MUSPARSE_OPERATION_NON_TRANSPOSE, ormusparseMatrixType_t!= MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_B - muInt
m - muInt
n - muInt
k - const musparseMatDescr_t
descr_A - muInt
nnz_Aconst muIntcsr_row_ptr_Aconst muIntcsr_col_ind_A - const musparseMatDescr_t
descr_B - muInt
nnz_Bconst muIntcsr_row_ptr_Bconst muIntcsr_col_ind_B - const musparseMatDescr_t
descr_D - muInt
nnz_Dconst muIntcsr_row_ptr_Dconst muIntcsr_col_ind_D - const musparseMatDescr_t
descr_CmuIntcsr_row_ptr_CmuIntnnz_C - const musparseMatInfo_t
info_Cvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsric0_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXbsric0_zeroPivot(musparseHandle_t handle, musparseMatInfo_t info, muInt *position)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsric0_zeroPivot returns MUSPARSE_EXPORT MUSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during musparseSbsric0(), musparseDbsric0(), musparseCbsric0() or musparseZbsric0() computation. The first zero pivot formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\} at formula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\} is stored in position, using same index base as the BSR matrix.
position can be in host or device memory. If no zero pivot has been found, position is set to -1 and MUSPARSE_STATUS_SUCCESS is returned instead.
注意:If a zero pivot is found,
position=jmeans that either the diagonal blockA(j,j)is missing (structural zero) or the diagonal blockA(j,j)is not positive definite (numerical zero).
注意:
musparseXbsric0_zeroPivotis a blocking function. It might influence performance negatively.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.position: pointer to zero pivotformula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}, can be in host or device memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infoorpositionpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_ZERO_PIVOT zero pivot has been found.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsric0_clear
MUSPARSE_EXPORT musparseStatus_t musparseXbsric0_clear(musparseHandle_t handle, musparseMatInfo_t info)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsric0_clear deallocates all memory that was allocated by musparseSbsric0_analysis(), musparseDbsric0_analysis(), musparseCbsric0_analysis() or musparseZbsric0_analysis(). This is especially useful, if memory is an issue and the analysis data is not required for further computation.
注意:Calling
musparseXbsric0_clearis optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer holding the meta data could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsrilu0_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXbsrilu0_zeroPivot(musparseHandle_t handle, musparseMatInfo_t info, muInt *position)
Incomplete LU factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsrilu0_zeroPivot returns MUSPARSE_EXPORT MUSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during musparseSbsrilu0(), musparseDbsrilu0(), musparseCbsrilu0() or musparseZbsrilu0() computation. The first zero pivot formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\} at formula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\} is stored in position, using same index base as the BSR matrix.
position can be in host or device memory. If no zero pivot has been found, position is set to -1 and MUSPARSE_STATUS_SUCCESS is returned instead.
注意:If a zero pivot is found,
positionformula \{"type":"element","name":"formula","attributes":\{"id":"106"\},"children":[\{"type":"text","text":"$=j$"\}]\}means that either the diagonal blockformula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\}is missing (structural zero) or the diagonal blockformula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\}is not invertible (numerical zero).
注意:
musparseXbsrilu0_zeroPivotis a blocking function. It might influence performance negatively.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.position: pointer to zero pivotformula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}, can be in host or device memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infoorpositionpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_ZERO_PIVOT zero pivot has been found.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXbsrilu0_clear
MUSPARSE_EXPORT musparseStatus_t musparseXbsrilu0_clear(musparseHandle_t handle, musparseMatInfo_t info)
Incomplete LU factorization with 0 fill-ins and no pivoting using BSR storage format.
musparseXbsrilu0_clear deallocates all memory that was allocated by musparseSbsrilu0_analysis(), musparseDbsrilu0_analysis(), musparseCbsrilu0_analysis() or musparseZbsrilu0_analysis(). This is especially useful, if memory is an issue and the analysis data is not required for further computation.
注意:Calling
musparseXbsrilu0_clearis optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer holding the meta data could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsric0_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXcsric0_zeroPivot(musparseHandle_t handle, musparseMatInfo_t info, muInt *position)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using CSR storage format.
musparse_csric_zero_pivot returns MUSPARSE_EXPORT MUSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during musparseScsric0() or musparseDcsric0() computation. The first zero pivot formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\} at formula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\} is stored in position, using same index base as the CSR matrix.
position can be in host or device memory. If no zero pivot has been found, position is set to -1 and MUSPARSE_STATUS_SUCCESS is returned instead.
注意:
musparseXcsric0_zeroPivotis a blocking function. It might influence performance negatively.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.position: pointer to zero pivotformula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}, can be in host or device memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infoorpositionpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_ZERO_PIVOT zero pivot has been found.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsric0_clear
MUSPARSE_EXPORT musparseStatus_t musparseXcsric0_clear(musparseHandle_t handle, musparseMatInfo_t info)
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsric0_clear deallocates all memory that was allocated by musparseScsric0_analysis() or musparseDcsric0_analysis(). This is especially useful, if memory is an issue and the analysis data is not required for further computation.
注意:Calling
musparseXcsric0_clearis optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer holding the meta data could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrilu0_zeroPivot
MUSPARSE_EXPORT musparseStatus_t musparseXcsrilu0_zeroPivot(musparseHandle_t handle, musparseMatInfo_t info, muInt *position)
Incomplete LU factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsrilu0_zeroPivot returns MUSPARSE_EXPORT MUSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during musparseScsrilu0(), musparseDcsrilu0(), musparseCcsrilu0() or musparseZcsrilu0() computation. The first zero pivot formula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\} at formula \{"type":"element","name":"formula","attributes":\{"id":"19"\},"children":[\{"type":"text","text":"$A_\{j,j\}$"\}]\} is stored in position, using same index base as the CSR matrix.
position can be in host or device memory. If no zero pivot has been found, position is set to -1 and MUSPARSE_STATUS_SUCCESS is returned instead.
注意:
musparseXcsrilu0_zeroPivotis a blocking function. It might influence performance negatively.
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.position: pointer to zero pivotformula \{"type":"element","name":"formula","attributes":\{"id":"18"\},"children":[\{"type":"text","text":"$j$"\}]\}, can be in host or device memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infoorpositionpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_ZERO_PIVOT zero pivot has been found.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
infomuIntposition
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrilu0_clear
MUSPARSE_EXPORT musparseStatus_t musparseXcsrilu0_clear(musparseHandle_t handle, musparseMatInfo_t info)
Incomplete LU factorization with 0 fill-ins and no pivoting using CSR storage format.
musparseXcsrilu0_clear deallocates all memory that was allocated by musparseScsrilu0_analysis(), musparseDcsrilu0_analysis(), musparseCcsrilu0_analysis() or musparseZcsrilu0_analysis(). This is especially useful, if memory is an issue and the analysis data is not required for further computation.
注意:Calling
musparseXcsrilu0_clearis optional. All allocated resources will be cleared, when the opaque musparseMatInfo_t struct is destroyed using musparseDestroyMatInfo().
Parameters:
handle: handle to the musparse library context queue.info: structure that holds the information collected during the analysis step.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:infopointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR the buffer holding the meta data could not be deallocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - musparseMatInfo_t
info
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsr2coo
MUSPARSE_EXPORT musparseStatus_t musparseXcsr2coo(musparseHandle_t handle, const muInt `csr_row_ptr, muInt nnz, muInt m, muInt `coo_row_ind, musparseIndexBase_t idx_base)
Convert a sparse CSR matrix into a sparse COO matrix.
musparseXcsr2coo converts the CSR array containing the row offsets, that point to the start of every row, into a COO array of row indices.
注意:It can also be used to convert a CSC array containing the column offsets into a COO array of column indices.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.m: number of rows of the sparse CSR matrix.coo_row_ind: array ofnnzelements containing the row indices of the sparse COO matrix.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p csr_row_ptr or coo_row_ind pointer is invalid.
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_ARCH_MISMATCH the the device is not supported.
Example:
This example converts a CSR matrix into a COO matrix.
// 1 2 0 3 0
// A = 0 4 5 0 0
// 6 0 0 7 8
muInt m = 3;
muInt n = 5;
muInt nnz = 8;
csr_row_ptr[m+1] = \{0, 3, 5, 8\}; // device memory
csr_col_ind[nnz] = \{0, 1, 3, 1, 2, 0, 3, 4\}; // device memory
csr_val[nnz] = \{1, 2, 3, 4, 5, 6, 7, 8\}; // device memory
// Allocate COO matrix arrays
muInt* coo_row_ind;
muInt* coo_col_ind;
float* coo_val;
musaMalloc((void``)&coo_row_ind, sizeof(muInt) * nnz);
musaMalloc((void``)&coo_col_ind, sizeof(muInt) * nnz);
musaMalloc((void``)&coo_val, sizeof(float) * nnz);
// Convert the csr row offsets into coo row indices
musparseXcsr2coo(handle,
csr_row_ptr,
nnz,
m,
coo_row_ind,
MUSPARSE_INDEX_BASE_ZERO);
// Copy the column and value arrays
musaMemcpy(coo_col_ind,
csr_col_ind,
sizeof(muInt) * nnz,
musaMemcpyDeviceToDevice);
musaMemcpy(coo_val,
csr_val,
sizeof(float) * nnz,
musaMemcpyDeviceToDevice);
Parameters:
- musparseHandle_t
handleconst muIntcsr_row_ptr - muInt
nnz - muInt
mmuIntcoo_row_ind - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsr2csc_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseXcsr2csc_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const muInt `csr_row_ptr, const muInt `csr_col_ind, musparseAction_t copy_values, size_t *buffer_size)
Convert a sparse CSR matrix into a sparse CSC matrix.
musparseXcsr2csc_bufferSize returns the size of the temporary storage buffer required by musparseScsr2csc(), musparseDcsr2csc(), musparseCcsr2csc() and musparseZcsr2csc(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.copy_values: MUSPARSE_ACTION_SYMBOLIC or MUSPARSE_ACTION_NUMERIC.buffer_size: number of bytes of the temporary storage buffer required by musparseScsr2csc(), musparseDcsr2csc(), musparseCcsr2csc() and musparseZcsr2csc().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p csr_row_ptr, csr_col_ind or buffer_size pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzconst muIntcsr_row_ptrconst muIntcsr_col_ind - musparseAction_t
copy_valuessize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsr2csr2ell_width
MUSPARSE_EXPORT musparseStatus_t musparseXcsr2csr2ell_width(musparseHandle_t handle, muInt m, const musparseMatDescr_t csr_descr, const muInt `csr_row_ptr, const musparseMatDescr_t ell_descr, muInt `ell_width)
Convert a sparse CSR matrix into a sparse ELL matrix.
musparseXcsr2csr2ell_width computes the maximum of the per row non-zero elements over all rows, the ELL width, for a given CSR matrix.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.ell_descr: descriptor of the sparse ELL matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.ell_width: pointer to the number of non-zero elements per row in ELL storage format.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mis invalid.MUSPARSE_STATUS_INVALID_POINTER:csr_descr,csr_row_ptr, orell_widthpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - muInt
m - const musparseMatDescr_t
csr_descrconst muIntcsr_row_ptr - const musparseMatDescr_t
ell_descrmuIntell_width
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsr2bsr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseXcsr2bsr_nnz(musparseHandle_t handle, musparseDirection_t dir, muInt m, muInt n, const musparseMatDescr_t csr_descr, const muInt `csr_row_ptr, const muInt `csr_col_ind, muInt block_dim, const musparseMatDescr_t bsr_descr, muInt `bsr_row_ptr, muInt `bsr_nnz)
This function computes the number of nonzero block columns per row and the total number of nonzero blocks in a sparse BSR matrix given a sparse CSR matrix as input.
The routine does support asynchronous execution if the pointer mode is set to device.
Parameters:
handle: handle to the musparse library context queue.dir: direction that specified whether to count nonzero elements by MUSPARSE_DIRECTION_ROW or by MUSPARSE_DIRECTION_ROW.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr: integer array containingm+1elements that point to the start of each row of the CSR matrixcsr_col_ind: integer array of the column indices for each non-zero element in the CSR matrixblock_dim: the block dimension of the BSR matrix. Between 1 and min(m, n)bsr_descr: descriptor of the sparse BSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.bsr_row_ptr: integer array containingmb+1elements that point to the start of each block row of the BSR matrixbsr_nnz: total number of nonzero elements in device or host memory.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornorblock_dimis invalid.MUSPARSE_STATUS_INVALID_POINTER:csr_row_ptrorcsr_col_indorbsr_row_ptrorbsr_nnzpointer is invalid.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
m - muInt
n - const musparseMatDescr_t
csr_descrconst muIntcsr_row_ptrconst muIntcsr_col_ind - muInt
block_dim - const musparseMatDescr_t
bsr_descrmuIntbsr_row_ptrmuIntbsr_nnz
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcoo2csr
MUSPARSE_EXPORT musparseStatus_t musparseXcoo2csr(musparseHandle_t handle, const muInt `coo_row_ind, muInt nnz, muInt m, muInt `csr_row_ptr, musparseIndexBase_t idx_base)
Convert a sparse COO matrix into a sparse CSR matrix.
musparseXcoo2csr converts the COO array containing the row indices into a CSR array of row offsets, that point to the start of every row. It is assumed that the COO row index array is sorted.
注意:It can also be used, to convert a COO array containing the column indices into a CSC array of column offsets, that point to the start of every column. Then, it is assumed that the COO column index array is sorted, instead.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.coo_row_ind: array ofnnzelements containing the row indices of the sparse COO matrix.nnz: number of non-zero entries of the sparse CSR matrix.m: number of rows of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.idx_base: MUSPARSE_INDEX_BASE_ZERO or MUSPARSE_INDEX_BASE_ONE.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p coo_row_ind or csr_row_ptr pointer is invalid.
Example:
This example converts a COO matrix into a CSR matrix.
// 1 2 0 3 0
// A = 0 4 5 0 0
// 6 0 0 7 8
muInt m = 3;
muInt n = 5;
muInt nnz = 8;
coo_row_ind[nnz] = \{0, 0, 0, 1, 1, 2, 2, 2\}; // device memory
coo_col_ind[nnz] = \{0, 1, 3, 1, 2, 0, 3, 4\}; // device memory
coo_val[nnz] = \{1, 2, 3, 4, 5, 6, 7, 8\}; // device memory
// Allocate CSR matrix arrays
muInt* csr_row_ptr;
muInt* csr_col_ind;
float* csr_val;
musaMalloc((void``)&csr_row_ptr, sizeof(muInt) * (m + 1));
musaMalloc((void``)&csr_col_ind, sizeof(muInt) * nnz);
musaMalloc((void``)&csr_val, sizeof(float) * nnz);
// Convert the coo row indices into csr row offsets
musparseXcoo2csr(handle,
coo_row_ind,
nnz,
m,
csr_row_ptr,
MUSPARSE_INDEX_BASE_ZERO);
// Copy the column and value arrays
musaMemcpy(csr_col_ind,
coo_col_ind,
sizeof(muInt) * nnz,
musaMemcpyDeviceToDevice);
musaMemcpy(csr_val,
coo_val,
sizeof(float) * nnz,
musaMemcpyDeviceToDevice);
Parameters:
- musparseHandle_t
handleconst muIntcoo_row_ind - muInt
nnz - muInt
mmuIntcsr_row_ptr - musparseIndexBase_t
idx_base
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsr2ell2csr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseXcsr2ell2csr_nnz(musparseHandle_t handle, muInt m, muInt n, const musparseMatDescr_t ell_descr, muInt ell_width, const muInt `ell_col_ind, const musparseMatDescr_t csr_descr, muInt `csr_row_ptr, muInt *csr_nnz)
Convert a sparse ELL matrix into a sparse CSR matrix.
musparseXcsr2ell2csr_nnz computes the total CSR non-zero elements and the CSR row offsets, that point to the start of every row of the sparse CSR matrix, for a given ELL matrix. It is assumed that csr_row_ptr has been allocated with size m + 1.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse ELL matrix.n: number of columns of the sparse ELL matrix.ell_descr: descriptor of the sparse ELL matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.ell_width: number of non-zero elements per row in ELL storage format.ell_col_ind: array ofmtimesell_widthelements containing the column indices of the sparse ELL matrix.csr_descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_nnz: pointer to the total number of non-zero elements in CSR storage format.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,norell_widthis invalid.MUSPARSE_STATUS_INVALID_POINTER:ell_descr,ell_col_ind,csr_descr,csr_row_ptrorcsr_nnzpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - const musparseMatDescr_t
ell_descr - muInt
ell_widthconst muIntell_col_ind - const musparseMatDescr_t
csr_descrmuIntcsr_row_ptrmuIntcsr_nnz
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXhyb2csr_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseXhyb2csr_bufferSize(musparseHandle_t handle, const musparseMatDescr_t descr, const musparseHybMat_t hyb, const muInt `csr_row_ptr, size_t `buffer_size)
Convert a sparse HYB matrix into a sparse CSR matrix.
musparseXhyb2csr_bufferSize returns the size of the temporary storage buffer required by musparseShyb2csr(), musparseDhyb2csr(), musparseChyb2csr() and musparseDhyb2csr(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.descr: descriptor of the sparse HYB matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.hyb: sparse matrix in HYB format.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.buffer_size: number of bytes of the temporary storage buffer required by musparseShyb2csr(), musparseDhyb2csr(), musparseChyb2csr() and musparseZhyb2csr().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:descr,hyb,csr_row_ptrorbuffer_sizepointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. `MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Parameters:
- musparseHandle_t
handle - const musparseMatDescr_t
descr - const musparseHybMat_t
hybconst muIntcsr_row_ptrsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseCreateIdentityPermutation
MUSPARSE_EXPORT musparseStatus_t musparseCreateIdentityPermutation(musparseHandle_t handle, muInt n, muInt *p)
Create the identity map.
musparseCreateIdentityPermutation stores the identity map in p, such that formula \{"type":"element","name":"formula","attributes":\{"id":"114"\},"children":[\{"type":"text","text":"$p = 0:1:(n-1)$"\}]\}.
for(i = 0; i < n; ++i)
\{
p[i] = i;
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.n: size of the mapp.p: array ofnintegers containing the map.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:nis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p p pointer is invalid.
Example:
The following example creates an identity permutation.
muInt size = 200;
// Allocate memory to hold the identity map
muInt* perm;
musaMalloc((void``)&perm, sizeof(muInt) * size);
// Fill perm with the identity permutation
musparseCreateIdentityPermutation(handle, size, perm);
Parameters:
- musparseHandle_t
handle - muInt
nmuIntp
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrsort_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseXcsrsort_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const muInt `csr_row_ptr, const muInt `csr_col_ind, size_t *buffer_size)
Sort a sparse CSR matrix.
musparseXcsrsort_bufferSize returns the size of the temporary storage buffer required by musparseXcsrsort(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.buffer_size: number of bytes of the temporary storage buffer required by musparseXcsrsort().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p csr_row_ptr, csr_col_ind or buffer_size pointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzconst muIntcsr_row_ptrconst muIntcsr_col_indsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcsrsort
MUSPARSE_EXPORT musparseStatus_t musparseXcsrsort(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const muInt `csr_row_ptr, muInt `csr_col_ind, muInt `perm, void `temp_buffer)
Sort a sparse CSR matrix.
musparseXcsrsort sorts a matrix in CSR format. The sorted permutation vector perm can be used to obtain sorted csr_val array. In this case, perm must be initialized as the identity permutation, see musparseCreateIdentityPermutation().
musparseXcsrsort requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by musparseXcsrsort_bufferSize().
注意:
permcan beNULLif a sorted permutation vector is not required.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSR matrix.n: number of columns of the sparse CSR matrix.nnz: number of non-zero entries of the sparse CSR matrix.descr: descriptor of the sparse CSR matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csr_row_ptr: array ofm+1elements that point to the start of every row of the sparse CSR matrix.csr_col_ind: array ofnnzelements containing the column indices of the sparse CSR matrix.perm: array ofnnzintegers containing the unsorted map indices, can beNULL.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseXcsrsort_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csr_row_ptr, csr_col_ind or temp_buffer pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. ` *MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
The following example sorts a formula \{"type":"element","name":"formula","attributes":\{"id":"115"\},"children":[\{"type":"text","text":"$3 \\times 3$"\}]\} CSR matrix.
// 1 2 3
// A = 4 5 6
// 7 8 9
muInt m = 3;
muInt n = 3;
muInt nnz = 9;
csr_row_ptr[m + 1] = \{0, 3, 6, 9\}; // device memory
csr_col_ind[nnz] = \{2, 0, 1, 0, 1, 2, 0, 2, 1\}; // device memory
csr_val[nnz] = \{3, 1, 2, 4, 5, 6, 7, 9, 8\}; // device memory
// Create permutation vector perm as the identity map
muInt* perm;
musaMalloc((void``)&perm, sizeof(muInt) * nnz);
musparseCreateIdentityPermutation(handle, nnz, perm);
// Allocate temporary buffer
size_t buffer_size;
void* temp_buffer;
musparseXcsrsort_bufferSize(handle, m, n, nnz, csr_row_ptr,
csr_col_ind, &buffer_size); musaMalloc(&temp_buffer, buffer_size);
// Sort the CSR matrix
musparseXcsrsort(handle, m, n, nnz, descr, csr_row_ptr, csr_col_ind,
perm, temp_buffer);
// Gather sorted csr_val array
float* csr_val_sorted;
musaMalloc((void``)&csr_val_sorted, sizeof(float) * nnz);
musparseSgthr(handle, nnz, csr_val, csr_val_sorted, perm,
MUSPARSE_INDEX_BASE_ZERO);
// Clean up
musaFree(temp_buffer);
musaFree(perm);
musaFree(csr_val);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst muIntcsr_row_ptrmuIntcsr_col_indmuIntpermvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcscsort_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseXcscsort_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const muInt `csc_col_ptr, const muInt `csc_row_ind, size_t *buffer_size)
Sort a sparse CSC matrix.
musparseXcscsort_bufferSize returns the size of the temporary storage buffer required by musparseXcscsort(). The temporary storage buffer must be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSC matrix.n: number of columns of the sparse CSC matrix.nnz: number of non-zero entries of the sparse CSC matrix.csc_col_ptr: array ofn+1elements that point to the start of every column of the sparse CSC matrix.csc_row_ind: array ofnnzelements containing the row indices of the sparse CSC matrix.buffer_size: number of bytes of the temporary storage buffer required by musparseXcscsort().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p csc_col_ptr, csc_row_ind or buffer_size pointer is invalid.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzconst muIntcsc_col_ptrconst muIntcsc_row_indsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcscsort
MUSPARSE_EXPORT musparseStatus_t musparseXcscsort(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const musparseMatDescr_t descr, const muInt `csc_col_ptr, muInt `csc_row_ind, muInt `perm, void `temp_buffer)
Sort a sparse CSC matrix.
musparseXcscsort sorts a matrix in CSC format. The sorted permutation vector perm can be used to obtain sorted csc_val array. In this case, perm must be initialized as the identity permutation, see musparseCreateIdentityPermutation().
musparseXcscsort requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by musparseXcscsort_bufferSize().
注意:
permcan beNULLif a sorted permutation vector is not required.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse CSC matrix.n: number of columns of the sparse CSC matrix.nnz: number of non-zero entries of the sparse CSC matrix.descr: descriptor of the sparse CSC matrix. Currently, only MUSPARSE_MATRIX_TYPE_GENERAL is supported.csc_col_ptr: array ofn+1elements that point to the start of every column of the sparse CSC matrix.csc_row_ind: array ofnnzelements containing the row indices of the sparse CSC matrix.perm: array ofnnzintegers containing the unsorted map indices, can beNULL.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseXcscsort_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p descr, csc_col_ptr, csc_row_ind or temp_buffer pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. ` *MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTED musparseMatrixType_t != MUSPARSE_MATRIX_TYPE_GENERAL.
Example:
The following example sorts a formula \{"type":"element","name":"formula","attributes":\{"id":"115"\},"children":[\{"type":"text","text":"$3 \\times 3$"\}]\} CSC matrix.
// 1 2 3
// A = 4 5 6
// 7 8 9
muInt m = 3;
muInt n = 3;
muInt nnz = 9;
csc_col_ptr[m + 1] = \{0, 3, 6, 9\}; // device memory
csc_row_ind[nnz] = \{2, 0, 1, 0, 1, 2, 0, 2, 1\}; // device memory
csc_val[nnz] = \{7, 1, 4, 2, 5, 8, 3, 9, 6\}; // device memory
// Create permutation vector perm as the identity map
muInt* perm;
musaMalloc((void``)&perm, sizeof(muInt) * nnz);
musparseCreateIdentityPermutation(handle, nnz, perm);
// Allocate temporary buffer
size_t buffer_size;
void* temp_buffer;
musparseXcscsort_bufferSize(handle, m, n, nnz, csc_col_ptr,
csc_row_ind, &buffer_size); musaMalloc(&temp_buffer, buffer_size);
// Sort the CSC matrix
musparseXcscsort(handle, m, n, nnz, descr, csc_col_ptr, csc_row_ind,
perm, temp_buffer);
// Gather sorted csc_val array
float* csc_val_sorted;
musaMalloc((void``)&csc_val_sorted, sizeof(float) * nnz);
musparseSgthr(handle, nnz, csc_val, csc_val_sorted, perm,
MUSPARSE_INDEX_BASE_ZERO);
// Clean up
musaFree(temp_buffer);
musaFree(perm);
musaFree(csc_val);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnz - const musparseMatDescr_t
descrconst muIntcsc_col_ptrmuIntcsc_row_indmuIntpermvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcoosort_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseXcoosort_bufferSize(musparseHandle_t handle, muInt m, muInt n, muInt nnz, const muInt `coo_row_ind, const muInt `coo_col_ind, size_t *buffer_size)
Sort a sparse COO matrix.
coosort_buffer_size returns the size of the temporary storage buffer that is required by musparseXcoosortByRow() and musparseXcoosortByColumn(). The temporary storage buffer has to be allocated by the user.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse COO matrix.n: number of columns of the sparse COO matrix.nnz: number of non-zero entries of the sparse COO matrix.coo_row_ind: array ofnnzelements containing the row indices of the sparse COO matrix.coo_col_ind: array ofnnzelements containing the column indices of the sparse COO matrix.buffer_size: number of bytes of the temporary storage buffer required by musparseXcoosortByRow() and musparseXcoosortByColumn().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p coo_row_ind, coo_col_ind or buffer_size pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzconst muIntcoo_row_indconst muIntcoo_col_indsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcoosortByRow
MUSPARSE_EXPORT musparseStatus_t musparseXcoosortByRow(musparseHandle_t handle, muInt m, muInt n, muInt nnz, muInt `coo_row_ind, muInt `coo_col_ind, muInt `perm, void `temp_buffer)
Sort a sparse COO matrix by row.
musparseXcoosortByRow sorts a matrix in COO format by row. The sorted permutation vector perm can be used to obtain sorted coo_val array. In this case, perm must be initialized as the identity permutation, see musparseCreateIdentityPermutation().
musparseXcoosortByRow requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by musparseXcoosort_bufferSize().
注意:
permcan beNULLif a sorted permutation vector is not required.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse COO matrix.n: number of columns of the sparse COO matrix.nnz: number of non-zero entries of the sparse COO matrix.coo_row_ind: array ofnnzelements containing the row indices of the sparse COO matrix.coo_col_ind: array ofnnzelements containing the column indices of the sparse COO matrix.perm: array ofnnzintegers containing the unsorted map indices, can beNULL.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseXcoosort_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p coo_row_ind, coo_col_ind or temp_buffer pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Example:
The following example sorts a formula \{"type":"element","name":"formula","attributes":\{"id":"115"\},"children":[\{"type":"text","text":"$3 \\times 3$"\}]\} COO matrix by row indices.
// 1 2 3
// A = 4 5 6
// 7 8 9
muInt m = 3;
muInt n = 3;
muInt nnz = 9;
coo_row_ind[nnz] = \{0, 1, 2, 0, 1, 2, 0, 1, 2\}; // device memory
coo_col_ind[nnz] = \{0, 0, 0, 1, 1, 1, 2, 2, 2\}; // device memory
coo_val[nnz] = \{1, 4, 7, 2, 5, 8, 3, 6, 9\}; // device memory
// Create permutation vector perm as the identity map
muInt* perm;
musaMalloc((void``)&perm, sizeof(muInt) * nnz);
musparseCreateIdentityPermutation(handle, nnz, perm);
// Allocate temporary buffer
size_t buffer_size;
void* temp_buffer;
musparseXcoosort_bufferSize(handle,
m,
n,
nnz,
coo_row_ind,
coo_col_ind,
&buffer_size);
musaMalloc(&temp_buffer, buffer_size);
// Sort the COO matrix
musparseXcoosortByRow(handle,
m,
n,
nnz,
coo_row_ind,
coo_col_ind,
perm,
temp_buffer);
// Gather sorted coo_val array
float* coo_val_sorted;
musaMalloc((void``)&coo_val_sorted, sizeof(float) * nnz);
musparseSgthr(handle, nnz, coo_val, coo_val_sorted, perm,
MUSPARSE_INDEX_BASE_ZERO);
// Clean up
musaFree(temp_buffer);
musaFree(perm);
musaFree(coo_val);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzmuIntcoo_row_indmuIntcoo_col_indmuIntpermvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXcoosortByColumn
MUSPARSE_EXPORT musparseStatus_t musparseXcoosortByColumn(musparseHandle_t handle, muInt m, muInt n, muInt nnz, muInt `coo_row_ind, muInt `coo_col_ind, muInt `perm, void `temp_buffer)
Sort a sparse COO matrix by column.
musparseXcoosortByColumn sorts a matrix in COO format by column. The sorted permutation vector perm can be used to obtain sorted coo_val array. In this case, perm must be initialized as the identity permutation, see musparseCreateIdentityPermutation().
musparseXcoosortByColumn requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by musparseXcoosort_bufferSize().
注意:
permcan beNULLif a sorted permutation vector is not required.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.m: number of rows of the sparse COO matrix.n: number of columns of the sparse COO matrix.nnz: number of non-zero entries of the sparse COO matrix.coo_row_ind: array ofnnzelements containing the row indices of the sparse COO matrix.coo_col_ind: array ofnnzelements containing the column indices of the sparse COO matrix.perm: array ofnnzintegers containing the unsorted map indices, can beNULL.temp_buffer: temporary storage buffer allocated by the user, size is returned by musparseXcoosort_bufferSize().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:m,nornnzis invalid.MUSPARSE_STATUS_INVALID_POINTER:
p coo_row_ind, coo_col_ind or temp_buffer pointer is invalid. *
Return values:
MUSPARSE_EXPORT: MUSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Example:
The following example sorts a formula \{"type":"element","name":"formula","attributes":\{"id":"115"\},"children":[\{"type":"text","text":"$3 \\times 3$"\}]\} COO matrix by column indices.
// 1 2 3
// A = 4 5 6
// 7 8 9
muInt m = 3;
muInt n = 3;
muInt nnz = 9;
coo_row_ind[nnz] = \{0, 0, 0, 1, 1, 1, 2, 2, 2\}; // device memory
coo_col_ind[nnz] = \{0, 1, 2, 0, 1, 2, 0, 1, 2\}; // device memory
coo_val[nnz] = \{1, 2, 3, 4, 5, 6, 7, 8, 9\}; // device memory
// Create permutation vector perm as the identity map
muInt* perm;
musaMalloc((void``)&perm, sizeof(muInt) * nnz);
musparseCreateIdentityPermutation(handle, nnz, perm);
// Allocate temporary buffer
size_t buffer_size;
void* temp_buffer;
musparseXcoosort_bufferSize(handle,
m,
n,
nnz,
coo_row_ind,
coo_col_ind,
&buffer_size);
musaMalloc(&temp_buffer, buffer_size);
// Sort the COO matrix
musparseXcoosortByColumn(handle,
m,
n,
nnz,
coo_row_ind,
coo_col_ind,
perm,
temp_buffer);
// Gather sorted coo_val array
float* coo_val_sorted;
musaMalloc((void``)&coo_val_sorted, sizeof(float) * nnz);
musparseSgthr(handle, nnz, coo_val, coo_val_sorted, perm,
MUSPARSE_INDEX_BASE_ZERO);
// Clean up
musaFree(temp_buffer);
musaFree(perm);
musaFree(coo_val);
Parameters:
- musparseHandle_t
handle - muInt
m - muInt
n - muInt
nnzmuIntcoo_row_indmuIntcoo_col_indmuIntpermvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseXgebsr2gebsr_nnz
MUSPARSE_EXPORT musparseStatus_t musparseXgebsr2gebsr_nnz(musparseHandle_t handle, musparseDirection_t dir, muInt mb, muInt nb, muInt nnzb, const musparseMatDescr_t descr_A, const muInt `bsr_row_ptr_A, const muInt `bsr_col_ind_A, muInt row_block_dim_A, muInt col_block_dim_A, const musparseMatDescr_t descr_C, muInt `bsr_row_ptr_C, muInt row_block_dim_C, muInt col_block_dim_C, muInt `nnz_total_dev_host_ptr, void *temp_buffer)
This function is used when converting a general BSR sparse matrix A to another general BSR sparse matrix C. Specifically, this function determines the number of non-zero blocks that will exist in C (stored using either a host or device pointer), and computes the row pointer array for C.
The routine does support asynchronous execution.
Parameters:
handle: handle to the musparse library context queue.dir: the storage format of the blocks, MUSPARSE_DIRECTION_ROW or MUSPARSE_DIRECTION_COLUMNmb: number of block rows of the general BSR sparse matrixA.nb: number of block columns of the general BSR sparse matrixA.nnzb: number of blocks in the general BSR sparse matrixA.descr_A: the descriptor of the general BSR sparse matrixA, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.bsr_row_ptr_A: array ofmb+1elements that point to the start of every block row of the sparse general BSR matrixA.bsr_col_ind_A: array ofnnzbelements containing the block column indices of the sparse general BSR matrixA.row_block_dim_A: row size of the blocks in the sparse general BSR matrixA.col_block_dim_A: column size of the blocks in the sparse general BSR matrixA.descr_C: the descriptor of the general BSR sparse matrixC, the supported matrix type is MUSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the musparseIndexBase_t.bsr_row_ptr_C: array ofmb_C+1elements that point to the start of every block row of the sparse general BSR matrixCwheremb_C=(m+row_block_dim_C-1)/row_block_dim_C.row_block_dim_C: row size of the blocks in the sparse general BSR matrixC.col_block_dim_C: column size of the blocks in the sparse general BSR matrixC.nnz_total_dev_host_ptr: total number of nonzero blocks in general BSR sparse matrixCstored using device or host memory.temp_buffer: buffer allocated by the user whose size is determined by calling musparse_xgebsr2gebsr_buffer_size().
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_SIZE:mbornbornnzborrow_block_dim_Aorcol_block_dim_Aorrow_block_dim_Corcol_block_dim_Cis invalid.MUSPARSE_STATUS_INVALID_POINTER:bsr_row_ptr_Aorbsr_col_ind_Aorbsr_row_ptr_Cordescr_Aordescr_Cortemp_bufferpointer is invalid.
Parameters:
- musparseHandle_t
handle - musparseDirection_t
dir - muInt
mb - muInt
nb - muInt
nnzb - const musparseMatDescr_t
descr_Aconst muIntbsr_row_ptr_Aconst muIntbsr_col_ind_A - muInt
row_block_dim_A - muInt
col_block_dim_A - const musparseMatDescr_t
descr_CmuIntbsr_row_ptr_C - muInt
row_block_dim_C - muInt
col_block_dim_CmuIntnnz_total_dev_host_ptrvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseAxpby
MUSPARSE_EXPORT musparseStatus_t musparseAxpby(musparseHandle_t handle, const void `alpha, musparseConstSpVecDescr_t x, const void `beta, musparseDnVecDescr_t y)
Scale a sparse vector and add it to a scaled dense vector.
musparseAxpby multiplies the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} with scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied with scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that
formula \{"type":"element","name":"formula","attributes":\{"id":"116"\},"children":[\{"type":"text","text":"\\[\n y := \\alpha \\cdot x + \\beta \\cdot y\n \\]"\}]\}
for(i = 0; i < nnz; ++i)
\{
y[x_ind[i]] = alpha ` x_val[i] + beta ` y[x_ind[i]]
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.x: sparse matrix descriptor.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: dense matrix descriptor.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alpha,x,betaorypointer is invalid.
Parameters:
- musparseHandle_t
handleconst voidalpha - musparseConstSpVecDescr_t
xconst voidbeta - musparseDnVecDescr_t
y
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseGather
MUSPARSE_EXPORT musparseStatus_t musparseGather(musparseHandle_t handle, const musparseConstDnVecDescr_t y, musparseSpVecDescr_t x)
Gather elements from a dense vector and store them into a sparse vector.
musparseGather gathers the elements from the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} and stores them in the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.
for(i = 0; i < nnz; ++i)
\{
x_val[i] = y[x_ind[i]];
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.y: dense vectorformula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}.x: sparse vectorformula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:xorypointer is invalid.
Parameters:
- musparseHandle_t
handle - const musparseConstDnVecDescr_t
y - musparseSpVecDescr_t
x
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseScatter
MUSPARSE_EXPORT musparseStatus_t musparseScatter(musparseHandle_t handle, musparseConstSpVecDescr_t x, musparseDnVecDescr_t y)
Scatter elements from a sparse vector into a dense vector.
musparseScatter scatters the elements from the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} in the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}.
for(i = 0; i < nnz; ++i)
\{
y[x_ind[i]] = x_val[i];
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.x: sparse vectorformula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.y: dense vectorformula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:xorypointer is invalid.
Parameters:
- musparseHandle_t
handle - musparseConstSpVecDescr_t
x - musparseDnVecDescr_t
y
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseRot
MUSPARSE_EXPORT musparseStatus_t musparseRot(musparseHandle_t handle, const void `c, const void `s, musparseSpVecDescr_t x, musparseDnVecDescr_t y)
Apply Givens rotation to a dense and a sparse vector.
musparseRot applies the Givens rotation matrix formula \{"type":"element","name":"formula","attributes":\{"id":"6"\},"children":[\{"type":"text","text":"$G$"\}]\} to the sparse vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}, where formula \{"type":"element","name":"formula","attributes":\{"id":"7"\},"children":[\{"type":"text","text":"\\[ G = \\begin\{pmatrix\} c\n& s \\\\ -s & c \\end\{pmatrix\} \\]"\}]\}
for(i = 0; i < nnz; ++i)
\{
x_tmp = x_val[i];
y_tmp = y[x_ind[i]];
x_val[i] = c ` x_tmp + s ` y_tmp;
y[x_ind[i]] = c ` y_tmp - s ` x_tmp;
\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.c: pointer to the cosine element offormula \{"type":"element","name":"formula","attributes":\{"id":"6"\},"children":[\{"type":"text","text":"$G$"\}]\}, can be on host or device.s: pointer to the sine element offormula \{"type":"element","name":"formula","attributes":\{"id":"6"\},"children":[\{"type":"text","text":"$G$"\}]\}, can be on host or device.x: sparse vectorformula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\}.y: dense vectorformula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:c,s,xorypointer is invalid.
Parameters:
- musparseHandle_t
handleconst voidcconst voids - musparseSpVecDescr_t
x - musparseDnVecDescr_t
y
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSparseToDense_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSparseToDense_legacy(musparseHandle_t handle, const musparseSpMatDescr_t mat_A, musparseDnMatDescr_t mat_B, musparseSparseToDenseAlg_t alg, size_t `buffer_size, void `temp_buffer)
Sparse matrix to dense matrix conversion.
musparseSparseToDense musparseSparseToDense performs the conversion of a sparse matrix in CSR, CSC, or COO format to a dense matrix
注意:This function writes the required allocation size (in bytes) to
buffer_sizeand returns without performing the sparse to dense operation, when a nullptr is passed fortemp_buffer.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.mat_A: sparse matrix descriptor.mat_B: dense matrix descriptor.alg: algorithm for the sparse to dense computation.buffer_size: number of bytes of the temporary storage buffer. buffer_size is set whentemp_bufferis nullptr.temp_buffer: temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written tobuffer_sizeand function returns without performing the sparse to dense operation.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:mat_A,mat_B, orbuffer_sizepointer is invalid.
Parameters:
- musparseHandle_t
handle - const musparseSpMatDescr_t
mat_A - musparseDnMatDescr_t
mat_B - musparseSparseToDenseAlg_t
algsize_tbuffer_sizevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDenseToSparse
MUSPARSE_EXPORT musparseStatus_t musparseDenseToSparse(musparseHandle_t handle, const musparseDnMatDescr_t mat_A, musparseSpMatDescr_t mat_B, musparseDenseToSparseAlg_t alg, size_t `buffer_size, void `temp_buffer)
Dense matrix to sparse matrix conversion.
musparseDenseToSparse musparseDenseToSparse performs the conversion of a dense matrix to a sparse matrix in CSR, CSC, or COO format.
注意:This function writes the required allocation size (in bytes) to
buffer_sizeand returns without performing the dense to sparse operation, when a nullptr is passed fortemp_buffer.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.mat_A: dense matrix descriptor.mat_B: sparse matrix descriptor.alg: algorithm for the sparse to dense computation.buffer_size: number of bytes of the temporary storage buffer. buffer_size is set whentemp_bufferis nullptr.temp_buffer: temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written tobuffer_sizeand function returns without performing the dense to sparse operation.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:mat_A,mat_B, orbuffer_sizepointer is invalid.
Parameters:
- musparseHandle_t
handle - const musparseDnMatDescr_t
mat_A - musparseSpMatDescr_t
mat_B - musparseDenseToSparseAlg_t
algsize_tbuffer_sizevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDenseToSparse_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseDenseToSparse_bufferSize(musparseHandle_t handle, musparseConstDnMatDescr_t matA, musparseSpMatDescr_t matB, musparseDenseToSparseAlg_t alg, size_t *bufferSize)
Parameters:
- musparseHandle_t
handle - musparseConstDnMatDescr_t
matA - musparseSpMatDescr_t
matB - musparseDenseToSparseAlg_t
algsize_tbufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDenseToSparse_analysis
MUSPARSE_EXPORT musparseStatus_t musparseDenseToSparse_analysis(musparseHandle_t handle, musparseConstDnMatDescr_t matA, musparseSpMatDescr_t matB, musparseDenseToSparseAlg_t alg, void *externalBuffer)
Parameters:
- musparseHandle_t
handle - musparseConstDnMatDescr_t
matA - musparseSpMatDescr_t
matB - musparseDenseToSparseAlg_t
algvoidexternalBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseDenseToSparse_convert
MUSPARSE_EXPORT musparseStatus_t musparseDenseToSparse_convert(musparseHandle_t handle, musparseConstDnMatDescr_t matA, musparseSpMatDescr_t matB, musparseDenseToSparseAlg_t alg, void *externalBuffer)
Parameters:
- musparseHandle_t
handle - musparseConstDnMatDescr_t
matA - musparseSpMatDescr_t
matB - musparseDenseToSparseAlg_t
algvoidexternalBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpVV_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSpVV_legacy(musparseHandle_t handle, musparseOperation_t trans, const musparseSpVecDescr_t x, const musparseDnVecDescr_t y, void `result, musparseDataType_t compute_type, size_t `buffer_size, void *temp_buffer)
Sparse vector inner dot product.
musparseSpVV computes the inner dot product of the sparse vecotr formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} with the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"117"\},"children":[\{"type":"text","text":"\\[ \\text\{result\} := x^\{'\}\n\\cdot y, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"118"\},"children":[\{"type":"text","text":"\\[ op(x) = \\left\\\{ \\begin\{array\}\{ll\}\n x, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n \\bar\{x\}, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n\\\\ \\end\{array\} \\right. \\]"\}]\}
result = 0;
for(i = 0; i < nnz; ++i)
\{
result += x_val[i] * y[x_ind[i]];
\}
注意:This function writes the required allocation size (in bytes) to
buffer_sizeand returns without performing the SpVV operation, when a nullptr is passed fortemp_buffer.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans: sparse vector operation type.x: sparse vector descriptor.y: dense vector descriptor.result: pointer to the result, can be host or device memorycompute_type: floating point precision for the SpVV computation.buffer_size: number of bytes of the temporary storage buffer. buffer_size is set whentemp_bufferis nullptr.temp_buffer: temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written tobuffer_sizeand function returns without performing the SpVV operation.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:x,y,resultorbuffer_sizepointer is```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDcompute_type` is currently not supported.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans - const musparseSpVecDescr_t
x - const musparseDnVecDescr_t
yvoidresult - musparseDataType_t
compute_typesize_tbuffer_sizevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMV_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSpMV_legacy(musparseHandle_t handle, musparseOperation_t trans, const void `alpha, const musparseSpMatDescr_t mat, const musparseDnVecDescr_t x, const void `beta, const musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpMVAlg_t alg, void *temp_buffer)
Sparse matrix vector multiplication.
musparseSpMV multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"25"\},"children":[\{"type":"text","text":"$m\n\\times n$"\}]\} matrix and the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} and adds the result to the dense vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"119"\},"children":[\{"type":"text","text":"\\[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"11"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:This function writes the required allocation size (in bytes) to
buffer_sizeand returns without performing the SpMV operation, when a nullptr is passed fortemp_buffer.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.mat: matrix descriptor.x: vector descriptor.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.y: vector descriptor.compute_type: floating point precision for the SpMV computation.alg: SpMV algorithm for the SpMV computation.buffer_size: number of bytes of the temporary storage buffer. buffer_size is set whentemp_bufferis nullptr.temp_buffer: temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written tobuffer_sizeand function returns without performing the SpMV operation.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alpha,mat,x,beta,yorbuffer_sizepointer is```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDcompute_typeoralg` is currently not supported.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - const musparseSpMatDescr_t
mat - const musparseDnVecDescr_t
xconst voidbeta - const musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpMVAlg_t
algvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMV_legacy_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpMV_legacy_bufferSize(musparseHandle_t handle, musparseOperation_t trans, const void `alpha, const musparseSpMatDescr_t mat, const musparseDnVecDescr_t x, const void `beta, const musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpMVAlg_t alg, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - const musparseSpMatDescr_t
mat - const musparseDnVecDescr_t
xconst voidbeta - const musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpMVAlg_t
algsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMV
MUSPARSE_EXPORT musparseStatus_t musparseSpMV(musparseHandle_t handle, musparseOperation_t trans, const void `alpha, musparseConstSpMatDescr_t mat, musparseConstDnVecDescr_t x, const void `beta, musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpMVAlg_t alg, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - musparseConstSpMatDescr_t
mat - musparseConstDnVecDescr_t
xconst voidbeta - musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpMVAlg_t
algvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMV_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpMV_bufferSize(musparseHandle_t handle, musparseOperation_t trans, const void `alpha, musparseConstSpMatDescr_t mat, musparseConstDnVecDescr_t x, const void `beta, musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpMVAlg_t alg, size_t *buffer_size)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - musparseConstSpMatDescr_t
mat - musparseConstDnVecDescr_t
xconst voidbeta - musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpMVAlg_t
algsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMV_preprocess
MUSPARSE_EXPORT musparseStatus_t musparseSpMV_preprocess(musparseHandle_t handle, musparseOperation_t trans, const void `alpha, musparseConstSpMatDescr_t mat, musparseConstDnVecDescr_t x, const void `beta, const musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpMVAlg_t alg, void *temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - musparseConstSpMatDescr_t
mat - musparseConstDnVecDescr_t
xconst voidbeta - const musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpMVAlg_t
algvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSV
MUSPARSE_EXPORT musparseStatus_t musparseSpSV(musparseHandle_t handle, musparseOperation_t trans, const void `alpha, const musparseSpMatDescr_t mat, const musparseDnVecDescr_t x, const musparseDnVecDescr_t y, musparseDataType_t compute_type, musparseSpSVAlg_t alg, musparseSpSVStage_t stage, size_t `buffer_size, void *temp_buffer)
Sparse triangular solve.
musparse_spsv_solve solves a sparse triangular linear system of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix, defined in CSR or COO storage format, a dense solution vector formula \{"type":"element","name":"formula","attributes":\{"id":"2"\},"children":[\{"type":"text","text":"$y$"\}]\} and the right-hand side formula \{"type":"element","name":"formula","attributes":\{"id":"0"\},"children":[\{"type":"text","text":"$x$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"21"\},"children":[\{"type":"text","text":"\\[ op(A) \\cdot y = \\alpha \\cdot x, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"11"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:SpSV requires three stages to complete. The first stage MUSPARSE_SPSV_STAGE_BUFFER_SIZE will return the size of the temporary storage buffer that is required for subsequent calls. The second stage MUSPARSE_SPSV_STAGE_PREPROCESS will preprocess data that would be saved in the temporary storage buffer. In the final stage MUSPARSE_SPSV_STAGE_COMPUTE, the actual computation is performed.
注意:If MUSPARSE_SPSV_STAGE_AUTO is selected, musparse will automatically detect which stage is required based on the following indicators: If
temp_bufferis equal tonullptr, the required buffer size will be returned. Ifbuffer_sizeis equal tonullptr, analysis will be performed. Otherwise, the SpSV preprocess and the SpSV algorithm will be executed.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans== MUSPARSE_OPERATION_NON_TRANSPOSE andtrans== MUSPARSE_OPERATION_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.trans: matrix operation type.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.mat: matrix descriptor.x: vector descriptor.y: vector descriptor.compute_type: floating point precision for the SpSV computation.alg: SpSV algorithm for the SpSV computation.stage: SpSV stage for the SpSV computation.buffer_size: number of bytes of the temporary storage buffer.temp_buffer: temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written tobuffer_sizeand function returns without performing the SpSV operation.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alpha,mat,x,y,descrorbuffer_sizepointer is```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans,compute_type,stageoralg` is currently not supported.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
transconst voidalpha - const musparseSpMatDescr_t
mat - const musparseDnVecDescr_t
x - const musparseDnVecDescr_t
y - musparseDataType_t
compute_type - musparseSpSVAlg_t
alg - musparseSpSVStage_t
stagesize_tbuffer_sizevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSM
MUSPARSE_EXPORT musparseStatus_t musparseSpSM(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, const void `alpha, const musparseSpMatDescr_t matA, const musparseDnMatDescr_t matB, const musparseDnMatDescr_t matC, musparseDataType_t compute_type, musparseSpSMAlg_t alg, musparseSpSMStage_t stage, size_t `buffer_size, void *temp_buffer)
Sparse triangular system solve.
musparse_spsm_solve solves a sparse triangular linear system of a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"20"\},"children":[\{"type":"text","text":"$m \\times m$"\}]\} matrix, defined in CSR or COO storage format, a dense solution matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\} and the right-hand side formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"120"\},"children":[\{"type":"text","text":"\\[ op(A) \\cdot C = \\alpha \\cdot op(B), \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"11"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"70"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:SpSM requires three stages to complete. The first stage MUSPARSE_SPSM_STAGE_BUFFER_SIZE will return the size of the temporary storage buffer that is required for subsequent calls. The second stage MUSPARSE_SPSM_STAGE_PREPROCESS will preprocess data that would be saved in the temporary storage buffer. In the final stage MUSPARSE_SPSM_STAGE_COMPUTE, the actual computation is performed.
注意:If MUSPARSE_SPSM_STAGE_AUTO is selected, musparse will automatically detect which stage is required based on the following indicators: If
temp_bufferis equal tonullptr, the required buffer size will be returned. Ifbuffer_sizeis equal tonullptr, analysis will be performed. Otherwise, the SpSM preprocess and the SpSM algorithm will be executed.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans_A== MUSPARSE_OPERATION_NON_TRANSPOSE andtrans_A== MUSPARSE_OPERATION_TRANSPOSE is supported. Currently, onlytrans_B== MUSPARSE_OPERATION_NON_TRANSPOSE andtrans_B== MUSPARSE_OPERATION_TRANSPOSE is supported.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrix operation type for the sparse matrix A.trans_B: matrix operation type for the dense matrix B.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.matA: sparse matrix descriptor.matB: dense matrix descriptor.matC: dense matrix descriptor.compute_type: floating point precision for the SpSM computation.alg: SpSM algorithm for the SpSM computation.stage: SpSM stage for the SpSM computation.buffer_size: number of bytes of the temporary storage buffer.temp_buffer: temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written tobuffer_sizeand function returns without performing the SpSM operation.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alpha,matA,matB,matC,descrorbuffer_sizepointer is```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A,trans_B,compute_type,stageoralg` is currently not supported.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_Bconst voidalpha - const musparseSpMatDescr_t
matA - const musparseDnMatDescr_t
matB - const musparseDnMatDescr_t
matC - musparseDataType_t
compute_type - musparseSpSMAlg_t
alg - musparseSpSMStage_t
stagesize_tbuffer_sizevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSM_createDescr
MUSPARSE_EXPORT musparseStatus_t musparseSpSM_createDescr(musparseSpSMDescr_t *descr)
Parameters:
[musparseSpSMDescr\_t](#musparse-functions_8h_1abf5df20836f675d6d1088e20816fcfd1) descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSM_destroyDescr
MUSPARSE_EXPORT musparseStatus_t musparseSpSM_destroyDescr(musparseSpSMDescr_t descr)
Parameters:
- musparseSpSMDescr_t
descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSM_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpSM_bufferSize(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstDnMatDescr_t matB, musparseDnMatDescr_t matC, musaDataType computeType, musparseSpSMAlg_t alg, musparseSpSMDescr_t spsmDescr, size_t `bufferSize)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstDnMatDescr_t
matB - musparseDnMatDescr_t
matC - musaDataType
computeType - musparseSpSMAlg_t
alg - musparseSpSMDescr_t
spsmDescrsize_tbufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSM_analysis
MUSPARSE_EXPORT musparseStatus_t musparseSpSM_analysis(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstDnMatDescr_t matB, musparseDnMatDescr_t matC, musaDataType computeType, musparseSpSMAlg_t alg, musparseSpSMDescr_t spsmDescr, void `externalBuffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstDnMatDescr_t
matB - musparseDnMatDescr_t
matC - musaDataType
computeType - musparseSpSMAlg_t
alg - musparseSpSMDescr_t
spsmDescrvoidexternalBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpSM_solve
MUSPARSE_EXPORT musparseStatus_t musparseSpSM_solve(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void *alpha, musparseConstSpMatDescr_t matA, musparseConstDnMatDescr_t matB, musparseDnMatDescr_t matC, musaDataType computeType, musparseSpSMAlg_t alg, musparseSpSMDescr_t spsmDescr)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstDnMatDescr_t
matB - musparseDnMatDescr_t
matC - musaDataType
computeType - musparseSpSMAlg_t
alg - musparseSpSMDescr_t
spsmDescr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMM_ex
MUSPARSE_EXPORT musparseStatus_t musparseSpMM_ex(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, const void `alpha, const musparseSpMatDescr_t mat_A, const musparseDnMatDescr_t mat_B, const void `beta, const musparseDnMatDescr_t mat_C, musparseDataType_t compute_type, musparseSpMMAlg_t alg, musparseSpMMStage_t stage, size_t `buffer_size, void `temp_buffer)
Sparse matrix dense matrix multiplication, extension routine.
musparseSpMM (or musparseSpMM_ex ) multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with a sparse formula \{"type":"element","name":"formula","attributes":\{"id":"90"\},"children":[\{"type":"text","text":"$m \\times k$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, defined in CSR or COO or Blocked ELL storage format, and the dense formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\} and adds the result to the dense formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\} that is multiplied by the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"121"\},"children":[\{"type":"text","text":"\\[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C,\n \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"81"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"70"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Currently, only
trans_A== MUSPARSE_OPERATION_NON_TRANSPOSE is supported for COO and Blocked ELL formats.
注意:Currently, only CSR, COO and Blocked ELL sparse formats are supported.
注意:Different algorithms are available which can provide better performance for different matrices. Currently, the available algorithms are MUSPARSE_SPMM_ALG_CSR, MUSPARSE_SPMM_ALG_CSR_ROW_SPLIT or MUSPARSE_SPMM_ALG_CSR_MERGE for CSR matrices, MUSPARSE_SPMM_ALG_BLOCKED_ELL for Blocked ELL matrices and MUSPARSE_SPMM_ALG_COO_SEGMENTED or MUSPARSE_SPMM_ALG_COO_ATOMIC for COO matrices. Additionally, one can specify the algorithm to be MUSPARSE_SPMM_ALG_DEFAULT. In the case of CSR matrices this will set the algorithm to be MUSPARSE_SPMM_ALG_CSR, in the case of Blocked ELL matrices this will set the algorithm to be MUSPARSE_SPMM_ALG_BLOCKED_ELL and for COO matrices it will set the algorithm to be MUSPARSE_SPMM_ALG_COO_ATOMIC.
注意:This function writes the required allocation size (in bytes) to
buffer_sizeand returns without performing the SpMM operation, when a nullptr is passed fortemp_buffer.
注意:SpMM requires three stages to complete. The first stage MUSPARSE_SPMM_STAGE_BUFFER_SIZE will return the size of the temporary storage buffer that is required for subsequent calls to musparseSpMM (or musparseSpMM_ex). The second stage MUSPARSE_SPMM_STAGE_PREPROCESS will preprocess data that would be saved in the temporary storage buffer. In the final stage MUSPARSE_SPMM_STAGE_COMPUTE, the actual computation is performed.
注意:If MUSPARSE_SPMM_STAGE_AUTO is selected, musparse will automatically detect which stage is required based on the following indicators: If
temp_bufferis equal tonullptr, the required buffer size will be returned. Else, the SpMM preprocess and the SpMM algorithm will be executed.
Parameters:
handle: handle to the musparse library context queue.trans_A: matrix operation type.trans_B: matrix operation type.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.mat_A: matrix descriptor.mat_B: matrix descriptor.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.mat_C: matrix descriptor.compute_type: floating point precision for the SpMM computation.alg: SpMM algorithm for the SpMM computation.stage: SpMM stage for the SpMM computation.buffer_size: number of bytes of the temporary storage buffer. buffer_size is set whentemp_bufferis nullptr.temp_buffer: temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written tobuffer_sizeand function returns without performing the SpMM operation.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alpha,mat_A,mat_B,mat_C,beta, orbuffer_sizepointer is```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A,trans_B,compute_typeoralg` is currently not supported.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_Bconst voidalpha - const musparseSpMatDescr_t
mat_A - const musparseDnMatDescr_t
mat_Bconst voidbeta - const musparseDnMatDescr_t
mat_C - musparseDataType_t
compute_type - musparseSpMMAlg_t
alg - musparseSpMMStage_t
stagesize_tbuffer_sizevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMM_legacy
MUSPARSE_EXPORT musparseStatus_t musparseSpMM_legacy(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, const void `alpha, const musparseSpMatDescr_t mat_A, const musparseDnMatDescr_t mat_B, const void `beta, const musparseDnMatDescr_t mat_C, musparseDataType_t compute_type, musparseSpMMAlg_t alg, musparseSpMMStage_t stage, size_t `buffer_size, void `temp_buffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_Bconst voidalpha - const musparseSpMatDescr_t
mat_A - const musparseDnMatDescr_t
mat_Bconst voidbeta - const musparseDnMatDescr_t
mat_C - musparseDataType_t
compute_type - musparseSpMMAlg_t
alg - musparseSpMMStage_t
stagesize_tbuffer_sizevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMM_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSpMM_bufferSize(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstDnMatDescr_t matB, const void `beta, musparseDnMatDescr_t matC, musaDataType computeType, musparseSpMMAlg_t alg, size_t *bufferSize)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstDnMatDescr_t
matBconst voidbeta - musparseDnMatDescr_t
matC - musaDataType
computeType - musparseSpMMAlg_t
algsize_tbufferSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMM_preprocess
MUSPARSE_EXPORT musparseStatus_t musparseSpMM_preprocess(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstDnMatDescr_t matB, const void `beta, musparseDnMatDescr_t matC, musaDataType computeType, musparseSpMMAlg_t alg, void *externalBuffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstDnMatDescr_t
matBconst voidbeta - musparseDnMatDescr_t
matC - musaDataType
computeType - musparseSpMMAlg_t
algvoidexternalBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMM
MUSPARSE_EXPORT musparseStatus_t musparseSpMM(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstDnMatDescr_t matB, const void `beta, musparseDnMatDescr_t matC, musaDataType computeType, musparseSpMMAlg_t alg, void *externalBuffer)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstDnMatDescr_t
matBconst voidbeta - musparseDnMatDescr_t
matC - musaDataType
computeType - musparseSpMMAlg_t
algvoidexternalBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMMOp_createPlan
MUSPARSE_EXPORT musparseStatus_t musparseSpMMOp_createPlan(musparseHandle_t handle, musparseSpMMOpPlan_t `plan, musparseOperation_t opA, musparseOperation_t opB, musparseConstSpMatDescr_t matA, musparseConstDnMatDescr_t matB, musparseDnMatDescr_t matC, musaDataType computeType, musparseSpMMOpAlg_t alg, const void `addOperationNvvmBuffer, size_t addOperationBufferSize, const void `mulOperationNvvmBuffer, size_t mulOperationBufferSize, const void `epilogueNvvmBuffer, size_t epilogueBufferSize, size_t *SpMMWorkspaceSize)
Parameters:
- musparseHandle_t
handle[musparseSpMMOpPlan\_t](#musparse-functions_8h_1aa9728da5e054f18d4e0b27c19a7c26b9)plan - musparseOperation_t
opA - musparseOperation_t
opB - musparseConstSpMatDescr_t
matA - musparseConstDnMatDescr_t
matB - musparseDnMatDescr_t
matC - musaDataType
computeType - musparseSpMMOpAlg_t
algconst voidaddOperationNvvmBuffer - size_t
addOperationBufferSizeconst voidmulOperationNvvmBuffer - size_t
mulOperationBufferSizeconst voidepilogueNvvmBuffer - size_t
epilogueBufferSizesize_tSpMMWorkspaceSize
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMMOp
MUSPARSE_EXPORT musparseStatus_t musparseSpMMOp(musparseSpMMOpPlan_t plan, void *externalBuffer)
Parameters:
- musparseSpMMOpPlan_t
planvoidexternalBuffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpMMOp_destroyPlan
MUSPARSE_EXPORT musparseStatus_t musparseSpMMOp_destroyPlan(musparseSpMMOpPlan_t plan)
Parameters:
- musparseSpMMOpPlan_t
plan
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMM
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMM(musparseHandle_t handle, musparseOperation_t trans_A, musparseOperation_t trans_B, const void `alpha, const musparseSpMatDescr_t A, const musparseSpMatDescr_t B, const void `beta, const musparseSpMatDescr_t D, musparseSpMatDescr_t C, musparseDataType_t compute_type, musparseSpGEMMAlg_t alg, musparseSpGEMMStage_t stage, size_t `buffer_size, void `temp_buffer)
Sparse matrix sparse matrix multiplication.
musparseSpGEMM multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"90"\},"children":[\{"type":"text","text":"$m \\times k$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\} and the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\} and adds the result to the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\} that is multiplied by formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}. The final result is stored in the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"122"\},"children":[\{"type":"text","text":"\\[ C := \\alpha \\cdot op(A) \\cdot\nop(B) + \\beta \\cdot D, \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"74"\},"children":[\{"type":"text","text":"\\[ op(A) = \\left\\\{ \\begin\{array\}\{ll\}\n A, & \\text\{if trans_A == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if trans_A == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n A^H, & \\text\{if trans_A == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"70"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if trans_B == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if trans_B == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n B^H, & \\text\{if trans_B == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\}\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:SpGEMM requires three stages to complete. The first stage MUSPARSE_SPGEMM_STAGE_BUFFER_SIZE will return the size of the temporary storage buffer that is required for subsequent calls to musparseSpGEMM. The second stage MUSPARSE_SPGEMM_STAGE_NNZ will determine the number of non-zero elements of the resulting
formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}matrix. If the sparsity pattern offormula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}is already known, this stage can be skipped. In the final stage MUSPARSE_SPGEMM_STAGE_COMPUTE, the actual computation is performed.
注意:If MUSPARSE_SPGEMM_STAGE_AUTO is selected, musparse will automatically detect which stage is required based on the following indicators: If
temp_bufferis equal tonullptr, the required buffer size will be returned. Else, if the number of non-zeros offormula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}is zero, the number of non-zero entries will be computed. Else, the SpGEMM algorithm will be executed.
注意:If
formula \{"type":"element","name":"formula","attributes":\{"id":"94"\},"children":[\{"type":"text","text":"$\\alpha == 0$"\}]\}, thenformula \{"type":"element","name":"formula","attributes":\{"id":"95"\},"children":[\{"type":"text","text":"$C = \\beta \\cdot D$"\}]\}will be computed.
注意:If
formula \{"type":"element","name":"formula","attributes":\{"id":"96"\},"children":[\{"type":"text","text":"$\\beta == 0$"\}]\}, thenformula \{"type":"element","name":"formula","attributes":\{"id":"123"\},"children":[\{"type":"text","text":"$C = \\alpha \\cdot op(A)\n\\cdot op(B)$"\}]\}will be computed.
注意:If MUSPARSE_SPGEMM_STAGE_SYMBOLIC is selected then the symbolic computation is performed only.
注意:If MUSPARSE_SPGEMM_STAGE_NUMERIC is selected then the numeric computation is performed only.
注意:
formula \{"type":"element","name":"formula","attributes":\{"id":"98"\},"children":[\{"type":"text","text":"$\\alpha == beta == 0$"\}]\}is invalid.
注意:It is allowed to pass the same sparse matrix for
formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}andformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}, if both matrices have the same sparsity pattern.
注意:Currently, only
trans_A== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:Currently, only
trans_B== MUSPARSE_OPERATION_NON_TRANSPOSE is supported.
注意:This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
注意:Please note, that for rare matrix products with more than 4096 non-zero entries per row, additional temporary storage buffer is allocated by the algorithm.
Parameters:
handle: handle to the musparse library context queue.trans_A: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.trans_B: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.A: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}descriptor.B: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}descriptor.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.D: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"89"\},"children":[\{"type":"text","text":"$D$"\}]\}descriptor.C: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}descriptor.compute_type: floating point precision for the SpGEMM computation.alg: SpGEMM algorithm for the SpGEMM computation.stage: SpGEMM stage for the SpGEMM computation.buffer_size: number of bytes of the temporary storage buffer. buffer_size is set whentemp_bufferis nullptr.temp_buffer: temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written tobuffer_sizeand function returns without performing the SpGEMM operation.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alphaandbetaare invalid,A,B,D,Corbuffer_sizepointer is invalid. `MUSPARSE_EXPORT: MUSPARSE_STATUS_MEMORY_ERROR additional buffer for long rows could not be allocated.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDtrans_A!= MUSPARSE_OPERATION_NON_TRANSPOSE ortrans_B!= MUSPARSE_OPERATION_NON_TRANSPOSE.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
trans_A - musparseOperation_t
trans_Bconst voidalpha - const musparseSpMatDescr_t
A - const musparseSpMatDescr_t
Bconst voidbeta - const musparseSpMatDescr_t
D - musparseSpMatDescr_t
C - musparseDataType_t
compute_type - musparseSpGEMMAlg_t
alg - musparseSpGEMMStage_t
stagesize_tbuffer_sizevoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMM_createDescr
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMM_createDescr(musparseSpGEMMDescr_t *descr)
Parameters:
[musparseSpGEMMDescr\_t](#musparse-functions_8h_1abf2f26d57d9fb437672c1e65a6a744d6) descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMM_destroyDescr
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMM_destroyDescr(musparseSpGEMMDescr_t descr)
Parameters:
- musparseSpGEMMDescr_t
descr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMM_workEstimation
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMM_workEstimation(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstSpMatDescr_t matB, const void `beta, musparseSpMatDescr_t matC, musaDataType computeType, musparseSpGEMMAlg_t alg, musparseSpGEMMDescr_t spgemmDescr, size_t `bufferSize1, void `externalBuffer1)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstSpMatDescr_t
matBconst voidbeta - musparseSpMatDescr_t
matC - musaDataType
computeType - musparseSpGEMMAlg_t
alg - musparseSpGEMMDescr_t
spgemmDescrsize_tbufferSize1voidexternalBuffer1
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMM_getNumProducts
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMM_getNumProducts(musparseSpGEMMDescr_t spgemmDescr, int64_t *num_prods)
Parameters:
- musparseSpGEMMDescr_t
spgemmDescrint64_tnum_prods
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMM_estimateMemory
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMM_estimateMemory(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstSpMatDescr_t matB, const void `beta, musparseSpMatDescr_t matC, musaDataType computeType, musparseSpGEMMAlg_t alg, musparseSpGEMMDescr_t spgemmDescr, float chunk_fraction, size_t `bufferSize3, void `externalBuffer3, size_t *bufferSize2)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstSpMatDescr_t
matBconst voidbeta - musparseSpMatDescr_t
matC - musaDataType
computeType - musparseSpGEMMAlg_t
alg - musparseSpGEMMDescr_t
spgemmDescr - float
chunk_fractionsize_tbufferSize3voidexternalBuffer3size_tbufferSize2
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMM_compute
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMM_compute(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstSpMatDescr_t matB, const void `beta, musparseSpMatDescr_t matC, musaDataType computeType, musparseSpGEMMAlg_t alg, musparseSpGEMMDescr_t spgemmDescr, size_t `bufferSize2, void `externalBuffer2)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstSpMatDescr_t
matBconst voidbeta - musparseSpMatDescr_t
matC - musaDataType
computeType - musparseSpGEMMAlg_t
alg - musparseSpGEMMDescr_t
spgemmDescrsize_tbufferSize2voidexternalBuffer2
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMM_copy
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMM_copy(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstSpMatDescr_t matB, const void `beta, musparseSpMatDescr_t matC, musaDataType computeType, musparseSpGEMMAlg_t alg, musparseSpGEMMDescr_t spgemmDescr)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstSpMatDescr_t
matBconst voidbeta - musparseSpMatDescr_t
matC - musaDataType
computeType - musparseSpGEMMAlg_t
alg - musparseSpGEMMDescr_t
spgemmDescr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMMreuse_workEstimation
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMMreuse_workEstimation(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, musparseConstSpMatDescr_t matA, musparseConstSpMatDescr_t matB, musparseSpMatDescr_t matC, musparseSpGEMMAlg_t alg, musparseSpGEMMDescr_t spgemmDescr, size_t `bufferSize1, void `externalBuffer1)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opB - musparseConstSpMatDescr_t
matA - musparseConstSpMatDescr_t
matB - musparseSpMatDescr_t
matC - musparseSpGEMMAlg_t
alg - musparseSpGEMMDescr_t
spgemmDescrsize_tbufferSize1voidexternalBuffer1
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMMreuse_nnz
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMMreuse_nnz(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, musparseConstSpMatDescr_t matA, musparseConstSpMatDescr_t matB, musparseSpMatDescr_t matC, musparseSpGEMMAlg_t alg, musparseSpGEMMDescr_t spgemmDescr, size_t `bufferSize2, void `externalBuffer2, size_t `bufferSize3, void `externalBuffer3, size_t `bufferSize4, void `externalBuffer4)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opB - musparseConstSpMatDescr_t
matA - musparseConstSpMatDescr_t
matB - musparseSpMatDescr_t
matC - musparseSpGEMMAlg_t
alg - musparseSpGEMMDescr_t
spgemmDescrsize_tbufferSize2voidexternalBuffer2size_tbufferSize3voidexternalBuffer3size_tbufferSize4voidexternalBuffer4
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMMreuse_copy
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMMreuse_copy(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, musparseConstSpMatDescr_t matA, musparseConstSpMatDescr_t matB, musparseSpMatDescr_t matC, musparseSpGEMMAlg_t alg, musparseSpGEMMDescr_t spgemmDescr, size_t `bufferSize5, void `externalBuffer5)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opB - musparseConstSpMatDescr_t
matA - musparseConstSpMatDescr_t
matB - musparseSpMatDescr_t
matC - musparseSpGEMMAlg_t
alg - musparseSpGEMMDescr_t
spgemmDescrsize_tbufferSize5voidexternalBuffer5
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSpGEMMreuse_compute
MUSPARSE_EXPORT musparseStatus_t musparseSpGEMMreuse_compute(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, musparseConstSpMatDescr_t matA, musparseConstSpMatDescr_t matB, const void `beta, musparseSpMatDescr_t matC, musaDataType computeType, musparseSpGEMMAlg_t alg, musparseSpGEMMDescr_t spgemmDescr)
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - musparseConstSpMatDescr_t
matA - musparseConstSpMatDescr_t
matBconst voidbeta - musparseSpMatDescr_t
matC - musaDataType
computeType - musparseSpGEMMAlg_t
alg - musparseSpGEMMDescr_t
spgemmDescr
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSDDMM
MUSPARSE_EXPORT musparseStatus_t musparseSDDMM(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, const musparseDnMatDescr_t A, const musparseDnMatDescr_t B, const void `beta, musparseSpMatDescr_t C, musparseDataType_t compute_type, musparseSDDMMAlg_t alg, void *temp_buffer)
Sampled Dense-Dense Matrix Multiplication.
musparseSDDMM multiplies the scalar formula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\} with the dense formula \{"type":"element","name":"formula","attributes":\{"id":"90"\},"children":[\{"type":"text","text":"$m \\times k$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}, the dense formula \{"type":"element","name":"formula","attributes":\{"id":"38"\},"children":[\{"type":"text","text":"$k \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}, filtered by the sparsity pattern of the formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} sparse matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\} and adds the result to formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\} scaled by formula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}. The final result is stored in the sparse formula \{"type":"element","name":"formula","attributes":\{"id":"41"\},"children":[\{"type":"text","text":"$m \\times n$"\}]\} matrix formula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}, such that formula \{"type":"element","name":"formula","attributes":\{"id":"124"\},"children":[\{"type":"text","text":"\\[\n C := \\alpha ( opA(A) \\cdot opB(B) ) \\cdot spy(C) + \\beta C,\n \\]"\}]\} with formula \{"type":"element","name":"formula","attributes":\{"id":"125"\},"children":[\{"type":"text","text":"\\[\n op(A) = \\left\\\{\n \\begin\{array\}\{ll\}\n A, & \\text\{if opA == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n A^T, & \\text\{if opA == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n \\end\{array\}\n \\right.\n \\]"\}]\}, formula \{"type":"element","name":"formula","attributes":\{"id":"126"\},"children":[\{"type":"text","text":"\\[\n op(B) = \\left\\\{\n \\begin\{array\}\{ll\}\n B, & \\text\{if opB == MUSPARSE_OPERATION_NON_TRANSPOSE\} \\\\\n B^T, & \\text\{if opB == MUSPARSE_OPERATION_TRANSPOSE\} \\\\\n \\end\{array\}\n \\right.\n \\]"\}]\} and formula \{"type":"element","name":"formula","attributes":\{"id":"127"\},"children":[\{"type":"text","text":"\\[\n spy(C)_ij = \\left\\\{\n \\begin\{array\}\{ll\}\n 1 \\text\{if i == j\}, & 0 \\text\{if i != j\} \\\\\n \\end\{array\}\n \\right.\n \\]"\}]\}
注意:
opA== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE is not supported.
注意:
opB== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE is not supported.
Parameters:
handle: handle to the musparse library context queue.opA: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.opB: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.A: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}descriptor.B: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}descriptor.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.C: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}descriptor.compute_type: floating point precision for the SDDMM computation.alg: specification of the algorithm to use.temp_buffer: temporary storage buffer allocated by the user. The size must be greater or equal to the size obtained with musparseSDDMM_bufferSize.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_VALUE: the value oftrans_A,trans_B,compute_typeor alg is incorrect.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alphaandbetaare invalid,A,B,D,Cortemp_bufferpointer is```: MUSPARSE_EXPORT MUSPARSE_STATUS_NOT_IMPLEMENTEDopA== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE oropB` == MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - const musparseDnMatDescr_t
A - const musparseDnMatDescr_t
Bconst voidbeta - musparseSpMatDescr_t
C - musparseDataType_t
compute_type - musparseSDDMMAlg_t
algvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSDDMM_bufferSize
MUSPARSE_EXPORT musparseStatus_t musparseSDDMM_bufferSize(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, const musparseDnMatDescr_t A, const musparseDnMatDescr_t B, const void `beta, musparseSpMatDescr_t C, musparseDataType_t compute_type, musparseSDDMMAlg_t alg, size_t *buffer_size)
Calculate the size in bytes of the required buffer for the use of musparseSDDMM and musparseSDDMM_preprocess.
musparseSDDMM_bufferSize returns the size of the required buffer to execute the SDDMM operation from a given configuration.
Parameters:
handle: handle to the musparse library context queue.opA: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.opB: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.A: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}descriptor.B: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}descriptor.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.C: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}descriptor.compute_type: floating point precision for the SDDMM computation.alg: specification of the algorithm to use.buffer_size: number of bytes of the temporary storage buffer.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_VALUE: the value oftrans_Aortrans_Bis incorrect.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alphaandbetaare invalid,A,B,D,Corbuffer_sizepointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDopA== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE oropB== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - const musparseDnMatDescr_t
A - const musparseDnMatDescr_t
Bconst voidbeta - musparseSpMatDescr_t
C - musparseDataType_t
compute_type - musparseSDDMMAlg_t
algsize_tbuffer_size
Return type: MUSPARSE_EXPORT musparseStatus_t
Function musparseSDDMM_preprocess
MUSPARSE_EXPORT musparseStatus_t musparseSDDMM_preprocess(musparseHandle_t handle, musparseOperation_t opA, musparseOperation_t opB, const void `alpha, const musparseDnMatDescr_t A, const musparseDnMatDescr_t B, const void `beta, musparseSpMatDescr_t C, musparseDataType_t compute_type, musparseSDDMMAlg_t alg, void *temp_buffer)
Preprocess data before the use of musparseSDDMM.
musparseSDDMM_preprocess executes a part of the algorithm that can be calculated once in the context of multiple calls of the musparseSDDMM with the same sparsity pattern.
Parameters:
handle: handle to the musparse library context queue.opA: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}operation type.opB: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}operation type.alpha: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"1"\},"children":[\{"type":"text","text":"$\\alpha$"\}]\}.A: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"35"\},"children":[\{"type":"text","text":"$A$"\}]\}descriptor.B: dense matrixformula \{"type":"element","name":"formula","attributes":\{"id":"39"\},"children":[\{"type":"text","text":"$B$"\}]\}descriptor.beta: scalarformula \{"type":"element","name":"formula","attributes":\{"id":"9"\},"children":[\{"type":"text","text":"$\\beta$"\}]\}.C: sparse matrixformula \{"type":"element","name":"formula","attributes":\{"id":"42"\},"children":[\{"type":"text","text":"$C$"\}]\}descriptor.compute_type: floating point precision for the SDDMM computation.alg: specification of the algorithm to use.temp_buffer: temporary storage buffer allocated by the user. The size must be greater or equal to the size obtained with musparseSDDMM_bufferSize.
Return values:
MUSPARSE_STATUS_SUCCESS: the operation completed successfully.MUSPARSE_STATUS_INVALID_VALUE: the value oftrans_Aortrans_Bis incorrect.MUSPARSE_STATUS_INVALID_HANDLE: the library context was not initialized.MUSPARSE_STATUS_INVALID_POINTER:alphaandbetaare invalid,A,B,D,Cortemp_bufferpointer is invalid.MUSPARSE_EXPORT: MUSPARSE_STATUS_NOT_IMPLEMENTEDopA== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE oropB== MUSPARSE_OPERATION_CONJUGATE_TRANSPOSE.
Parameters:
- musparseHandle_t
handle - musparseOperation_t
opA - musparseOperation_t
opBconst voidalpha - const musparseDnMatDescr_t
A - const musparseDnMatDescr_t
Bconst voidbeta - musparseSpMatDescr_t
C - musparseDataType_t
compute_type - musparseSDDMMAlg_t
algvoidtemp_buffer
Return type: MUSPARSE_EXPORT musparseStatus_t

