From 880b76c65a989c543d3b76da43ea02e7db20452f Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Sat, 9 Sep 2023 17:05:48 +0200 Subject: [PATCH] [HIPIFY][#674][rocSPARSE][feature] rocSPARSE support - Step 38 - functions + Updated synthetic tests and the regenerated hipify-perl and SPARSE docs --- bin/hipify-perl | 8 ++++ .../CUSPARSE_API_supported_by_HIP_and_ROC.md | 16 ++++---- docs/tables/CUSPARSE_API_supported_by_ROC.md | 16 ++++---- src/CUDA2HIP_SPARSE_API_functions.cpp | 24 +++++++---- .../synthetic/libraries/cusparse2hipsparse.cu | 40 +++++++++++++++++++ .../synthetic/libraries/cusparse2rocsparse.cu | 40 +++++++++++++++++++ 6 files changed, 120 insertions(+), 24 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index d4a6dee1..83ffc211 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1691,8 +1691,10 @@ sub rocSubstitutions { subst("cusparseCgebsr2gebsr_bufferSize", "rocsparse_cgebsr2gebsr_buffer_size", "library"); subst("cusparseCgpsvInterleavedBatch", "rocsparse_cgpsv_interleaved_batch", "library"); subst("cusparseCgpsvInterleavedBatch_bufferSizeExt", "rocsparse_cgpsv_interleaved_batch_buffer_size", "library"); + subst("cusparseCgtsv2", "rocsparse_cgtsv", "library"); subst("cusparseCgtsv2StridedBatch", "rocsparse_cgtsv_no_pivot_strided_batch", "library"); subst("cusparseCgtsv2StridedBatch_bufferSizeExt", "rocsparse_cgtsv_no_pivot_strided_batch_buffer_size", "library"); + subst("cusparseCgtsv2_bufferSizeExt", "rocsparse_cgtsv_buffer_size", "library"); subst("cusparseCgtsv2_nopivot", "rocsparse_cgtsv_no_pivot", "library"); subst("cusparseCgtsv2_nopivot_bufferSizeExt", "rocsparse_cgtsv_no_pivot_buffer_size", "library"); subst("cusparseCgtsvInterleavedBatch", "rocsparse_cgtsv_interleaved_batch", "library"); @@ -1747,8 +1749,10 @@ sub rocSubstitutions { subst("cusparseDgebsr2gebsr_bufferSize", "rocsparse_dgebsr2gebsr_buffer_size", "library"); subst("cusparseDgpsvInterleavedBatch", "rocsparse_dgpsv_interleaved_batch", "library"); subst("cusparseDgpsvInterleavedBatch_bufferSizeExt", "rocsparse_dgpsv_interleaved_batch_buffer_size", "library"); + subst("cusparseDgtsv2", "rocsparse_dgtsv", "library"); subst("cusparseDgtsv2StridedBatch", "rocsparse_dgtsv_no_pivot_strided_batch", "library"); subst("cusparseDgtsv2StridedBatch_bufferSizeExt", "rocsparse_dgtsv_no_pivot_strided_batch_buffer_size", "library"); + subst("cusparseDgtsv2_bufferSizeExt", "rocsparse_dgtsv_buffer_size", "library"); subst("cusparseDgtsv2_nopivot", "rocsparse_dgtsv_no_pivot", "library"); subst("cusparseDgtsv2_nopivot_bufferSizeExt", "rocsparse_dgtsv_no_pivot_buffer_size", "library"); subst("cusparseDgtsvInterleavedBatch", "rocsparse_dgtsv_interleaved_batch", "library"); @@ -1812,8 +1816,10 @@ sub rocSubstitutions { subst("cusparseSgebsr2gebsr_bufferSize", "rocsparse_sgebsr2gebsr_buffer_size", "library"); subst("cusparseSgpsvInterleavedBatch", "rocsparse_sgpsv_interleaved_batch", "library"); subst("cusparseSgpsvInterleavedBatch_bufferSizeExt", "rocsparse_sgpsv_interleaved_batch_buffer_size", "library"); + subst("cusparseSgtsv2", "rocsparse_sgtsv", "library"); subst("cusparseSgtsv2StridedBatch", "rocsparse_sgtsv_no_pivot_strided_batch", "library"); subst("cusparseSgtsv2StridedBatch_bufferSizeExt", "rocsparse_sgtsv_no_pivot_strided_batch_buffer_size", "library"); + subst("cusparseSgtsv2_bufferSizeExt", "rocsparse_sgtsv_buffer_size", "library"); subst("cusparseSgtsv2_nopivot", "rocsparse_sgtsv_no_pivot", "library"); subst("cusparseSgtsv2_nopivot_bufferSizeExt", "rocsparse_sgtsv_no_pivot_buffer_size", "library"); subst("cusparseSgtsvInterleavedBatch", "rocsparse_sgtsv_interleaved_batch", "library"); @@ -1876,8 +1882,10 @@ sub rocSubstitutions { subst("cusparseZgebsr2gebsr_bufferSize", "rocsparse_zgebsr2gebsr_buffer_size", "library"); subst("cusparseZgpsvInterleavedBatch", "rocsparse_zgpsv_interleaved_batch", "library"); subst("cusparseZgpsvInterleavedBatch_bufferSizeExt", "rocsparse_zgpsv_interleaved_batch_buffer_size", "library"); + subst("cusparseZgtsv2", "rocsparse_zgtsv", "library"); subst("cusparseZgtsv2StridedBatch", "rocsparse_zgtsv_no_pivot_strided_batch", "library"); subst("cusparseZgtsv2StridedBatch_bufferSizeExt", "rocsparse_zgtsv_no_pivot_strided_batch_buffer_size", "library"); + subst("cusparseZgtsv2_bufferSizeExt", "rocsparse_zgtsv_buffer_size", "library"); subst("cusparseZgtsv2_nopivot", "rocsparse_zgtsv_no_pivot", "library"); subst("cusparseZgtsv2_nopivot_bufferSizeExt", "rocsparse_zgtsv_no_pivot_buffer_size", "library"); subst("cusparseZgtsvInterleavedBatch", "rocsparse_zgtsv_interleaved_batch", "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 3d12e806..a6520195 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -492,10 +492,10 @@ |`cusparseCgpsvInterleavedBatch`|9.2| | |`hipsparseCgpsvInterleavedBatch`|5.1.0| | | |`rocsparse_cgpsv_interleaved_batch`|5.1.0| | | | |`cusparseCgpsvInterleavedBatch_bufferSizeExt`|9.2| | |`hipsparseCgpsvInterleavedBatch_bufferSizeExt`|5.1.0| | | |`rocsparse_cgpsv_interleaved_batch_buffer_size`|5.1.0| | | | |`cusparseCgtsv`| |10.2|11.0| | | | | | | | | | | -|`cusparseCgtsv2`|9.0| | |`hipsparseCgtsv2`|4.3.0| | | | | | | | | +|`cusparseCgtsv2`|9.0| | |`hipsparseCgtsv2`|4.3.0| | | |`rocsparse_cgtsv`|4.3.0| | | | |`cusparseCgtsv2StridedBatch`| | | |`hipsparseCgtsv2StridedBatch`|4.5.0| | | |`rocsparse_cgtsv_no_pivot_strided_batch`|4.3.0| | | | |`cusparseCgtsv2StridedBatch_bufferSizeExt`| | | |`hipsparseCgtsv2StridedBatch_bufferSizeExt`|4.5.0| | | |`rocsparse_cgtsv_no_pivot_strided_batch_buffer_size`|4.3.0| | | | -|`cusparseCgtsv2_bufferSizeExt`|9.0| | |`hipsparseCgtsv2_bufferSizeExt`|4.3.0| | | | | | | | | +|`cusparseCgtsv2_bufferSizeExt`|9.0| | |`hipsparseCgtsv2_bufferSizeExt`|4.3.0| | | |`rocsparse_cgtsv_buffer_size`|4.3.0| | | | |`cusparseCgtsv2_nopivot`|9.0| | |`hipsparseCgtsv2_nopivot`|4.3.0| | | |`rocsparse_cgtsv_no_pivot`|4.3.0| | | | |`cusparseCgtsv2_nopivot_bufferSizeExt`|9.0| | |`hipsparseCgtsv2_nopivot_bufferSizeExt`|4.3.0| | | |`rocsparse_cgtsv_no_pivot_buffer_size`|4.3.0| | | | |`cusparseCgtsvInterleavedBatch`|9.2| | |`hipsparseCgtsvInterleavedBatch`|5.1.0| | | |`rocsparse_cgtsv_interleaved_batch`|5.1.0| | | | @@ -526,10 +526,10 @@ |`cusparseDgpsvInterleavedBatch`|9.2| | |`hipsparseDgpsvInterleavedBatch`|5.1.0| | | |`rocsparse_dgpsv_interleaved_batch`|5.1.0| | | | |`cusparseDgpsvInterleavedBatch_bufferSizeExt`|9.2| | |`hipsparseDgpsvInterleavedBatch_bufferSizeExt`|5.1.0| | | |`rocsparse_dgpsv_interleaved_batch_buffer_size`|5.1.0| | | | |`cusparseDgtsv`| |10.2|11.0| | | | | | | | | | | -|`cusparseDgtsv2`|9.0| | |`hipsparseDgtsv2`|4.3.0| | | | | | | | | +|`cusparseDgtsv2`|9.0| | |`hipsparseDgtsv2`|4.3.0| | | |`rocsparse_dgtsv`|4.3.0| | | | |`cusparseDgtsv2StridedBatch`| | | |`hipsparseDgtsv2StridedBatch`|4.5.0| | | |`rocsparse_dgtsv_no_pivot_strided_batch`|4.3.0| | | | |`cusparseDgtsv2StridedBatch_bufferSizeExt`| | | |`hipsparseDgtsv2StridedBatch_bufferSizeExt`|4.5.0| | | |`rocsparse_dgtsv_no_pivot_strided_batch_buffer_size`|4.3.0| | | | -|`cusparseDgtsv2_bufferSizeExt`|9.0| | |`hipsparseDgtsv2_bufferSizeExt`|4.3.0| | | | | | | | | +|`cusparseDgtsv2_bufferSizeExt`|9.0| | |`hipsparseDgtsv2_bufferSizeExt`|4.3.0| | | |`rocsparse_dgtsv_buffer_size`|4.3.0| | | | |`cusparseDgtsv2_nopivot`|9.0| | |`hipsparseDgtsv2_nopivot`|4.3.0| | | |`rocsparse_dgtsv_no_pivot`|4.3.0| | | | |`cusparseDgtsv2_nopivot_bufferSizeExt`|9.0| | |`hipsparseDgtsv2_nopivot_bufferSizeExt`|4.3.0| | | |`rocsparse_dgtsv_no_pivot_buffer_size`|4.3.0| | | | |`cusparseDgtsvInterleavedBatch`|9.2| | |`hipsparseDgtsvInterleavedBatch`|5.1.0| | | |`rocsparse_dgtsv_interleaved_batch`|5.1.0| | | | @@ -559,10 +559,10 @@ |`cusparseSgpsvInterleavedBatch`|9.2| | |`hipsparseSgpsvInterleavedBatch`|5.1.0| | | |`rocsparse_sgpsv_interleaved_batch`|5.1.0| | | | |`cusparseSgpsvInterleavedBatch_bufferSizeExt`|9.2| | |`hipsparseSgpsvInterleavedBatch_bufferSizeExt`|5.1.0| | | |`rocsparse_sgpsv_interleaved_batch_buffer_size`|5.1.0| | | | |`cusparseSgtsv`| |10.2|11.0| | | | | | | | | | | -|`cusparseSgtsv2`|9.0| | |`hipsparseSgtsv2`|4.3.0| | | | | | | | | +|`cusparseSgtsv2`|9.0| | |`hipsparseSgtsv2`|4.3.0| | | |`rocsparse_sgtsv`|4.3.0| | | | |`cusparseSgtsv2StridedBatch`|9.0| | |`hipsparseSgtsv2StridedBatch`|4.5.0| | | |`rocsparse_sgtsv_no_pivot_strided_batch`|4.3.0| | | | |`cusparseSgtsv2StridedBatch_bufferSizeExt`|9.0| | |`hipsparseSgtsv2StridedBatch_bufferSizeExt`|4.5.0| | | |`rocsparse_sgtsv_no_pivot_strided_batch_buffer_size`|4.3.0| | | | -|`cusparseSgtsv2_bufferSizeExt`|9.0| | |`hipsparseSgtsv2_bufferSizeExt`|4.3.0| | | | | | | | | +|`cusparseSgtsv2_bufferSizeExt`|9.0| | |`hipsparseSgtsv2_bufferSizeExt`|4.3.0| | | |`rocsparse_sgtsv_buffer_size`|4.3.0| | | | |`cusparseSgtsv2_nopivot`|9.0| | |`hipsparseSgtsv2_nopivot`|4.3.0| | | |`rocsparse_sgtsv_no_pivot`|4.3.0| | | | |`cusparseSgtsv2_nopivot_bufferSizeExt`|9.0| | |`hipsparseSgtsv2_nopivot_bufferSizeExt`|4.3.0| | | |`rocsparse_sgtsv_no_pivot_buffer_size`|4.3.0| | | | |`cusparseSgtsvInterleavedBatch`|9.2| | |`hipsparseSgtsvInterleavedBatch`|5.1.0| | | |`rocsparse_sgtsv_interleaved_batch`|5.1.0| | | | @@ -596,10 +596,10 @@ |`cusparseZgpsvInterleavedBatch`|9.2| | |`hipsparseZgpsvInterleavedBatch`|5.1.0| | | |`rocsparse_zgpsv_interleaved_batch`|5.1.0| | | | |`cusparseZgpsvInterleavedBatch_bufferSizeExt`|9.2| | |`hipsparseZgpsvInterleavedBatch_bufferSizeExt`|5.1.0| | | |`rocsparse_zgpsv_interleaved_batch_buffer_size`|5.1.0| | | | |`cusparseZgtsv`| |10.2|11.0| | | | | | | | | | | -|`cusparseZgtsv2`|9.0| | |`hipsparseZgtsv2`|4.3.0| | | | | | | | | +|`cusparseZgtsv2`|9.0| | |`hipsparseZgtsv2`|4.3.0| | | |`rocsparse_zgtsv`|4.3.0| | | | |`cusparseZgtsv2StridedBatch`| | | |`hipsparseZgtsv2StridedBatch`|4.5.0| | | |`rocsparse_zgtsv_no_pivot_strided_batch`|4.3.0| | | | |`cusparseZgtsv2StridedBatch_bufferSizeExt`| | | |`hipsparseZgtsv2StridedBatch_bufferSizeExt`|4.5.0| | | |`rocsparse_zgtsv_no_pivot_strided_batch_buffer_size`|4.3.0| | | | -|`cusparseZgtsv2_bufferSizeExt`|9.0| | |`hipsparseZgtsv2_bufferSizeExt`|4.3.0| | | | | | | | | +|`cusparseZgtsv2_bufferSizeExt`|9.0| | |`hipsparseZgtsv2_bufferSizeExt`|4.3.0| | | |`rocsparse_zgtsv_buffer_size`|4.3.0| | | | |`cusparseZgtsv2_nopivot`|9.0| | |`hipsparseZgtsv2_nopivot`|4.3.0| | | |`rocsparse_zgtsv_no_pivot`|4.3.0| | | | |`cusparseZgtsv2_nopivot_bufferSizeExt`|9.0| | |`hipsparseZgtsv2_nopivot_bufferSizeExt`|4.3.0| | | |`rocsparse_zgtsv_no_pivot_buffer_size`|4.3.0| | | | |`cusparseZgtsvInterleavedBatch`|9.2| | |`hipsparseZgtsvInterleavedBatch`|5.1.0| | | |`rocsparse_zgtsv_interleaved_batch`|5.1.0| | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index 42569ed3..c2dad2f2 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -492,10 +492,10 @@ |`cusparseCgpsvInterleavedBatch`|9.2| | |`rocsparse_cgpsv_interleaved_batch`|5.1.0| | | | |`cusparseCgpsvInterleavedBatch_bufferSizeExt`|9.2| | |`rocsparse_cgpsv_interleaved_batch_buffer_size`|5.1.0| | | | |`cusparseCgtsv`| |10.2|11.0| | | | | | -|`cusparseCgtsv2`|9.0| | | | | | | | +|`cusparseCgtsv2`|9.0| | |`rocsparse_cgtsv`|4.3.0| | | | |`cusparseCgtsv2StridedBatch`| | | |`rocsparse_cgtsv_no_pivot_strided_batch`|4.3.0| | | | |`cusparseCgtsv2StridedBatch_bufferSizeExt`| | | |`rocsparse_cgtsv_no_pivot_strided_batch_buffer_size`|4.3.0| | | | -|`cusparseCgtsv2_bufferSizeExt`|9.0| | | | | | | | +|`cusparseCgtsv2_bufferSizeExt`|9.0| | |`rocsparse_cgtsv_buffer_size`|4.3.0| | | | |`cusparseCgtsv2_nopivot`|9.0| | |`rocsparse_cgtsv_no_pivot`|4.3.0| | | | |`cusparseCgtsv2_nopivot_bufferSizeExt`|9.0| | |`rocsparse_cgtsv_no_pivot_buffer_size`|4.3.0| | | | |`cusparseCgtsvInterleavedBatch`|9.2| | |`rocsparse_cgtsv_interleaved_batch`|5.1.0| | | | @@ -526,10 +526,10 @@ |`cusparseDgpsvInterleavedBatch`|9.2| | |`rocsparse_dgpsv_interleaved_batch`|5.1.0| | | | |`cusparseDgpsvInterleavedBatch_bufferSizeExt`|9.2| | |`rocsparse_dgpsv_interleaved_batch_buffer_size`|5.1.0| | | | |`cusparseDgtsv`| |10.2|11.0| | | | | | -|`cusparseDgtsv2`|9.0| | | | | | | | +|`cusparseDgtsv2`|9.0| | |`rocsparse_dgtsv`|4.3.0| | | | |`cusparseDgtsv2StridedBatch`| | | |`rocsparse_dgtsv_no_pivot_strided_batch`|4.3.0| | | | |`cusparseDgtsv2StridedBatch_bufferSizeExt`| | | |`rocsparse_dgtsv_no_pivot_strided_batch_buffer_size`|4.3.0| | | | -|`cusparseDgtsv2_bufferSizeExt`|9.0| | | | | | | | +|`cusparseDgtsv2_bufferSizeExt`|9.0| | |`rocsparse_dgtsv_buffer_size`|4.3.0| | | | |`cusparseDgtsv2_nopivot`|9.0| | |`rocsparse_dgtsv_no_pivot`|4.3.0| | | | |`cusparseDgtsv2_nopivot_bufferSizeExt`|9.0| | |`rocsparse_dgtsv_no_pivot_buffer_size`|4.3.0| | | | |`cusparseDgtsvInterleavedBatch`|9.2| | |`rocsparse_dgtsv_interleaved_batch`|5.1.0| | | | @@ -559,10 +559,10 @@ |`cusparseSgpsvInterleavedBatch`|9.2| | |`rocsparse_sgpsv_interleaved_batch`|5.1.0| | | | |`cusparseSgpsvInterleavedBatch_bufferSizeExt`|9.2| | |`rocsparse_sgpsv_interleaved_batch_buffer_size`|5.1.0| | | | |`cusparseSgtsv`| |10.2|11.0| | | | | | -|`cusparseSgtsv2`|9.0| | | | | | | | +|`cusparseSgtsv2`|9.0| | |`rocsparse_sgtsv`|4.3.0| | | | |`cusparseSgtsv2StridedBatch`|9.0| | |`rocsparse_sgtsv_no_pivot_strided_batch`|4.3.0| | | | |`cusparseSgtsv2StridedBatch_bufferSizeExt`|9.0| | |`rocsparse_sgtsv_no_pivot_strided_batch_buffer_size`|4.3.0| | | | -|`cusparseSgtsv2_bufferSizeExt`|9.0| | | | | | | | +|`cusparseSgtsv2_bufferSizeExt`|9.0| | |`rocsparse_sgtsv_buffer_size`|4.3.0| | | | |`cusparseSgtsv2_nopivot`|9.0| | |`rocsparse_sgtsv_no_pivot`|4.3.0| | | | |`cusparseSgtsv2_nopivot_bufferSizeExt`|9.0| | |`rocsparse_sgtsv_no_pivot_buffer_size`|4.3.0| | | | |`cusparseSgtsvInterleavedBatch`|9.2| | |`rocsparse_sgtsv_interleaved_batch`|5.1.0| | | | @@ -596,10 +596,10 @@ |`cusparseZgpsvInterleavedBatch`|9.2| | |`rocsparse_zgpsv_interleaved_batch`|5.1.0| | | | |`cusparseZgpsvInterleavedBatch_bufferSizeExt`|9.2| | |`rocsparse_zgpsv_interleaved_batch_buffer_size`|5.1.0| | | | |`cusparseZgtsv`| |10.2|11.0| | | | | | -|`cusparseZgtsv2`|9.0| | | | | | | | +|`cusparseZgtsv2`|9.0| | |`rocsparse_zgtsv`|4.3.0| | | | |`cusparseZgtsv2StridedBatch`| | | |`rocsparse_zgtsv_no_pivot_strided_batch`|4.3.0| | | | |`cusparseZgtsv2StridedBatch_bufferSizeExt`| | | |`rocsparse_zgtsv_no_pivot_strided_batch_buffer_size`|4.3.0| | | | -|`cusparseZgtsv2_bufferSizeExt`|9.0| | | | | | | | +|`cusparseZgtsv2_bufferSizeExt`|9.0| | |`rocsparse_zgtsv_buffer_size`|4.3.0| | | | |`cusparseZgtsv2_nopivot`|9.0| | |`rocsparse_zgtsv_no_pivot`|4.3.0| | | | |`cusparseZgtsv2_nopivot_bufferSizeExt`|9.0| | |`rocsparse_zgtsv_no_pivot_buffer_size`|4.3.0| | | | |`cusparseZgtsvInterleavedBatch`|9.2| | |`rocsparse_zgtsv_interleaved_batch`|5.1.0| | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index d3f67e5d..8b8a1462 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -435,15 +435,15 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseCgtsv_nopivot", {"hipsparseCgtsv_nopivot", "", CONV_LIB_FUNC, API_SPARSE, 12, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, {"cusparseZgtsv_nopivot", {"hipsparseZgtsv_nopivot", "", CONV_LIB_FUNC, API_SPARSE, 12, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseSgtsv2_bufferSizeExt", {"hipsparseSgtsv2_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}}, - {"cusparseDgtsv2_bufferSizeExt", {"hipsparseDgtsv2_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}}, - {"cusparseCgtsv2_bufferSizeExt", {"hipsparseCgtsv2_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}}, - {"cusparseZgtsv2_bufferSizeExt", {"hipsparseZgtsv2_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}}, + {"cusparseSgtsv2_bufferSizeExt", {"hipsparseSgtsv2_bufferSizeExt", "rocsparse_sgtsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 12}}, + {"cusparseDgtsv2_bufferSizeExt", {"hipsparseDgtsv2_bufferSizeExt", "rocsparse_dgtsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 12}}, + {"cusparseCgtsv2_bufferSizeExt", {"hipsparseCgtsv2_bufferSizeExt", "rocsparse_cgtsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 12}}, + {"cusparseZgtsv2_bufferSizeExt", {"hipsparseZgtsv2_bufferSizeExt", "rocsparse_zgtsv_buffer_size", CONV_LIB_FUNC, API_SPARSE, 12}}, - {"cusparseSgtsv2", {"hipsparseSgtsv2", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}}, - {"cusparseDgtsv2", {"hipsparseDgtsv2", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}}, - {"cusparseCgtsv2", {"hipsparseCgtsv2", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}}, - {"cusparseZgtsv2", {"hipsparseZgtsv2", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}}, + {"cusparseSgtsv2", {"hipsparseSgtsv2", "rocsparse_sgtsv", CONV_LIB_FUNC, API_SPARSE, 12}}, + {"cusparseDgtsv2", {"hipsparseDgtsv2", "rocsparse_dgtsv", CONV_LIB_FUNC, API_SPARSE, 12}}, + {"cusparseCgtsv2", {"hipsparseCgtsv2", "rocsparse_cgtsv", CONV_LIB_FUNC, API_SPARSE, 12}}, + {"cusparseZgtsv2", {"hipsparseZgtsv2", "rocsparse_zgtsv", CONV_LIB_FUNC, API_SPARSE, 12}}, {"cusparseSgtsv2_nopivot_bufferSizeExt", {"hipsparseSgtsv2_nopivot_bufferSizeExt", "rocsparse_sgtsv_no_pivot_buffer_size", CONV_LIB_FUNC, API_SPARSE, 12}}, {"cusparseDgtsv2_nopivot_bufferSizeExt", {"hipsparseDgtsv2_nopivot_bufferSizeExt", "rocsparse_dgtsv_no_pivot_buffer_size", CONV_LIB_FUNC, API_SPARSE, 12}}, @@ -2167,6 +2167,14 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_cgtsv_no_pivot_buffer_size", {HIP_4030, HIP_0, HIP_0 }}, {"rocsparse_dgtsv_no_pivot_buffer_size", {HIP_4030, HIP_0, HIP_0 }}, {"rocsparse_sgtsv_no_pivot_buffer_size", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_zgtsv", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_cgtsv", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_dgtsv", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_sgtsv", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_zgtsv_buffer_size", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_cgtsv_buffer_size", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_dgtsv_buffer_size", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_sgtsv_buffer_size", {HIP_4030, HIP_0, HIP_0 }}, }; const std::map CUDA_SPARSE_API_SECTION_MAP { diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index d6a9297e..ef869489 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -892,6 +892,46 @@ int main() { // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSgtsv2_nopivot_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const float* dl, const float* d, const float* du, const float* B, int ldb, size_t* pBufferSizeInBytes); // CHECK: status_t = hipsparseSgtsv2_nopivot_bufferSizeExt(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, &bufferSize); status_t = cusparseSgtsv2_nopivot_bufferSizeExt(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseZgtsv2(cusparseHandle_t handle, int m, int n, const cuDoubleComplex* dl, const cuDoubleComplex* d, const cuDoubleComplex* du, cuDoubleComplex* B, int ldb, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZgtsv2(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex* dl, const hipDoubleComplex* d, const hipDoubleComplex* du, hipDoubleComplex* B, int ldb, void* pBuffer); + // CHECK: status_t = hipsparseZgtsv2(handle_t, m, n, &dcomplexdl, &dcomplexd, &dcomplexdu, &dcomplexB, ldb, pBuffer); + status_t = cusparseZgtsv2(handle_t, m, n, &dcomplexdl, &dcomplexd, &dcomplexdu, &dcomplexB, ldb, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCgtsv2(cusparseHandle_t handle, int m, int n, const cuComplex* dl, const cuComplex* d, const cuComplex* du, cuComplex* B, int ldb, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCgtsv2(hipsparseHandle_t handle, int m, int n, const hipComplex* dl, const hipComplex* d, const hipComplex* du, hipComplex* B, int ldb, void* pBuffer); + // CHECK: status_t = hipsparseCgtsv2(handle_t, m, n, &complexdl, &complexd, &complexdu, &complexB, ldb, pBuffer); + status_t = cusparseCgtsv2(handle_t, m, n, &complexdl, &complexd, &complexdu, &complexB, ldb, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDgtsv2(cusparseHandle_t handle, int m, int n, const double* dl, const double* d, const double* du, double* B, int ldb, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDgtsv2(hipsparseHandle_t handle, int m, int n, const double* dl, const double* d, const double* du, double* B, int ldb, void* pBuffer); + // CHECK: status_t = hipsparseDgtsv2(handle_t, m, n, &ddl, &dd, &ddu, &dB, ldb, pBuffer); + status_t = cusparseDgtsv2(handle_t, m, n, &ddl, &dd, &ddu, &dB, ldb, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSgtsv2(cusparseHandle_t handle, int m, int n, const float* dl, const float* d, const float* du, float* B, int ldb, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSgtsv2(hipsparseHandle_t handle, int m, int n, const float* dl, const float* d, const float* du, float* B, int ldb, void* pBuffer); + // CHECK: status_t = hipsparseSgtsv2(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, pBuffer); + status_t = cusparseSgtsv2(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseZgtsv2_bufferSizeExt(cusparseHandle_t handle, int m, int n, const cuDoubleComplex* dl, const cuDoubleComplex* d, const cuDoubleComplex* du, const cuDoubleComplex* B, int ldb, size_t* bufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZgtsv2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex* dl, const hipDoubleComplex* d, const hipDoubleComplex* du, const hipDoubleComplex* B, int ldb, size_t* pBufferSizeInBytes); + // CHECK: status_t = hipsparseZgtsv2_bufferSizeExt(handle_t, m, n, &dcomplexdl, &dcomplexd, &dcomplexdu, &dcomplexB, ldb, &bufferSize); + status_t = cusparseZgtsv2_bufferSizeExt(handle_t, m, n, &dcomplexdl, &dcomplexd, &dcomplexdu, &dcomplexB, ldb, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCgtsv2_bufferSizeExt(cusparseHandle_t handle, int m, int n, const cuComplex* dl, const cuComplex* d, const cuComplex* du, const cuComplex* B, int ldb, size_t* bufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCgtsv2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const hipComplex* dl, const hipComplex* d, const hipComplex* du, const hipComplex* B, int ldb, size_t* pBufferSizeInBytes); + // CHECK: status_t = hipsparseCgtsv2_bufferSizeExt(handle_t, m, n, &complexdl, &complexd, &complexdu, &complexB, ldb, &bufferSize); + status_t = cusparseCgtsv2_bufferSizeExt(handle_t, m, n, &complexdl, &complexd, &complexdu, &complexB, ldb, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDgtsv2_bufferSizeExt(cusparseHandle_t handle, int m, int n, const double* dl, const double* d, const double* du, const double* B, int ldb, size_t* bufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDgtsv2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const double* dl, const double* d, const double* du, const double* B, int db, size_t* pBufferSizeInBytes); + // CHECK: status_t = hipsparseDgtsv2_bufferSizeExt(handle_t, m, n, &ddl, &dd, &ddu, &dB, ldb, &bufferSize); + status_t = cusparseDgtsv2_bufferSizeExt(handle_t, m, n, &ddl, &dd, &ddu, &dB, ldb, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSgtsv2_bufferSizeExt(cusparseHandle_t handle, int m, int n, const float* dl, const float* d, const float* du, const float* B, int ldb, size_t* bufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSgtsv2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const float* dl, const float* d, const float* du, const float* B, int ldb, size_t* pBufferSizeInBytes); + // CHECK: status_t = hipsparseSgtsv2_bufferSizeExt(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, &bufferSize); + status_t = cusparseSgtsv2_bufferSizeExt(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, &bufferSize); #endif #if CUDA_VERSION >= 9020 diff --git a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu index 361782b2..64e72e4a 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -899,6 +899,46 @@ int main() { // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sgtsv_no_pivot_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const float* dl, const float* d, const float* du, const float* B, rocsparse_int ldb, size_t* buffer_size); // CHECK: status_t = rocsparse_sgtsv_no_pivot_buffer_size(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, &bufferSize); status_t = cusparseSgtsv2_nopivot_bufferSizeExt(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseZgtsv2(cusparseHandle_t handle, int m, int n, const cuDoubleComplex* dl, const cuDoubleComplex* d, const cuDoubleComplex* du, cuDoubleComplex* B, int ldb, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zgtsv(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_double_complex* dl, const rocsparse_double_complex* d, const rocsparse_double_complex* du, rocsparse_double_complex* B, rocsparse_int ldb, void* temp_buffer); + // CHECK: status_t = rocsparse_zgtsv(handle_t, m, n, &dcomplexdl, &dcomplexd, &dcomplexdu, &dcomplexB, ldb, pBuffer); + status_t = cusparseZgtsv2(handle_t, m, n, &dcomplexdl, &dcomplexd, &dcomplexdu, &dcomplexB, ldb, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCgtsv2(cusparseHandle_t handle, int m, int n, const cuComplex* dl, const cuComplex* d, const cuComplex* du, cuComplex* B, int ldb, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cgtsv(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_float_complex* dl, const rocsparse_float_complex* d, const rocsparse_float_complex* du, rocsparse_float_complex* B, rocsparse_int ldb, void* temp_buffer); + // CHECK: status_t = rocsparse_cgtsv(handle_t, m, n, &complexdl, &complexd, &complexdu, &complexB, ldb, pBuffer); + status_t = cusparseCgtsv2(handle_t, m, n, &complexdl, &complexd, &complexdu, &complexB, ldb, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDgtsv2(cusparseHandle_t handle, int m, int n, const double* dl, const double* d, const double* du, double* B, int ldb, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dgtsv(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const double* dl, const double* d, const double* du, double* B, rocsparse_int ldb, void* temp_buffer); + // CHECK: status_t = rocsparse_dgtsv(handle_t, m, n, &ddl, &dd, &ddu, &dB, ldb, pBuffer); + status_t = cusparseDgtsv2(handle_t, m, n, &ddl, &dd, &ddu, &dB, ldb, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSgtsv2(cusparseHandle_t handle, int m, int n, const float* dl, const float* d, const float* du, float* B, int ldb, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sgtsv(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const float* dl, const float* d, const float* du, float* B, rocsparse_int ldb, void* temp_buffer); + // CHECK: status_t = rocsparse_sgtsv(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, pBuffer); + status_t = cusparseSgtsv2(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseZgtsv2_bufferSizeExt(cusparseHandle_t handle, int m, int n, const cuDoubleComplex* dl, const cuDoubleComplex* d, const cuDoubleComplex* du, const cuDoubleComplex* B, int ldb, size_t* bufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zgtsv_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_double_complex* dl, const rocsparse_double_complex* d, const rocsparse_double_complex* du, const rocsparse_double_complex* B, rocsparse_int ldb, size_t* buffer_size); + // CHECK: status_t = rocsparse_zgtsv_buffer_size(handle_t, m, n, &dcomplexdl, &dcomplexd, &dcomplexdu, &dcomplexB, ldb, &bufferSize); + status_t = cusparseZgtsv2_bufferSizeExt(handle_t, m, n, &dcomplexdl, &dcomplexd, &dcomplexdu, &dcomplexB, ldb, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCgtsv2_bufferSizeExt(cusparseHandle_t handle, int m, int n, const cuComplex* dl, const cuComplex* d, const cuComplex* du, const cuComplex* B, int ldb, size_t* bufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cgtsv_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_float_complex* dl, const rocsparse_float_complex* d, const rocsparse_float_complex* du, const rocsparse_float_complex* B, rocsparse_int ldb, size_t* buffer_size); + // CHECK: status_t = rocsparse_cgtsv_buffer_size(handle_t, m, n, &complexdl, &complexd, &complexdu, &complexB, ldb, &bufferSize); + status_t = cusparseCgtsv2_bufferSizeExt(handle_t, m, n, &complexdl, &complexd, &complexdu, &complexB, ldb, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDgtsv2_bufferSizeExt(cusparseHandle_t handle, int m, int n, const double* dl, const double* d, const double* du, const double* B, int ldb, size_t* bufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dgtsv_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const double* dl, const double* d, const double* du, const double* B, rocsparse_int ldb, size_t* buffer_size); + // CHECK: status_t = rocsparse_dgtsv_buffer_size(handle_t, m, n, &ddl, &dd, &ddu, &dB, ldb, &bufferSize); + status_t = cusparseDgtsv2_bufferSizeExt(handle_t, m, n, &ddl, &dd, &ddu, &dB, ldb, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSgtsv2_bufferSizeExt(cusparseHandle_t handle, int m, int n, const float* dl, const float* d, const float* du, const float* B, int ldb, size_t* bufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sgtsv_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const float* dl, const float* d, const float* du, const float* B, rocsparse_int ldb, size_t* buffer_size); + // CHECK: status_t = rocsparse_sgtsv_buffer_size(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, &bufferSize); + status_t = cusparseSgtsv2_bufferSizeExt(handle_t, m, n, &fdl, &fd, &fdu, &fB, ldb, &bufferSize); #endif #if CUDA_VERSION >= 9020