Skip to content

Commit

Permalink
Merge pull request #1186 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][#675][#677][SOLVER][feature] `cuSOLVER` support - Step 27 - Functions (DN)
  • Loading branch information
emankov authored Dec 6, 2023
2 parents db95390 + 3a5348d commit 4cb9f6d
Show file tree
Hide file tree
Showing 6 changed files with 112 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 @@ -1080,6 +1080,8 @@ my %experimental_funcs = (
"cusolverEigType_t" => "6.1.0",
"cusolverEigRange_t" => "6.1.0",
"cusolverEigMode_t" => "6.1.0",
"cusolverDnZunmqr_bufferSize" => "6.1.0",
"cusolverDnZunmqr" => "6.1.0",
"cusolverDnZungqr_bufferSize" => "6.1.0",
"cusolverDnZungqr" => "6.1.0",
"cusolverDnZpotrsBatched" => "6.1.0",
Expand All @@ -1105,6 +1107,8 @@ my %experimental_funcs = (
"cusolverDnSpotrf_bufferSize" => "6.1.0",
"cusolverDnSpotrfBatched" => "6.1.0",
"cusolverDnSpotrf" => "6.1.0",
"cusolverDnSormqr_bufferSize" => "6.1.0",
"cusolverDnSormqr" => "6.1.0",
"cusolverDnSorgqr_bufferSize" => "6.1.0",
"cusolverDnSorgqr" => "6.1.0",
"cusolverDnSgetrs" => "6.1.0",
Expand All @@ -1126,6 +1130,8 @@ my %experimental_funcs = (
"cusolverDnDpotrf_bufferSize" => "6.1.0",
"cusolverDnDpotrfBatched" => "6.1.0",
"cusolverDnDpotrf" => "6.1.0",
"cusolverDnDormqr_bufferSize" => "6.1.0",
"cusolverDnDormqr" => "6.1.0",
"cusolverDnDorgqr_bufferSize" => "6.1.0",
"cusolverDnDorgqr" => "6.1.0",
"cusolverDnDgetrs" => "6.1.0",
Expand All @@ -1138,6 +1144,8 @@ my %experimental_funcs = (
"cusolverDnDDgesv" => "6.1.0",
"cusolverDnDDgels_bufferSize" => "6.1.0",
"cusolverDnDDgels" => "6.1.0",
"cusolverDnCunmqr_bufferSize" => "6.1.0",
"cusolverDnCunmqr" => "6.1.0",
"cusolverDnCungqr_bufferSize" => "6.1.0",
"cusolverDnCungqr" => "6.1.0",
"cusolverDnCreate" => "6.1.0",
Expand Down Expand Up @@ -1331,6 +1339,8 @@ sub experimentalSubstitutions {
subst("cusolverDnCreate", "hipsolverDnCreate", "library");
subst("cusolverDnCungqr", "hipsolverDnCungqr", "library");
subst("cusolverDnCungqr_bufferSize", "hipsolverDnCungqr_bufferSize", "library");
subst("cusolverDnCunmqr", "hipsolverDnCunmqr", "library");
subst("cusolverDnCunmqr_bufferSize", "hipsolverDnCunmqr_bufferSize", "library");
subst("cusolverDnDDgels", "hipsolverDnDDgels", "library");
subst("cusolverDnDDgels_bufferSize", "hipsolverDnDDgels_bufferSize", "library");
subst("cusolverDnDDgesv", "hipsolverDnDDgesv", "library");
Expand All @@ -1343,6 +1353,8 @@ sub experimentalSubstitutions {
subst("cusolverDnDgetrs", "hipsolverDnDgetrs", "library");
subst("cusolverDnDorgqr", "hipsolverDnDorgqr", "library");
subst("cusolverDnDorgqr_bufferSize", "hipsolverDnDorgqr_bufferSize", "library");
subst("cusolverDnDormqr", "hipsolverDnDormqr", "library");
subst("cusolverDnDormqr_bufferSize", "hipsolverDnDormqr_bufferSize", "library");
subst("cusolverDnDpotrf", "hipsolverDnDpotrf", "library");
subst("cusolverDnDpotrfBatched", "hipsolverDnDpotrfBatched", "library");
subst("cusolverDnDpotrf_bufferSize", "hipsolverDnDpotrf_bufferSize", "library");
Expand All @@ -1363,6 +1375,8 @@ sub experimentalSubstitutions {
subst("cusolverDnSgetrs", "hipsolverDnSgetrs", "library");
subst("cusolverDnSorgqr", "hipsolverDnSorgqr", "library");
subst("cusolverDnSorgqr_bufferSize", "hipsolverDnSorgqr_bufferSize", "library");
subst("cusolverDnSormqr", "hipsolverDnSormqr", "library");
subst("cusolverDnSormqr_bufferSize", "hipsolverDnSormqr_bufferSize", "library");
subst("cusolverDnSpotrf", "hipsolverDnSpotrf", "library");
subst("cusolverDnSpotrfBatched", "hipsolverDnSpotrfBatched", "library");
subst("cusolverDnSpotrf_bufferSize", "hipsolverDnSpotrf_bufferSize", "library");
Expand All @@ -1388,6 +1402,8 @@ sub experimentalSubstitutions {
subst("cusolverDnZpotrsBatched", "hipsolverDnZpotrsBatched", "library");
subst("cusolverDnZungqr", "hipsolverDnZungqr", "library");
subst("cusolverDnZungqr_bufferSize", "hipsolverDnZungqr_bufferSize", "library");
subst("cusolverDnZunmqr", "hipsolverDnZunmqr", "library");
subst("cusolverDnZunmqr_bufferSize", "hipsolverDnZunmqr_bufferSize", "library");
subst("cusolverDnHandle_t", "hipsolverHandle_t", "type");
subst("cusolverEigMode_t", "hipsolverEigMode_t", "type");
subst("cusolverEigRange_t", "hipsolverEigRange_t", "type");
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 @@ -143,6 +143,8 @@
|`cusolverDnCreateParams`|11.0| | | | | | | | | |
|`cusolverDnCungqr`|8.0| | | |`hipsolverDnCungqr`|5.1.0| | | |6.1.0|
|`cusolverDnCungqr_bufferSize`|8.0| | | |`hipsolverDnCungqr_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnCunmqr`| | | | |`hipsolverDnCunmqr`|5.1.0| | | |6.1.0|
|`cusolverDnCunmqr_bufferSize`|8.0| | | |`hipsolverDnCunmqr_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnDBgels`|11.0| | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | |
Expand Down Expand Up @@ -174,6 +176,8 @@
|`cusolverDnDlauum_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnDorgqr`|8.0| | | |`hipsolverDnDorgqr`|5.1.0| | | |6.1.0|
|`cusolverDnDorgqr_bufferSize`|8.0| | | |`hipsolverDnDorgqr_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnDormqr`| | | | |`hipsolverDnDormqr`|5.1.0| | | |6.1.0|
|`cusolverDnDormqr_bufferSize`|8.0| | | |`hipsolverDnDormqr_bufferSize`|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|
Expand Down Expand Up @@ -236,6 +240,8 @@
|`cusolverDnSlauum_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnSorgqr`|8.0| | | |`hipsolverDnSorgqr`|5.1.0| | | |6.1.0|
|`cusolverDnSorgqr_bufferSize`|8.0| | | |`hipsolverDnSorgqr_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnSormqr`| | | | |`hipsolverDnSormqr`|5.1.0| | | |6.1.0|
|`cusolverDnSormqr_bufferSize`|8.0| | | |`hipsolverDnSormqr_bufferSize`|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|
Expand Down Expand Up @@ -285,6 +291,8 @@
|`cusolverDnZpotrsBatched`|9.1| | | |`hipsolverDnZpotrsBatched`|5.1.0| | | |6.1.0|
|`cusolverDnZungqr`|8.0| | | |`hipsolverDnZungqr`|5.1.0| | | |6.1.0|
|`cusolverDnZungqr_bufferSize`|8.0| | | |`hipsolverDnZungqr_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnZunmqr`| | | | |`hipsolverDnZunmqr`|5.1.0| | | |6.1.0|
|`cusolverDnZunmqr_bufferSize`|8.0| | | |`hipsolverDnZunmqr_bufferSize`|5.1.0| | | |6.1.0|


\*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental
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 @@ -143,6 +143,8 @@
|`cusolverDnCreateParams`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnCungqr`|8.0| | | |`hipsolverDnCungqr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCungqr_bufferSize`|8.0| | | |`hipsolverDnCungqr_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCunmqr`| | | | |`hipsolverDnCunmqr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCunmqr_bufferSize`|8.0| | | |`hipsolverDnCunmqr_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDBgels`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | | | | | | | |
Expand Down Expand Up @@ -174,6 +176,8 @@
|`cusolverDnDlauum_bufferSize`|10.1| | | | | | | | | | | | | | | |
|`cusolverDnDorgqr`|8.0| | | |`hipsolverDnDorgqr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDorgqr_bufferSize`|8.0| | | |`hipsolverDnDorgqr_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDormqr`| | | | |`hipsolverDnDormqr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDormqr_bufferSize`|8.0| | | |`hipsolverDnDormqr_bufferSize`|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| | | | | | |
Expand Down Expand Up @@ -236,6 +240,8 @@
|`cusolverDnSlauum_bufferSize`|10.1| | | | | | | | | | | | | | | |
|`cusolverDnSorgqr`|8.0| | | |`hipsolverDnSorgqr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSorgqr_bufferSize`|8.0| | | |`hipsolverDnSorgqr_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSormqr`| | | | |`hipsolverDnSormqr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSormqr_bufferSize`|8.0| | | |`hipsolverDnSormqr_bufferSize`|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| | | | | | |
Expand Down Expand Up @@ -285,6 +291,8 @@
|`cusolverDnZpotrsBatched`|9.1| | | |`hipsolverDnZpotrsBatched`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZungqr`|8.0| | | |`hipsolverDnZungqr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZungqr_bufferSize`|8.0| | | |`hipsolverDnZungqr_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZunmqr`| | | | |`hipsolverDnZunmqr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZunmqr_bufferSize`|8.0| | | |`hipsolverDnZunmqr_bufferSize`|5.1.0| | | |6.1.0| | | | | | |


\*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental
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 @@ -143,6 +143,8 @@
|`cusolverDnCreateParams`|11.0| | | | | | | | | |
|`cusolverDnCungqr`|8.0| | | | | | | | | |
|`cusolverDnCungqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnCunmqr`| | | | | | | | | | |
|`cusolverDnCunmqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDBgels`|11.0| | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | |
Expand Down Expand Up @@ -174,6 +176,8 @@
|`cusolverDnDlauum_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnDorgqr`|8.0| | | | | | | | | |
|`cusolverDnDorgqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDormqr`| | | | | | | | | | |
|`cusolverDnDormqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDpotrf`| | | | |`rocsolver_dpotrf`|3.2.0| | | |6.1.0|
|`cusolverDnDpotrfBatched`|9.1| | | | | | | | | |
|`cusolverDnDpotrf_bufferSize`| | | | | | | | | | |
Expand Down Expand Up @@ -236,6 +240,8 @@
|`cusolverDnSlauum_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnSorgqr`|8.0| | | | | | | | | |
|`cusolverDnSorgqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnSormqr`| | | | | | | | | | |
|`cusolverDnSormqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnSpotrf`| | | | |`rocsolver_spotrf`|3.2.0| | | |6.1.0|
|`cusolverDnSpotrfBatched`|9.1| | | | | | | | | |
|`cusolverDnSpotrf_bufferSize`| | | | | | | | | | |
Expand Down Expand Up @@ -285,6 +291,8 @@
|`cusolverDnZpotrsBatched`|9.1| | | | | | | | | |
|`cusolverDnZungqr`|8.0| | | | | | | | | |
|`cusolverDnZungqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnZunmqr`| | | | | | | | | | |
|`cusolverDnZunmqr_bufferSize`|8.0| | | | | | | | | |


\*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental
22 changes: 22 additions & 0 deletions src/CUDA2HIP_SOLVER_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SOLVER_FUNCTION_MAP {
{"cusolverDnDorgqr", {"hipsolverDnDorgqr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCungqr", {"hipsolverDnCungqr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZungqr", {"hipsolverDnZungqr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d)ormqr and rocsolver_(c|z)unmqr have a harness of other HIP and ROC API calls
{"cusolverDnSormqr_bufferSize", {"hipsolverDnSormqr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDormqr_bufferSize", {"hipsolverDnDormqr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCunmqr_bufferSize", {"hipsolverDnCunmqr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZunmqr_bufferSize", {"hipsolverDnZunmqr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d)ormqr and rocsolver_(c|z)unmqr have a harness of other HIP and ROC API calls
{"cusolverDnSormqr", {"hipsolverDnSormqr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDormqr", {"hipsolverDnDormqr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCunmqr", {"hipsolverDnCunmqr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZunmqr", {"hipsolverDnZunmqr", "", 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 @@ -371,6 +381,10 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_SOLVER_FUNCTION_VER_MAP {
{"cusolverDnDorgqr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCungqr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZungqr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnSormqr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnDormqr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCunmqr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZunmqr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
};

const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
Expand Down Expand Up @@ -450,6 +464,14 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
{"hipsolverDnDorgqr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCungqr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZungqr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSormqr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDormqr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCunmqr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZunmqr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSormqr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDormqr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCunmqr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZunmqr", {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 4cb9f6d

Please sign in to comment.