Skip to content

Commit

Permalink
Merge pull request #1749 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][6.3.0][BLAS][fix] Sync with `hipBLAS` and `rocBLAS` - Step 16 - final for `hipBLAS`
  • Loading branch information
emankov authored Nov 12, 2024
2 parents fbd55d4 + b46b461 commit 192f683
Show file tree
Hide file tree
Showing 9 changed files with 512 additions and 433 deletions.
6 changes: 3 additions & 3 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -4719,8 +4719,11 @@ sub simpleSubstitutions {
subst("cublasDznrm2_v2", "hipblasDznrm2_v2", "library");
subst("cublasDznrm2_v2_64", "hipblasDznrm2_v2_64", "library");
subst("cublasGemmBatchedEx", "hipblasGemmBatchedEx_v2", "library");
subst("cublasGemmBatchedEx_64", "hipblasGemmBatchedEx_v2_64", "library");
subst("cublasGemmEx", "hipblasGemmEx_v2", "library");
subst("cublasGemmEx_64", "hipblasGemmEx_v2_64", "library");
subst("cublasGemmStridedBatchedEx", "hipblasGemmStridedBatchedEx_v2", "library");
subst("cublasGemmStridedBatchedEx_64", "hipblasGemmStridedBatchedEx_v2_64", "library");
subst("cublasGetAtomicsMode", "hipblasGetAtomicsMode", "library");
subst("cublasGetMathMode", "hipblasGetMathMode", "library");
subst("cublasGetMatrix", "hipblasGetMatrix", "library");
Expand Down Expand Up @@ -11771,11 +11774,8 @@ sub warnHipOnlyUnsupportedFunctions {
"cublasGetLoggerCallback",
"cublasGetError",
"cublasGetCudartVersion",
"cublasGemmStridedBatchedEx_64",
"cublasGemmGroupedBatchedEx_64",
"cublasGemmGroupedBatchedEx",
"cublasGemmEx_64",
"cublasGemmBatchedEx_64",
"cublasFree",
"cublasDtrttp",
"cublasDtpttr",
Expand Down
12 changes: 6 additions & 6 deletions docs/tables/CUBLAS_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -1868,12 +1868,12 @@
|`cublasDtrsmBatched`| | | | |`hipblasDtrsmBatched`|3.2.0| | | | |
|`cublasDtrsmBatched_64`|12.0| | | |`hipblasDtrsmBatched_64`|6.3.0| | | |6.3.0|
|`cublasDtrttp`| | | | | | | | | | |
|`cublasGemmBatchedEx`|9.1| | | |`hipblasGemmBatchedEx_v2`|6.0.0| | | | |
|`cublasGemmBatchedEx_64`|12.0| | | | | | | | | |
|`cublasGemmEx`|8.0| | | |`hipblasGemmEx_v2`|6.0.0| | | | |
|`cublasGemmEx_64`|12.0| | | | | | | | | |
|`cublasGemmStridedBatchedEx`|9.1| | | |`hipblasGemmStridedBatchedEx_v2`|6.0.0| | | | |
|`cublasGemmStridedBatchedEx_64`|12.0| | | | | | | | | |
|`cublasGemmBatchedEx`|9.1| |11.0| |`hipblasGemmBatchedEx_v2`|6.0.0| | | | |
|`cublasGemmBatchedEx_64`|12.0| | | |`hipblasGemmBatchedEx_v2_64`|6.3.0| | | |6.3.0|
|`cublasGemmEx`|8.0| |11.0| |`hipblasGemmEx_v2`|6.0.0| | | | |
|`cublasGemmEx_64`|12.0| | | |`hipblasGemmEx_v2_64`|6.3.0| | | |6.3.0|
|`cublasGemmStridedBatchedEx`|9.1| |11.0| |`hipblasGemmStridedBatchedEx_v2`|6.0.0| | | | |
|`cublasGemmStridedBatchedEx_64`|12.0| | | |`hipblasGemmStridedBatchedEx_v2_64`|6.3.0| | | |6.3.0|
|`cublasIamaxEx`|10.1| | | | | | | | | |
|`cublasIamaxEx_64`|12.0| | | | | | | | | |
|`cublasIaminEx`|10.1| | | | | | | | | |
Expand Down
12 changes: 6 additions & 6 deletions docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -1868,12 +1868,12 @@
|`cublasDtrsmBatched`| | | | |`hipblasDtrsmBatched`|3.2.0| | | | |`rocblas_dtrsm_batched`|3.5.0| | | | |
|`cublasDtrsmBatched_64`|12.0| | | |`hipblasDtrsmBatched_64`|6.3.0| | | |6.3.0|`rocblas_dtrsm_batched_64`|6.2.0| | | | |
|`cublasDtrttp`| | | | | | | | | | | | | | | | |
|`cublasGemmBatchedEx`|9.1| | | |`hipblasGemmBatchedEx_v2`|6.0.0| | | | |`rocblas_gemm_batched_ex`|3.5.0| | | | |
|`cublasGemmBatchedEx_64`|12.0| | | | | | | | | | | | | | | |
|`cublasGemmEx`|8.0| | | |`hipblasGemmEx_v2`|6.0.0| | | | |`rocblas_gemm_ex`|1.8.2| | | | |
|`cublasGemmEx_64`|12.0| | | | | | | | | | | | | | | |
|`cublasGemmStridedBatchedEx`|9.1| | | |`hipblasGemmStridedBatchedEx_v2`|6.0.0| | | | |`rocblas_gemm_strided_batched_ex`|1.9.0| | | | |
|`cublasGemmStridedBatchedEx_64`|12.0| | | | | | | | | | | | | | | |
|`cublasGemmBatchedEx`|9.1| |11.0| |`hipblasGemmBatchedEx_v2`|6.0.0| | | | |`rocblas_gemm_batched_ex`|3.5.0| | | | |
|`cublasGemmBatchedEx_64`|12.0| | | |`hipblasGemmBatchedEx_v2_64`|6.3.0| | | |6.3.0| | | | | | |
|`cublasGemmEx`|8.0| |11.0| |`hipblasGemmEx_v2`|6.0.0| | | | |`rocblas_gemm_ex`|1.8.2| | | | |
|`cublasGemmEx_64`|12.0| | | |`hipblasGemmEx_v2_64`|6.3.0| | | |6.3.0| | | | | | |
|`cublasGemmStridedBatchedEx`|9.1| |11.0| |`hipblasGemmStridedBatchedEx_v2`|6.0.0| | | | |`rocblas_gemm_strided_batched_ex`|1.9.0| | | | |
|`cublasGemmStridedBatchedEx_64`|12.0| | | |`hipblasGemmStridedBatchedEx_v2_64`|6.3.0| | | |6.3.0| | | | | | |
|`cublasIamaxEx`|10.1| | | | | | | | | | | | | | | |
|`cublasIamaxEx_64`|12.0| | | | | | | | | | | | | | | |
|`cublasIaminEx`|10.1| | | | | | | | | | | | | | | |
Expand Down
6 changes: 3 additions & 3 deletions docs/tables/CUBLAS_API_supported_by_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -1868,11 +1868,11 @@
|`cublasDtrsmBatched`| | | | |`rocblas_dtrsm_batched`|3.5.0| | | | |
|`cublasDtrsmBatched_64`|12.0| | | |`rocblas_dtrsm_batched_64`|6.2.0| | | | |
|`cublasDtrttp`| | | | | | | | | | |
|`cublasGemmBatchedEx`|9.1| | | |`rocblas_gemm_batched_ex`|3.5.0| | | | |
|`cublasGemmBatchedEx`|9.1| |11.0| |`rocblas_gemm_batched_ex`|3.5.0| | | | |
|`cublasGemmBatchedEx_64`|12.0| | | | | | | | | |
|`cublasGemmEx`|8.0| | | |`rocblas_gemm_ex`|1.8.2| | | | |
|`cublasGemmEx`|8.0| |11.0| |`rocblas_gemm_ex`|1.8.2| | | | |
|`cublasGemmEx_64`|12.0| | | | | | | | | |
|`cublasGemmStridedBatchedEx`|9.1| | | |`rocblas_gemm_strided_batched_ex`|1.9.0| | | | |
|`cublasGemmStridedBatchedEx`|9.1| |11.0| |`rocblas_gemm_strided_batched_ex`|1.9.0| | | | |
|`cublasGemmStridedBatchedEx_64`|12.0| | | | | | | | | |
|`cublasIamaxEx`|10.1| | | | | | | | | |
|`cublasIamaxEx_64`|12.0| | | | | | | | | |
Expand Down
15 changes: 12 additions & 3 deletions src/CUDA2HIP_BLAS_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,11 +835,11 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {
{"cublasSgemmEx", {"hipblasSgemmEx", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasSgemmEx_64", {"hipblasSgemmEx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasGemmEx", {"hipblasGemmEx_v2", "rocblas_gemm_ex", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasGemmEx_64", {"hipblasGemmEx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasGemmEx_64", {"hipblasGemmEx_v2_64", "rocblas_gemm_ex_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, ROC_UNSUPPORTED}},
{"cublasGemmBatchedEx", {"hipblasGemmBatchedEx_v2", "rocblas_gemm_batched_ex", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasGemmBatchedEx_64", {"hipblasGemmBatchedEx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasGemmBatchedEx_64", {"hipblasGemmBatchedEx_v2_64", "rocblas_gemm_batched_ex_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, ROC_UNSUPPORTED}},
{"cublasGemmStridedBatchedEx", {"hipblasGemmStridedBatchedEx_v2", "rocblas_gemm_strided_batched_ex", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasGemmStridedBatchedEx_64", {"hipblasGemmStridedBatchedEx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasGemmStridedBatchedEx_64", {"hipblasGemmStridedBatchedEx_v2_64", "rocblas_gemm_strided_batched_ex_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, ROC_UNSUPPORTED}},
// IO in Int8 complex/cuComplex, computation in cuComplex
{"cublasCgemmEx", {"hipblasCgemmEx", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasCgemmEx_64", {"hipblasCgemmEx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
Expand Down Expand Up @@ -2082,6 +2082,9 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"hipblasDdgmm_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasCdgmm_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasZdgmm_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasGemmEx_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasGemmBatchedEx_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasGemmStridedBatchedEx_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},

{"rocblas_status_to_string", {HIP_3050, HIP_0, HIP_0 }},
{"rocblas_sscal", {HIP_1050, HIP_0, HIP_0 }},
Expand Down Expand Up @@ -2521,6 +2524,9 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"rocblas_ddgmm_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_cdgmm_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_zdgmm_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_gemm_ex_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_gemm_batched_ex_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_gemm_strided_batched_ex_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
};

const std::map<llvm::StringRef, hipAPIChangedVersions> HIP_BLAS_FUNCTION_CHANGED_VER_MAP {
Expand All @@ -2534,6 +2540,9 @@ const std::map<llvm::StringRef, hipAPIChangedVersions> HIP_BLAS_FUNCTION_CHANGED

const std::map<llvm::StringRef, cudaAPIChangedVersions> CUDA_BLAS_FUNCTION_CHANGED_VER_MAP {
{"cublasLtMatmulDescCreate", {CUDA_110}},
{"cublasGemmEx", {CUDA_110}},
{"cublasGemmBatchedEx", {CUDA_110}},
{"cublasGemmStridedBatchedEx", {CUDA_110}},
};

const std::map<unsigned int, llvm::StringRef> CUDA_BLAS_API_SECTION_MAP {
Expand Down
Loading

0 comments on commit 192f683

Please sign in to comment.