diff --git a/bin/hipify-perl b/bin/hipify-perl index 606a1c39..bec494a9 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -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"); @@ -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"); @@ -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"); @@ -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", diff --git a/docs/tables/CUSPARSE_API_supported_by_HIP.md b/docs/tables/CUSPARSE_API_supported_by_HIP.md index 8fc3b178..3730f637 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP.md @@ -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| | | | | @@ -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| | | | | | | | | @@ -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| | | | | | | | | 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 6bf31a54..b78a8bf8 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -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| | | | | | | | | | | @@ -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| | | | | | | | | | | | | | | @@ -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| | | | | | | | | | | | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index ab15b541..69e517ab 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -730,19 +730,19 @@ const std::map 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}}, @@ -764,7 +764,7 @@ const std::map 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}}, @@ -1968,6 +1968,12 @@ const std::map 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 }}, diff --git a/src/CUDA2HIP_SPARSE_API_types.cpp b/src/CUDA2HIP_SPARSE_API_types.cpp index a18e43db..14bdc282 100644 --- a/src/CUDA2HIP_SPARSE_API_types.cpp +++ b/src/CUDA2HIP_SPARSE_API_types.cpp @@ -268,7 +268,7 @@ const std::map 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}}, }; @@ -563,6 +563,7 @@ const std::map 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 }}, diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 08d5c7f7..8183471a 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -186,16 +186,22 @@ int main() { void *values = nullptr; const void** const values_const = const_cast(&values); void *cooRowInd = nullptr; + const void** const cooRowInd_const = const_cast(&cooRowInd); int icooRowInd = 0; void *cscRowInd = nullptr; void *csrColInd = nullptr; + const void** const csrColInd_const = const_cast(&csrColInd); void *cooColInd = nullptr; + const void** const cooColInd_const = const_cast(&cooColInd); void *ellColInd = nullptr; void *cooValues = nullptr; + const void** const cooValues_const = const_cast(&cooValues); void *csrValues = nullptr; + const void** const csrValues_const = const_cast(&csrValues); void *cscValues = nullptr; void *ellValue = nullptr; void *csrRowOffsets = nullptr; + const void** const csrRowOffsets_const = const_cast(&csrRowOffsets); void *cscColOffsets = nullptr; void *cooRows = nullptr; int icooRows = 0; @@ -1393,10 +1399,13 @@ int main() { // CHECK: status_t = hipsparseCreateCoo(&spMatDescr_t, rows, cols, nnz, cooRowInd, cooColInd, cooValues, indexType_t, indexBase_t, dataType); status_t = cusparseCreateCoo(&spMatDescr_t, rows, cols, nnz, cooRowInd, cooColInd, cooValues, indexType_t, indexBase_t, dataType); +#if CUDA_VERSION < 12000 + // TODO: Mark as C-Changed in 12.0.0 // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroySpMat(cusparseConstSpMatDescr_t spMatDescr); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroySpMat(hipsparseSpMatDescr_t spMatDescr); // CHECK: status_t = hipsparseDestroySpMat(spMatDescr_t); status_t = cusparseDestroySpMat(spMatDescr_t); +#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); // HIP: hipsparseStatus_t hipsparseCooGet(const hipsparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, void** cooRowInd, void** cooColInd, void** cooValues, hipsparseIndexType_t* idxType, hipsparseIndexBase_t* idxBase, hipDataType* valueType); @@ -2023,6 +2032,9 @@ int main() { // CHECK: hipsparseConstSpVecDescr_t constSpVecDescr = nullptr; cusparseConstSpVecDescr_t constSpVecDescr = nullptr; + // CHECK: hipsparseConstSpMatDescr_t constSpMatDescr = nullptr; + cusparseConstSpMatDescr_t constSpMatDescr = 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); @@ -2047,6 +2059,41 @@ int main() { // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseConstSpVecGetValues(hipsparseConstSpVecDescr_t spVecDescr, const void** values); // CHECK: status_t = hipsparseConstSpVecGetValues(constSpVecDescr, values_const); status_t = cusparseConstSpVecGetValues(constSpVecDescr, values_const); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateConstCoo(cusparseConstSpMatDescr_t* spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void* cooRowInd, const void* cooColInd, const void* cooValues, cusparseIndexType_t cooIdxType, cusparseIndexBase_t idxBase, cudaDataType valueType); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateConstCoo(hipsparseConstSpMatDescr_t* spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void* cooRowInd, const void* cooColInd, const void* cooValues, hipsparseIndexType_t cooIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType); + // CHECK: status_t = hipsparseCreateConstCoo(&constSpMatDescr, rows, cols, nnz, cooRowInd, cooColInd, cooValues, indexType_t, indexBase_t, dataType); + status_t = cusparseCreateConstCoo(&constSpMatDescr, rows, cols, nnz, cooRowInd, cooColInd, cooValues, indexType_t, indexBase_t, dataType); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateConstCsr(cusparseConstSpMatDescr_t* spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void* csrRowOffsets, const void* csrColInd, const void* csrValues, cusparseIndexType_t csrRowOffsetsType, cusparseIndexType_t csrColIndType, cusparseIndexBase_t idxBase, cudaDataType valueType); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateConstCsr(hipsparseConstSpMatDescr_t* spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void* csrRowOffsets, const void* csrColInd, const void* csrValues, hipsparseIndexType_t csrRowOffsetsType, hipsparseIndexType_t csrColIndType, hipsparseIndexBase_t idxBase, hipDataType valueType); + // CHECK: status_t = hipsparseCreateConstCsr(&constSpMatDescr, rows, cols, nnz, csrRowOffsets, csrColInd, csrValues, csrRowOffsetsType, csrColIndType, indexBase_t, dataType); + status_t = cusparseCreateConstCsr(&constSpMatDescr, rows, cols, nnz, csrRowOffsets, csrColInd, csrValues, csrRowOffsetsType, csrColIndType, indexBase_t, dataType); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateConstCsc(cusparseConstSpMatDescr_t* spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void* cscColOffsets, const void* cscRowInd, const void* cscValues, cusparseIndexType_t cscColOffsetsType, cusparseIndexType_t cscRowIndType, cusparseIndexBase_t idxBase, cudaDataType valueType); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateConstCsc(hipsparseConstSpMatDescr_t* spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void* cscColOffsets, const void* cscRowInd, const void* cscValues, hipsparseIndexType_t cscColOffsetsType, hipsparseIndexType_t cscRowIndType, hipsparseIndexBase_t idxBase, hipDataType valueType); + // CHECK: status_t = hipsparseCreateConstCsc(&constSpMatDescr, rows, cols, nnz, cscColOffsets, cscRowInd, cscValues, cscColOffsetsType, cscRowIndType, indexBase_t, dataType); + status_t = cusparseCreateConstCsc(&constSpMatDescr, rows, cols, nnz, cscColOffsets, cscRowInd, cscValues, cscColOffsetsType, cscRowIndType, indexBase_t, dataType); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateConstBlockedEll(cusparseConstSpMatDescr_t* spMatDescr, int64_t rows, int64_t cols, int64_t ellBlockSize, int64_t ellCols, const void* ellColInd, const void* ellValue, cusparseIndexType_t ellIdxType, cusparseIndexBase_t idxBase, cudaDataType valueType); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateConstBlockedEll(hipsparseConstSpMatDescr_t* spMatDescr, int64_t rows, int64_t cols, int64_t ellBlockSize, int64_t ellCols, const void* ellColInd, const void* ellValue, hipsparseIndexType_t ellIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType); + // CHECK: status_t = hipsparseCreateConstBlockedEll(&constSpMatDescr, rows, cols, ellBlockSize, ellCols, ellColInd, ellValue, ellIdxType, indexBase_t, dataType); + status_t = cusparseCreateConstBlockedEll(&constSpMatDescr, rows, cols, ellBlockSize, ellCols, ellColInd, ellValue, ellIdxType, indexBase_t, dataType); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroySpMat(cusparseConstSpMatDescr_t spMatDescr); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroySpMat(hipsparseConstSpMatDescr_t spMatDescr); + // CHECK: status_t = hipsparseDestroySpMat(constSpMatDescr); + status_t = cusparseDestroySpMat(constSpMatDescr); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseConstCooGet(cusparseConstSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, const void** cooRowInd, const void** cooColInd, const void** cooValues, cusparseIndexType_t* idxType, cusparseIndexBase_t* idxBase, cudaDataType* valueType); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseConstCooGet(hipsparseConstSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, const void** cooRowInd, const void** cooColInd, const void** cooValues, hipsparseIndexType_t* idxType, hipsparseIndexBase_t* idxBase, hipDataType* valueType); + // CHECK: status_t = hipsparseConstCooGet(constSpMatDescr, &rows, &cols, &nnz, cooRowInd_const, cooColInd_const, cooValues_const, &indexType_t, &indexBase_t, &dataType); + status_t = cusparseConstCooGet(constSpMatDescr, &rows, &cols, &nnz, cooRowInd_const, cooColInd_const, cooValues_const, &indexType_t, &indexBase_t, &dataType); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseConstCsrGet(cusparseConstSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, const void** csrRowOffsets, const void** csrColInd, const void** csrValues, cusparseIndexType_t* csrRowOffsetsType, cusparseIndexType_t* csrColIndType, cusparseIndexBase_t* idxBase, cudaDataType* valueType); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseConstCsrGet(hipsparseConstSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, const void** csrRowOffsets, const void** csrColInd, const void** csrValues, hipsparseIndexType_t* csrRowOffsetsType, hipsparseIndexType_t* csrColIndType, hipsparseIndexBase_t* idxBase, hipDataType* valueType); + // CHECK: status_t = hipsparseConstCsrGet(constSpMatDescr, &rows, &cols, &nnz, csrRowOffsets_const, csrColInd_const, csrValues_const, &csrRowOffsetsType, &csrColIndType, &indexBase_t, &dataType); + status_t = cusparseConstCsrGet(constSpMatDescr, &rows, &cols, &nnz, csrRowOffsets_const, csrColInd_const, csrValues_const, &csrRowOffsetsType, &csrColIndType, &indexBase_t, &dataType); #endif return 0;