diff --git a/bin/hipify-perl b/bin/hipify-perl index f57304a8..7e2afc72 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -2285,6 +2285,7 @@ sub rocSubstitutions { subst("cusparseCcsrcolor", "rocsparse_ccsrcolor", "library"); subst("cusparseCcsrgeam", "rocsparse_ccsrgeam", "library"); subst("cusparseCcsrgeam2", "rocsparse_ccsrgeam", "library"); + subst("cusparseCcsrgemm2", "rocsparse_ccsrgemm", "library"); subst("cusparseCcsrgemm2_bufferSizeExt", "rocsparse_ccsrgemm_buffer_size", "library"); subst("cusparseCcsric02", "rocsparse_ccsric0", "library"); subst("cusparseCcsric02_analysis", "rocsparse_ccsric0_analysis", "library"); @@ -2409,6 +2410,7 @@ sub rocSubstitutions { subst("cusparseDcsrcolor", "rocsparse_dcsrcolor", "library"); subst("cusparseDcsrgeam", "rocsparse_dcsrgeam", "library"); subst("cusparseDcsrgeam2", "rocsparse_dcsrgeam", "library"); + subst("cusparseDcsrgemm2", "rocsparse_dcsrgemm", "library"); subst("cusparseDcsrgemm2_bufferSizeExt", "rocsparse_dcsrgemm_buffer_size", "library"); subst("cusparseDcsric02", "rocsparse_dcsric0", "library"); subst("cusparseDcsric02_analysis", "rocsparse_dcsric0_analysis", "library"); @@ -2536,6 +2538,7 @@ sub rocSubstitutions { subst("cusparseScsrcolor", "rocsparse_scsrcolor", "library"); subst("cusparseScsrgeam", "rocsparse_scsrgeam", "library"); subst("cusparseScsrgeam2", "rocsparse_scsrgeam", "library"); + subst("cusparseScsrgemm2", "rocsparse_scsrgemm", "library"); subst("cusparseScsrgemm2_bufferSizeExt", "rocsparse_scsrgemm_buffer_size", "library"); subst("cusparseScsric02", "rocsparse_scsric0", "library"); subst("cusparseScsric02_analysis", "rocsparse_scsric0_analysis", "library"); @@ -2664,6 +2667,7 @@ sub rocSubstitutions { subst("cusparseZcsrcolor", "rocsparse_zcsrcolor", "library"); subst("cusparseZcsrgeam", "rocsparse_zcsrgeam", "library"); subst("cusparseZcsrgeam2", "rocsparse_zcsrgeam", "library"); + subst("cusparseZcsrgemm2", "rocsparse_zcsrgemm", "library"); subst("cusparseZcsrgemm2_bufferSizeExt", "rocsparse_zcsrgemm_buffer_size", "library"); subst("cusparseZcsric02", "rocsparse_zcsric0", "library"); subst("cusparseZcsric02_analysis", "rocsparse_zcsric0_analysis", "library"); diff --git a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md index a0a153b5..cbf2b2d6 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -442,19 +442,19 @@ |`cusparseCcsrgeam2`|10.0| | | |`hipsparseCcsrgeam2`|3.5.0| | | | |`rocsparse_ccsrgeam`|3.5.0| | | | | |`cusparseCcsrgeam2_bufferSizeExt`|10.0| | | |`hipsparseCcsrgeam2_bufferSizeExt`|3.5.0| | | | | | | | | | | |`cusparseCcsrgemm`| |10.2| |11.0|`hipsparseCcsrgemm`|3.1.0| | | | | | | | | | | -|`cusparseCcsrgemm2`| |11.0| |12.0|`hipsparseCcsrgemm2`|3.1.0| | | | | | | | | | | +|`cusparseCcsrgemm2`| |11.0| |12.0|`hipsparseCcsrgemm2`|3.1.0| | | | |`rocsparse_ccsrgemm`|2.8.0| | | | | |`cusparseCcsrgemm2_bufferSizeExt`| |11.0| |12.0|`hipsparseCcsrgemm2_bufferSizeExt`|3.1.0| | | | |`rocsparse_ccsrgemm_buffer_size`|2.8.0| | | | | |`cusparseDcsrgeam`| |10.2| |11.0|`hipsparseDcsrgeam`|3.5.0| | | | |`rocsparse_dcsrgeam`|3.5.0| | | | | |`cusparseDcsrgeam2`|10.0| | | |`hipsparseDcsrgeam2`|3.5.0| | | | |`rocsparse_dcsrgeam`|3.5.0| | | | | |`cusparseDcsrgeam2_bufferSizeExt`|10.0| | | |`hipsparseDcsrgeam2_bufferSizeExt`|3.5.0| | | | | | | | | | | |`cusparseDcsrgemm`| |10.2| |11.0|`hipsparseDcsrgemm`|2.8.0| | | | | | | | | | | -|`cusparseDcsrgemm2`| |11.0| |12.0|`hipsparseDcsrgemm2`|2.8.0| | | | | | | | | | | +|`cusparseDcsrgemm2`| |11.0| |12.0|`hipsparseDcsrgemm2`|2.8.0| | | | |`rocsparse_dcsrgemm`|2.8.0| | | | | |`cusparseDcsrgemm2_bufferSizeExt`| |11.0| |12.0|`hipsparseDcsrgemm2_bufferSizeExt`|2.8.0| | | | |`rocsparse_dcsrgemm_buffer_size`|2.8.0| | | | | |`cusparseScsrgeam`| |10.2| |11.0|`hipsparseScsrgeam`|3.5.0| | | | |`rocsparse_scsrgeam`|3.5.0| | | | | |`cusparseScsrgeam2`|10.0| | | |`hipsparseScsrgeam2`|3.5.0| | | | |`rocsparse_scsrgeam`|3.5.0| | | | | |`cusparseScsrgeam2_bufferSizeExt`|10.0| | | |`hipsparseScsrgeam2_bufferSizeExt`|3.5.0| | | | | | | | | | | |`cusparseScsrgemm`| |10.2| |11.0|`hipsparseScsrgemm`|2.8.0| | | | | | | | | | | -|`cusparseScsrgemm2`| |11.0| |12.0|`hipsparseScsrgemm2`|2.8.0| | | | | | | | | | | +|`cusparseScsrgemm2`| |11.0| |12.0|`hipsparseScsrgemm2`|2.8.0| | | | |`rocsparse_scsrgemm`|2.8.0| | | | | |`cusparseScsrgemm2_bufferSizeExt`| |11.0| |12.0|`hipsparseScsrgemm2_bufferSizeExt`|2.8.0| | | | |`rocsparse_scsrgemm_buffer_size`|2.8.0| | | | | |`cusparseXcsrgeam2Nnz`|10.0| | | |`hipsparseXcsrgeam2Nnz`|3.5.0| | | | | | | | | | | |`cusparseXcsrgeamNnz`| |10.2| |11.0|`hipsparseXcsrgeamNnz`|3.5.0| | | | |`rocsparse_csrgeam_nnz`|3.5.0| | | | | @@ -464,7 +464,7 @@ |`cusparseZcsrgeam2`|10.0| | | |`hipsparseZcsrgeam2`|3.5.0| | | | |`rocsparse_zcsrgeam`|3.5.0| | | | | |`cusparseZcsrgeam2_bufferSizeExt`|10.0| | | |`hipsparseZcsrgeam2_bufferSizeExt`|3.5.0| | | | | | | | | | | |`cusparseZcsrgemm`| |10.2| |11.0|`hipsparseZcsrgemm`|3.1.0| | | | | | | | | | | -|`cusparseZcsrgemm2`| |11.0| |12.0|`hipsparseZcsrgemm2`|3.1.0| | | | | | | | | | | +|`cusparseZcsrgemm2`| |11.0| |12.0|`hipsparseZcsrgemm2`|3.1.0| | | | |`rocsparse_zcsrgemm`|2.8.0| | | | | |`cusparseZcsrgemm2_bufferSizeExt`| |11.0| |12.0|`hipsparseZcsrgemm2_bufferSizeExt`|3.1.0| | | | |`rocsparse_zcsrgemm_buffer_size`|2.8.0| | | | | ## **12. CUSPARSE Preconditioners Reference** diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index b0b1d24e..cc9ac1ed 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -442,19 +442,19 @@ |`cusparseCcsrgeam2`|10.0| | | |`rocsparse_ccsrgeam`|3.5.0| | | | | |`cusparseCcsrgeam2_bufferSizeExt`|10.0| | | | | | | | | | |`cusparseCcsrgemm`| |10.2| |11.0| | | | | | | -|`cusparseCcsrgemm2`| |11.0| |12.0| | | | | | | +|`cusparseCcsrgemm2`| |11.0| |12.0|`rocsparse_ccsrgemm`|2.8.0| | | | | |`cusparseCcsrgemm2_bufferSizeExt`| |11.0| |12.0|`rocsparse_ccsrgemm_buffer_size`|2.8.0| | | | | |`cusparseDcsrgeam`| |10.2| |11.0|`rocsparse_dcsrgeam`|3.5.0| | | | | |`cusparseDcsrgeam2`|10.0| | | |`rocsparse_dcsrgeam`|3.5.0| | | | | |`cusparseDcsrgeam2_bufferSizeExt`|10.0| | | | | | | | | | |`cusparseDcsrgemm`| |10.2| |11.0| | | | | | | -|`cusparseDcsrgemm2`| |11.0| |12.0| | | | | | | +|`cusparseDcsrgemm2`| |11.0| |12.0|`rocsparse_dcsrgemm`|2.8.0| | | | | |`cusparseDcsrgemm2_bufferSizeExt`| |11.0| |12.0|`rocsparse_dcsrgemm_buffer_size`|2.8.0| | | | | |`cusparseScsrgeam`| |10.2| |11.0|`rocsparse_scsrgeam`|3.5.0| | | | | |`cusparseScsrgeam2`|10.0| | | |`rocsparse_scsrgeam`|3.5.0| | | | | |`cusparseScsrgeam2_bufferSizeExt`|10.0| | | | | | | | | | |`cusparseScsrgemm`| |10.2| |11.0| | | | | | | -|`cusparseScsrgemm2`| |11.0| |12.0| | | | | | | +|`cusparseScsrgemm2`| |11.0| |12.0|`rocsparse_scsrgemm`|2.8.0| | | | | |`cusparseScsrgemm2_bufferSizeExt`| |11.0| |12.0|`rocsparse_scsrgemm_buffer_size`|2.8.0| | | | | |`cusparseXcsrgeam2Nnz`|10.0| | | | | | | | | | |`cusparseXcsrgeamNnz`| |10.2| |11.0|`rocsparse_csrgeam_nnz`|3.5.0| | | | | @@ -464,7 +464,7 @@ |`cusparseZcsrgeam2`|10.0| | | |`rocsparse_zcsrgeam`|3.5.0| | | | | |`cusparseZcsrgeam2_bufferSizeExt`|10.0| | | | | | | | | | |`cusparseZcsrgemm`| |10.2| |11.0| | | | | | | -|`cusparseZcsrgemm2`| |11.0| |12.0| | | | | | | +|`cusparseZcsrgemm2`| |11.0| |12.0|`rocsparse_zcsrgemm`|2.8.0| | | | | |`cusparseZcsrgemm2_bufferSizeExt`| |11.0| |12.0|`rocsparse_zcsrgemm_buffer_size`|2.8.0| | | | | ## **12. CUSPARSE Preconditioners Reference** diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index d9490515..e1fa2bde 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -315,10 +315,10 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { // NOTE: rocsparse_csrgemm_nnz has different signature, thus it is unsupported yet {"cusparseXcsrgemmNnz", {"hipsparseXcsrgemmNnz", "", CONV_LIB_FUNC, API_SPARSE, 11, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseScsrgemm2", {"hipsparseScsrgemm2", "", CONV_LIB_FUNC, API_SPARSE, 11, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseDcsrgemm2", {"hipsparseDcsrgemm2", "", CONV_LIB_FUNC, API_SPARSE, 11, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseCcsrgemm2", {"hipsparseCcsrgemm2", "", CONV_LIB_FUNC, API_SPARSE, 11, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseZcsrgemm2", {"hipsparseZcsrgemm2", "", CONV_LIB_FUNC, API_SPARSE, 11, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, + {"cusparseScsrgemm2", {"hipsparseScsrgemm2", "rocsparse_scsrgemm", CONV_LIB_FUNC, API_SPARSE, 11, CUDA_DEPRECATED | CUDA_REMOVED}}, + {"cusparseDcsrgemm2", {"hipsparseDcsrgemm2", "rocsparse_dcsrgemm", CONV_LIB_FUNC, API_SPARSE, 11, CUDA_DEPRECATED | CUDA_REMOVED}}, + {"cusparseCcsrgemm2", {"hipsparseCcsrgemm2", "rocsparse_ccsrgemm", CONV_LIB_FUNC, API_SPARSE, 11, CUDA_DEPRECATED | CUDA_REMOVED}}, + {"cusparseZcsrgemm2", {"hipsparseZcsrgemm2", "rocsparse_zcsrgemm", CONV_LIB_FUNC, API_SPARSE, 11, CUDA_DEPRECATED | CUDA_REMOVED}}, {"cusparseXcsrgemm2Nnz", {"hipsparseXcsrgemm2Nnz", "rocsparse_csrgemm_nnz", CONV_LIB_FUNC, API_SPARSE, 11, CUDA_DEPRECATED | CUDA_REMOVED}}, {"cusparseScsrgemm2_bufferSizeExt", {"hipsparseScsrgemm2_bufferSizeExt", "rocsparse_scsrgemm_buffer_size", CONV_LIB_FUNC, API_SPARSE, 11, CUDA_DEPRECATED | CUDA_REMOVED}}, @@ -2415,6 +2415,10 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_dcsrmm", {HIP_1090, HIP_0, HIP_0 }}, {"rocsparse_ccsrmm", {HIP_1090, HIP_0, HIP_0 }}, {"rocsparse_zcsrmm", {HIP_1090, HIP_0, HIP_0 }}, + {"rocsparse_scsrgemm", {HIP_2080, HIP_0, HIP_0 }}, + {"rocsparse_dcsrgemm", {HIP_2080, HIP_0, HIP_0 }}, + {"rocsparse_ccsrgemm", {HIP_2080, HIP_0, HIP_0 }}, + {"rocsparse_zcsrgemm", {HIP_2080, HIP_0, HIP_0 }}, }; const std::map CUDA_SPARSE_FUNCTION_CHANGED_VER_MAP { diff --git a/src/HipifyAction.cpp b/src/HipifyAction.cpp index 24908cb1..b02f7005 100644 --- a/src/HipifyAction.cpp +++ b/src/HipifyAction.cpp @@ -191,6 +191,10 @@ const std::string sCusparseZcsrsv2_bufferSize = "cusparseZcsrsv2_bufferSize"; const std::string sCusparseCcsrsv2_bufferSize = "cusparseCcsrsv2_bufferSize"; const std::string sCusparseDcsrsv2_bufferSize = "cusparseDcsrsv2_bufferSize"; const std::string sCusparseScsrsv2_bufferSize = "cusparseScsrsv2_bufferSize"; +const std::string sCusparseZcsrgemm2 = "cusparseZcsrgemm2"; +const std::string sCusparseCcsrgemm2 = "cusparseCcsrgemm2"; +const std::string sCusparseDcsrgemm2 = "cusparseDcsrgemm2"; +const std::string sCusparseScsrgemm2 = "cusparseScsrgemm2"; // CUDA_OVERLOADED const std::string sCudaEventCreate = "cudaEventCreate"; @@ -1495,6 +1499,42 @@ std::map FuncArgCasts { false } }, + {sCusparseZcsrgemm2, + { + { + {1, {e_add_const_argument, cw_None, "rocsparse_operation_none, rocsparse_operation_none"}} + }, + true, + false + } + }, + {sCusparseCcsrgemm2, + { + { + {1, {e_add_const_argument, cw_None, "rocsparse_operation_none, rocsparse_operation_none"}} + }, + true, + false + } + }, + {sCusparseDcsrgemm2, + { + { + {1, {e_add_const_argument, cw_None, "rocsparse_operation_none, rocsparse_operation_none"}} + }, + true, + false + } + }, + {sCusparseScsrgemm2, + { + { + {1, {e_add_const_argument, cw_None, "rocsparse_operation_none, rocsparse_operation_none"}} + }, + true, + false + } + }, }; void HipifyAction::RewriteString(StringRef s, clang::SourceLocation start) { @@ -2326,7 +2366,11 @@ std::unique_ptr HipifyAction::CreateASTConsumer(clang::Compi sCusparseZcsrsv2_bufferSize, sCusparseCcsrsv2_bufferSize, sCusparseDcsrsv2_bufferSize, - sCusparseScsrsv2_bufferSize + sCusparseScsrsv2_bufferSize, + sCusparseZcsrgemm2, + sCusparseCcsrgemm2, + sCusparseDcsrgemm2, + sCusparseScsrgemm2 ) ) ) diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 3c5253a2..9342cc4b 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -254,10 +254,13 @@ int main() { float csrSortedValA = 0.f; float csrSortedValB = 0.f; float csrSortedValC = 0.f; + float csrSortedValD = 0.f; double dcsrSortedVal = 0.f; double dcscSortedVal = 0.f; double dcsrSortedValA = 0.f; double dcsrSortedValB = 0.f; + double dcsrSortedValC = 0.f; + double dcsrSortedValD = 0.f; double dbsrSortedVal = 0.f; double dbsrSortedValA = 0.f; double dbsrSortedValC = 0.f; @@ -265,7 +268,6 @@ int main() { float fbsrSortedValA = 0.f; float fbsrSortedValC = 0.f; float fcsrSortedValC = 0.f; - double dcsrSortedValC = 0.f; double d_resultDevHostPtr = 0.f; float f_resultDevHostPtr = 0.f; double percentage = 0.f; @@ -318,11 +320,11 @@ int main() { bsrsm2Info_t bsrsm2_info; bsrsv2Info_t bsrsv2_info; - // CHECK: hipDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexF, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val, dcomplex_resultDevHostPtr; - cuDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexF, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val, dcomplex_resultDevHostPtr; + // CHECK: hipDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexF, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dComplexcsrSortedValD, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val, dcomplex_resultDevHostPtr; + cuDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexF, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dComplexcsrSortedValD, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val, dcomplex_resultDevHostPtr; - // CHECK: hipComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexF, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val, complex_resultDevHostPtr; - cuComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexF, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val, complex_resultDevHostPtr; + // CHECK: hipComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexF, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complexcsrSortedValD, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val, complex_resultDevHostPtr; + cuComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexF, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complexcsrSortedValD, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val, complex_resultDevHostPtr; // CHECK: hipsparseOperation_t opA, opB, opX; cusparseOperation_t opA, opB, opX; @@ -2812,6 +2814,26 @@ int main() { // CHECK: status_t = hipsparseXcsrgemm2Nnz(handle_t, m, n, k, matDescr_A, nnza, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &csrRowPtrB, &csrColIndB, matDescr_D, nnzd, &csrRowPtrD, &csrColIndD, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, csrgemm2_info, pBuffer); status_t = cusparseXcsrgemm2Nnz(handle_t, m, n, k, matDescr_A, nnza, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &csrRowPtrB, &csrColIndB, matDescr_D, nnzd, &csrRowPtrD, &csrColIndD, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, csrgemm2_info, pBuffer); + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseZcsrgemm2(cusparseHandle_t handle, int m, int n, int k, const cuDoubleComplex* alpha, const cusparseMatDescr_t descrA, int nnzA, const cuDoubleComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const cuDoubleComplex* csrSortedValB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const cuDoubleComplex* beta, const cusparseMatDescr_t descrD, int nnzD, const cuDoubleComplex* csrSortedValD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, const cusparseMatDescr_t descrC, cuDoubleComplex* csrSortedValC, const int* csrSortedRowPtrC, int* csrSortedColIndC, const csrgemm2Info_t info, void* pBuffer); + // HIP: DEPRECATED_CUDA_11000("The routine will be removed in CUDA 12") HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZcsrgemm2(hipsparseHandle_t handle, int m, int n, int k, const hipDoubleComplex* alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipDoubleComplex* csrValA, const int* csrRowPtrA, const int* csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const hipDoubleComplex* csrValB, const int* csrRowPtrB, const int* csrColIndB, const hipDoubleComplex* beta, const hipsparseMatDescr_t descrD, int nnzD, const hipDoubleComplex* csrValD, const int* csrRowPtrD, const int* csrColIndD, const hipsparseMatDescr_t descrC, hipDoubleComplex* csrValC, const int* csrRowPtrC, int* csrColIndC, const csrgemm2Info_t info, void* pBuffer); + // CHECK: status_t = hipsparseZcsrgemm2(handle_t, m, n, k, &dcomplexA, matDescr_A, nnza, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &dComplexcsrSortedValB, &csrRowPtrB, &csrColIndB, &dcomplexB, matDescr_D, nnzd, &dComplexcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &dComplexcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + status_t = cusparseZcsrgemm2(handle_t, m, n, k, &dcomplexA, matDescr_A, nnza, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &dComplexcsrSortedValB, &csrRowPtrB, &csrColIndB, &dcomplexB, matDescr_D, nnzd, &dComplexcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &dComplexcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseCcsrgemm2(cusparseHandle_t handle, int m, int n, int k, const cuComplex* alpha, const cusparseMatDescr_t descrA, int nnzA, const cuComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const cuComplex* csrSortedValB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const cuComplex* beta, const cusparseMatDescr_t descrD, int nnzD, const cuComplex* csrSortedValD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, const cusparseMatDescr_t descrC, cuComplex* csrSortedValC, const int* csrSortedRowPtrC, int* csrSortedColIndC, const csrgemm2Info_t info, void* pBuffer); + // HIP: DEPRECATED_CUDA_11000("The routine will be removed in CUDA 12") HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCcsrgemm2(hipsparseHandle_t handle, int m, int n, int k, const hipComplex* alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipComplex* csrValA, const int* csrRowPtrA, const int* csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const hipComplex* csrValB, const int* csrRowPtrB, const int* csrColIndB, const hipComplex* beta, const hipsparseMatDescr_t descrD, int nnzD, const hipComplex* csrValD, const int* csrRowPtrD, const int* csrColIndD, const hipsparseMatDescr_t descrC, hipComplex* csrValC, const int* csrRowPtrC, int* csrColIndC, const csrgemm2Info_t info, void* pBuffer); + // CHECK: status_t = hipsparseCcsrgemm2(handle_t, m, n, k, &complexA, matDescr_A, nnza, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &complexcsrSortedValB, &csrRowPtrB, &csrColIndB, &complexB, matDescr_D, nnzd, &complexcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &complexcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + status_t = cusparseCcsrgemm2(handle_t, m, n, k, &complexA, matDescr_A, nnza, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &complexcsrSortedValB, &csrRowPtrB, &csrColIndB, &complexB, matDescr_D, nnzd, &complexcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &complexcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseDcsrgemm2(cusparseHandle_t handle, int m, int n, int k, const double* alpha, const cusparseMatDescr_t descrA, int nnzA, const double* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const double* csrSortedValB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const double* beta, const cusparseMatDescr_t descrD, int nnzD, const double* csrSortedValD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, const cusparseMatDescr_t descrC, double* csrSortedValC, const int* csrSortedRowPtrC, int* csrSortedColIndC, const csrgemm2Info_t info, void* pBuffer); + // HIP: DEPRECATED_CUDA_11000("The routine will be removed in CUDA 12") HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDcsrgemm2(hipsparseHandle_t handle, int m, int n, int k, const double* alpha, const hipsparseMatDescr_t descrA, int nnzA, const double* csrValA, const int* csrRowPtrA, const int* csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const double* csrValB, const int* csrRowPtrB, const int* csrColIndB, const double* beta, const hipsparseMatDescr_t descrD, int nnzD, const double* csrValD, const int* csrRowPtrD, const int* csrColIndD, const hipsparseMatDescr_t descrC, double* csrValC, const int* csrRowPtrC, int* csrColIndC, const csrgemm2Info_t info, void* pBuffer); + // CHECK: status_t = hipsparseDcsrgemm2(handle_t, m, n, k, &dA, matDescr_A, nnza, &dcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &dcsrSortedValB, &csrRowPtrB, &csrColIndB, &dB, matDescr_D, nnzd, &dcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &dcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + status_t = cusparseDcsrgemm2(handle_t, m, n, k, &dA, matDescr_A, nnza, &dcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &dcsrSortedValB, &csrRowPtrB, &csrColIndB, &dB, matDescr_D, nnzd, &dcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &dcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseScsrgemm2(cusparseHandle_t handle, int m, int n, int k, const float* alpha, const cusparseMatDescr_t descrA, int nnzA, const float* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const float* csrSortedValB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const float* beta, const cusparseMatDescr_t descrD, int nnzD, const float* csrSortedValD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, const cusparseMatDescr_t descrC, float* csrSortedValC, const int* csrSortedRowPtrC, int* csrSortedColIndC, const csrgemm2Info_t info, void* pBuffer); + // HIP: DEPRECATED_CUDA_11000("The routine will be removed in CUDA 12") HIPSPARSE_EXPORT hipsparseStatus_t hipsparseScsrgemm2(hipsparseHandle_t handle, int m, int n, int k, const float* alpha, const hipsparseMatDescr_t descrA, int nnzA, const float* csrValA, const int* csrRowPtrA, const int* csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const float* csrValB, const int* csrRowPtrB, const int* csrColIndB, const float* beta, const hipsparseMatDescr_t descrD, int nnzD, const float* csrValD, const int* csrRowPtrD, const int* csrColIndD, const hipsparseMatDescr_t descrC, float* csrValC, const int* csrRowPtrC, int* csrColIndC, const csrgemm2Info_t info, void* pBuffer); + // CHECK: status_t = hipsparseScsrgemm2(handle_t, m, n, k, &fA, matDescr_A, nnza, &csrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &csrSortedValB, &csrRowPtrB, &csrColIndB, &fB, matDescr_D, nnzd, &csrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &csrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + status_t = cusparseScsrgemm2(handle_t, m, n, k, &fA, matDescr_A, nnza, &csrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &csrSortedValB, &csrRowPtrB, &csrColIndB, &fB, matDescr_D, nnzd, &csrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &csrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseZcsrgemm2_bufferSizeExt(cusparseHandle_t handle, int m, int n, int k, const cuDoubleComplex* alpha, const cusparseMatDescr_t descrA, int nnzA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const cuDoubleComplex* beta, const cusparseMatDescr_t descrD, int nnzD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, csrgemm2Info_t info, size_t* pBufferSizeInBytes); // HIP: DEPRECATED_CUDA_11000("The routine will be removed in CUDA 12") HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZcsrgemm2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int k, const hipDoubleComplex* alpha, const hipsparseMatDescr_t descrA, int nnzA, const int* csrRowPtrA, const int* csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int* csrRowPtrB, const int* csrColIndB, const hipDoubleComplex* beta, const hipsparseMatDescr_t descrD, int nnzD, const int* csrRowPtrD, const int* csrColIndD, csrgemm2Info_t info, size_t* pBufferSizeInBytes); // CHECK: status_t = hipsparseZcsrgemm2_bufferSizeExt(handle_t, m, n, k, &dcomplexA, matDescr_A, nnza, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &csrRowPtrB, &csrColIndB, &dcomplexB, matDescr_D, nnzd, &csrRowPtrD, &csrColIndD, csrgemm2_info, &bufferSize); diff --git a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse_before_12000.cu b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse_before_12000.cu index 3b9a1718..68796a9f 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse_before_12000.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse_before_12000.cu @@ -32,33 +32,57 @@ int main() { cusparseSolvePolicy_t solvePolicy_t; int m = 0; + int n = 0; + int k = 0; int innz = 0; + int nnza = 0; + int nnzb = 0; + int nnzc = 0; + int nnzd = 0; int csrRowPtrA = 0; + int csrRowPtrB = 0; + int csrRowPtrC = 0; + int csrRowPtrD = 0; int csrColIndA = 0; + int csrColIndB = 0; + int csrColIndC = 0; + int csrColIndD = 0; int bufferSizeInBytes = 0; + double dA = 0.f; + double dB = 0.f; double dAlpha = 0.f; double dF = 0.f; double dX = 0.f; double dcsrSortedValA = 0.f; + double dcsrSortedValB = 0.f; + double dcsrSortedValC = 0.f; + double dcsrSortedValD = 0.f; float fAlpha = 0.f; + float fA = 0.f; + float fB = 0.f; float fF = 0.f; float fX = 0.f; float csrSortedValA = 0.f; + float csrSortedValB = 0.f; + float csrSortedValC = 0.f; + float csrSortedValD = 0.f; void *pBuffer = nullptr; // TODO: should be rocsparse_double_complex // TODO: add to TypeOverloads cuDoubleComplex -> rocsparse_double_complex under a new option --sparse - // CHECK: rocblas_double_complex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexF, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; - cuDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexF, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; + // CHECK: rocblas_double_complex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexF, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dComplexcsrSortedValD, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; + cuDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexF, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dComplexcsrSortedValD, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; // TODO: should be rocsparse_double_complex // TODO: add to TypeOverloads cuComplex -> rocsparse_float_complex under a new option --sparse - // CHECK: rocblas_float_complex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexF, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; - cuComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexF, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; + // CHECK: rocblas_float_complex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexF, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complexcsrSortedValD, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; + cuComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexF, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complexcsrSortedValD, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; #if CUDA_VERSION < 12000 // CHECK: rocsparse_mat_descr csrsv2_info; csrsv2Info_t csrsv2_info; + // CHECK: rocsparse_mat_info csrgemm2_info; + csrgemm2Info_t csrgemm2_info; // CUDA: CUSPARSE_DEPRECATED(cusparseSpSV) cusparseStatus_t CUSPARSEAPI cusparseZcsrsv2_solve(cusparseHandle_t handle, cusparseOperation_t transA, int m, int nnz, const cuDoubleComplex* alpha, const cusparseMatDescr_t descrA, const cuDoubleComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrsv2Info_t info, const cuDoubleComplex* f, cuDoubleComplex* x, cusparseSolvePolicy_t policy, void* pBuffer); // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zcsrsv_solve(rocsparse_handle handle, rocsparse_operation trans, rocsparse_int m, rocsparse_int nnz, const rocsparse_double_complex* alpha, const rocsparse_mat_descr descr, const rocsparse_double_complex* csr_val, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, rocsparse_mat_info info, const rocsparse_double_complex* x, rocsparse_double_complex* y, rocsparse_solve_policy policy, void* temp_buffer); @@ -119,6 +143,26 @@ int main() { // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_scsrsv_buffer_size(rocsparse_handle handle, rocsparse_operation trans, rocsparse_int m, rocsparse_int nnz, const rocsparse_mat_descr descr, const float* csr_val, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, rocsparse_mat_info info, size_t* buffer_size); // CHECK: status_t = rocsparse_scsrsv_buffer_size(handle_t, opA, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrsv2_info, reinterpret_cast(&bufferSizeInBytes)); status_t = cusparseScsrsv2_bufferSize(handle_t, opA, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrsv2_info, &bufferSizeInBytes); + + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseZcsrgemm2(cusparseHandle_t handle, int m, int n, int k, const cuDoubleComplex* alpha, const cusparseMatDescr_t descrA, int nnzA, const cuDoubleComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const cuDoubleComplex* csrSortedValB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const cuDoubleComplex* beta, const cusparseMatDescr_t descrD, int nnzD, const cuDoubleComplex* csrSortedValD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, const cusparseMatDescr_t descrC, cuDoubleComplex* csrSortedValC, const int* csrSortedRowPtrC, int* csrSortedColIndC, const csrgemm2Info_t info, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zcsrgemm(rocsparse_handle handle, rocsparse_operation trans_A, rocsparse_operation trans_B, rocsparse_int m, rocsparse_int n, rocsparse_int k, const rocsparse_double_complex* alpha, const rocsparse_mat_descr descr_A, rocsparse_int nnz_A, const rocsparse_double_complex* csr_val_A, const rocsparse_int* csr_row_ptr_A, const rocsparse_int* csr_col_ind_A, const rocsparse_mat_descr descr_B, rocsparse_int nnz_B, const rocsparse_double_complex* csr_val_B, const rocsparse_int* csr_row_ptr_B, const rocsparse_int* csr_col_ind_B, const rocsparse_double_complex* beta, const rocsparse_mat_descr descr_D, rocsparse_int nnz_D, const rocsparse_double_complex* csr_val_D, const rocsparse_int* csr_row_ptr_D, const rocsparse_int* csr_col_ind_D, const rocsparse_mat_descr descr_C, rocsparse_double_complex* csr_val_C, const rocsparse_int* csr_row_ptr_C, rocsparse_int* csr_col_ind_C, const rocsparse_mat_info info_C, void* temp_buffer); + // CHECK: status_t = rocsparse_zcsrgemm(handle_t, rocsparse_operation_none, rocsparse_operation_none, m, n, k, &dcomplexA, matDescr_A, nnza, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &dComplexcsrSortedValB, &csrRowPtrB, &csrColIndB, &dcomplexB, matDescr_D, nnzd, &dComplexcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &dComplexcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + status_t = cusparseZcsrgemm2(handle_t, m, n, k, &dcomplexA, matDescr_A, nnza, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &dComplexcsrSortedValB, &csrRowPtrB, &csrColIndB, &dcomplexB, matDescr_D, nnzd, &dComplexcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &dComplexcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseCcsrgemm2(cusparseHandle_t handle, int m, int n, int k, const cuComplex* alpha, const cusparseMatDescr_t descrA, int nnzA, const cuComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const cuComplex* csrSortedValB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const cuComplex* beta, const cusparseMatDescr_t descrD, int nnzD, const cuComplex* csrSortedValD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, const cusparseMatDescr_t descrC, cuComplex* csrSortedValC, const int* csrSortedRowPtrC, int* csrSortedColIndC, const csrgemm2Info_t info, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_ccsrgemm(rocsparse_handle handle, rocsparse_operation trans_A, rocsparse_operation trans_B, rocsparse_int m, rocsparse_int n, rocsparse_int k, const rocsparse_float_complex* alpha, const rocsparse_mat_descr descr_A, rocsparse_int nnz_A, const rocsparse_float_complex* csr_val_A, const rocsparse_int* csr_row_ptr_A, const rocsparse_int* csr_col_ind_A, const rocsparse_mat_descr descr_B, rocsparse_int nnz_B, const rocsparse_float_complex* csr_val_B, const rocsparse_int* csr_row_ptr_B, const rocsparse_int* csr_col_ind_B, const rocsparse_float_complex* beta, const rocsparse_mat_descr descr_D, rocsparse_int nnz_D, const rocsparse_float_complex* csr_val_D, const rocsparse_int* csr_row_ptr_D, const rocsparse_int* csr_col_ind_D, const rocsparse_mat_descr descr_C, rocsparse_float_complex* csr_val_C, const rocsparse_int* csr_row_ptr_C, rocsparse_int* csr_col_ind_C, const rocsparse_mat_info info_C, void* temp_buffer); + // CHECK: status_t = rocsparse_ccsrgemm(handle_t, rocsparse_operation_none, rocsparse_operation_none, m, n, k, &complexA, matDescr_A, nnza, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &complexcsrSortedValB, &csrRowPtrB, &csrColIndB, &complexB, matDescr_D, nnzd, &complexcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &complexcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + status_t = cusparseCcsrgemm2(handle_t, m, n, k, &complexA, matDescr_A, nnza, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &complexcsrSortedValB, &csrRowPtrB, &csrColIndB, &complexB, matDescr_D, nnzd, &complexcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &complexcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseDcsrgemm2(cusparseHandle_t handle, int m, int n, int k, const double* alpha, const cusparseMatDescr_t descrA, int nnzA, const double* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const double* csrSortedValB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const double* beta, const cusparseMatDescr_t descrD, int nnzD, const double* csrSortedValD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, const cusparseMatDescr_t descrC, double* csrSortedValC, const int* csrSortedRowPtrC, int* csrSortedColIndC, const csrgemm2Info_t info, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dcsrgemm(rocsparse_handle handle, rocsparse_operation trans_A, rocsparse_operation trans_B, rocsparse_int m, rocsparse_int n, rocsparse_int k, const double* alpha, const rocsparse_mat_descr descr_A, rocsparse_int nnz_A, const double* csr_val_A, const rocsparse_int* csr_row_ptr_A, const rocsparse_int* csr_col_ind_A, const rocsparse_mat_descr descr_B, rocsparse_int nnz_B, const double* csr_val_B, const rocsparse_int* csr_row_ptr_B, const rocsparse_int* csr_col_ind_B, const double* beta, const rocsparse_mat_descr descr_D, rocsparse_int nnz_D, const double* csr_val_D, const rocsparse_int* csr_row_ptr_D, const rocsparse_int* csr_col_ind_D, const rocsparse_mat_descr descr_C, double* csr_val_C, const rocsparse_int* csr_row_ptr_C, rocsparse_int* csr_col_ind_C, const rocsparse_mat_info info_C, void* temp_buffer); + // CHECK: status_t = rocsparse_dcsrgemm(handle_t, rocsparse_operation_none, rocsparse_operation_none, m, n, k, &dA, matDescr_A, nnza, &dcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &dcsrSortedValB, &csrRowPtrB, &csrColIndB, &dB, matDescr_D, nnzd, &dcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &dcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + status_t = cusparseDcsrgemm2(handle_t, m, n, k, &dA, matDescr_A, nnza, &dcsrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &dcsrSortedValB, &csrRowPtrB, &csrColIndB, &dB, matDescr_D, nnzd, &dcsrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &dcsrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED(cusparseSpGEMM) cusparseStatus_t CUSPARSEAPI cusparseScsrgemm2(cusparseHandle_t handle, int m, int n, int k, const float* alpha, const cusparseMatDescr_t descrA, int nnzA, const float* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, const cusparseMatDescr_t descrB, int nnzB, const float* csrSortedValB, const int* csrSortedRowPtrB, const int* csrSortedColIndB, const float* beta, const cusparseMatDescr_t descrD, int nnzD, const float* csrSortedValD, const int* csrSortedRowPtrD, const int* csrSortedColIndD, const cusparseMatDescr_t descrC, float* csrSortedValC, const int* csrSortedRowPtrC, int* csrSortedColIndC, const csrgemm2Info_t info, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_scsrgemm(rocsparse_handle handle, rocsparse_operation trans_A, rocsparse_operation trans_B, rocsparse_int m, rocsparse_int n, rocsparse_int k, const float* alpha, const rocsparse_mat_descr descr_A, rocsparse_int nnz_A, const float* csr_val_A, const rocsparse_int* csr_row_ptr_A, const rocsparse_int* csr_col_ind_A, const rocsparse_mat_descr descr_B, rocsparse_int nnz_B, const float* csr_val_B, const rocsparse_int* csr_row_ptr_B, const rocsparse_int* csr_col_ind_B, const float* beta, const rocsparse_mat_descr descr_D, rocsparse_int nnz_D, const float* csr_val_D, const rocsparse_int* csr_row_ptr_D, const rocsparse_int* csr_col_ind_D, const rocsparse_mat_descr descr_C, float* csr_val_C, const rocsparse_int* csr_row_ptr_C, rocsparse_int* csr_col_ind_C, const rocsparse_mat_info info_C, void* temp_buffer); + // CHECK: status_t = rocsparse_scsrgemm(handle_t, rocsparse_operation_none, rocsparse_operation_none, m, n, k, &fA, matDescr_A, nnza, &csrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &csrSortedValB, &csrRowPtrB, &csrColIndB, &fB, matDescr_D, nnzd, &csrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &csrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); + status_t = cusparseScsrgemm2(handle_t, m, n, k, &fA, matDescr_A, nnza, &csrSortedValA, &csrRowPtrA, &csrColIndA, matDescr_B, nnzb, &csrSortedValB, &csrRowPtrB, &csrColIndB, &fB, matDescr_D, nnzd, &csrSortedValD, &csrRowPtrD, &csrColIndD, matDescr_C, &csrSortedValC, &csrRowPtrC, &csrColIndC, csrgemm2_info, pBuffer); #endif return 0;