Skip to content

Commit

Permalink
[HIPIFY][6.0.0][hipSPARSE] Support for ROCm HIP 6.0.0 - Step 25 - 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:
 `cusparseDestroyDnVec`,
 `cusparseDnMatGetStridedBatch`
  • Loading branch information
emankov committed Oct 25, 2023
1 parent 75a6da6 commit 89e2fa3
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 45 deletions.
12 changes: 6 additions & 6 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -3600,6 +3600,10 @@ sub simpleSubstitutions {
subst("cusparseConstBlockedEllGet", "hipsparseConstBlockedEllGet", "library");
subst("cusparseConstCooGet", "hipsparseConstCooGet", "library");
subst("cusparseConstCsrGet", "hipsparseConstCsrGet", "library");
subst("cusparseConstDnMatGet", "hipsparseConstDnMatGet", "library");
subst("cusparseConstDnMatGetValues", "hipsparseConstDnMatGetValues", "library");
subst("cusparseConstDnVecGet", "hipsparseConstDnVecGet", "library");
subst("cusparseConstDnVecGetValues", "hipsparseConstDnVecGetValues", "library");
subst("cusparseConstSpMatGetValues", "hipsparseConstSpMatGetValues", "library");
subst("cusparseConstSpVecGet", "hipsparseConstSpVecGet", "library");
subst("cusparseConstSpVecGetValues", "hipsparseConstSpVecGetValues", "library");
Expand All @@ -3619,6 +3623,7 @@ sub simpleSubstitutions {
subst("cusparseCreateConstCoo", "hipsparseCreateConstCoo", "library");
subst("cusparseCreateConstCsc", "hipsparseCreateConstCsc", "library");
subst("cusparseCreateConstCsr", "hipsparseCreateConstCsr", "library");
subst("cusparseCreateConstDnMat", "hipsparseCreateConstDnMat", "library");
subst("cusparseCreateConstDnVec", "hipsparseCreateConstDnVec", "library");
subst("cusparseCreateConstSpVec", "hipsparseCreateConstSpVec", "library");
subst("cusparseCreateCoo", "hipsparseCreateCoo", "library");
Expand Down Expand Up @@ -4557,6 +4562,7 @@ sub simpleSubstitutions {
subst("curandStatus_t", "hiprandStatus_t", "type");
subst("cusparseAction_t", "hipsparseAction_t", "type");
subst("cusparseColorInfo_t", "hipsparseColorInfo_t", "type");
subst("cusparseConstDnMatDescr_t", "hipsparseConstDnMatDescr_t", "type");
subst("cusparseConstDnVecDescr_t", "hipsparseConstDnVecDescr_t", "type");
subst("cusparseConstSpMatDescr_t", "hipsparseConstSpMatDescr_t", "type");
subst("cusparseConstSpVecDescr_t", "hipsparseConstSpVecDescr_t", "type");
Expand Down Expand Up @@ -6911,17 +6917,11 @@ sub warnUnsupportedFunctions {
"cusparseCreateSolveAnalysisInfo",
"cusparseCreateSlicedEll",
"cusparseCreateConstSlicedEll",
"cusparseCreateConstDnMat",
"cusparseCreateConstBsr",
"cusparseCreateBsr",
"cusparseContext",
"cusparseConstrainedGeMM_bufferSize",
"cusparseConstrainedGeMM",
"cusparseConstDnVecGetValues",
"cusparseConstDnVecGet",
"cusparseConstDnMatGetValues",
"cusparseConstDnMatGet",
"cusparseConstDnMatDescr_t",
"cusparseConstCscGet",
"cusparseColorInfo",
"cusparseColorAlg_t",
Expand Down
12 changes: 6 additions & 6 deletions docs/tables/CUSPARSE_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
|`cusparseColorAlg_t`|8.0|12.2| | | | | | | |
|`cusparseColorInfo`| |12.2| | | | | | | |
|`cusparseColorInfo_t`| |12.2| |`hipsparseColorInfo_t`|4.5.0| | | | |
|`cusparseConstDnMatDescr_t`|12.0| | | | | | | | |
|`cusparseConstDnMatDescr_t`|12.0| | |`hipsparseConstDnMatDescr_t`|6.0.0| | | |6.0.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|
Expand Down Expand Up @@ -805,10 +805,10 @@
|`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| | | | | | | | |
|`cusparseConstDnMatGet`|12.0| | |`hipsparseConstDnMatGet`|6.0.0| | | |6.0.0|
|`cusparseConstDnMatGetValues`|12.0| | |`hipsparseConstDnMatGetValues`|6.0.0| | | |6.0.0|
|`cusparseConstDnVecGet`|12.0| | |`hipsparseConstDnVecGet`|6.0.0| | | |6.0.0|
|`cusparseConstDnVecGetValues`|12.0| | |`hipsparseConstDnVecGetValues`|6.0.0| | | |6.0.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|
Expand All @@ -825,7 +825,7 @@
|`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| | | | | | | | |
|`cusparseCreateConstDnMat`|12.0| | |`hipsparseCreateConstDnMat`|6.0.0| | | |6.0.0|
|`cusparseCreateConstDnVec`|12.0| | |`hipsparseCreateConstDnVec`|6.0.0| | | |6.0.0|
|`cusparseCreateConstSlicedEll`|12.1| | | | | | | | |
|`cusparseCreateConstSpVec`|12.0| | |`hipsparseCreateConstSpVec`|6.0.0| | | |6.0.0|
Expand Down
12 changes: 6 additions & 6 deletions docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
|`cusparseColorAlg_t`|8.0|12.2| | | | | | | | | | | | | |
|`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| | | | | | | | | | | | | | |
|`cusparseConstDnMatDescr_t`|12.0| | |`hipsparseConstDnMatDescr_t`|6.0.0| | | |6.0.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| | | | | | |
Expand Down Expand Up @@ -805,10 +805,10 @@
|`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| | | | | | | | | | | | | | |
|`cusparseConstDnMatGet`|12.0| | |`hipsparseConstDnMatGet`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstDnMatGetValues`|12.0| | |`hipsparseConstDnMatGetValues`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstDnVecGet`|12.0| | |`hipsparseConstDnVecGet`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseConstDnVecGetValues`|12.0| | |`hipsparseConstDnVecGetValues`|6.0.0| | | |6.0.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| | | | | | |
Expand All @@ -825,7 +825,7 @@
|`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| | | | | | | | | | | | | | |
|`cusparseCreateConstDnMat`|12.0| | |`hipsparseCreateConstDnMat`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseCreateConstDnVec`|12.0| | |`hipsparseCreateConstDnVec`|6.0.0| | | |6.0.0| | | | | | |
|`cusparseCreateConstSlicedEll`|12.1| | | | | | | | | | | | | | |
|`cusparseCreateConstSpVec`|12.0| | |`hipsparseCreateConstSpVec`|6.0.0| | | |6.0.0| | | | | | |
Expand Down
15 changes: 10 additions & 5 deletions src/CUDA2HIP_SPARSE_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,12 +785,12 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
// Generic Dense API helper functions
// Dense Matrix descriptor
{"cusparseCreateDnMat", {"hipsparseCreateDnMat", "rocsparse_create_dnmat_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseCreateConstDnMat", {"hipsparseCreateConstDnMat", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseCreateConstDnMat", {"hipsparseCreateConstDnMat", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseDestroyDnMat", {"hipsparseDestroyDnMat", "rocsparse_destroy_dnmat_descr", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseDnMatGet", {"hipsparseDnMatGet", "rocsparse_dnmat_get", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseConstDnMatGet", {"hipsparseConstDnMatGet", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseConstDnMatGet", {"hipsparseConstDnMatGet", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseDnMatGetValues", {"hipsparseDnMatGetValues", "rocsparse_dnmat_get_values", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseConstDnMatGetValues", {"hipsparseConstDnMatGetValues", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseConstDnMatGetValues", {"hipsparseConstDnMatGetValues", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseDnMatSetValues", {"hipsparseDnMatSetValues", "rocsparse_dnmat_set_values", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseDnMatSetStridedBatch", {"hipsparseDnMatSetStridedBatch", "rocsparse_dnmat_set_strided_batch", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseDnMatGetStridedBatch", {"hipsparseDnMatGetStridedBatch", "rocsparse_dnmat_get_strided_batch", CONV_LIB_FUNC, API_SPARSE, 15}},
Expand All @@ -799,9 +799,9 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP {
{"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}},
{"cusparseConstDnVecGet", {"hipsparseConstDnVecGet", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseDnVecGetValues", {"hipsparseDnVecGetValues", "rocsparse_dnvec_get_values", CONV_LIB_FUNC, API_SPARSE, 15}},
{"cusparseConstDnVecGetValues", {"hipsparseConstDnVecGetValues", "", CONV_LIB_FUNC, API_SPARSE, 15, UNSUPPORTED}},
{"cusparseConstDnVecGetValues", {"hipsparseConstDnVecGetValues", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
{"cusparseDnVecSetValues", {"hipsparseDnVecSetValues", "rocsparse_dnvec_set_values", CONV_LIB_FUNC, API_SPARSE, 15}},

{"cusparseSpGEMM_createDescr", {"hipsparseSpGEMM_createDescr", "", CONV_LIB_FUNC, API_SPARSE, 15, ROC_UNSUPPORTED}},
Expand Down Expand Up @@ -1977,6 +1977,11 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SPARSE_FUNCTION_VER_MAP {
{"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}},
{"hipsparseConstDnVecGet", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstDnVecGetValues", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseCreateConstDnMat", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstDnMatGet", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipsparseConstDnMatGetValues", {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 @@ -269,7 +269,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_TYPE_NAME_MAP {
{"cusparseConstSpVecDescr_t", {"hipsparseConstSpVecDescr_t", "", CONV_TYPE, API_SPARSE, 4, ROC_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}},
{"cusparseConstDnMatDescr_t", {"hipsparseConstDnMatDescr_t", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED}},
};

const std::map<llvm::StringRef, cudaAPIversions> CUDA_SPARSE_TYPE_NAME_VER_MAP {
Expand Down Expand Up @@ -565,6 +565,7 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SPARSE_TYPE_NAME_VER_MAP {
{"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}},
{"hipsparseConstDnMatDescr_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 89e2fa3

Please sign in to comment.