From a020eac93795ea99788ddfc87eecf84abe2a561a Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Sun, 7 Jan 2024 16:01:25 +0000 Subject: [PATCH] [HIPIFY][#674][rocSPARSE][feature] rocSPARSE support - Step 92 - functions `rocsparse_(s|d|c|z)bsrsv_buffer_size` + Updated `SPARSE` synthetic tests, the regenerated hipify-perl, and `SPARSE` `CUDA2HIP` documentation --- bin/hipify-perl | 4 ++ .../CUSPARSE_API_supported_by_HIP_and_ROC.md | 8 ++-- docs/tables/CUSPARSE_API_supported_by_ROC.md | 8 ++-- src/CUDA2HIP_SPARSE_API_functions.cpp | 24 +++++----- src/HipifyAction.cpp | 46 ++++++++++++++++++- .../synthetic/libraries/cusparse2hipsparse.cu | 20 ++++++++ .../synthetic/libraries/cusparse2rocsparse.cu | 20 ++++++++ 7 files changed, 109 insertions(+), 21 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index 71bdd78e..e6592368 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -2271,6 +2271,7 @@ sub rocSubstitutions { subst("cusparseCbsrsm2_bufferSize", "rocsparse_cbsrsm_buffer_size", "library"); subst("cusparseCbsrsm2_solve", "rocsparse_cbsrsm_solve", "library"); subst("cusparseCbsrsv2_analysis", "rocsparse_cbsrsv_analysis", "library"); + subst("cusparseCbsrsv2_bufferSize", "rocsparse_cbsrsv_buffer_size", "library"); subst("cusparseCbsrsv2_bufferSizeExt", "rocsparse_cbsrsv_buffer_size", "library"); subst("cusparseCbsrsv2_solve", "rocsparse_cbsrsv_solve", "library"); subst("cusparseCbsrxmv", "rocsparse_cbsrxmv", "library"); @@ -2393,6 +2394,7 @@ sub rocSubstitutions { subst("cusparseDbsrsm2_bufferSize", "rocsparse_dbsrsm_buffer_size", "library"); subst("cusparseDbsrsm2_solve", "rocsparse_dbsrsm_solve", "library"); subst("cusparseDbsrsv2_analysis", "rocsparse_dbsrsv_analysis", "library"); + subst("cusparseDbsrsv2_bufferSize", "rocsparse_dbsrsv_buffer_size", "library"); subst("cusparseDbsrsv2_bufferSizeExt", "rocsparse_dbsrsv_buffer_size", "library"); subst("cusparseDbsrsv2_solve", "rocsparse_dbsrsv_solve", "library"); subst("cusparseDbsrxmv", "rocsparse_dbsrxmv", "library"); @@ -2517,6 +2519,7 @@ sub rocSubstitutions { subst("cusparseSbsrsm2_bufferSize", "rocsparse_sbsrsm_buffer_size", "library"); subst("cusparseSbsrsm2_solve", "rocsparse_sbsrsm_solve", "library"); subst("cusparseSbsrsv2_analysis", "rocsparse_sbsrsv_analysis", "library"); + subst("cusparseSbsrsv2_bufferSize", "rocsparse_sbsrsv_buffer_size", "library"); subst("cusparseSbsrsv2_bufferSizeExt", "rocsparse_sbsrsv_buffer_size", "library"); subst("cusparseSbsrsv2_solve", "rocsparse_sbsrsv_solve", "library"); subst("cusparseSbsrxmv", "rocsparse_sbsrxmv", "library"); @@ -2644,6 +2647,7 @@ sub rocSubstitutions { subst("cusparseZbsrsm2_bufferSize", "rocsparse_zbsrsm_buffer_size", "library"); subst("cusparseZbsrsm2_solve", "rocsparse_zbsrsm_solve", "library"); subst("cusparseZbsrsv2_analysis", "rocsparse_zbsrsv_analysis", "library"); + subst("cusparseZbsrsv2_bufferSize", "rocsparse_zbsrsv_buffer_size", "library"); subst("cusparseZbsrsv2_bufferSizeExt", "rocsparse_zbsrsv_buffer_size", "library"); subst("cusparseZbsrsv2_solve", "rocsparse_zbsrsv_solve", "library"); subst("cusparseZbsrxmv", "rocsparse_zbsrxmv", "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 bb61970b..4a038852 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -294,7 +294,7 @@ |:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:| |`cusparseCbsrmv`| | | | |`hipsparseCbsrmv`|3.5.0| | | | |`rocsparse_cbsrmv`|3.5.0|5.4.0| | | | |`cusparseCbsrsv2_analysis`| |12.2| | |`hipsparseCbsrsv2_analysis`|3.6.0| | | | |`rocsparse_cbsrsv_analysis`|3.6.0| | | | | -|`cusparseCbsrsv2_bufferSize`| |12.2| | |`hipsparseCbsrsv2_bufferSize`|3.6.0| | | | | | | | | | | +|`cusparseCbsrsv2_bufferSize`| |12.2| | |`hipsparseCbsrsv2_bufferSize`|3.6.0| | | | |`rocsparse_cbsrsv_buffer_size`|3.6.0| | | | | |`cusparseCbsrsv2_bufferSizeExt`| |12.2| | |`hipsparseCbsrsv2_bufferSizeExt`|3.6.0| | | | |`rocsparse_cbsrsv_buffer_size`|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| | | | |`rocsparse_cbsrxmv`|4.5.0| | | | | @@ -317,7 +317,7 @@ |`cusparseCsrsv_solveEx`|8.0|10.2| |11.0| | | | | | | | | | | | | |`cusparseDbsrmv`| | | | |`hipsparseDbsrmv`|3.5.0| | | | |`rocsparse_dbsrmv`|3.5.0|5.4.0| | | | |`cusparseDbsrsv2_analysis`| |12.2| | |`hipsparseDbsrsv2_analysis`|3.6.0| | | | |`rocsparse_dbsrsv_analysis`|3.6.0| | | | | -|`cusparseDbsrsv2_bufferSize`| |12.2| | |`hipsparseDbsrsv2_bufferSize`|3.6.0| | | | | | | | | | | +|`cusparseDbsrsv2_bufferSize`| |12.2| | |`hipsparseDbsrsv2_bufferSize`|3.6.0| | | | |`rocsparse_dbsrsv_buffer_size`|3.6.0| | | | | |`cusparseDbsrsv2_bufferSizeExt`| |12.2| | |`hipsparseDbsrsv2_bufferSizeExt`|3.6.0| | | | |`rocsparse_dbsrsv_buffer_size`|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| | | | |`rocsparse_dbsrxmv`|4.5.0| | | | | @@ -336,7 +336,7 @@ |`cusparseDhybsv_solve`| |10.2| |11.0| | | | | | | | | | | | | |`cusparseSbsrmv`| | | | |`hipsparseSbsrmv`|3.5.0| | | | |`rocsparse_sbsrmv`|3.5.0|5.4.0| | | | |`cusparseSbsrsv2_analysis`| |12.2| | |`hipsparseSbsrsv2_analysis`|3.6.0| | | | |`rocsparse_sbsrsv_analysis`|3.6.0| | | | | -|`cusparseSbsrsv2_bufferSize`| |12.2| | |`hipsparseSbsrsv2_bufferSize`|3.6.0| | | | | | | | | | | +|`cusparseSbsrsv2_bufferSize`| |12.2| | |`hipsparseSbsrsv2_bufferSize`|3.6.0| | | | |`rocsparse_sbsrsv_buffer_size`|3.6.0| | | | | |`cusparseSbsrsv2_bufferSizeExt`| |12.2| | |`hipsparseSbsrsv2_bufferSizeExt`|3.6.0| | | | |`rocsparse_sbsrsv_buffer_size`|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| | | | |`rocsparse_sbsrxmv`|4.5.0| | | | | @@ -357,7 +357,7 @@ |`cusparseXcsrsv2_zeroPivot`| |11.3| |12.0|`hipsparseXcsrsv2_zeroPivot`|1.9.2| | | | |`rocsparse_csrsv_zero_pivot`|1.9.0| | | | | |`cusparseZbsrmv`| | | | |`hipsparseZbsrmv`|3.5.0| | | | |`rocsparse_zbsrmv`|3.5.0|5.4.0| | | | |`cusparseZbsrsv2_analysis`| |12.2| | |`hipsparseZbsrsv2_analysis`|3.6.0| | | | |`rocsparse_zbsrsv_analysis`|3.6.0| | | | | -|`cusparseZbsrsv2_bufferSize`| |12.2| | |`hipsparseZbsrsv2_bufferSize`|3.6.0| | | | | | | | | | | +|`cusparseZbsrsv2_bufferSize`| |12.2| | |`hipsparseZbsrsv2_bufferSize`|3.6.0| | | | |`rocsparse_zbsrsv_buffer_size`|3.6.0| | | | | |`cusparseZbsrsv2_bufferSizeExt`| |12.2| | |`hipsparseZbsrsv2_bufferSizeExt`|3.6.0| | | | |`rocsparse_zbsrsv_buffer_size`|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| | | | |`rocsparse_zbsrxmv`|4.5.0| | | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index 734047a2..0ad0d452 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -294,7 +294,7 @@ |:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:| |`cusparseCbsrmv`| | | | |`rocsparse_cbsrmv`|3.5.0|5.4.0| | | | |`cusparseCbsrsv2_analysis`| |12.2| | |`rocsparse_cbsrsv_analysis`|3.6.0| | | | | -|`cusparseCbsrsv2_bufferSize`| |12.2| | | | | | | | | +|`cusparseCbsrsv2_bufferSize`| |12.2| | |`rocsparse_cbsrsv_buffer_size`|3.6.0| | | | | |`cusparseCbsrsv2_bufferSizeExt`| |12.2| | |`rocsparse_cbsrsv_buffer_size`|3.6.0| | | | | |`cusparseCbsrsv2_solve`| |12.2| | |`rocsparse_cbsrsv_solve`|3.6.0| | | | | |`cusparseCbsrxmv`| |12.2| | |`rocsparse_cbsrxmv`|4.5.0| | | | | @@ -317,7 +317,7 @@ |`cusparseCsrsv_solveEx`|8.0|10.2| |11.0| | | | | | | |`cusparseDbsrmv`| | | | |`rocsparse_dbsrmv`|3.5.0|5.4.0| | | | |`cusparseDbsrsv2_analysis`| |12.2| | |`rocsparse_dbsrsv_analysis`|3.6.0| | | | | -|`cusparseDbsrsv2_bufferSize`| |12.2| | | | | | | | | +|`cusparseDbsrsv2_bufferSize`| |12.2| | |`rocsparse_dbsrsv_buffer_size`|3.6.0| | | | | |`cusparseDbsrsv2_bufferSizeExt`| |12.2| | |`rocsparse_dbsrsv_buffer_size`|3.6.0| | | | | |`cusparseDbsrsv2_solve`| |12.2| | |`rocsparse_dbsrsv_solve`|3.6.0| | | | | |`cusparseDbsrxmv`| |12.2| | |`rocsparse_dbsrxmv`|4.5.0| | | | | @@ -336,7 +336,7 @@ |`cusparseDhybsv_solve`| |10.2| |11.0| | | | | | | |`cusparseSbsrmv`| | | | |`rocsparse_sbsrmv`|3.5.0|5.4.0| | | | |`cusparseSbsrsv2_analysis`| |12.2| | |`rocsparse_sbsrsv_analysis`|3.6.0| | | | | -|`cusparseSbsrsv2_bufferSize`| |12.2| | | | | | | | | +|`cusparseSbsrsv2_bufferSize`| |12.2| | |`rocsparse_sbsrsv_buffer_size`|3.6.0| | | | | |`cusparseSbsrsv2_bufferSizeExt`| |12.2| | |`rocsparse_sbsrsv_buffer_size`|3.6.0| | | | | |`cusparseSbsrsv2_solve`| |12.2| | |`rocsparse_sbsrsv_solve`|3.6.0| | | | | |`cusparseSbsrxmv`| |12.2| | |`rocsparse_sbsrxmv`|4.5.0| | | | | @@ -357,7 +357,7 @@ |`cusparseXcsrsv2_zeroPivot`| |11.3| |12.0|`rocsparse_csrsv_zero_pivot`|1.9.0| | | | | |`cusparseZbsrmv`| | | | |`rocsparse_zbsrmv`|3.5.0|5.4.0| | | | |`cusparseZbsrsv2_analysis`| |12.2| | |`rocsparse_zbsrsv_analysis`|3.6.0| | | | | -|`cusparseZbsrsv2_bufferSize`| |12.2| | | | | | | | | +|`cusparseZbsrsv2_bufferSize`| |12.2| | |`rocsparse_zbsrsv_buffer_size`|3.6.0| | | | | |`cusparseZbsrsv2_bufferSizeExt`| |12.2| | |`rocsparse_zbsrsv_buffer_size`|3.6.0| | | | | |`cusparseZbsrsv2_solve`| |12.2| | |`rocsparse_zbsrsv_solve`|3.6.0| | | | | |`cusparseZbsrxmv`| |12.2| | |`rocsparse_zbsrxmv`|4.5.0| | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index 71d18a9b..3939b973 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -151,13 +151,13 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseCgemvi_bufferSize", {"hipsparseCgemvi_bufferSize", "rocsparse_cgemvi_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9}}, {"cusparseZgemvi_bufferSize", {"hipsparseZgemvi_bufferSize", "rocsparse_zgemvi_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9}}, - {"cusparseSbsrsv2_bufferSize", {"hipsparseSbsrsv2_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseSbsrsv2_bufferSize", {"hipsparseSbsrsv2_bufferSize", "rocsparse_sbsrsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, {"cusparseSbsrsv2_bufferSizeExt", {"hipsparseSbsrsv2_bufferSizeExt", "rocsparse_sbsrsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, - {"cusparseDbsrsv2_bufferSize", {"hipsparseDbsrsv2_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseDbsrsv2_bufferSize", {"hipsparseDbsrsv2_bufferSize", "rocsparse_dbsrsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, {"cusparseDbsrsv2_bufferSizeExt", {"hipsparseDbsrsv2_bufferSizeExt", "rocsparse_dbsrsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, - {"cusparseCbsrsv2_bufferSize", {"hipsparseCbsrsv2_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseCbsrsv2_bufferSize", {"hipsparseCbsrsv2_bufferSize", "rocsparse_cbsrsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, {"cusparseCbsrsv2_bufferSizeExt", {"hipsparseCbsrsv2_bufferSizeExt", "rocsparse_cbsrsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, - {"cusparseZbsrsv2_bufferSize", {"hipsparseZbsrsv2_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseZbsrsv2_bufferSize", {"hipsparseZbsrsv2_bufferSize", "rocsparse_zbsrsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, {"cusparseZbsrsv2_bufferSizeExt", {"hipsparseZbsrsv2_bufferSizeExt", "rocsparse_zbsrsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, {"cusparseSbsrsv2_analysis", {"hipsparseSbsrsv2_analysis", "rocsparse_sbsrsv_analysis", CONV_LIB_FUNC, API_SPARSE, 9, CUDA_DEPRECATED}}, @@ -1327,14 +1327,14 @@ const std::map CUDA_SPARSE_FUNCTION_VER_MAP { {"cusparseCbsrxmv", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 {"cusparseZbsrxmv", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 {"cusparseXbsrsv2_zeroPivot", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 - {"cusparseSbsrsv2_bufferSize", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 - {"cusparseDbsrsv2_bufferSize", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 - {"cusparseCbsrsv2_bufferSize", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 - {"cusparseZbsrsv2_bufferSize", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 - {"cusparseSbsrsv2_bufferSizeExt", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 - {"cusparseDbsrsv2_bufferSizeExt", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 - {"cusparseCbsrsv2_bufferSizeExt", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 - {"cusparseZbsrsv2_bufferSizeExt", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 + {"cusparseSbsrsv2_bufferSize", {CUDA_0, CUDA_122, CUDA_0 }}, // D: CUSPARSE_VERSION 12102 + {"cusparseDbsrsv2_bufferSize", {CUDA_0, CUDA_122, CUDA_0 }}, // D: CUSPARSE_VERSION 12102 + {"cusparseCbsrsv2_bufferSize", {CUDA_0, CUDA_122, CUDA_0 }}, // D: CUSPARSE_VERSION 12102 + {"cusparseZbsrsv2_bufferSize", {CUDA_0, CUDA_122, CUDA_0 }}, // D: CUSPARSE_VERSION 12102 + {"cusparseSbsrsv2_bufferSizeExt", {CUDA_0, CUDA_122, CUDA_0 }}, // D: CUSPARSE_VERSION 12102 + {"cusparseDbsrsv2_bufferSizeExt", {CUDA_0, CUDA_122, CUDA_0 }}, // D: CUSPARSE_VERSION 12102 + {"cusparseCbsrsv2_bufferSizeExt", {CUDA_0, CUDA_122, CUDA_0 }}, // D: CUSPARSE_VERSION 12102 + {"cusparseZbsrsv2_bufferSizeExt", {CUDA_0, CUDA_122, CUDA_0 }}, // D: CUSPARSE_VERSION 12102 {"cusparseSbsrsv2_analysis", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 {"cusparseDbsrsv2_analysis", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 {"cusparseCbsrsv2_analysis", {CUDA_0, CUDA_122, CUDA_0 }}, // CUSPARSE_VERSION 12120 diff --git a/src/HipifyAction.cpp b/src/HipifyAction.cpp index b8b3eb1f..ca96b8a0 100644 --- a/src/HipifyAction.cpp +++ b/src/HipifyAction.cpp @@ -183,6 +183,10 @@ const std::string sCusparseZcsrgeam2 = "cusparseZcsrgeam2"; const std::string sCusparseCcsrgeam2 = "cusparseCcsrgeam2"; const std::string sCusparseDcsrgeam2 = "cusparseDcsrgeam2"; const std::string sCusparseScsrgeam2 = "cusparseScsrgeam2"; +const std::string sCusparseZbsrsv2_bufferSize = "cusparseZbsrsv2_bufferSize"; +const std::string sCusparseCbsrsv2_bufferSize = "cusparseCbsrsv2_bufferSize"; +const std::string sCusparseDbsrsv2_bufferSize = "cusparseDbsrsv2_bufferSize"; +const std::string sCusparseSbsrsv2_bufferSize = "cusparseSbsrsv2_bufferSize"; // CUDA_OVERLOADED const std::string sCudaEventCreate = "cudaEventCreate"; @@ -1415,6 +1419,42 @@ std::map FuncArgCasts { false } }, + {sCusparseZbsrsv2_bufferSize, + { + { + {11, {e_reinterpret_cast_size_t, cw_None}} + }, + true, + false + } + }, + {sCusparseCbsrsv2_bufferSize, + { + { + {11, {e_reinterpret_cast_size_t, cw_None}} + }, + true, + false + } + }, + {sCusparseDbsrsv2_bufferSize, + { + { + {11, {e_reinterpret_cast_size_t, cw_None}} + }, + true, + false + } + }, + {sCusparseSbsrsv2_bufferSize, + { + { + {11, {e_reinterpret_cast_size_t, cw_None}} + }, + true, + false + } + }, }; void HipifyAction::RewriteString(StringRef s, clang::SourceLocation start) { @@ -2238,7 +2278,11 @@ std::unique_ptr HipifyAction::CreateASTConsumer(clang::Compi sCusparseZcsrgeam2, sCusparseCcsrgeam2, sCusparseDcsrgeam2, - sCusparseScsrgeam2 + sCusparseScsrgeam2, + sCusparseZbsrsv2_bufferSize, + sCusparseCbsrsv2_bufferSize, + sCusparseDbsrsv2_bufferSize, + sCusparseSbsrsv2_bufferSize ) ) ) diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 725280ab..87f09b6d 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -1147,6 +1147,26 @@ int main() { // CHECK: status_t = hipsparseSbsrsv2_bufferSizeExt(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &fbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSize); status_t = cusparseSbsrsv2_bufferSizeExt(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &fbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSize); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZbsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuDoubleComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // CHECK: status_t = hipsparseZbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &dComplexbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + status_t = cusparseZbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &dComplexbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCbsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // CHECK: status_t = hipsparseCbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &complexbsrValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + status_t = cusparseCbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &complexbsrValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDbsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, double* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // CHECK: status_t = hipsparseDbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &dbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + status_t = cusparseDbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &dbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSbsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, float* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // CHECK: status_t = hipsparseSbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &fbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + status_t = cusparseSbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &fbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseXbsrsv2_zeroPivot(cusparseHandle_t handle, bsrsv2Info_t info, int* position); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseXbsrsv2_zeroPivot(hipsparseHandle_t handle, bsrsv2Info_t info, int* position); // CHECK: status_t = hipsparseXbsrsv2_zeroPivot(handle_t, bsrsv2_info, &iposition); diff --git a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu index e13805d2..1f0a6c1b 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -1156,6 +1156,26 @@ int main() { // CHECK: status_t = rocsparse_sbsrsv_buffer_size(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &fbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSize); status_t = cusparseSbsrsv2_bufferSizeExt(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &fbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSize); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZbsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuDoubleComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zbsrsv_buffer_size(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation trans, rocsparse_int mb, rocsparse_int nnzb, 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, size_t* buffer_size); + // CHECK: status_t = rocsparse_zbsrsv_buffer_size(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &dComplexbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, reinterpret_cast(&bufferSizeInBytes)); + status_t = cusparseZbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &dComplexbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCbsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cbsrsv_buffer_size(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation trans, rocsparse_int mb, rocsparse_int nnzb, 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, size_t* buffer_size); + // CHECK: status_t = rocsparse_cbsrsv_buffer_size(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &complexbsrValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, reinterpret_cast(&bufferSizeInBytes)); + status_t = cusparseCbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &complexbsrValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDbsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, double* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dbsrsv_buffer_size(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation trans, rocsparse_int mb, rocsparse_int nnzb, 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, size_t* buffer_size); + // CHECK: status_t = rocsparse_dbsrsv_buffer_size(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &dbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, reinterpret_cast(&bufferSizeInBytes)); + status_t = cusparseDbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &dbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSbsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, float* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sbsrsv_buffer_size(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation trans, rocsparse_int mb, rocsparse_int nnzb, 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, size_t* buffer_size); + // CHECK: status_t = rocsparse_sbsrsv_buffer_size(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &fbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, reinterpret_cast(&bufferSizeInBytes)); + status_t = cusparseSbsrsv2_bufferSize(handle_t, direction_t, opA, mb, nnzb, matDescr_A, &fbsrSortedValA, &bsrRowPtrA, &bsrColIndA, blockDim, bsrsv2_info, &bufferSizeInBytes); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseXbsrsv2_zeroPivot(cusparseHandle_t handle, bsrsv2Info_t info, int* position); // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_bsrsv_zero_pivot(rocsparse_handle handle, rocsparse_mat_info info, rocsparse_int* position); // CHECK: status_t = rocsparse_bsrsv_zero_pivot(handle_t, bsrsv2_info, &iposition);