From 31e51d632152bd26eba090603e504dc60f7ad9c6 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Mon, 11 Sep 2023 20:23:28 +0200 Subject: [PATCH] [HIPIFY][#674][rocSPARSE][feature] rocSPARSE support - Step 40 - functions + 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 070fcff3..c524293d 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1683,6 +1683,7 @@ sub rocSubstitutions { subst("cusparseCcsr2hyb", "rocsparse_ccsr2hyb", "library"); subst("cusparseCcsrcolor", "rocsparse_ccsrcolor", "library"); subst("cusparseCcsrilu02", "rocsparse_ccsrilu0", "library"); + subst("cusparseCcsrilu02_analysis", "rocsparse_ccsrilu0_analysis", "library"); subst("cusparseCdense2csc", "rocsparse_cdense2csc", "library"); subst("cusparseCdense2csr", "rocsparse_cdense2csr", "library"); subst("cusparseCgebsr2csr", "rocsparse_cgebsr2csr", "library"); @@ -1734,6 +1735,7 @@ sub rocSubstitutions { subst("cusparseDcsr2hyb", "rocsparse_dcsr2hyb", "library"); subst("cusparseDcsrcolor", "rocsparse_dcsrcolor", "library"); subst("cusparseDcsrilu02", "rocsparse_dcsrilu0", "library"); + subst("cusparseDcsrilu02_analysis", "rocsparse_dcsrilu0_analysis", "library"); subst("cusparseDdense2csc", "rocsparse_ddense2csc", "library"); subst("cusparseDdense2csr", "rocsparse_ddense2csr", "library"); subst("cusparseDestroy", "rocsparse_destroy_handle", "library"); @@ -1804,6 +1806,7 @@ sub rocSubstitutions { subst("cusparseScsr2hyb", "rocsparse_scsr2hyb", "library"); subst("cusparseScsrcolor", "rocsparse_scsrcolor", "library"); subst("cusparseScsrilu02", "rocsparse_scsrilu0", "library"); + subst("cusparseScsrilu02_analysis", "rocsparse_scsrilu0_analysis", "library"); subst("cusparseSdense2csc", "rocsparse_sdense2csc", "library"); subst("cusparseSdense2csr", "rocsparse_sdense2csr", "library"); subst("cusparseSetMatDiagType", "rocsparse_set_mat_diag_type", "library"); @@ -1877,6 +1880,7 @@ sub rocSubstitutions { subst("cusparseZcsr2hyb", "rocsparse_zcsr2hyb", "library"); subst("cusparseZcsrcolor", "rocsparse_zcsrcolor", "library"); subst("cusparseZcsrilu02", "rocsparse_zcsrilu0", "library"); + subst("cusparseZcsrilu02_analysis", "rocsparse_zcsrilu0_analysis", "library"); subst("cusparseZdense2csc", "rocsparse_zdense2csc", "library"); subst("cusparseZdense2csr", "rocsparse_zdense2csr", "library"); subst("cusparseZgebsr2csr", "rocsparse_zgebsr2csr", "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 bc9f4e90..a69f5dc5 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -485,7 +485,7 @@ |`cusparseCcsric02_bufferSizeExt`| |12.2| |`hipsparseCcsric02_bufferSizeExt`|3.1.0| | | | | | | | | |`cusparseCcsrilu0`| |10.2|11.0| | | | | | | | | | | |`cusparseCcsrilu02`| |12.2| |`hipsparseCcsrilu02`|3.1.0| | | |`rocsparse_ccsrilu0`|2.10.0| | | | -|`cusparseCcsrilu02_analysis`| |12.2| |`hipsparseCcsrilu02_analysis`|3.1.0| | | | | | | | | +|`cusparseCcsrilu02_analysis`| |12.2| |`hipsparseCcsrilu02_analysis`|3.1.0| | | |`rocsparse_ccsrilu0_analysis`|2.10.0| | | | |`cusparseCcsrilu02_bufferSize`| |12.2| |`hipsparseCcsrilu02_bufferSize`|3.1.0| | | | | | | | | |`cusparseCcsrilu02_bufferSizeExt`| |12.2| |`hipsparseCcsrilu02_bufferSizeExt`|3.1.0| | | | | | | | | |`cusparseCcsrilu02_numericBoost`| |12.2| |`hipsparseCcsrilu02_numericBoost`|3.10.0| | | | | | | | | @@ -519,7 +519,7 @@ |`cusparseDcsric02_bufferSizeExt`| |12.2| |`hipsparseDcsric02_bufferSizeExt`|3.1.0| | | | | | | | | |`cusparseDcsrilu0`| |10.2|11.0| | | | | | | | | | | |`cusparseDcsrilu02`| |12.2| |`hipsparseDcsrilu02`|1.9.2| | | |`rocsparse_dcsrilu0`|1.9.0| | | | -|`cusparseDcsrilu02_analysis`| |12.2| |`hipsparseDcsrilu02_analysis`|1.9.2| | | | | | | | | +|`cusparseDcsrilu02_analysis`| |12.2| |`hipsparseDcsrilu02_analysis`|1.9.2| | | |`rocsparse_dcsrilu0_analysis`|1.9.0| | | | |`cusparseDcsrilu02_bufferSize`| |12.2| |`hipsparseDcsrilu02_bufferSize`|1.9.2| | | | | | | | | |`cusparseDcsrilu02_bufferSizeExt`| |12.2| |`hipsparseDcsrilu02_bufferSizeExt`|1.9.2| | | | | | | | | |`cusparseDcsrilu02_numericBoost`| |12.2| |`hipsparseDcsrilu02_numericBoost`|3.10.0| | | | | | | | | @@ -552,7 +552,7 @@ |`cusparseScsric02_bufferSizeExt`| |12.2| |`hipsparseScsric02_bufferSizeExt`|3.1.0| | | | | | | | | |`cusparseScsrilu0`| |10.2|11.0| | | | | | | | | | | |`cusparseScsrilu02`| |12.2| |`hipsparseScsrilu02`|1.9.2| | | |`rocsparse_scsrilu0`|1.9.0| | | | -|`cusparseScsrilu02_analysis`| |12.2| |`hipsparseScsrilu02_analysis`|1.9.2| | | | | | | | | +|`cusparseScsrilu02_analysis`| |12.2| |`hipsparseScsrilu02_analysis`|1.9.2| | | |`rocsparse_scsrilu0_analysis`|1.9.0| | | | |`cusparseScsrilu02_bufferSize`| |12.2| |`hipsparseScsrilu02_bufferSize`|1.9.2| | | | | | | | | |`cusparseScsrilu02_bufferSizeExt`| |12.2| |`hipsparseScsrilu02_bufferSizeExt`|1.9.2| | | | | | | | | |`cusparseScsrilu02_numericBoost`| |12.2| |`hipsparseScsrilu02_numericBoost`|3.10.0| | | | | | | | | @@ -589,7 +589,7 @@ |`cusparseZcsric02_bufferSizeExt`| |12.2| |`hipsparseZcsric02_bufferSizeExt`|3.1.0| | | | | | | | | |`cusparseZcsrilu0`| |10.2|11.0| | | | | | | | | | | |`cusparseZcsrilu02`| |12.2| |`hipsparseZcsrilu02`|3.1.0| | | |`rocsparse_zcsrilu0`|2.10.0| | | | -|`cusparseZcsrilu02_analysis`| |12.2| |`hipsparseZcsrilu02_analysis`|3.1.0| | | | | | | | | +|`cusparseZcsrilu02_analysis`| |12.2| |`hipsparseZcsrilu02_analysis`|3.1.0| | | |`rocsparse_zcsrilu0_analysis`|2.10.0| | | | |`cusparseZcsrilu02_bufferSize`| |12.2| |`hipsparseZcsrilu02_bufferSize`|3.1.0| | | | | | | | | |`cusparseZcsrilu02_bufferSizeExt`| |12.2| |`hipsparseZcsrilu02_bufferSizeExt`|3.1.0| | | | | | | | | |`cusparseZcsrilu02_numericBoost`| |12.2| |`hipsparseZcsrilu02_numericBoost`|3.10.0| | | | | | | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index 880e08df..9f53a495 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -485,7 +485,7 @@ |`cusparseCcsric02_bufferSizeExt`| |12.2| | | | | | | |`cusparseCcsrilu0`| |10.2|11.0| | | | | | |`cusparseCcsrilu02`| |12.2| |`rocsparse_ccsrilu0`|2.10.0| | | | -|`cusparseCcsrilu02_analysis`| |12.2| | | | | | | +|`cusparseCcsrilu02_analysis`| |12.2| |`rocsparse_ccsrilu0_analysis`|2.10.0| | | | |`cusparseCcsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseCcsrilu02_bufferSizeExt`| |12.2| | | | | | | |`cusparseCcsrilu02_numericBoost`| |12.2| | | | | | | @@ -519,7 +519,7 @@ |`cusparseDcsric02_bufferSizeExt`| |12.2| | | | | | | |`cusparseDcsrilu0`| |10.2|11.0| | | | | | |`cusparseDcsrilu02`| |12.2| |`rocsparse_dcsrilu0`|1.9.0| | | | -|`cusparseDcsrilu02_analysis`| |12.2| | | | | | | +|`cusparseDcsrilu02_analysis`| |12.2| |`rocsparse_dcsrilu0_analysis`|1.9.0| | | | |`cusparseDcsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseDcsrilu02_bufferSizeExt`| |12.2| | | | | | | |`cusparseDcsrilu02_numericBoost`| |12.2| | | | | | | @@ -552,7 +552,7 @@ |`cusparseScsric02_bufferSizeExt`| |12.2| | | | | | | |`cusparseScsrilu0`| |10.2|11.0| | | | | | |`cusparseScsrilu02`| |12.2| |`rocsparse_scsrilu0`|1.9.0| | | | -|`cusparseScsrilu02_analysis`| |12.2| | | | | | | +|`cusparseScsrilu02_analysis`| |12.2| |`rocsparse_scsrilu0_analysis`|1.9.0| | | | |`cusparseScsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseScsrilu02_bufferSizeExt`| |12.2| | | | | | | |`cusparseScsrilu02_numericBoost`| |12.2| | | | | | | @@ -589,7 +589,7 @@ |`cusparseZcsric02_bufferSizeExt`| |12.2| | | | | | | |`cusparseZcsrilu0`| |10.2|11.0| | | | | | |`cusparseZcsrilu02`| |12.2| |`rocsparse_zcsrilu0`|2.10.0| | | | -|`cusparseZcsrilu02_analysis`| |12.2| | | | | | | +|`cusparseZcsrilu02_analysis`| |12.2| |`rocsparse_zcsrilu0_analysis`|2.10.0| | | | |`cusparseZcsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseZcsrilu02_bufferSizeExt`| |12.2| | | | | | | |`cusparseZcsrilu02_numericBoost`| |12.2| | | | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index 341641fd..bb341e3b 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -386,10 +386,10 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseZcsrilu02_bufferSize", {"hipsparseZcsrilu02_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, {"cusparseZcsrilu02_bufferSizeExt", {"hipsparseZcsrilu02_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseScsrilu02_analysis", {"hipsparseScsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseDcsrilu02_analysis", {"hipsparseDcsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseCcsrilu02_analysis", {"hipsparseCcsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseZcsrilu02_analysis", {"hipsparseZcsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseScsrilu02_analysis", {"hipsparseScsrilu02_analysis", "rocsparse_scsrilu0_analysis", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseDcsrilu02_analysis", {"hipsparseDcsrilu02_analysis", "rocsparse_dcsrilu0_analysis", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseCcsrilu02_analysis", {"hipsparseCcsrilu02_analysis", "rocsparse_ccsrilu0_analysis", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseZcsrilu02_analysis", {"hipsparseZcsrilu02_analysis", "rocsparse_zcsrilu0_analysis", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, {"cusparseScsrilu02", {"hipsparseScsrilu02", "rocsparse_scsrilu0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, {"cusparseDcsrilu02", {"hipsparseDcsrilu02", "rocsparse_dcsrilu0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, @@ -2179,6 +2179,10 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_ccsrilu0", {HIP_2100, HIP_0, HIP_0 }}, {"rocsparse_dcsrilu0", {HIP_1090, HIP_0, HIP_0 }}, {"rocsparse_scsrilu0", {HIP_1090, HIP_0, HIP_0 }}, + {"rocsparse_zcsrilu0_analysis", {HIP_2100, HIP_0, HIP_0 }}, + {"rocsparse_ccsrilu0_analysis", {HIP_2100, HIP_0, HIP_0 }}, + {"rocsparse_dcsrilu0_analysis", {HIP_1090, HIP_0, HIP_0 }}, + {"rocsparse_scsrilu0_analysis", {HIP_1090, HIP_0, HIP_0 }}, }; const std::map CUDA_SPARSE_API_SECTION_MAP { diff --git a/src/HipifyAction.cpp b/src/HipifyAction.cpp index f2e02501..2a4b4939 100644 --- a/src/HipifyAction.cpp +++ b/src/HipifyAction.cpp @@ -102,6 +102,10 @@ const std::string sCusparseZcsrilu02 = "cusparseZcsrilu02"; const std::string sCusparseCcsrilu02 = "cusparseCcsrilu02"; const std::string sCusparseDcsrilu02 = "cusparseDcsrilu02"; const std::string sCusparseScsrilu02 = "cusparseScsrilu02"; +const std::string sCusparseZcsrilu02_analysis = "cusparseZcsrilu02_analysis"; +const std::string sCusparseCcsrilu02_analysis = "cusparseCcsrilu02_analysis"; +const std::string sCusparseDcsrilu02_analysis = "cusparseDcsrilu02_analysis"; +const std::string sCusparseScsrilu02_analysis = "cusparseScsrilu02_analysis"; // CUDA_OVERLOADED const std::string sCudaEventCreate = "cudaEventCreate"; const std::string sCudaGraphInstantiate = "cudaGraphInstantiate"; @@ -583,6 +587,46 @@ std::map FuncArgCasts { false } }, + {sCusparseZcsrilu02_analysis, + { + { + {8, {e_replace_argument_with_const, cw_None, "rocsparse_analysis_policy_force"}}, + {9, {e_add_const_argument, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseCcsrilu02_analysis, + { + { + {8, {e_replace_argument_with_const, cw_None, "rocsparse_analysis_policy_force"}}, + {9, {e_add_const_argument, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseDcsrilu02_analysis, + { + { + {8, {e_replace_argument_with_const, cw_None, "rocsparse_analysis_policy_force"}}, + {9, {e_add_const_argument, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseScsrilu02_analysis, + { + { + {8, {e_replace_argument_with_const, cw_None, "rocsparse_analysis_policy_force"}}, + {9, {e_add_const_argument, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, }; void HipifyAction::RewriteString(StringRef s, clang::SourceLocation start) { @@ -1312,7 +1356,11 @@ std::unique_ptr HipifyAction::CreateASTConsumer(clang::Compi sCusparseZcsrilu02, sCusparseCcsrilu02, sCusparseDcsrilu02, - sCusparseScsrilu02 + sCusparseScsrilu02, + sCusparseZcsrilu02_analysis, + sCusparseCcsrilu02_analysis, + sCusparseDcsrilu02_analysis, + sCusparseScsrilu02_analysis ) ) ) diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 14901333..412d490f 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -699,6 +699,26 @@ int main() { // CHECK: status_t = hipsparseScsrilu02(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); status_t = cusparseScsrilu02(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZcsrilu02_analysis(cusparseHandle_t handle, int m, int nnz, const cusparseMatDescr_t descrA, const cuDoubleComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZcsrilu02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipDoubleComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseZcsrilu02_analysis(handle_t, m, innz, matDescr_A, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseZcsrilu02_analysis(handle_t, m, innz, matDescr_A, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCcsrilu02_analysis(cusparseHandle_t handle, int m, int nnz, const cusparseMatDescr_t descrA, const cuComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCcsrilu02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseCcsrilu02_analysis(handle_t, m, innz, matDescr_A, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseCcsrilu02_analysis(handle_t, m, innz, matDescr_A, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDcsrilu02_analysis(cusparseHandle_t handle, int m, int nnz, const cusparseMatDescr_t descrA, const double* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDcsrilu02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const double* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseDcsrilu02_analysis(handle_t, m, innz, matDescr_A, &dcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseDcsrilu02_analysis(handle_t, m, innz, matDescr_A, &dcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseScsrilu02_analysis(cusparseHandle_t handle, int m, int nnz, const cusparseMatDescr_t descrA, const float* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseScsrilu02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const float* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseScsrilu02_analysis(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseScsrilu02_analysis(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_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 bcf5617f..2faf5a7c 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -707,6 +707,26 @@ int main() { // CHECK: status_t = rocsparse_scsrilu0(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, rocsparse_solve_policy_auto, pBuffer); status_t = cusparseScsrilu02(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZcsrilu02_analysis(cusparseHandle_t handle, int m, int nnz, const cusparseMatDescr_t descrA, const cuDoubleComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zcsrilu0_analysis(rocsparse_handle handle, rocsparse_int m, rocsparse_int nnz, const rocsparse_mat_descr descr, const rocsparse_double_complex* csr_val, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, rocsparse_mat_info info, rocsparse_analysis_policy analysis, rocsparse_solve_policy solve, void* temp_buffer); + // CHECK: status_t = rocsparse_zcsrilu0_analysis(handle_t, m, innz, matDescr_A, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, rocsparse_analysis_policy_force, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseZcsrilu02_analysis(handle_t, m, innz, matDescr_A, &dComplexcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCcsrilu02_analysis(cusparseHandle_t handle, int m, int nnz, const cusparseMatDescr_t descrA, const cuComplex* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_ccsrilu0_analysis(rocsparse_handle handle, rocsparse_int m, rocsparse_int nnz, const rocsparse_mat_descr descr, const rocsparse_float_complex* csr_val, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, rocsparse_mat_info info, rocsparse_analysis_policy analysis, rocsparse_solve_policy solve, void* temp_buffer); + // CHECK: status_t = rocsparse_ccsrilu0_analysis(handle_t, m, innz, matDescr_A, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, rocsparse_analysis_policy_force, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseCcsrilu02_analysis(handle_t, m, innz, matDescr_A, &complexcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDcsrilu02_analysis(cusparseHandle_t handle, int m, int nnz, const cusparseMatDescr_t descrA, const double* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dcsrilu0_analysis(rocsparse_handle handle, rocsparse_int m, rocsparse_int nnz, const rocsparse_mat_descr descr, const double* csr_val, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, rocsparse_mat_info info, rocsparse_analysis_policy analysis, rocsparse_solve_policy solve, void* temp_buffer); + // CHECK: status_t = rocsparse_dcsrilu0_analysis(handle_t, m, innz, matDescr_A, &dcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, rocsparse_analysis_policy_force, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseDcsrilu02_analysis(handle_t, m, innz, matDescr_A, &dcsrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseScsrilu02_analysis(cusparseHandle_t handle, int m, int nnz, const cusparseMatDescr_t descrA, const float* csrSortedValA, const int* csrSortedRowPtrA, const int* csrSortedColIndA, csrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_scsrilu0_analysis(rocsparse_handle handle, rocsparse_int m, rocsparse_int nnz, const rocsparse_mat_descr descr, const float* csr_val, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, rocsparse_mat_info info, rocsparse_analysis_policy analysis, rocsparse_solve_policy solve, void* temp_buffer); + // CHECK: status_t = rocsparse_scsrilu0_analysis(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, rocsparse_analysis_policy_force, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseScsrilu02_analysis(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csrilu02_info, solvePolicy_t, pBuffer); + #if CUDA_VERSION >= 8000 // CHECK: hipDataType dataType_t; // TODO: [#899] There should be rocsparse_datatype