Skip to content

Commit

Permalink
Merge pull request #1693 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][rocBLAS] 64-bit functions support - Step 13
  • Loading branch information
emankov authored Oct 9, 2024
2 parents 1d3fb9f + 24965a7 commit c0a57bb
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 @@ -1656,7 +1656,9 @@ sub rocSubstitutions {
subst("cublasCtbsv", "rocblas_ctbsv", "library");
subst("cublasCtbsv_v2", "rocblas_ctbsv", "library");
subst("cublasCtpmv", "rocblas_ctpmv", "library");
subst("cublasCtpmv_64", "rocblas_ctpmv_64", "library");
subst("cublasCtpmv_v2", "rocblas_ctpmv", "library");
subst("cublasCtpmv_v2_64", "rocblas_ctpmv_64", "library");
subst("cublasCtpsv", "rocblas_ctpsv", "library");
subst("cublasCtpsv_v2", "rocblas_ctpsv", "library");
subst("cublasCtrmm", "rocblas_ctrmm", "library");
Expand Down Expand Up @@ -1776,7 +1778,9 @@ sub rocSubstitutions {
subst("cublasDtbsv", "rocblas_dtbsv", "library");
subst("cublasDtbsv_v2", "rocblas_dtbsv", "library");
subst("cublasDtpmv", "rocblas_dtpmv", "library");
subst("cublasDtpmv_64", "rocblas_dtpmv_64", "library");
subst("cublasDtpmv_v2", "rocblas_dtpmv", "library");
subst("cublasDtpmv_v2_64", "rocblas_dtpmv_64", "library");
subst("cublasDtpsv", "rocblas_dtpsv", "library");
subst("cublasDtpsv_v2", "rocblas_dtpsv", "library");
subst("cublasDtrmm", "rocblas_dtrmm", "library");
Expand Down Expand Up @@ -1980,7 +1984,9 @@ sub rocSubstitutions {
subst("cublasStbsv", "rocblas_stbsv", "library");
subst("cublasStbsv_v2", "rocblas_stbsv", "library");
subst("cublasStpmv", "rocblas_stpmv", "library");
subst("cublasStpmv_64", "rocblas_stpmv_64", "library");
subst("cublasStpmv_v2", "rocblas_stpmv", "library");
subst("cublasStpmv_v2_64", "rocblas_stpmv_64", "library");
subst("cublasStpsv", "rocblas_stpsv", "library");
subst("cublasStpsv_v2", "rocblas_stpsv", "library");
subst("cublasStrmm", "rocblas_strmm", "library");
Expand Down Expand Up @@ -2121,7 +2127,9 @@ sub rocSubstitutions {
subst("cublasZtbsv", "rocblas_ztbsv", "library");
subst("cublasZtbsv_v2", "rocblas_ztbsv", "library");
subst("cublasZtpmv", "rocblas_ztpmv", "library");
subst("cublasZtpmv_64", "rocblas_ztpmv_64", "library");
subst("cublasZtpmv_v2", "rocblas_ztpmv", "library");
subst("cublasZtpmv_v2_64", "rocblas_ztpmv_64", "library");
subst("cublasZtpsv", "rocblas_ztpsv", "library");
subst("cublasZtpsv_v2", "rocblas_ztpsv", "library");
subst("cublasZtrmm", "rocblas_ztrmm", "library");
Expand Down Expand Up @@ -12615,8 +12623,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasZtpttr",
"cublasZtpsv_v2_64",
"cublasZtpsv_64",
"cublasZtpmv_v2_64",
"cublasZtpmv_64",
"cublasZtbsv_v2_64",
"cublasZtbsv_64",
"cublasZtbmv_v2_64",
Expand Down Expand Up @@ -12668,8 +12674,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasStpttr",
"cublasStpsv_v2_64",
"cublasStpsv_64",
"cublasStpmv_v2_64",
"cublasStpmv_64",
"cublasStbsv_v2_64",
"cublasStbsv_64",
"cublasStbmv_v2_64",
Expand Down Expand Up @@ -12813,8 +12817,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasDtpttr",
"cublasDtpsv_v2_64",
"cublasDtpsv_64",
"cublasDtpmv_v2_64",
"cublasDtpmv_64",
"cublasDtbsv_v2_64",
"cublasDtbsv_64",
"cublasDtbmv_v2_64",
Expand Down Expand Up @@ -12853,8 +12855,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasCtpttr",
"cublasCtpsv_v2_64",
"cublasCtpsv_64",
"cublasCtpmv_v2_64",
"cublasCtpmv_64",
"cublasCtbsv_v2_64",
"cublasCtbsv_64",
"cublasCtbmv_v2_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 @@ -787,9 +787,9 @@
|`cublasCtbsv_v2`| | | | |`hipblasCtbsv_v2`|6.0.0| | | | |`rocblas_ctbsv`|3.5.0| | | | |
|`cublasCtbsv_v2_64`|12.0| | | |`hipblasCtbsv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasCtpmv`| | | | |`hipblasCtpmv_v2`|6.0.0| | | | |`rocblas_ctpmv`|3.5.0| | | | |
|`cublasCtpmv_64`|12.0| | | |`hipblasCtpmv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasCtpmv_64`|12.0| | | |`hipblasCtpmv_v2_64`|6.2.0| | | | |`rocblas_ctpmv_64`|6.2.0| | | | |
|`cublasCtpmv_v2`| | | | |`hipblasCtpmv_v2`|6.0.0| | | | |`rocblas_ctpmv`|3.5.0| | | | |
|`cublasCtpmv_v2_64`|12.0| | | |`hipblasCtpmv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasCtpmv_v2_64`|12.0| | | |`hipblasCtpmv_v2_64`|6.2.0| | | | |`rocblas_ctpmv_64`|6.2.0| | | | |
|`cublasCtpsv`| | | | |`hipblasCtpsv_v2`|6.0.0| | | | |`rocblas_ctpsv`|3.5.0| | | | |
|`cublasCtpsv_64`|12.0| | | |`hipblasCtpsv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasCtpsv_v2`| | | | |`hipblasCtpsv_v2`|6.0.0| | | | |`rocblas_ctpsv`|3.5.0| | | | |
Expand Down Expand Up @@ -851,9 +851,9 @@
|`cublasDtbsv_v2`| | | | |`hipblasDtbsv`|3.6.0| | | | |`rocblas_dtbsv`|3.5.0| | | | |
|`cublasDtbsv_v2_64`|12.0| | | |`hipblasDtbsv_64`|6.2.0| | | | | | | | | | |
|`cublasDtpmv`| | | | |`hipblasDtpmv`|3.5.0| | | | |`rocblas_dtpmv`|3.5.0| | | | |
|`cublasDtpmv_64`|12.0| | | |`hipblasDtpmv_64`|6.2.0| | | | | | | | | | |
|`cublasDtpmv_64`|12.0| | | |`hipblasDtpmv_64`|6.2.0| | | | |`rocblas_dtpmv_64`|6.2.0| | | | |
|`cublasDtpmv_v2`| | | | |`hipblasDtpmv`|3.5.0| | | | |`rocblas_dtpmv`|3.5.0| | | | |
|`cublasDtpmv_v2_64`|12.0| | | |`hipblasDtpmv_64`|6.2.0| | | | | | | | | | |
|`cublasDtpmv_v2_64`|12.0| | | |`hipblasDtpmv_64`|6.2.0| | | | |`rocblas_dtpmv_64`|6.2.0| | | | |
|`cublasDtpsv`| | | | |`hipblasDtpsv`|3.5.0| | | | |`rocblas_dtpsv`|3.5.0| | | | |
|`cublasDtpsv_64`|12.0| | | |`hipblasDtpsv_64`|6.2.0| | | | | | | | | | |
|`cublasDtpsv_v2`| | | | |`hipblasDtpsv`|3.5.0| | | | |`rocblas_dtpsv`|3.5.0| | | | |
Expand Down Expand Up @@ -915,9 +915,9 @@
|`cublasStbsv_v2`| | | | |`hipblasStbsv`|3.6.0| | | | |`rocblas_stbsv`|3.5.0| | | | |
|`cublasStbsv_v2_64`|12.0| | | |`hipblasStbsv_64`|6.2.0| | | | | | | | | | |
|`cublasStpmv`| | | | |`hipblasStpmv`|3.5.0| | | | |`rocblas_stpmv`|3.5.0| | | | |
|`cublasStpmv_64`|12.0| | | |`hipblasStpmv_64`|6.2.0| | | | | | | | | | |
|`cublasStpmv_64`|12.0| | | |`hipblasStpmv_64`|6.2.0| | | | |`rocblas_stpmv_64`|6.2.0| | | | |
|`cublasStpmv_v2`| | | | |`hipblasStpmv`|3.5.0| | | | |`rocblas_stpmv`|3.5.0| | | | |
|`cublasStpmv_v2_64`|12.0| | | |`hipblasStpmv_64`|6.2.0| | | | | | | | | | |
|`cublasStpmv_v2_64`|12.0| | | |`hipblasStpmv_64`|6.2.0| | | | |`rocblas_stpmv_64`|6.2.0| | | | |
|`cublasStpsv`| | | | |`hipblasStpsv`|3.5.0| | | | |`rocblas_stpsv`|3.5.0| | | | |
|`cublasStpsv_64`|12.0| | | |`hipblasStpsv_64`|6.2.0| | | | | | | | | | |
|`cublasStpsv_v2`| | | | |`hipblasStpsv`|3.5.0| | | | |`rocblas_stpsv`|3.5.0| | | | |
Expand Down Expand Up @@ -995,9 +995,9 @@
|`cublasZtbsv_v2`| | | | |`hipblasZtbsv_v2`|6.0.0| | | | |`rocblas_ztbsv`|3.5.0| | | | |
|`cublasZtbsv_v2_64`|12.0| | | |`hipblasZtbsv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasZtpmv`| | | | |`hipblasZtpmv_v2`|6.0.0| | | | |`rocblas_ztpmv`|3.5.0| | | | |
|`cublasZtpmv_64`|12.0| | | |`hipblasZtpmv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasZtpmv_64`|12.0| | | |`hipblasZtpmv_v2_64`|6.2.0| | | | |`rocblas_ztpmv_64`|6.2.0| | | | |
|`cublasZtpmv_v2`| | | | |`hipblasZtpmv_v2`|6.0.0| | | | |`rocblas_ztpmv`|3.5.0| | | | |
|`cublasZtpmv_v2_64`|12.0| | | |`hipblasZtpmv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasZtpmv_v2_64`|12.0| | | |`hipblasZtpmv_v2_64`|6.2.0| | | | |`rocblas_ztpmv_64`|6.2.0| | | | |
|`cublasZtpsv`| | | | |`hipblasZtpsv_v2`|6.0.0| | | | |`rocblas_ztpsv`|3.5.0| | | | |
|`cublasZtpsv_64`|12.0| | | |`hipblasZtpsv_v2_64`|6.2.0| | | | | | | | | | |
|`cublasZtpsv_v2`| | | | |`hipblasZtpsv_v2`|6.0.0| | | | |`rocblas_ztpsv`|3.5.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 @@ -787,9 +787,9 @@
|`cublasCtbsv_v2`| | | | |`rocblas_ctbsv`|3.5.0| | | | |
|`cublasCtbsv_v2_64`|12.0| | | | | | | | | |
|`cublasCtpmv`| | | | |`rocblas_ctpmv`|3.5.0| | | | |
|`cublasCtpmv_64`|12.0| | | | | | | | | |
|`cublasCtpmv_64`|12.0| | | |`rocblas_ctpmv_64`|6.2.0| | | | |
|`cublasCtpmv_v2`| | | | |`rocblas_ctpmv`|3.5.0| | | | |
|`cublasCtpmv_v2_64`|12.0| | | | | | | | | |
|`cublasCtpmv_v2_64`|12.0| | | |`rocblas_ctpmv_64`|6.2.0| | | | |
|`cublasCtpsv`| | | | |`rocblas_ctpsv`|3.5.0| | | | |
|`cublasCtpsv_64`|12.0| | | | | | | | | |
|`cublasCtpsv_v2`| | | | |`rocblas_ctpsv`|3.5.0| | | | |
Expand Down Expand Up @@ -851,9 +851,9 @@
|`cublasDtbsv_v2`| | | | |`rocblas_dtbsv`|3.5.0| | | | |
|`cublasDtbsv_v2_64`|12.0| | | | | | | | | |
|`cublasDtpmv`| | | | |`rocblas_dtpmv`|3.5.0| | | | |
|`cublasDtpmv_64`|12.0| | | | | | | | | |
|`cublasDtpmv_64`|12.0| | | |`rocblas_dtpmv_64`|6.2.0| | | | |
|`cublasDtpmv_v2`| | | | |`rocblas_dtpmv`|3.5.0| | | | |
|`cublasDtpmv_v2_64`|12.0| | | | | | | | | |
|`cublasDtpmv_v2_64`|12.0| | | |`rocblas_dtpmv_64`|6.2.0| | | | |
|`cublasDtpsv`| | | | |`rocblas_dtpsv`|3.5.0| | | | |
|`cublasDtpsv_64`|12.0| | | | | | | | | |
|`cublasDtpsv_v2`| | | | |`rocblas_dtpsv`|3.5.0| | | | |
Expand Down Expand Up @@ -915,9 +915,9 @@
|`cublasStbsv_v2`| | | | |`rocblas_stbsv`|3.5.0| | | | |
|`cublasStbsv_v2_64`|12.0| | | | | | | | | |
|`cublasStpmv`| | | | |`rocblas_stpmv`|3.5.0| | | | |
|`cublasStpmv_64`|12.0| | | | | | | | | |
|`cublasStpmv_64`|12.0| | | |`rocblas_stpmv_64`|6.2.0| | | | |
|`cublasStpmv_v2`| | | | |`rocblas_stpmv`|3.5.0| | | | |
|`cublasStpmv_v2_64`|12.0| | | | | | | | | |
|`cublasStpmv_v2_64`|12.0| | | |`rocblas_stpmv_64`|6.2.0| | | | |
|`cublasStpsv`| | | | |`rocblas_stpsv`|3.5.0| | | | |
|`cublasStpsv_64`|12.0| | | | | | | | | |
|`cublasStpsv_v2`| | | | |`rocblas_stpsv`|3.5.0| | | | |
Expand Down Expand Up @@ -995,9 +995,9 @@
|`cublasZtbsv_v2`| | | | |`rocblas_ztbsv`|3.5.0| | | | |
|`cublasZtbsv_v2_64`|12.0| | | | | | | | | |
|`cublasZtpmv`| | | | |`rocblas_ztpmv`|3.5.0| | | | |
|`cublasZtpmv_64`|12.0| | | | | | | | | |
|`cublasZtpmv_64`|12.0| | | |`rocblas_ztpmv_64`|6.2.0| | | | |
|`cublasZtpmv_v2`| | | | |`rocblas_ztpmv`|3.5.0| | | | |
|`cublasZtpmv_v2_64`|12.0| | | | | | | | | |
|`cublasZtpmv_v2_64`|12.0| | | |`rocblas_ztpmv_64`|6.2.0| | | | |
|`cublasZtpsv`| | | | |`rocblas_ztpsv`|3.5.0| | | | |
|`cublasZtpsv_64`|12.0| | | | | | | | | |
|`cublasZtpsv_v2`| | | | |`rocblas_ztpsv`|3.5.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 @@ -262,13 +262,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// TPMV
{"cublasStpmv", {"hipblasStpmv", "rocblas_stpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasStpmv_64", {"hipblasStpmv_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasStpmv_64", {"hipblasStpmv_64", "rocblas_stpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDtpmv", {"hipblasDtpmv", "rocblas_dtpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasDtpmv_64", {"hipblasDtpmv_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasDtpmv_64", {"hipblasDtpmv_64", "rocblas_dtpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasCtpmv", {"hipblasCtpmv_v2", "rocblas_ctpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasCtpmv_64", {"hipblasCtpmv_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasCtpmv_64", {"hipblasCtpmv_v2_64", "rocblas_ctpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZtpmv", {"hipblasZtpmv_v2", "rocblas_ztpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
{"cublasZtpmv_64", {"hipblasZtpmv_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasZtpmv_64", {"hipblasZtpmv_v2_64", "rocblas_ztpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},

// TRSV
{"cublasStrsv", {"hipblasStrsv", "rocblas_strsv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, HIP_SUPPORTED_V2_ONLY}},
Expand Down Expand Up @@ -680,13 +680,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// TPMV
{"cublasStpmv_v2", {"hipblasStpmv", "rocblas_stpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasStpmv_v2_64", {"hipblasStpmv_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasStpmv_v2_64", {"hipblasStpmv_64", "rocblas_stpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDtpmv_v2", {"hipblasDtpmv", "rocblas_dtpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasDtpmv_v2_64", {"hipblasDtpmv_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasDtpmv_v2_64", {"hipblasDtpmv_64", "rocblas_dtpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasCtpmv_v2", {"hipblasCtpmv_v2", "rocblas_ctpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasCtpmv_v2_64", {"hipblasCtpmv_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasCtpmv_v2_64", {"hipblasCtpmv_v2_64", "rocblas_ctpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZtpmv_v2", {"hipblasZtpmv_v2", "rocblas_ztpmv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
{"cublasZtpmv_v2_64", {"hipblasZtpmv_v2_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2, ROC_UNSUPPORTED}},
{"cublasZtpmv_v2_64", {"hipblasZtpmv_v2_64", "rocblas_ztpmv_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},

// TRSV
{"cublasStrsv_v2", {"hipblasStrsv", "rocblas_strsv", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_2}},
Expand Down Expand Up @@ -2377,6 +2377,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"rocblas_dtrmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_ctrmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_ztrmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_stpmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_dtpmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_ctpmv_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_ztpmv_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 c0a57bb

Please sign in to comment.