Skip to content

Commit

Permalink
Merge pull request #1690 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][rocBLAS] 64-bit functions support - Step 11
  • Loading branch information
emankov authored Oct 8, 2024
2 parents 49ea22f + f417d93 commit 172eb68
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 32 deletions.
16 changes: 8 additions & 8 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,9 @@ sub rocSubstitutions {
subst("cublasChpmv_v2_64", "rocblas_chpmv_64", "library");
subst("cublasChpr", "rocblas_chpr", "library");
subst("cublasChpr2", "rocblas_chpr2", "library");
subst("cublasChpr2_64", "rocblas_chpr2_64", "library");
subst("cublasChpr2_v2", "rocblas_chpr2", "library");
subst("cublasChpr2_v2_64", "rocblas_chpr2_64", "library");
subst("cublasChpr_64", "rocblas_chpr_64", "library");
subst("cublasChpr_v2", "rocblas_chpr", "library");
subst("cublasChpr_v2_64", "rocblas_chpr_64", "library");
Expand Down Expand Up @@ -1738,7 +1740,9 @@ sub rocSubstitutions {
subst("cublasDspmv_v2_64", "rocblas_dspmv_64", "library");
subst("cublasDspr", "rocblas_dspr", "library");
subst("cublasDspr2", "rocblas_dspr2", "library");
subst("cublasDspr2_64", "rocblas_dspr2_64", "library");
subst("cublasDspr2_v2", "rocblas_dspr2", "library");
subst("cublasDspr2_v2_64", "rocblas_dspr2_64", "library");
subst("cublasDspr_64", "rocblas_dspr_64", "library");
subst("cublasDspr_v2", "rocblas_dspr", "library");
subst("cublasDspr_v2_64", "rocblas_dspr_64", "library");
Expand Down Expand Up @@ -1938,7 +1942,9 @@ sub rocSubstitutions {
subst("cublasSspmv_v2_64", "rocblas_sspmv_64", "library");
subst("cublasSspr", "rocblas_sspr", "library");
subst("cublasSspr2", "rocblas_sspr2", "library");
subst("cublasSspr2_64", "rocblas_sspr2_64", "library");
subst("cublasSspr2_v2", "rocblas_sspr2", "library");
subst("cublasSspr2_v2_64", "rocblas_sspr2_64", "library");
subst("cublasSspr_64", "rocblas_sspr_64", "library");
subst("cublasSspr_v2", "rocblas_sspr", "library");
subst("cublasSspr_v2_64", "rocblas_sspr_64", "library");
Expand Down Expand Up @@ -2065,7 +2071,9 @@ sub rocSubstitutions {
subst("cublasZhpmv_v2_64", "rocblas_zhpmv_64", "library");
subst("cublasZhpr", "rocblas_zhpr", "library");
subst("cublasZhpr2", "rocblas_zhpr2", "library");
subst("cublasZhpr2_64", "rocblas_zhpr2_64", "library");
subst("cublasZhpr2_v2", "rocblas_zhpr2", "library");
subst("cublasZhpr2_v2_64", "rocblas_zhpr2_64", "library");
subst("cublasZhpr_64", "rocblas_zhpr_64", "library");
subst("cublasZhpr_v2", "rocblas_zhpr", "library");
subst("cublasZhpr_v2_64", "rocblas_zhpr_64", "library");
Expand Down Expand Up @@ -12609,8 +12617,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasZsymm_v2_64",
"cublasZsymm_64",
"cublasZmatinvBatched",
"cublasZhpr2_v2_64",
"cublasZhpr2_64",
"cublasZherkx_64",
"cublasZherk_v2_64",
"cublasZherk_64",
Expand Down Expand Up @@ -12665,8 +12671,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasSsyr2k_64",
"cublasSsymm_v2_64",
"cublasSsymm_64",
"cublasSspr2_v2_64",
"cublasSspr2_64",
"cublasSmatinvBatched",
"cublasShutdown",
"cublasSgetrsBatched",
Expand Down Expand Up @@ -12814,8 +12818,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasDsyr2k_64",
"cublasDsymm_v2_64",
"cublasDsymm_64",
"cublasDspr2_v2_64",
"cublasDspr2_64",
"cublasDmatinvBatched",
"cublasDgetrsBatched",
"cublasDgetriBatched",
Expand Down Expand Up @@ -12865,8 +12867,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasCopyEx_64",
"cublasCopyEx",
"cublasCmatinvBatched",
"cublasChpr2_v2_64",
"cublasChpr2_64",
"cublasCherkx_64",
"cublasCherk_v2_64",
"cublasCherk_64",
Expand Down
16 changes: 8 additions & 8 deletions docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,9 @@
|`cublasChpmv_v2_64`|12.0| | | |`hipblasChpmv_v2_64`|6.2.0| | | | |`rocblas_chpmv_64`|6.2.0| | | | |
|`cublasChpr`| | | | |`hipblasChpr_v2`|6.0.0| | | | |`rocblas_chpr`|3.5.0| | | | |
|`cublasChpr2`| | | | |`hipblasChpr2_v2`|6.0.0| | | | |`rocblas_chpr2`|3.5.0| | | | |
|`cublasChpr2_64`|12.0| | | |`hipblasChpr2_v2_64`|6.2.0| | | | | | | | | | |
|`cublasChpr2_64`|12.0| | | |`hipblasChpr2_v2_64`|6.2.0| | | | |`rocblas_chpr2_64`|6.2.0| | | | |
|`cublasChpr2_v2`| | | | |`hipblasChpr2_v2`|6.0.0| | | | |`rocblas_chpr2`|3.5.0| | | | |
|`cublasChpr2_v2_64`|12.0| | | |`hipblasChpr2_v2_64`|6.2.0| | | | | | | | | | |
|`cublasChpr2_v2_64`|12.0| | | |`hipblasChpr2_v2_64`|6.2.0| | | | |`rocblas_chpr2_64`|6.2.0| | | | |
|`cublasChpr_64`|12.0| | | |`hipblasChpr_v2_64`|6.2.0| | | | |`rocblas_chpr_64`|6.2.0| | | | |
|`cublasChpr_v2`| | | | |`hipblasChpr_v2`|6.0.0| | | | |`rocblas_chpr`|3.5.0| | | | |
|`cublasChpr_v2_64`|12.0| | | |`hipblasChpr_v2_64`|6.2.0| | | | |`rocblas_chpr_64`|6.2.0| | | | |
Expand Down Expand Up @@ -824,9 +824,9 @@
|`cublasDspmv_v2_64`|12.0| | | |`hipblasDspmv_64`|6.2.0| | | | |`rocblas_dspmv_64`|6.2.0| | | | |
|`cublasDspr`| | | | |`hipblasDspr`|3.5.0| | | | |`rocblas_dspr`|3.5.0| | | | |
|`cublasDspr2`| | | | |`hipblasDspr2`|3.5.0| | | | |`rocblas_dspr2`|3.5.0| | | | |
|`cublasDspr2_64`|12.0| | | |`hipblasDspr2_64`|6.2.0| | | | | | | | | | |
|`cublasDspr2_64`|12.0| | | |`hipblasDspr2_64`|6.2.0| | | | |`rocblas_dspr2_64`|6.2.0| | | | |
|`cublasDspr2_v2`| | | | |`hipblasDspr2`|3.5.0| | | | |`rocblas_dspr2`|3.5.0| | | | |
|`cublasDspr2_v2_64`|12.0| | | |`hipblasDspr2_64`|6.2.0| | | | | | | | | | |
|`cublasDspr2_v2_64`|12.0| | | |`hipblasDspr2_64`|6.2.0| | | | |`rocblas_dspr2_64`|6.2.0| | | | |
|`cublasDspr_64`|12.0| | | |`hipblasDspr_64`|6.2.0| | | | |`rocblas_dspr_64`|6.2.0| | | | |
|`cublasDspr_v2`| | | | |`hipblasDspr`|3.5.0| | | | |`rocblas_dspr`|3.5.0| | | | |
|`cublasDspr_v2_64`|12.0| | | |`hipblasDspr_64`|6.2.0| | | | |`rocblas_dspr_64`|6.2.0| | | | |
Expand Down Expand Up @@ -888,9 +888,9 @@
|`cublasSspmv_v2_64`|12.0| | | |`hipblasSspmv_64`|6.2.0| | | | |`rocblas_sspmv_64`|6.2.0| | | | |
|`cublasSspr`| | | | |`hipblasSspr`|3.5.0| | | | |`rocblas_sspr`|3.5.0| | | | |
|`cublasSspr2`| | | | |`hipblasSspr2`|3.5.0| | | | |`rocblas_sspr2`|3.5.0| | | | |
|`cublasSspr2_64`|12.0| | | |`hipblasSspr2_64`|6.2.0| | | | | | | | | | |
|`cublasSspr2_64`|12.0| | | |`hipblasSspr2_64`|6.2.0| | | | |`rocblas_sspr2_64`|6.2.0| | | | |
|`cublasSspr2_v2`| | | | |`hipblasSspr2`|3.5.0| | | | |`rocblas_sspr2`|3.5.0| | | | |
|`cublasSspr2_v2_64`|12.0| | | |`hipblasSspr2_64`|6.2.0| | | | | | | | | | |
|`cublasSspr2_v2_64`|12.0| | | |`hipblasSspr2_64`|6.2.0| | | | |`rocblas_sspr2_64`|6.2.0| | | | |
|`cublasSspr_64`|12.0| | | |`hipblasSspr_64`|6.2.0| | | | |`rocblas_sspr_64`|6.2.0| | | | |
|`cublasSspr_v2`| | | | |`hipblasSspr`|3.5.0| | | | |`rocblas_sspr`|3.5.0| | | | |
|`cublasSspr_v2_64`|12.0| | | |`hipblasSspr_64`|6.2.0| | | | |`rocblas_sspr_64`|6.2.0| | | | |
Expand Down Expand Up @@ -968,9 +968,9 @@
|`cublasZhpmv_v2_64`|12.0| | | |`hipblasZhpmv_v2_64`|6.2.0| | | | |`rocblas_zhpmv_64`|6.2.0| | | | |
|`cublasZhpr`| | | | |`hipblasZhpr_v2`|6.0.0| | | | |`rocblas_zhpr`|3.5.0| | | | |
|`cublasZhpr2`| | | | |`hipblasZhpr2_v2`|6.0.0| | | | |`rocblas_zhpr2`|3.5.0| | | | |
|`cublasZhpr2_64`|12.0| | | |`hipblasZhpr2_v2_64`|6.2.0| | | | | | | | | | |
|`cublasZhpr2_64`|12.0| | | |`hipblasZhpr2_v2_64`|6.2.0| | | | |`rocblas_zhpr2_64`|6.2.0| | | | |
|`cublasZhpr2_v2`| | | | |`hipblasZhpr2_v2`|6.0.0| | | | |`rocblas_zhpr2`|3.5.0| | | | |
|`cublasZhpr2_v2_64`|12.0| | | |`hipblasZhpr2_v2_64`|6.2.0| | | | | | | | | | |
|`cublasZhpr2_v2_64`|12.0| | | |`hipblasZhpr2_v2_64`|6.2.0| | | | |`rocblas_zhpr2_64`|6.2.0| | | | |
|`cublasZhpr_64`|12.0| | | |`hipblasZhpr_v2_64`|6.2.0| | | | |`rocblas_zhpr_64`|6.2.0| | | | |
|`cublasZhpr_v2`| | | | |`hipblasZhpr_v2`|6.0.0| | | | |`rocblas_zhpr`|3.5.0| | | | |
|`cublasZhpr_v2_64`|12.0| | | |`hipblasZhpr_v2_64`|6.2.0| | | | |`rocblas_zhpr_64`|6.2.0| | | | |
Expand Down
16 changes: 8 additions & 8 deletions docs/tables/CUBLAS_API_supported_by_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,9 @@
|`cublasChpmv_v2_64`|12.0| | | |`rocblas_chpmv_64`|6.2.0| | | | |
|`cublasChpr`| | | | |`rocblas_chpr`|3.5.0| | | | |
|`cublasChpr2`| | | | |`rocblas_chpr2`|3.5.0| | | | |
|`cublasChpr2_64`|12.0| | | | | | | | | |
|`cublasChpr2_64`|12.0| | | |`rocblas_chpr2_64`|6.2.0| | | | |
|`cublasChpr2_v2`| | | | |`rocblas_chpr2`|3.5.0| | | | |
|`cublasChpr2_v2_64`|12.0| | | | | | | | | |
|`cublasChpr2_v2_64`|12.0| | | |`rocblas_chpr2_64`|6.2.0| | | | |
|`cublasChpr_64`|12.0| | | |`rocblas_chpr_64`|6.2.0| | | | |
|`cublasChpr_v2`| | | | |`rocblas_chpr`|3.5.0| | | | |
|`cublasChpr_v2_64`|12.0| | | |`rocblas_chpr_64`|6.2.0| | | | |
Expand Down Expand Up @@ -824,9 +824,9 @@
|`cublasDspmv_v2_64`|12.0| | | |`rocblas_dspmv_64`|6.2.0| | | | |
|`cublasDspr`| | | | |`rocblas_dspr`|3.5.0| | | | |
|`cublasDspr2`| | | | |`rocblas_dspr2`|3.5.0| | | | |
|`cublasDspr2_64`|12.0| | | | | | | | | |
|`cublasDspr2_64`|12.0| | | |`rocblas_dspr2_64`|6.2.0| | | | |
|`cublasDspr2_v2`| | | | |`rocblas_dspr2`|3.5.0| | | | |
|`cublasDspr2_v2_64`|12.0| | | | | | | | | |
|`cublasDspr2_v2_64`|12.0| | | |`rocblas_dspr2_64`|6.2.0| | | | |
|`cublasDspr_64`|12.0| | | |`rocblas_dspr_64`|6.2.0| | | | |
|`cublasDspr_v2`| | | | |`rocblas_dspr`|3.5.0| | | | |
|`cublasDspr_v2_64`|12.0| | | |`rocblas_dspr_64`|6.2.0| | | | |
Expand Down Expand Up @@ -888,9 +888,9 @@
|`cublasSspmv_v2_64`|12.0| | | |`rocblas_sspmv_64`|6.2.0| | | | |
|`cublasSspr`| | | | |`rocblas_sspr`|3.5.0| | | | |
|`cublasSspr2`| | | | |`rocblas_sspr2`|3.5.0| | | | |
|`cublasSspr2_64`|12.0| | | | | | | | | |
|`cublasSspr2_64`|12.0| | | |`rocblas_sspr2_64`|6.2.0| | | | |
|`cublasSspr2_v2`| | | | |`rocblas_sspr2`|3.5.0| | | | |
|`cublasSspr2_v2_64`|12.0| | | | | | | | | |
|`cublasSspr2_v2_64`|12.0| | | |`rocblas_sspr2_64`|6.2.0| | | | |
|`cublasSspr_64`|12.0| | | |`rocblas_sspr_64`|6.2.0| | | | |
|`cublasSspr_v2`| | | | |`rocblas_sspr`|3.5.0| | | | |
|`cublasSspr_v2_64`|12.0| | | |`rocblas_sspr_64`|6.2.0| | | | |
Expand Down Expand Up @@ -968,9 +968,9 @@
|`cublasZhpmv_v2_64`|12.0| | | |`rocblas_zhpmv_64`|6.2.0| | | | |
|`cublasZhpr`| | | | |`rocblas_zhpr`|3.5.0| | | | |
|`cublasZhpr2`| | | | |`rocblas_zhpr2`|3.5.0| | | | |
|`cublasZhpr2_64`|12.0| | | | | | | | | |
|`cublasZhpr2_64`|12.0| | | |`rocblas_zhpr2_64`|6.2.0| | | | |
|`cublasZhpr2_v2`| | | | |`rocblas_zhpr2`|3.5.0| | | | |
|`cublasZhpr2_v2_64`|12.0| | | | | | | | | |
|`cublasZhpr2_v2_64`|12.0| | | |`rocblas_zhpr2_64`|6.2.0| | | | |
|`cublasZhpr_64`|12.0| | | |`rocblas_zhpr_64`|6.2.0| | | | |
|`cublasZhpr_v2`| | | | |`rocblas_zhpr`|3.5.0| | | | |
|`cublasZhpr_v2_64`|12.0| | | |`rocblas_zhpr_64`|6.2.0| | | | |
Expand Down
20 changes: 12 additions & 8 deletions src/CUDA2HIP_BLAS_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// SPR2/HPR2
{"cublasSspr2", {"hipblasSspr2", "rocblas_sspr2", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasSspr2_64", {"hipblasSspr2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasSspr2_64", {"hipblasSspr2_64", "rocblas_sspr2_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDspr2", {"hipblasDspr2", "rocblas_dspr2", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasDspr2_64", {"hipblasDspr2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasDspr2_64", {"hipblasDspr2_64", "rocblas_dspr2_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasChpr2", {"hipblasChpr2_v2", "rocblas_chpr2", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasChpr2_64", {"hipblasChpr2_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasChpr2_64", {"hipblasChpr2_v2_64", "rocblas_chpr2_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZhpr2", {"hipblasZhpr2_v2", "rocblas_zhpr2", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasZhpr2_64", {"hipblasZhpr2_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasZhpr2_64", {"hipblasZhpr2_v2_64", "rocblas_zhpr2_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},

// Blas3 (v1) Routines
// GEMM
Expand Down Expand Up @@ -806,13 +806,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// SPR2/HPR2
{"cublasSspr2_v2", {"hipblasSspr2", "rocblas_sspr2", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasSspr2_v2_64", {"hipblasSspr2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasSspr2_v2_64", {"hipblasSspr2_64", "rocblas_sspr2_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDspr2_v2", {"hipblasDspr2", "rocblas_dspr2", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDspr2_v2_64", {"hipblasDspr2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasDspr2_v2_64", {"hipblasDspr2_64", "rocblas_dspr2_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasChpr2_v2", {"hipblasChpr2_v2", "rocblas_chpr2", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasChpr2_v2_64", {"hipblasChpr2_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasChpr2_v2_64", {"hipblasChpr2_v2_64", "rocblas_chpr2_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZhpr2_v2", {"hipblasZhpr2_v2", "rocblas_zhpr2", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZhpr2_v2_64", {"hipblasZhpr2_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasZhpr2_v2_64", {"hipblasZhpr2_v2_64", "rocblas_zhpr2_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},

// Blas3 (v2) Routines
// GEMM
Expand Down Expand Up @@ -2369,6 +2369,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"rocblas_dspr_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_chpr_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_zhpr_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_sspr2_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_dspr2_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_chpr2_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_zhpr2_64", {HIP_6020, HIP_0, HIP_0 }},
};

const std::map<llvm::StringRef, hipAPIChangedVersions> HIP_BLAS_FUNCTION_CHANGED_VER_MAP {
Expand Down
Loading

0 comments on commit 172eb68

Please sign in to comment.