Skip to content

Commit

Permalink
Merge pull request #1703 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][rocBLAS] 64-bit functions support - Step 19
  • Loading branch information
emankov authored Oct 13, 2024
2 parents f630919 + 8719384 commit 1c16c89
Show file tree
Hide file tree
Showing 5 changed files with 65 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 @@ -1714,7 +1714,9 @@ sub rocSubstitutions {
subst("cublasCtrmv_v2_64", "rocblas_ctrmv_64", "library");
subst("cublasCtrsm", "rocblas_ctrsm", "library");
subst("cublasCtrsmBatched", "rocblas_ctrsm_batched", "library");
subst("cublasCtrsm_64", "rocblas_ctrsm_64", "library");
subst("cublasCtrsm_v2", "rocblas_ctrsm", "library");
subst("cublasCtrsm_v2_64", "rocblas_ctrsm_64", "library");
subst("cublasCtrsv", "rocblas_ctrsv", "library");
subst("cublasCtrsv_64", "rocblas_ctrsv_64", "library");
subst("cublasCtrsv_v2", "rocblas_ctrsv", "library");
Expand Down Expand Up @@ -1846,7 +1848,9 @@ sub rocSubstitutions {
subst("cublasDtrmv_v2_64", "rocblas_dtrmv_64", "library");
subst("cublasDtrsm", "rocblas_dtrsm", "library");
subst("cublasDtrsmBatched", "rocblas_dtrsm_batched", "library");
subst("cublasDtrsm_64", "rocblas_dtrsm_64", "library");
subst("cublasDtrsm_v2", "rocblas_dtrsm", "library");
subst("cublasDtrsm_v2_64", "rocblas_dtrsm_64", "library");
subst("cublasDtrsv", "rocblas_dtrsv", "library");
subst("cublasDtrsv_64", "rocblas_dtrsv_64", "library");
subst("cublasDtrsv_v2", "rocblas_dtrsv", "library");
Expand Down Expand Up @@ -2062,7 +2066,9 @@ sub rocSubstitutions {
subst("cublasStrmv_v2_64", "rocblas_strmv_64", "library");
subst("cublasStrsm", "rocblas_strsm", "library");
subst("cublasStrsmBatched", "rocblas_strsm_batched", "library");
subst("cublasStrsm_64", "rocblas_strsm_64", "library");
subst("cublasStrsm_v2", "rocblas_strsm", "library");
subst("cublasStrsm_v2_64", "rocblas_strsm_64", "library");
subst("cublasStrsv", "rocblas_strsv", "library");
subst("cublasStrsv_64", "rocblas_strsv_64", "library");
subst("cublasStrsv_v2", "rocblas_strsv", "library");
Expand Down Expand Up @@ -2217,7 +2223,9 @@ sub rocSubstitutions {
subst("cublasZtrmv_v2_64", "rocblas_ztrmv_64", "library");
subst("cublasZtrsm", "rocblas_ztrsm", "library");
subst("cublasZtrsmBatched", "rocblas_ztrsm_batched", "library");
subst("cublasZtrsm_64", "rocblas_ztrsm_64", "library");
subst("cublasZtrsm_v2", "rocblas_ztrsm", "library");
subst("cublasZtrsm_v2_64", "rocblas_ztrsm_64", "library");
subst("cublasZtrsv", "rocblas_ztrsv", "library");
subst("cublasZtrsv_64", "rocblas_ztrsv_64", "library");
subst("cublasZtrsv_v2", "rocblas_ztrsv", "library");
Expand Down Expand Up @@ -12675,8 +12683,6 @@ sub warnRocOnlyUnsupportedFunctions {
my $k = 0;
foreach $func (
"cublasZtrttp",
"cublasZtrsm_v2_64",
"cublasZtrsm_64",
"cublasZtrsmBatched_64",
"cublasZtrmm_v2_64",
"cublasZtrmm_64",
Expand Down Expand Up @@ -12714,8 +12720,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasSwapEx_64",
"cublasSwapEx",
"cublasStrttp",
"cublasStrsm_v2_64",
"cublasStrsm_64",
"cublasStrsmBatched_64",
"cublasStrmm_v2_64",
"cublasStrmm_64",
Expand Down Expand Up @@ -12847,8 +12851,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasGemmBatchedEx_64",
"cublasFree",
"cublasDtrttp",
"cublasDtrsm_v2_64",
"cublasDtrsm_64",
"cublasDtrsmBatched_64",
"cublasDtrmm_v2_64",
"cublasDtrmm_64",
Expand All @@ -12875,8 +12877,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasDgeam_64",
"cublasDdgmm_64",
"cublasCtrttp",
"cublasCtrsm_v2_64",
"cublasCtrsm_64",
"cublasCtrsmBatched_64",
"cublasCtrmm_v2_64",
"cublasCtrmm_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 @@ -1068,9 +1068,9 @@
|`cublasCtrmm_v2`| | | | |`hipblasCtrmm_v2`|6.0.0| | | | |`rocblas_ctrmm`|3.5.0| |6.0.0| | |
|`cublasCtrmm_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCtrsm`| | | | |`hipblasCtrsm_v2`|6.0.0| | | | |`rocblas_ctrsm`|3.5.0| | | | |
|`cublasCtrsm_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCtrsm_64`|12.0| | | | | | | | | |`rocblas_ctrsm_64`|6.2.0| | | | |
|`cublasCtrsm_v2`| | | | |`hipblasCtrsm_v2`|6.0.0| | | | |`rocblas_ctrsm`|3.5.0| | | | |
|`cublasCtrsm_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCtrsm_v2_64`|12.0| | | | | | | | | |`rocblas_ctrsm_64`|6.2.0| | | | |
|`cublasDgemm`| | | | |`hipblasDgemm`|1.8.2| | | | |`rocblas_dgemm`|1.5.0| | | | |
|`cublasDgemmBatched`| | | | |`hipblasDgemmBatched`|1.8.2| | | | |`rocblas_dgemm_batched`|3.5.0| | | | |
|`cublasDgemmBatched_64`|12.0| | | | | | | | | | | | | | | |
Expand Down Expand Up @@ -1104,9 +1104,9 @@
|`cublasDtrmm_v2`| | | | |`hipblasDtrmm`|3.2.0| |6.0.0| | |`rocblas_dtrmm`|3.5.0| |6.0.0| | |
|`cublasDtrmm_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasDtrsm`| | | | |`hipblasDtrsm`|1.8.2| | | | |`rocblas_dtrsm`|1.5.0| | | | |
|`cublasDtrsm_64`|12.0| | | | | | | | | | | | | | | |
|`cublasDtrsm_64`|12.0| | | | | | | | | |`rocblas_dtrsm_64`|6.2.0| | | | |
|`cublasDtrsm_v2`| | | | |`hipblasDtrsm`|1.8.2| | | | |`rocblas_dtrsm`|1.5.0| | | | |
|`cublasDtrsm_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasDtrsm_v2_64`|12.0| | | | | | | | | |`rocblas_dtrsm_64`|6.2.0| | | | |
|`cublasGemmGroupedBatchedEx`|12.5| | | | | | | | | | | | | | | |
|`cublasGemmGroupedBatchedEx_64`|12.5| | | | | | | | | | | | | | | |
|`cublasHSHgemvBatched`|11.6| | | | | | | | | |`rocblas_hshgemv_batched`|6.0.0| | | | |
Expand Down Expand Up @@ -1156,9 +1156,9 @@
|`cublasStrmm_v2`| | | | |`hipblasStrmm`|3.2.0| |6.0.0| | |`rocblas_strmm`|3.5.0| |6.0.0| | |
|`cublasStrmm_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasStrsm`| | | | |`hipblasStrsm`|1.8.2| | | | |`rocblas_strsm`|1.5.0| | | | |
|`cublasStrsm_64`|12.0| | | | | | | | | | | | | | | |
|`cublasStrsm_64`|12.0| | | | | | | | | |`rocblas_strsm_64`|6.2.0| | | | |
|`cublasStrsm_v2`| | | | |`hipblasStrsm`|1.8.2| | | | |`rocblas_strsm`|1.5.0| | | | |
|`cublasStrsm_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasStrsm_v2_64`|12.0| | | | | | | | | |`rocblas_strsm_64`|6.2.0| | | | |
|`cublasTSSgemvBatched`|11.6| | | | | | | | | |`rocblas_tssgemv_batched`|6.0.0| | | | |
|`cublasTSSgemvBatched_64`|12.0| | | | | | | | | |`rocblas_tssgemv_batched_64`|6.2.0| | | | |
|`cublasTSSgemvStridedBatched`|11.6| | | | | | | | | |`rocblas_tssgemv_strided_batched`|6.0.0| | | | |
Expand Down Expand Up @@ -1214,9 +1214,9 @@
|`cublasZtrmm_v2`| | | | |`hipblasZtrmm_v2`|6.0.0| | | | |`rocblas_ztrmm`|3.5.0| |6.0.0| | |
|`cublasZtrmm_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasZtrsm`| | | | |`hipblasZtrsm_v2`|6.0.0| | | | |`rocblas_ztrsm`|3.5.0| | | | |
|`cublasZtrsm_64`|12.0| | | | | | | | | | | | | | | |
|`cublasZtrsm_64`|12.0| | | | | | | | | |`rocblas_ztrsm_64`|6.2.0| | | | |
|`cublasZtrsm_v2`| | | | |`hipblasZtrsm_v2`|6.0.0| | | | |`rocblas_ztrsm`|3.5.0| | | | |
|`cublasZtrsm_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasZtrsm_v2_64`|12.0| | | | | | | | | |`rocblas_ztrsm_64`|6.2.0| | | | |

## **8. BLAS-like Extension**

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 @@ -1068,9 +1068,9 @@
|`cublasCtrmm_v2`| | | | |`rocblas_ctrmm`|3.5.0| |6.0.0| | |
|`cublasCtrmm_v2_64`|12.0| | | | | | | | | |
|`cublasCtrsm`| | | | |`rocblas_ctrsm`|3.5.0| | | | |
|`cublasCtrsm_64`|12.0| | | | | | | | | |
|`cublasCtrsm_64`|12.0| | | |`rocblas_ctrsm_64`|6.2.0| | | | |
|`cublasCtrsm_v2`| | | | |`rocblas_ctrsm`|3.5.0| | | | |
|`cublasCtrsm_v2_64`|12.0| | | | | | | | | |
|`cublasCtrsm_v2_64`|12.0| | | |`rocblas_ctrsm_64`|6.2.0| | | | |
|`cublasDgemm`| | | | |`rocblas_dgemm`|1.5.0| | | | |
|`cublasDgemmBatched`| | | | |`rocblas_dgemm_batched`|3.5.0| | | | |
|`cublasDgemmBatched_64`|12.0| | | | | | | | | |
Expand Down Expand Up @@ -1104,9 +1104,9 @@
|`cublasDtrmm_v2`| | | | |`rocblas_dtrmm`|3.5.0| |6.0.0| | |
|`cublasDtrmm_v2_64`|12.0| | | | | | | | | |
|`cublasDtrsm`| | | | |`rocblas_dtrsm`|1.5.0| | | | |
|`cublasDtrsm_64`|12.0| | | | | | | | | |
|`cublasDtrsm_64`|12.0| | | |`rocblas_dtrsm_64`|6.2.0| | | | |
|`cublasDtrsm_v2`| | | | |`rocblas_dtrsm`|1.5.0| | | | |
|`cublasDtrsm_v2_64`|12.0| | | | | | | | | |
|`cublasDtrsm_v2_64`|12.0| | | |`rocblas_dtrsm_64`|6.2.0| | | | |
|`cublasGemmGroupedBatchedEx`|12.5| | | | | | | | | |
|`cublasGemmGroupedBatchedEx_64`|12.5| | | | | | | | | |
|`cublasHSHgemvBatched`|11.6| | | |`rocblas_hshgemv_batched`|6.0.0| | | | |
Expand Down Expand Up @@ -1156,9 +1156,9 @@
|`cublasStrmm_v2`| | | | |`rocblas_strmm`|3.5.0| |6.0.0| | |
|`cublasStrmm_v2_64`|12.0| | | | | | | | | |
|`cublasStrsm`| | | | |`rocblas_strsm`|1.5.0| | | | |
|`cublasStrsm_64`|12.0| | | | | | | | | |
|`cublasStrsm_64`|12.0| | | |`rocblas_strsm_64`|6.2.0| | | | |
|`cublasStrsm_v2`| | | | |`rocblas_strsm`|1.5.0| | | | |
|`cublasStrsm_v2_64`|12.0| | | | | | | | | |
|`cublasStrsm_v2_64`|12.0| | | |`rocblas_strsm_64`|6.2.0| | | | |
|`cublasTSSgemvBatched`|11.6| | | |`rocblas_tssgemv_batched`|6.0.0| | | | |
|`cublasTSSgemvBatched_64`|12.0| | | |`rocblas_tssgemv_batched_64`|6.2.0| | | | |
|`cublasTSSgemvStridedBatched`|11.6| | | |`rocblas_tssgemv_strided_batched`|6.0.0| | | | |
Expand Down Expand Up @@ -1214,9 +1214,9 @@
|`cublasZtrmm_v2`| | | | |`rocblas_ztrmm`|3.5.0| |6.0.0| | |
|`cublasZtrmm_v2_64`|12.0| | | | | | | | | |
|`cublasZtrsm`| | | | |`rocblas_ztrsm`|3.5.0| | | | |
|`cublasZtrsm_64`|12.0| | | | | | | | | |
|`cublasZtrsm_64`|12.0| | | |`rocblas_ztrsm_64`|6.2.0| | | | |
|`cublasZtrsm_v2`| | | | |`rocblas_ztrsm`|3.5.0| | | | |
|`cublasZtrsm_v2_64`|12.0| | | | | | | | | |
|`cublasZtrsm_v2_64`|12.0| | | |`rocblas_ztrsm_64`|6.2.0| | | | |

## **8. BLAS-like Extension**

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 @@ -541,13 +541,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// TRSM
{"cublasStrsm", {"hipblasStrsm", "rocblas_strsm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
{"cublasStrsm_64", {"hipblasStrsm_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasStrsm_64", {"hipblasStrsm_64", "rocblas_strsm_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_UNSUPPORTED}},
{"cublasDtrsm", {"hipblasDtrsm", "rocblas_dtrsm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
{"cublasDtrsm_64", {"hipblasDtrsm_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasDtrsm_64", {"hipblasDtrsm_64", "rocblas_dtrsm_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_UNSUPPORTED}},
{"cublasCtrsm", {"hipblasCtrsm_v2", "rocblas_ctrsm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
{"cublasCtrsm_64", {"hipblasCtrsm_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasCtrsm_64", {"hipblasCtrsm_64", "rocblas_ctrsm_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_UNSUPPORTED}},
{"cublasZtrsm", {"hipblasZtrsm_v2", "rocblas_ztrsm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
{"cublasZtrsm_64", {"hipblasZtrsm_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasZtrsm_64", {"hipblasZtrsm_64", "rocblas_ztrsm_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_UNSUPPORTED}},

// TRMM
{"cublasStrmm", {"hipblasStrmm", "rocblas_strmm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
Expand Down Expand Up @@ -908,13 +908,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// TRSM
{"cublasStrsm_v2", {"hipblasStrsm", "rocblas_strsm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasStrsm_v2_64", {"hipblasStrsm_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasStrsm_v2_64", {"hipblasStrsm_64", "rocblas_strsm_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_UNSUPPORTED}},
{"cublasDtrsm_v2", {"hipblasDtrsm", "rocblas_dtrsm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasDtrsm_v2_64", {"hipblasDtrsm_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasDtrsm_v2_64", {"hipblasDtrsm_64", "rocblas_dtrsm_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_UNSUPPORTED}},
{"cublasCtrsm_v2", {"hipblasCtrsm_v2", "rocblas_ctrsm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasCtrsm_v2_64", {"hipblasCtrsm_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasCtrsm_v2_64", {"hipblasCtrsm_64", "rocblas_ctrsm_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_UNSUPPORTED}},
{"cublasZtrsm_v2", {"hipblasZtrsm_v2", "rocblas_ztrsm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasZtrsm_v2_64", {"hipblasZtrsm_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasZtrsm_v2_64", {"hipblasZtrsm_64", "rocblas_ztrsm_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_UNSUPPORTED}},

// TRMM
{"cublasStrmm_v2", {"hipblasStrmm", "rocblas_strmm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
Expand Down Expand Up @@ -2403,6 +2403,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"rocblas_zgeru_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_cgerc_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_zgerc_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_strsm_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_dtrsm_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_ctrsm_64", {HIP_6020, HIP_0, HIP_0 }},
{"rocblas_ztrsm_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 1c16c89

Please sign in to comment.