diff --git a/bin/hipify-perl b/bin/hipify-perl index bec494a9..f23d0fcc 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -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"); @@ -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"); @@ -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"); @@ -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", diff --git a/docs/tables/CUSPARSE_API_supported_by_HIP.md b/docs/tables/CUSPARSE_API_supported_by_HIP.md index 3730f637..eec52013 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP.md @@ -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`| | | | | | | | | | @@ -801,7 +801,7 @@ |`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| @@ -809,7 +809,7 @@ |`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| | | | | | | @@ -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| | | | | 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 b78a8bf8..a0fcc5c6 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -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| | | | | @@ -801,7 +801,7 @@ |`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| | | | | | | @@ -809,7 +809,7 @@ |`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| | | | | | | | | | | | | @@ -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| | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index 69e517ab..eeb0eaa4 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -752,7 +752,7 @@ const std::map 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}}, @@ -762,7 +762,7 @@ const std::map 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}}, @@ -796,7 +796,7 @@ const std::map 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}}, @@ -1974,6 +1974,9 @@ const std::map 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 }}, diff --git a/src/CUDA2HIP_SPARSE_API_types.cpp b/src/CUDA2HIP_SPARSE_API_types.cpp index 14bdc282..8fa0e887 100644 --- a/src/CUDA2HIP_SPARSE_API_types.cpp +++ b/src/CUDA2HIP_SPARSE_API_types.cpp @@ -267,7 +267,7 @@ const std::map 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}}, }; @@ -564,6 +564,7 @@ const std::map 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 }}, diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 8183471a..951e9d81 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -194,12 +194,14 @@ int main() { void *cooColInd = nullptr; const void** const cooColInd_const = const_cast(&cooColInd); void *ellColInd = nullptr; + const void** const ellColInd_const = const_cast(&ellColInd); 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; + const void** const ellValue_const = const_cast(&ellValue); void *csrRowOffsets = nullptr; const void** const csrRowOffsets_const = const_cast(&csrRowOffsets); void *cscColOffsets = nullptr; @@ -1405,22 +1407,24 @@ int main() { // 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); - // CHECK: status_t = hipsparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType); - status_t = cusparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType); + // TODO: Mark as C-Changed in 12.0.0 // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetFormat(cusparseConstSpMatDescr_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); // 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); +#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); + // CHECK: status_t = hipsparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType); + status_t = cusparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType); // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateDnMat(cusparseDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void* values, cudaDataType valueType, cusparseOrder_t order); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateDnMat(hipsparseDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void* values, hipDataType valueType, hipsparseOrder_t order); @@ -1489,6 +1493,12 @@ int main() { // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpVecGetIndexBase(const hipsparseSpVecDescr_t spVecDescr, hipsparseIndexBase_t* idxBase); // CHECK: status_t = hipsparseSpVecGetIndexBase(spVecDescr_t, &indexBase_t); 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); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetStridedBatch(hipsparseSpMatDescr_t spMatDescr, int* batchCount); + // CHECK: status_t = hipsparseSpMatGetStridedBatch(spMatDescr_t, &batchCount); + status_t = cusparseSpMatGetStridedBatch(spMatDescr_t, &batchCount); #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); @@ -1526,11 +1536,6 @@ int main() { // CHECK: status_t = hipsparseSpMatSetValues(spMatDescr_t, values); status_t = cusparseSpMatSetValues(spMatDescr_t, values); - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetStridedBatch(cusparseConstSpMatDescr_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); - // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateDnVec(cusparseDnVecDescr_t* dnVecDescr, int64_t size, void* values, cudaDataType valueType); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateDnVec(hipsparseDnVecDescr_t* dnVecDescr, int64_t size, void* values, hipDataType valueType); // CHECK: status_t = hipsparseCreateDnVec(&dnVecDescr_t, size, values, dataType); @@ -1742,11 +1747,14 @@ int main() { // CHECK: status_t = hipsparseCsrSetPointers(spMatDescr_t, csrRowOffsets, csrColInd, csrValues); status_t = cusparseCsrSetPointers(spMatDescr_t, csrRowOffsets, csrColInd, csrValues); +#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); // 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); #endif +#endif #if CUDA_VERSION >= 11000 && CUSPARSE_VERSION >= 11100 // CHECK: hipsparseSpMMAlg_t SPMM_ALG_DEFAULT = HIPSPARSE_SPMM_ALG_DEFAULT; @@ -1886,10 +1894,13 @@ int main() { cusparseSpSVAlg_t spSVAlg_t; cusparseSpSVAlg_t SPSV_ALG_DEFAULT = CUSPARSE_SPSV_ALG_DEFAULT; +#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); // 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); +#endif // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatSetAttribute(cusparseSpMatDescr_t spMatDescr, cusparseSpMatAttribute_t attribute, void* data, size_t dataSize); // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatSetAttribute(hipsparseSpMatDescr_t spMatDescr, hipsparseSpMatAttribute_t attribute, const void* data, size_t dataSize); @@ -2035,6 +2046,9 @@ int main() { // CHECK: hipsparseConstSpMatDescr_t constSpMatDescr = nullptr; cusparseConstSpMatDescr_t constSpMatDescr = nullptr; + // CHECK: hipsparseConstDnVecDescr_t constDnVecDescr = nullptr; + cusparseConstDnVecDescr_t constDnVecDescr = 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); @@ -2094,6 +2108,46 @@ int main() { // 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); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseConstBlockedEllGet(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 hipsparseConstBlockedEllGet(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 = hipsparseConstBlockedEllGet(constSpMatDescr, &rows, &cols, &ellBlockSize, &ellCols, ellColInd_const, ellValue_const, &ellIdxType, &indexBase_t, &dataType); + status_t = cusparseConstBlockedEllGet(constSpMatDescr, &rows, &cols, &ellBlockSize, &ellCols, ellColInd_const, ellValue_const, &ellIdxType, &indexBase_t, &dataType); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetSize(cusparseConstSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetSize(hipsparseConstSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz); + // CHECK: status_t = hipsparseSpMatGetSize(constSpMatDescr, &rows, &cols, &nnz); + status_t = cusparseSpMatGetSize(constSpMatDescr, &rows, &cols, &nnz); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetFormat(cusparseConstSpMatDescr_t spMatDescr, cusparseFormat_t* format); + // HIP: hipsparseStatus_t hipsparseSpMatGetFormat(hipsparseConstSpMatDescr_t spMatDescr, hipsparseFormat_t* format); + // CHECK: status_t = hipsparseSpMatGetFormat(constSpMatDescr, &format_t); + status_t = cusparseSpMatGetFormat(constSpMatDescr, &format_t); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetIndexBase(cusparseConstSpMatDescr_t spMatDescr, cusparseIndexBase_t* idxBase); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetIndexBase(hipsparseConstSpMatDescr_t spMatDescr, hipsparseIndexBase_t* idxBase); + // CHECK: status_t = hipsparseSpMatGetIndexBase(constSpMatDescr, &indexBase_t); + status_t = cusparseSpMatGetIndexBase(constSpMatDescr, &indexBase_t); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseConstSpMatGetValues(cusparseConstSpMatDescr_t spMatDescr, const void** values); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseConstSpMatGetValues(hipsparseConstSpMatDescr_t spMatDescr, const void** values); + // CHECK: status_t = hipsparseConstSpMatGetValues(constSpMatDescr, values_const); + status_t = cusparseConstSpMatGetValues(constSpMatDescr, values_const); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetStridedBatch(cusparseConstSpMatDescr_t spMatDescr, int* batchCount); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetStridedBatch(hipsparseConstSpMatDescr_t spMatDescr, int* batchCount); + // CHECK: status_t = hipsparseSpMatGetStridedBatch(constSpMatDescr, &batchCount); + status_t = cusparseSpMatGetStridedBatch(constSpMatDescr, &batchCount); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMatGetAttribute(cusparseConstSpMatDescr_t spMatDescr, cusparseSpMatAttribute_t attribute, void* data, size_t dataSize); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSpMatGetAttribute(hipsparseConstSpMatDescr_t spMatDescr, hipsparseSpMatAttribute_t attribute, void* data, size_t dataSize); + // CHECK: status_t = hipsparseSpMatGetAttribute(constSpMatDescr, spMatAttribute_t, &data, dataSize); + status_t = cusparseSpMatGetAttribute(constSpMatDescr, spMatAttribute_t, &data, dataSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateConstDnVec(cusparseConstDnVecDescr_t* dnVecDescr, int64_t size, const void* values, cudaDataType valueType); + // 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); #endif return 0;