Skip to content

Commit

Permalink
Merge pull request #1185 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][#675][#677][SOLVER][feature] `cuSOLVER` support - Step 26 - Functions (DN)
  • Loading branch information
emankov authored Dec 6, 2023
2 parents 2c0cf68 + 6af3b2a commit db95390
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 @@ -1080,6 +1080,8 @@ my %experimental_funcs = (
"cusolverEigType_t" => "6.1.0",
"cusolverEigRange_t" => "6.1.0",
"cusolverEigMode_t" => "6.1.0",
"cusolverDnZungqr_bufferSize" => "6.1.0",
"cusolverDnZungqr" => "6.1.0",
"cusolverDnZpotrsBatched" => "6.1.0",
"cusolverDnZpotrs" => "6.1.0",
"cusolverDnZpotri_bufferSize" => "6.1.0",
Expand All @@ -1103,6 +1105,8 @@ my %experimental_funcs = (
"cusolverDnSpotrf_bufferSize" => "6.1.0",
"cusolverDnSpotrfBatched" => "6.1.0",
"cusolverDnSpotrf" => "6.1.0",
"cusolverDnSorgqr_bufferSize" => "6.1.0",
"cusolverDnSorgqr" => "6.1.0",
"cusolverDnSgetrs" => "6.1.0",
"cusolverDnSgetrf_bufferSize" => "6.1.0",
"cusolverDnSgetrf" => "6.1.0",
Expand All @@ -1122,6 +1126,8 @@ my %experimental_funcs = (
"cusolverDnDpotrf_bufferSize" => "6.1.0",
"cusolverDnDpotrfBatched" => "6.1.0",
"cusolverDnDpotrf" => "6.1.0",
"cusolverDnDorgqr_bufferSize" => "6.1.0",
"cusolverDnDorgqr" => "6.1.0",
"cusolverDnDgetrs" => "6.1.0",
"cusolverDnDgetrf_bufferSize" => "6.1.0",
"cusolverDnDgetrf" => "6.1.0",
Expand All @@ -1132,6 +1138,8 @@ my %experimental_funcs = (
"cusolverDnDDgesv" => "6.1.0",
"cusolverDnDDgels_bufferSize" => "6.1.0",
"cusolverDnDDgels" => "6.1.0",
"cusolverDnCungqr_bufferSize" => "6.1.0",
"cusolverDnCungqr" => "6.1.0",
"cusolverDnCreate" => "6.1.0",
"cusolverDnCpotrsBatched" => "6.1.0",
"cusolverDnCpotrs" => "6.1.0",
Expand Down Expand Up @@ -1321,6 +1329,8 @@ sub experimentalSubstitutions {
subst("cusolverDnCpotrs", "hipsolverDnCpotrs", "library");
subst("cusolverDnCpotrsBatched", "hipsolverDnCpotrsBatched", "library");
subst("cusolverDnCreate", "hipsolverDnCreate", "library");
subst("cusolverDnCungqr", "hipsolverDnCungqr", "library");
subst("cusolverDnCungqr_bufferSize", "hipsolverDnCungqr_bufferSize", "library");
subst("cusolverDnDDgels", "hipsolverDnDDgels", "library");
subst("cusolverDnDDgels_bufferSize", "hipsolverDnDDgels_bufferSize", "library");
subst("cusolverDnDDgesv", "hipsolverDnDDgesv", "library");
Expand All @@ -1331,6 +1341,8 @@ sub experimentalSubstitutions {
subst("cusolverDnDgetrf", "hipsolverDnDgetrf", "library");
subst("cusolverDnDgetrf_bufferSize", "hipsolverDnDgetrf_bufferSize", "library");
subst("cusolverDnDgetrs", "hipsolverDnDgetrs", "library");
subst("cusolverDnDorgqr", "hipsolverDnDorgqr", "library");
subst("cusolverDnDorgqr_bufferSize", "hipsolverDnDorgqr_bufferSize", "library");
subst("cusolverDnDpotrf", "hipsolverDnDpotrf", "library");
subst("cusolverDnDpotrfBatched", "hipsolverDnDpotrfBatched", "library");
subst("cusolverDnDpotrf_bufferSize", "hipsolverDnDpotrf_bufferSize", "library");
Expand All @@ -1349,6 +1361,8 @@ sub experimentalSubstitutions {
subst("cusolverDnSgetrf", "hipsolverDnSgetrf", "library");
subst("cusolverDnSgetrf_bufferSize", "hipsolverDnSgetrf_bufferSize", "library");
subst("cusolverDnSgetrs", "hipsolverDnSgetrs", "library");
subst("cusolverDnSorgqr", "hipsolverDnSorgqr", "library");
subst("cusolverDnSorgqr_bufferSize", "hipsolverDnSorgqr_bufferSize", "library");
subst("cusolverDnSpotrf", "hipsolverDnSpotrf", "library");
subst("cusolverDnSpotrfBatched", "hipsolverDnSpotrfBatched", "library");
subst("cusolverDnSpotrf_bufferSize", "hipsolverDnSpotrf_bufferSize", "library");
Expand All @@ -1372,6 +1386,8 @@ sub experimentalSubstitutions {
subst("cusolverDnZpotri_bufferSize", "hipsolverDnZpotri_bufferSize", "library");
subst("cusolverDnZpotrs", "hipsolverDnZpotrs", "library");
subst("cusolverDnZpotrsBatched", "hipsolverDnZpotrsBatched", "library");
subst("cusolverDnZungqr", "hipsolverDnZungqr", "library");
subst("cusolverDnZungqr_bufferSize", "hipsolverDnZungqr_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 @@ -141,6 +141,8 @@
|`cusolverDnCpotrsBatched`|9.1| | | |`hipsolverDnCpotrsBatched`|5.1.0| | | |6.1.0|
|`cusolverDnCreate`| | | | |`hipsolverDnCreate`|5.1.0| | | |6.1.0|
|`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|
|`cusolverDnDBgels`|11.0| | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | |
Expand Down Expand Up @@ -170,6 +172,8 @@
|`cusolverDnDlaswp`| | | | | | | | | | |
|`cusolverDnDlauum`|10.1| | | | | | | | | |
|`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|
|`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 @@ -230,6 +234,8 @@
|`cusolverDnSlaswp`| | | | | | | | | | |
|`cusolverDnSlauum`|10.1| | | | | | | | | |
|`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|
|`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 @@ -277,6 +283,8 @@
|`cusolverDnZpotri_bufferSize`|10.1| | | |`hipsolverDnZpotri_bufferSize`|5.1.0| | | |6.1.0|
|`cusolverDnZpotrs`| | | | |`hipsolverDnZpotrs`|5.1.0| | | |6.1.0|
|`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|


\*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 @@ -141,6 +141,8 @@
|`cusolverDnCpotrsBatched`|9.1| | | |`hipsolverDnCpotrsBatched`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnCreate`| | | | |`hipsolverDnCreate`|5.1.0| | | |6.1.0|`rocblas_create_handle`| | | | | |
|`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| | | | | | |
|`cusolverDnDBgels`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | | | | | | | |
Expand Down Expand Up @@ -170,6 +172,8 @@
|`cusolverDnDlaswp`| | | | | | | | | | | | | | | | |
|`cusolverDnDlauum`|10.1| | | | | | | | | | | | | | | |
|`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| | | | | | |
|`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 @@ -230,6 +234,8 @@
|`cusolverDnSlaswp`| | | | | | | | | | | | | | | | |
|`cusolverDnSlauum`|10.1| | | | | | | | | | | | | | | |
|`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| | | | | | |
|`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 @@ -277,6 +283,8 @@
|`cusolverDnZpotri_bufferSize`|10.1| | | |`hipsolverDnZpotri_bufferSize`|5.1.0| | | |6.1.0| | | | | | |
|`cusolverDnZpotrs`| | | | |`hipsolverDnZpotrs`|5.1.0| | | |6.1.0| | | | | | |
|`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| | | | | | |


\*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 @@ -141,6 +141,8 @@
|`cusolverDnCpotrsBatched`|9.1| | | | | | | | | |
|`cusolverDnCreate`| | | | |`rocblas_create_handle`| | | | | |
|`cusolverDnCreateParams`|11.0| | | | | | | | | |
|`cusolverDnCungqr`|8.0| | | | | | | | | |
|`cusolverDnCungqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDBgels`|11.0| | | | | | | | | |
|`cusolverDnDBgels_bufferSize`|11.0| | | | | | | | | |
|`cusolverDnDBgesv`|11.0| | | | | | | | | |
Expand Down Expand Up @@ -170,6 +172,8 @@
|`cusolverDnDlaswp`| | | | | | | | | | |
|`cusolverDnDlauum`|10.1| | | | | | | | | |
|`cusolverDnDlauum_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnDorgqr`|8.0| | | | | | | | | |
|`cusolverDnDorgqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnDpotrf`| | | | |`rocsolver_dpotrf`|3.2.0| | | |6.1.0|
|`cusolverDnDpotrfBatched`|9.1| | | | | | | | | |
|`cusolverDnDpotrf_bufferSize`| | | | | | | | | | |
Expand Down Expand Up @@ -230,6 +234,8 @@
|`cusolverDnSlaswp`| | | | | | | | | | |
|`cusolverDnSlauum`|10.1| | | | | | | | | |
|`cusolverDnSlauum_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnSorgqr`|8.0| | | | | | | | | |
|`cusolverDnSorgqr_bufferSize`|8.0| | | | | | | | | |
|`cusolverDnSpotrf`| | | | |`rocsolver_spotrf`|3.2.0| | | |6.1.0|
|`cusolverDnSpotrfBatched`|9.1| | | | | | | | | |
|`cusolverDnSpotrf_bufferSize`| | | | | | | | | | |
Expand Down Expand Up @@ -277,6 +283,8 @@
|`cusolverDnZpotri_bufferSize`|10.1| | | | | | | | | |
|`cusolverDnZpotrs`| | | | | | | | | | |
|`cusolverDnZpotrsBatched`|9.1| | | | | | | | | |
|`cusolverDnZungqr`|8.0| | | | | | | | | |
|`cusolverDnZungqr_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 @@ -221,6 +221,16 @@ const std::map<llvm::StringRef, hipCounter> CUDA_SOLVER_FUNCTION_MAP {
{"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}},
// NOTE: rocsolver_(s|d)orgqr and rocsolver_(c|z)ungqr have a harness of other HIP and ROC API calls
{"cusolverDnSorgqr_bufferSize", {"hipsolverDnSorgqr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnDorgqr_bufferSize", {"hipsolverDnDorgqr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnCungqr_bufferSize", {"hipsolverDnCungqr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"cusolverDnZungqr_bufferSize", {"hipsolverDnZungqr_bufferSize", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
// NOTE: rocsolver_(s|d)orgqr and rocsolver_(c|z)ungqr have a harness of other HIP and ROC API calls
{"cusolverDnSorgqr", {"hipsolverDnSorgqr", "", CONV_LIB_FUNC, API_SOLVER, 2, ROC_UNSUPPORTED | HIP_EXPERIMENTAL}},
{"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}},
};

const std::map<llvm::StringRef, cudaAPIversions> CUDA_SOLVER_FUNCTION_VER_MAP {
Expand Down Expand Up @@ -353,6 +363,14 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_SOLVER_FUNCTION_VER_MAP {
{"cusolverDnDlauum", {CUDA_101, CUDA_0, CUDA_0}},
{"cusolverDnClauum", {CUDA_101, CUDA_0, CUDA_0}},
{"cusolverDnZlauum", {CUDA_101, CUDA_0, CUDA_0}},
{"cusolverDnSorgqr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnDorgqr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCungqr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZungqr_bufferSize", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnSorgqr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnDorgqr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnCungqr", {CUDA_80, CUDA_0, CUDA_0}},
{"cusolverDnZungqr", {CUDA_80, CUDA_0, CUDA_0}},
};

const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
Expand Down Expand Up @@ -424,6 +442,14 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
{"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}},
{"hipsolverDnSorgqr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnDorgqr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnCungqr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnZungqr_bufferSize", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSorgqr", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"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}},

{"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 db95390

Please sign in to comment.