Skip to content

Commit

Permalink
[HIPIFY][ROCm#674][rocSPARSE][feature] rocSPARSE support - Step 31 - …
Browse files Browse the repository at this point in the history
…functions

+ Updated synthetic tests and the regenerated hipify-perl and SPARSE docs
  • Loading branch information
emankov committed Aug 25, 2023
1 parent 0d58bf3 commit 17e440f
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 17 deletions.
4 changes: 4 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,7 @@ sub rocSubstitutions {
subst("cusparseCgebsr2gebsc_bufferSize", "rocsparse_cgebsr2gebsc_buffer_size", "library");
subst("cusparseCgebsr2gebsr", "rocsparse_cgebsr2gebsr", "library");
subst("cusparseCgebsr2gebsr_bufferSize", "rocsparse_cgebsr2gebsr_buffer_size", "library");
subst("cusparseCnnz", "rocsparse_cnnz", "library");
subst("cusparseCnnz_compress", "rocsparse_cnnz_compress", "library");
subst("cusparseCooAoSGet", "rocsparse_coo_aos_get", "library");
subst("cusparseCooGet", "rocsparse_coo_get", "library");
Expand Down Expand Up @@ -1744,6 +1745,7 @@ sub rocSubstitutions {
subst("cusparseDnVecGet", "rocsparse_dnvec_get", "library");
subst("cusparseDnVecGetValues", "rocsparse_dnvec_get_values", "library");
subst("cusparseDnVecSetValues", "rocsparse_dnvec_set_values", "library");
subst("cusparseDnnz", "rocsparse_dnnz", "library");
subst("cusparseDnnz_compress", "rocsparse_dnnz_compress", "library");
subst("cusparseDpruneCsr2csr", "rocsparse_dprune_csr2csr", "library");
subst("cusparseDpruneCsr2csrByPercentage", "rocsparse_dprune_csr2csr_by_percentage", "library");
Expand Down Expand Up @@ -1792,6 +1794,7 @@ sub rocSubstitutions {
subst("cusparseSgebsr2gebsc_bufferSize", "rocsparse_sgebsr2gebsc_buffer_size", "library");
subst("cusparseSgebsr2gebsr", "rocsparse_sgebsr2gebsr", "library");
subst("cusparseSgebsr2gebsr_bufferSize", "rocsparse_sgebsr2gebsr_buffer_size", "library");
subst("cusparseSnnz", "rocsparse_snnz", "library");
subst("cusparseSnnz_compress", "rocsparse_snnz_compress", "library");
subst("cusparseSpMV", "rocsparse_spmv", "library");
subst("cusparseSpMatGetAttribute", "rocsparse_spmat_get_attribute", "library");
Expand Down Expand Up @@ -1847,6 +1850,7 @@ sub rocSubstitutions {
subst("cusparseZgebsr2gebsc_bufferSize", "rocsparse_zgebsr2gebsc_buffer_size", "library");
subst("cusparseZgebsr2gebsr", "rocsparse_zgebsr2gebsr", "library");
subst("cusparseZgebsr2gebsr_bufferSize", "rocsparse_zgebsr2gebsr_buffer_size", "library");
subst("cusparseZnnz", "rocsparse_znnz", "library");
subst("cusparseZnnz_compress", "rocsparse_znnz_compress", "library");
subst("cublas.h", "rocblas.h", "include_cuda_main_header");
subst("cublas_v2.h", "rocblas.h", "include_cuda_main_header_v2");
Expand Down
8 changes: 4 additions & 4 deletions docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
|`cusparseChyb2csc`| |10.2|11.0| | | | | | | | | | |
|`cusparseChyb2csr`| |10.2|11.0|`hipsparseChyb2csr`|3.1.0| | | | | | | | |
|`cusparseChyb2dense`| |10.2|11.0| | | | | | | | | | |
|`cusparseCnnz`| | | |`hipsparseCnnz`|3.2.0| | | | | | | | |
|`cusparseCnnz`| | | |`hipsparseCnnz`|3.2.0| | | |`rocsparse_cnnz`|3.2.0| | | |
|`cusparseCnnz_compress`|8.0|12.2| |`hipsparseCnnz_compress`|3.5.0| | | |`rocsparse_cnnz_compress`|3.5.0| | | |
|`cusparseCreateCsru2csrInfo`| |12.2| |`hipsparseCreateCsru2csrInfo`|4.2.0| | | | | | | | |
|`cusparseCreateIdentityPermutation`| |12.2| |`hipsparseCreateIdentityPermutation`|1.9.2| | | |`rocsparse_create_identity_permutation`|1.9.0| | | |
Expand Down Expand Up @@ -682,7 +682,7 @@
|`cusparseDhyb2csc`| |10.2|11.0| | | | | | | | | | |
|`cusparseDhyb2csr`| |10.2|11.0|`hipsparseDhyb2csr`|3.1.0| | | | | | | | |
|`cusparseDhyb2dense`| |10.2|11.0| | | | | | | | | | |
|`cusparseDnnz`| | | |`hipsparseDnnz`|3.2.0| | | | | | | | |
|`cusparseDnnz`| | | |`hipsparseDnnz`|3.2.0| | | |`rocsparse_dnnz`|3.2.0| | | |
|`cusparseDnnz_compress`|8.0|12.2| |`hipsparseDnnz_compress`|3.5.0| | | |`rocsparse_dnnz_compress`|3.5.0| | | |
|`cusparseDpruneCsr2csr`|9.0|12.2| |`hipsparseDpruneCsr2csr`|3.9.0| | | |`rocsparse_dprune_csr2csr`|3.9.0| | | |
|`cusparseDpruneCsr2csrByPercentage`|9.0|12.2| |`hipsparseDpruneCsr2csrByPercentage`|3.9.0| | | |`rocsparse_dprune_csr2csr_by_percentage`|3.9.0| | | |
Expand Down Expand Up @@ -735,7 +735,7 @@
|`cusparseShyb2csc`| |10.2|11.0| | | | | | | | | | |
|`cusparseShyb2csr`| |10.2|11.0|`hipsparseShyb2csr`|3.1.0| | | | | | | | |
|`cusparseShyb2dense`| |10.2|11.0| | | | | | | | | | |
|`cusparseSnnz`| | | |`hipsparseSnnz`|3.2.0| | | | | | | | |
|`cusparseSnnz`| | | |`hipsparseSnnz`|3.2.0| | | |`rocsparse_snnz`|3.2.0| | | |
|`cusparseSnnz_compress`|8.0|12.2| |`hipsparseSnnz_compress`|3.5.0| | | |`rocsparse_snnz_compress`|3.5.0| | | |
|`cusparseSpruneCsr2csr`|9.0|12.2| |`hipsparseSpruneCsr2csr`|3.9.0| | | |`rocsparse_sprune_csr2csr`|3.9.0| | | |
|`cusparseSpruneCsr2csrByPercentage`|9.0|12.2| |`hipsparseSpruneCsr2csrByPercentage`|3.9.0| | | |`rocsparse_sprune_csr2csr_by_percentage`|3.9.0| | | |
Expand Down Expand Up @@ -789,7 +789,7 @@
|`cusparseZhyb2csc`| |10.2|11.0| | | | | | | | | | |
|`cusparseZhyb2csr`| |10.2|11.0|`hipsparseZhyb2csr`|3.1.0| | | | | | | | |
|`cusparseZhyb2dense`| |10.2|11.0| | | | | | | | | | |
|`cusparseZnnz`| | | |`hipsparseZnnz`|3.2.0| | | | | | | | |
|`cusparseZnnz`| | | |`hipsparseZnnz`|3.2.0| | | |`rocsparse_znnz`|3.2.0| | | |
|`cusparseZnnz_compress`|8.0|12.2| |`hipsparseZnnz_compress`|3.5.0| | | |`rocsparse_znnz_compress`|3.5.0| | | |

## **15. CUSPARSE Generic API Reference**
Expand Down
8 changes: 4 additions & 4 deletions docs/tables/CUSPARSE_API_supported_by_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
|`cusparseChyb2csc`| |10.2|11.0| | | | | |
|`cusparseChyb2csr`| |10.2|11.0| | | | | |
|`cusparseChyb2dense`| |10.2|11.0| | | | | |
|`cusparseCnnz`| | | | | | | | |
|`cusparseCnnz`| | | |`rocsparse_cnnz`|3.2.0| | | |
|`cusparseCnnz_compress`|8.0|12.2| |`rocsparse_cnnz_compress`|3.5.0| | | |
|`cusparseCreateCsru2csrInfo`| |12.2| | | | | | |
|`cusparseCreateIdentityPermutation`| |12.2| |`rocsparse_create_identity_permutation`|1.9.0| | | |
Expand Down Expand Up @@ -682,7 +682,7 @@
|`cusparseDhyb2csc`| |10.2|11.0| | | | | |
|`cusparseDhyb2csr`| |10.2|11.0| | | | | |
|`cusparseDhyb2dense`| |10.2|11.0| | | | | |
|`cusparseDnnz`| | | | | | | | |
|`cusparseDnnz`| | | |`rocsparse_dnnz`|3.2.0| | | |
|`cusparseDnnz_compress`|8.0|12.2| |`rocsparse_dnnz_compress`|3.5.0| | | |
|`cusparseDpruneCsr2csr`|9.0|12.2| |`rocsparse_dprune_csr2csr`|3.9.0| | | |
|`cusparseDpruneCsr2csrByPercentage`|9.0|12.2| |`rocsparse_dprune_csr2csr_by_percentage`|3.9.0| | | |
Expand Down Expand Up @@ -735,7 +735,7 @@
|`cusparseShyb2csc`| |10.2|11.0| | | | | |
|`cusparseShyb2csr`| |10.2|11.0| | | | | |
|`cusparseShyb2dense`| |10.2|11.0| | | | | |
|`cusparseSnnz`| | | | | | | | |
|`cusparseSnnz`| | | |`rocsparse_snnz`|3.2.0| | | |
|`cusparseSnnz_compress`|8.0|12.2| |`rocsparse_snnz_compress`|3.5.0| | | |
|`cusparseSpruneCsr2csr`|9.0|12.2| |`rocsparse_sprune_csr2csr`|3.9.0| | | |
|`cusparseSpruneCsr2csrByPercentage`|9.0|12.2| |`rocsparse_sprune_csr2csr_by_percentage`|3.9.0| | | |
Expand Down Expand Up @@ -789,7 +789,7 @@
|`cusparseZhyb2csc`| |10.2|11.0| | | | | |
|`cusparseZhyb2csr`| |10.2|11.0| | | | | |
|`cusparseZhyb2dense`| |10.2|11.0| | | | | |
|`cusparseZnnz`| | | | | | | | |
|`cusparseZnnz`| | | |`rocsparse_znnz`|3.2.0| | | |
|`cusparseZnnz_compress`|8.0|12.2| |`rocsparse_znnz_compress`|3.5.0| | | |

## **15. CUSPARSE Generic API Reference**
Expand Down
13 changes: 9 additions & 4 deletions src/CUDA2HIP_SPARSE_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
{"cusparseCgpsvInterleavedBatch_bufferSizeExt", {"hipsparseCgpsvInterleavedBatch_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}},
{"cusparseZgpsvInterleavedBatch_bufferSizeExt", {"hipsparseZgpsvInterleavedBatch_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}},

// NOTE: rocsparse_(s|d|c|z)gpsv_interleaved_batch have an additional parameter rocsparse_int batch_stride
{"cusparseSgpsvInterleavedBatch", {"hipsparseSgpsvInterleavedBatch", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}},
{"cusparseDgpsvInterleavedBatch", {"hipsparseDgpsvInterleavedBatch", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}},
{"cusparseCgpsvInterleavedBatch", {"hipsparseCgpsvInterleavedBatch", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED}},
Expand Down Expand Up @@ -629,10 +630,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
{"cusparseChyb2dense", {"hipsparseChyb2dense", "", CONV_LIB_FUNC, API_SPARSE, 14, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}},
{"cusparseZhyb2dense", {"hipsparseZhyb2dense", "", CONV_LIB_FUNC, API_SPARSE, 14, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}},

{"cusparseSnnz", {"hipsparseSnnz", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}},
{"cusparseDnnz", {"hipsparseDnnz", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}},
{"cusparseCnnz", {"hipsparseCnnz", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}},
{"cusparseZnnz", {"hipsparseZnnz", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}},
{"cusparseSnnz", {"hipsparseSnnz", "rocsparse_snnz", CONV_LIB_FUNC, API_SPARSE, 14}},
{"cusparseDnnz", {"hipsparseDnnz", "rocsparse_dnnz", CONV_LIB_FUNC, API_SPARSE, 14}},
{"cusparseCnnz", {"hipsparseCnnz", "rocsparse_cnnz", CONV_LIB_FUNC, API_SPARSE, 14}},
{"cusparseZnnz", {"hipsparseZnnz", "rocsparse_znnz", CONV_LIB_FUNC, API_SPARSE, 14}},

{"cusparseCreateIdentityPermutation", {"hipsparseCreateIdentityPermutation", "rocsparse_create_identity_permutation", CONV_LIB_FUNC, API_SPARSE, 14, CUDA_DEPRECATED}},

Expand Down Expand Up @@ -2128,6 +2129,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SPARSE_FUNCTION_VER_MAP {
{"rocsparse_cdense2csr", {HIP_3020, HIP_0, HIP_0 }},
{"rocsparse_ddense2csr", {HIP_3020, HIP_0, HIP_0 }},
{"rocsparse_sdense2csr", {HIP_3020, HIP_0, HIP_0 }},
{"rocsparse_znnz", {HIP_3020, HIP_0, HIP_0 }},
{"rocsparse_cnnz", {HIP_3020, HIP_0, HIP_0 }},
{"rocsparse_dnnz", {HIP_3020, HIP_0, HIP_0 }},
{"rocsparse_snnz", {HIP_3020, HIP_0, HIP_0 }},
};

const std::map<unsigned int, llvm::StringRef> CUDA_SPARSE_API_SECTION_MAP {
Expand Down
Loading

0 comments on commit 17e440f

Please sign in to comment.