From 73d6816ed8b4e1e3bff669b5ac4bf4f42765795a Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Thu, 28 Sep 2023 15:30:27 +0200 Subject: [PATCH] [HIPIFY][#674][rocSPARSE][feature] rocSPARSE support - Step 46 - functions `rocsparse_(s|d|c|z)bsrilu0_analysis` + Updated synthetic tests and the regenerated hipify-perl and SPARSE docs --- bin/hipify-perl | 4 ++ .../CUSPARSE_API_supported_by_HIP_and_ROC.md | 8 +-- docs/tables/CUSPARSE_API_supported_by_ROC.md | 8 +-- src/CUDA2HIP_SPARSE_API_functions.cpp | 12 +++-- src/HipifyAction.cpp | 50 ++++++++++++++++++- .../synthetic/libraries/cusparse2hipsparse.cu | 20 ++++++++ .../synthetic/libraries/cusparse2rocsparse.cu | 20 ++++++++ 7 files changed, 109 insertions(+), 13 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index e2a557f3..ca01177c 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1675,6 +1675,7 @@ sub rocSubstitutions { subst("cusparseBlockedEllGet", "rocsparse_bell_get", "library"); subst("cusparseCbsr2csr", "rocsparse_cbsr2csr", "library"); subst("cusparseCbsrilu02", "rocsparse_cbsrilu0", "library"); + subst("cusparseCbsrilu02_analysis", "rocsparse_cbsrilu0_analysis", "library"); subst("cusparseCcsc2dense", "rocsparse_ccsc2dense", "library"); subst("cusparseCcsr2bsr", "rocsparse_ccsr2bsr", "library"); subst("cusparseCcsr2csr_compress", "rocsparse_ccsr2csr_compress", "library"); @@ -1734,6 +1735,7 @@ sub rocSubstitutions { subst("cusparseCsrSetStridedBatch", "rocsparse_csr_set_strided_batch", "library"); subst("cusparseDbsr2csr", "rocsparse_dbsr2csr", "library"); subst("cusparseDbsrilu02", "rocsparse_dbsrilu0", "library"); + subst("cusparseDbsrilu02_analysis", "rocsparse_dbsrilu0_analysis", "library"); subst("cusparseDcsc2dense", "rocsparse_dcsc2dense", "library"); subst("cusparseDcsr2bsr", "rocsparse_dcsr2bsr", "library"); subst("cusparseDcsr2csr_compress", "rocsparse_dcsr2csr_compress", "library"); @@ -1811,6 +1813,7 @@ sub rocSubstitutions { subst("cusparseSDDMM_preprocess", "rocsparse_sddmm_preprocess", "library"); subst("cusparseSbsr2csr", "rocsparse_sbsr2csr", "library"); subst("cusparseSbsrilu02", "rocsparse_sbsrilu0", "library"); + subst("cusparseSbsrilu02_analysis", "rocsparse_sbsrilu0_analysis", "library"); subst("cusparseScatter", "rocsparse_scatter", "library"); subst("cusparseScsc2dense", "rocsparse_scsc2dense", "library"); subst("cusparseScsr2bsr", "rocsparse_scsr2bsr", "library"); @@ -1896,6 +1899,7 @@ sub rocSubstitutions { subst("cusparseXgebsr2gebsrNnz", "rocsparse_gebsr2gebsr_nnz", "library"); subst("cusparseZbsr2csr", "rocsparse_zbsr2csr", "library"); subst("cusparseZbsrilu02", "rocsparse_zbsrilu0", "library"); + subst("cusparseZbsrilu02_analysis", "rocsparse_zbsrilu0_analysis", "library"); subst("cusparseZcsc2dense", "rocsparse_zcsc2dense", "library"); subst("cusparseZcsr2bsr", "rocsparse_zcsr2bsr", "library"); subst("cusparseZcsr2csr_compress", "rocsparse_zcsr2csr_compress", "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 417c4199..51c19ac9 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -474,7 +474,7 @@ |`cusparseCbsric02_bufferSize`| |12.2| |`hipsparseCbsric02_bufferSize`|3.8.0| | | | | | | | | |`cusparseCbsric02_bufferSizeExt`| |12.2| | | | | | | | | | | | |`cusparseCbsrilu02`| |12.2| |`hipsparseCbsrilu02`|3.9.0| | | |`rocsparse_cbsrilu0`|3.9.0| | | | -|`cusparseCbsrilu02_analysis`| |12.2| |`hipsparseCbsrilu02_analysis`|3.9.0| | | | | | | | | +|`cusparseCbsrilu02_analysis`| |12.2| |`hipsparseCbsrilu02_analysis`|3.9.0| | | |`rocsparse_cbsrilu0_analysis`|3.6.0| | | | |`cusparseCbsrilu02_bufferSize`| |12.2| |`hipsparseCbsrilu02_bufferSize`|3.9.0| | | | | | | | | |`cusparseCbsrilu02_bufferSizeExt`| |12.2| | | | | | | | | | | | |`cusparseCbsrilu02_numericBoost`| |12.2| |`hipsparseCbsrilu02_numericBoost`|3.9.0| | | | | | | | | @@ -508,7 +508,7 @@ |`cusparseDbsric02_bufferSize`| |12.2| |`hipsparseDbsric02_bufferSize`|3.8.0| | | | | | | | | |`cusparseDbsric02_bufferSizeExt`| |12.2| | | | | | | | | | | | |`cusparseDbsrilu02`| |12.2| |`hipsparseDbsrilu02`|3.9.0| | | |`rocsparse_dbsrilu0`|3.9.0| | | | -|`cusparseDbsrilu02_analysis`| |12.2| |`hipsparseDbsrilu02_analysis`|3.9.0| | | | | | | | | +|`cusparseDbsrilu02_analysis`| |12.2| |`hipsparseDbsrilu02_analysis`|3.9.0| | | |`rocsparse_dbsrilu0_analysis`|3.6.0| | | | |`cusparseDbsrilu02_bufferSize`| |12.2| |`hipsparseDbsrilu02_bufferSize`|3.9.0| | | | | | | | | |`cusparseDbsrilu02_bufferSizeExt`| |12.2| | | | | | | | | | | | |`cusparseDbsrilu02_numericBoost`| |12.2| |`hipsparseDbsrilu02_numericBoost`|3.9.0| | | | | | | | | @@ -541,7 +541,7 @@ |`cusparseSbsric02_bufferSize`| |12.2| |`hipsparseSbsric02_bufferSize`|3.8.0| | | | | | | | | |`cusparseSbsric02_bufferSizeExt`| |12.2| | | | | | | | | | | | |`cusparseSbsrilu02`| |12.2| |`hipsparseSbsrilu02`|3.9.0| | | |`rocsparse_sbsrilu0`|3.9.0| | | | -|`cusparseSbsrilu02_analysis`| |12.2| |`hipsparseSbsrilu02_analysis`|3.9.0| | | | | | | | | +|`cusparseSbsrilu02_analysis`| |12.2| |`hipsparseSbsrilu02_analysis`|3.9.0| | | |`rocsparse_sbsrilu0_analysis`|3.6.0| | | | |`cusparseSbsrilu02_bufferSize`| |12.2| |`hipsparseSbsrilu02_bufferSize`|3.9.0| | | | | | | | | |`cusparseSbsrilu02_bufferSizeExt`| |12.2| | | | | | | | | | | | |`cusparseSbsrilu02_numericBoost`| |12.2| |`hipsparseSbsrilu02_numericBoost`|3.9.0| | | | | | | | | @@ -578,7 +578,7 @@ |`cusparseZbsric02_bufferSize`| |12.2| |`hipsparseZbsric02_bufferSize`|3.8.0| | | | | | | | | |`cusparseZbsric02_bufferSizeExt`| |12.2| | | | | | | | | | | | |`cusparseZbsrilu02`| |12.2| |`hipsparseZbsrilu02`|3.9.0| | | |`rocsparse_zbsrilu0`|3.9.0| | | | -|`cusparseZbsrilu02_analysis`| |12.2| |`hipsparseZbsrilu02_analysis`|3.9.0| | | | | | | | | +|`cusparseZbsrilu02_analysis`| |12.2| |`hipsparseZbsrilu02_analysis`|3.9.0| | | |`rocsparse_zbsrilu0_analysis`|3.6.0| | | | |`cusparseZbsrilu02_bufferSize`| |12.2| |`hipsparseZbsrilu02_bufferSize`|3.9.0| | | | | | | | | |`cusparseZbsrilu02_bufferSizeExt`| |12.2| | | | | | | | | | | | |`cusparseZbsrilu02_numericBoost`| |12.2| |`hipsparseZbsrilu02_numericBoost`|3.9.0| | | | | | | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index ada0506a..fb2d1e53 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -474,7 +474,7 @@ |`cusparseCbsric02_bufferSize`| |12.2| | | | | | | |`cusparseCbsric02_bufferSizeExt`| |12.2| | | | | | | |`cusparseCbsrilu02`| |12.2| |`rocsparse_cbsrilu0`|3.9.0| | | | -|`cusparseCbsrilu02_analysis`| |12.2| | | | | | | +|`cusparseCbsrilu02_analysis`| |12.2| |`rocsparse_cbsrilu0_analysis`|3.6.0| | | | |`cusparseCbsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseCbsrilu02_bufferSizeExt`| |12.2| | | | | | | |`cusparseCbsrilu02_numericBoost`| |12.2| | | | | | | @@ -508,7 +508,7 @@ |`cusparseDbsric02_bufferSize`| |12.2| | | | | | | |`cusparseDbsric02_bufferSizeExt`| |12.2| | | | | | | |`cusparseDbsrilu02`| |12.2| |`rocsparse_dbsrilu0`|3.9.0| | | | -|`cusparseDbsrilu02_analysis`| |12.2| | | | | | | +|`cusparseDbsrilu02_analysis`| |12.2| |`rocsparse_dbsrilu0_analysis`|3.6.0| | | | |`cusparseDbsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseDbsrilu02_bufferSizeExt`| |12.2| | | | | | | |`cusparseDbsrilu02_numericBoost`| |12.2| | | | | | | @@ -541,7 +541,7 @@ |`cusparseSbsric02_bufferSize`| |12.2| | | | | | | |`cusparseSbsric02_bufferSizeExt`| |12.2| | | | | | | |`cusparseSbsrilu02`| |12.2| |`rocsparse_sbsrilu0`|3.9.0| | | | -|`cusparseSbsrilu02_analysis`| |12.2| | | | | | | +|`cusparseSbsrilu02_analysis`| |12.2| |`rocsparse_sbsrilu0_analysis`|3.6.0| | | | |`cusparseSbsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseSbsrilu02_bufferSizeExt`| |12.2| | | | | | | |`cusparseSbsrilu02_numericBoost`| |12.2| | | | | | | @@ -578,7 +578,7 @@ |`cusparseZbsric02_bufferSize`| |12.2| | | | | | | |`cusparseZbsric02_bufferSizeExt`| |12.2| | | | | | | |`cusparseZbsrilu02`| |12.2| |`rocsparse_zbsrilu0`|3.9.0| | | | -|`cusparseZbsrilu02_analysis`| |12.2| | | | | | | +|`cusparseZbsrilu02_analysis`| |12.2| |`rocsparse_zbsrilu0_analysis`|3.6.0| | | | |`cusparseZbsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseZbsrilu02_bufferSizeExt`| |12.2| | | | | | | |`cusparseZbsrilu02_numericBoost`| |12.2| | | | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index 7665748c..c7b39383 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -411,10 +411,10 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseZbsrilu02_bufferSize", {"hipsparseZbsrilu02_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, {"cusparseZbsrilu02_bufferSizeExt", {"hipsparseZbsrilu02_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseSbsrilu02_analysis", {"hipsparseSbsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseDbsrilu02_analysis", {"hipsparseDbsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseCbsrilu02_analysis", {"hipsparseCbsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseZbsrilu02_analysis", {"hipsparseZbsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseSbsrilu02_analysis", {"hipsparseSbsrilu02_analysis", "rocsparse_sbsrilu0_analysis", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseDbsrilu02_analysis", {"hipsparseDbsrilu02_analysis", "rocsparse_dbsrilu0_analysis", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseCbsrilu02_analysis", {"hipsparseCbsrilu02_analysis", "rocsparse_cbsrilu0_analysis", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseZbsrilu02_analysis", {"hipsparseZbsrilu02_analysis", "rocsparse_zbsrilu0_analysis", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, {"cusparseSbsrilu02", {"hipsparseSbsrilu02", "rocsparse_sbsrilu0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, {"cusparseDbsrilu02", {"hipsparseDbsrilu02", "rocsparse_dbsrilu0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, @@ -2210,6 +2210,10 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_dbsrilu0", {HIP_3090, HIP_0, HIP_0 }}, {"rocsparse_sbsrilu0", {HIP_3090, HIP_0, HIP_0 }}, {"rocsparse_bsrilu0_zero_pivot", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_zbsrilu0_analysis", {HIP_3060, HIP_0, HIP_0 }}, + {"rocsparse_cbsrilu0_analysis", {HIP_3060, HIP_0, HIP_0 }}, + {"rocsparse_dbsrilu0_analysis", {HIP_3060, HIP_0, HIP_0 }}, + {"rocsparse_sbsrilu0_analysis", {HIP_3060, HIP_0, HIP_0 }}, }; const std::map CUDA_SPARSE_API_SECTION_MAP { diff --git a/src/HipifyAction.cpp b/src/HipifyAction.cpp index 5e3f8158..d1637126 100644 --- a/src/HipifyAction.cpp +++ b/src/HipifyAction.cpp @@ -119,6 +119,10 @@ const std::string sCusparseZbsrilu02 = "cusparseZbsrilu02"; const std::string sCusparseCbsrilu02 = "cusparseCbsrilu02"; const std::string sCusparseDbsrilu02 = "cusparseDbsrilu02"; const std::string sCusparseSbsrilu02 = "cusparseSbsrilu02"; +const std::string sCusparseZbsrilu02_analysis = "cusparseZbsrilu02_analysis"; +const std::string sCusparseCbsrilu02_analysis = "cusparseCbsrilu02_analysis"; +const std::string sCusparseDbsrilu02_analysis = "cusparseDbsrilu02_analysis"; +const std::string sCusparseSbsrilu02_analysis = "cusparseSbsrilu02_analysis"; // CUDA_OVERLOADED const std::string sCudaEventCreate = "cudaEventCreate"; const std::string sCudaGraphInstantiate = "cudaGraphInstantiate"; @@ -754,6 +758,46 @@ std::map FuncArgCasts { false } }, + {sCusparseZbsrilu02_analysis, + { + { + {10, {e_replace_argument_with_const, cw_None, "rocsparse_analysis_policy_force"}}, + {11, {e_add_const_argument, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseCbsrilu02_analysis, + { + { + {10, {e_replace_argument_with_const, cw_None, "rocsparse_analysis_policy_force"}}, + {11, {e_add_const_argument, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseDbsrilu02_analysis, + { + { + {10, {e_replace_argument_with_const, cw_None, "rocsparse_analysis_policy_force"}}, + {11, {e_add_const_argument, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseSbsrilu02_analysis, + { + { + {10, {e_replace_argument_with_const, cw_None, "rocsparse_analysis_policy_force"}}, + {11, {e_add_const_argument, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, }; void HipifyAction::RewriteString(StringRef s, clang::SourceLocation start) { @@ -1501,7 +1545,11 @@ std::unique_ptr HipifyAction::CreateASTConsumer(clang::Compi sCusparseZbsrilu02, sCusparseCbsrilu02, sCusparseDbsrilu02, - sCusparseSbsrilu02 + sCusparseSbsrilu02, + sCusparseZbsrilu02_analysis, + sCusparseCbsrilu02_analysis, + sCusparseDbsrilu02_analysis, + sCusparseSbsrilu02_analysis ) ) ) diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 07c3cf74..25d534ee 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -880,6 +880,26 @@ int main() { // CHECK: status_t = hipsparseXbsrilu02_zeroPivot(handle_t, bsrilu02_info, &iposition); status_t = cusparseXbsrilu02_zeroPivot(handle_t, bsrilu02_info, &iposition); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZbsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuDoubleComplex* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZbsrilu02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseZbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &dComplexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseZbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &dComplexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCbsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuComplex* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCbsrilu02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseCbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &complexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseCbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &complexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDbsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDbsrilu02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseDbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &dbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseDbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &dbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSbsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSbsrilu02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float* bsrSortedValA, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseSbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &fbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseSbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &fbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + #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 b030cd87..f8f7b6bb 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -892,6 +892,26 @@ int main() { // CHECK: status_t = rocsparse_bsrilu0_zero_pivot(handle_t, bsrilu02_info, &iposition); status_t = cusparseXbsrilu02_zeroPivot(handle_t, bsrilu02_info, &iposition); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZbsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuDoubleComplex* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zbsrilu0_analysis(rocsparse_handle handle, rocsparse_direction dir, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_mat_descr descr, const rocsparse_double_complex* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, rocsparse_analysis_policy analysis, rocsparse_solve_policy solve, void* temp_buffer); + // CHECK: status_t = rocsparse_zbsrilu0_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &dComplexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, rocsparse_analysis_policy_force, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseZbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &dComplexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCbsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuComplex* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cbsrilu0_analysis(rocsparse_handle handle, rocsparse_direction dir, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_mat_descr descr, const rocsparse_float_complex* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, rocsparse_analysis_policy analysis, rocsparse_solve_policy solve, void* temp_buffer); + // CHECK: status_t = rocsparse_cbsrilu0_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &complexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, rocsparse_analysis_policy_force, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseCbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &complexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDbsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dbsrilu0_analysis(rocsparse_handle handle, rocsparse_direction dir, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_mat_descr descr, const double* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, rocsparse_analysis_policy analysis, rocsparse_solve_policy solve, void* temp_buffer); + // CHECK: status_t = rocsparse_dbsrilu0_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &dbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, rocsparse_analysis_policy_force, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseDbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &dbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSbsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sbsrilu0_analysis(rocsparse_handle handle, rocsparse_direction dir, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_mat_descr descr, const float* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, rocsparse_analysis_policy analysis, rocsparse_solve_policy solve, void* temp_buffer); + // CHECK: status_t = rocsparse_sbsrilu0_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &fbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, rocsparse_analysis_policy_force, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseSbsrilu02_analysis(handle_t, direction_t, mb, nnzb, matDescr_A, &fbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + #if CUDA_VERSION >= 8000 // CHECK: hipDataType dataType_t; // TODO: [#899] There should be rocsparse_datatype