Skip to content

Commit

Permalink
Merge pull request #1195 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][#675][#677][SOLVER][feature] `cuSOLVER` support - Step 30 - Functions (DN)
  • Loading branch information
emankov authored Dec 10, 2023
2 parents bcda3a0 + 9e62913 commit c9072a2
Show file tree
Hide file tree
Showing 6 changed files with 110 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 @@ -1098,6 +1098,8 @@ my %experimental_funcs = (
"cusolverDnZgetrf" => "6.1.0",
"cusolverDnZgeqrf_bufferSize" => "6.1.0",
"cusolverDnZgeqrf" => "6.1.0",
"cusolverDnZgebrd_bufferSize" => "6.1.0",
"cusolverDnZgebrd" => "6.1.0",
"cusolverDnZZgesv_bufferSize" => "6.1.0",
"cusolverDnZZgesv" => "6.1.0",
"cusolverDnZZgels_bufferSize" => "6.1.0",
Expand All @@ -1120,6 +1122,8 @@ my %experimental_funcs = (
"cusolverDnSgetrf" => "6.1.0",
"cusolverDnSgeqrf_bufferSize" => "6.1.0",
"cusolverDnSgeqrf" => "6.1.0",
"cusolverDnSgebrd_bufferSize" => "6.1.0",
"cusolverDnSgebrd" => "6.1.0",
"cusolverDnSetStream" => "6.1.0",
"cusolverDnSSgesv_bufferSize" => "6.1.0",
"cusolverDnSSgesv" => "6.1.0",
Expand All @@ -1145,6 +1149,8 @@ my %experimental_funcs = (
"cusolverDnDgetrf" => "6.1.0",
"cusolverDnDgeqrf_bufferSize" => "6.1.0",
"cusolverDnDgeqrf" => "6.1.0",
"cusolverDnDgebrd_bufferSize" => "6.1.0",
"cusolverDnDgebrd" => "6.1.0",
"cusolverDnDestroy" => "6.1.0",
"cusolverDnDDgesv_bufferSize" => "6.1.0",
"cusolverDnDDgesv" => "6.1.0",
Expand All @@ -1169,6 +1175,8 @@ my %experimental_funcs = (
"cusolverDnCgetrf" => "6.1.0",
"cusolverDnCgeqrf_bufferSize" => "6.1.0",
"cusolverDnCgeqrf" => "6.1.0",
"cusolverDnCgebrd_bufferSize" => "6.1.0",
"cusolverDnCgebrd" => "6.1.0",
"cusolverDnCCgesv_bufferSize" => "6.1.0",
"cusolverDnCCgesv" => "6.1.0",
"cusolverDnCCgels_bufferSize" => "6.1.0",
Expand Down Expand Up @@ -1332,6 +1340,8 @@ sub experimentalSubstitutions {
subst("cusolverDnCCgels_bufferSize", "hipsolverDnCCgels_bufferSize", "library");
subst("cusolverDnCCgesv", "hipsolverDnCCgesv", "library");
subst("cusolverDnCCgesv_bufferSize", "hipsolverDnCCgesv_bufferSize", "library");
subst("cusolverDnCgebrd", "hipsolverDnCgebrd", "library");
subst("cusolverDnCgebrd_bufferSize", "hipsolverDnCgebrd_bufferSize", "library");
subst("cusolverDnCgeqrf", "hipsolverDnCgeqrf", "library");
subst("cusolverDnCgeqrf_bufferSize", "hipsolverDnCgeqrf_bufferSize", "library");
subst("cusolverDnCgetrf", "hipsolverDnCgetrf", "library");
Expand All @@ -1356,6 +1366,8 @@ sub experimentalSubstitutions {
subst("cusolverDnDDgesv", "hipsolverDnDDgesv", "library");
subst("cusolverDnDDgesv_bufferSize", "hipsolverDnDDgesv_bufferSize", "library");
subst("cusolverDnDestroy", "hipsolverDnDestroy", "library");
subst("cusolverDnDgebrd", "hipsolverDnDgebrd", "library");
subst("cusolverDnDgebrd_bufferSize", "hipsolverDnDgebrd_bufferSize", "library");
subst("cusolverDnDgeqrf", "hipsolverDnDgeqrf", "library");
subst("cusolverDnDgeqrf_bufferSize", "hipsolverDnDgeqrf_bufferSize", "library");
subst("cusolverDnDgetrf", "hipsolverDnDgetrf", "library");
Expand All @@ -1380,6 +1392,8 @@ sub experimentalSubstitutions {
subst("cusolverDnSSgesv", "hipsolverDnSSgesv", "library");
subst("cusolverDnSSgesv_bufferSize", "hipsolverDnSSgesv_bufferSize", "library");
subst("cusolverDnSetStream", "hipsolverSetStream", "library");
subst("cusolverDnSgebrd", "hipsolverDnSgebrd", "library");
subst("cusolverDnSgebrd_bufferSize", "hipsolverDnSgebrd_bufferSize", "library");
subst("cusolverDnSgeqrf", "hipsolverDnSgeqrf", "library");
subst("cusolverDnSgeqrf_bufferSize", "hipsolverDnSgeqrf_bufferSize", "library");
subst("cusolverDnSgetrf", "hipsolverDnSgetrf", "library");
Expand All @@ -1402,6 +1416,8 @@ sub experimentalSubstitutions {
subst("cusolverDnZZgels_bufferSize", "hipsolverDnZZgels_bufferSize", "library");
subst("cusolverDnZZgesv", "hipsolverDnZZgesv", "library");
subst("cusolverDnZZgesv_bufferSize", "hipsolverDnZZgesv_bufferSize", "library");
subst("cusolverDnZgebrd", "hipsolverDnZgebrd", "library");
subst("cusolverDnZgebrd_bufferSize", "hipsolverDnZgebrd_bufferSize", "library");
subst("cusolverDnZgeqrf", "hipsolverDnZgeqrf", "library");
subst("cusolverDnZgeqrf_bufferSize", "hipsolverDnZgeqrf_bufferSize", "library");
subst("cusolverDnZgetrf", "hipsolverDnZgetrf", "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| | | | | | | | | |
|`cusolverDnCgebrd`| | | | |`hipsolverDnCgebrd`|5.1.0| | | |6.1.0|
|`cusolverDnCgebrd_bufferSize`| | | | |`hipsolverDnCgebrd_bufferSize`|5.1.0| | | |6.1.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|
Expand Down Expand Up @@ -170,6 +172,8 @@
|`cusolverDnDXgesv`|11.0| | | | | | | | | |
|`cusolverDnDXgesv_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDestroy`| | | | |`hipsolverDnDestroy`|5.1.0| | | |6.1.0|
|`cusolverDnDgebrd`| | | | |`hipsolverDnDgebrd`|5.1.0| | | |6.1.0|
|`cusolverDnDgebrd_bufferSize`| | | | |`hipsolverDnDgebrd_bufferSize`|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|
Expand Down Expand Up @@ -238,6 +242,8 @@
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | |
|`cusolverDnSetDeterministicMode`|12.2| | | | | | | | | |
|`cusolverDnSetStream`| | | | |`hipsolverSetStream`|4.5.0| | | |6.1.0|
|`cusolverDnSgebrd`| | | | |`hipsolverDnSgebrd`|5.1.0| | | |6.1.0|
|`cusolverDnSgebrd_bufferSize`| | | | |`hipsolverDnSgebrd_bufferSize`|5.1.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|
Expand Down Expand Up @@ -288,6 +294,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|
|`cusolverDnZgebrd`| | | | |`hipsolverDnZgebrd`|5.1.0| | | |6.1.0|
|`cusolverDnZgebrd_bufferSize`| | | | |`hipsolverDnZgebrd_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|
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| | | | | | | | | | | | | | | |
|`cusolverDnCgebrd`| | | | |`hipsolverDnCgebrd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCgebrd_bufferSize`| | | | |`hipsolverDnCgebrd_bufferSize`|5.1.0| | | |6.1.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| | | | | | |
Expand Down Expand Up @@ -170,6 +172,8 @@
|`cusolverDnDXgesv`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDXgesv_bufferSize`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDestroy`| | | | |`hipsolverDnDestroy`|5.1.0| | | |6.1.0|`rocblas_destroy_handle`| | | | | |
|`cusolverDnDgebrd`| | | | |`hipsolverDnDgebrd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDgebrd_bufferSize`| | | | |`hipsolverDnDgebrd_bufferSize`|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| | | | | | |
Expand Down Expand Up @@ -238,6 +242,8 @@
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnSetDeterministicMode`|12.2| | | | | | | | | | | | | | | |
|`cusolverDnSetStream`| | | | |`hipsolverSetStream`|4.5.0| | | |6.1.0|`rocblas_set_stream`| | | | | |
|`cusolverDnSgebrd`| | | | |`hipsolverDnSgebrd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSgebrd_bufferSize`| | | | |`hipsolverDnSgebrd_bufferSize`|5.1.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| | | | | | |
Expand Down Expand Up @@ -288,6 +294,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| | | | | | |
|`cusolverDnZgebrd`| | | | |`hipsolverDnZgebrd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZgebrd_bufferSize`| | | | |`hipsolverDnZgebrd_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| | | | | | |
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| | | | | | | | | |
|`cusolverDnCgebrd`| | | | | | | | | | |
|`cusolverDnCgebrd_bufferSize`| | | | | | | | | | |
|`cusolverDnCgeqrf`| | | | | | | | | | |
|`cusolverDnCgeqrf_bufferSize`| | | | | | | | | | |
|`cusolverDnCgetrf`| | | | | | | | | | |
Expand Down Expand Up @@ -170,6 +172,8 @@
|`cusolverDnDXgesv`|11.0| | | | | | | | | |
|`cusolverDnDXgesv_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDestroy`| | | | |`rocblas_destroy_handle`| | | | | |
|`cusolverDnDgebrd`| | | | | | | | | | |
|`cusolverDnDgebrd_bufferSize`| | | | | | | | | | |
|`cusolverDnDgeqrf`| | | | | | | | | | |
|`cusolverDnDgeqrf_bufferSize`| | | | | | | | | | |
|`cusolverDnDgetrf`| | | | | | | | | | |
Expand Down Expand Up @@ -238,6 +242,8 @@
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | |
|`cusolverDnSetDeterministicMode`|12.2| | | | | | | | | |
|`cusolverDnSetStream`| | | | |`rocblas_set_stream`| | | | | |
|`cusolverDnSgebrd`| | | | | | | | | | |
|`cusolverDnSgebrd_bufferSize`| | | | | | | | | | |
|`cusolverDnSgeqrf`| | | | | | | | | | |
|`cusolverDnSgeqrf_bufferSize`| | | | | | | | | | |
|`cusolverDnSgetrf`| | | | | | | | | | |
Expand Down Expand Up @@ -288,6 +294,8 @@
|`cusolverDnZZgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnZZgesv`|10.2| | | | | | | | | |
|`cusolverDnZZgesv_bufferSize`|10.2| | | | | | | | | |
|`cusolverDnZgebrd`| | | | | | | | | | |
|`cusolverDnZgebrd_bufferSize`| | | | | | | | | | |
|`cusolverDnZgeqrf`| | | | | | | | | | |
|`cusolverDnZgeqrf_bufferSize`| | | | | | | | | | |
|`cusolverDnZgetrf`| | | | | | | | | | |
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 @@ -261,6 +261,16 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SOLVER_FUNCTION_MAP {
{"cusolverDnDsytri", {"hipsolverDnDsytri", "", CONV_LIB_FUNC, API_SOLVER, 2, UNSUPPORTED}},
{"cusolverDnCsytri", {"hipsolverDnCsytri", "", CONV_LIB_FUNC, API_SOLVER, 2, UNSUPPORTED}},
{"cusolverDnZsytri", {"hipsolverDnZsytri", "", CONV_LIB_FUNC, API_SOLVER, 2, UNSUPPORTED}},
// NOTE: rocsolver_(s|d|c|z)gebrd have a harness of other HIP and ROC API calls
{"cusolverDnSgebrd_bufferSize", {"hipsolverDnSgebrd_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDgebrd_bufferSize", {"hipsolverDnDgebrd_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCgebrd_bufferSize", {"hipsolverDnCgebrd_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZgebrd_bufferSize", {"hipsolverDnZgebrd_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d|c|z)gebrd have a harness of other HIP and ROC API calls
{"cusolverDnSgebrd", {"hipsolverDnSgebrd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDgebrd", {"hipsolverDnDgebrd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCgebrd", {"hipsolverDnCgebrd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZgebrd", {"hipsolverDnZgebrd", "", 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 @@ -510,6 +520,14 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
{"hipsolverDnDsytrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCsytrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZsytrf", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSgebrd_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDgebrd_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCgebrd_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZgebrd_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSgebrd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDgebrd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCgebrd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZgebrd", {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 c9072a2

Please sign in to comment.