Skip to content

Commit

Permalink
[HIPIFY][6.0.0][hipBLAS] Support for ROCm HIP 6.0.0 - Step 19 - Funct…
Browse files Browse the repository at this point in the history
…ions

+ Updated synthetic tests, the regenerated hipify-perl, and docs

[The changed mapping]
`hipblasGemmStridedBatchedEx` -> `hipblasGemmStridedBatchedEx_v2`
`hipblasAxpyEx`               -> `hipblasAxpyEx_v2`
`hipblasDotEx`                -> `hipblasDotEx_v2`
`hipblasDotcEx`               -> `hipblasDotcEx_v2`
`hipblasNrm2Ex`               -> `hipblasNrm2Ex_v2`
`hipblasRotEx`                -> `hipblasRotEx_v2`
`hipblasScalEx`               -> `hipblasScalEx_v2`
  • Loading branch information
emankov committed Oct 22, 2023
1 parent e4de13b commit 90d8251
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 60 deletions.
14 changes: 7 additions & 7 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -2935,7 +2935,7 @@ sub simpleSubstitutions {
subst("make_cuComplex", "make_hipComplex", "complex");
subst("make_cuDoubleComplex", "make_hipDoubleComplex", "complex");
subst("make_cuFloatComplex", "make_hipFloatComplex", "complex");
subst("cublasAxpyEx", "hipblasAxpyEx", "library");
subst("cublasAxpyEx", "hipblasAxpyEx_v2", "library");
subst("cublasCaxpy", "hipblasCaxpy_v2", "library");
subst("cublasCaxpy_v2", "hipblasCaxpy_v2", "library");
subst("cublasCcopy", "hipblasCcopy_v2", "library");
Expand Down Expand Up @@ -3059,8 +3059,8 @@ sub simpleSubstitutions {
subst("cublasDgetrsBatched", "hipblasDgetrsBatched", "library");
subst("cublasDnrm2", "hipblasDnrm2", "library");
subst("cublasDnrm2_v2", "hipblasDnrm2", "library");
subst("cublasDotEx", "hipblasDotEx", "library");
subst("cublasDotcEx", "hipblasDotcEx", "library");
subst("cublasDotEx", "hipblasDotEx_v2", "library");
subst("cublasDotcEx", "hipblasDotcEx_v2", "library");
subst("cublasDrot", "hipblasDrot", "library");
subst("cublasDrot_v2", "hipblasDrot", "library");
subst("cublasDrotg", "hipblasDrotg", "library");
Expand Down Expand Up @@ -3117,7 +3117,7 @@ sub simpleSubstitutions {
subst("cublasDznrm2_v2", "hipblasDznrm2_v2", "library");
subst("cublasGemmBatchedEx", "hipblasGemmBatchedEx_v2", "library");
subst("cublasGemmEx", "hipblasGemmEx_v2", "library");
subst("cublasGemmStridedBatchedEx", "hipblasGemmStridedBatchedEx", "library");
subst("cublasGemmStridedBatchedEx", "hipblasGemmStridedBatchedEx_v2", "library");
subst("cublasGetAtomicsMode", "hipblasGetAtomicsMode", "library");
subst("cublasGetMatrix", "hipblasGetMatrix", "library");
subst("cublasGetMatrixAsync", "hipblasGetMatrixAsync", "library");
Expand Down Expand Up @@ -3146,13 +3146,13 @@ sub simpleSubstitutions {
subst("cublasIzamax_v2", "hipblasIzamax_v2", "library");
subst("cublasIzamin", "hipblasIzamin_v2", "library");
subst("cublasIzamin_v2", "hipblasIzamin_v2", "library");
subst("cublasNrm2Ex", "hipblasNrm2Ex", "library");
subst("cublasRotEx", "hipblasRotEx", "library");
subst("cublasNrm2Ex", "hipblasNrm2Ex_v2", "library");
subst("cublasRotEx", "hipblasRotEx_v2", "library");
subst("cublasSasum", "hipblasSasum", "library");
subst("cublasSasum_v2", "hipblasSasum", "library");
subst("cublasSaxpy", "hipblasSaxpy", "library");
subst("cublasSaxpy_v2", "hipblasSaxpy", "library");
subst("cublasScalEx", "hipblasScalEx", "library");
subst("cublasScalEx", "hipblasScalEx_v2", "library");
subst("cublasScasum", "hipblasScasum_v2", "library");
subst("cublasScasum_v2", "hipblasScasum_v2", "library");
subst("cublasScnrm2", "hipblasScnrm2_v2", "library");
Expand Down
14 changes: 7 additions & 7 deletions docs/tables/CUBLAS_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
|`cublasIzamin_64`|12.0| | | | | | | | |
|`cublasIzamin_v2`| | | |`hipblasIzamin_v2`|6.0.0| | | |6.0.0|
|`cublasIzamin_v2_64`|12.0| | | | | | | | |
|`cublasNrm2Ex`|8.0| | |`hipblasNrm2Ex`|4.1.0| | | | |
|`cublasNrm2Ex`|8.0| | |`hipblasNrm2Ex_v2`|6.0.0| | | |6.0.0|
|`cublasNrm2Ex_64`|12.0| | | | | | | | |
|`cublasSasum`| | | |`hipblasSasum`|1.8.2| | | | |
|`cublasSasum_64`|12.0| | | | | | | | |
Expand Down Expand Up @@ -910,7 +910,7 @@
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|
|`cublasAsumEx`|10.1| | | | | | | | |
|`cublasAsumEx_64`|12.0| | | | | | | | |
|`cublasAxpyEx`|8.0| | |`hipblasAxpyEx`|4.1.0| | | | |
|`cublasAxpyEx`|8.0| | |`hipblasAxpyEx_v2`|6.0.0| | | |6.0.0|
|`cublasAxpyEx_64`|12.0| | | | | | | | |
|`cublasCdgmm`| | | |`hipblasCdgmm_v2`|6.0.0| | | |6.0.0|
|`cublasCdgmm_64`|12.0| | | | | | | | |
Expand Down Expand Up @@ -948,9 +948,9 @@
|`cublasDgetriBatched`| | | |`hipblasDgetriBatched`|3.7.0| | | | |
|`cublasDgetrsBatched`| | | |`hipblasDgetrsBatched`|3.5.0| | | | |
|`cublasDmatinvBatched`| | | | | | | | | |
|`cublasDotEx`|8.0| | |`hipblasDotEx`|4.1.0| | | | |
|`cublasDotEx`|8.0| | |`hipblasDotEx_v2`|6.0.0| | | |6.0.0|
|`cublasDotEx_64`|12.0| | | | | | | | |
|`cublasDotcEx`|8.0| | |`hipblasDotcEx`|4.1.0| | | | |
|`cublasDotcEx`|8.0| | |`hipblasDotcEx_v2`|6.0.0| | | |6.0.0|
|`cublasDotcEx_64`|12.0| | | | | | | | |
|`cublasDtpttr`| | | | | | | | | |
|`cublasDtrsmBatched`| | | |`hipblasDtrsmBatched`|3.2.0| | | | |
Expand All @@ -960,19 +960,19 @@
|`cublasGemmBatchedEx_64`|12.0| | | | | | | | |
|`cublasGemmEx`|8.0| | |`hipblasGemmEx_v2`|6.0.0| | | |6.0.0|
|`cublasGemmEx_64`|12.0| | | | | | | | |
|`cublasGemmStridedBatchedEx`|9.1| | |`hipblasGemmStridedBatchedEx`|3.6.0| | | | |
|`cublasGemmStridedBatchedEx`|9.1| | |`hipblasGemmStridedBatchedEx_v2`|6.0.0| | | |6.0.0|
|`cublasGemmStridedBatchedEx_64`|12.0| | | | | | | | |
|`cublasIamaxEx`|10.1| | | | | | | | |
|`cublasIamaxEx_64`|12.0| | | | | | | | |
|`cublasIaminEx`|10.1| | | | | | | | |
|`cublasIaminEx_64`|12.0| | | | | | | | |
|`cublasRotEx`|10.1| | |`hipblasRotEx`|4.1.0| | | | |
|`cublasRotEx`|10.1| | |`hipblasRotEx_v2`|6.0.0| | | |6.0.0|
|`cublasRotEx_64`|12.0| | | | | | | | |
|`cublasRotgEx`|10.1| | | | | | | | |
|`cublasRotmEx`|10.1| | | | | | | | |
|`cublasRotmEx_64`|12.0| | | | | | | | |
|`cublasRotmgEx`|10.1| | | | | | | | |
|`cublasScalEx`|8.0| | |`hipblasScalEx`|4.1.0| | | | |
|`cublasScalEx`|8.0| | |`hipblasScalEx_v2`|6.0.0| | | |6.0.0|
|`cublasScalEx_64`|12.0| | | | | | | | |
|`cublasSdgmm`| | | |`hipblasSdgmm`|3.6.0| | | | |
|`cublasSdgmm_64`|12.0| | | | | | | | |
Expand Down
14 changes: 7 additions & 7 deletions docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
|`cublasIzamin_64`|12.0| | | | | | | | | | | | | | |
|`cublasIzamin_v2`| | | |`hipblasIzamin_v2`|6.0.0| | | |6.0.0|`rocblas_izamin`|3.5.0| | | | |
|`cublasIzamin_v2_64`|12.0| | | | | | | | | | | | | | |
|`cublasNrm2Ex`|8.0| | |`hipblasNrm2Ex`|4.1.0| | | | |`rocblas_nrm2_ex`|4.1.0| | | | |
|`cublasNrm2Ex`|8.0| | |`hipblasNrm2Ex_v2`|6.0.0| | | |6.0.0|`rocblas_nrm2_ex`|4.1.0| | | | |
|`cublasNrm2Ex_64`|12.0| | | | | | | | | | | | | | |
|`cublasSasum`| | | |`hipblasSasum`|1.8.2| | | | |`rocblas_sasum`|1.5.0| | | | |
|`cublasSasum_64`|12.0| | | | | | | | | | | | | | |
Expand Down Expand Up @@ -910,7 +910,7 @@
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|
|`cublasAsumEx`|10.1| | | | | | | | | | | | | | |
|`cublasAsumEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasAxpyEx`|8.0| | |`hipblasAxpyEx`|4.1.0| | | | |`rocblas_axpy_ex`|3.9.0| | | | |
|`cublasAxpyEx`|8.0| | |`hipblasAxpyEx_v2`|6.0.0| | | |6.0.0|`rocblas_axpy_ex`|3.9.0| | | | |
|`cublasAxpyEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasCdgmm`| | | |`hipblasCdgmm_v2`|6.0.0| | | |6.0.0|`rocblas_cdgmm`|3.5.0| | | | |
|`cublasCdgmm_64`|12.0| | | | | | | | | | | | | | |
Expand Down Expand Up @@ -948,9 +948,9 @@
|`cublasDgetriBatched`| | | |`hipblasDgetriBatched`|3.7.0| | | | | | | | | | |
|`cublasDgetrsBatched`| | | |`hipblasDgetrsBatched`|3.5.0| | | | | | | | | | |
|`cublasDmatinvBatched`| | | | | | | | | | | | | | | |
|`cublasDotEx`|8.0| | |`hipblasDotEx`|4.1.0| | | | |`rocblas_dot_ex`|4.1.0| | | | |
|`cublasDotEx`|8.0| | |`hipblasDotEx_v2`|6.0.0| | | |6.0.0|`rocblas_dot_ex`|4.1.0| | | | |
|`cublasDotEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasDotcEx`|8.0| | |`hipblasDotcEx`|4.1.0| | | | |`rocblas_dotc_ex`|4.1.0| | | | |
|`cublasDotcEx`|8.0| | |`hipblasDotcEx_v2`|6.0.0| | | |6.0.0|`rocblas_dotc_ex`|4.1.0| | | | |
|`cublasDotcEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasDtpttr`| | | | | | | | | | | | | | | |
|`cublasDtrsmBatched`| | | |`hipblasDtrsmBatched`|3.2.0| | | | |`rocblas_dtrsm_batched`|3.5.0| | | | |
Expand All @@ -960,19 +960,19 @@
|`cublasGemmBatchedEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasGemmEx`|8.0| | |`hipblasGemmEx_v2`|6.0.0| | | |6.0.0|`rocblas_gemm_ex`|1.8.2| | | | |
|`cublasGemmEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasGemmStridedBatchedEx`|9.1| | |`hipblasGemmStridedBatchedEx`|3.6.0| | | | |`rocblas_gemm_strided_batched_ex`|1.9.0| | | | |
|`cublasGemmStridedBatchedEx`|9.1| | |`hipblasGemmStridedBatchedEx_v2`|6.0.0| | | |6.0.0|`rocblas_gemm_strided_batched_ex`|1.9.0| | | | |
|`cublasGemmStridedBatchedEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasIamaxEx`|10.1| | | | | | | | | | | | | | |
|`cublasIamaxEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasIaminEx`|10.1| | | | | | | | | | | | | | |
|`cublasIaminEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasRotEx`|10.1| | |`hipblasRotEx`|4.1.0| | | | |`rocblas_rot_ex`|4.1.0| | | | |
|`cublasRotEx`|10.1| | |`hipblasRotEx_v2`|6.0.0| | | |6.0.0|`rocblas_rot_ex`|4.1.0| | | | |
|`cublasRotEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasRotgEx`|10.1| | | | | | | | | | | | | | |
|`cublasRotmEx`|10.1| | | | | | | | | | | | | | |
|`cublasRotmEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasRotmgEx`|10.1| | | | | | | | | | | | | | |
|`cublasScalEx`|8.0| | |`hipblasScalEx`|4.1.0| | | | |`rocblas_scal_ex`|4.0.0| | | | |
|`cublasScalEx`|8.0| | |`hipblasScalEx_v2`|6.0.0| | | |6.0.0|`rocblas_scal_ex`|4.0.0| | | | |
|`cublasScalEx_64`|12.0| | | | | | | | | | | | | | |
|`cublasSdgmm`| | | |`hipblasSdgmm`|3.6.0| | | | |`rocblas_sdgmm`|3.5.0| | | | |
|`cublasSdgmm_64`|12.0| | | | | | | | | | | | | | |
Expand Down
21 changes: 14 additions & 7 deletions src/CUDA2HIP_BLAS_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {
{"cublasScnrm2_64", {"hipblasScnrm2_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},
{"cublasDznrm2", {"hipblasDznrm2_v2", "rocblas_dznrm2", CONV_LIB_FUNC, API_BLAS, 5, HIP_SUPPORTED_V2_ONLY}},
{"cublasDznrm2_64", {"hipblasDznrm2_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},
{"cublasNrm2Ex", {"hipblasNrm2Ex", "rocblas_nrm2_ex", CONV_LIB_FUNC, API_BLAS, 5}},
{"cublasNrm2Ex", {"hipblasNrm2Ex_v2", "rocblas_nrm2_ex", CONV_LIB_FUNC, API_BLAS, 5}},
{"cublasNrm2Ex_64", {"hipblasNrm2Ex_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},

// DOT
Expand Down Expand Up @@ -830,7 +830,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {
{"cublasGemmEx_64", {"hipblasGemmEx_64", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},
{"cublasGemmBatchedEx", {"hipblasGemmBatchedEx_v2", "rocblas_gemm_batched_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasGemmBatchedEx_64", {"hipblasGemmBatchedEx_64", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},
{"cublasGemmStridedBatchedEx", {"hipblasGemmStridedBatchedEx", "rocblas_gemm_strided_batched_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasGemmStridedBatchedEx", {"hipblasGemmStridedBatchedEx_v2", "rocblas_gemm_strided_batched_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasGemmStridedBatchedEx_64", {"hipblasGemmStridedBatchedEx_64", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},
// IO in Int8 complex/cuComplex, computation in cuComplex
{"cublasCgemmEx", {"hipblasCgemmEx", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},
Expand Down Expand Up @@ -929,9 +929,9 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {
{"cublasDznrm2_v2_64", {"hipblasDznrm2_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},

// DOT
{"cublasDotEx", {"hipblasDotEx", "rocblas_dot_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasDotEx", {"hipblasDotEx_v2", "rocblas_dot_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasDotEx_64", {"hipblasDotEx_64", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},
{"cublasDotcEx", {"hipblasDotcEx", "rocblas_dotc_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasDotcEx", {"hipblasDotcEx_v2", "rocblas_dotc_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasDotcEx_64", {"hipblasDotcEx_64", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},

{"cublasSdot_v2", {"hipblasSdot", "rocblas_sdot", CONV_LIB_FUNC, API_BLAS, 5}},
Expand All @@ -949,7 +949,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {
{"cublasZdotc_v2_64", {"hipblasZdotc_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},

// SCAL
{"cublasScalEx", {"hipblasScalEx", "rocblas_scal_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasScalEx", {"hipblasScalEx_v2", "rocblas_scal_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasScalEx_64", {"hipblasScalEx_64", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},
{"cublasSscal_v2", {"hipblasSscal", "rocblas_sscal", CONV_LIB_FUNC, API_BLAS, 5}},
{"cublasSscal_v2_64", {"hipblasSscal_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},
Expand All @@ -965,7 +965,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {
{"cublasZdscal_v2_64", {"hipblasZdscal_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},

// AXPY
{"cublasAxpyEx", {"hipblasAxpyEx", "rocblas_axpy_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasAxpyEx", {"hipblasAxpyEx_v2", "rocblas_axpy_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasAxpyEx_64", {"hipblasAxpyEx_64", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},
{"cublasSaxpy_v2", {"hipblasSaxpy", "rocblas_saxpy", CONV_LIB_FUNC, API_BLAS, 5}},
{"cublasSaxpy_v2_64", {"hipblasSaxpy_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},
Expand Down Expand Up @@ -1037,7 +1037,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {
{"cublasDzasum_v2_64", {"hipblasDzasum_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},

// ROT
{"cublasRotEx", {"hipblasRotEx", "rocblas_rot_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasRotEx", {"hipblasRotEx_v2", "rocblas_rot_ex", CONV_LIB_FUNC, API_BLAS, 8}},
{"cublasRotEx_64", {"hipblasRotEx_64", "", CONV_LIB_FUNC, API_BLAS, 8, UNSUPPORTED}},
{"cublasSrot_v2", {"hipblasSrot", "rocblas_srot", CONV_LIB_FUNC, API_BLAS, 5}},
{"cublasSrot_v2_64", {"hipblasSrot_64", "", CONV_LIB_FUNC, API_BLAS, 5, UNSUPPORTED}},
Expand Down Expand Up @@ -1862,6 +1862,13 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"hipblasZgeqrfBatched_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasGemmEx_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasGemmBatchedEx_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasGemmStridedBatchedEx_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasAxpyEx_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasDotEx_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasDotcEx_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasNrm2Ex_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasRotEx_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasScalEx_v2", {HIP_6000, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_status_to_string", {HIP_3050, HIP_0, HIP_0 }},
{"rocblas_sscal", {HIP_1050, HIP_0, HIP_0 }},
{"rocblas_dscal", {HIP_1050, HIP_0, HIP_0 }},
Expand Down
Loading

0 comments on commit 90d8251

Please sign in to comment.