Skip to content

Commit

Permalink
Merge pull request #1687 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][rocBLAS] 64-bit functions support - Step 9
  • Loading branch information
emankov authored Oct 7, 2024
2 parents 1d039fa + db51301 commit 7fa8b83
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 @@ -1597,7 +1597,9 @@ sub rocSubstitutions {
subst("cublasCherk_v2", "rocblas_cherk", "library");
subst("cublasCherkx", "rocblas_cherkx", "library");
subst("cublasChpmv", "rocblas_chpmv", "library");
subst("cublasChpmv_64", "rocblas_chpmv_64", "library");
subst("cublasChpmv_v2", "rocblas_chpmv", "library");
subst("cublasChpmv_v2_64", "rocblas_chpmv_64", "library");
subst("cublasChpr", "rocblas_chpr", "library");
subst("cublasChpr2", "rocblas_chpr2", "library");
subst("cublasChpr2_v2", "rocblas_chpr2", "library");
Expand Down Expand Up @@ -1729,7 +1731,9 @@ sub rocSubstitutions {
subst("cublasDscal_v2", "rocblas_dscal", "library");
subst("cublasDscal_v2_64", "rocblas_dscal_64", "library");
subst("cublasDspmv", "rocblas_dspmv", "library");
subst("cublasDspmv_64", "rocblas_dspmv_64", "library");
subst("cublasDspmv_v2", "rocblas_dspmv", "library");
subst("cublasDspmv_v2_64", "rocblas_dspmv_64", "library");
subst("cublasDspr", "rocblas_dspr", "library");
subst("cublasDspr2", "rocblas_dspr2", "library");
subst("cublasDspr2_v2", "rocblas_dspr2", "library");
Expand Down Expand Up @@ -1925,7 +1929,9 @@ sub rocSubstitutions {
subst("cublasSscal_v2", "rocblas_sscal", "library");
subst("cublasSscal_v2_64", "rocblas_sscal_64", "library");
subst("cublasSspmv", "rocblas_sspmv", "library");
subst("cublasSspmv_64", "rocblas_sspmv_64", "library");
subst("cublasSspmv_v2", "rocblas_sspmv", "library");
subst("cublasSspmv_v2_64", "rocblas_sspmv_64", "library");
subst("cublasSspr", "rocblas_sspr", "library");
subst("cublasSspr2", "rocblas_sspr2", "library");
subst("cublasSspr2_v2", "rocblas_sspr2", "library");
Expand Down Expand Up @@ -2048,7 +2054,9 @@ sub rocSubstitutions {
subst("cublasZherk_v2", "rocblas_zherk", "library");
subst("cublasZherkx", "rocblas_zherkx", "library");
subst("cublasZhpmv", "rocblas_zhpmv", "library");
subst("cublasZhpmv_64", "rocblas_zhpmv_64", "library");
subst("cublasZhpmv_v2", "rocblas_zhpmv", "library");
subst("cublasZhpmv_v2_64", "rocblas_zhpmv_64", "library");
subst("cublasZhpr", "rocblas_zhpr", "library");
subst("cublasZhpr2", "rocblas_zhpr2", "library");
subst("cublasZhpr2_v2", "rocblas_zhpr2", "library");
Expand Down Expand Up @@ -12597,8 +12605,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasZhpr_64",
"cublasZhpr2_v2_64",
"cublasZhpr2_64",
"cublasZhpmv_v2_64",
"cublasZhpmv_64",
"cublasZherkx_64",
"cublasZherk_v2_64",
"cublasZherk_64",
Expand Down Expand Up @@ -12657,8 +12663,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasSspr_64",
"cublasSspr2_v2_64",
"cublasSspr2_64",
"cublasSspmv_v2_64",
"cublasSspmv_64",
"cublasSmatinvBatched",
"cublasShutdown",
"cublasSgetrsBatched",
Expand Down Expand Up @@ -12810,8 +12814,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasDspr_64",
"cublasDspr2_v2_64",
"cublasDspr2_64",
"cublasDspmv_v2_64",
"cublasDspmv_64",
"cublasDmatinvBatched",
"cublasDgetrsBatched",
"cublasDgetriBatched",
Expand Down Expand Up @@ -12865,8 +12867,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasChpr_64",
"cublasChpr2_v2_64",
"cublasChpr2_64",
"cublasChpmv_v2_64",
"cublasChpmv_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 @@ -755,9 +755,9 @@
|`cublasCher_v2`| | | | |`hipblasCher_v2`|6.0.0| | | | |`rocblas_cher`|3.5.0| | | | |
|`cublasCher_v2_64`|12.0| | | |`hipblasCher_v2_64`|6.2.0| | | | |`rocblas_cher_64`|6.2.0| | | | |
|`cublasChpmv`| | | | |`hipblasChpmv_v2`|6.0.0| | | | |`rocblas_chpmv`|3.5.0| | | | |
|`cublasChpmv_64`|12.0| | | |`hipblasChpmv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasChpmv_64`|12.0| | | |`hipblasChpmv_v2_64`|6.2.0| | | | |`rocblas_chpmv_64`|6.2.0| | | | |
|`cublasChpmv_v2`| | | | |`hipblasChpmv_v2`|6.0.0| | | | |`rocblas_chpmv`|3.5.0| | | | |
|`cublasChpmv_v2_64`|12.0| | | |`hipblasChpmv_v2_64`|6.2.0| | | | | | | | | | |
|`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| | | | | | | | | | |
Expand Down Expand Up @@ -819,9 +819,9 @@
|`cublasDsbmv_v2`| | | | |`hipblasDsbmv`|3.5.0| | | | |`rocblas_dsbmv`|3.5.0| | | | |
|`cublasDsbmv_v2_64`|12.0| | | |`hipblasDsbmv_64`|6.2.0| | | | |`rocblas_dsbmv_64`|6.2.0| | | | |
|`cublasDspmv`| | | | |`hipblasDspmv`|3.5.0| | | | |`rocblas_dspmv`|3.5.0| | | | |
|`cublasDspmv_64`|12.0| | | |`hipblasDspmv_64`|6.2.0| | | | | | | | | | |
|`cublasDspmv_64`|12.0| | | |`hipblasDspmv_64`|6.2.0| | | | |`rocblas_dspmv_64`|6.2.0| | | | |
|`cublasDspmv_v2`| | | | |`hipblasDspmv`|3.5.0| | | | |`rocblas_dspmv`|3.5.0| | | | |
|`cublasDspmv_v2_64`|12.0| | | |`hipblasDspmv_64`|6.2.0| | | | | | | | | | |
|`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| | | | | | | | | | |
Expand Down Expand Up @@ -883,9 +883,9 @@
|`cublasSsbmv_v2`| | | | |`hipblasSsbmv`|3.5.0| | | | |`rocblas_ssbmv`|3.5.0| | | | |
|`cublasSsbmv_v2_64`|12.0| | | |`hipblasSsbmv_64`|6.2.0| | | | |`rocblas_ssbmv_64`|6.2.0| | | | |
|`cublasSspmv`| | | | |`hipblasSspmv`|3.5.0| | | | |`rocblas_sspmv`|3.5.0| | | | |
|`cublasSspmv_64`|12.0| | | |`hipblasSspmv_64`|6.2.0| | | | | | | | | | |
|`cublasSspmv_64`|12.0| | | |`hipblasSspmv_64`|6.2.0| | | | |`rocblas_sspmv_64`|6.2.0| | | | |
|`cublasSspmv_v2`| | | | |`hipblasSspmv`|3.5.0| | | | |`rocblas_sspmv`|3.5.0| | | | |
|`cublasSspmv_v2_64`|12.0| | | |`hipblasSspmv_64`|6.2.0| | | | | | | | | | |
|`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| | | | | | | | | | |
Expand Down Expand Up @@ -963,9 +963,9 @@
|`cublasZher_v2`| | | | |`hipblasZher_v2`|6.0.0| | | | |`rocblas_zher`|3.5.0| | | | |
|`cublasZher_v2_64`|12.0| | | |`hipblasZher_v2_64`|6.2.0| | | | |`rocblas_zher_64`|6.2.0| | | | |
|`cublasZhpmv`| | | | |`hipblasZhpmv_v2`|6.0.0| | | | |`rocblas_zhpmv`|3.5.0| | | | |
|`cublasZhpmv_64`|12.0| | | |`hipblasZhpmv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasZhpmv_64`|12.0| | | |`hipblasZhpmv_v2_64`|6.2.0| | | | |`rocblas_zhpmv_64`|6.2.0| | | | |
|`cublasZhpmv_v2`| | | | |`hipblasZhpmv_v2`|6.0.0| | | | |`rocblas_zhpmv`|3.5.0| | | | |
|`cublasZhpmv_v2_64`|12.0| | | |`hipblasZhpmv_v2_64`|6.2.0| | | | | | | | | | |
|`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| | | | | | | | | | |
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 @@ -755,9 +755,9 @@
|`cublasCher_v2`| | | | |`rocblas_cher`|3.5.0| | | | |
|`cublasCher_v2_64`|12.0| | | |`rocblas_cher_64`|6.2.0| | | | |
|`cublasChpmv`| | | | |`rocblas_chpmv`|3.5.0| | | | |
|`cublasChpmv_64`|12.0| | | | | | | | | |
|`cublasChpmv_64`|12.0| | | |`rocblas_chpmv_64`|6.2.0| | | | |
|`cublasChpmv_v2`| | | | |`rocblas_chpmv`|3.5.0| | | | |
|`cublasChpmv_v2_64`|12.0| | | | | | | | | |
|`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| | | | | | | | | |
Expand Down Expand Up @@ -819,9 +819,9 @@
|`cublasDsbmv_v2`| | | | |`rocblas_dsbmv`|3.5.0| | | | |
|`cublasDsbmv_v2_64`|12.0| | | |`rocblas_dsbmv_64`|6.2.0| | | | |
|`cublasDspmv`| | | | |`rocblas_dspmv`|3.5.0| | | | |
|`cublasDspmv_64`|12.0| | | | | | | | | |
|`cublasDspmv_64`|12.0| | | |`rocblas_dspmv_64`|6.2.0| | | | |
|`cublasDspmv_v2`| | | | |`rocblas_dspmv`|3.5.0| | | | |
|`cublasDspmv_v2_64`|12.0| | | | | | | | | |
|`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| | | | | | | | | |
Expand Down Expand Up @@ -883,9 +883,9 @@
|`cublasSsbmv_v2`| | | | |`rocblas_ssbmv`|3.5.0| | | | |
|`cublasSsbmv_v2_64`|12.0| | | |`rocblas_ssbmv_64`|6.2.0| | | | |
|`cublasSspmv`| | | | |`rocblas_sspmv`|3.5.0| | | | |
|`cublasSspmv_64`|12.0| | | | | | | | | |
|`cublasSspmv_64`|12.0| | | |`rocblas_sspmv_64`|6.2.0| | | | |
|`cublasSspmv_v2`| | | | |`rocblas_sspmv`|3.5.0| | | | |
|`cublasSspmv_v2_64`|12.0| | | | | | | | | |
|`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| | | | | | | | | |
Expand Down Expand Up @@ -963,9 +963,9 @@
|`cublasZher_v2`| | | | |`rocblas_zher`|3.5.0| | | | |
|`cublasZher_v2_64`|12.0| | | |`rocblas_zher_64`|6.2.0| | | | |
|`cublasZhpmv`| | | | |`rocblas_zhpmv`|3.5.0| | | | |
|`cublasZhpmv_64`|12.0| | | | | | | | | |
|`cublasZhpmv_64`|12.0| | | |`rocblas_zhpmv_64`|6.2.0| | | | |
|`cublasZhpmv_v2`| | | | |`rocblas_zhpmv`|3.5.0| | | | |
|`cublasZhpmv_v2_64`|12.0| | | | | | | | | |
|`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| | | | | | | | | |
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 @@ -326,13 +326,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// SPMV/HPMV
{"cublasSspmv", {"hipblasSspmv", "rocblas_sspmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasSspmv_64", {"hipblasSspmv_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasSspmv_64", {"hipblasSspmv_64", "rocblas_sspmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDspmv", {"hipblasDspmv", "rocblas_dspmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasDspmv_64", {"hipblasDspmv_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasDspmv_64", {"hipblasDspmv_64", "rocblas_dspmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasChpmv", {"hipblasChpmv_v2", "rocblas_chpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasChpmv_64", {"hipblasChpmv_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasChpmv_64", {"hipblasChpmv_v2_64", "rocblas_chpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZhpmv", {"hipblasZhpmv_v2", "rocblas_zhpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasZhpmv_64", {"hipblasZhpmv_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasZhpmv_64", {"hipblasZhpmv_v2_64", "rocblas_zhpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},

// GER
{"cublasSger", {"hipblasSger", "rocblas_sger", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
Expand Down Expand Up @@ -744,13 +744,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// SPMV/HPMV
{"cublasSspmv_v2", {"hipblasSspmv", "rocblas_sspmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasSspmv_v2_64", {"hipblasSspmv_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasSspmv_v2_64", {"hipblasSspmv_64", "rocblas_sspmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDspmv_v2", {"hipblasDspmv", "rocblas_dspmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDspmv_v2_64", {"hipblasDspmv_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasDspmv_v2_64", {"hipblasDspmv_64", "rocblas_dspmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasChpmv_v2", {"hipblasChpmv_v2", "rocblas_chpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasChpmv_v2_64", {"hipblasChpmv_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasChpmv_v2_64", {"hipblasChpmv_v2_64", "rocblas_chpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZhpmv_v2", {"hipblasZhpmv_v2", "rocblas_zhpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZhpmv_v2_64", {"hipblasZhpmv_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasZhpmv_v2_64", {"hipblasZhpmv_v2_64", "rocblas_zhpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},

// GER
{"cublasSger_v2", {"hipblasSger", "rocblas_sger", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
Expand Down Expand Up @@ -2361,6 +2361,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"rocblas_zsyr2_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_cher2_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_zher2_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_sspmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_dspmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_chpmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_zhpmv_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 7fa8b83

Please sign in to comment.