diff --git a/bin/hipify-perl b/bin/hipify-perl index 8e0c1737..47ca9645 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1834,6 +1834,7 @@ sub rocSubstitutions { subst("cusparseCbsrsm2_analysis", "rocsparse_cbsrsm_analysis", "library"); subst("cusparseCbsrsm2_bufferSize", "rocsparse_cbsrsm_buffer_size", "library"); subst("cusparseCbsrsm2_solve", "rocsparse_cbsrsm_solve", "library"); + subst("cusparseCbsrsv2_solve", "rocsparse_cbsrsv_solve", "library"); subst("cusparseCcsc2dense", "rocsparse_ccsc2dense", "library"); subst("cusparseCcsr2bsr", "rocsparse_ccsr2bsr", "library"); subst("cusparseCcsr2csr_compress", "rocsparse_ccsr2csr_compress", "library"); @@ -1915,6 +1916,7 @@ sub rocSubstitutions { subst("cusparseDbsrsm2_analysis", "rocsparse_dbsrsm_analysis", "library"); subst("cusparseDbsrsm2_bufferSize", "rocsparse_dbsrsm_buffer_size", "library"); subst("cusparseDbsrsm2_solve", "rocsparse_dbsrsm_solve", "library"); + subst("cusparseDbsrsv2_solve", "rocsparse_dbsrsv_solve", "library"); subst("cusparseDcsc2dense", "rocsparse_dcsc2dense", "library"); subst("cusparseDcsr2bsr", "rocsparse_dcsr2bsr", "library"); subst("cusparseDcsr2csr_compress", "rocsparse_dcsr2csr_compress", "library"); @@ -2014,6 +2016,7 @@ sub rocSubstitutions { subst("cusparseSbsrsm2_analysis", "rocsparse_sbsrsm_analysis", "library"); subst("cusparseSbsrsm2_bufferSize", "rocsparse_sbsrsm_buffer_size", "library"); subst("cusparseSbsrsm2_solve", "rocsparse_sbsrsm_solve", "library"); + subst("cusparseSbsrsv2_solve", "rocsparse_sbsrsv_solve", "library"); subst("cusparseScatter", "rocsparse_scatter", "library"); subst("cusparseScsc2dense", "rocsparse_scsc2dense", "library"); subst("cusparseScsr2bsr", "rocsparse_scsr2bsr", "library"); @@ -2127,6 +2130,7 @@ sub rocSubstitutions { subst("cusparseZbsrsm2_analysis", "rocsparse_zbsrsm_analysis", "library"); subst("cusparseZbsrsm2_bufferSize", "rocsparse_zbsrsm_buffer_size", "library"); subst("cusparseZbsrsm2_solve", "rocsparse_zbsrsm_solve", "library"); + subst("cusparseZbsrsv2_solve", "rocsparse_zbsrsv_solve", "library"); subst("cusparseZcsc2dense", "rocsparse_zcsc2dense", "library"); subst("cusparseZcsr2bsr", "rocsparse_zcsr2bsr", "library"); subst("cusparseZcsr2csr_compress", "rocsparse_zcsr2csr_compress", "library"); @@ -2185,6 +2189,8 @@ sub rocSubstitutions { subst("bsrilu02Info_t", "rocsparse_mat_info", "type"); subst("bsrsm2Info", "_rocsparse_mat_info", "type"); subst("bsrsm2Info_t", "rocsparse_mat_info", "type"); + subst("bsrsv2Info", "_rocsparse_mat_info", "type"); + subst("bsrsv2Info_t", "rocsparse_mat_info", "type"); subst("csrgemm2Info", "_rocsparse_mat_info", "type"); subst("csrgemm2Info_t", "rocsparse_mat_info", "type"); subst("csric02Info", "_rocsparse_mat_info", "type"); 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 db17380e..f2213652 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -114,8 +114,8 @@ |`bsrilu02Info_t`| |12.2| | |`bsrilu02Info_t`|3.9.0| | | | |`rocsparse_mat_info`|1.9.0| | | | | |`bsrsm2Info`| |12.2| | |`bsrsm2Info`|4.5.0| | | | |`_rocsparse_mat_info`|1.9.0| | | | | |`bsrsm2Info_t`| |12.2| | |`bsrsm2Info_t`|4.5.0| | | | |`rocsparse_mat_info`|1.9.0| | | | | -|`bsrsv2Info`| |12.2| | |`bsrsv2Info`|3.6.0| | | | | | | | | | | -|`bsrsv2Info_t`| |12.2| | |`bsrsv2Info_t`|3.6.0| | | | | | | | | | | +|`bsrsv2Info`| |12.2| | |`bsrsv2Info`|3.6.0| | | | |`_rocsparse_mat_info`|1.9.0| | | | | +|`bsrsv2Info_t`| |12.2| | |`bsrsv2Info_t`|3.6.0| | | | |`rocsparse_mat_info`|1.9.0| | | | | |`csrgemm2Info`| | | |12.0|`csrgemm2Info`|2.8.0| | | | |`_rocsparse_mat_info`|1.9.0| | | | | |`csrgemm2Info_t`| | | |12.0|`csrgemm2Info_t`|2.8.0| | | | |`rocsparse_mat_info`|1.9.0| | | | | |`csric02Info`| |12.2| | |`csric02Info`|3.1.0| | | | |`_rocsparse_mat_info`|1.9.0| | | | | @@ -296,7 +296,7 @@ |`cusparseCbsrsv2_analysis`| |12.2| | |`hipsparseCbsrsv2_analysis`|3.6.0| | | | | | | | | | | |`cusparseCbsrsv2_bufferSize`| |12.2| | |`hipsparseCbsrsv2_bufferSize`|3.6.0| | | | | | | | | | | |`cusparseCbsrsv2_bufferSizeExt`| |12.2| | |`hipsparseCbsrsv2_bufferSizeExt`|3.6.0| | | | | | | | | | | -|`cusparseCbsrsv2_solve`| |12.2| | |`hipsparseCbsrsv2_solve`|3.6.0| | | | | | | | | | | +|`cusparseCbsrsv2_solve`| |12.2| | |`hipsparseCbsrsv2_solve`|3.6.0| | | | |`rocsparse_cbsrsv_solve`|3.6.0| | | | | |`cusparseCbsrxmv`| |12.2| | |`hipsparseCbsrxmv`|4.5.0| | | | | | | | | | | |`cusparseCcsrmv`| |10.2| |11.0|`hipsparseCcsrmv`|3.1.0| | | | |`rocsparse_ccsrmv`|1.9.0| | | | | |`cusparseCcsrmv_mp`|8.0|10.2| |11.0| | | | | | | | | | | | | @@ -319,7 +319,7 @@ |`cusparseDbsrsv2_analysis`| |12.2| | |`hipsparseDbsrsv2_analysis`|3.6.0| | | | | | | | | | | |`cusparseDbsrsv2_bufferSize`| |12.2| | |`hipsparseDbsrsv2_bufferSize`|3.6.0| | | | | | | | | | | |`cusparseDbsrsv2_bufferSizeExt`| |12.2| | |`hipsparseDbsrsv2_bufferSizeExt`|3.6.0| | | | | | | | | | | -|`cusparseDbsrsv2_solve`| |12.2| | |`hipsparseDbsrsv2_solve`|3.6.0| | | | | | | | | | | +|`cusparseDbsrsv2_solve`| |12.2| | |`hipsparseDbsrsv2_solve`|3.6.0| | | | |`rocsparse_dbsrsv_solve`|3.6.0| | | | | |`cusparseDbsrxmv`| |12.2| | |`hipsparseDbsrxmv`|4.5.0| | | | | | | | | | | |`cusparseDcsrmv`| |10.2| |11.0|`hipsparseDcsrmv`|1.9.2| | | | |`rocsparse_dcsrmv`|1.9.0| | | | | |`cusparseDcsrmv_mp`|8.0|10.2| |11.0| | | | | | | | | | | | | @@ -338,7 +338,7 @@ |`cusparseSbsrsv2_analysis`| |12.2| | |`hipsparseSbsrsv2_analysis`|3.6.0| | | | | | | | | | | |`cusparseSbsrsv2_bufferSize`| |12.2| | |`hipsparseSbsrsv2_bufferSize`|3.6.0| | | | | | | | | | | |`cusparseSbsrsv2_bufferSizeExt`| |12.2| | |`hipsparseSbsrsv2_bufferSizeExt`|3.6.0| | | | | | | | | | | -|`cusparseSbsrsv2_solve`| |12.2| | |`hipsparseSbsrsv2_solve`|3.6.0| | | | | | | | | | | +|`cusparseSbsrsv2_solve`| |12.2| | |`hipsparseSbsrsv2_solve`|3.6.0| | | | |`rocsparse_sbsrsv_solve`|3.6.0| | | | | |`cusparseSbsrxmv`| |12.2| | |`hipsparseSbsrxmv`|4.5.0| | | | | | | | | | | |`cusparseScsrmv`| |10.2| |11.0|`hipsparseScsrmv`|1.9.2| | | | |`rocsparse_scsrmv`|1.9.0| | | | | |`cusparseScsrmv_mp`|8.0|10.2| |11.0| | | | | | | | | | | | | @@ -359,7 +359,7 @@ |`cusparseZbsrsv2_analysis`| |12.2| | |`hipsparseZbsrsv2_analysis`|3.6.0| | | | | | | | | | | |`cusparseZbsrsv2_bufferSize`| |12.2| | |`hipsparseZbsrsv2_bufferSize`|3.6.0| | | | | | | | | | | |`cusparseZbsrsv2_bufferSizeExt`| |12.2| | |`hipsparseZbsrsv2_bufferSizeExt`|3.6.0| | | | | | | | | | | -|`cusparseZbsrsv2_solve`| |12.2| | |`hipsparseZbsrsv2_solve`|3.6.0| | | | | | | | | | | +|`cusparseZbsrsv2_solve`| |12.2| | |`hipsparseZbsrsv2_solve`|3.6.0| | | | |`rocsparse_zbsrsv_solve`|3.6.0| | | | | |`cusparseZbsrxmv`| |12.2| | |`hipsparseZbsrxmv`|4.5.0| | | | | | | | | | | |`cusparseZcsrmv`| |10.2| |11.0|`hipsparseZcsrmv`|3.1.0| | | | |`rocsparse_zcsrmv`|1.9.0| | | | | |`cusparseZcsrmv_mp`|8.0|10.2| |11.0| | | | | | | | | | | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index 129b5244..07429faf 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -114,8 +114,8 @@ |`bsrilu02Info_t`| |12.2| | |`rocsparse_mat_info`|1.9.0| | | | | |`bsrsm2Info`| |12.2| | |`_rocsparse_mat_info`|1.9.0| | | | | |`bsrsm2Info_t`| |12.2| | |`rocsparse_mat_info`|1.9.0| | | | | -|`bsrsv2Info`| |12.2| | | | | | | | | -|`bsrsv2Info_t`| |12.2| | | | | | | | | +|`bsrsv2Info`| |12.2| | |`_rocsparse_mat_info`|1.9.0| | | | | +|`bsrsv2Info_t`| |12.2| | |`rocsparse_mat_info`|1.9.0| | | | | |`csrgemm2Info`| | | |12.0|`_rocsparse_mat_info`|1.9.0| | | | | |`csrgemm2Info_t`| | | |12.0|`rocsparse_mat_info`|1.9.0| | | | | |`csric02Info`| |12.2| | |`_rocsparse_mat_info`|1.9.0| | | | | @@ -296,7 +296,7 @@ |`cusparseCbsrsv2_analysis`| |12.2| | | | | | | | | |`cusparseCbsrsv2_bufferSize`| |12.2| | | | | | | | | |`cusparseCbsrsv2_bufferSizeExt`| |12.2| | | | | | | | | -|`cusparseCbsrsv2_solve`| |12.2| | | | | | | | | +|`cusparseCbsrsv2_solve`| |12.2| | |`rocsparse_cbsrsv_solve`|3.6.0| | | | | |`cusparseCbsrxmv`| |12.2| | | | | | | | | |`cusparseCcsrmv`| |10.2| |11.0|`rocsparse_ccsrmv`|1.9.0| | | | | |`cusparseCcsrmv_mp`|8.0|10.2| |11.0| | | | | | | @@ -319,7 +319,7 @@ |`cusparseDbsrsv2_analysis`| |12.2| | | | | | | | | |`cusparseDbsrsv2_bufferSize`| |12.2| | | | | | | | | |`cusparseDbsrsv2_bufferSizeExt`| |12.2| | | | | | | | | -|`cusparseDbsrsv2_solve`| |12.2| | | | | | | | | +|`cusparseDbsrsv2_solve`| |12.2| | |`rocsparse_dbsrsv_solve`|3.6.0| | | | | |`cusparseDbsrxmv`| |12.2| | | | | | | | | |`cusparseDcsrmv`| |10.2| |11.0|`rocsparse_dcsrmv`|1.9.0| | | | | |`cusparseDcsrmv_mp`|8.0|10.2| |11.0| | | | | | | @@ -338,7 +338,7 @@ |`cusparseSbsrsv2_analysis`| |12.2| | | | | | | | | |`cusparseSbsrsv2_bufferSize`| |12.2| | | | | | | | | |`cusparseSbsrsv2_bufferSizeExt`| |12.2| | | | | | | | | -|`cusparseSbsrsv2_solve`| |12.2| | | | | | | | | +|`cusparseSbsrsv2_solve`| |12.2| | |`rocsparse_sbsrsv_solve`|3.6.0| | | | | |`cusparseSbsrxmv`| |12.2| | | | | | | | | |`cusparseScsrmv`| |10.2| |11.0|`rocsparse_scsrmv`|1.9.0| | | | | |`cusparseScsrmv_mp`|8.0|10.2| |11.0| | | | | | | @@ -359,7 +359,7 @@ |`cusparseZbsrsv2_analysis`| |12.2| | | | | | | | | |`cusparseZbsrsv2_bufferSize`| |12.2| | | | | | | | | |`cusparseZbsrsv2_bufferSizeExt`| |12.2| | | | | | | | | -|`cusparseZbsrsv2_solve`| |12.2| | | | | | | | | +|`cusparseZbsrsv2_solve`| |12.2| | |`rocsparse_zbsrsv_solve`|3.6.0| | | | | |`cusparseZbsrxmv`| |12.2| | | | | | | | | |`cusparseZcsrmv`| |10.2| |11.0|`rocsparse_zcsrmv`|1.9.0| | | | | |`cusparseZcsrmv_mp`|8.0|10.2| |11.0| | | | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index 8700e8ae..1d6fe46a 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -168,10 +168,10 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseCcsrsv_solve", {"hipsparseCcsrsv_solve", "", CONV_LIB_FUNC, API_SPARSE, 9, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, {"cusparseZcsrsv_solve", {"hipsparseZcsrsv_solve", "", CONV_LIB_FUNC, API_SPARSE, 9, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseSbsrsv2_solve", {"hipsparseSbsrsv2_solve", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseDbsrsv2_solve", {"hipsparseDbsrsv2_solve", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseCbsrsv2_solve", {"hipsparseCbsrsv2_solve", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseZbsrsv2_solve", {"hipsparseZbsrsv2_solve", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseSbsrsv2_solve", {"hipsparseSbsrsv2_solve", "rocsparse_sbsrsv_solve", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, + {"cusparseDbsrsv2_solve", {"hipsparseDbsrsv2_solve", "rocsparse_dbsrsv_solve", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, + {"cusparseCbsrsv2_solve", {"hipsparseCbsrsv2_solve", "rocsparse_cbsrsv_solve", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, + {"cusparseZbsrsv2_solve", {"hipsparseZbsrsv2_solve", "rocsparse_zbsrsv_solve", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, {"cusparseXbsrsv2_zeroPivot", {"hipsparseXbsrsv2_zeroPivot", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, {"cusparseScsrsv_analysis", {"hipsparseScsrsv_analysis", "", CONV_LIB_FUNC, API_SPARSE, 9, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, @@ -2342,6 +2342,10 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_ccsrmv", {HIP_1090, HIP_0, HIP_0 }}, {"rocsparse_dcsrmv", {HIP_1090, HIP_0, HIP_0 }}, {"rocsparse_scsrmv", {HIP_1090, HIP_0, HIP_0 }}, + {"rocsparse_zbsrsv_solve", {HIP_3060, HIP_0, HIP_0 }}, + {"rocsparse_cbsrsv_solve", {HIP_3060, HIP_0, HIP_0 }}, + {"rocsparse_dbsrsv_solve", {HIP_3060, HIP_0, HIP_0 }}, + {"rocsparse_sbsrsv_solve", {HIP_3060, HIP_0, HIP_0 }}, }; const std::map CUDA_SPARSE_FUNCTION_CHANGED_VER_MAP { diff --git a/src/CUDA2HIP_SPARSE_API_types.cpp b/src/CUDA2HIP_SPARSE_API_types.cpp index 5c09511a..f2231d1f 100644 --- a/src/CUDA2HIP_SPARSE_API_types.cpp +++ b/src/CUDA2HIP_SPARSE_API_types.cpp @@ -44,8 +44,8 @@ const std::map CUDA_SPARSE_TYPE_NAME_MAP { {"csrsm2Info", {"csrsm2Info", "_rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, HIP_UNSUPPORTED | CUDA_REMOVED}}, {"csrsm2Info_t", {"csrsm2Info_t", "rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_REMOVED}}, - {"bsrsv2Info", {"bsrsv2Info", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"bsrsv2Info_t", {"bsrsv2Info_t", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"bsrsv2Info", {"bsrsv2Info", "_rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_DEPRECATED}}, + {"bsrsv2Info_t", {"bsrsv2Info_t", "rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_DEPRECATED}}, {"bsrsm2Info", {"bsrsm2Info", "_rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_DEPRECATED}}, {"bsrsm2Info_t", {"bsrsm2Info_t", "rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_DEPRECATED}}, diff --git a/src/HipifyAction.cpp b/src/HipifyAction.cpp index 2447052e..0129be93 100644 --- a/src/HipifyAction.cpp +++ b/src/HipifyAction.cpp @@ -167,6 +167,10 @@ const std::string sCusparseZcsrmv = "cusparseZcsrmv"; const std::string sCusparseCcsrmv = "cusparseCcsrmv"; const std::string sCusparseDcsrmv = "cusparseDcsrmv"; const std::string sCusparseScsrmv = "cusparseScsrmv"; +const std::string sCusparseZbsrsv2_solve = "cusparseZbsrsv2_solve"; +const std::string sCusparseCbsrsv2_solve = "cusparseCbsrsv2_solve"; +const std::string sCusparseDbsrsv2_solve = "cusparseDbsrsv2_solve"; +const std::string sCusparseSbsrsv2_solve = "cusparseSbsrsv2_solve"; // CUDA_OVERLOADED const std::string sCudaEventCreate = "cudaEventCreate"; @@ -1251,6 +1255,42 @@ std::map FuncArgCasts { false } }, + {sCusparseZbsrsv2_solve, + { + { + {14, {e_replace_argument_with_const, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseCbsrsv2_solve, + { + { + {14, {e_replace_argument_with_const, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseDbsrsv2_solve, + { + { + {14, {e_replace_argument_with_const, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseSbsrsv2_solve, + { + { + {14, {e_replace_argument_with_const, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, }; void HipifyAction::RewriteString(StringRef s, clang::SourceLocation start) { @@ -2046,7 +2086,11 @@ std::unique_ptr HipifyAction::CreateASTConsumer(clang::Compi sCusparseZcsrmv, sCusparseCcsrmv, sCusparseDcsrmv, - sCusparseScsrmv + sCusparseScsrmv, + sCusparseZbsrsv2_solve, + sCusparseCbsrsv2_solve, + sCusparseDbsrsv2_solve, + sCusparseSbsrsv2_solve ) ) ) diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 06536828..eba4f7b4 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -309,12 +309,13 @@ int main() { bsrilu02Info_t bsrilu02_info; bsric02Info_t bsric02_info; 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; 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: hipComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, 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, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; + // 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; + 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: hipsparseOperation_t opA, opB, opX; cusparseOperation_t opA, opB, opX; @@ -1079,6 +1080,26 @@ int main() { // CHECK: status_t = hipsparseSbsrmm(handle_t, direction_t, opA, opB, mb, n, kb, nnzb, &fA, matDescr_A, &fbscVal, &bsrRowPtrA, &bsrColIndA, blockDim, &fB, ldb, &fBeta, &fC, ldc); status_t = cusparseSbsrmm(handle_t, direction_t, opA, opB, mb, n, kb, nnzb, &fA, matDescr_A, &fbscVal, &bsrRowPtrA, &bsrColIndA, blockDim, &fB, ldb, &fBeta, &fC, ldc); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZbsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cuDoubleComplex* alpha, const cusparseMatDescr_t descrA, const cuDoubleComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const cuDoubleComplex* f, cuDoubleComplex* x, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipDoubleComplex* alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const hipDoubleComplex* f, hipDoubleComplex* x, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseZbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &dcomplexAlpha, matDescr_A, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &dcomplexF, &dcomplexX, solvePolicy_t, &pBuffer); + status_t = cusparseZbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &dcomplexAlpha, matDescr_A, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &dcomplexF, &dcomplexX, solvePolicy_t, &pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCbsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cuComplex* alpha, const cusparseMatDescr_t descrA, const cuComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const cuComplex* f, cuComplex* x,cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipComplex* alpha, const hipsparseMatDescr_t descrA, const hipComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const hipComplex* f, hipComplex* x, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseCbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &complexAlpha, matDescr_A, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &complexF, &complexX, solvePolicy_t, &pBuffer); + status_t = cusparseCbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &complexAlpha, matDescr_A, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &complexF, &complexX, solvePolicy_t, &pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDbsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const double* alpha, const cusparseMatDescr_t descrA, const double* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const double* f, double* x, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const double* alpha, const hipsparseMatDescr_t descrA, const double* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const double* f, double* x, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseDbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &dAlpha, matDescr_A, &dbsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &dF, &dX, solvePolicy_t, &pBuffer); + status_t = cusparseDbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &dAlpha, matDescr_A, &dbsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &dF, &dX, solvePolicy_t, &pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSbsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const float* alpha, const cusparseMatDescr_t descrA, const float* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const float* f, float* x, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const float* alpha, const hipsparseMatDescr_t descrA, const float* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const float* f, float* x, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseSbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &fAlpha, matDescr_A, &fbsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &fF, &fX, solvePolicy_t, &pBuffer); + status_t = cusparseSbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &fAlpha, matDescr_A, &fbsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &fF, &fX, solvePolicy_t, &pBuffer); + #if CUDA_VERSION >= 7050 // CUDA: cusparseStatus_t CUSPARSEAPI cusparseZgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const cuDoubleComplex* alpha, const cuDoubleComplex* A, int lda, int nnz, const cuDoubleComplex* xVal, const int* xInd, const cuDoubleComplex* beta, cuDoubleComplex* y, cusparseIndexBase_t idxBase, void* pBuffer); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const hipDoubleComplex* alpha, const hipDoubleComplex* A, int lda, int nnz, const hipDoubleComplex* x, const int* xInd, const hipDoubleComplex* beta, hipDoubleComplex* y, hipsparseIndexBase_t idxBase, void* pBuffer); diff --git a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu index 04ad5455..6428f358 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -256,6 +256,7 @@ int main() { double dB = 0.f; double dBeta = 0.f; double dC = 0.f; + double dF = 0.f; double dX = 0.f; double dY = 0.f; float fA = 0.f; @@ -263,6 +264,7 @@ int main() { float fB = 0.f; float fBeta = 0.f; float fC = 0.f; + float fF = 0.f; float fX = 0.f; float fY = 0.f; int algo = 0; @@ -296,15 +298,18 @@ int main() { // CHECK: rocsparse_mat_info bsrsm2_info; bsrsm2Info_t bsrsm2_info; + // CHECK: rocsparse_mat_info bsrsv2_info; + bsrsv2Info_t bsrsv2_info; + // 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, 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, 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, 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; // 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, 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, 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, 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: rocsparse_operation opA, opB, opX; cusparseOperation_t opA, opB, opX; @@ -1070,6 +1075,26 @@ int main() { // CHECK: status_t = rocsparse_sbsrmm(handle_t, direction_t, opA, opB, mb, n, kb, nnzb, &fA, matDescr_A, &fbscVal, &bsrRowPtrA, &bsrColIndA, blockDim, &fB, ldb, &fBeta, &fC, ldc); status_t = cusparseSbsrmm(handle_t, direction_t, opA, opB, mb, n, kb, nnzb, &fA, matDescr_A, &fbscVal, &bsrRowPtrA, &bsrColIndA, blockDim, &fB, ldb, &fBeta, &fC, ldc); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZbsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cuDoubleComplex* alpha, const cusparseMatDescr_t descrA, const cuDoubleComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const cuDoubleComplex* f, cuDoubleComplex* x, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zbsrsv_solve(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation trans, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_double_complex* alpha, const rocsparse_mat_descr descr, const rocsparse_double_complex* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, const rocsparse_double_complex* x, rocsparse_double_complex* y, rocsparse_solve_policy policy, void* temp_buffer); + // CHECK: status_t = rocsparse_zbsrsv_solve(handle_t, direction_t, opA, mb, nnzb, &dcomplexAlpha, matDescr_A, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &dcomplexF, &dcomplexX, rocsparse_solve_policy_auto, &pBuffer); + status_t = cusparseZbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &dcomplexAlpha, matDescr_A, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &dcomplexF, &dcomplexX, solvePolicy_t, &pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCbsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cuComplex* alpha, const cusparseMatDescr_t descrA, const cuComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const cuComplex* f, cuComplex* x,cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cbsrsv_solve(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation trans, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_float_complex* alpha, const rocsparse_mat_descr descr, const rocsparse_float_complex* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, const rocsparse_float_complex* x, rocsparse_float_complex* y, rocsparse_solve_policy policy, void* temp_buffer); + // CHECK: status_t = rocsparse_cbsrsv_solve(handle_t, direction_t, opA, mb, nnzb, &complexAlpha, matDescr_A, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &complexF, &complexX, rocsparse_solve_policy_auto, &pBuffer); + status_t = cusparseCbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &complexAlpha, matDescr_A, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &complexF, &complexX, solvePolicy_t, &pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDbsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const double* alpha, const cusparseMatDescr_t descrA, const double* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const double* f, double* x, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dbsrsv_solve(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation trans, rocsparse_int mb, rocsparse_int nnzb, const double* alpha, const rocsparse_mat_descr descr, const double* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, const double* x, double* y, rocsparse_solve_policy policy, void* temp_buffer); + // CHECK: status_t = rocsparse_dbsrsv_solve(handle_t, direction_t, opA, mb, nnzb, &dAlpha, matDescr_A, &dbsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &dF, &dX, rocsparse_solve_policy_auto, &pBuffer); + status_t = cusparseDbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &dAlpha, matDescr_A, &dbsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &dF, &dX, solvePolicy_t, &pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSbsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const float* alpha, const cusparseMatDescr_t descrA, const float* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const float* f, float* x, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sbsrsv_solve(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation trans, rocsparse_int mb, rocsparse_int nnzb, const float* alpha, const rocsparse_mat_descr descr, const float* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, const float* x, float* y, rocsparse_solve_policy policy, void* temp_buffer); + // CHECK: status_t = rocsparse_sbsrsv_solve(handle_t, direction_t, opA, mb, nnzb, &fAlpha, matDescr_A, &fbsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &fF, &fX, rocsparse_solve_policy_auto, &pBuffer); + status_t = cusparseSbsrsv2_solve(handle_t, direction_t, opA, mb, nnzb, &fAlpha, matDescr_A, &fbsrSortedValA, &csrRowPtrA, &csrColIndA, blockDim, bsrsv2_info, &fF, &fX, solvePolicy_t, &pBuffer); + #if CUDA_VERSION >= 7050 // CUDA: cusparseStatus_t CUSPARSEAPI cusparseZgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const cuDoubleComplex* alpha, const cuDoubleComplex* A, int lda, int nnz, const cuDoubleComplex* xVal, const int* xInd, const cuDoubleComplex* beta, cuDoubleComplex* y, cusparseIndexBase_t idxBase, void* pBuffer); // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zgemvi(rocsparse_handle handle, rocsparse_operation trans, rocsparse_int m, rocsparse_int n, const rocsparse_double_complex* alpha, const rocsparse_double_complex* A, rocsparse_int lda, rocsparse_int nnz, const rocsparse_double_complex* x_val, const rocsparse_int* x_ind, const rocsparse_double_complex* beta, rocsparse_double_complex* y, rocsparse_index_base idx_base,void* temp_buffer);