Skip to content

Commit

Permalink
Merge pull request #1719 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][6.3.0][BLAS] Sync with `hipBLAS` and `rocBLAS` - Step 4
  • Loading branch information
emankov authored Oct 23, 2024
2 parents fd763b3 + d63588e commit eb08f08
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 36 deletions.
24 changes: 12 additions & 12 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -1647,8 +1647,11 @@ sub rocSubstitutions {
subst("cublasCher_v2", "rocblas_cher", "library");
subst("cublasCher_v2_64", "rocblas_cher_64", "library");
subst("cublasCherk", "rocblas_cherk", "library");
subst("cublasCherk_64", "rocblas_cherk_64", "library");
subst("cublasCherk_v2", "rocblas_cherk", "library");
subst("cublasCherk_v2_64", "rocblas_cherk_64", "library");
subst("cublasCherkx", "rocblas_cherkx", "library");
subst("cublasCherkx_64", "rocblas_cherkx_64", "library");
subst("cublasChpmv", "rocblas_chpmv", "library");
subst("cublasChpmv_64", "rocblas_chpmv_64", "library");
subst("cublasChpmv_v2", "rocblas_chpmv", "library");
Expand Down Expand Up @@ -2184,8 +2187,11 @@ sub rocSubstitutions {
subst("cublasZher_v2", "rocblas_zher", "library");
subst("cublasZher_v2_64", "rocblas_zher_64", "library");
subst("cublasZherk", "rocblas_zherk", "library");
subst("cublasZherk_64", "rocblas_zherk_64", "library");
subst("cublasZherk_v2", "rocblas_zherk", "library");
subst("cublasZherk_v2_64", "rocblas_zherk_64", "library");
subst("cublasZherkx", "rocblas_zherkx", "library");
subst("cublasZherkx_64", "rocblas_zherkx_64", "library");
subst("cublasZhpmv", "rocblas_zhpmv", "library");
subst("cublasZhpmv_64", "rocblas_zhpmv_64", "library");
subst("cublasZhpmv_v2", "rocblas_zhpmv", "library");
Expand Down Expand Up @@ -4391,8 +4397,11 @@ sub simpleSubstitutions {
subst("cublasCher_v2", "hipblasCher_v2", "library");
subst("cublasCher_v2_64", "hipblasCher_v2_64", "library");
subst("cublasCherk", "hipblasCherk_v2", "library");
subst("cublasCherk_64", "hipblasCherk_v2_64", "library");
subst("cublasCherk_v2", "hipblasCherk_v2", "library");
subst("cublasCherk_v2_64", "hipblasCherk_v2_64", "library");
subst("cublasCherkx", "hipblasCherkx_v2", "library");
subst("cublasCherkx_64", "hipblasCherkx_v2_64", "library");
subst("cublasChpmv", "hipblasChpmv_v2", "library");
subst("cublasChpmv_64", "hipblasChpmv_v2_64", "library");
subst("cublasChpmv_v2", "hipblasChpmv_v2", "library");
Expand Down Expand Up @@ -4933,8 +4942,11 @@ sub simpleSubstitutions {
subst("cublasZher_v2", "hipblasZher_v2", "library");
subst("cublasZher_v2_64", "hipblasZher_v2_64", "library");
subst("cublasZherk", "hipblasZherk_v2", "library");
subst("cublasZherk_64", "hipblasZherk_v2_64", "library");
subst("cublasZherk_v2", "hipblasZherk_v2", "library");
subst("cublasZherk_v2_64", "hipblasZherk_v2_64", "library");
subst("cublasZherkx", "hipblasZherkx_v2", "library");
subst("cublasZherkx_64", "hipblasZherkx_v2_64", "library");
subst("cublasZhpmv", "hipblasZhpmv_v2", "library");
subst("cublasZhpmv_64", "hipblasZhpmv_v2_64", "library");
subst("cublasZhpmv_v2", "hipblasZhpmv_v2", "library");
Expand Down Expand Up @@ -11551,9 +11563,6 @@ sub warnHipOnlyUnsupportedFunctions {
"cublasZsymm_v2_64",
"cublasZsymm_64",
"cublasZmatinvBatched",
"cublasZherkx_64",
"cublasZherk_v2_64",
"cublasZherk_64",
"cublasZher2k_v2_64",
"cublasZher2k_64",
"cublasZhemm_v2_64",
Expand Down Expand Up @@ -11719,9 +11728,6 @@ sub warnHipOnlyUnsupportedFunctions {
"cublasCopyEx",
"cublasContext",
"cublasCmatinvBatched",
"cublasCherkx_64",
"cublasCherk_v2_64",
"cublasCherk_64",
"cublasCherkEx_64",
"cublasCherkEx",
"cublasCherk3mEx_64",
Expand Down Expand Up @@ -13339,9 +13345,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasZsymm_v2_64",
"cublasZsymm_64",
"cublasZmatinvBatched",
"cublasZherkx_64",
"cublasZherk_v2_64",
"cublasZherk_64",
"cublasZher2k_v2_64",
"cublasZher2k_64",
"cublasZhemm_v2_64",
Expand Down Expand Up @@ -13521,9 +13524,6 @@ sub warnRocOnlyUnsupportedFunctions {
"cublasCopyEx_64",
"cublasCopyEx",
"cublasCmatinvBatched",
"cublasCherkx_64",
"cublasCherk_v2_64",
"cublasCherk_64",
"cublasCherkEx_64",
"cublasCherkEx",
"cublasCherk3mEx_64",
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 @@ -1150,11 +1150,11 @@
|`cublasCher2k_v2`| | | | |`hipblasCher2k_v2`|6.0.0| | | | |
|`cublasCher2k_v2_64`|12.0| | | | | | | | | |
|`cublasCherk`| | | | |`hipblasCherk_v2`|6.0.0| | | | |
|`cublasCherk_64`|12.0| | | | | | | | | |
|`cublasCherk_64`|12.0| | | |`hipblasCherk_v2_64`|6.3.0| | | |6.3.0|
|`cublasCherk_v2`| | | | |`hipblasCherk_v2`|6.0.0| | | | |
|`cublasCherk_v2_64`|12.0| | | | | | | | | |
|`cublasCherk_v2_64`|12.0| | | |`hipblasCherk_v2_64`|6.3.0| | | |6.3.0|
|`cublasCherkx`| | | | |`hipblasCherkx_v2`|6.0.0| | | | |
|`cublasCherkx_64`|12.0| | | | | | | | | |
|`cublasCherkx_64`|12.0| | | |`hipblasCherkx_v2_64`|6.3.0| | | |6.3.0|
|`cublasCsymm`| | | | |`hipblasCsymm_v2`|6.0.0| | | | |
|`cublasCsymm_64`|12.0| | | | | | | | | |
|`cublasCsymm_v2`| | | | |`hipblasCsymm_v2`|6.0.0| | | | |
Expand Down Expand Up @@ -1296,11 +1296,11 @@
|`cublasZher2k_v2`| | | | |`hipblasZher2k_v2`|6.0.0| | | | |
|`cublasZher2k_v2_64`|12.0| | | | | | | | | |
|`cublasZherk`| | | | |`hipblasZherk_v2`|6.0.0| | | | |
|`cublasZherk_64`|12.0| | | | | | | | | |
|`cublasZherk_64`|12.0| | | |`hipblasZherk_v2_64`|6.3.0| | | |6.3.0|
|`cublasZherk_v2`| | | | |`hipblasZherk_v2`|6.0.0| | | | |
|`cublasZherk_v2_64`|12.0| | | | | | | | | |
|`cublasZherk_v2_64`|12.0| | | |`hipblasZherk_v2_64`|6.3.0| | | |6.3.0|
|`cublasZherkx`| | | | |`hipblasZherkx_v2`|6.0.0| | | | |
|`cublasZherkx_64`|12.0| | | | | | | | | |
|`cublasZherkx_64`|12.0| | | |`hipblasZherkx_v2_64`|6.3.0| | | |6.3.0|
|`cublasZsymm`| | | | |`hipblasZsymm_v2`|6.0.0| | | | |
|`cublasZsymm_64`|12.0| | | | | | | | | |
|`cublasZsymm_v2`| | | | |`hipblasZsymm_v2`|6.0.0| | | | |
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 @@ -1150,11 +1150,11 @@
|`cublasCher2k_v2`| | | | |`hipblasCher2k_v2`|6.0.0| | | | |`rocblas_cher2k`|3.5.0| | | | |
|`cublasCher2k_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCherk`| | | | |`hipblasCherk_v2`|6.0.0| | | | |`rocblas_cherk`|3.5.0| | | | |
|`cublasCherk_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCherk_64`|12.0| | | |`hipblasCherk_v2_64`|6.3.0| | | |6.3.0|`rocblas_cherk_64`|6.3.0| | | |6.3.0|
|`cublasCherk_v2`| | | | |`hipblasCherk_v2`|6.0.0| | | | |`rocblas_cherk`|3.5.0| | | | |
|`cublasCherk_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCherk_v2_64`|12.0| | | |`hipblasCherk_v2_64`|6.3.0| | | |6.3.0|`rocblas_cherk_64`|6.3.0| | | |6.3.0|
|`cublasCherkx`| | | | |`hipblasCherkx_v2`|6.0.0| | | | |`rocblas_cherkx`|3.5.0| | | | |
|`cublasCherkx_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCherkx_64`|12.0| | | |`hipblasCherkx_v2_64`|6.3.0| | | |6.3.0|`rocblas_cherkx_64`|6.3.0| | | |6.3.0|
|`cublasCsymm`| | | | |`hipblasCsymm_v2`|6.0.0| | | | |`rocblas_csymm`|3.5.0| | | | |
|`cublasCsymm_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCsymm_v2`| | | | |`hipblasCsymm_v2`|6.0.0| | | | |`rocblas_csymm`|3.5.0| | | | |
Expand Down Expand Up @@ -1296,11 +1296,11 @@
|`cublasZher2k_v2`| | | | |`hipblasZher2k_v2`|6.0.0| | | | |`rocblas_zher2k`|3.5.0| | | | |
|`cublasZher2k_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasZherk`| | | | |`hipblasZherk_v2`|6.0.0| | | | |`rocblas_zherk`|3.5.0| | | | |
|`cublasZherk_64`|12.0| | | | | | | | | | | | | | | |
|`cublasZherk_64`|12.0| | | |`hipblasZherk_v2_64`|6.3.0| | | |6.3.0|`rocblas_zherk_64`|6.3.0| | | |6.3.0|
|`cublasZherk_v2`| | | | |`hipblasZherk_v2`|6.0.0| | | | |`rocblas_zherk`|3.5.0| | | | |
|`cublasZherk_v2_64`|12.0| | | | | | | | | | | | | | | |
|`cublasZherk_v2_64`|12.0| | | |`hipblasZherk_v2_64`|6.3.0| | | |6.3.0|`rocblas_zherk_64`|6.3.0| | | |6.3.0|
|`cublasZherkx`| | | | |`hipblasZherkx_v2`|6.0.0| | | | |`rocblas_zherkx`|3.5.0| | | | |
|`cublasZherkx_64`|12.0| | | | | | | | | | | | | | | |
|`cublasZherkx_64`|12.0| | | |`hipblasZherkx_v2_64`|6.3.0| | | |6.3.0|`rocblas_zherkx_64`|6.3.0| | | |6.3.0|
|`cublasZsymm`| | | | |`hipblasZsymm_v2`|6.0.0| | | | |`rocblas_zsymm`|3.5.0| | | | |
|`cublasZsymm_64`|12.0| | | | | | | | | | | | | | | |
|`cublasZsymm_v2`| | | | |`hipblasZsymm_v2`|6.0.0| | | | |`rocblas_zsymm`|3.5.0| | | | |
Expand Down
12 changes: 6 additions & 6 deletions docs/tables/CUBLAS_API_supported_by_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -1150,11 +1150,11 @@
|`cublasCher2k_v2`| | | | |`rocblas_cher2k`|3.5.0| | | | |
|`cublasCher2k_v2_64`|12.0| | | | | | | | | |
|`cublasCherk`| | | | |`rocblas_cherk`|3.5.0| | | | |
|`cublasCherk_64`|12.0| | | | | | | | | |
|`cublasCherk_64`|12.0| | | |`rocblas_cherk_64`|6.3.0| | | |6.3.0|
|`cublasCherk_v2`| | | | |`rocblas_cherk`|3.5.0| | | | |
|`cublasCherk_v2_64`|12.0| | | | | | | | | |
|`cublasCherk_v2_64`|12.0| | | |`rocblas_cherk_64`|6.3.0| | | |6.3.0|
|`cublasCherkx`| | | | |`rocblas_cherkx`|3.5.0| | | | |
|`cublasCherkx_64`|12.0| | | | | | | | | |
|`cublasCherkx_64`|12.0| | | |`rocblas_cherkx_64`|6.3.0| | | |6.3.0|
|`cublasCsymm`| | | | |`rocblas_csymm`|3.5.0| | | | |
|`cublasCsymm_64`|12.0| | | | | | | | | |
|`cublasCsymm_v2`| | | | |`rocblas_csymm`|3.5.0| | | | |
Expand Down Expand Up @@ -1296,11 +1296,11 @@
|`cublasZher2k_v2`| | | | |`rocblas_zher2k`|3.5.0| | | | |
|`cublasZher2k_v2_64`|12.0| | | | | | | | | |
|`cublasZherk`| | | | |`rocblas_zherk`|3.5.0| | | | |
|`cublasZherk_64`|12.0| | | | | | | | | |
|`cublasZherk_64`|12.0| | | |`rocblas_zherk_64`|6.3.0| | | |6.3.0|
|`cublasZherk_v2`| | | | |`rocblas_zherk`|3.5.0| | | | |
|`cublasZherk_v2_64`|12.0| | | | | | | | | |
|`cublasZherk_v2_64`|12.0| | | |`rocblas_zherk_64`|6.3.0| | | |6.3.0|
|`cublasZherkx`| | | | |`rocblas_zherkx`|3.5.0| | | | |
|`cublasZherkx_64`|12.0| | | | | | | | | |
|`cublasZherkx_64`|12.0| | | |`rocblas_zherkx_64`|6.3.0| | | |6.3.0|
|`cublasZsymm`| | | | |`rocblas_zsymm`|3.5.0| | | | |
|`cublasZsymm_64`|12.0| | | | | | | | | |
|`cublasZsymm_v2`| | | | |`rocblas_zsymm`|3.5.0| | | | |
Expand Down
20 changes: 14 additions & 6 deletions src/CUDA2HIP_BLAS_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// HERK
{"cublasCherk", {"hipblasCherk_v2", "rocblas_cherk", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
{"cublasCherk_64", {"hipblasCherk_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasCherk_64", {"hipblasCherk_v2_64", "rocblas_cherk_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasZherk", {"hipblasZherk_v2", "rocblas_zherk", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
{"cublasZherk_64", {"hipblasZherk_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasZherk_64", {"hipblasZherk_v2_64", "rocblas_zherk_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},

// SYR2K
{"cublasSsyr2k", {"hipblasSsyr2k", "rocblas_ssyr2k", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
Expand Down Expand Up @@ -519,9 +519,9 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// HERKX - eXtended HERK
{"cublasCherkx", {"hipblasCherkx_v2", "rocblas_cherkx", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasCherkx_64", {"hipblasCherkx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasCherkx_64", {"hipblasCherkx_v2_64", "rocblas_cherkx_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasZherkx", {"hipblasZherkx_v2", "rocblas_zherkx", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasZherkx_64", {"hipblasZherkx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasZherkx_64", {"hipblasZherkx_v2_64", "rocblas_zherkx_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},

// SYMM
{"cublasSsymm", {"hipblasSsymm", "rocblas_ssymm", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, HIP_SUPPORTED_V2_ONLY}},
Expand Down Expand Up @@ -864,15 +864,15 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// HERK
{"cublasCherk_v2", {"hipblasCherk_v2", "rocblas_cherk", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasCherk_v2_64", {"hipblasCherk_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasCherk_v2_64", {"hipblasCherk_v2_64", "rocblas_cherk_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
// IO in Int8 complex/cuComplex, computation in cuComplex
{"cublasCherkEx", {"hipblasCherkEx", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasCherkEx_64", {"hipblasCherkEx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
// IO in Int8 complex/cuComplex, computation in cuComplex, Gaussian math
{"cublasCherk3mEx", {"hipblasCherk3mEx", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasCherk3mEx_64", {"hipblasCherk3mEx_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
{"cublasZherk_v2", {"hipblasZherk_v2", "rocblas_zherk", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
{"cublasZherk_v2_64", {"hipblasZherk_64", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3, UNSUPPORTED}},
{"cublasZherk_v2_64", {"hipblasZherk_v2_64", "rocblas_zherk_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},

// SYR2K
{"cublasSsyr2k_v2", {"hipblasSsyr2k", "rocblas_ssyr2k", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_LEVEL_3}},
Expand Down Expand Up @@ -2038,6 +2038,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"hipblasDgemmStridedBatched_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasCgemmStridedBatched_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasZgemmStridedBatched_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasCherk_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasZherk_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasCherkx_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasZherkx_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 @@ -2441,6 +2445,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"rocblas_dgemm_strided_batched_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_cgemm_strided_batched_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_zgemm_strided_batched_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_cherk_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_zherk_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_cherkx_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"rocblas_zherkx_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
};

const std::map<llvm::StringRef, hipAPIChangedVersions> HIP_BLAS_FUNCTION_CHANGED_VER_MAP {
Expand Down
Loading

0 comments on commit eb08f08

Please sign in to comment.