From 0d58bf3882bbc6c6c9f5b3613b9c61e0099bcab7 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Thu, 24 Aug 2023 13:53:46 +0200 Subject: [PATCH] [HIPIFY][#674][rocSPARSE][feature] rocSPARSE support - Step 30 - 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 9d652394..a83ee511 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1683,6 +1683,7 @@ sub rocSubstitutions { subst("cusparseCcsr2hyb", "rocsparse_ccsr2hyb", "library"); subst("cusparseCcsrcolor", "rocsparse_ccsrcolor", "library"); subst("cusparseCdense2csc", "rocsparse_cdense2csc", "library"); + subst("cusparseCdense2csr", "rocsparse_cdense2csr", "library"); subst("cusparseCgebsr2csr", "rocsparse_cgebsr2csr", "library"); subst("cusparseCgebsr2gebsc", "rocsparse_cgebsr2gebsc", "library"); subst("cusparseCgebsr2gebsc_bufferSize", "rocsparse_cgebsr2gebsc_buffer_size", "library"); @@ -1721,6 +1722,7 @@ sub rocSubstitutions { subst("cusparseDcsr2hyb", "rocsparse_dcsr2hyb", "library"); subst("cusparseDcsrcolor", "rocsparse_dcsrcolor", "library"); subst("cusparseDdense2csc", "rocsparse_ddense2csc", "library"); + subst("cusparseDdense2csr", "rocsparse_ddense2csr", "library"); subst("cusparseDestroy", "rocsparse_destroy_handle", "library"); subst("cusparseDestroyColorInfo", "rocsparse_destroy_color_info", "library"); subst("cusparseDestroyDnMat", "rocsparse_destroy_dnmat_descr", "library"); @@ -1752,7 +1754,9 @@ sub rocSubstitutions { subst("cusparseDpruneDense2csr", "rocsparse_dprune_dense2csr", "library"); subst("cusparseDpruneDense2csrByPercentage", "rocsparse_dprune_dense2csr_by_percentage", "library"); subst("cusparseDpruneDense2csrByPercentage_bufferSizeExt", "rocsparse_dprune_dense2csr_by_percentage_buffer_size", "library"); + subst("cusparseDpruneDense2csrNnz", "rocsparse_dprune_dense2csr_nnz", "library"); subst("cusparseDpruneDense2csrNnzByPercentage", "rocsparse_dprune_dense2csr_nnz_by_percentage", "library"); + subst("cusparseDpruneDense2csr_bufferSizeExt", "rocsparse_dprune_dense2csr_buffer_size", "library"); subst("cusparseGather", "rocsparse_gather", "library"); subst("cusparseGetMatDiagType", "rocsparse_get_mat_diag_type", "library"); subst("cusparseGetMatFillMode", "rocsparse_get_mat_fill_mode", "library"); @@ -1776,6 +1780,7 @@ sub rocSubstitutions { subst("cusparseScsr2hyb", "rocsparse_scsr2hyb", "library"); subst("cusparseScsrcolor", "rocsparse_scsrcolor", "library"); subst("cusparseSdense2csc", "rocsparse_sdense2csc", "library"); + subst("cusparseSdense2csr", "rocsparse_sdense2csr", "library"); subst("cusparseSetMatDiagType", "rocsparse_set_mat_diag_type", "library"); subst("cusparseSetMatFillMode", "rocsparse_set_mat_fill_mode", "library"); subst("cusparseSetMatIndexBase", "rocsparse_set_mat_index_base", "library"); @@ -1811,7 +1816,9 @@ sub rocSubstitutions { subst("cusparseSpruneDense2csr", "rocsparse_sprune_dense2csr", "library"); subst("cusparseSpruneDense2csrByPercentage", "rocsparse_sprune_dense2csr_by_percentage", "library"); subst("cusparseSpruneDense2csrByPercentage_bufferSizeExt", "rocsparse_sprune_dense2csr_by_percentage_buffer_size", "library"); + subst("cusparseSpruneDense2csrNnz", "rocsparse_sprune_dense2csr_nnz", "library"); subst("cusparseSpruneDense2csrNnzByPercentage", "rocsparse_sprune_dense2csr_nnz_by_percentage", "library"); + subst("cusparseSpruneDense2csr_bufferSizeExt", "rocsparse_sprune_dense2csr_buffer_size", "library"); subst("cusparseXcoo2csr", "rocsparse_coo2csr", "library"); subst("cusparseXcoosortByColumn", "rocsparse_coosort_by_column", "library"); subst("cusparseXcoosortByRow", "rocsparse_coosort_by_row", "library"); @@ -1834,6 +1841,7 @@ sub rocSubstitutions { subst("cusparseZcsr2hyb", "rocsparse_zcsr2hyb", "library"); subst("cusparseZcsrcolor", "rocsparse_zcsrcolor", "library"); subst("cusparseZdense2csc", "rocsparse_zdense2csc", "library"); + subst("cusparseZdense2csr", "rocsparse_zdense2csr", "library"); subst("cusparseZgebsr2csr", "rocsparse_zgebsr2csr", "library"); subst("cusparseZgebsr2gebsc", "rocsparse_zgebsr2gebsc", "library"); subst("cusparseZgebsr2gebsc_bufferSize", "rocsparse_zgebsr2gebsc_buffer_size", "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 17be3222..d0029f6d 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -635,7 +635,7 @@ |`cusparseCcsru2csr`| |12.2| |`hipsparseCcsru2csr`|4.2.0| | | | | | | | | |`cusparseCcsru2csr_bufferSizeExt`| |12.2| |`hipsparseCcsru2csr_bufferSizeExt`|4.2.0| | | | | | | | | |`cusparseCdense2csc`| |11.1|12.0|`hipsparseCdense2csc`|3.5.0| | | |`rocsparse_cdense2csc`|3.2.0| | | | -|`cusparseCdense2csr`| |11.1|12.0|`hipsparseCdense2csr`|3.5.0| | | | | | | | | +|`cusparseCdense2csr`| |11.1|12.0|`hipsparseCdense2csr`|3.5.0| | | |`rocsparse_cdense2csr`|3.2.0| | | | |`cusparseCdense2hyb`| |10.2|11.0| | | | | | | | | | | |`cusparseCgebsr2csr`| | | |`hipsparseCgebsr2csr`|4.1.0| | | |`rocsparse_cgebsr2csr`|3.10.0| | | | |`cusparseCgebsr2gebsc`| | | |`hipsparseCgebsr2gebsc`|4.1.0| | | |`rocsparse_cgebsr2gebsc`|4.1.0| | | | @@ -669,7 +669,7 @@ |`cusparseDcsru2csr`| |12.2| |`hipsparseDcsru2csr`|4.2.0| | | | | | | | | |`cusparseDcsru2csr_bufferSizeExt`| |12.2| |`hipsparseDcsru2csr_bufferSizeExt`|4.2.0| | | | | | | | | |`cusparseDdense2csc`| |11.1|12.0|`hipsparseDdense2csc`|3.5.0| | | |`rocsparse_ddense2csc`|3.2.0| | | | -|`cusparseDdense2csr`| |11.1|12.0|`hipsparseDdense2csr`|3.5.0| | | | | | | | | +|`cusparseDdense2csr`| |11.1|12.0|`hipsparseDdense2csr`|3.5.0| | | |`rocsparse_ddense2csr`|3.2.0| | | | |`cusparseDdense2hyb`| |10.2|11.0| | | | | | | | | | | |`cusparseDestroyCsru2csrInfo`| |12.2| |`hipsparseDestroyCsru2csrInfo`|4.2.0| | | | | | | | | |`cusparseDgebsr2csr`| | | |`hipsparseDgebsr2csr`|4.1.0| | | |`rocsparse_dgebsr2csr`|3.10.0| | | | @@ -693,9 +693,9 @@ |`cusparseDpruneDense2csr`|9.0|12.2| |`hipsparseDpruneDense2csr`|3.9.0| | | |`rocsparse_dprune_dense2csr`|3.9.0| | | | |`cusparseDpruneDense2csrByPercentage`|9.0|12.2| |`hipsparseDpruneDense2csrByPercentage`|3.9.0| | | |`rocsparse_dprune_dense2csr_by_percentage`|3.9.0| | | | |`cusparseDpruneDense2csrByPercentage_bufferSizeExt`|9.0|12.2| |`hipsparseDpruneDense2csrByPercentage_bufferSizeExt`|3.9.0| | | |`rocsparse_dprune_dense2csr_by_percentage_buffer_size`|3.9.0| | | | -|`cusparseDpruneDense2csrNnz`|9.0|12.2| |`hipsparseDpruneDense2csrNnz`|3.9.0| | | | | | | | | +|`cusparseDpruneDense2csrNnz`|9.0|12.2| |`hipsparseDpruneDense2csrNnz`|3.9.0| | | |`rocsparse_dprune_dense2csr_nnz`|3.9.0| | | | |`cusparseDpruneDense2csrNnzByPercentage`|9.0|12.2| |`hipsparseDpruneDense2csrNnzByPercentage`|3.9.0| | | |`rocsparse_dprune_dense2csr_nnz_by_percentage`|3.9.0| | | | -|`cusparseDpruneDense2csr_bufferSizeExt`|9.0|12.2| |`hipsparseDpruneDense2csr_bufferSizeExt`|3.9.0| | | | | | | | | +|`cusparseDpruneDense2csr_bufferSizeExt`|9.0|12.2| |`hipsparseDpruneDense2csr_bufferSizeExt`|3.9.0| | | |`rocsparse_dprune_dense2csr_buffer_size`|3.9.0| | | | |`cusparseHpruneCsr2csr`|9.0|12.2| | | | | | | | | | | | |`cusparseHpruneCsr2csrByPercentage`|9.0|12.2| | | | | | | | | | | | |`cusparseHpruneCsr2csrByPercentage_bufferSizeExt`|9.0|12.2| | | | | | | | | | | | @@ -723,7 +723,7 @@ |`cusparseScsru2csr`| |12.2| |`hipsparseScsru2csr`|4.2.0| | | | | | | | | |`cusparseScsru2csr_bufferSizeExt`| |12.2| |`hipsparseScsru2csr_bufferSizeExt`|4.2.0| | | | | | | | | |`cusparseSdense2csc`| |11.1|12.0|`hipsparseSdense2csc`|3.5.0| | | |`rocsparse_sdense2csc`|3.2.0| | | | -|`cusparseSdense2csr`| |11.1|12.0|`hipsparseSdense2csr`|3.5.0| | | | | | | | | +|`cusparseSdense2csr`| |11.1|12.0|`hipsparseSdense2csr`|3.5.0| | | |`rocsparse_sdense2csr`|3.2.0| | | | |`cusparseSdense2hyb`| |10.2|11.0| | | | | | | | | | | |`cusparseSgebsr2csr`| | | |`hipsparseSgebsr2csr`|4.1.0| | | |`rocsparse_sgebsr2csr`|3.10.0| | | | |`cusparseSgebsr2gebsc`| | | |`hipsparseSgebsr2gebsc`|4.1.0| | | |`rocsparse_sgebsr2gebsc`|4.1.0| | | | @@ -746,9 +746,9 @@ |`cusparseSpruneDense2csr`|9.0|12.2| |`hipsparseSpruneDense2csr`|3.9.0| | | |`rocsparse_sprune_dense2csr`|3.9.0| | | | |`cusparseSpruneDense2csrByPercentage`|9.0|12.2| |`hipsparseSpruneDense2csrByPercentage`|3.9.0| | | |`rocsparse_sprune_dense2csr_by_percentage`|3.9.0| | | | |`cusparseSpruneDense2csrByPercentage_bufferSizeExt`|9.0|12.2| |`hipsparseSpruneDense2csrByPercentage_bufferSizeExt`|3.9.0| | | |`rocsparse_sprune_dense2csr_by_percentage_buffer_size`|3.9.0| | | | -|`cusparseSpruneDense2csrNnz`|9.0|12.2| |`hipsparseSpruneDense2csrNnz`|3.9.0| | | | | | | | | +|`cusparseSpruneDense2csrNnz`|9.0|12.2| |`hipsparseSpruneDense2csrNnz`|3.9.0| | | |`rocsparse_sprune_dense2csr_nnz`|3.9.0| | | | |`cusparseSpruneDense2csrNnzByPercentage`|9.0|12.2| |`hipsparseSpruneDense2csrNnzByPercentage`|3.9.0| | | |`rocsparse_sprune_dense2csr_nnz_by_percentage`|3.9.0| | | | -|`cusparseSpruneDense2csr_bufferSizeExt`|9.0|12.2| |`hipsparseSpruneDense2csr_bufferSizeExt`|3.9.0| | | | | | | | | +|`cusparseSpruneDense2csr_bufferSizeExt`|9.0|12.2| |`hipsparseSpruneDense2csr_bufferSizeExt`|3.9.0| | | |`rocsparse_sprune_dense2csr_buffer_size`|3.9.0| | | | |`cusparseXcoo2csr`| | | |`hipsparseXcoo2csr`|1.9.2| | | |`rocsparse_coo2csr`|1.9.0| | | | |`cusparseXcoosortByColumn`| | | |`hipsparseXcoosortByColumn`|1.9.2| | | |`rocsparse_coosort_by_column`|1.9.0| | | | |`cusparseXcoosortByRow`| | | |`hipsparseXcoosortByRow`|1.9.2| | | |`rocsparse_coosort_by_row`|1.9.0| | | | @@ -777,7 +777,7 @@ |`cusparseZcsru2csr`| |12.2| |`hipsparseZcsru2csr`|4.2.0| | | | | | | | | |`cusparseZcsru2csr_bufferSizeExt`| |12.2| |`hipsparseZcsru2csr_bufferSizeExt`|4.2.0| | | | | | | | | |`cusparseZdense2csc`| |11.1|12.0|`hipsparseZdense2csc`|3.5.0| | | |`rocsparse_zdense2csc`|3.2.0| | | | -|`cusparseZdense2csr`| |11.1|12.0|`hipsparseZdense2csr`|3.5.0| | | | | | | | | +|`cusparseZdense2csr`| |11.1|12.0|`hipsparseZdense2csr`|3.5.0| | | |`rocsparse_zdense2csr`|3.2.0| | | | |`cusparseZdense2hyb`| |10.2|11.0| | | | | | | | | | | |`cusparseZgebsr2csr`| | | |`hipsparseZgebsr2csr`|4.1.0| | | |`rocsparse_zgebsr2csr`|3.10.0| | | | |`cusparseZgebsr2gebsc`| | | |`hipsparseZgebsr2gebsc`|4.1.0| | | |`rocsparse_zgebsr2gebsc`|4.1.0| | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index e38c41db..38596ee7 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -635,7 +635,7 @@ |`cusparseCcsru2csr`| |12.2| | | | | | | |`cusparseCcsru2csr_bufferSizeExt`| |12.2| | | | | | | |`cusparseCdense2csc`| |11.1|12.0|`rocsparse_cdense2csc`|3.2.0| | | | -|`cusparseCdense2csr`| |11.1|12.0| | | | | | +|`cusparseCdense2csr`| |11.1|12.0|`rocsparse_cdense2csr`|3.2.0| | | | |`cusparseCdense2hyb`| |10.2|11.0| | | | | | |`cusparseCgebsr2csr`| | | |`rocsparse_cgebsr2csr`|3.10.0| | | | |`cusparseCgebsr2gebsc`| | | |`rocsparse_cgebsr2gebsc`|4.1.0| | | | @@ -669,7 +669,7 @@ |`cusparseDcsru2csr`| |12.2| | | | | | | |`cusparseDcsru2csr_bufferSizeExt`| |12.2| | | | | | | |`cusparseDdense2csc`| |11.1|12.0|`rocsparse_ddense2csc`|3.2.0| | | | -|`cusparseDdense2csr`| |11.1|12.0| | | | | | +|`cusparseDdense2csr`| |11.1|12.0|`rocsparse_ddense2csr`|3.2.0| | | | |`cusparseDdense2hyb`| |10.2|11.0| | | | | | |`cusparseDestroyCsru2csrInfo`| |12.2| | | | | | | |`cusparseDgebsr2csr`| | | |`rocsparse_dgebsr2csr`|3.10.0| | | | @@ -693,9 +693,9 @@ |`cusparseDpruneDense2csr`|9.0|12.2| |`rocsparse_dprune_dense2csr`|3.9.0| | | | |`cusparseDpruneDense2csrByPercentage`|9.0|12.2| |`rocsparse_dprune_dense2csr_by_percentage`|3.9.0| | | | |`cusparseDpruneDense2csrByPercentage_bufferSizeExt`|9.0|12.2| |`rocsparse_dprune_dense2csr_by_percentage_buffer_size`|3.9.0| | | | -|`cusparseDpruneDense2csrNnz`|9.0|12.2| | | | | | | +|`cusparseDpruneDense2csrNnz`|9.0|12.2| |`rocsparse_dprune_dense2csr_nnz`|3.9.0| | | | |`cusparseDpruneDense2csrNnzByPercentage`|9.0|12.2| |`rocsparse_dprune_dense2csr_nnz_by_percentage`|3.9.0| | | | -|`cusparseDpruneDense2csr_bufferSizeExt`|9.0|12.2| | | | | | | +|`cusparseDpruneDense2csr_bufferSizeExt`|9.0|12.2| |`rocsparse_dprune_dense2csr_buffer_size`|3.9.0| | | | |`cusparseHpruneCsr2csr`|9.0|12.2| | | | | | | |`cusparseHpruneCsr2csrByPercentage`|9.0|12.2| | | | | | | |`cusparseHpruneCsr2csrByPercentage_bufferSizeExt`|9.0|12.2| | | | | | | @@ -723,7 +723,7 @@ |`cusparseScsru2csr`| |12.2| | | | | | | |`cusparseScsru2csr_bufferSizeExt`| |12.2| | | | | | | |`cusparseSdense2csc`| |11.1|12.0|`rocsparse_sdense2csc`|3.2.0| | | | -|`cusparseSdense2csr`| |11.1|12.0| | | | | | +|`cusparseSdense2csr`| |11.1|12.0|`rocsparse_sdense2csr`|3.2.0| | | | |`cusparseSdense2hyb`| |10.2|11.0| | | | | | |`cusparseSgebsr2csr`| | | |`rocsparse_sgebsr2csr`|3.10.0| | | | |`cusparseSgebsr2gebsc`| | | |`rocsparse_sgebsr2gebsc`|4.1.0| | | | @@ -746,9 +746,9 @@ |`cusparseSpruneDense2csr`|9.0|12.2| |`rocsparse_sprune_dense2csr`|3.9.0| | | | |`cusparseSpruneDense2csrByPercentage`|9.0|12.2| |`rocsparse_sprune_dense2csr_by_percentage`|3.9.0| | | | |`cusparseSpruneDense2csrByPercentage_bufferSizeExt`|9.0|12.2| |`rocsparse_sprune_dense2csr_by_percentage_buffer_size`|3.9.0| | | | -|`cusparseSpruneDense2csrNnz`|9.0|12.2| | | | | | | +|`cusparseSpruneDense2csrNnz`|9.0|12.2| |`rocsparse_sprune_dense2csr_nnz`|3.9.0| | | | |`cusparseSpruneDense2csrNnzByPercentage`|9.0|12.2| |`rocsparse_sprune_dense2csr_nnz_by_percentage`|3.9.0| | | | -|`cusparseSpruneDense2csr_bufferSizeExt`|9.0|12.2| | | | | | | +|`cusparseSpruneDense2csr_bufferSizeExt`|9.0|12.2| |`rocsparse_sprune_dense2csr_buffer_size`|3.9.0| | | | |`cusparseXcoo2csr`| | | |`rocsparse_coo2csr`|1.9.0| | | | |`cusparseXcoosortByColumn`| | | |`rocsparse_coosort_by_column`|1.9.0| | | | |`cusparseXcoosortByRow`| | | |`rocsparse_coosort_by_row`|1.9.0| | | | @@ -777,7 +777,7 @@ |`cusparseZcsru2csr`| |12.2| | | | | | | |`cusparseZcsru2csr_bufferSizeExt`| |12.2| | | | | | | |`cusparseZdense2csc`| |11.1|12.0|`rocsparse_zdense2csc`|3.2.0| | | | -|`cusparseZdense2csr`| |11.1|12.0| | | | | | +|`cusparseZdense2csr`| |11.1|12.0|`rocsparse_zdense2csr`|3.2.0| | | | |`cusparseZdense2hyb`| |10.2|11.0| | | | | | |`cusparseZgebsr2csr`| | | |`rocsparse_zgebsr2csr`|3.10.0| | | | |`cusparseZgebsr2gebsc`| | | |`rocsparse_zgebsr2gebsc`|4.1.0| | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index ebc17d1a..80265336 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -600,10 +600,10 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseCdense2csc", {"hipsparseCdense2csc", "rocsparse_cdense2csc", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED | CUDA_REMOVED}}, {"cusparseZdense2csc", {"hipsparseZdense2csc", "rocsparse_zdense2csc", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseSdense2csr", {"hipsparseSdense2csr", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseDdense2csr", {"hipsparseDdense2csr", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseCdense2csr", {"hipsparseCdense2csr", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseZdense2csr", {"hipsparseZdense2csr", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, + {"cusparseSdense2csr", {"hipsparseSdense2csr", "rocsparse_sdense2csr", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED | CUDA_REMOVED}}, + {"cusparseDdense2csr", {"hipsparseDdense2csr", "rocsparse_ddense2csr", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED | CUDA_REMOVED}}, + {"cusparseCdense2csr", {"hipsparseCdense2csr", "rocsparse_cdense2csr", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED | CUDA_REMOVED}}, + {"cusparseZdense2csr", {"hipsparseZdense2csr", "rocsparse_zdense2csr", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED | CUDA_REMOVED}}, {"cusparseSdense2hyb", {"hipsparseSdense2hyb", "", CONV_LIB_FUNC, API_SPARSE, 14, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, {"cusparseDdense2hyb", {"hipsparseDdense2hyb", "", CONV_LIB_FUNC, API_SPARSE, 14, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, @@ -669,12 +669,12 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseDpruneDense2csr", {"hipsparseDpruneDense2csr", "rocsparse_dprune_dense2csr", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED}}, {"cusparseHpruneDense2csr_bufferSizeExt", {"hipsparseHpruneDense2csr_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 14, UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseSpruneDense2csr_bufferSizeExt", {"hipsparseSpruneDense2csr_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseDpruneDense2csr_bufferSizeExt", {"hipsparseDpruneDense2csr_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseSpruneDense2csr_bufferSizeExt", {"hipsparseSpruneDense2csr_bufferSizeExt", "rocsparse_sprune_dense2csr_buffer_size", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED}}, + {"cusparseDpruneDense2csr_bufferSizeExt", {"hipsparseDpruneDense2csr_bufferSizeExt", "rocsparse_dprune_dense2csr_buffer_size", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED}}, {"cusparseHpruneDense2csrNnz", {"hipsparseHpruneDense2csrNnz", "", CONV_LIB_FUNC, API_SPARSE, 14, UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseSpruneDense2csrNnz", {"hipsparseSpruneDense2csrNnz", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseDpruneDense2csrNnz", {"hipsparseDpruneDense2csrNnz", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseSpruneDense2csrNnz", {"hipsparseSpruneDense2csrNnz", "rocsparse_sprune_dense2csr_nnz", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED}}, + {"cusparseDpruneDense2csrNnz", {"hipsparseDpruneDense2csrNnz", "rocsparse_dprune_dense2csr_nnz", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED}}, {"cusparseHpruneCsr2csr", {"hipsparseHpruneCsr2csr", "", CONV_LIB_FUNC, API_SPARSE, 14, UNSUPPORTED | CUDA_DEPRECATED}}, {"cusparseSpruneCsr2csr", {"hipsparseSpruneCsr2csr", "rocsparse_sprune_csr2csr", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED}}, @@ -2120,6 +2120,14 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_sprune_dense2csr_by_percentage_buffer_size", {HIP_3090, HIP_0, HIP_0 }}, {"rocsparse_dprune_dense2csr", {HIP_3090, HIP_0, HIP_0 }}, {"rocsparse_sprune_dense2csr", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_dprune_dense2csr_nnz", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_sprune_dense2csr_nnz", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_dprune_dense2csr_buffer_size", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_sprune_dense2csr_buffer_size", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_zdense2csr", {HIP_3020, HIP_0, HIP_0 }}, + {"rocsparse_cdense2csr", {HIP_3020, HIP_0, HIP_0 }}, + {"rocsparse_ddense2csr", {HIP_3020, HIP_0, HIP_0 }}, + {"rocsparse_sdense2csr", {HIP_3020, 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 07c4d4c5..d4c0f000 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -755,6 +755,26 @@ int main() { // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpruneDense2csr(hipsparseHandle_t handle, int m, int n, const float* A, int lda, const float* threshold, const hipsparseMatDescr_t descr, float* csrVal, const int* csrRowPtr, int* csrColInd, void* buffer); // CHECK: status_t = hipsparseSpruneDense2csr(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &fcsrSortedValC, &csrRowPtrC, &csrColIndC, pBuffer); status_t = cusparseSpruneDense2csr(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &fcsrSortedValC, &csrRowPtrC, &csrColIndC, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDpruneDense2csrNnz(cusparseHandle_t handle, int m, int n, const double* A, int lda, const double* threshold, const cusparseMatDescr_t descrC, int* csrSortedRowPtrC, int* nnzTotalDevHostPtr, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDpruneDense2csrNnz(hipsparseHandle_t handle, int m, int n, const double* A, int lda, const double* threshold, const hipsparseMatDescr_t descr, int* csrRowPtr, int* nnzTotalDevHostPtr, void* buffer); + // CHECK: status_t = hipsparseDpruneDense2csrNnz(handle_t, m, n, &dA, lda, &dthreshold, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, pBuffer); + status_t = cusparseDpruneDense2csrNnz(handle_t, m, n, &dA, lda, &dthreshold, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSpruneDense2csrNnz(cusparseHandle_t handle, int m, int n, const float* A, int lda, const float* threshold, const cusparseMatDescr_t descrC, int* csrRowPtrC, int* nnzTotalDevHostPtr, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpruneDense2csrNnz(hipsparseHandle_t handle, int m, int n, const float* A, int lda, const float* threshold, const hipsparseMatDescr_t descr, int* csrRowPtr, int* nnzTotalDevHostPtr, void* buffer); + // CHECK: status_t = hipsparseSpruneDense2csrNnz(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, pBuffer); + status_t = cusparseSpruneDense2csrNnz(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDpruneDense2csr_bufferSizeExt(cusparseHandle_t handle, int m, int n, const double* A, int lda, const double* threshold, const cusparseMatDescr_t descrC, const double* csrSortedValC, const int* csrSortedRowPtrC, const int* csrSortedColIndC, size_t* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDpruneDense2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const double* A, int lda, const double* threshold, const hipsparseMatDescr_t descr, const double* csrVal, const int* csrRowPtr, const int* csrColInd, size_t* bufferSize); + // CHECK: status_t = hipsparseDpruneDense2csr_bufferSizeExt(handle_t, m, n, &dA, lda, &dthreshold, matDescr_C, &dcsrSortedValC, &csrRowPtrC, &csrColIndC, &bufferSize); + status_t = cusparseDpruneDense2csr_bufferSizeExt(handle_t, m, n, &dA, lda, &dthreshold, matDescr_C, &dcsrSortedValC, &csrRowPtrC, &csrColIndC, &bufferSize); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSpruneDense2csr_bufferSizeExt(cusparseHandle_t handle, int m, int n, const float* A, int lda, const float* threshold, const cusparseMatDescr_t descrC, const float* csrSortedValC, const int* csrSortedRowPtrC, const int* csrSortedColIndC, size_t* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpruneDense2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const float* A, int lda, const float* threshold, const hipsparseMatDescr_t descr,const float* csrVal, const int* csrRowPtr, const int* csrColInd, size_t* bufferSize); + // CHECK: status_t = hipsparseSpruneDense2csr_bufferSizeExt(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &fcsrSortedValC, &csrRowPtrC, &csrColIndC, &bufferSize); + status_t = cusparseSpruneDense2csr_bufferSizeExt(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &fcsrSortedValC, &csrRowPtrC, &csrColIndC, &bufferSize); #endif #if CUDA_VERSION >= 10010 @@ -1345,6 +1365,26 @@ int main() { // HIP: DEPRECATED_CUDA_11000("The routine will be removed in CUDA 12") HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSdense2csc(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const float* A, int ld, const int* nnz_per_columns, float* csc_val, int* csc_row_ind, int* csc_col_ptr); // CHECK: status_t = hipsparseSdense2csc(handle_t, m, n, matDescr_A, &fA, lda, &nnzPerCol, &cscSortedVal, &csrSortedRowPtr, &csrSortedColInd); status_t = cusparseSdense2csc(handle_t, m, n, matDescr_A, &fA, lda, &nnzPerCol, &cscSortedVal, &csrSortedRowPtr, &csrSortedColInd); + + // CUDA: CUSPARSE_DEPRECATED(cusparseDenseToSparse) cusparseStatus_t CUSPARSEAPI cusparseZdense2csr(cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, const cuDoubleComplex* A, int lda, const int* nnzPerRow, cuDoubleComplex* csrSortedValA, int* csrSortedRowPtrA, int* csrSortedColIndA); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZdense2csr(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipDoubleComplex* A, int ld, const int* nnz_per_rows, hipDoubleComplex* csr_val, int* csr_row_ptr, int* csr_col_ind); + // CHECK: status_t = hipsparseZdense2csr(handle_t, m, n, matDescr_A, &dcomplexA, lda, &nnzPerRow, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA); + status_t = cusparseZdense2csr(handle_t, m, n, matDescr_A, &dcomplexA, lda, &nnzPerRow, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA); + + // CUDA: CUSPARSE_DEPRECATED(cusparseDenseToSparse) cusparseStatus_t CUSPARSEAPI cusparseCdense2csr(cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, const cuComplex* A, int lda, const int* nnzPerRow, cuComplex* csrSortedValA, int* csrSortedRowPtrA, int* csrSortedColIndA); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCdense2csr(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipComplex* A, int ld, const int* nnz_per_rows, hipComplex* csr_val, int* csr_row_ptr, int* csr_col_ind); + // CHECK: status_t = hipsparseCdense2csr(handle_t, m, n, matDescr_A, &complexA, lda, &nnzPerRow, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA); + status_t = cusparseCdense2csr(handle_t, m, n, matDescr_A, &complexA, lda, &nnzPerRow, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA); + + // CUDA: CUSPARSE_DEPRECATED(cusparseDenseToSparse) cusparseStatus_t CUSPARSEAPI cusparseDdense2csr(cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, const double* A, int lda, const int* nnzPerRow, double* csrSortedValA, int* csrSortedRowPtrA, int* csrSortedColIndA); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDdense2csr(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const double* A, int ld, const int* nnz_per_rows, double* csr_val, int* csr_row_ptr, int* csr_col_ind); + // CHECK: status_t = hipsparseDdense2csr(handle_t, m, n, matDescr_A, &dA, lda, &nnzPerRow, &dcsrSortedValA, &csrRowPtrA, &csrColIndA); + status_t = cusparseDdense2csr(handle_t, m, n, matDescr_A, &dA, lda, &nnzPerRow, &dcsrSortedValA, &csrRowPtrA, &csrColIndA); + + // CUDA: CUSPARSE_DEPRECATED(cusparseDenseToSparse) cusparseStatus_t CUSPARSEAPI cusparseSdense2csr(cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, const float* A, int lda, const int* nnzPerRow, float* csrSortedValA, int* csrSortedRowPtrA, int* csrSortedColIndA); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSdense2csr(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const float* A, int ld, const int* nnz_per_rows, float* csr_val, int* csr_row_ptr, int* csr_col_ind); + // CHECK: status_t = hipsparseSdense2csr(handle_t, m, n, matDescr_A, &fA, lda, &nnzPerRow, &csrSortedValA, &csrRowPtrA, &csrColIndA); + status_t = cusparseSdense2csr(handle_t, m, n, matDescr_A, &fA, lda, &nnzPerRow, &csrSortedValA, &csrRowPtrA, &csrColIndA); #endif #if CUDA_VERSION >= 12000 diff --git a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu index 103e2c73..dc0f7881 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -761,6 +761,26 @@ int main() { // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sprune_dense2csr(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const float* A, rocsparse_int lda, const float* threshold, const rocsparse_mat_descr descr, float* csr_val, const rocsparse_int* csr_row_ptr, rocsparse_int* csr_col_ind, void* temp_buffer); // CHECK: status_t = rocsparse_sprune_dense2csr(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &fcsrSortedValC, &csrRowPtrC, &csrColIndC, pBuffer); status_t = cusparseSpruneDense2csr(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &fcsrSortedValC, &csrRowPtrC, &csrColIndC, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDpruneDense2csrNnz(cusparseHandle_t handle, int m, int n, const double* A, int lda, const double* threshold, const cusparseMatDescr_t descrC, int* csrSortedRowPtrC, int* nnzTotalDevHostPtr, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dprune_dense2csr_nnz(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const double* A, rocsparse_int lda, const double* threshold, const rocsparse_mat_descr descr, rocsparse_int* csr_row_ptr, rocsparse_int* nnz_total_dev_host_ptr, void* temp_buffer); + // CHECK: status_t = rocsparse_dprune_dense2csr_nnz(handle_t, m, n, &dA, lda, &dthreshold, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, pBuffer); + status_t = cusparseDpruneDense2csrNnz(handle_t, m, n, &dA, lda, &dthreshold, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSpruneDense2csrNnz(cusparseHandle_t handle, int m, int n, const float* A, int lda, const float* threshold, const cusparseMatDescr_t descrC, int* csrRowPtrC, int* nnzTotalDevHostPtr, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sprune_dense2csr_nnz(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const float* A, rocsparse_int lda, const float* threshold, const rocsparse_mat_descr descr, rocsparse_int* csr_row_ptr, rocsparse_int* nnz_total_dev_host_ptr, void* temp_buffer); + // CHECK: status_t = rocsparse_sprune_dense2csr_nnz(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, pBuffer); + status_t = cusparseSpruneDense2csrNnz(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &csrRowPtrC, &nnzTotalDevHostPtr, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDpruneDense2csr_bufferSizeExt(cusparseHandle_t handle, int m, int n, const double* A, int lda, const double* threshold, const cusparseMatDescr_t descrC, const double* csrSortedValC, const int* csrSortedRowPtrC, const int* csrSortedColIndC, size_t* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dprune_dense2csr_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const double* A, rocsparse_int lda, const double* threshold, const rocsparse_mat_descr descr, const double* csr_val, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, size_t* buffer_size); + // CHECK: status_t = rocsparse_dprune_dense2csr_buffer_size(handle_t, m, n, &dA, lda, &dthreshold, matDescr_C, &dcsrSortedValC, &csrRowPtrC, &csrColIndC, &bufferSize); + status_t = cusparseDpruneDense2csr_bufferSizeExt(handle_t, m, n, &dA, lda, &dthreshold, matDescr_C, &dcsrSortedValC, &csrRowPtrC, &csrColIndC, &bufferSize); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSpruneDense2csr_bufferSizeExt(cusparseHandle_t handle, int m, int n, const float* A, int lda, const float* threshold, const cusparseMatDescr_t descrC, const float* csrSortedValC, const int* csrSortedRowPtrC, const int* csrSortedColIndC, size_t* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sprune_dense2csr_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const float* A, rocsparse_int lda, const float* threshold, const rocsparse_mat_descr descr, const float* csr_val, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, size_t* buffer_size); + // CHECK: status_t = rocsparse_sprune_dense2csr_buffer_size(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &fcsrSortedValC, &csrRowPtrC, &csrColIndC, &bufferSize); + status_t = cusparseSpruneDense2csr_bufferSizeExt(handle_t, m, n, &fA, lda, &fthreshold, matDescr_C, &fcsrSortedValC, &csrRowPtrC, &csrColIndC, &bufferSize); #endif #if (CUDA_VERSION >= 10010 && CUDA_VERSION < 11000 && !defined(_WIN32)) || CUDA_VERSION >= 11000 @@ -1275,6 +1295,26 @@ int main() { // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sdense2csc(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_mat_descr descr, const float* A, rocsparse_int ld, const rocsparse_int* nnz_per_columns, float* csc_val, rocsparse_int* csc_col_ptr, rocsparse_int* csc_row_ind); // CHECK: status_t = rocsparse_sdense2csc(handle_t, m, n, matDescr_A, &fA, lda, &nnzPerCol, &cscSortedVal, &csrSortedRowPtr, &csrSortedColInd); status_t = cusparseSdense2csc(handle_t, m, n, matDescr_A, &fA, lda, &nnzPerCol, &cscSortedVal, &csrSortedRowPtr, &csrSortedColInd); + + // CUDA: CUSPARSE_DEPRECATED(cusparseDenseToSparse) cusparseStatus_t CUSPARSEAPI cusparseZdense2csr(cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, const cuDoubleComplex* A, int lda, const int* nnzPerRow, cuDoubleComplex* csrSortedValA, int* csrSortedRowPtrA, int* csrSortedColIndA); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zdense2csr(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_mat_descr descr, const rocsparse_double_complex* A, rocsparse_int ld, const rocsparse_int* nnz_per_rows, rocsparse_double_complex* csr_val, rocsparse_int* csr_row_ptr, rocsparse_int* csr_col_ind); + // CHECK: status_t = rocsparse_zdense2csr(handle_t, m, n, matDescr_A, &dcomplexA, lda, &nnzPerRow, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA); + status_t = cusparseZdense2csr(handle_t, m, n, matDescr_A, &dcomplexA, lda, &nnzPerRow, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA); + + // CUDA: CUSPARSE_DEPRECATED(cusparseDenseToSparse) cusparseStatus_t CUSPARSEAPI cusparseCdense2csr(cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, const cuComplex* A, int lda, const int* nnzPerRow, cuComplex* csrSortedValA, int* csrSortedRowPtrA, int* csrSortedColIndA); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cdense2csr(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_mat_descr descr, const rocsparse_float_complex* A, rocsparse_int ld, const rocsparse_int* nnz_per_rows, rocsparse_float_complex* csr_val, rocsparse_int* csr_row_ptr, rocsparse_int* csr_col_ind); + // CHECK: status_t = rocsparse_cdense2csr(handle_t, m, n, matDescr_A, &complexA, lda, &nnzPerRow, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA); + status_t = cusparseCdense2csr(handle_t, m, n, matDescr_A, &complexA, lda, &nnzPerRow, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA); + + // CUDA: CUSPARSE_DEPRECATED(cusparseDenseToSparse) cusparseStatus_t CUSPARSEAPI cusparseDdense2csr(cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, const double* A, int lda, const int* nnzPerRow, double* csrSortedValA, int* csrSortedRowPtrA, int* csrSortedColIndA); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_ddense2csr(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_mat_descr descr, const double* A, rocsparse_int ld, const rocsparse_int* nnz_per_rows, double* csr_val, rocsparse_int* csr_row_ptr, rocsparse_int* csr_col_ind); + // CHECK: status_t = rocsparse_ddense2csr(handle_t, m, n, matDescr_A, &dA, lda, &nnzPerRow, &dcsrSortedValA, &csrRowPtrA, &csrColIndA); + status_t = cusparseDdense2csr(handle_t, m, n, matDescr_A, &dA, lda, &nnzPerRow, &dcsrSortedValA, &csrRowPtrA, &csrColIndA); + + // CUDA: CUSPARSE_DEPRECATED(cusparseDenseToSparse) cusparseStatus_t CUSPARSEAPI cusparseSdense2csr(cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, const float* A, int lda, const int* nnzPerRow, float* csrSortedValA, int* csrSortedRowPtrA, int* csrSortedColIndA); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sdense2csr(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, const rocsparse_mat_descr descr, const float* A, rocsparse_int ld, const rocsparse_int* nnz_per_rows, float* csr_val, rocsparse_int* csr_row_ptr, rocsparse_int* csr_col_ind); + // CHECK: status_t = rocsparse_sdense2csr(handle_t, m, n, matDescr_A, &fA, lda, &nnzPerRow, &csrSortedValA, &csrRowPtrA, &csrColIndA); + status_t = cusparseSdense2csr(handle_t, m, n, matDescr_A, &fA, lda, &nnzPerRow, &csrSortedValA, &csrRowPtrA, &csrColIndA); #endif #if CUDA_VERSION >= 12010 && CUSPARSE_VERSION >= 12100