diff --git a/bin/hipify-perl b/bin/hipify-perl index 6517f75b..9d0d48fa 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1795,6 +1795,7 @@ sub rocSubstitutions { subst("cusparseCgebsr2gebsc_bufferSize", "rocsparse_cgebsr2gebsc_buffer_size", "library"); subst("cusparseCgebsr2gebsr", "rocsparse_cgebsr2gebsr", "library"); subst("cusparseCgebsr2gebsr_bufferSize", "rocsparse_cgebsr2gebsr_buffer_size", "library"); + subst("cusparseCgemvi", "rocsparse_cgemvi", "library"); subst("cusparseCgpsvInterleavedBatch", "rocsparse_cgpsv_interleaved_batch", "library"); subst("cusparseCgpsvInterleavedBatch_bufferSizeExt", "rocsparse_cgpsv_interleaved_batch_buffer_size", "library"); subst("cusparseCgtsv2", "rocsparse_cgtsv", "library"); @@ -1877,6 +1878,7 @@ sub rocSubstitutions { subst("cusparseDgebsr2gebsc_bufferSize", "rocsparse_dgebsr2gebsc_buffer_size", "library"); subst("cusparseDgebsr2gebsr", "rocsparse_dgebsr2gebsr", "library"); subst("cusparseDgebsr2gebsr_bufferSize", "rocsparse_dgebsr2gebsr_buffer_size", "library"); + subst("cusparseDgemvi", "rocsparse_dgemvi", "library"); subst("cusparseDgpsvInterleavedBatch", "rocsparse_dgpsv_interleaved_batch", "library"); subst("cusparseDgpsvInterleavedBatch_bufferSizeExt", "rocsparse_dgpsv_interleaved_batch_buffer_size", "library"); subst("cusparseDgtsv2", "rocsparse_dgtsv", "library"); @@ -1968,6 +1970,7 @@ sub rocSubstitutions { subst("cusparseSgebsr2gebsc_bufferSize", "rocsparse_sgebsr2gebsc_buffer_size", "library"); subst("cusparseSgebsr2gebsr", "rocsparse_sgebsr2gebsr", "library"); subst("cusparseSgebsr2gebsr_bufferSize", "rocsparse_sgebsr2gebsr_buffer_size", "library"); + subst("cusparseSgemvi", "rocsparse_sgemvi", "library"); subst("cusparseSgpsvInterleavedBatch", "rocsparse_sgpsv_interleaved_batch", "library"); subst("cusparseSgpsvInterleavedBatch_bufferSizeExt", "rocsparse_sgpsv_interleaved_batch_buffer_size", "library"); subst("cusparseSgtsv2", "rocsparse_sgtsv", "library"); @@ -2066,6 +2069,7 @@ sub rocSubstitutions { subst("cusparseZgebsr2gebsc_bufferSize", "rocsparse_zgebsr2gebsc_buffer_size", "library"); subst("cusparseZgebsr2gebsr", "rocsparse_zgebsr2gebsr", "library"); subst("cusparseZgebsr2gebsr_bufferSize", "rocsparse_zgebsr2gebsr_buffer_size", "library"); + subst("cusparseZgemvi", "rocsparse_zgemvi", "library"); subst("cusparseZgpsvInterleavedBatch", "rocsparse_zgpsv_interleaved_batch", "library"); subst("cusparseZgpsvInterleavedBatch_bufferSizeExt", "rocsparse_zgpsv_interleaved_batch_buffer_size", "library"); subst("cusparseZgtsv2", "rocsparse_zgtsv", "library"); 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 e19afbc7..7a0324fa 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -306,7 +306,7 @@ |`cusparseCcsrsv2_solve`| |11.3| |12.0|`hipsparseCcsrsv2_solve`|3.1.0| | | | | | | | | | | |`cusparseCcsrsv_analysis`| |10.2| |11.0| | | | | | | | | | | | | |`cusparseCcsrsv_solve`| |10.2| |11.0| | | | | | | | | | | | | -|`cusparseCgemvi`|7.5| | | |`hipsparseCgemvi`|4.3.0| | | | | | | | | | | +|`cusparseCgemvi`|7.5| | | |`hipsparseCgemvi`|4.3.0| | | | |`rocsparse_cgemvi`|4.3.0| | | | | |`cusparseCgemvi_bufferSize`|7.5| | | |`hipsparseCgemvi_bufferSize`|4.3.0| | | | | | | | | | | |`cusparseChybmv`| |10.2| |11.0|`hipsparseChybmv`|3.1.0| | | | | | | | | | | |`cusparseChybsv_analysis`| |10.2| |11.0| | | | | | | | | | | | | @@ -329,7 +329,7 @@ |`cusparseDcsrsv2_solve`| |11.3| |12.0|`hipsparseDcsrsv2_solve`|1.9.2| | | | | | | | | | | |`cusparseDcsrsv_analysis`| |10.2| |11.0| | | | | | | | | | | | | |`cusparseDcsrsv_solve`| |10.2| |11.0| | | | | | | | | | | | | -|`cusparseDgemvi`|7.5| | | |`hipsparseDgemvi`|4.3.0| | | | | | | | | | | +|`cusparseDgemvi`|7.5| | | |`hipsparseDgemvi`|4.3.0| | | | |`rocsparse_dgemvi`|4.3.0| | | | | |`cusparseDgemvi_bufferSize`|7.5| | | |`hipsparseDgemvi_bufferSize`|4.3.0| | | | | | | | | | | |`cusparseDhybmv`| |10.2| |11.0|`hipsparseDhybmv`|1.9.2| | | | | | | | | | | |`cusparseDhybsv_analysis`| |10.2| |11.0| | | | | | | | | | | | | @@ -348,7 +348,7 @@ |`cusparseScsrsv2_solve`| |11.3| |12.0|`hipsparseScsrsv2_solve`|1.9.2| | | | | | | | | | | |`cusparseScsrsv_analysis`| |10.2| |11.0| | | | | | | | | | | | | |`cusparseScsrsv_solve`| |10.2| |11.0| | | | | | | | | | | | | -|`cusparseSgemvi`|7.5| | | |`hipsparseSgemvi`|4.3.0| | | | | | | | | | | +|`cusparseSgemvi`|7.5| | | |`hipsparseSgemvi`|4.3.0| | | | |`rocsparse_sgemvi`|4.3.0| | | | | |`cusparseSgemvi_bufferSize`|7.5| | | |`hipsparseSgemvi_bufferSize`|4.3.0| | | | | | | | | | | |`cusparseShybmv`| |10.2| |11.0|`hipsparseShybmv`|1.9.2| | | | | | | | | | | |`cusparseShybsv_analysis`| |10.2| |11.0| | | | | | | | | | | | | @@ -369,7 +369,7 @@ |`cusparseZcsrsv2_solve`| |11.3| |12.0|`hipsparseZcsrsv2_solve`|3.1.0| | | | | | | | | | | |`cusparseZcsrsv_analysis`| |10.2| |11.0| | | | | | | | | | | | | |`cusparseZcsrsv_solve`| |10.2| |11.0| | | | | | | | | | | | | -|`cusparseZgemvi`|7.5| | | |`hipsparseZgemvi`|4.3.0| | | | | | | | | | | +|`cusparseZgemvi`|7.5| | | |`hipsparseZgemvi`|4.3.0| | | | |`rocsparse_zgemvi`|4.3.0| | | | | |`cusparseZgemvi_bufferSize`|7.5| | | |`hipsparseZgemvi_bufferSize`|4.3.0| | | | | | | | | | | |`cusparseZhybmv`| |10.2| |11.0|`hipsparseZhybmv`|3.1.0| | | | | | | | | | | |`cusparseZhybsv_analysis`| |10.2| |11.0| | | | | | | | | | | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index 8e060798..e527c6d5 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -306,7 +306,7 @@ |`cusparseCcsrsv2_solve`| |11.3| |12.0| | | | | | | |`cusparseCcsrsv_analysis`| |10.2| |11.0| | | | | | | |`cusparseCcsrsv_solve`| |10.2| |11.0| | | | | | | -|`cusparseCgemvi`|7.5| | | | | | | | | | +|`cusparseCgemvi`|7.5| | | |`rocsparse_cgemvi`|4.3.0| | | | | |`cusparseCgemvi_bufferSize`|7.5| | | | | | | | | | |`cusparseChybmv`| |10.2| |11.0| | | | | | | |`cusparseChybsv_analysis`| |10.2| |11.0| | | | | | | @@ -329,7 +329,7 @@ |`cusparseDcsrsv2_solve`| |11.3| |12.0| | | | | | | |`cusparseDcsrsv_analysis`| |10.2| |11.0| | | | | | | |`cusparseDcsrsv_solve`| |10.2| |11.0| | | | | | | -|`cusparseDgemvi`|7.5| | | | | | | | | | +|`cusparseDgemvi`|7.5| | | |`rocsparse_dgemvi`|4.3.0| | | | | |`cusparseDgemvi_bufferSize`|7.5| | | | | | | | | | |`cusparseDhybmv`| |10.2| |11.0| | | | | | | |`cusparseDhybsv_analysis`| |10.2| |11.0| | | | | | | @@ -348,7 +348,7 @@ |`cusparseScsrsv2_solve`| |11.3| |12.0| | | | | | | |`cusparseScsrsv_analysis`| |10.2| |11.0| | | | | | | |`cusparseScsrsv_solve`| |10.2| |11.0| | | | | | | -|`cusparseSgemvi`|7.5| | | | | | | | | | +|`cusparseSgemvi`|7.5| | | |`rocsparse_sgemvi`|4.3.0| | | | | |`cusparseSgemvi_bufferSize`|7.5| | | | | | | | | | |`cusparseShybmv`| |10.2| |11.0| | | | | | | |`cusparseShybsv_analysis`| |10.2| |11.0| | | | | | | @@ -369,7 +369,7 @@ |`cusparseZcsrsv2_solve`| |11.3| |12.0| | | | | | | |`cusparseZcsrsv_analysis`| |10.2| |11.0| | | | | | | |`cusparseZcsrsv_solve`| |10.2| |11.0| | | | | | | -|`cusparseZgemvi`|7.5| | | | | | | | | | +|`cusparseZgemvi`|7.5| | | |`rocsparse_zgemvi`|4.3.0| | | | | |`cusparseZgemvi_bufferSize`|7.5| | | | | | | | | | |`cusparseZhybmv`| |10.2| |11.0| | | | | | | |`cusparseZhybsv_analysis`| |10.2| |11.0| | | | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index 9f1019e9..dcf1c40b 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -139,10 +139,10 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseCcsrmv_mp", {"hipsparseCcsrmv_mp", "", CONV_LIB_FUNC, API_SPARSE, 9, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, {"cusparseZcsrmv_mp", {"hipsparseZcsrmv_mp", "", CONV_LIB_FUNC, API_SPARSE, 9, UNSUPPORTED | CUDA_DEPRECATED | CUDA_REMOVED}}, - {"cusparseSgemvi", {"hipsparseSgemvi", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED}}, - {"cusparseDgemvi", {"hipsparseDgemvi", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED}}, - {"cusparseCgemvi", {"hipsparseCgemvi", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED}}, - {"cusparseZgemvi", {"hipsparseZgemvi", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED}}, + {"cusparseSgemvi", {"hipsparseSgemvi", "rocsparse_sgemvi", CONV_LIB_FUNC, API_SPARSE, 9}}, + {"cusparseDgemvi", {"hipsparseDgemvi", "rocsparse_dgemvi", CONV_LIB_FUNC, API_SPARSE, 9}}, + {"cusparseCgemvi", {"hipsparseCgemvi", "rocsparse_cgemvi", CONV_LIB_FUNC, API_SPARSE, 9}}, + {"cusparseZgemvi", {"hipsparseZgemvi", "rocsparse_zgemvi", CONV_LIB_FUNC, API_SPARSE, 9}}, {"cusparseSgemvi_bufferSize", {"hipsparseSgemvi_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED}}, {"cusparseDgemvi_bufferSize", {"hipsparseDgemvi_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 9, ROC_UNSUPPORTED}}, @@ -2311,6 +2311,10 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_cbsrmm", {HIP_3070, HIP_0, HIP_0 }}, {"rocsparse_dbsrmm", {HIP_3070, HIP_0, HIP_0 }}, {"rocsparse_sbsrmm", {HIP_3070, HIP_0, HIP_0 }}, + {"rocsparse_sgemvi", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_dgemvi", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_cgemvi", {HIP_4030, HIP_0, HIP_0 }}, + {"rocsparse_zgemvi", {HIP_4030, HIP_0, HIP_0 }}, }; const std::map CUDA_SPARSE_FUNCTION_CHANGED_VER_MAP { diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 413a5708..43adcc08 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -179,6 +179,7 @@ int main() { int userEllWidth = 0; int ienable_boost = 0; int iposition = 0; + int xInd = 0; int64_t size = 0; int64_t nnz = 0; int64_t rows = 0; @@ -271,13 +272,19 @@ int main() { double dbscVal = 0.f; float fbscVal = 0.f; double dA = 0.f; + double dAlpha = 0.f; double dB = 0.f; double dBeta = 0.f; double dC = 0.f; + double dX = 0.f; + double dY = 0.f; float fA = 0.f; + float fAlpha = 0.f; float fB = 0.f; float fBeta = 0.f; float fC = 0.f; + float fX = 0.f; + float fY = 0.f; int algo = 0; double dds = 0.f; double ddl = 0.f; @@ -301,11 +308,11 @@ int main() { bsric02Info_t bsric02_info; bsrsm2Info_t bsrsm2_info; - // CHECK: hipDoubleComplex dcomplex, dcomplexA, dcomplexB, dcomplexBeta, dcomplexC, dcomplexX, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; - cuDoubleComplex dcomplex, dcomplexA, dcomplexB, dcomplexBeta, dcomplexC, dcomplexX, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; + // CHECK: hipDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; + cuDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; - // CHECK: hipComplex complex, complexA, complexB, complexBeta, complexC, complexX, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; - cuComplex complex, complexA, complexB, complexBeta, complexC, complexX, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; + // CHECK: hipComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; + cuComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; // CHECK: hipsparseOperation_t opA, opB, opX; cusparseOperation_t opA, opB, opX; @@ -1070,6 +1077,28 @@ int main() { // CHECK: status_t = hipsparseSbsrmm(handle_t, direction_t, opA, opB, mb, n, kb, nnzb, &fA, matDescr_A, &fbscVal, &bsrRowPtrA, &bsrColIndA, blockDim, &fB, ldb, &fBeta, &fC, ldc); status_t = cusparseSbsrmm(handle_t, direction_t, opA, opB, mb, n, kb, nnzb, &fA, matDescr_A, &fbscVal, &bsrRowPtrA, &bsrColIndA, blockDim, &fB, ldb, &fBeta, &fC, ldc); +#if CUDA_VERSION >= 7050 + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseZgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const cuDoubleComplex* alpha, const cuDoubleComplex* A, int lda, int nnz, const cuDoubleComplex* xVal, const int* xInd, const cuDoubleComplex* beta, cuDoubleComplex* y, cusparseIndexBase_t idxBase, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const hipDoubleComplex* alpha, const hipDoubleComplex* A, int lda, int nnz, const hipDoubleComplex* x, const int* xInd, const hipDoubleComplex* beta, hipDoubleComplex* y, hipsparseIndexBase_t idxBase, void* pBuffer); + // CHECK: status_t = hipsparseZgemvi(handle_t, opA, m, n, &dcomplexAlpha, &dcomplexA, lda, innz, &dcomplexX, &xInd, &dcomplexBeta, &dcomplexY, indexBase_t, pBuffer); + status_t = cusparseZgemvi(handle_t, opA, m, n, &dcomplexAlpha, &dcomplexA, lda, innz, &dcomplexX, &xInd, &dcomplexBeta, &dcomplexY, indexBase_t, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const cuComplex* alpha, const cuComplex* A, int lda, int nnz, const cuComplex* xVal, const int* xInd, const cuComplex* beta, cuComplex* y, cusparseIndexBase_t idxBase, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const hipComplex* alpha, const hipComplex* A, int lda, int nnz, const hipComplex* x, const int* xInd, const hipComplex* beta, hipComplex* y, hipsparseIndexBase_t idxBase, void* pBuffer); + // CHECK: status_t = hipsparseCgemvi(handle_t, opA, m, n, &complexAlpha, &complexA, lda, innz, &complexX, &xInd, &complexBeta, &complexY, indexBase_t, pBuffer); + status_t = cusparseCgemvi(handle_t, opA, m, n, &complexAlpha, &complexA, lda, innz, &complexX, &xInd, &complexBeta, &complexY, indexBase_t, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const double* alpha, const double* A, int lda, int nnz, const double* xVal, const int* xInd, const double* beta, double* y, cusparseIndexBase_t idxBase, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const double* alpha, const double* A, int lda, int nnz, const double* x, const int* xInd, const double* beta, double* y, hipsparseIndexBase_t idxBase, void* pBuffer); + // CHECK: status_t = hipsparseDgemvi(handle_t, opA, m, n, &dAlpha, &dA, lda, innz, &dX, &xInd, &dBeta, &dY, indexBase_t, pBuffer); + status_t = cusparseDgemvi(handle_t, opA, m, n, &dAlpha, &dA, lda, innz, &dX, &xInd, &dBeta, &dY, indexBase_t, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const float* alpha, const float* A, int lda, int nnz, const float* xVal, const int* xInd, const float* beta, float* y, cusparseIndexBase_t idxBase, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const float* alpha, const float* A, int lda, int nnz, const float* x, const int* xInd, const float* beta, float* y, hipsparseIndexBase_t idxBase, void* pBuffer); + // CHECK: status_t = hipsparseSgemvi(handle_t, opA, m, n, &fAlpha, &fA, lda, innz, &fX, &xInd, &fBeta, &fY, indexBase_t, pBuffer); + status_t = cusparseSgemvi(handle_t, opA, m, n, &fAlpha, &fA, lda, innz, &fX, &xInd, &fBeta, &fY, indexBase_t, pBuffer); +#endif + #if CUDA_VERSION >= 8000 // CHECK: hipDataType dataType_t; // CHECK-NEXT: hipDataType dataType; diff --git a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu index 3459d004..8da03814 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -179,6 +179,7 @@ int main() { int userEllWidth = 0; int ienable_boost = 0; int iposition = 0; + int xInd = 0; int64_t size = 0; int64_t nnz = 0; int64_t rows = 0; @@ -251,13 +252,19 @@ int main() { double dbscVal = 0.f; float fbscVal = 0.f; double dA = 0.f; + double dAlpha = 0.f; double dB = 0.f; double dBeta = 0.f; double dC = 0.f; + double dX = 0.f; + double dY = 0.f; float fA = 0.f; + float fAlpha = 0.f; float fB = 0.f; float fBeta = 0.f; float fC = 0.f; + float fX = 0.f; + float fY = 0.f; int algo = 0; double dds = 0.f; double ddl = 0.f; @@ -291,13 +298,13 @@ int main() { // TODO: should be rocsparse_double_complex // TODO: add to TypeOverloads cuDoubleComplex -> rocsparse_double_complex under a new option --sparse - // CHECK: rocblas_double_complex dcomplex, dcomplexA, dcomplexB, dcomplexBeta, dcomplexC, dcomplexX, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; - cuDoubleComplex dcomplex, dcomplexA, dcomplexB, dcomplexBeta, dcomplexC, dcomplexX, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; + // CHECK: rocblas_double_complex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; + cuDoubleComplex dcomplex, dcomplexA, dcomplexAlpha, dcomplexB, dcomplexBeta, dcomplexC, dcomplexX, dcomplexY, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValB, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; // TODO: should be rocsparse_double_complex // TODO: add to TypeOverloads cuComplex -> rocsparse_float_complex under a new option --sparse - // CHECK: rocblas_float_complex complex, complexA, complexB, complexBeta, complexC, complexX, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; - cuComplex complex, complexA, complexB, complexBeta, complexC, complexX, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; + // CHECK: rocblas_float_complex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; + cuComplex complex, complexA, complexAlpha, complexB, complexBeta, complexC, complexX, complexY, complexbsrValA, complexbsrSortedValC, complexcsrSortedValA, complexcsrSortedValB, complexcsrSortedValC, complextol, complexbsrSortedVal, complexbscVal, complexcscSortedVal, complexds, complexdl, complexd, complexdu, complexdw, complexx, complex_boost_val; // CHECK: rocsparse_operation opA, opB, opX; cusparseOperation_t opA, opB, opX; @@ -1063,6 +1070,28 @@ int main() { // CHECK: status_t = rocsparse_sbsrmm(handle_t, direction_t, opA, opB, mb, n, kb, nnzb, &fA, matDescr_A, &fbscVal, &bsrRowPtrA, &bsrColIndA, blockDim, &fB, ldb, &fBeta, &fC, ldc); status_t = cusparseSbsrmm(handle_t, direction_t, opA, opB, mb, n, kb, nnzb, &fA, matDescr_A, &fbscVal, &bsrRowPtrA, &bsrColIndA, blockDim, &fB, ldb, &fBeta, &fC, ldc); +#if CUDA_VERSION >= 7050 + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseZgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const cuDoubleComplex* alpha, const cuDoubleComplex* A, int lda, int nnz, const cuDoubleComplex* xVal, const int* xInd, const cuDoubleComplex* beta, cuDoubleComplex* y, cusparseIndexBase_t idxBase, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zgemvi(rocsparse_handle handle, rocsparse_operation trans, rocsparse_int m, rocsparse_int n, const rocsparse_double_complex* alpha, const rocsparse_double_complex* A, rocsparse_int lda, rocsparse_int nnz, const rocsparse_double_complex* x_val, const rocsparse_int* x_ind, const rocsparse_double_complex* beta, rocsparse_double_complex* y, rocsparse_index_base idx_base,void* temp_buffer); + // CHECK: status_t = rocsparse_zgemvi(handle_t, opA, m, n, &dcomplexAlpha, &dcomplexA, lda, innz, &dcomplexX, &xInd, &dcomplexBeta, &dcomplexY, indexBase_t, pBuffer); + status_t = cusparseZgemvi(handle_t, opA, m, n, &dcomplexAlpha, &dcomplexA, lda, innz, &dcomplexX, &xInd, &dcomplexBeta, &dcomplexY, indexBase_t, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const cuComplex* alpha, const cuComplex* A, int lda, int nnz, const cuComplex* xVal, const int* xInd, const cuComplex* beta, cuComplex* y, cusparseIndexBase_t idxBase, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cgemvi(rocsparse_handle handle, rocsparse_operation trans, rocsparse_int m, rocsparse_int n, const rocsparse_float_complex* alpha, const rocsparse_float_complex* A, rocsparse_int lda, rocsparse_int nnz, const rocsparse_float_complex* x_val, const rocsparse_int* x_ind, const rocsparse_float_complex* beta, rocsparse_float_complex* y, rocsparse_index_base idx_base, void* temp_buffer); + // CHECK: status_t = rocsparse_cgemvi(handle_t, opA, m, n, &complexAlpha, &complexA, lda, innz, &complexX, &xInd, &complexBeta, &complexY, indexBase_t, pBuffer); + status_t = cusparseCgemvi(handle_t, opA, m, n, &complexAlpha, &complexA, lda, innz, &complexX, &xInd, &complexBeta, &complexY, indexBase_t, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseDgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const double* alpha, const double* A, int lda, int nnz, const double* xVal, const int* xInd, const double* beta, double* y, cusparseIndexBase_t idxBase, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dgemvi(rocsparse_handle handle, rocsparse_operation trans, rocsparse_int m, rocsparse_int n, const double* alpha, const double* A, rocsparse_int lda, rocsparse_int nnz, const double* x_val, const rocsparse_int* x_ind, const double* beta, double* y, rocsparse_index_base idx_base, void* temp_buffer); + // CHECK: status_t = rocsparse_dgemvi(handle_t, opA, m, n, &dAlpha, &dA, lda, innz, &dX, &xInd, &dBeta, &dY, indexBase_t, pBuffer); + status_t = cusparseDgemvi(handle_t, opA, m, n, &dAlpha, &dA, lda, innz, &dX, &xInd, &dBeta, &dY, indexBase_t, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseSgemvi(cusparseHandle_t handle, cusparseOperation_t transA, int m, int n, const float* alpha, const float* A, int lda, int nnz, const float* xVal, const int* xInd, const float* beta, float* y, cusparseIndexBase_t idxBase, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sgemvi(rocsparse_handle handle, rocsparse_operation trans, rocsparse_int m, rocsparse_int n, const float* alpha, const float* A, rocsparse_int lda, rocsparse_int nnz, const float* x_val, const rocsparse_int* x_ind, const float* beta, float* y, rocsparse_index_base idx_base, void* temp_buffer); + // CHECK: status_t = rocsparse_sgemvi(handle_t, opA, m, n, &fAlpha, &fA, lda, innz, &fX, &xInd, &fBeta, &fY, indexBase_t, pBuffer); + status_t = cusparseSgemvi(handle_t, opA, m, n, &fAlpha, &fA, lda, innz, &fX, &xInd, &fBeta, &fY, indexBase_t, pBuffer); +#endif + #if CUDA_VERSION >= 8000 // TODO: [#899] There should be rocsparse_datatype instead of hipDataType cudaDataType_t dataType_t;