Skip to content

Commit

Permalink
Merge pull request #1201 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][#675][#677][SOLVER][feature] `cuSOLVER` support - Step 34 - Functions (DN)
  • Loading branch information
emankov authored Dec 12, 2023
2 parents eb4d0aa + 08a833e commit e78ab1f
Show file tree
Hide file tree
Showing 6 changed files with 106 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 @@ -1080,6 +1080,8 @@ my %experimental_funcs = (
"cusolverEigType_t" => "6.1.0",
"cusolverEigRange_t" => "6.1.0",
"cusolverEigMode_t" => "6.1.0",
"cusolverDnZunmtr_bufferSize" => "6.1.0",
"cusolverDnZunmtr" => "6.1.0",
"cusolverDnZunmqr_bufferSize" => "6.1.0",
"cusolverDnZunmqr" => "6.1.0",
"cusolverDnZungtr_bufferSize" => "6.1.0",
Expand Down Expand Up @@ -1121,6 +1123,8 @@ my %experimental_funcs = (
"cusolverDnSpotrf_bufferSize" => "6.1.0",
"cusolverDnSpotrfBatched" => "6.1.0",
"cusolverDnSpotrf" => "6.1.0",
"cusolverDnSormtr_bufferSize" => "6.1.0",
"cusolverDnSormtr" => "6.1.0",
"cusolverDnSormqr_bufferSize" => "6.1.0",
"cusolverDnSormqr" => "6.1.0",
"cusolverDnSorgtr_bufferSize" => "6.1.0",
Expand Down Expand Up @@ -1154,6 +1158,8 @@ my %experimental_funcs = (
"cusolverDnDpotrf_bufferSize" => "6.1.0",
"cusolverDnDpotrfBatched" => "6.1.0",
"cusolverDnDpotrf" => "6.1.0",
"cusolverDnDormtr_bufferSize" => "6.1.0",
"cusolverDnDormtr" => "6.1.0",
"cusolverDnDormqr_bufferSize" => "6.1.0",
"cusolverDnDormqr" => "6.1.0",
"cusolverDnDorgtr_bufferSize" => "6.1.0",
Expand All @@ -1174,6 +1180,8 @@ my %experimental_funcs = (
"cusolverDnDDgesv" => "6.1.0",
"cusolverDnDDgels_bufferSize" => "6.1.0",
"cusolverDnDDgels" => "6.1.0",
"cusolverDnCunmtr_bufferSize" => "6.1.0",
"cusolverDnCunmtr" => "6.1.0",
"cusolverDnCunmqr_bufferSize" => "6.1.0",
"cusolverDnCunmqr" => "6.1.0",
"cusolverDnCungtr_bufferSize" => "6.1.0",
Expand Down Expand Up @@ -1391,6 +1399,8 @@ sub experimentalSubstitutions {
subst("cusolverDnCungtr_bufferSize", "hipsolverDnCungtr_bufferSize", "library");
subst("cusolverDnCunmqr", "hipsolverDnCunmqr", "library");
subst("cusolverDnCunmqr_bufferSize", "hipsolverDnCunmqr_bufferSize", "library");
subst("cusolverDnCunmtr", "hipsolverDnCunmtr", "library");
subst("cusolverDnCunmtr_bufferSize", "hipsolverDnCunmtr_bufferSize", "library");
subst("cusolverDnDDgels", "hipsolverDnDDgels", "library");
subst("cusolverDnDDgels_bufferSize", "hipsolverDnDDgels_bufferSize", "library");
subst("cusolverDnDDgesv", "hipsolverDnDDgesv", "library");
Expand All @@ -1411,6 +1421,8 @@ sub experimentalSubstitutions {
subst("cusolverDnDorgtr_bufferSize", "hipsolverDnDorgtr_bufferSize", "library");
subst("cusolverDnDormqr", "hipsolverDnDormqr", "library");
subst("cusolverDnDormqr_bufferSize", "hipsolverDnDormqr_bufferSize", "library");
subst("cusolverDnDormtr", "hipsolverDnDormtr", "library");
subst("cusolverDnDormtr_bufferSize", "hipsolverDnDormtr_bufferSize", "library");
subst("cusolverDnDpotrf", "hipsolverDnDpotrf", "library");
subst("cusolverDnDpotrfBatched", "hipsolverDnDpotrfBatched", "library");
subst("cusolverDnDpotrf_bufferSize", "hipsolverDnDpotrf_bufferSize", "library");
Expand Down Expand Up @@ -1443,6 +1455,8 @@ sub experimentalSubstitutions {
subst("cusolverDnSorgtr_bufferSize", "hipsolverDnSorgtr_bufferSize", "library");
subst("cusolverDnSormqr", "hipsolverDnSormqr", "library");
subst("cusolverDnSormqr_bufferSize", "hipsolverDnSormqr_bufferSize", "library");
subst("cusolverDnSormtr", "hipsolverDnSormtr", "library");
subst("cusolverDnSormtr_bufferSize", "hipsolverDnSormtr_bufferSize", "library");
subst("cusolverDnSpotrf", "hipsolverDnSpotrf", "library");
subst("cusolverDnSpotrfBatched", "hipsolverDnSpotrfBatched", "library");
subst("cusolverDnSpotrf_bufferSize", "hipsolverDnSpotrf_bufferSize", "library");
Expand Down Expand Up @@ -1484,6 +1498,8 @@ sub experimentalSubstitutions {
subst("cusolverDnZungtr_bufferSize", "hipsolverDnZungtr_bufferSize", "library");
subst("cusolverDnZunmqr", "hipsolverDnZunmqr", "library");
subst("cusolverDnZunmqr_bufferSize", "hipsolverDnZunmqr_bufferSize", "library");
subst("cusolverDnZunmtr", "hipsolverDnZunmtr", "library");
subst("cusolverDnZunmtr_bufferSize", "hipsolverDnZunmtr_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 @@ -157,6 +157,8 @@
|`cusolverDnCungtr_bufferSize`|8.0| | | |`hipsolverDnCungtr_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|
|`cusolverDnCunmtr`|8.0| | | |`hipsolverDnCunmtr`|5.1.0| | | |6.1.0|
|`cusolverDnCunmtr_bufferSize`|8.0| | | |`hipsolverDnCunmtr_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnDBgels`|11.0| | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | |
Expand Down Expand Up @@ -196,6 +198,8 @@
|`cusolverDnDorgtr_bufferSize`|8.0| | | |`hipsolverDnDorgtr_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|
|`cusolverDnDormtr`|8.0| | | |`hipsolverDnDormtr`|5.1.0| | | |6.1.0|
|`cusolverDnDormtr_bufferSize`|8.0| | | |`hipsolverDnDormtr_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 @@ -272,6 +276,8 @@
|`cusolverDnSorgtr_bufferSize`|8.0| | | |`hipsolverDnSorgtr_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|
|`cusolverDnSormtr`|8.0| | | |`hipsolverDnSormtr`|5.1.0| | | |6.1.0|
|`cusolverDnSormtr_bufferSize`|8.0| | | |`hipsolverDnSormtr_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 @@ -343,6 +349,8 @@
|`cusolverDnZungtr_bufferSize`|8.0| | | |`hipsolverDnZungtr_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|
|`cusolverDnZunmtr`|8.0| | | |`hipsolverDnZunmtr`|5.1.0| | | |6.1.0|
|`cusolverDnZunmtr_bufferSize`|8.0| | | |`hipsolverDnZunmtr_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 @@ -157,6 +157,8 @@
|`cusolverDnCungtr_bufferSize`|8.0| | | |`hipsolverDnCungtr_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| | | | | | |
|`cusolverDnCunmtr`|8.0| | | |`hipsolverDnCunmtr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCunmtr_bufferSize`|8.0| | | |`hipsolverDnCunmtr_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDBgels`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | | | | | | | |
Expand Down Expand Up @@ -196,6 +198,8 @@
|`cusolverDnDorgtr_bufferSize`|8.0| | | |`hipsolverDnDorgtr_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| | | | | | |
|`cusolverDnDormtr`|8.0| | | |`hipsolverDnDormtr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnDormtr_bufferSize`|8.0| | | |`hipsolverDnDormtr_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 @@ -272,6 +276,8 @@
|`cusolverDnSorgtr_bufferSize`|8.0| | | |`hipsolverDnSorgtr_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| | | | | | |
|`cusolverDnSormtr`|8.0| | | |`hipsolverDnSormtr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnSormtr_bufferSize`|8.0| | | |`hipsolverDnSormtr_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 @@ -343,6 +349,8 @@
|`cusolverDnZungtr_bufferSize`|8.0| | | |`hipsolverDnZungtr_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| | | | | | |
|`cusolverDnZunmtr`|8.0| | | |`hipsolverDnZunmtr`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZunmtr_bufferSize`|8.0| | | |`hipsolverDnZunmtr_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 @@ -157,6 +157,8 @@
|`cusolverDnCungtr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnCunmqr`| | | | | | | | | | |
|`cusolverDnCunmqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnCunmtr`|8.0| | | | | | | | | |
|`cusolverDnCunmtr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDBgels`|11.0| | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | |
Expand Down Expand Up @@ -196,6 +198,8 @@
|`cusolverDnDorgtr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDormqr`| | | | | | | | | | |
|`cusolverDnDormqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDormtr`|8.0| | | | | | | | | |
|`cusolverDnDormtr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDpotrf`| | | | |`rocsolver_dpotrf`|3.2.0| | | |6.1.0|
|`cusolverDnDpotrfBatched`|9.1| | | | | | | | | |
|`cusolverDnDpotrf_bufferSize`| | | | | | | | | | |
Expand Down Expand Up @@ -272,6 +276,8 @@
|`cusolverDnSorgtr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnSormqr`| | | | | | | | | | |
|`cusolverDnSormqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnSormtr`|8.0| | | | | | | | | |
|`cusolverDnSormtr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnSpotrf`| | | | |`rocsolver_spotrf`|3.2.0| | | |6.1.0|
|`cusolverDnSpotrfBatched`|9.1| | | | | | | | | |
|`cusolverDnSpotrf_bufferSize`| | | | | | | | | | |
Expand Down Expand Up @@ -343,6 +349,8 @@
|`cusolverDnZungtr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnZunmqr`| | | | | | | | | | |
|`cusolverDnZunmqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnZunmtr`|8.0| | | | | | | | | |
|`cusolverDnZunmtr_bufferSize`|8.0| | | | | | | | | |


\*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental
26 changes: 26 additions & 0 deletions src/CUDA2HIP_SOLVER_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,16 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SOLVER_FUNCTION_MAP {
{"cusolverDnDorgtr", {"hipsolverDnDorgtr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCungtr", {"hipsolverDnCungtr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZungtr", {"hipsolverDnZungtr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d)ormtr and rocsolver_(c|z)unmtr have a harness of other HIP and ROC API calls
{"cusolverDnSormtr_bufferSize", {"hipsolverDnSormtr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDormtr_bufferSize", {"hipsolverDnDormtr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCunmtr_bufferSize", {"hipsolverDnCunmtr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZunmtr_bufferSize", {"hipsolverDnZunmtr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d)ormtr and rocsolver_(c|z)unmtr have a harness of other HIP and ROC API calls
{"cusolverDnSormtr", {"hipsolverDnSormtr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDormtr", {"hipsolverDnDormtr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCunmtr", {"hipsolverDnCunmtr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZunmtr", {"hipsolverDnZunmtr", "", 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 @@ -477,6 +487,14 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_SOLVER_FUNCTION_VER_MAP {
{"cusolverDnDorgtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCungtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZungtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnSormtr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnDormtr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCunmtr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZunmtr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnSormtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnDormtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCunmtr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZunmtr", {CUDA_80, CUDA_0, CUDA_0}},
};

const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
Expand Down Expand Up @@ -604,6 +622,14 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
{"hipsolverDnDorgtr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCungtr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZungtr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSormtr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDormtr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCunmtr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZunmtr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSormtr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDormtr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCunmtr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZunmtr", {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 e78ab1f

Please sign in to comment.