Skip to content

Commit

Permalink
Merge pull request #1183 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][#675][#677][SOLVER][feature] `cuSOLVER` support - Step 25 - Functions (DN)
  • Loading branch information
emankov authored Dec 5, 2023
2 parents 3826ea1 + feeb794 commit 5698923
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 4 deletions.
16 changes: 16 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,8 @@ my %experimental_funcs = (
"cusolverDnZgetrs" => "6.1.0",
"cusolverDnZgetrf_bufferSize" => "6.1.0",
"cusolverDnZgetrf" => "6.1.0",
"cusolverDnZgeqrf_bufferSize" => "6.1.0",
"cusolverDnZgeqrf" => "6.1.0",
"cusolverDnZZgesv_bufferSize" => "6.1.0",
"cusolverDnZZgesv" => "6.1.0",
"cusolverDnZZgels_bufferSize" => "6.1.0",
Expand All @@ -1104,6 +1106,8 @@ my %experimental_funcs = (
"cusolverDnSgetrs" => "6.1.0",
"cusolverDnSgetrf_bufferSize" => "6.1.0",
"cusolverDnSgetrf" => "6.1.0",
"cusolverDnSgeqrf_bufferSize" => "6.1.0",
"cusolverDnSgeqrf" => "6.1.0",
"cusolverDnSetStream" => "6.1.0",
"cusolverDnSSgesv_bufferSize" => "6.1.0",
"cusolverDnSSgesv" => "6.1.0",
Expand All @@ -1121,6 +1125,8 @@ my %experimental_funcs = (
"cusolverDnDgetrs" => "6.1.0",
"cusolverDnDgetrf_bufferSize" => "6.1.0",
"cusolverDnDgetrf" => "6.1.0",
"cusolverDnDgeqrf_bufferSize" => "6.1.0",
"cusolverDnDgeqrf" => "6.1.0",
"cusolverDnDestroy" => "6.1.0",
"cusolverDnDDgesv_bufferSize" => "6.1.0",
"cusolverDnDDgesv" => "6.1.0",
Expand All @@ -1137,6 +1143,8 @@ my %experimental_funcs = (
"cusolverDnCgetrs" => "6.1.0",
"cusolverDnCgetrf_bufferSize" => "6.1.0",
"cusolverDnCgetrf" => "6.1.0",
"cusolverDnCgeqrf_bufferSize" => "6.1.0",
"cusolverDnCgeqrf" => "6.1.0",
"cusolverDnCCgesv_bufferSize" => "6.1.0",
"cusolverDnCCgesv" => "6.1.0",
"cusolverDnCCgels_bufferSize" => "6.1.0",
Expand Down Expand Up @@ -1300,6 +1308,8 @@ sub experimentalSubstitutions {
subst("cusolverDnCCgels_bufferSize", "hipsolverDnCCgels_bufferSize", "library");
subst("cusolverDnCCgesv", "hipsolverDnCCgesv", "library");
subst("cusolverDnCCgesv_bufferSize", "hipsolverDnCCgesv_bufferSize", "library");
subst("cusolverDnCgeqrf", "hipsolverDnCgeqrf", "library");
subst("cusolverDnCgeqrf_bufferSize", "hipsolverDnCgeqrf_bufferSize", "library");
subst("cusolverDnCgetrf", "hipsolverDnCgetrf", "library");
subst("cusolverDnCgetrf_bufferSize", "hipsolverDnCgetrf_bufferSize", "library");
subst("cusolverDnCgetrs", "hipsolverDnCgetrs", "library");
Expand All @@ -1316,6 +1326,8 @@ sub experimentalSubstitutions {
subst("cusolverDnDDgesv", "hipsolverDnDDgesv", "library");
subst("cusolverDnDDgesv_bufferSize", "hipsolverDnDDgesv_bufferSize", "library");
subst("cusolverDnDestroy", "hipsolverDnDestroy", "library");
subst("cusolverDnDgeqrf", "hipsolverDnDgeqrf", "library");
subst("cusolverDnDgeqrf_bufferSize", "hipsolverDnDgeqrf_bufferSize", "library");
subst("cusolverDnDgetrf", "hipsolverDnDgetrf", "library");
subst("cusolverDnDgetrf_bufferSize", "hipsolverDnDgetrf_bufferSize", "library");
subst("cusolverDnDgetrs", "hipsolverDnDgetrs", "library");
Expand All @@ -1332,6 +1344,8 @@ sub experimentalSubstitutions {
subst("cusolverDnSSgesv", "hipsolverDnSSgesv", "library");
subst("cusolverDnSSgesv_bufferSize", "hipsolverDnSSgesv_bufferSize", "library");
subst("cusolverDnSetStream", "hipsolverSetStream", "library");
subst("cusolverDnSgeqrf", "hipsolverDnSgeqrf", "library");
subst("cusolverDnSgeqrf_bufferSize", "hipsolverDnSgeqrf_bufferSize", "library");
subst("cusolverDnSgetrf", "hipsolverDnSgetrf", "library");
subst("cusolverDnSgetrf_bufferSize", "hipsolverDnSgetrf_bufferSize", "library");
subst("cusolverDnSgetrs", "hipsolverDnSgetrs", "library");
Expand All @@ -1346,6 +1360,8 @@ sub experimentalSubstitutions {
subst("cusolverDnZZgels_bufferSize", "hipsolverDnZZgels_bufferSize", "library");
subst("cusolverDnZZgesv", "hipsolverDnZZgesv", "library");
subst("cusolverDnZZgesv_bufferSize", "hipsolverDnZZgesv_bufferSize", "library");
subst("cusolverDnZgeqrf", "hipsolverDnZgeqrf", "library");
subst("cusolverDnZgeqrf_bufferSize", "hipsolverDnZgeqrf_bufferSize", "library");
subst("cusolverDnZgetrf", "hipsolverDnZgetrf", "library");
subst("cusolverDnZgetrf_bufferSize", "hipsolverDnZgetrf_bufferSize", "library");
subst("cusolverDnZgetrs", "hipsolverDnZgetrs", "library");
Expand Down
8 changes: 8 additions & 0 deletions docs/tables/CUSOLVER_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
|`cusolverDnCYgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnCYgesv`|11.0| | | | | | | | | |
|`cusolverDnCYgesv_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnCgeqrf`| | | | |`hipsolverDnCgeqrf`|5.1.0| | | |6.1.0|
|`cusolverDnCgeqrf_bufferSize`| | | | |`hipsolverDnCgeqrf_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnCgetrf`| | | | |`hipsolverDnCgetrf`|5.1.0| | | |6.1.0|
|`cusolverDnCgetrf_bufferSize`| | | | |`hipsolverDnCgetrf_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnCgetrs`| | | | |`hipsolverDnCgetrs`|5.1.0| | | |6.1.0|
Expand Down Expand Up @@ -160,6 +162,8 @@
|`cusolverDnDXgesv`|11.0| | | | | | | | | |
|`cusolverDnDXgesv_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDestroy`| | | | |`hipsolverDnDestroy`|5.1.0| | | |6.1.0|
|`cusolverDnDgeqrf`| | | | |`hipsolverDnDgeqrf`|5.1.0| | | |6.1.0|
|`cusolverDnDgeqrf_bufferSize`| | | | |`hipsolverDnDgeqrf_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnDgetrf`| | | | |`hipsolverDnDgetrf`|5.1.0| | | |6.1.0|
|`cusolverDnDgetrf_bufferSize`| | | | |`hipsolverDnDgetrf_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnDgetrs`| | | | |`hipsolverDnDgetrs`|5.1.0| | | |6.1.0|
Expand Down Expand Up @@ -218,6 +222,8 @@
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | |
|`cusolverDnSetDeterministicMode`|12.2| | | | | | | | | |
|`cusolverDnSetStream`| | | | |`hipsolverSetStream`|4.5.0| | | |6.1.0|
|`cusolverDnSgeqrf`| | | | |`hipsolverDnSgeqrf`|5.1.0| | | |6.1.0|
|`cusolverDnSgeqrf_bufferSize`| | | | |`hipsolverDnSgeqrf_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnSgetrf`| | | | |`hipsolverDnSgetrf`|5.1.0| | | |6.1.0|
|`cusolverDnSgetrf_bufferSize`| | | | |`hipsolverDnSgetrf_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnSgetrs`| | | | |`hipsolverDnSgetrs`|5.1.0| | | |6.1.0|
Expand Down Expand Up @@ -256,6 +262,8 @@
|`cusolverDnZZgels_bufferSize`|11.0| | | |`hipsolverDnZZgels_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnZZgesv`|10.2| | | |`hipsolverDnZZgesv`|5.1.0| | | |6.1.0|
|`cusolverDnZZgesv_bufferSize`|10.2| | | |`hipsolverDnZZgesv_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnZgeqrf`| | | | |`hipsolverDnZgeqrf`|5.1.0| | | |6.1.0|
|`cusolverDnZgeqrf_bufferSize`| | | | |`hipsolverDnZgeqrf_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnZgetrf`| | | | |`hipsolverDnZgetrf`|5.1.0| | | |6.1.0|
|`cusolverDnZgetrf_bufferSize`| | | | |`hipsolverDnZgetrf_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnZgetrs`| | | | |`hipsolverDnZgetrs`|5.1.0| | | |6.1.0|
Expand Down
8 changes: 8 additions & 0 deletions docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
|`cusolverDnCYgels_bufferSize`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnCYgesv`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnCYgesv_bufferSize`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnCgeqrf`| | | | |`hipsolverDnCgeqrf`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCgeqrf_bufferSize`| | | | |`hipsolverDnCgeqrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCgetrf`| | | | |`hipsolverDnCgetrf`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCgetrf_bufferSize`| | | | |`hipsolverDnCgetrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCgetrs`| | | | |`hipsolverDnCgetrs`|5.1.0| | | |6.1.0| | | | | | |
Expand Down Expand Up @@ -160,6 +162,8 @@
|`cusolverDnDXgesv`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDXgesv_bufferSize`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDestroy`| | | | |`hipsolverDnDestroy`|5.1.0| | | |6.1.0|`rocblas_destroy_handle`| | | | | |
|`cusolverDnDgeqrf`| | | | |`hipsolverDnDgeqrf`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDgeqrf_bufferSize`| | | | |`hipsolverDnDgeqrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDgetrf`| | | | |`hipsolverDnDgetrf`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDgetrf_bufferSize`| | | | |`hipsolverDnDgetrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDgetrs`| | | | |`hipsolverDnDgetrs`|5.1.0| | | |6.1.0| | | | | | |
Expand Down Expand Up @@ -218,6 +222,8 @@
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnSetDeterministicMode`|12.2| | | | | | | | | | | | | | | |
|`cusolverDnSetStream`| | | | |`hipsolverSetStream`|4.5.0| | | |6.1.0|`rocblas_set_stream`| | | | | |
|`cusolverDnSgeqrf`| | | | |`hipsolverDnSgeqrf`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSgeqrf_bufferSize`| | | | |`hipsolverDnSgeqrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSgetrf`| | | | |`hipsolverDnSgetrf`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSgetrf_bufferSize`| | | | |`hipsolverDnSgetrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSgetrs`| | | | |`hipsolverDnSgetrs`|5.1.0| | | |6.1.0| | | | | | |
Expand Down Expand Up @@ -256,6 +262,8 @@
|`cusolverDnZZgels_bufferSize`|11.0| | | |`hipsolverDnZZgels_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZZgesv`|10.2| | | |`hipsolverDnZZgesv`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZZgesv_bufferSize`|10.2| | | |`hipsolverDnZZgesv_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZgeqrf`| | | | |`hipsolverDnZgeqrf`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZgeqrf_bufferSize`| | | | |`hipsolverDnZgeqrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZgetrf`| | | | |`hipsolverDnZgetrf`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZgetrf_bufferSize`| | | | |`hipsolverDnZgetrf_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZgetrs`| | | | |`hipsolverDnZgetrs`|5.1.0| | | |6.1.0| | | | | | |
Expand Down
8 changes: 8 additions & 0 deletions docs/tables/CUSOLVER_API_supported_by_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
|`cusolverDnCYgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnCYgesv`|11.0| | | | | | | | | |
|`cusolverDnCYgesv_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnCgeqrf`| | | | | | | | | | |
|`cusolverDnCgeqrf_bufferSize`| | | | | | | | | | |
|`cusolverDnCgetrf`| | | | | | | | | | |
|`cusolverDnCgetrf_bufferSize`| | | | | | | | | | |
|`cusolverDnCgetrs`| | | | | | | | | | |
Expand Down Expand Up @@ -160,6 +162,8 @@
|`cusolverDnDXgesv`|11.0| | | | | | | | | |
|`cusolverDnDXgesv_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDestroy`| | | | |`rocblas_destroy_handle`| | | | | |
|`cusolverDnDgeqrf`| | | | | | | | | | |
|`cusolverDnDgeqrf_bufferSize`| | | | | | | | | | |
|`cusolverDnDgetrf`| | | | | | | | | | |
|`cusolverDnDgetrf_bufferSize`| | | | | | | | | | |
|`cusolverDnDgetrs`| | | | | | | | | | |
Expand Down Expand Up @@ -218,6 +222,8 @@
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | |
|`cusolverDnSetDeterministicMode`|12.2| | | | | | | | | |
|`cusolverDnSetStream`| | | | |`rocblas_set_stream`| | | | | |
|`cusolverDnSgeqrf`| | | | | | | | | | |
|`cusolverDnSgeqrf_bufferSize`| | | | | | | | | | |
|`cusolverDnSgetrf`| | | | | | | | | | |
|`cusolverDnSgetrf_bufferSize`| | | | | | | | | | |
|`cusolverDnSgetrs`| | | | | | | | | | |
Expand Down Expand Up @@ -256,6 +262,8 @@
|`cusolverDnZZgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnZZgesv`|10.2| | | | | | | | | |
|`cusolverDnZZgesv_bufferSize`|10.2| | | | | | | | | |
|`cusolverDnZgeqrf`| | | | | | | | | | |
|`cusolverDnZgeqrf_bufferSize`| | | | | | | | | | |
|`cusolverDnZgetrf`| | | | | | | | | | |
|`cusolverDnZgetrf_bufferSize`| | | | | | | | | | |
|`cusolverDnZgetrs`| | | | | | | | | | |
Expand Down
18 changes: 18 additions & 0 deletions src/CUDA2HIP_SOLVER_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SOLVER_FUNCTION_MAP {
{"cusolverDnDlaswp", {"hipsolverDnDlaswp", "", CONV_LIB_FUNC, API_SOLVER, 2, UNSUPPORTED}},
{"cusolverDnClaswp", {"hipsolverDnClaswp", "", CONV_LIB_FUNC, API_SOLVER, 2, UNSUPPORTED}},
{"cusolverDnZlaswp", {"hipsolverDnZlaswp", "", CONV_LIB_FUNC, API_SOLVER, 2, UNSUPPORTED}},
// NOTE: rocsolver_(s|d|c|z)geqrf have a harness of other HIP and ROC API calls
{"cusolverDnSgeqrf_bufferSize", {"hipsolverDnSgeqrf_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDgeqrf_bufferSize", {"hipsolverDnDgeqrf_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCgeqrf_bufferSize", {"hipsolverDnCgeqrf_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZgeqrf_bufferSize", {"hipsolverDnZgeqrf_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d|c|z)geqrf have a harness of other HIP and ROC API calls
{"cusolverDnSgeqrf", {"hipsolverDnSgeqrf", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDgeqrf", {"hipsolverDnDgeqrf", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCgeqrf", {"hipsolverDnCgeqrf", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZgeqrf", {"hipsolverDnZgeqrf", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
};

const std::map<llvm::StringRef, cudaAPIversions> CUDA_SOLVER_FUNCTION_VER_MAP {
Expand Down Expand Up @@ -406,6 +416,14 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
{"hipsolverDnDpotri", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCpotri", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZpotri", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSgeqrf_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDgeqrf_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCgeqrf_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZgeqrf_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSgeqrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDgeqrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCgeqrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZgeqrf", {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}},
Expand Down
Loading

0 comments on commit 5698923

Please sign in to comment.