From 100a676761778365915b8114c763b9bdd2acc81c Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Mon, 27 Nov 2023 16:06:37 +0100 Subject: [PATCH] [HIPIFY][#675][#677][SOLVER][feature] `cuSOLVER` support - Step 19 - Functions (DN) + `cusolverDn(S|D|C|Z)potrs` and `cusolverDn(S|D|C|Z)potrfBatched` are `SUPPORTED` by `hipSOLVER` only + [NOTE] `rocsolver_(s|d|c|z)potrs` and `rocsolver_(s|d|c|z)potrf_batched` have a harness of other HIP/ROC functions, thus `UNSUPPORTED` + Updated `SOLVER` synthetic tests, the regenerated hipify-perl, and `SOLVER` `CUDA2HIP` documentation --- bin/hipify-perl | 16 ++++++ docs/tables/CUSOLVER_API_supported_by_HIP.md | 8 +++ .../CUSOLVER_API_supported_by_HIP_and_ROC.md | 8 +++ docs/tables/CUSOLVER_API_supported_by_ROC.md | 8 +++ src/CUDA2HIP_SOLVER_API_functions.cpp | 22 ++++++++ .../synthetic/libraries/cusolver2hipsolver.cu | 53 +++++++++++++++++++ 6 files changed, 115 insertions(+) diff --git a/bin/hipify-perl b/bin/hipify-perl index 52d1ff5a..8e0c1737 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1080,13 +1080,17 @@ my %experimental_funcs = ( "cusolverEigType_t" => "6.1.0", "cusolverEigRange_t" => "6.1.0", "cusolverEigMode_t" => "6.1.0", + "cusolverDnZpotrs" => "6.1.0", "cusolverDnZpotrf_bufferSize" => "6.1.0", + "cusolverDnZpotrfBatched" => "6.1.0", "cusolverDnZpotrf" => "6.1.0", "cusolverDnZZgesv_bufferSize" => "6.1.0", "cusolverDnZZgesv" => "6.1.0", "cusolverDnZZgels_bufferSize" => "6.1.0", "cusolverDnZZgels" => "6.1.0", + "cusolverDnSpotrs" => "6.1.0", "cusolverDnSpotrf_bufferSize" => "6.1.0", + "cusolverDnSpotrfBatched" => "6.1.0", "cusolverDnSpotrf" => "6.1.0", "cusolverDnSgetrs" => "6.1.0", "cusolverDnSgetrf_bufferSize" => "6.1.0", @@ -1098,7 +1102,9 @@ my %experimental_funcs = ( "cusolverDnSSgels" => "6.1.0", "cusolverDnHandle_t" => "6.1.0", "cusolverDnGetStream" => "6.1.0", + "cusolverDnDpotrs" => "6.1.0", "cusolverDnDpotrf_bufferSize" => "6.1.0", + "cusolverDnDpotrfBatched" => "6.1.0", "cusolverDnDpotrf" => "6.1.0", "cusolverDnDgetrs" => "6.1.0", "cusolverDnDgetrf_bufferSize" => "6.1.0", @@ -1109,7 +1115,9 @@ my %experimental_funcs = ( "cusolverDnDDgels_bufferSize" => "6.1.0", "cusolverDnDDgels" => "6.1.0", "cusolverDnCreate" => "6.1.0", + "cusolverDnCpotrs" => "6.1.0", "cusolverDnCpotrf_bufferSize" => "6.1.0", + "cusolverDnCpotrfBatched" => "6.1.0", "cusolverDnCpotrf" => "6.1.0", "cusolverDnCCgesv_bufferSize" => "6.1.0", "cusolverDnCCgesv" => "6.1.0", @@ -1275,7 +1283,9 @@ sub experimentalSubstitutions { subst("cusolverDnCCgesv", "hipsolverDnCCgesv", "library"); subst("cusolverDnCCgesv_bufferSize", "hipsolverDnCCgesv_bufferSize", "library"); subst("cusolverDnCpotrf", "hipsolverDnCpotrf", "library"); + subst("cusolverDnCpotrfBatched", "hipsolverDnCpotrfBatched", "library"); subst("cusolverDnCpotrf_bufferSize", "hipsolverDnCpotrf_bufferSize", "library"); + subst("cusolverDnCpotrs", "hipsolverDnCpotrs", "library"); subst("cusolverDnCreate", "hipsolverDnCreate", "library"); subst("cusolverDnDDgels", "hipsolverDnDDgels", "library"); subst("cusolverDnDDgels_bufferSize", "hipsolverDnDDgels_bufferSize", "library"); @@ -1286,7 +1296,9 @@ sub experimentalSubstitutions { subst("cusolverDnDgetrf_bufferSize", "hipsolverDnDgetrf_bufferSize", "library"); subst("cusolverDnDgetrs", "hipsolverDnDgetrs", "library"); subst("cusolverDnDpotrf", "hipsolverDnDpotrf", "library"); + subst("cusolverDnDpotrfBatched", "hipsolverDnDpotrfBatched", "library"); subst("cusolverDnDpotrf_bufferSize", "hipsolverDnDpotrf_bufferSize", "library"); + subst("cusolverDnDpotrs", "hipsolverDnDpotrs", "library"); subst("cusolverDnGetStream", "hipsolverGetStream", "library"); subst("cusolverDnSSgels", "hipsolverDnSSgels", "library"); subst("cusolverDnSSgels_bufferSize", "hipsolverDnSSgels_bufferSize", "library"); @@ -1297,13 +1309,17 @@ sub experimentalSubstitutions { subst("cusolverDnSgetrf_bufferSize", "hipsolverDnSgetrf_bufferSize", "library"); subst("cusolverDnSgetrs", "hipsolverDnSgetrs", "library"); subst("cusolverDnSpotrf", "hipsolverDnSpotrf", "library"); + subst("cusolverDnSpotrfBatched", "hipsolverDnSpotrfBatched", "library"); subst("cusolverDnSpotrf_bufferSize", "hipsolverDnSpotrf_bufferSize", "library"); + subst("cusolverDnSpotrs", "hipsolverDnSpotrs", "library"); subst("cusolverDnZZgels", "hipsolverDnZZgels", "library"); subst("cusolverDnZZgels_bufferSize", "hipsolverDnZZgels_bufferSize", "library"); subst("cusolverDnZZgesv", "hipsolverDnZZgesv", "library"); subst("cusolverDnZZgesv_bufferSize", "hipsolverDnZZgesv_bufferSize", "library"); subst("cusolverDnZpotrf", "hipsolverDnZpotrf", "library"); + subst("cusolverDnZpotrfBatched", "hipsolverDnZpotrfBatched", "library"); subst("cusolverDnZpotrf_bufferSize", "hipsolverDnZpotrf_bufferSize", "library"); + subst("cusolverDnZpotrs", "hipsolverDnZpotrs", "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 0c1cdd52..bd2088bb 100644 --- a/docs/tables/CUSOLVER_API_supported_by_HIP.md +++ b/docs/tables/CUSOLVER_API_supported_by_HIP.md @@ -125,7 +125,9 @@ |`cusolverDnCYgesv`|11.0| | | | | | | | | | |`cusolverDnCYgesv_bufferSize`|11.0| | | | | | | | | | |`cusolverDnCpotrf`| | | | |`hipsolverDnCpotrf`|5.1.0| | | |6.1.0| +|`cusolverDnCpotrfBatched`|9.1| | | |`hipsolverDnCpotrfBatched`|5.1.0| | | |6.1.0| |`cusolverDnCpotrf_bufferSize`| | | | |`hipsolverDnCpotrf_bufferSize`|5.1.0| | | |6.1.0| +|`cusolverDnCpotrs`| | | | |`hipsolverDnCpotrs`|5.1.0| | | |6.1.0| |`cusolverDnCreate`| | | | |`hipsolverDnCreate`|5.1.0| | | |6.1.0| |`cusolverDnCreateParams`|11.0| | | | | | | | | | |`cusolverDnDBgels`|11.0| | | | | | | | | | @@ -153,7 +155,9 @@ |`cusolverDnDgetrf_bufferSize`| | | | |`hipsolverDnDgetrf_bufferSize`|5.1.0| | | |6.1.0| |`cusolverDnDgetrs`| | | | |`hipsolverDnDgetrs`|5.1.0| | | |6.1.0| |`cusolverDnDpotrf`| | | | |`hipsolverDnDpotrf`|5.1.0| | | |6.1.0| +|`cusolverDnDpotrfBatched`|9.1| | | |`hipsolverDnDpotrfBatched`|5.1.0| | | |6.1.0| |`cusolverDnDpotrf_bufferSize`| | | | |`hipsolverDnDpotrf_bufferSize`|5.1.0| | | |6.1.0| +|`cusolverDnDpotrs`| | | | |`hipsolverDnDpotrs`|5.1.0| | | |6.1.0| |`cusolverDnGetDeterministicMode`|12.2| | | | | | | | | | |`cusolverDnGetStream`| | | | |`hipsolverGetStream`|4.5.0| | | |6.1.0| |`cusolverDnIRSInfosCreate`|10.2| | | | | | | | | | @@ -203,7 +207,9 @@ |`cusolverDnSgetrf_bufferSize`| | | | |`hipsolverDnSgetrf_bufferSize`|5.1.0| | | |6.1.0| |`cusolverDnSgetrs`| | | | |`hipsolverDnSgetrs`|5.1.0| | | |6.1.0| |`cusolverDnSpotrf`| | | | |`hipsolverDnSpotrf`|5.1.0| | | |6.1.0| +|`cusolverDnSpotrfBatched`|9.1| | | |`hipsolverDnSpotrfBatched`|5.1.0| | | |6.1.0| |`cusolverDnSpotrf_bufferSize`| | | | |`hipsolverDnSpotrf_bufferSize`|5.1.0| | | |6.1.0| +|`cusolverDnSpotrs`| | | | |`hipsolverDnSpotrs`|5.1.0| | | |6.1.0| |`cusolverDnXgetrf`|11.1| | | | | | | | | | |`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | | |`cusolverDnXgetrs`|11.1| | | | | | | | | | @@ -228,7 +234,9 @@ |`cusolverDnZZgesv`|10.2| | | |`hipsolverDnZZgesv`|5.1.0| | | |6.1.0| |`cusolverDnZZgesv_bufferSize`|10.2| | | |`hipsolverDnZZgesv_bufferSize`|5.1.0| | | |6.1.0| |`cusolverDnZpotrf`| | | | |`hipsolverDnZpotrf`|5.1.0| | | |6.1.0| +|`cusolverDnZpotrfBatched`|9.1| | | |`hipsolverDnZpotrfBatched`|5.1.0| | | |6.1.0| |`cusolverDnZpotrf_bufferSize`| | | | |`hipsolverDnZpotrf_bufferSize`|5.1.0| | | |6.1.0| +|`cusolverDnZpotrs`| | | | |`hipsolverDnZpotrs`|5.1.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 da29b7eb..dca995ee 100644 --- a/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md @@ -125,7 +125,9 @@ |`cusolverDnCYgesv`|11.0| | | | | | | | | | | | | | | | |`cusolverDnCYgesv_bufferSize`|11.0| | | | | | | | | | | | | | | | |`cusolverDnCpotrf`| | | | |`hipsolverDnCpotrf`|5.1.0| | | |6.1.0|`rocsolver_cpotrf`|3.6.0| | | |6.1.0| +|`cusolverDnCpotrfBatched`|9.1| | | |`hipsolverDnCpotrfBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnCpotrf_bufferSize`| | | | |`hipsolverDnCpotrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | +|`cusolverDnCpotrs`| | | | |`hipsolverDnCpotrs`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnCreate`| | | | |`hipsolverDnCreate`|5.1.0| | | |6.1.0|`rocblas_create_handle`| | | | | | |`cusolverDnCreateParams`|11.0| | | | | | | | | | | | | | | | |`cusolverDnDBgels`|11.0| | | | | | | | | | | | | | | | @@ -153,7 +155,9 @@ |`cusolverDnDgetrf_bufferSize`| | | | |`hipsolverDnDgetrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnDgetrs`| | | | |`hipsolverDnDgetrs`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnDpotrf`| | | | |`hipsolverDnDpotrf`|5.1.0| | | |6.1.0|`rocsolver_dpotrf`|3.2.0| | | |6.1.0| +|`cusolverDnDpotrfBatched`|9.1| | | |`hipsolverDnDpotrfBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnDpotrf_bufferSize`| | | | |`hipsolverDnDpotrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | +|`cusolverDnDpotrs`| | | | |`hipsolverDnDpotrs`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnGetDeterministicMode`|12.2| | | | | | | | | | | | | | | | |`cusolverDnGetStream`| | | | |`hipsolverGetStream`|4.5.0| | | |6.1.0|`rocblas_get_stream`| | | | | | |`cusolverDnIRSInfosCreate`|10.2| | | | | | | | | | | | | | | | @@ -203,7 +207,9 @@ |`cusolverDnSgetrf_bufferSize`| | | | |`hipsolverDnSgetrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnSgetrs`| | | | |`hipsolverDnSgetrs`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnSpotrf`| | | | |`hipsolverDnSpotrf`|5.1.0| | | |6.1.0|`rocsolver_spotrf`|3.2.0| | | |6.1.0| +|`cusolverDnSpotrfBatched`|9.1| | | |`hipsolverDnSpotrfBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnSpotrf_bufferSize`| | | | |`hipsolverDnSpotrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | +|`cusolverDnSpotrs`| | | | |`hipsolverDnSpotrs`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnXgetrf`|11.1| | | | | | | | | | | | | | | | |`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | | | | | | | | |`cusolverDnXgetrs`|11.1| | | | | | | | | | | | | | | | @@ -228,7 +234,9 @@ |`cusolverDnZZgesv`|10.2| | | |`hipsolverDnZZgesv`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnZZgesv_bufferSize`|10.2| | | |`hipsolverDnZZgesv_bufferSize`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnZpotrf`| | | | |`hipsolverDnZpotrf`|5.1.0| | | |6.1.0|`rocsolver_zpotrf`|3.6.0| | | |6.1.0| +|`cusolverDnZpotrfBatched`|9.1| | | |`hipsolverDnZpotrfBatched`|5.1.0| | | |6.1.0| | | | | | | |`cusolverDnZpotrf_bufferSize`| | | | |`hipsolverDnZpotrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | | +|`cusolverDnZpotrs`| | | | |`hipsolverDnZpotrs`|5.1.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 b0c30ea3..c2271e58 100644 --- a/docs/tables/CUSOLVER_API_supported_by_ROC.md +++ b/docs/tables/CUSOLVER_API_supported_by_ROC.md @@ -125,7 +125,9 @@ |`cusolverDnCYgesv`|11.0| | | | | | | | | | |`cusolverDnCYgesv_bufferSize`|11.0| | | | | | | | | | |`cusolverDnCpotrf`| | | | |`rocsolver_cpotrf`|3.6.0| | | |6.1.0| +|`cusolverDnCpotrfBatched`|9.1| | | | | | | | | | |`cusolverDnCpotrf_bufferSize`| | | | | | | | | | | +|`cusolverDnCpotrs`| | | | | | | | | | | |`cusolverDnCreate`| | | | |`rocblas_create_handle`| | | | | | |`cusolverDnCreateParams`|11.0| | | | | | | | | | |`cusolverDnDBgels`|11.0| | | | | | | | | | @@ -153,7 +155,9 @@ |`cusolverDnDgetrf_bufferSize`| | | | | | | | | | | |`cusolverDnDgetrs`| | | | | | | | | | | |`cusolverDnDpotrf`| | | | |`rocsolver_dpotrf`|3.2.0| | | |6.1.0| +|`cusolverDnDpotrfBatched`|9.1| | | | | | | | | | |`cusolverDnDpotrf_bufferSize`| | | | | | | | | | | +|`cusolverDnDpotrs`| | | | | | | | | | | |`cusolverDnGetDeterministicMode`|12.2| | | | | | | | | | |`cusolverDnGetStream`| | | | |`rocblas_get_stream`| | | | | | |`cusolverDnIRSInfosCreate`|10.2| | | | | | | | | | @@ -203,7 +207,9 @@ |`cusolverDnSgetrf_bufferSize`| | | | | | | | | | | |`cusolverDnSgetrs`| | | | | | | | | | | |`cusolverDnSpotrf`| | | | |`rocsolver_spotrf`|3.2.0| | | |6.1.0| +|`cusolverDnSpotrfBatched`|9.1| | | | | | | | | | |`cusolverDnSpotrf_bufferSize`| | | | | | | | | | | +|`cusolverDnSpotrs`| | | | | | | | | | | |`cusolverDnXgetrf`|11.1| | | | | | | | | | |`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | | |`cusolverDnXgetrs`|11.1| | | | | | | | | | @@ -228,7 +234,9 @@ |`cusolverDnZZgesv`|10.2| | | | | | | | | | |`cusolverDnZZgesv_bufferSize`|10.2| | | | | | | | | | |`cusolverDnZpotrf`| | | | |`rocsolver_zpotrf`|3.6.0| | | |6.1.0| +|`cusolverDnZpotrfBatched`|9.1| | | | | | | | | | |`cusolverDnZpotrf_bufferSize`| | | | | | | | | | | +|`cusolverDnZpotrs`| | | | | | | | | | | \*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 fd87f93f..698e0322 100644 --- a/src/CUDA2HIP_SOLVER_API_functions.cpp +++ b/src/CUDA2HIP_SOLVER_API_functions.cpp @@ -172,6 +172,16 @@ const std::map CUDA_SOLVER_FUNCTION_MAP { {"cusolverDnDpotrf", {"hipsolverDnDpotrf", "rocsolver_dpotrf", CONV_LIB_FUNC, API_SOLVER, 2, HIP_EXPERIMENTAL}}, {"cusolverDnCpotrf", {"hipsolverDnCpotrf", "rocsolver_cpotrf", CONV_LIB_FUNC, API_SOLVER, 2, HIP_EXPERIMENTAL}}, {"cusolverDnZpotrf", {"hipsolverDnZpotrf", "rocsolver_zpotrf", CONV_LIB_FUNC, API_SOLVER, 2, HIP_EXPERIMENTAL}}, + // NOTE: rocsolver_(s|d|c|z)potrs has a harness of rocblas_set_workspace, hipsolver(S|D|C|Z)potrs_bufferSize, hipsolverManageWorkspace, and hipsolverZeroInfo + {"cusolverDnSpotrs", {"hipsolverDnSpotrs", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnDpotrs", {"hipsolverDnDpotrs", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnCpotrs", {"hipsolverDnCpotrs", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnZpotrs", {"hipsolverDnZpotrs", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + // NOTE: rocsolver_(s|d|c|z)potrf_batched has a harness of rocblas_set_workspace, hipsolver(S|D|C|Z)potrfBatched_bufferSize, and hipsolverManageWorkspace + {"cusolverDnSpotrfBatched", {"hipsolverDnSpotrfBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnDpotrfBatched", {"hipsolverDnDpotrfBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnCpotrfBatched", {"hipsolverDnCpotrfBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, + {"cusolverDnZpotrfBatched", {"hipsolverDnZpotrfBatched", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}}, }; const std::map CUDA_SOLVER_FUNCTION_VER_MAP { @@ -278,6 +288,10 @@ const std::map CUDA_SOLVER_FUNCTION_VER_MAP { {"cusolverDnIRSXgesv_bufferSize", {CUDA_102, CUDA_0, CUDA_0}}, {"cusolverDnIRSXgels", {CUDA_110, CUDA_0, CUDA_0}}, {"cusolverDnIRSXgels_bufferSize", {CUDA_110, CUDA_0, CUDA_0}}, + {"cusolverDnSpotrfBatched", {CUDA_91, CUDA_0, CUDA_0}}, + {"cusolverDnDpotrfBatched", {CUDA_91, CUDA_0, CUDA_0}}, + {"cusolverDnCpotrfBatched", {CUDA_91, CUDA_0, CUDA_0}}, + {"cusolverDnZpotrfBatched", {CUDA_91, CUDA_0, CUDA_0}}, }; const std::map HIP_SOLVER_FUNCTION_VER_MAP { @@ -315,6 +329,14 @@ const std::map HIP_SOLVER_FUNCTION_VER_MAP { {"hipsolverDnDpotrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, {"hipsolverDnCpotrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, {"hipsolverDnZpotrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnSpotrs", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnDpotrs", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnCpotrs", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnZpotrs", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnSpotrfBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnDpotrfBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnCpotrfBatched", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}}, + {"hipsolverDnZpotrfBatched", {HIP_5010, 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 81fd1bf5..56e921fc 100644 --- a/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu +++ b/tests/unit_tests/synthetic/libraries/cusolver2hipsolver.cu @@ -17,6 +17,8 @@ int main() { int Lwork = 0; int devIpiv = 0; int devInfo = 0; + int infoArray = 0; + int batchSize = 0; float fA = 0.f; float fB = 0.f; float fX = 0.f; @@ -28,12 +30,21 @@ int main() { void *Workspace = nullptr; size_t lwork_bytes = 0; + float** fAarray = 0; + double** dAarray = 0; + // CHECK: hipDoubleComplex dComplexA, dComplexB, dComplexX, dComplexWorkspace; cuDoubleComplex dComplexA, dComplexB, dComplexX, dComplexWorkspace; // CHECK: hipComplex complexA, complexB, complexX, complexWorkspace; cuComplex complexA, complexB, complexX, complexWorkspace; + // CHECK: hipDoubleComplex** dcomplexAarray = 0; + cuDoubleComplex** dcomplexAarray = 0; + + // CHECK: hipComplex** complexAarray = 0; + cuComplex** complexAarray = 0; + // CHECK: hipsolverHandle_t handle; cusolverDnHandle_t handle; @@ -159,6 +170,26 @@ int main() { // CHECK: status = hipsolverDnZpotrf(handle, fillMode, n, &dComplexA, lda, &dComplexWorkspace, Lwork, &devInfo); status = cusolverDnZpotrf(handle, fillMode, n, &dComplexA, lda, &dComplexWorkspace, Lwork, &devInfo); + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnSpotrs(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, int nrhs, const float * A, int lda, float * B, int ldb, int * devInfo); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnSpotrs(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, int nrhs, const float* A, int lda, float* B, int ldb, int* devInfo); + // CHECK: status = hipsolverDnSpotrs(handle, fillMode, n, nrhs, &fA, lda, &fB, ldb, &devInfo); + status = cusolverDnSpotrs(handle, fillMode, n, nrhs, &fA, lda, &fB, ldb, &devInfo); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnDpotrs(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, int nrhs, const double * A, int lda, double * B, int ldb, int * devInfo); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnDpotrs(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, int nrhs, const double* A, int lda, double* B, int ldb, int* devInfo); + // CHECK: status = hipsolverDnDpotrs(handle, fillMode, n, nrhs, &dA, lda, &dB, ldb, &devInfo); + status = cusolverDnDpotrs(handle, fillMode, n, nrhs, &dA, lda, &dB, ldb, &devInfo); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnCpotrs(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, int nrhs, const cuComplex * A, int lda, cuComplex * B, int ldb, int * devInfo); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnCpotrs(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, int nrhs, const hipFloatComplex* A, int lda, hipFloatComplex* B, int ldb, int* devInfo); + // CHECK: status = hipsolverDnCpotrs(handle, fillMode, n, nrhs, &complexA, lda, &complexB, ldb, &devInfo); + status = cusolverDnCpotrs(handle, fillMode, n, nrhs, &complexA, lda, &complexB, ldb, &devInfo); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnZpotrs(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, int nrhs, const cuDoubleComplex *A, int lda, cuDoubleComplex * B, int ldb, int * devInfo); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnZpotrs(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, int nrhs, const hipDoubleComplex* A, int lda, hipDoubleComplex* B, int ldb, int* devInfo); + // CHECK: status = hipsolverDnZpotrs(handle, fillMode, n, nrhs, &dComplexA, lda, &dComplexB, ldb, &devInfo); + status = cusolverDnZpotrs(handle, fillMode, n, nrhs, &dComplexA, lda, &dComplexB, ldb, &devInfo); + #if CUDA_VERSION >= 8000 // CHECK: hipsolverEigType_t eigType; // CHECK-NEXT: hipsolverEigType_t EIG_TYPE_1 = HIPSOLVER_EIG_TYPE_1; @@ -185,6 +216,28 @@ int main() { gesvdjInfo_t gesvdj_info; #endif +#if CUDA_VERSION >= 9010 + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnSpotrfBatched(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, float * Aarray[], int lda, int * infoArray, int batchSize); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnSpotrfBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, float* A[], int lda, int* devInfo, int batch_count); + // CHECK: status = hipsolverDnSpotrfBatched(handle, fillMode, n, fAarray, lda, &infoArray, batchSize); + status = cusolverDnSpotrfBatched(handle, fillMode, n, fAarray, lda, &infoArray, batchSize); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnDpotrfBatched(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, double * Aarray[], int lda, int * infoArray, int batchSize); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnDpotrfBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, double* A[], int lda, int* devInfo, int batch_count); + // CHECK: status = hipsolverDnDpotrfBatched(handle, fillMode, n, dAarray, lda, &infoArray, batchSize); + status = cusolverDnDpotrfBatched(handle, fillMode, n, dAarray, lda, &infoArray, batchSize); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnCpotrfBatched(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, cuComplex * Aarray[], int lda, int * infoArray, int batchSize); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnCpotrfBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, hipFloatComplex* A[], int lda, int* devInfo, int batch_count); + // CHECK: status = hipsolverDnCpotrfBatched(handle, fillMode, n, complexAarray, lda, &infoArray, batchSize); + status = cusolverDnCpotrfBatched(handle, fillMode, n, complexAarray, lda, &infoArray, batchSize); + + // CUDA: cusolverStatus_t CUSOLVERAPI cusolverDnZpotrfBatched(cusolverDnHandle_t handle, cublasFillMode_t uplo, int n, cuDoubleComplex * Aarray[], int lda, int * infoArray, int batchSize); + // HIP: HIPSOLVER_EXPORT hipsolverStatus_t hipsolverDnZpotrfBatched(hipsolverHandle_t handle, hipblasFillMode_t uplo, int n, hipDoubleComplex* A[], int lda, int* devInfo, int batch_count); + // CHECK: status = hipsolverDnZpotrfBatched(handle, fillMode, n, dcomplexAarray, lda, &infoArray, batchSize); + status = cusolverDnZpotrfBatched(handle, fillMode, n, dcomplexAarray, lda, &infoArray, batchSize); +#endif + #if CUDA_VERSION >= 10010 // CHECK: int solver_int = 0; // CHECK: int lm = 0;