Skip to content

Commit

Permalink
Merge pull request #1203 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][#675][#677][SOLVER][feature] `cuSOLVER` support - Step 36 - Functions (DN)
  • Loading branch information
emankov authored Dec 13, 2023
2 parents f84a80d + 88aae12 commit 2323131
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,8 @@ my %experimental_funcs = (
"cusolverDnZpotrf" => "6.1.0",
"cusolverDnZhetrd_bufferSize" => "6.1.0",
"cusolverDnZhetrd" => "6.1.0",
"cusolverDnZheevd_bufferSize" => "6.1.0",
"cusolverDnZheevd" => "6.1.0",
"cusolverDnZgetrs" => "6.1.0",
"cusolverDnZgetrf_bufferSize" => "6.1.0",
"cusolverDnZgetrf" => "6.1.0",
Expand All @@ -1118,6 +1120,8 @@ my %experimental_funcs = (
"cusolverDnSsytrf" => "6.1.0",
"cusolverDnSsytrd_bufferSize" => "6.1.0",
"cusolverDnSsytrd" => "6.1.0",
"cusolverDnSsyevd_bufferSize" => "6.1.0",
"cusolverDnSsyevd" => "6.1.0",
"cusolverDnSpotrsBatched" => "6.1.0",
"cusolverDnSpotrs" => "6.1.0",
"cusolverDnSpotri_bufferSize" => "6.1.0",
Expand Down Expand Up @@ -1155,6 +1159,8 @@ my %experimental_funcs = (
"cusolverDnDsytrf" => "6.1.0",
"cusolverDnDsytrd_bufferSize" => "6.1.0",
"cusolverDnDsytrd" => "6.1.0",
"cusolverDnDsyevd_bufferSize" => "6.1.0",
"cusolverDnDsyevd" => "6.1.0",
"cusolverDnDpotrsBatched" => "6.1.0",
"cusolverDnDpotrs" => "6.1.0",
"cusolverDnDpotri_bufferSize" => "6.1.0",
Expand Down Expand Up @@ -1208,6 +1214,8 @@ my %experimental_funcs = (
"cusolverDnCpotrf" => "6.1.0",
"cusolverDnChetrd_bufferSize" => "6.1.0",
"cusolverDnChetrd" => "6.1.0",
"cusolverDnCheevd_bufferSize" => "6.1.0",
"cusolverDnCheevd" => "6.1.0",
"cusolverDnCgetrs" => "6.1.0",
"cusolverDnCgetrf_bufferSize" => "6.1.0",
"cusolverDnCgetrf" => "6.1.0",
Expand Down Expand Up @@ -1389,6 +1397,8 @@ sub experimentalSubstitutions {
subst("cusolverDnCgetrf", "hipsolverDnCgetrf", "library");
subst("cusolverDnCgetrf_bufferSize", "hipsolverDnCgetrf_bufferSize", "library");
subst("cusolverDnCgetrs", "hipsolverDnCgetrs", "library");
subst("cusolverDnCheevd", "hipsolverDnCheevd", "library");
subst("cusolverDnCheevd_bufferSize", "hipsolverDnCheevd_bufferSize", "library");
subst("cusolverDnChetrd", "hipsolverDnChetrd", "library");
subst("cusolverDnChetrd_bufferSize", "hipsolverDnChetrd_bufferSize", "library");
subst("cusolverDnCpotrf", "hipsolverDnCpotrf", "library");
Expand Down Expand Up @@ -1442,6 +1452,8 @@ sub experimentalSubstitutions {
subst("cusolverDnDpotri_bufferSize", "hipsolverDnDpotri_bufferSize", "library");
subst("cusolverDnDpotrs", "hipsolverDnDpotrs", "library");
subst("cusolverDnDpotrsBatched", "hipsolverDnDpotrsBatched", "library");
subst("cusolverDnDsyevd", "hipsolverDnDsyevd", "library");
subst("cusolverDnDsyevd_bufferSize", "hipsolverDnDsyevd_bufferSize", "library");
subst("cusolverDnDsytrd", "hipsolverDnDsytrd", "library");
subst("cusolverDnDsytrd_bufferSize", "hipsolverDnDsytrd_bufferSize", "library");
subst("cusolverDnDsytrf", "hipsolverDnDsytrf", "library");
Expand Down Expand Up @@ -1478,6 +1490,8 @@ sub experimentalSubstitutions {
subst("cusolverDnSpotri_bufferSize", "hipsolverDnSpotri_bufferSize", "library");
subst("cusolverDnSpotrs", "hipsolverDnSpotrs", "library");
subst("cusolverDnSpotrsBatched", "hipsolverDnSpotrsBatched", "library");
subst("cusolverDnSsyevd", "hipsolverDnSsyevd", "library");
subst("cusolverDnSsyevd_bufferSize", "hipsolverDnSsyevd_bufferSize", "library");
subst("cusolverDnSsytrd", "hipsolverDnSsytrd", "library");
subst("cusolverDnSsytrd_bufferSize", "hipsolverDnSsytrd_bufferSize", "library");
subst("cusolverDnSsytrf", "hipsolverDnSsytrf", "library");
Expand All @@ -1495,6 +1509,8 @@ sub experimentalSubstitutions {
subst("cusolverDnZgetrf", "hipsolverDnZgetrf", "library");
subst("cusolverDnZgetrf_bufferSize", "hipsolverDnZgetrf_bufferSize", "library");
subst("cusolverDnZgetrs", "hipsolverDnZgetrs", "library");
subst("cusolverDnZheevd", "hipsolverDnZheevd", "library");
subst("cusolverDnZheevd_bufferSize", "hipsolverDnZheevd_bufferSize", "library");
subst("cusolverDnZhetrd", "hipsolverDnZhetrd", "library");
subst("cusolverDnZhetrd_bufferSize", "hipsolverDnZhetrd_bufferSize", "library");
subst("cusolverDnZpotrf", "hipsolverDnZpotrf", "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 @@ -133,6 +133,8 @@
|`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|
|`cusolverDnCheevd`|8.0| | | |`hipsolverDnCheevd`|5.1.0| | | |6.1.0|
|`cusolverDnCheevd_bufferSize`|8.0| | | |`hipsolverDnCheevd_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnChetrd`|8.0| | | |`hipsolverDnChetrd`|5.1.0| | | |6.1.0|
|`cusolverDnChetrd_bufferSize`|8.0| | | |`hipsolverDnChetrd_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnClaswp`| | | | | | | | | | |
Expand Down Expand Up @@ -211,6 +213,8 @@
|`cusolverDnDpotri_bufferSize`|10.1| | | |`hipsolverDnDpotri_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnDpotrs`| | | | |`hipsolverDnDpotrs`|5.1.0| | | |6.1.0|
|`cusolverDnDpotrsBatched`|9.1| | | |`hipsolverDnDpotrsBatched`|5.1.0| | | |6.1.0|
|`cusolverDnDsyevd`|8.0| | | |`hipsolverDnDsyevd`|5.1.0| | | |6.1.0|
|`cusolverDnDsyevd_bufferSize`|8.0| | | |`hipsolverDnDsyevd_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnDsytrd`| | | | |`hipsolverDnDsytrd`|5.1.0| | | |6.1.0|
|`cusolverDnDsytrd_bufferSize`|8.0| | | |`hipsolverDnDsytrd_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnDsytrf`| | | | |`hipsolverDnDsytrf`|5.1.0| | | |6.1.0|
Expand Down Expand Up @@ -291,6 +295,8 @@
|`cusolverDnSpotri_bufferSize`|10.1| | | |`hipsolverDnSpotri_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnSpotrs`| | | | |`hipsolverDnSpotrs`|5.1.0| | | |6.1.0|
|`cusolverDnSpotrsBatched`|9.1| | | |`hipsolverDnSpotrsBatched`|5.1.0| | | |6.1.0|
|`cusolverDnSsyevd`|8.0| | | |`hipsolverDnSsyevd`|5.1.0| | | |6.1.0|
|`cusolverDnSsyevd_bufferSize`|8.0| | | |`hipsolverDnSsyevd_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnSsytrd`| | | | |`hipsolverDnSsytrd`|5.1.0| | | |6.1.0|
|`cusolverDnSsytrd_bufferSize`|8.0| | | |`hipsolverDnSsytrd_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnSsytrf`| | | | |`hipsolverDnSsytrf`|5.1.0| | | |6.1.0|
Expand Down Expand Up @@ -333,6 +339,8 @@
|`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|
|`cusolverDnZheevd`|8.0| | | |`hipsolverDnZheevd`|5.1.0| | | |6.1.0|
|`cusolverDnZheevd_bufferSize`|8.0| | | |`hipsolverDnZheevd_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnZhetrd`|8.0| | | |`hipsolverDnZhetrd`|5.1.0| | | |6.1.0|
|`cusolverDnZhetrd_bufferSize`|8.0| | | |`hipsolverDnZhetrd_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnZlaswp`| | | | | | | | | | |
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 @@ -133,6 +133,8 @@
|`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| | | | | | |
|`cusolverDnCheevd`|8.0| | | |`hipsolverDnCheevd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCheevd_bufferSize`|8.0| | | |`hipsolverDnCheevd_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnChetrd`|8.0| | | |`hipsolverDnChetrd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnChetrd_bufferSize`|8.0| | | |`hipsolverDnChetrd_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnClaswp`| | | | | | | | | | | | | | | | |
Expand Down Expand Up @@ -211,6 +213,8 @@
|`cusolverDnDpotri_bufferSize`|10.1| | | |`hipsolverDnDpotri_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDpotrs`| | | | |`hipsolverDnDpotrs`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDpotrsBatched`|9.1| | | |`hipsolverDnDpotrsBatched`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDsyevd`|8.0| | | |`hipsolverDnDsyevd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDsyevd_bufferSize`|8.0| | | |`hipsolverDnDsyevd_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDsytrd`| | | | |`hipsolverDnDsytrd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDsytrd_bufferSize`|8.0| | | |`hipsolverDnDsytrd_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDsytrf`| | | | |`hipsolverDnDsytrf`|5.1.0| | | |6.1.0| | | | | | |
Expand Down Expand Up @@ -291,6 +295,8 @@
|`cusolverDnSpotri_bufferSize`|10.1| | | |`hipsolverDnSpotri_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSpotrs`| | | | |`hipsolverDnSpotrs`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSpotrsBatched`|9.1| | | |`hipsolverDnSpotrsBatched`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSsyevd`|8.0| | | |`hipsolverDnSsyevd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSsyevd_bufferSize`|8.0| | | |`hipsolverDnSsyevd_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSsytrd`| | | | |`hipsolverDnSsytrd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSsytrd_bufferSize`|8.0| | | |`hipsolverDnSsytrd_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSsytrf`| | | | |`hipsolverDnSsytrf`|5.1.0| | | |6.1.0| | | | | | |
Expand Down Expand Up @@ -333,6 +339,8 @@
|`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| | | | | | |
|`cusolverDnZheevd`|8.0| | | |`hipsolverDnZheevd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZheevd_bufferSize`|8.0| | | |`hipsolverDnZheevd_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZhetrd`|8.0| | | |`hipsolverDnZhetrd`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZhetrd_bufferSize`|8.0| | | |`hipsolverDnZhetrd_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZlaswp`| | | | | | | | | | | | | | | | |
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 @@ -133,6 +133,8 @@
|`cusolverDnCgetrf`| | | | | | | | | | |
|`cusolverDnCgetrf_bufferSize`| | | | | | | | | | |
|`cusolverDnCgetrs`| | | | | | | | | | |
|`cusolverDnCheevd`|8.0| | | | | | | | | |
|`cusolverDnCheevd_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnChetrd`|8.0| | | | | | | | | |
|`cusolverDnChetrd_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnClaswp`| | | | | | | | | | |
Expand Down Expand Up @@ -211,6 +213,8 @@
|`cusolverDnDpotri_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnDpotrs`| | | | | | | | | | |
|`cusolverDnDpotrsBatched`|9.1| | | | | | | | | |
|`cusolverDnDsyevd`|8.0| | | | | | | | | |
|`cusolverDnDsyevd_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDsytrd`| | | | | | | | | | |
|`cusolverDnDsytrd_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDsytrf`| | | | | | | | | | |
Expand Down Expand Up @@ -291,6 +295,8 @@
|`cusolverDnSpotri_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnSpotrs`| | | | | | | | | | |
|`cusolverDnSpotrsBatched`|9.1| | | | | | | | | |
|`cusolverDnSsyevd`|8.0| | | | | | | | | |
|`cusolverDnSsyevd_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnSsytrd`| | | | | | | | | | |
|`cusolverDnSsytrd_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnSsytrf`| | | | | | | | | | |
Expand Down Expand Up @@ -333,6 +339,8 @@
|`cusolverDnZgetrf`| | | | | | | | | | |
|`cusolverDnZgetrf_bufferSize`| | | | | | | | | | |
|`cusolverDnZgetrs`| | | | | | | | | | |
|`cusolverDnZheevd`|8.0| | | | | | | | | |
|`cusolverDnZheevd_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnZhetrd`|8.0| | | | | | | | | |
|`cusolverDnZhetrd_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnZlaswp`| | | | | | | | | | |
Expand Down
26 changes: 26 additions & 0 deletions src/CUDA2HIP_SOLVER_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,16 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SOLVER_FUNCTION_MAP {
{"cusolverDnDgesvd", {"hipsolverDnDgesvd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCgesvd", {"hipsolverDnCgesvd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZgesvd", {"hipsolverDnZgesvd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d|c|z)gesvd have a harness of other HIP and ROC API calls
{"cusolverDnSsyevd_bufferSize", {"hipsolverDnSsyevd_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDsyevd_bufferSize", {"hipsolverDnDsyevd_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCheevd_bufferSize", {"hipsolverDnCheevd_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZheevd_bufferSize", {"hipsolverDnZheevd_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d)syevd and rocsolver_(c|z)heevd have a harness of other HIP and ROC API calls
{"cusolverDnSsyevd", {"hipsolverDnSsyevd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDsyevd", {"hipsolverDnDsyevd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCheevd", {"hipsolverDnCheevd", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZheevd", {"hipsolverDnZheevd", "", 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 @@ -505,6 +515,14 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_SOLVER_FUNCTION_VER_MAP {
{"cusolverDnDormtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCunmtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZunmtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnSsyevd_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnDsyevd_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCheevd_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZheevd_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnSsyevd", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnDsyevd", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCheevd", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZheevd", {CUDA_80, CUDA_0, CUDA_0}},
};

const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
Expand Down Expand Up @@ -648,6 +666,14 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
{"hipsolverDnDgesvd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCgesvd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZgesvd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSsyevd_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDsyevd_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCheevd_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZheevd_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSsyevd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDsyevd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCheevd", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZheevd", {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 2323131

Please sign in to comment.