From 89e2fa36c831c353090b17c2fec6dca2b38ff457 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Wed, 25 Oct 2023 21:32:53 +0200 Subject: [PATCH] [HIPIFY][6.0.0][hipSPARSE] Support for ROCm HIP 6.0.0 - Step 25 - hipSPARSE + Updated synthetic tests and the regenerated hipify-perl and SPARSE docs [TODO] + Mark as `C-Changed` in CUDA 12000: `cusparseDestroyDnVec`, `cusparseDnMatGetStridedBatch` --- bin/hipify-perl | 12 +-- docs/tables/CUSPARSE_API_supported_by_HIP.md | 12 +-- .../CUSPARSE_API_supported_by_HIP_and_ROC.md | 12 +-- src/CUDA2HIP_SPARSE_API_functions.cpp | 15 ++-- src/CUDA2HIP_SPARSE_API_types.cpp | 3 +- .../synthetic/libraries/cusparse2hipsparse.cu | 83 ++++++++++++++----- 6 files changed, 92 insertions(+), 45 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index f23d0fcc..f45618d9 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -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"); @@ -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"); @@ -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"); @@ -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", diff --git a/docs/tables/CUSPARSE_API_supported_by_HIP.md b/docs/tables/CUSPARSE_API_supported_by_HIP.md index eec52013..5771916a 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP.md @@ -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| @@ -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| @@ -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| 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 a0fcc5c6..dbe2377d 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -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| | | | | | | @@ -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| | | | | | | @@ -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| | | | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index eeb0eaa4..6ba82a98 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -785,12 +785,12 @@ const std::map 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}}, @@ -799,9 +799,9 @@ const std::map 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}}, @@ -1977,6 +1977,11 @@ const std::map 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 }}, diff --git a/src/CUDA2HIP_SPARSE_API_types.cpp b/src/CUDA2HIP_SPARSE_API_types.cpp index 8fa0e887..86eb42d8 100644 --- a/src/CUDA2HIP_SPARSE_API_types.cpp +++ b/src/CUDA2HIP_SPARSE_API_types.cpp @@ -269,7 +269,7 @@ const std::map 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 CUDA_SPARSE_TYPE_NAME_VER_MAP { @@ -565,6 +565,7 @@ const std::map 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 }}, diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 951e9d81..a8cc3dd5 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -1403,22 +1403,34 @@ int main() { #if CUDA_VERSION < 12000 // TODO: Mark as C-Changed in 12.0.0 - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroySpMat(cusparseConstSpMatDescr_t spMatDescr); + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroySpMat(cusparseSpMatDescr_t spMatDescr); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroySpMat(hipsparseSpMatDescr_t spMatDescr); // CHECK: status_t = hipsparseDestroySpMat(spMatDescr_t); status_t = cusparseDestroySpMat(spMatDescr_t); // TODO: Mark as C-Changed in 12.0.0 - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetFormat(cusparseConstSpMatDescr_t spMatDescr, cusparseFormat_t* format); + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetFormat(cusparseSpMatDescr_t spMatDescr, cusparseFormat_t* format); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetFormat(const hipsparseSpMatDescr_t spMatDescr, hipsparseFormat_t* format); // CHECK: status_t = hipsparseSpMatGetFormat(spMatDescr_t, &format_t); status_t = cusparseSpMatGetFormat(spMatDescr_t, &format_t); // TODO: Mark as C-Changed in 12.0.0 - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetIndexBase(cusparseConstSpMatDescr_t spMatDescr, cusparseIndexBase_t* idxBase); + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetIndexBase(cusparseSpMatDescr_t spMatDescr, cusparseIndexBase_t* idxBase); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetIndexBase(const hipsparseSpMatDescr_t spMatDescr, hipsparseIndexBase_t* idxBase); // CHECK: status_t = hipsparseSpMatGetIndexBase(spMatDescr_t, &indexBase_t); status_t = cusparseSpMatGetIndexBase(spMatDescr_t, &indexBase_t); + + // TODO: Mark as C-Changed in 12.0.0 + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroyDnMat(cusparseDnMatDescr_t dnMatDescr); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroyDnMat(hipsparseDnMatDescr_t dnMatDescr); + // CHECK: status_t = hipsparseDestroyDnMat(dnMatDescr_t); + status_t = cusparseDestroyDnMat(dnMatDescr_t); + + // TODO: Mark as C-Changed in 12.0.0 + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGetStridedBatch(cusparseDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatGetStridedBatch(hipsparseDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride); + // CHECK: status_t = hipsparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride); + status_t = cusparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride); #endif // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCooGet(cusparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, void** cooRowInd, void** cooColInd, void** cooValues, cusparseIndexType_t* idxType, cusparseIndexBase_t* idxBase, cudaDataType* valueType); @@ -1431,21 +1443,11 @@ int main() { // CHECK: status_t = hipsparseCreateDnMat(&dnMatDescr_t, rows, cols, ld, values, dataType, order_t); status_t = cusparseCreateDnMat(&dnMatDescr_t, rows, cols, ld, values, dataType, order_t); - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroyDnMat(cusparseConstDnMatDescr_t dnMatDescr); - // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroyDnMat(hipsparseDnMatDescr_t dnMatDescr); - // CHECK: status_t = hipsparseDestroyDnMat(dnMatDescr_t); - status_t = cusparseDestroyDnMat(dnMatDescr_t); - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGet(cusparseDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, void** values, cudaDataType* type, cusparseOrder_t* order); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatGet(const hipsparseDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, void** values, hipDataType* valueType, hipsparseOrder_t* order); // CHECK: status_t = hipsparseDnMatGet(dnMatDescr_t, &rows, &cols, &ld, &values, &dataType, &order_t); status_t = cusparseDnMatGet(dnMatDescr_t, &rows, &cols, &ld, &values, &dataType, &order_t); - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGetStridedBatch(cusparseConstDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride); - // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatGetStridedBatch(hipsparseDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride); - // CHECK: status_t = hipsparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride); - status_t = cusparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride); - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatSetStridedBatch(cusparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatSetStridedBatch(hipsparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride); // CHECK: status_t = hipsparseDnMatSetStridedBatch(dnMatDescr_t, batchCount, batchStride); @@ -1495,10 +1497,16 @@ int main() { status_t = cusparseSpVecGetIndexBase(spVecDescr_t, &indexBase_t); // TODO: Mark as C-Changed in 12.0.0 - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetStridedBatch(cusparseConstSpMatDescr_t spMatDescr, int* batchCount); + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetStridedBatch(cusparseSpMatDescr_t spMatDescr, int* batchCount); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetStridedBatch(hipsparseSpMatDescr_t spMatDescr, int* batchCount); // CHECK: status_t = hipsparseSpMatGetStridedBatch(spMatDescr_t, &batchCount); status_t = cusparseSpMatGetStridedBatch(spMatDescr_t, &batchCount); + + // TODO: Mark as C-Changed in 12.0.0 + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroyDnVec(cusparseDnVecDescr_t dnVecDescr); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroyDnVec(hipsparseDnVecDescr_t dnVecDescr); + // CHECK: status_t = hipsparseDestroyDnVec(dnVecDescr_t); + status_t = cusparseDestroyDnVec(dnVecDescr_t); #endif // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpVecGet(cusparseSpVecDescr_t spVecDescr, int64_t* size, int64_t* nnz, void** indices, void** values, cusparseIndexType_t* idxType, cusparseIndexBase_t* idxBase, cudaDataType* valueType); @@ -1541,11 +1549,6 @@ int main() { // CHECK: status_t = hipsparseCreateDnVec(&dnVecDescr_t, size, values, dataType); status_t = cusparseCreateDnVec(&dnVecDescr_t, size, values, dataType); - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroyDnVec(cusparseConstDnVecDescr_t dnVecDescr); - // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroyDnVec(hipsparseDnVecDescr_t dnVecDescr); - // CHECK: status_t = hipsparseDestroyDnVec(dnVecDescr_t); - status_t = cusparseDestroyDnVec(dnVecDescr_t); - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnVecGet(cusparseDnVecDescr_t dnVecDescr, int64_t* size, void** values, cudaDataType* valueType); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnVecGet(const hipsparseDnVecDescr_t dnVecDescr, int64_t* size, void** values, hipDataType* valueType); // CHECK: status_t = hipsparseDnVecGet(dnVecDescr_t, &size, &values, &dataType); @@ -1749,7 +1752,7 @@ int main() { #if CUDA_VERSION < 12000 // TODO: Mark as C-Changed in 12.0.0 - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetSize(cusparseConstSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz); + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetSize(cusparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetSize(hipsparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz); // CHECK: status_t = hipsparseSpMatGetSize(spMatDescr_t, &rows, &cols, &nnz); status_t = cusparseSpMatGetSize(spMatDescr_t, &rows, &cols, &nnz); @@ -1896,7 +1899,7 @@ int main() { #if CUDA_VERSION < 12000 // TODO: Mark as C-Changed in 12.0.0 - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetAttribute(cusparseConstSpMatDescr_t spMatDescr, cusparseSpMatAttribute_t attribute, void* data, size_t dataSize); + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetAttribute(cusparseSpMatDescr_t spMatDescr, cusparseSpMatAttribute_t attribute, void* data, size_t dataSize); // HIP: hipsparseStatus_t hipsparseSpMatGetAttribute(hipsparseSpMatDescr_t spMatDescr, hipsparseSpMatAttribute_t attribute, void* data, size_t dataSize); // CHECK: status_t = hipsparseSpMatGetAttribute(spMatDescr_t, spMatAttribute_t, &data, dataSize); status_t = cusparseSpMatGetAttribute(spMatDescr_t, spMatAttribute_t, &data, dataSize); @@ -2049,6 +2052,9 @@ int main() { // CHECK: hipsparseConstDnVecDescr_t constDnVecDescr = nullptr; cusparseConstDnVecDescr_t constDnVecDescr = nullptr; + // CHECK: hipsparseConstDnMatDescr_t constDnMatDescr = nullptr; + cusparseConstDnMatDescr_t constDnMatDescr = nullptr; + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateConstSpVec(cusparseConstSpVecDescr_t* spVecDescr, int64_t size, int64_t nnz, const void* indices, const void* values, cusparseIndexType_t idxType, cusparseIndexBase_t idxBase, cudaDataType valueType); // HIP: hipsparseStatus_t hipsparseCreateConstSpVec(hipsparseConstSpVecDescr_t* spVecDescr, int64_t size, int64_t nnz, const void* indices, const void* values, hipsparseIndexType_t idxType, hipsparseIndexBase_t idxBase, hipDataType valueType); // CHECK: status_t = hipsparseCreateConstSpVec(&constSpVecDescr, size, nnz, indices, values, indexType_t, indexBase_t, dataType); @@ -2148,6 +2154,41 @@ int main() { // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateConstDnVec(hipsparseConstDnVecDescr_t* dnVecDescr, int64_t size, const void* values, hipDataType valueType); // CHECK: status_t = hipsparseCreateConstDnVec(&constDnVecDescr, size, values, dataType); status_t = cusparseCreateConstDnVec(&constDnVecDescr, size, values, dataType); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroyDnVec(cusparseConstDnVecDescr_t dnVecDescr); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroyDnVec(hipsparseConstDnVecDescr_t dnVecDescr); + // CHECK: status_t = hipsparseDestroyDnVec(constDnVecDescr); + status_t = cusparseDestroyDnVec(constDnVecDescr); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseConstDnVecGet(cusparseConstDnVecDescr_t dnVecDescr, int64_t* size, const void** values, cudaDataType* valueType); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseConstDnVecGet(hipsparseConstDnVecDescr_t dnVecDescr, int64_t* size, const void** values, hipDataType* valueType); + // CHECK: status_t = hipsparseConstDnVecGet(constDnVecDescr, &size, values_const, &dataType); + status_t = cusparseConstDnVecGet(constDnVecDescr, &size, values_const, &dataType); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateConstDnMat(cusparseConstDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, const void* values, cudaDataType valueType, cusparseOrder_t order); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateConstDnMat(hipsparseConstDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, const void* values, hipDataType valueType, hipsparseOrder_t order); + // CHECK: status_t = hipsparseCreateConstDnMat(&constDnMatDescr, rows, cols, ld, values, dataType, order_t); + status_t = cusparseCreateConstDnMat(&constDnMatDescr, rows, cols, ld, values, dataType, order_t); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroyDnMat(cusparseConstDnMatDescr_t dnMatDescr); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroyDnMat(hipsparseConstDnMatDescr_t dnMatDescr); + // CHECK: status_t = hipsparseDestroyDnMat(constDnMatDescr); + status_t = cusparseDestroyDnMat(constDnMatDescr); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseConstDnMatGet(cusparseConstDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, const void** values, cudaDataType* type, cusparseOrder_t* order); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseConstDnMatGet(hipsparseConstDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, const void** values, hipDataType* valueType, hipsparseOrder_t* order); + // CHECK: status_t = hipsparseConstDnMatGet(constDnMatDescr, &rows, &cols, &ld, values_const, &dataType, &order_t); + status_t = cusparseConstDnMatGet(constDnMatDescr, &rows, &cols, &ld, values_const, &dataType, &order_t); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseConstDnMatGetValues(cusparseConstDnMatDescr_t dnMatDescr, const void** values); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseConstDnMatGetValues(hipsparseConstDnMatDescr_t dnMatDescr, const void** values); + // CHECK: status_t = hipsparseConstDnMatGetValues(constDnMatDescr, values_const); + status_t = cusparseConstDnMatGetValues(constDnMatDescr, values_const); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGetStridedBatch(cusparseConstDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatGetStridedBatch(hipsparseConstDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride); + // CHECK: status_t = hipsparseDnMatGetStridedBatch(constDnMatDescr, &batchCount, &batchStride); + status_t = cusparseDnMatGetStridedBatch(constDnMatDescr, &batchCount, &batchStride); #endif return 0;