Skip to content

Commit af190db

Browse files
committed
[HIPIFY][6.3.0][BLAS] Sync with hipBLAS - Step 14
+ `hipblas(S|D|C|Z)trsm_batched(_v2)?_64` support + Updated synthetic tests, the regenerated `hipify-perl`, and `BLAS` `CUDA2HIP` documentation
1 parent c29118e commit af190db

File tree

5 files changed

+40
-16
lines changed

5 files changed

+40
-16
lines changed

bin/hipify-perl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,6 +4543,7 @@ sub simpleSubstitutions {
45434543
subst("cublasCtrmv_v2_64", "hipblasCtrmv_v2_64", "library");
45444544
subst("cublasCtrsm", "hipblasCtrsm_v2", "library");
45454545
subst("cublasCtrsmBatched", "hipblasCtrsmBatched_v2", "library");
4546+
subst("cublasCtrsmBatched_64", "hipblasCtrsmBatched_v2_64", "library");
45464547
subst("cublasCtrsm_64", "hipblasCtrsm_v2_64", "library");
45474548
subst("cublasCtrsm_v2", "hipblasCtrsm_v2", "library");
45484549
subst("cublasCtrsm_v2_64", "hipblasCtrsm_v2_64", "library");
@@ -4695,6 +4696,7 @@ sub simpleSubstitutions {
46954696
subst("cublasDtrmv_v2_64", "hipblasDtrmv_64", "library");
46964697
subst("cublasDtrsm", "hipblasDtrsm", "library");
46974698
subst("cublasDtrsmBatched", "hipblasDtrsmBatched", "library");
4699+
subst("cublasDtrsmBatched_64", "hipblasDtrsmBatched_64", "library");
46984700
subst("cublasDtrsm_64", "hipblasDtrsm_64", "library");
46994701
subst("cublasDtrsm_v2", "hipblasDtrsm", "library");
47004702
subst("cublasDtrsm_v2_64", "hipblasDtrsm_64", "library");
@@ -4944,6 +4946,7 @@ sub simpleSubstitutions {
49444946
subst("cublasStrmv_v2_64", "hipblasStrmv_64", "library");
49454947
subst("cublasStrsm", "hipblasStrsm", "library");
49464948
subst("cublasStrsmBatched", "hipblasStrsmBatched", "library");
4949+
subst("cublasStrsmBatched_64", "hipblasStrsmBatched_64", "library");
49474950
subst("cublasStrsm_64", "hipblasStrsm_64", "library");
49484951
subst("cublasStrsm_v2", "hipblasStrsm", "library");
49494952
subst("cublasStrsm_v2_64", "hipblasStrsm_64", "library");
@@ -5118,6 +5121,7 @@ sub simpleSubstitutions {
51185121
subst("cublasZtrmv_v2_64", "hipblasZtrmv_v2_64", "library");
51195122
subst("cublasZtrsm", "hipblasZtrsm_v2", "library");
51205123
subst("cublasZtrsmBatched", "hipblasZtrsmBatched_v2", "library");
5124+
subst("cublasZtrsmBatched_64", "hipblasZtrsmBatched_v2_64", "library");
51215125
subst("cublasZtrsm_64", "hipblasZtrsm_v2_64", "library");
51225126
subst("cublasZtrsm_v2", "hipblasZtrsm_v2", "library");
51235127
subst("cublasZtrsm_v2_64", "hipblasZtrsm_v2_64", "library");
@@ -11653,7 +11657,6 @@ sub warnHipOnlyUnsupportedFunctions {
1165311657
"cudnnAdvInferVersionCheck",
1165411658
"cudnnActivationStruct",
1165511659
"cublasZtrttp",
11656-
"cublasZtrsmBatched_64",
1165711660
"cublasZtpttr",
1165811661
"cublasZmatinvBatched",
1165911662
"cublasZgemm3m_64",
@@ -11672,7 +11675,6 @@ sub warnHipOnlyUnsupportedFunctions {
1167211675
"cublasSwapEx_64",
1167311676
"cublasSwapEx",
1167411677
"cublasStrttp",
11675-
"cublasStrsmBatched_64",
1167611678
"cublasStpttr",
1167711679
"cublasSmatinvBatched",
1167811680
"cublasShutdown",
@@ -11764,14 +11766,12 @@ sub warnHipOnlyUnsupportedFunctions {
1176411766
"cublasGemmBatchedEx_64",
1176511767
"cublasFree",
1176611768
"cublasDtrttp",
11767-
"cublasDtrsmBatched_64",
1176811769
"cublasDtpttr",
1176911770
"cublasDmatinvBatched",
1177011771
"cublasDgemmGroupedBatched_64",
1177111772
"cublasDgemmGroupedBatched",
1177211773
"cublasDdgmm_64",
1177311774
"cublasCtrttp",
11774-
"cublasCtrsmBatched_64",
1177511775
"cublasCtpttr",
1177611776
"cublasCsyrkEx_64",
1177711777
"cublasCsyrkEx",

docs/tables/CUBLAS_API_supported_by_HIP.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@
18011801
|`cublasCsyrkEx_64`|12.0| | | | | | | | | |
18021802
|`cublasCtpttr`| | | | | | | | | | |
18031803
|`cublasCtrsmBatched`| | | | |`hipblasCtrsmBatched_v2`|6.0.0| | | | |
1804-
|`cublasCtrsmBatched_64`|12.0| | | | | | | | | |
1804+
|`cublasCtrsmBatched_64`|12.0| | | |`hipblasCtrsmBatched_v2_64`|6.3.0| | | |6.3.0|
18051805
|`cublasCtrttp`| | | | | | | | | | |
18061806
|`cublasDdgmm`| | | | |`hipblasDdgmm`|3.6.0| | | | |
18071807
|`cublasDdgmm_64`|12.0| | | | | | | | | |
@@ -1819,7 +1819,7 @@
18191819
|`cublasDotcEx_64`|12.0| | | |`hipblasDotcEx_v2_64`|6.2.0| | | | |
18201820
|`cublasDtpttr`| | | | | | | | | | |
18211821
|`cublasDtrsmBatched`| | | | |`hipblasDtrsmBatched`|3.2.0| | | | |
1822-
|`cublasDtrsmBatched_64`|12.0| | | | | | | | | |
1822+
|`cublasDtrsmBatched_64`|12.0| | | |`hipblasDtrsmBatched_64`|6.3.0| | | |6.3.0|
18231823
|`cublasDtrttp`| | | | | | | | | | |
18241824
|`cublasGemmBatchedEx`|9.1| | | |`hipblasGemmBatchedEx_v2`|6.0.0| | | | |
18251825
|`cublasGemmBatchedEx_64`|12.0| | | | | | | | | |
@@ -1853,7 +1853,7 @@
18531853
|`cublasSmatinvBatched`| | | | | | | | | | |
18541854
|`cublasStpttr`| | | | | | | | | | |
18551855
|`cublasStrsmBatched`| | | | |`hipblasStrsmBatched`|3.2.0| | | | |
1856-
|`cublasStrsmBatched_64`|12.0| | | | | | | | | |
1856+
|`cublasStrsmBatched_64`|12.0| | | |`hipblasStrsmBatched_64`|6.3.0| | | |6.3.0|
18571857
|`cublasStrttp`| | | | | | | | | | |
18581858
|`cublasSwapEx`|10.1| | | | | | | | | |
18591859
|`cublasSwapEx_64`|12.0| | | | | | | | | |
@@ -1870,7 +1870,7 @@
18701870
|`cublasZmatinvBatched`| | | | | | | | | | |
18711871
|`cublasZtpttr`| | | | | | | | | | |
18721872
|`cublasZtrsmBatched`| | | | |`hipblasZtrsmBatched_v2`|6.0.0| | | | |
1873-
|`cublasZtrsmBatched_64`|12.0| | | | | | | | | |
1873+
|`cublasZtrsmBatched_64`|12.0| | | |`hipblasZtrsmBatched_v2_64`|6.3.0| | | |6.3.0|
18741874
|`cublasZtrttp`| | | | | | | | | | |
18751875

18761876
## **9. BLASLt Function Reference**

docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@
18011801
|`cublasCsyrkEx_64`|12.0| | | | | | | | | | | | | | | |
18021802
|`cublasCtpttr`| | | | | | | | | | | | | | | | |
18031803
|`cublasCtrsmBatched`| | | | |`hipblasCtrsmBatched_v2`|6.0.0| | | | |`rocblas_ctrsm_batched`|3.5.0| | | | |
1804-
|`cublasCtrsmBatched_64`|12.0| | | | | | | | | |`rocblas_ctrsm_batched_64`|6.2.0| | | | |
1804+
|`cublasCtrsmBatched_64`|12.0| | | |`hipblasCtrsmBatched_v2_64`|6.3.0| | | |6.3.0|`rocblas_ctrsm_batched_64`|6.2.0| | | | |
18051805
|`cublasCtrttp`| | | | | | | | | | | | | | | | |
18061806
|`cublasDdgmm`| | | | |`hipblasDdgmm`|3.6.0| | | | |`rocblas_ddgmm`|3.5.0| | | | |
18071807
|`cublasDdgmm_64`|12.0| | | | | | | | | | | | | | | |
@@ -1819,7 +1819,7 @@
18191819
|`cublasDotcEx_64`|12.0| | | |`hipblasDotcEx_v2_64`|6.2.0| | | | |`rocblas_dotc_ex_64`|6.1.0| | | | |
18201820
|`cublasDtpttr`| | | | | | | | | | | | | | | | |
18211821
|`cublasDtrsmBatched`| | | | |`hipblasDtrsmBatched`|3.2.0| | | | |`rocblas_dtrsm_batched`|3.5.0| | | | |
1822-
|`cublasDtrsmBatched_64`|12.0| | | | | | | | | |`rocblas_dtrsm_batched_64`|6.2.0| | | | |
1822+
|`cublasDtrsmBatched_64`|12.0| | | |`hipblasDtrsmBatched_64`|6.3.0| | | |6.3.0|`rocblas_dtrsm_batched_64`|6.2.0| | | | |
18231823
|`cublasDtrttp`| | | | | | | | | | | | | | | | |
18241824
|`cublasGemmBatchedEx`|9.1| | | |`hipblasGemmBatchedEx_v2`|6.0.0| | | | |`rocblas_gemm_batched_ex`|3.5.0| | | | |
18251825
|`cublasGemmBatchedEx_64`|12.0| | | | | | | | | | | | | | | |
@@ -1853,7 +1853,7 @@
18531853
|`cublasSmatinvBatched`| | | | | | | | | | | | | | | | |
18541854
|`cublasStpttr`| | | | | | | | | | | | | | | | |
18551855
|`cublasStrsmBatched`| | | | |`hipblasStrsmBatched`|3.2.0| | | | |`rocblas_strsm_batched`|3.5.0| | | | |
1856-
|`cublasStrsmBatched_64`|12.0| | | | | | | | | |`rocblas_strsm_batched_64`|6.2.0| | | | |
1856+
|`cublasStrsmBatched_64`|12.0| | | |`hipblasStrsmBatched_64`|6.3.0| | | |6.3.0|`rocblas_strsm_batched_64`|6.2.0| | | | |
18571857
|`cublasStrttp`| | | | | | | | | | | | | | | | |
18581858
|`cublasSwapEx`|10.1| | | | | | | | | | | | | | | |
18591859
|`cublasSwapEx_64`|12.0| | | | | | | | | | | | | | | |
@@ -1870,7 +1870,7 @@
18701870
|`cublasZmatinvBatched`| | | | | | | | | | | | | | | | |
18711871
|`cublasZtpttr`| | | | | | | | | | | | | | | | |
18721872
|`cublasZtrsmBatched`| | | | |`hipblasZtrsmBatched_v2`|6.0.0| | | | |`rocblas_ztrsm_batched`|3.5.0| | | | |
1873-
|`cublasZtrsmBatched_64`|12.0| | | | | | | | | |`rocblas_ztrsm_batched_64`|6.2.0| | | | |
1873+
|`cublasZtrsmBatched_64`|12.0| | | |`hipblasZtrsmBatched_v2_64`|6.3.0| | | |6.3.0|`rocblas_ztrsm_batched_64`|6.2.0| | | | |
18741874
|`cublasZtrttp`| | | | | | | | | | | | | | | | |
18751875

18761876
## **9. BLASLt Function Reference**

src/CUDA2HIP_BLAS_API_functions.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {
590590

591591
// TRSM - Batched Triangular Solver
592592
{"cublasStrsmBatched", {"hipblasStrsmBatched", "rocblas_strsm_batched", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
593-
{"cublasStrsmBatched_64", {"hipblasStrsmBatched_64", "rocblas_strsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, HIP_UNSUPPORTED}},
593+
{"cublasStrsmBatched_64", {"hipblasStrsmBatched_64", "rocblas_strsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
594594
{"cublasDtrsmBatched", {"hipblasDtrsmBatched", "rocblas_dtrsm_batched", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
595-
{"cublasDtrsmBatched_64", {"hipblasDtrsmBatched_64", "rocblas_dtrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, HIP_UNSUPPORTED}},
595+
{"cublasDtrsmBatched_64", {"hipblasDtrsmBatched_64", "rocblas_dtrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
596596
{"cublasCtrsmBatched", {"hipblasCtrsmBatched_v2", "rocblas_ctrsm_batched", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
597-
{"cublasCtrsmBatched_64", {"hipblasCtrsmBatched_64", "rocblas_ctrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, HIP_UNSUPPORTED}},
597+
{"cublasCtrsmBatched_64", {"hipblasCtrsmBatched_v2_64", "rocblas_ctrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
598598
{"cublasZtrsmBatched", {"hipblasZtrsmBatched_v2", "rocblas_ztrsm_batched", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
599-
{"cublasZtrsmBatched_64", {"hipblasZtrsmBatched_64", "rocblas_ztrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, HIP_UNSUPPORTED}},
599+
{"cublasZtrsmBatched_64", {"hipblasZtrsmBatched_v2_64", "rocblas_ztrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
600600

601601
// MATINV - Batched
602602
{"cublasSmatinvBatched", {"hipblasSmatinvBatched", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
@@ -2074,6 +2074,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
20742074
{"hipblasDtrsm_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
20752075
{"hipblasCtrsm_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
20762076
{"hipblasZtrsm_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
2077+
{"hipblasStrsmBatched_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
2078+
{"hipblasDtrsmBatched_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
2079+
{"hipblasCtrsmBatched_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
2080+
{"hipblasZtrsmBatched_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
20772081

20782082
{"rocblas_status_to_string", {HIP_3050, HIP_0, HIP_0 }},
20792083
{"rocblas_sscal", {HIP_1050, HIP_0, HIP_0 }},

tests/unit_tests/synthetic/libraries/cublas2hipblas_v2.cu

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3140,6 +3140,26 @@ int main() {
31403140
// CHECK-NEXT: blasStatus = hipblasZtrsm_v2_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, &dcomplexA, lda_64, &dcomplexB, ldb_64);
31413141
blasStatus = cublasZtrsm_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, &dcomplexA, lda_64, &dcomplexB, ldb_64);
31423142
blasStatus = cublasZtrsm_v2_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, &dcomplexA, lda_64, &dcomplexB, ldb_64);
3143+
3144+
// CUDA: CUBLASAPI cublasStatus_t CUBLASWINAPI cublasStrsmBatched_64(cublasHandle_t handle, cublasSideMode_t side, cublasFillMode_t uplo, cublasOperation_t trans, cublasDiagType_t diag, int64_t m, int64_t n, const float* alpha, const float* const A[], int64_t lda, float* const B[], int64_t ldb, int64_t batchCount);
3145+
// HIP: HIPBLAS_EXPORT hipblasStatus_t hipblasStrsmBatched_64(hipblasHandle_t handle, hipblasSideMode_t side, hipblasFillMode_t uplo, hipblasOperation_t transA, hipblasDiagType_t diag, int64_t m, int64_t n, const float* alpha, const float* const AP[], int64_t lda, float* const BP[], int64_t ldb, int64_t batchCount);
3146+
// CHECK: blasStatus = hipblasStrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &fa, fAarray_const, lda_64, fBarray, ldb_64, batchCount_64);
3147+
blasStatus = cublasStrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &fa, fAarray_const, lda_64, fBarray, ldb_64, batchCount_64);
3148+
3149+
// CUDA: CUBLASAPI cublasStatus_t CUBLASWINAPI cublasDtrsmBatched_64(cublasHandle_t handle, cublasSideMode_t side, cublasFillMode_t uplo, cublasOperation_t trans, cublasDiagType_t diag, int64_t m, int64_t n, const double* alpha, const double* const A[], int64_t lda, double* const B[], int64_t ldb, int64_t batchCount);
3150+
// HIP: HIPBLAS_EXPORT hipblasStatus_t hipblasDtrsmBatched_64(hipblasHandle_t handle, hipblasSideMode_t side, hipblasFillMode_t uplo, hipblasOperation_t transA, hipblasDiagType_t diag, int64_t m, int64_t n, const double* alpha, const double* const AP[], int64_t lda, double* const BP[], int64_t ldb, int64_t batchCount);
3151+
// CHECK: blasStatus = hipblasDtrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &da, dAarray_const, lda_64, dBarray, ldb_64, batchCount_64);
3152+
blasStatus = cublasDtrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &da, dAarray_const, lda_64, dBarray, ldb_64, batchCount_64);
3153+
3154+
// CUDA: CUBLASAPI cublasStatus_t CUBLASWINAPI cublasCtrsmBatched_64(cublasHandle_t handle, cublasSideMode_t side, cublasFillMode_t uplo, cublasOperation_t trans, cublasDiagType_t diag, int64_t m, int64_t n, const cuComplex* alpha, const cuComplex* const A[], int64_t lda, cuComplex* const B[], int64_t ldb, int64_t batchCount);
3155+
// HIP: HIPBLAS_EXPORT hipblasStatus_t hipblasCtrsmBatched_v2_64(hipblasHandle_t handle, hipblasSideMode_t side, hipblasFillMode_t uplo, hipblasOperation_t transA, hipblasDiagType_t diag, int64_t m, int64_t n, const hipComplex* alpha, const hipComplex* const AP[], int64_t lda, hipComplex* const BP[], int64_t ldb, int64_t batchCount);
3156+
// CHECK: blasStatus = hipblasCtrsmBatched_v2_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &complexa, complexAarray_const, lda_64, complexBarray, ldb_64, batchCount_64);
3157+
blasStatus = cublasCtrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &complexa, complexAarray_const, lda_64, complexBarray, ldb_64, batchCount_64);
3158+
3159+
// CUDA: CUBLASAPI cublasStatus_t CUBLASWINAPI cublasZtrsmBatched_64(cublasHandle_t handle, cublasSideMode_t side, cublasFillMode_t uplo, cublasOperation_t trans, cublasDiagType_t diag, int64_t m, int64_t n, const cuDoubleComplex* alpha, const cuDoubleComplex* const A[], int64_t lda, cuDoubleComplex* const B[], int64_t ldb, int64_t batchCount);
3160+
// HIP: HIPBLAS_EXPORT hipblasStatus_t hipblasZtrsmBatched_v2_64(hipblasHandle_t handle, hipblasSideMode_t side, hipblasFillMode_t uplo, hipblasOperation_t transA, hipblasDiagType_t diag, int64_t m, int64_t n, const hipDoubleComplex* alpha, const hipDoubleComplex* const AP[], int64_t lda, hipDoubleComplex* const BP[], int64_t ldb, int64_t batchCount);
3161+
// CHECK: blasStatus = hipblasZtrsmBatched_v2_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, dcomplexAarray_const, lda_64, dcomplexBarray, ldb_64, batchCount_64);
3162+
blasStatus = cublasZtrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, dcomplexAarray_const, lda_64, dcomplexBarray, ldb_64, batchCount_64);
31433163
#endif
31443164

31453165
return 0;

0 commit comments

Comments
 (0)