Skip to content

Commit

Permalink
[HIPIFY][6.0.0][hipSPARSE] Support for ROCm HIP 6.0.0 - Step 23 - hip…
Browse files Browse the repository at this point in the history
…SPARSE

+ Updated synthetic tests and the regenerated hipify-perl and SPARSE docs

[TODO]
+ Mark as `C` `cusparseDestroySpMat`
  • Loading branch information
emankov committed Oct 24, 2023
1 parent 322f263 commit e380780
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 28 deletions.
14 changes: 7 additions & 7 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -3597,6 +3597,8 @@ sub simpleSubstitutions {
subst("cusparseChybmv", "hipsparseChybmv", "library");
subst("cusparseCnnz", "hipsparseCnnz", "library");
subst("cusparseCnnz_compress", "hipsparseCnnz_compress", "library");
subst("cusparseConstCooGet", "hipsparseConstCooGet", "library");
subst("cusparseConstCsrGet", "hipsparseConstCsrGet", "library");
subst("cusparseConstSpVecGet", "hipsparseConstSpVecGet", "library");
subst("cusparseConstSpVecGetValues", "hipsparseConstSpVecGetValues", "library");
subst("cusparseCooAoSGet", "hipsparseCooAoSGet", "library");
Expand All @@ -3611,6 +3613,10 @@ sub simpleSubstitutions {
subst("cusparseCreateBsrsm2Info", "hipsparseCreateBsrsm2Info", "library");
subst("cusparseCreateBsrsv2Info", "hipsparseCreateBsrsv2Info", "library");
subst("cusparseCreateColorInfo", "hipsparseCreateColorInfo", "library");
subst("cusparseCreateConstBlockedEll", "hipsparseCreateConstBlockedEll", "library");
subst("cusparseCreateConstCoo", "hipsparseCreateConstCoo", "library");
subst("cusparseCreateConstCsc", "hipsparseCreateConstCsc", "library");
subst("cusparseCreateConstCsr", "hipsparseCreateConstCsr", "library");
subst("cusparseCreateConstSpVec", "hipsparseCreateConstSpVec", "library");
subst("cusparseCreateCoo", "hipsparseCreateCoo", "library");
subst("cusparseCreateCooAoS", "hipsparseCreateCooAoS", "library");
Expand Down Expand Up @@ -4548,6 +4554,7 @@ sub simpleSubstitutions {
subst("curandStatus_t", "hiprandStatus_t", "type");
subst("cusparseAction_t", "hipsparseAction_t", "type");
subst("cusparseColorInfo_t", "hipsparseColorInfo_t", "type");
subst("cusparseConstSpMatDescr_t", "hipsparseConstSpMatDescr_t", "type");
subst("cusparseConstSpVecDescr_t", "hipsparseConstSpVecDescr_t", "type");
subst("cusparseCsr2CscAlg_t", "hipsparseCsr2CscAlg_t", "type");
subst("cusparseDenseToSparseAlg_t", "hipsparseDenseToSparseAlg_t", "type");
Expand Down Expand Up @@ -6902,26 +6909,19 @@ sub warnUnsupportedFunctions {
"cusparseCreateConstSlicedEll",
"cusparseCreateConstDnVec",
"cusparseCreateConstDnMat",
"cusparseCreateConstCsr",
"cusparseCreateConstCsc",
"cusparseCreateConstCoo",
"cusparseCreateConstBsr",
"cusparseCreateConstBlockedEll",
"cusparseCreateBsr",
"cusparseContext",
"cusparseConstrainedGeMM_bufferSize",
"cusparseConstrainedGeMM",
"cusparseConstSpMatGetValues",
"cusparseConstSpMatDescr_t",
"cusparseConstDnVecGetValues",
"cusparseConstDnVecGet",
"cusparseConstDnVecDescr_t",
"cusparseConstDnMatGetValues",
"cusparseConstDnMatGet",
"cusparseConstDnMatDescr_t",
"cusparseConstCsrGet",
"cusparseConstCscGet",
"cusparseConstCooGet",
"cusparseConstBlockedEllGet",
"cusparseColorInfo",
"cusparseColorAlg_t",
Expand Down
14 changes: 7 additions & 7 deletions docs/tables/CUSPARSE_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
|`cusparseColorInfo_t`| |12.2| |`hipsparseColorInfo_t`|4.5.0| | | | |
|`cusparseConstDnMatDescr_t`|12.0| | | | | | | | |
|`cusparseConstDnVecDescr_t`|12.0| | | | | | | | |
|`cusparseConstSpMatDescr_t`|12.0| | | | | | | | |
|`cusparseConstSpMatDescr_t`|12.0| | |`hipsparseConstSpMatDescr_t`|6.0.0| | | |6.0.0|
|`cusparseConstSpVecDescr_t`|12.0| | |`hipsparseConstSpVecDescr_t`|6.0.0| | | |6.0.0|
|`cusparseContext`| | | | | | | | | |
|`cusparseCsr2CscAlg_t`|10.1| | |`hipsparseCsr2CscAlg_t`|5.4.0| | | | |
Expand Down Expand Up @@ -802,9 +802,9 @@
|`cusparseBlockedEllGet`|11.2| | |`hipsparseBlockedEllGet`|4.5.0| | | | |
|`cusparseBsrSetStridedBatch`|12.1| | | | | | | | |
|`cusparseConstBlockedEllGet`|12.0| | | | | | | | |
|`cusparseConstCooGet`|12.0| | | | | | | | |
|`cusparseConstCooGet`|12.0| | |`hipsparseConstCooGet`|6.0.0| | | |6.0.0|
|`cusparseConstCscGet`|12.0| | | | | | | | |
|`cusparseConstCsrGet`|12.0| | | | | | | | |
|`cusparseConstCsrGet`|12.0| | |`hipsparseConstCsrGet`|6.0.0| | | |6.0.0|
|`cusparseConstDnMatGet`|12.0| | | | | | | | |
|`cusparseConstDnMatGetValues`|12.0| | | | | | | | |
|`cusparseConstDnVecGet`|12.0| | | | | | | | |
Expand All @@ -820,11 +820,11 @@
|`cusparseCooSetStridedBatch`|11.0| | |`hipsparseCooSetStridedBatch`|5.2.0| | | | |
|`cusparseCreateBlockedEll`|11.2| | |`hipsparseCreateBlockedEll`|4.5.0| | | | |
|`cusparseCreateBsr`|12.1| | | | | | | | |
|`cusparseCreateConstBlockedEll`|12.0| | | | | | | | |
|`cusparseCreateConstBlockedEll`|12.0| | |`hipsparseCreateConstBlockedEll`|6.0.0| | | |6.0.0|
|`cusparseCreateConstBsr`|12.1| | | | | | | | |
|`cusparseCreateConstCoo`|12.0| | | | | | | | |
|`cusparseCreateConstCsc`|12.0| | | | | | | | |
|`cusparseCreateConstCsr`|12.0| | | | | | | | |
|`cusparseCreateConstCoo`|12.0| | |`hipsparseCreateConstCoo`|6.0.0| | | |6.0.0|
|`cusparseCreateConstCsc`|12.0| | |`hipsparseCreateConstCsc`|6.0.0| | | |6.0.0|
|`cusparseCreateConstCsr`|12.0| | |`hipsparseCreateConstCsr`|6.0.0| | | |6.0.0|
|`cusparseCreateConstDnMat`|12.0| | | | | | | | |
|`cusparseCreateConstDnVec`|12.0| | | | | | | | |
|`cusparseCreateConstSlicedEll`|12.1| | | | | | | | |
Expand Down
14 changes: 7 additions & 7 deletions docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
|`cusparseColorInfo_t`| |12.2| |`hipsparseColorInfo_t`|4.5.0| | | | |`rocsparse_color_info`|4.5.0| | | | |
|`cusparseConstDnMatDescr_t`|12.0| | | | | | | | | | | | | | |
|`cusparseConstDnVecDescr_t`|12.0| | | | | | | | | | | | | | |
|`cusparseConstSpMatDescr_t`|12.0| | | | | | | | | | | | | | |
|`cusparseConstSpMatDescr_t`|12.0| | |`hipsparseConstSpMatDescr_t`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstSpVecDescr_t`|12.0| | |`hipsparseConstSpVecDescr_t`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseContext`| | | | | | | | | |`_rocsparse_handle`|1.9.0| | | | |
|`cusparseCsr2CscAlg_t`|10.1| | |`hipsparseCsr2CscAlg_t`|5.4.0| | | | | | | | | | |
Expand Down Expand Up @@ -802,9 +802,9 @@
|`cusparseBlockedEllGet`|11.2| | |`hipsparseBlockedEllGet`|4.5.0| | | | |`rocsparse_bell_get`|4.1.0| | | | |
|`cusparseBsrSetStridedBatch`|12.1| | | | | | | | | | | | | | |
|`cusparseConstBlockedEllGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstCooGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstCooGet`|12.0| | |`hipsparseConstCooGet`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstCscGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstCsrGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstCsrGet`|12.0| | |`hipsparseConstCsrGet`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstDnMatGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstDnMatGetValues`|12.0| | | | | | | | | | | | | | |
|`cusparseConstDnVecGet`|12.0| | | | | | | | | | | | | | |
Expand All @@ -820,11 +820,11 @@
|`cusparseCooSetStridedBatch`|11.0| | |`hipsparseCooSetStridedBatch`|5.2.0| | | | |`rocsparse_coo_set_strided_batch`|5.2.0| | | | |
|`cusparseCreateBlockedEll`|11.2| | |`hipsparseCreateBlockedEll`|4.5.0| | | | |`rocsparse_create_bell_descr`|4.5.0| | | | |
|`cusparseCreateBsr`|12.1| | | | | | | | | | | | | | |
|`cusparseCreateConstBlockedEll`|12.0| | | | | | | | | | | | | | |
|`cusparseCreateConstBlockedEll`|12.0| | |`hipsparseCreateConstBlockedEll`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseCreateConstBsr`|12.1| | | | | | | | | | | | | | |
|`cusparseCreateConstCoo`|12.0| | | | | | | | | | | | | | |
|`cusparseCreateConstCsc`|12.0| | | | | | | | | | | | | | |
|`cusparseCreateConstCsr`|12.0| | | | | | | | | | | | | | |
|`cusparseCreateConstCoo`|12.0| | |`hipsparseCreateConstCoo`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseCreateConstCsc`|12.0| | |`hipsparseCreateConstCsc`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseCreateConstCsr`|12.0| | |`hipsparseCreateConstCsr`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseCreateConstDnMat`|12.0| | | | | | | | | | | | | | |
|`cusparseCreateConstDnVec`|12.0| | | | | | | | | | | | | | |
|`cusparseCreateConstSlicedEll`|12.1| | | | | | | | | | | | | | |
Expand Down
18 changes: 12 additions & 6 deletions src/CUDA2HIP_SPARSE_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,19 +730,19 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
// Generic Sparse API helper functions
// Sparse Matrix descriptor
{"cusparseCreateCoo", {"hipsparseCreateCoo", "rocsparse_create_coo_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCreateConstCoo", {"hipsparseCreateConstCoo", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseCreateConstCoo", {"hipsparseCreateConstCoo", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseCreateCooAoS", {"hipsparseCreateCooAoS", "rocsparse_create_coo_aos_descr", CONV_LIB_FUNC, API_SPARSE, 15, CUDA_DEPRECATED | CUDA_REMOVED}},
{"cusparseCreateCsr", {"hipsparseCreateCsr", "rocsparse_create_csr_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCreateConstCsr", {"hipsparseCreateConstCsr", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseCreateConstCsr", {"hipsparseCreateConstCsr", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseCreateCsc", {"hipsparseCreateCsc", "rocsparse_create_csc_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCreateConstCsc", {"hipsparseCreateConstCsc", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseCreateConstCsc", {"hipsparseCreateConstCsc", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseDestroySpMat", {"hipsparseDestroySpMat", "rocsparse_destroy_spmat_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCooGet", {"hipsparseCooGet", "rocsparse_coo_get", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCooAoSGet", {"hipsparseCooAoSGet", "rocsparse_coo_aos_get", CONV_LIB_FUNC, API_SPARSE, 15, CUDA_DEPRECATED | CUDA_REMOVED}},
{"cusparseConstCooGet", {"hipsparseConstCooGet", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseConstCooGet", {"hipsparseConstCooGet", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseCooSetStridedBatch", {"hipsparseCooSetStridedBatch", "rocsparse_coo_set_strided_batch", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCsrGet", {"hipsparseCsrGet", "rocsparse_csr_get", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseConstCsrGet", {"hipsparseConstCsrGet", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseConstCsrGet", {"hipsparseConstCsrGet", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseCsrSetPointers", {"hipsparseCsrSetPointers", "rocsparse_csr_set_pointers", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCscSetPointers", {"hipsparseCscSetPointers", "rocsparse_csc_set_pointers", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCscGet", {"hipsparseCscGet", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
Expand All @@ -764,7 +764,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
{"cusparseBlockedEllGet", {"hipsparseBlockedEllGet", "rocsparse_bell_get", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseConstBlockedEllGet", {"hipsparseConstBlockedEllGet", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseCreateBlockedEll", {"hipsparseCreateBlockedEll", "rocsparse_create_bell_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCreateConstBlockedEll", {"hipsparseCreateConstBlockedEll", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseCreateConstBlockedEll", {"hipsparseCreateConstBlockedEll", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseBsrSetStridedBatch", {"hipsparseBsrSetStridedBatch", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
// NOTE: rocsparse_create_bsr_descr has appeared earlier than cusparseCreateBsr and has a different signature
{"cusparseCreateBsr", {"hipsparseCreateBsr", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
Expand Down Expand Up @@ -1968,6 +1968,12 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SPARSE_FUNCTION_VER_MAP {
{"hipsparseCreateConstSpVec", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstSpVecGet", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstSpVecGetValues", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseCreateConstCoo", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseCreateConstCsr", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseCreateConstCsc", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseCreateConstBlockedEll", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstCooGet", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstCsrGet", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"rocsparse_create_handle", {HIP_1090, HIP_0, HIP_0 }},
{"rocsparse_destroy_handle", {HIP_1090, HIP_0, HIP_0 }},
{"rocsparse_set_stream", {HIP_1090, HIP_0, HIP_0 }},
Expand Down
3 changes: 2 additions & 1 deletion src/CUDA2HIP_SPARSE_API_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_TYPE_NAME_MAP {
{"cusparseLoggerCallback_t", {"hipsparseLoggerCallback_t", "", CONV_TYPE, API_SPARSE, 4, UNSUPPORTED}},
{"cusparseConstSpVecDescr_t", {"hipsparseConstSpVecDescr_t", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED}},
{"cusparseConstDnVecDescr_t", {"hipsparseConstDnVecDescr_t", "", CONV_TYPE, API_SPARSE, 4, UNSUPPORTED}},
{"cusparseConstSpMatDescr_t", {"hipsparseConstSpMatDescr_t", "", CONV_TYPE, API_SPARSE, 4, UNSUPPORTED}},
{"cusparseConstSpMatDescr_t", {"hipsparseConstSpMatDescr_t", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED}},
{"cusparseConstDnMatDescr_t", {"hipsparseConstDnMatDescr_t", "", CONV_TYPE, API_SPARSE, 4, UNSUPPORTED}},
};

Expand Down Expand Up @@ -563,6 +563,7 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SPARSE_TYPE_NAME_VER_MAP {
{"HIPSPARSE_SPGEMM_ALG2", {HIP_5060, HIP_0, HIP_0 }},
{"HIPSPARSE_SPGEMM_ALG3", {HIP_5060, HIP_0, HIP_0 }},
{"hipsparseConstSpVecDescr_t", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstSpMatDescr_t", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"csric02Info_t", {HIP_3010, HIP_0, HIP_0 }},
{"csric02Info", {HIP_3010, HIP_0, HIP_0 }},
{"_rocsparse_handle", {HIP_1090, HIP_0, HIP_0 }},
Expand Down
Loading

0 comments on commit e380780

Please sign in to comment.