Skip to content

Commit

Permalink
[HIPIFY][6.0.0][hipSPARSE] Support for ROCm HIP 6.0.0 - Step 24 - 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-Changed` in CUDA 12000:
 `cusparseSpMatGetSize`,
 `cusparseSpMatGetFormat`,
 `cusparseSpMatGetIndexBase`,
 `cusparseSpMatGetStridedBatch`,
 `cusparseSpMatGetAttribute`
  • Loading branch information
emankov committed Oct 25, 2023
1 parent e380780 commit 2bdae31
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 27 deletions.
8 changes: 4 additions & 4 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -3597,8 +3597,10 @@ sub simpleSubstitutions {
subst("cusparseChybmv", "hipsparseChybmv", "library");
subst("cusparseCnnz", "hipsparseCnnz", "library");
subst("cusparseCnnz_compress", "hipsparseCnnz_compress", "library");
subst("cusparseConstBlockedEllGet", "hipsparseConstBlockedEllGet", "library");
subst("cusparseConstCooGet", "hipsparseConstCooGet", "library");
subst("cusparseConstCsrGet", "hipsparseConstCsrGet", "library");
subst("cusparseConstSpMatGetValues", "hipsparseConstSpMatGetValues", "library");
subst("cusparseConstSpVecGet", "hipsparseConstSpVecGet", "library");
subst("cusparseConstSpVecGetValues", "hipsparseConstSpVecGetValues", "library");
subst("cusparseCooAoSGet", "hipsparseCooAoSGet", "library");
Expand All @@ -3617,6 +3619,7 @@ sub simpleSubstitutions {
subst("cusparseCreateConstCoo", "hipsparseCreateConstCoo", "library");
subst("cusparseCreateConstCsc", "hipsparseCreateConstCsc", "library");
subst("cusparseCreateConstCsr", "hipsparseCreateConstCsr", "library");
subst("cusparseCreateConstDnVec", "hipsparseCreateConstDnVec", "library");
subst("cusparseCreateConstSpVec", "hipsparseCreateConstSpVec", "library");
subst("cusparseCreateCoo", "hipsparseCreateCoo", "library");
subst("cusparseCreateCooAoS", "hipsparseCreateCooAoS", "library");
Expand Down Expand Up @@ -4554,6 +4557,7 @@ sub simpleSubstitutions {
subst("curandStatus_t", "hiprandStatus_t", "type");
subst("cusparseAction_t", "hipsparseAction_t", "type");
subst("cusparseColorInfo_t", "hipsparseColorInfo_t", "type");
subst("cusparseConstDnVecDescr_t", "hipsparseConstDnVecDescr_t", "type");
subst("cusparseConstSpMatDescr_t", "hipsparseConstSpMatDescr_t", "type");
subst("cusparseConstSpVecDescr_t", "hipsparseConstSpVecDescr_t", "type");
subst("cusparseCsr2CscAlg_t", "hipsparseCsr2CscAlg_t", "type");
Expand Down Expand Up @@ -6907,22 +6911,18 @@ sub warnUnsupportedFunctions {
"cusparseCreateSolveAnalysisInfo",
"cusparseCreateSlicedEll",
"cusparseCreateConstSlicedEll",
"cusparseCreateConstDnVec",
"cusparseCreateConstDnMat",
"cusparseCreateConstBsr",
"cusparseCreateBsr",
"cusparseContext",
"cusparseConstrainedGeMM_bufferSize",
"cusparseConstrainedGeMM",
"cusparseConstSpMatGetValues",
"cusparseConstDnVecGetValues",
"cusparseConstDnVecGet",
"cusparseConstDnVecDescr_t",
"cusparseConstDnMatGetValues",
"cusparseConstDnMatGet",
"cusparseConstDnMatDescr_t",
"cusparseConstCscGet",
"cusparseConstBlockedEllGet",
"cusparseColorInfo",
"cusparseColorAlg_t",
"cusparseChybsv_solve",
Expand Down
8 changes: 4 additions & 4 deletions docs/tables/CUSPARSE_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
|`cusparseColorInfo`| |12.2| | | | | | | |
|`cusparseColorInfo_t`| |12.2| |`hipsparseColorInfo_t`|4.5.0| | | | |
|`cusparseConstDnMatDescr_t`|12.0| | | | | | | | |
|`cusparseConstDnVecDescr_t`|12.0| | | | | | | | |
|`cusparseConstDnVecDescr_t`|12.0| | |`hipsparseConstDnVecDescr_t`|6.0.0| | | |6.0.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`| | | | | | | | | |
Expand Down Expand Up @@ -801,15 +801,15 @@
|`cusparseAxpby`|11.0| | |`hipsparseAxpby`|4.1.0| | | | |
|`cusparseBlockedEllGet`|11.2| | |`hipsparseBlockedEllGet`|4.5.0| | | | |
|`cusparseBsrSetStridedBatch`|12.1| | | | | | | | |
|`cusparseConstBlockedEllGet`|12.0| | | | | | | | |
|`cusparseConstBlockedEllGet`|12.0| | |`hipsparseConstBlockedEllGet`|6.0.0| | | |6.0.0|
|`cusparseConstCooGet`|12.0| | |`hipsparseConstCooGet`|6.0.0| | | |6.0.0|
|`cusparseConstCscGet`|12.0| | | | | | | | |
|`cusparseConstCsrGet`|12.0| | |`hipsparseConstCsrGet`|6.0.0| | | |6.0.0|
|`cusparseConstDnMatGet`|12.0| | | | | | | | |
|`cusparseConstDnMatGetValues`|12.0| | | | | | | | |
|`cusparseConstDnVecGet`|12.0| | | | | | | | |
|`cusparseConstDnVecGetValues`|12.0| | | | | | | | |
|`cusparseConstSpMatGetValues`|12.0| | | | | | | | |
|`cusparseConstSpMatGetValues`|12.0| | |`hipsparseConstSpMatGetValues`|6.0.0| | | |6.0.0|
|`cusparseConstSpVecGet`|12.0| | |`hipsparseConstSpVecGet`|6.0.0| | | |6.0.0|
|`cusparseConstSpVecGetValues`|12.0| | |`hipsparseConstSpVecGetValues`|6.0.0| | | |6.0.0|
|`cusparseConstrainedGeMM`|10.2|11.2|12.0| | | | | | |
Expand All @@ -826,7 +826,7 @@
|`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| | | | | | | | |
|`cusparseCreateConstDnVec`|12.0| | |`hipsparseCreateConstDnVec`|6.0.0| | | |6.0.0|
|`cusparseCreateConstSlicedEll`|12.1| | | | | | | | |
|`cusparseCreateConstSpVec`|12.0| | |`hipsparseCreateConstSpVec`|6.0.0| | | |6.0.0|
|`cusparseCreateCoo`|10.1| | |`hipsparseCreateCoo`|4.1.0| | | | |
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 @@ -134,7 +134,7 @@
|`cusparseColorInfo`| |12.2| | | | | | | |`_rocsparse_color_info`|4.5.0| | | | |
|`cusparseColorInfo_t`| |12.2| |`hipsparseColorInfo_t`|4.5.0| | | | |`rocsparse_color_info`|4.5.0| | | | |
|`cusparseConstDnMatDescr_t`|12.0| | | | | | | | | | | | | | |
|`cusparseConstDnVecDescr_t`|12.0| | | | | | | | | | | | | | |
|`cusparseConstDnVecDescr_t`|12.0| | |`hipsparseConstDnVecDescr_t`|6.0.0| | | |6.0.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| | | | |
Expand Down Expand Up @@ -801,15 +801,15 @@
|`cusparseAxpby`|11.0| | |`hipsparseAxpby`|4.1.0| | | | |`rocsparse_axpby`|4.1.0| | | | |
|`cusparseBlockedEllGet`|11.2| | |`hipsparseBlockedEllGet`|4.5.0| | | | |`rocsparse_bell_get`|4.1.0| | | | |
|`cusparseBsrSetStridedBatch`|12.1| | | | | | | | | | | | | | |
|`cusparseConstBlockedEllGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstBlockedEllGet`|12.0| | |`hipsparseConstBlockedEllGet`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstCooGet`|12.0| | |`hipsparseConstCooGet`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstCscGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstCsrGet`|12.0| | |`hipsparseConstCsrGet`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstDnMatGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstDnMatGetValues`|12.0| | | | | | | | | | | | | | |
|`cusparseConstDnVecGet`|12.0| | | | | | | | | | | | | | |
|`cusparseConstDnVecGetValues`|12.0| | | | | | | | | | | | | | |
|`cusparseConstSpMatGetValues`|12.0| | | | | | | | | | | | | | |
|`cusparseConstSpMatGetValues`|12.0| | |`hipsparseConstSpMatGetValues`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstSpVecGet`|12.0| | |`hipsparseConstSpVecGet`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstSpVecGetValues`|12.0| | |`hipsparseConstSpVecGetValues`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstrainedGeMM`|10.2|11.2|12.0| | | | | | | | | | | | |
Expand All @@ -826,7 +826,7 @@
|`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| | | | | | | | | | | | | | |
|`cusparseCreateConstDnVec`|12.0| | |`hipsparseCreateConstDnVec`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseCreateConstSlicedEll`|12.1| | | | | | | | | | | | | | |
|`cusparseCreateConstSpVec`|12.0| | |`hipsparseCreateConstSpVec`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseCreateCoo`|10.1| | |`hipsparseCreateCoo`|4.1.0| | | | |`rocsparse_create_coo_descr`|4.1.0| | | | |
Expand Down
9 changes: 6 additions & 3 deletions src/CUDA2HIP_SPARSE_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
{"cusparseSpMatGetFormat", {"hipsparseSpMatGetFormat", "rocsparse_spmat_get_format", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseSpMatGetIndexBase", {"hipsparseSpMatGetIndexBase", "rocsparse_spmat_get_index_base", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseSpMatGetValues", {"hipsparseSpMatGetValues", "rocsparse_spmat_get_values", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseConstSpMatGetValues", {"hipsparseConstSpMatGetValues", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseConstSpMatGetValues", {"hipsparseConstSpMatGetValues", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseSpMatSetValues", {"hipsparseSpMatSetValues", "rocsparse_spmat_set_values", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseSpMatGetStridedBatch", {"hipsparseSpMatGetStridedBatch", "rocsparse_spmat_get_strided_batch", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseSpMatSetStridedBatch", {"hipsparseSpMatSetStridedBatch", "rocsparse_spmat_set_strided_batch", CONV_LIB_FUNC, API_SPARSE, 15, CUDA_REMOVED}},
Expand All @@ -762,7 +762,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
{"cusparseSpMatGetAttribute", {"hipsparseSpMatGetAttribute", "rocsparse_spmat_get_attribute", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseSpMatSetAttribute", {"hipsparseSpMatSetAttribute", "rocsparse_spmat_set_attribute", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseBlockedEllGet", {"hipsparseBlockedEllGet", "rocsparse_bell_get", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseConstBlockedEllGet", {"hipsparseConstBlockedEllGet", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseConstBlockedEllGet", {"hipsparseConstBlockedEllGet", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseCreateBlockedEll", {"hipsparseCreateBlockedEll", "rocsparse_create_bell_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCreateConstBlockedEll", {"hipsparseCreateConstBlockedEll", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseBsrSetStridedBatch", {"hipsparseBsrSetStridedBatch", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
Expand Down Expand Up @@ -796,7 +796,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
{"cusparseDnMatGetStridedBatch", {"hipsparseDnMatGetStridedBatch", "rocsparse_dnmat_get_strided_batch", CONV_LIB_FUNC, API_SPARSE, 15}},
// Dense Vector descriptor
{"cusparseCreateDnVec", {"hipsparseCreateDnVec", "rocsparse_create_dnvec_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCreateConstDnVec", {"hipsparseCreateConstDnVec", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseCreateConstDnVec", {"hipsparseCreateConstDnVec", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseDestroyDnVec", {"hipsparseDestroyDnVec", "rocsparse_destroy_dnvec_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseDnVecGet", {"hipsparseDnVecGet", "rocsparse_dnvec_get", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseConstDnVecGet", {"hipsparseConstDnVecGet", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
Expand Down Expand Up @@ -1974,6 +1974,9 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SPARSE_FUNCTION_VER_MAP {
{"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}},
{"hipsparseConstBlockedEllGet", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstSpMatGetValues", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseCreateConstDnVec", {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 @@ -267,7 +267,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_TYPE_NAME_MAP {
// 4. Typedefs
{"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}},
{"cusparseConstDnVecDescr_t", {"hipsparseConstDnVecDescr_t", "", CONV_TYPE, API_SPARSE, 4, ROC_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 @@ -564,6 +564,7 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SPARSE_TYPE_NAME_VER_MAP {
{"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}},
{"hipsparseConstDnVecDescr_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 2bdae31

Please sign in to comment.