From 1ada04eeea9657077fa58c945f7249a51dfa114b Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Thu, 21 Dec 2023 20:33:49 +0000 Subject: [PATCH] [HIPIFY][#675][#677][SOLVER][feature] `cuSOLVER` support - Step 53 - Functions (RF) + Updated `SOLVER` synthetic tests, the regenerated `hipify-perl`, and `SOLVER` `CUDA2HIP` documentation --- bin/hipify-perl | 24 ++++++ docs/tables/CUSOLVER_API_supported_by_HIP.md | 12 +++ .../CUSOLVER_API_supported_by_HIP_and_ROC.md | 12 +++ docs/tables/CUSOLVER_API_supported_by_ROC.md | 12 +++ src/CUDA2HIP_SOLVER_API_functions.cpp | 36 +++++++++ .../synthetic/libraries/cusolver2hipsolver.cu | 77 +++++++++++++++++++ 6 files changed, 173 insertions(+) diff --git a/bin/hipify-perl b/bin/hipify-perl index 8b708109..ddb36a2c 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1077,6 +1077,7 @@ my %removed_funcs = ( my %experimental_funcs = ( "cusolverStatus_t" => "6.1.0", + "cusolverRfSolve" => "6.1.0", "cusolverRfSetupHost" => "6.1.0", "cusolverRfSetupDevice" => "6.1.0", "cusolverRfSetResetValuesFastMode" => "6.1.0", @@ -1084,12 +1085,23 @@ my %experimental_funcs = ( "cusolverRfSetMatrixFormat" => "6.1.0", "cusolverRfSetAlgs" => "6.1.0", "cusolverRfResetValues" => "6.1.0", + "cusolverRfRefactor" => "6.1.0", "cusolverRfGetResetValuesFastMode" => "6.1.0", "cusolverRfGetNumericProperties" => "6.1.0", "cusolverRfGetNumericBoostReport" => "6.1.0", "cusolverRfGetMatrixFormat" => "6.1.0", + "cusolverRfExtractSplitFactorsHost" => "6.1.0", + "cusolverRfExtractBundledFactorsHost" => "6.1.0", "cusolverRfDestroy" => "6.1.0", "cusolverRfCreate" => "6.1.0", + "cusolverRfBatchZeroPivot" => "6.1.0", + "cusolverRfBatchSolve" => "6.1.0", + "cusolverRfBatchSetupHost" => "6.1.0", + "cusolverRfBatchResetValues" => "6.1.0", + "cusolverRfBatchRefactor" => "6.1.0", + "cusolverRfBatchAnalyze" => "6.1.0", + "cusolverRfAnalyze" => "6.1.0", + "cusolverRfAccessBundledFactorsDevice" => "6.1.0", "cusolverEigType_t" => "6.1.0", "cusolverEigRange_t" => "6.1.0", "cusolverEigMode_t" => "6.1.0", @@ -1717,12 +1729,23 @@ sub experimentalSubstitutions { subst("cusolverDnZunmqr_bufferSize", "hipsolverDnZunmqr_bufferSize", "library"); subst("cusolverDnZunmtr", "hipsolverDnZunmtr", "library"); subst("cusolverDnZunmtr_bufferSize", "hipsolverDnZunmtr_bufferSize", "library"); + subst("cusolverRfAccessBundledFactorsDevice", "hipsolverRfAccessBundledFactorsDevice", "library"); + subst("cusolverRfAnalyze", "hipsolverRfAnalyze", "library"); + subst("cusolverRfBatchAnalyze", "hipsolverRfBatchAnalyze", "library"); + subst("cusolverRfBatchRefactor", "hipsolverRfBatchRefactor", "library"); + subst("cusolverRfBatchResetValues", "hipsolverRfBatchResetValues", "library"); + subst("cusolverRfBatchSetupHost", "hipsolverRfBatchSetupHost", "library"); + subst("cusolverRfBatchSolve", "hipsolverRfBatchSolve", "library"); + subst("cusolverRfBatchZeroPivot", "hipsolverRfBatchZeroPivot", "library"); subst("cusolverRfCreate", "hipsolverRfCreate", "library"); subst("cusolverRfDestroy", "hipsolverRfDestroy", "library"); + subst("cusolverRfExtractBundledFactorsHost", "hipsolverRfExtractBundledFactorsHost", "library"); + subst("cusolverRfExtractSplitFactorsHost", "hipsolverRfExtractSplitFactorsHost", "library"); subst("cusolverRfGetMatrixFormat", "hipsolverRfGetMatrixFormat", "library"); subst("cusolverRfGetNumericBoostReport", "hipsolverRfGetNumericBoostReport", "library"); subst("cusolverRfGetNumericProperties", "hipsolverRfGetNumericProperties", "library"); subst("cusolverRfGetResetValuesFastMode", "hipsolverRfGetResetValuesFastMode", "library"); + subst("cusolverRfRefactor", "hipsolverRfRefactor", "library"); subst("cusolverRfResetValues", "hipsolverRfResetValues", "library"); subst("cusolverRfSetAlgs", "hipsolverRfSetAlgs", "library"); subst("cusolverRfSetMatrixFormat", "hipsolverRfSetMatrixFormat", "library"); @@ -1730,6 +1753,7 @@ sub experimentalSubstitutions { subst("cusolverRfSetResetValuesFastMode", "hipsolverRfSetResetValuesFastMode", "library"); subst("cusolverRfSetupDevice", "hipsolverRfSetupDevice", "library"); subst("cusolverRfSetupHost", "hipsolverRfSetupHost", "library"); + subst("cusolverRfSolve", "hipsolverRfSolve", "library"); subst("cusolverDnHandle_t", "hipsolverHandle_t", "type"); subst("cusolverEigMode_t", "hipsolverEigMode_t", "type"); subst("cusolverEigRange_t", "hipsolverEigRange_t", "type"); diff --git a/docs/tables/CUSOLVER_API_supported_by_HIP.md b/docs/tables/CUSOLVER_API_supported_by_HIP.md index b86da920..df6c5963 100644 --- a/docs/tables/CUSOLVER_API_supported_by_HIP.md +++ b/docs/tables/CUSOLVER_API_supported_by_HIP.md @@ -539,13 +539,24 @@ |`cusolverMgPotrs_bufferSize`|11.0| | | | | | | | | | |`cusolverMgSyevd`|10.1| | | | | | | | | | |`cusolverMgSyevd_bufferSize`|10.1| | | | | | | | | | +|`cusolverRfAccessBundledFactorsDevice`| | | | |`hipsolverRfAccessBundledFactorsDevice`|5.6.0| | | |6.1.0| +|`cusolverRfAnalyze`| | | | |`hipsolverRfAnalyze`|5.6.0| | | |6.1.0| +|`cusolverRfBatchAnalyze`| | | | |`hipsolverRfBatchAnalyze`|5.6.0| | | |6.1.0| +|`cusolverRfBatchRefactor`| | | | |`hipsolverRfBatchRefactor`|5.6.0| | | |6.1.0| +|`cusolverRfBatchResetValues`| | | | |`hipsolverRfBatchResetValues`|5.6.0| | | |6.1.0| +|`cusolverRfBatchSetupHost`| | | | |`hipsolverRfBatchSetupHost`|5.6.0| | | |6.1.0| +|`cusolverRfBatchSolve`| | | | |`hipsolverRfBatchSolve`|5.6.0| | | |6.1.0| +|`cusolverRfBatchZeroPivot`| | | | |`hipsolverRfBatchZeroPivot`|5.6.0| | | |6.1.0| |`cusolverRfCreate`| | | | |`hipsolverRfCreate`|5.6.0| | | |6.1.0| |`cusolverRfDestroy`| | | | |`hipsolverRfDestroy`|5.6.0| | | |6.1.0| +|`cusolverRfExtractBundledFactorsHost`| | | | |`hipsolverRfExtractBundledFactorsHost`|5.6.0| | | |6.1.0| +|`cusolverRfExtractSplitFactorsHost`| | | | |`hipsolverRfExtractSplitFactorsHost`|5.6.0| | | |6.1.0| |`cusolverRfGetAlgs`| | | | | | | | | | | |`cusolverRfGetMatrixFormat`| | | | |`hipsolverRfGetMatrixFormat`|5.6.0| | | |6.1.0| |`cusolverRfGetNumericBoostReport`| | | | |`hipsolverRfGetNumericBoostReport`|5.6.0| | | |6.1.0| |`cusolverRfGetNumericProperties`| | | | |`hipsolverRfGetNumericProperties`|5.6.0| | | |6.1.0| |`cusolverRfGetResetValuesFastMode`| | | | |`hipsolverRfGetResetValuesFastMode`|5.6.0| | | |6.1.0| +|`cusolverRfRefactor`| | | | |`hipsolverRfRefactor`|5.6.0| | | |6.1.0| |`cusolverRfResetValues`| | | | |`hipsolverRfResetValues`|5.6.0| | | |6.1.0| |`cusolverRfSetAlgs`| | | | |`hipsolverRfSetAlgs`|5.6.0| | | |6.1.0| |`cusolverRfSetMatrixFormat`| | | | |`hipsolverRfSetMatrixFormat`|5.6.0| | | |6.1.0| @@ -553,6 +564,7 @@ |`cusolverRfSetResetValuesFastMode`| | | | |`hipsolverRfSetResetValuesFastMode`|5.6.0| | | |6.1.0| |`cusolverRfSetupDevice`| | | | |`hipsolverRfSetupDevice`|5.6.0| | | |6.1.0| |`cusolverRfSetupHost`| | | | |`hipsolverRfSetupHost`|5.6.0| | | |6.1.0| +|`cusolverRfSolve`| | | | |`hipsolverRfSolve`|5.6.0| | | |6.1.0| \*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental \ No newline at end of file diff --git a/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md b/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md index 07433e60..84ac2864 100644 --- a/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md @@ -539,13 +539,24 @@ |`cusolverMgPotrs_bufferSize`|11.0| | | | | | | | | | | | | | | | |`cusolverMgSyevd`|10.1| | | | | | | | | | | | | | | | |`cusolverMgSyevd_bufferSize`|10.1| | | | | | | | | | | | | | | | +|`cusolverRfAccessBundledFactorsDevice`| | | | |`hipsolverRfAccessBundledFactorsDevice`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfAnalyze`| | | | |`hipsolverRfAnalyze`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfBatchAnalyze`| | | | |`hipsolverRfBatchAnalyze`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfBatchRefactor`| | | | |`hipsolverRfBatchRefactor`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfBatchResetValues`| | | | |`hipsolverRfBatchResetValues`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfBatchSetupHost`| | | | |`hipsolverRfBatchSetupHost`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfBatchSolve`| | | | |`hipsolverRfBatchSolve`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfBatchZeroPivot`| | | | |`hipsolverRfBatchZeroPivot`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfCreate`| | | | |`hipsolverRfCreate`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfDestroy`| | | | |`hipsolverRfDestroy`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfExtractBundledFactorsHost`| | | | |`hipsolverRfExtractBundledFactorsHost`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfExtractSplitFactorsHost`| | | | |`hipsolverRfExtractSplitFactorsHost`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfGetAlgs`| | | | | | | | | | | | | | | | | |`cusolverRfGetMatrixFormat`| | | | |`hipsolverRfGetMatrixFormat`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfGetNumericBoostReport`| | | | |`hipsolverRfGetNumericBoostReport`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfGetNumericProperties`| | | | |`hipsolverRfGetNumericProperties`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfGetResetValuesFastMode`| | | | |`hipsolverRfGetResetValuesFastMode`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfRefactor`| | | | |`hipsolverRfRefactor`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfResetValues`| | | | |`hipsolverRfResetValues`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfSetAlgs`| | | | |`hipsolverRfSetAlgs`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfSetMatrixFormat`| | | | |`hipsolverRfSetMatrixFormat`|5.6.0| | | |6.1.0| | | | | | | @@ -553,6 +564,7 @@ |`cusolverRfSetResetValuesFastMode`| | | | |`hipsolverRfSetResetValuesFastMode`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfSetupDevice`| | | | |`hipsolverRfSetupDevice`|5.6.0| | | |6.1.0| | | | | | | |`cusolverRfSetupHost`| | | | |`hipsolverRfSetupHost`|5.6.0| | | |6.1.0| | | | | | | +|`cusolverRfSolve`| | | | |`hipsolverRfSolve`|5.6.0| | | |6.1.0| | | | | | | \*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental \ No newline at end of file diff --git a/docs/tables/CUSOLVER_API_supported_by_ROC.md b/docs/tables/CUSOLVER_API_supported_by_ROC.md index 1dc31ba4..f2286944 100644 --- a/docs/tables/CUSOLVER_API_supported_by_ROC.md +++ b/docs/tables/CUSOLVER_API_supported_by_ROC.md @@ -539,13 +539,24 @@ |`cusolverMgPotrs_bufferSize`|11.0| | | | | | | | | | |`cusolverMgSyevd`|10.1| | | | | | | | | | |`cusolverMgSyevd_bufferSize`|10.1| | | | | | | | | | +|`cusolverRfAccessBundledFactorsDevice`| | | | | | | | | | | +|`cusolverRfAnalyze`| | | | | | | | | | | +|`cusolverRfBatchAnalyze`| | | | | | | | | | | +|`cusolverRfBatchRefactor`| | | | | | | | | | | +|`cusolverRfBatchResetValues`| | | | | | | | | | | +|`cusolverRfBatchSetupHost`| | | | | | | | | | | +|`cusolverRfBatchSolve`| | | | | | | | | | | +|`cusolverRfBatchZeroPivot`| | | | | | | | | | | |`cusolverRfCreate`| | | | | | | | | | | |`cusolverRfDestroy`| | | | | | | | | | | +|`cusolverRfExtractBundledFactorsHost`| | | | | | | | | | | +|`cusolverRfExtractSplitFactorsHost`| | | | | | | | | | | |`cusolverRfGetAlgs`| | | | | | | | | | | |`cusolverRfGetMatrixFormat`| | | | | | | | | | | |`cusolverRfGetNumericBoostReport`| | | | | | | | | | | |`cusolverRfGetNumericProperties`| | | | | | | | | | | |`cusolverRfGetResetValuesFastMode`| | | | | | | | | | | +|`cusolverRfRefactor`| | | | | | | | | | | |`cusolverRfResetValues`| | | | | | | | | | | |`cusolverRfSetAlgs`| | | | | | | | | | | |`cusolverRfSetMatrixFormat`| | | | | | | | | | | @@ -553,6 +564,7 @@ |`cusolverRfSetResetValuesFastMode`| | | | | | | | | | | |`cusolverRfSetupDevice`| | | | | | | | | | | |`cusolverRfSetupHost`| | | | | | | | | | | +|`cusolverRfSolve`| | | | | | | | | | | \*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental \ No newline at end of file diff --git a/src/CUDA2HIP_SOLVER_API_functions.cpp b/src/CUDA2HIP_SOLVER_API_functions.cpp index a51c0d4a..864a18c1 100644 --- a/src/CUDA2HIP_SOLVER_API_functions.cpp +++ b/src/CUDA2HIP_SOLVER_API_functions.cpp @@ -511,6 +511,30 @@ const std::map CUDA_SOLVER_FUNCTION_MAP { {"cusolverRfSetupDevice", {"hipsolverRfSetupDevice", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, // no ROC analogues {"cusolverRfResetValues", {"hipsolverRfResetValues", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // NOTE: can't call rocsolver_dcsrrf_analysis w/o using hipSOLVER's hipsolverRfHandle + {"cusolverRfAnalyze", {"hipsolverRfAnalyze", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // NOTE: can't call rocsolver_dcsrrf_refactlu w/o using hipSOLVER's hipsolverRfHandle + {"cusolverRfRefactor", {"hipsolverRfRefactor", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfAccessBundledFactorsDevice", {"hipsolverRfAccessBundledFactorsDevice", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfExtractBundledFactorsHost", {"hipsolverRfExtractBundledFactorsHost", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfExtractSplitFactorsHost", {"hipsolverRfExtractSplitFactorsHost", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // NOTE: can't call rocsolver_dcsrrf_solve w/o using hipSOLVER's hipsolverRfHandle + {"cusolverRfSolve", {"hipsolverRfSolve", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfBatchSetupHost", {"hipsolverRfBatchSetupHost", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfBatchResetValues", {"hipsolverRfBatchResetValues", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfBatchAnalyze", {"hipsolverRfBatchAnalyze", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfBatchRefactor", {"hipsolverRfBatchRefactor", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfBatchSolve", {"hipsolverRfBatchSolve", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // no ROC analogues + {"cusolverRfBatchZeroPivot", {"hipsolverRfBatchZeroPivot", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, }; const std::map CUDA_SOLVER_FUNCTION_VER_MAP { @@ -1093,6 +1117,18 @@ const std::map HIP_SOLVER_FUNCTION_VER_MAP { {"hipsolverRfSetupHost", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, {"hipsolverRfSetupDevice", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, {"hipsolverRfResetValues", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfAnalyze", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfRefactor", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfAccessBundledFactorsDevice", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfExtractBundledFactorsHost", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfExtractSplitFactorsHost", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfSolve", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfBatchSetupHost", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfBatchResetValues", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfBatchAnalyze", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfBatchRefactor", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfBatchSolve", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverRfBatchZeroPivot", {HIP_5060, HIP_0, HIP_0, HIP_LATEST}}, {"rocsolver_spotrf", {HIP_3020, HIP_0, HIP_0, HIP_LATEST}}, {"rocsolver_dpotrf", {HIP_3020, HIP_0, HIP_0, HIP_LATEST}}, diff --git a/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu b/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu index 73184675..5442a626 100644 --- a/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu +++ b/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu @@ -10,10 +10,13 @@ int main() { printf("19. cuSOLVER API to hipSOLVER API synthetic test\n"); + int ldt = 0; + int ldxf = 0; int m = 0; int n = 0; int nnzA = 0; int nnzL = 0; + int nnzM = 0; int nnzU = 0; int k = 0; int il = 0; @@ -41,11 +44,18 @@ int main() { int ih_csrRowPtrA = 0; int ih_csrColIndA = 0; int ih_csrRowPtrL = 0; + int *pih_csrRowPtrL = nullptr; int ih_csrColIndL = 0; + int *pih_csrColIndL = nullptr; int ih_csrRowPtrU = 0; + int *pih_csrRowPtrU = nullptr; int ih_csrColIndU = 0; + int *pih_csrColIndU = nullptr; + int ih_nnzL = 0; + int ih_nnzU = 0; int ih_P = 0; int ih_Q = 0; + int iposition = 0; float fA = 0.f; float fd_A = 0.f; float fB = 0.f; @@ -82,6 +92,7 @@ int main() { double dd_V = 0.f; double dVT = 0.f; double dX = 0.f; + double dXF = 0.f; double dW = 0.f; double dTAU = 0.f; double dTAUQ = 0.f; @@ -99,8 +110,14 @@ int main() { double dboost = 0.f; double dh_csrValA = 0.f; double dh_csrValL = 0.f; + double *pdh_csrValL = nullptr; double dh_csrValU = 0.f; + double *pdh_csrValU = nullptr; + double dTemp = 0.f; void *Workspace = nullptr; + int *piMp = nullptr; + int *piMi = nullptr; + double *pdMx = nullptr; size_t lwork_bytes = 0; signed char jobu = 0; @@ -603,6 +620,66 @@ int main() { // CHECK: status = hipsolverRfResetValues(n, nnzA, &ih_csrRowPtrA, &ih_csrColIndA, &dh_csrValA, &ih_P, &ih_Q, RfHandle); status = cusolverRfResetValues(n, nnzA, &ih_csrRowPtrA, &ih_csrColIndA, &dh_csrValA, &ih_P, &ih_Q, RfHandle); + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfAnalyze(cusolverRfHandle_t handle); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfAnalyze(hipsolverRfHandle_t handle); + // CHECK: status = hipsolverRfAnalyze(RfHandle); + status = cusolverRfAnalyze(RfHandle); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfRefactor(cusolverRfHandle_t handle); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfRefactor(hipsolverRfHandle_t handle); + // CHECK: status = hipsolverRfRefactor(RfHandle); + status = cusolverRfRefactor(RfHandle); + + // CUDA: cusolverRfAccessBundledFactorsDevice(cusolverRfHandle_t handle, int* nnzM, int** Mp, int** Mi, double** Mx); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfAccessBundledFactorsDevice(hipsolverRfHandle_t handle, int* nnzM, int** Mp, int** Mi, double** Mx); + // CHECK: status = hipsolverRfAccessBundledFactorsDevice(RfHandle, &nnzM, &piMp, &piMi, &pdMx); + status = cusolverRfAccessBundledFactorsDevice(RfHandle, &nnzM, &piMp, &piMi, &pdMx); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfExtractBundledFactorsHost(cusolverRfHandle_t handle, int* h_nnzM, int** h_Mp, int** h_Mi, double** h_Mx); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfExtractBundledFactorsHost(hipsolverRfHandle_t handle, int* h_nnzM, int** h_Mp, int** h_Mi, double** h_Mx); + // CHECK: status = hipsolverRfExtractBundledFactorsHost(RfHandle, &nnzM, &piMp, &piMi, &pdMx); + status = cusolverRfExtractBundledFactorsHost(RfHandle, &nnzM, &piMp, &piMi, &pdMx); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfExtractSplitFactorsHost(cusolverRfHandle_t handle, int* h_nnzL, int** h_csrRowPtrL, int** h_csrColIndL, double** h_csrValL, int* h_nnzU, int** h_csrRowPtrU, int** h_csrColIndU, double** h_csrValU); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfExtractSplitFactorsHost(hipsolverRfHandle_t handle, int* h_nnzL, int** h_Lp, int** h_Li, double** h_Lx, int* h_nnzU, int** h_Up, int** h_Ui, double** h_Ux); + // CHECK: status = hipsolverRfExtractSplitFactorsHost(RfHandle, &ih_nnzL, &pih_csrRowPtrL, &pih_csrColIndL, &pdh_csrValL, &ih_nnzU, &pih_csrRowPtrU, &pih_csrColIndU, &pdh_csrValU); + status = cusolverRfExtractSplitFactorsHost(RfHandle, &ih_nnzL, &pih_csrRowPtrL, &pih_csrColIndL, &pdh_csrValL, &ih_nnzU, &pih_csrRowPtrU, &pih_csrColIndU, &pdh_csrValU); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfSolve( cusolverRfHandle_t handle, int* P, int* Q, int nrhs, double* Temp, int ldt, double* XF, int ldxf); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfSolve(hipsolverRfHandle_t handle, int* P, int* Q, int nrhs, double* Temp, int ldt, double* XF, int ldxf); + // CHECK: status = hipsolverRfSolve(RfHandle, &ih_P, &ih_Q, nrhs, &dTemp, ldt, &dXF, ldxf); + status = cusolverRfSolve(RfHandle, &ih_P, &ih_Q, nrhs, &dTemp, ldt, &dXF, ldxf); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfBatchSetupHost( int batchSize, int n, int nnzA, int* h_csrRowPtrA, int* h_csrColIndA, double* h_csrValA_array[], int nnzL, int* h_csrRowPtrL, int* h_csrColIndL, double* h_csrValL, int nnzU, int* h_csrRowPtrU, int* h_csrColIndU, double* h_csrValU, int* h_P, int* h_Q, cusolverRfHandle_t handle); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfBatchSetupHost(int batchSize, int n, int nnzA, int* h_csrRowPtrA, int* h_csrColIndA, double* h_csrValA_array[], int nnzL, int* h_csrRowPtrL, int* h_csrColIndL, double* h_csrValL, int nnzU, int* h_csrRowPtrU, int* h_csrColIndU, double* h_csrValU, int* h_P, int* h_Q, hipsolverRfHandle_t handle); + // CHECK: status = hipsolverRfBatchSetupHost(batchSize, n, nnzA, &ih_csrRowPtrA, &ih_csrColIndA, dAarray, nnzL, &ih_csrRowPtrL, &ih_csrColIndL, &dh_csrValL, nnzU, &ih_csrRowPtrU, &ih_csrColIndU, &dh_csrValU, &ih_P, &ih_Q, RfHandle); + status = cusolverRfBatchSetupHost(batchSize, n, nnzA, &ih_csrRowPtrA, &ih_csrColIndA, dAarray, nnzL, &ih_csrRowPtrL, &ih_csrColIndL, &dh_csrValL, nnzU, &ih_csrRowPtrU, &ih_csrColIndU, &dh_csrValU, &ih_P, &ih_Q, RfHandle); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfBatchResetValues(int batchSize, int n, int nnzA, int* csrRowPtrA, int* csrColIndA, double* csrValA_array[], int* P, int* Q, cusolverRfHandle_t handle); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfBatchResetValues(int batchSize, int n, int nnzA, int* csrRowPtrA, int* csrColIndA, double* csrValA_array[], int* P, int* Q, hipsolverRfHandle_t handle); + // CHECK: status = hipsolverRfBatchResetValues(batchSize, n, nnzA, &ih_csrRowPtrA, &ih_csrColIndA, dAarray, &ih_P, &ih_Q, RfHandle); + status = cusolverRfBatchResetValues(batchSize, n, nnzA, &ih_csrRowPtrA, &ih_csrColIndA, dAarray, &ih_P, &ih_Q, RfHandle); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfBatchAnalyze(cusolverRfHandle_t handle); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfBatchAnalyze(hipsolverRfHandle_t handle); + // CHECK: status = hipsolverRfBatchAnalyze(RfHandle); + status = cusolverRfBatchAnalyze(RfHandle); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfBatchRefactor(cusolverRfHandle_t handle); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfBatchRefactor(hipsolverRfHandle_t handle); + // CHECK: status = hipsolverRfBatchRefactor(RfHandle); + status = cusolverRfBatchRefactor(RfHandle); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfBatchSolve(cusolverRfHandle_t handle, int* P, int* Q, int nrhs, double* Temp, int ldt, double* XF_array[], int ldxf); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfBatchSolve(hipsolverRfHandle_t handle, int* P, int* Q, int nrhs, double* Temp, int ldt, double* XF_array[], int ldxf); + // CHECK: status = hipsolverRfBatchSolve(RfHandle, &ih_P, &ih_Q, nrhs, &dTemp, ldt, dAarray, ldxf); + status = cusolverRfBatchSolve(RfHandle, &ih_P, &ih_Q, nrhs, &dTemp, ldt, dAarray, ldxf); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverRfBatchZeroPivot(cusolverRfHandle_t handle, int* position); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverRfBatchZeroPivot(hipsolverRfHandle_t handle, int* position); + // CHECK: status = hipsolverRfBatchZeroPivot(RfHandle, &iposition); + status = cusolverRfBatchZeroPivot(RfHandle, &iposition); + #if CUDA_VERSION >= 8000 // CHECK: hipsolverEigType_t eigType; // CHECK-NEXT: hipsolverEigType_t EIG_TYPE_1 = HIPSOLVER_EIG_TYPE_1;