Skip to content

Commit

Permalink
Merge pull request #1744 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][6.3.0][BLAS] Sync with `hipBLAS` - Step 14
  • Loading branch information
emankov authored Nov 8, 2024
2 parents c29118e + af190db commit be0f836
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 16 deletions.
8 changes: 4 additions & 4 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -4543,6 +4543,7 @@ sub simpleSubstitutions {
subst("cublasCtrmv_v2_64", "hipblasCtrmv_v2_64", "library");
subst("cublasCtrsm", "hipblasCtrsm_v2", "library");
subst("cublasCtrsmBatched", "hipblasCtrsmBatched_v2", "library");
subst("cublasCtrsmBatched_64", "hipblasCtrsmBatched_v2_64", "library");
subst("cublasCtrsm_64", "hipblasCtrsm_v2_64", "library");
subst("cublasCtrsm_v2", "hipblasCtrsm_v2", "library");
subst("cublasCtrsm_v2_64", "hipblasCtrsm_v2_64", "library");
Expand Down Expand Up @@ -4695,6 +4696,7 @@ sub simpleSubstitutions {
subst("cublasDtrmv_v2_64", "hipblasDtrmv_64", "library");
subst("cublasDtrsm", "hipblasDtrsm", "library");
subst("cublasDtrsmBatched", "hipblasDtrsmBatched", "library");
subst("cublasDtrsmBatched_64", "hipblasDtrsmBatched_64", "library");
subst("cublasDtrsm_64", "hipblasDtrsm_64", "library");
subst("cublasDtrsm_v2", "hipblasDtrsm", "library");
subst("cublasDtrsm_v2_64", "hipblasDtrsm_64", "library");
Expand Down Expand Up @@ -4944,6 +4946,7 @@ sub simpleSubstitutions {
subst("cublasStrmv_v2_64", "hipblasStrmv_64", "library");
subst("cublasStrsm", "hipblasStrsm", "library");
subst("cublasStrsmBatched", "hipblasStrsmBatched", "library");
subst("cublasStrsmBatched_64", "hipblasStrsmBatched_64", "library");
subst("cublasStrsm_64", "hipblasStrsm_64", "library");
subst("cublasStrsm_v2", "hipblasStrsm", "library");
subst("cublasStrsm_v2_64", "hipblasStrsm_64", "library");
Expand Down Expand Up @@ -5118,6 +5121,7 @@ sub simpleSubstitutions {
subst("cublasZtrmv_v2_64", "hipblasZtrmv_v2_64", "library");
subst("cublasZtrsm", "hipblasZtrsm_v2", "library");
subst("cublasZtrsmBatched", "hipblasZtrsmBatched_v2", "library");
subst("cublasZtrsmBatched_64", "hipblasZtrsmBatched_v2_64", "library");
subst("cublasZtrsm_64", "hipblasZtrsm_v2_64", "library");
subst("cublasZtrsm_v2", "hipblasZtrsm_v2", "library");
subst("cublasZtrsm_v2_64", "hipblasZtrsm_v2_64", "library");
Expand Down Expand Up @@ -11653,7 +11657,6 @@ sub warnHipOnlyUnsupportedFunctions {
"cudnnAdvInferVersionCheck",
"cudnnActivationStruct",
"cublasZtrttp",
"cublasZtrsmBatched_64",
"cublasZtpttr",
"cublasZmatinvBatched",
"cublasZgemm3m_64",
Expand All @@ -11672,7 +11675,6 @@ sub warnHipOnlyUnsupportedFunctions {
"cublasSwapEx_64",
"cublasSwapEx",
"cublasStrttp",
"cublasStrsmBatched_64",
"cublasStpttr",
"cublasSmatinvBatched",
"cublasShutdown",
Expand Down Expand Up @@ -11764,14 +11766,12 @@ sub warnHipOnlyUnsupportedFunctions {
"cublasGemmBatchedEx_64",
"cublasFree",
"cublasDtrttp",
"cublasDtrsmBatched_64",
"cublasDtpttr",
"cublasDmatinvBatched",
"cublasDgemmGroupedBatched_64",
"cublasDgemmGroupedBatched",
"cublasDdgmm_64",
"cublasCtrttp",
"cublasCtrsmBatched_64",
"cublasCtpttr",
"cublasCsyrkEx_64",
"cublasCsyrkEx",
Expand Down
8 changes: 4 additions & 4 deletions docs/tables/CUBLAS_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@
|`cublasCsyrkEx_64`|12.0| | | | | | | | | |
|`cublasCtpttr`| | | | | | | | | | |
|`cublasCtrsmBatched`| | | | |`hipblasCtrsmBatched_v2`|6.0.0| | | | |
|`cublasCtrsmBatched_64`|12.0| | | | | | | | | |
|`cublasCtrsmBatched_64`|12.0| | | |`hipblasCtrsmBatched_v2_64`|6.3.0| | | |6.3.0|
|`cublasCtrttp`| | | | | | | | | | |
|`cublasDdgmm`| | | | |`hipblasDdgmm`|3.6.0| | | | |
|`cublasDdgmm_64`|12.0| | | | | | | | | |
Expand All @@ -1819,7 +1819,7 @@
|`cublasDotcEx_64`|12.0| | | |`hipblasDotcEx_v2_64`|6.2.0| | | | |
|`cublasDtpttr`| | | | | | | | | | |
|`cublasDtrsmBatched`| | | | |`hipblasDtrsmBatched`|3.2.0| | | | |
|`cublasDtrsmBatched_64`|12.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| | | | | | | | | |
Expand Down Expand Up @@ -1853,7 +1853,7 @@
|`cublasSmatinvBatched`| | | | | | | | | | |
|`cublasStpttr`| | | | | | | | | | |
|`cublasStrsmBatched`| | | | |`hipblasStrsmBatched`|3.2.0| | | | |
|`cublasStrsmBatched_64`|12.0| | | | | | | | | |
|`cublasStrsmBatched_64`|12.0| | | |`hipblasStrsmBatched_64`|6.3.0| | | |6.3.0|
|`cublasStrttp`| | | | | | | | | | |
|`cublasSwapEx`|10.1| | | | | | | | | |
|`cublasSwapEx_64`|12.0| | | | | | | | | |
Expand All @@ -1870,7 +1870,7 @@
|`cublasZmatinvBatched`| | | | | | | | | | |
|`cublasZtpttr`| | | | | | | | | | |
|`cublasZtrsmBatched`| | | | |`hipblasZtrsmBatched_v2`|6.0.0| | | | |
|`cublasZtrsmBatched_64`|12.0| | | | | | | | | |
|`cublasZtrsmBatched_64`|12.0| | | |`hipblasZtrsmBatched_v2_64`|6.3.0| | | |6.3.0|
|`cublasZtrttp`| | | | | | | | | | |

## **9. BLASLt Function Reference**
Expand Down
8 changes: 4 additions & 4 deletions docs/tables/CUBLAS_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@
|`cublasCsyrkEx_64`|12.0| | | | | | | | | | | | | | | |
|`cublasCtpttr`| | | | | | | | | | | | | | | | |
|`cublasCtrsmBatched`| | | | |`hipblasCtrsmBatched_v2`|6.0.0| | | | |`rocblas_ctrsm_batched`|3.5.0| | | | |
|`cublasCtrsmBatched_64`|12.0| | | | | | | | | |`rocblas_ctrsm_batched_64`|6.2.0| | | | |
|`cublasCtrsmBatched_64`|12.0| | | |`hipblasCtrsmBatched_v2_64`|6.3.0| | | |6.3.0|`rocblas_ctrsm_batched_64`|6.2.0| | | | |
|`cublasCtrttp`| | | | | | | | | | | | | | | | |
|`cublasDdgmm`| | | | |`hipblasDdgmm`|3.6.0| | | | |`rocblas_ddgmm`|3.5.0| | | | |
|`cublasDdgmm_64`|12.0| | | | | | | | | | | | | | | |
Expand All @@ -1819,7 +1819,7 @@
|`cublasDotcEx_64`|12.0| | | |`hipblasDotcEx_v2_64`|6.2.0| | | | |`rocblas_dotc_ex_64`|6.1.0| | | | |
|`cublasDtpttr`| | | | | | | | | | | | | | | | |
|`cublasDtrsmBatched`| | | | |`hipblasDtrsmBatched`|3.2.0| | | | |`rocblas_dtrsm_batched`|3.5.0| | | | |
|`cublasDtrsmBatched_64`|12.0| | | | | | | | | |`rocblas_dtrsm_batched_64`|6.2.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| | | | | | | | | | | | | | | |
Expand Down Expand Up @@ -1853,7 +1853,7 @@
|`cublasSmatinvBatched`| | | | | | | | | | | | | | | | |
|`cublasStpttr`| | | | | | | | | | | | | | | | |
|`cublasStrsmBatched`| | | | |`hipblasStrsmBatched`|3.2.0| | | | |`rocblas_strsm_batched`|3.5.0| | | | |
|`cublasStrsmBatched_64`|12.0| | | | | | | | | |`rocblas_strsm_batched_64`|6.2.0| | | | |
|`cublasStrsmBatched_64`|12.0| | | |`hipblasStrsmBatched_64`|6.3.0| | | |6.3.0|`rocblas_strsm_batched_64`|6.2.0| | | | |
|`cublasStrttp`| | | | | | | | | | | | | | | | |
|`cublasSwapEx`|10.1| | | | | | | | | | | | | | | |
|`cublasSwapEx_64`|12.0| | | | | | | | | | | | | | | |
Expand All @@ -1870,7 +1870,7 @@
|`cublasZmatinvBatched`| | | | | | | | | | | | | | | | |
|`cublasZtpttr`| | | | | | | | | | | | | | | | |
|`cublasZtrsmBatched`| | | | |`hipblasZtrsmBatched_v2`|6.0.0| | | | |`rocblas_ztrsm_batched`|3.5.0| | | | |
|`cublasZtrsmBatched_64`|12.0| | | | | | | | | |`rocblas_ztrsm_batched_64`|6.2.0| | | | |
|`cublasZtrsmBatched_64`|12.0| | | |`hipblasZtrsmBatched_v2_64`|6.3.0| | | |6.3.0|`rocblas_ztrsm_batched_64`|6.2.0| | | | |
|`cublasZtrttp`| | | | | | | | | | | | | | | | |

## **9. BLASLt Function Reference**
Expand Down
12 changes: 8 additions & 4 deletions src/CUDA2HIP_BLAS_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,13 +590,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_BLAS_FUNCTION_MAP {

// TRSM - Batched Triangular Solver
{"cublasStrsmBatched", {"hipblasStrsmBatched", "rocblas_strsm_batched", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasStrsmBatched_64", {"hipblasStrsmBatched_64", "rocblas_strsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, HIP_UNSUPPORTED}},
{"cublasStrsmBatched_64", {"hipblasStrsmBatched_64", "rocblas_strsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasDtrsmBatched", {"hipblasDtrsmBatched", "rocblas_dtrsm_batched", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasDtrsmBatched_64", {"hipblasDtrsmBatched_64", "rocblas_dtrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, HIP_UNSUPPORTED}},
{"cublasDtrsmBatched_64", {"hipblasDtrsmBatched_64", "rocblas_dtrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasCtrsmBatched", {"hipblasCtrsmBatched_v2", "rocblas_ctrsm_batched", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasCtrsmBatched_64", {"hipblasCtrsmBatched_64", "rocblas_ctrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, HIP_UNSUPPORTED}},
{"cublasCtrsmBatched_64", {"hipblasCtrsmBatched_v2_64", "rocblas_ctrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasZtrsmBatched", {"hipblasZtrsmBatched_v2", "rocblas_ztrsm_batched", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},
{"cublasZtrsmBatched_64", {"hipblasZtrsmBatched_64", "rocblas_ztrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, HIP_UNSUPPORTED}},
{"cublasZtrsmBatched_64", {"hipblasZtrsmBatched_v2_64", "rocblas_ztrsm_batched_64", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT}},

// MATINV - Batched
{"cublasSmatinvBatched", {"hipblasSmatinvBatched", "", CONV_LIB_FUNC, API_BLAS, SEC::BLAS_EXT, UNSUPPORTED}},
Expand Down Expand Up @@ -2074,6 +2074,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_BLAS_FUNCTION_VER_MAP {
{"hipblasDtrsm_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasCtrsm_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasZtrsm_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasStrsmBatched_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasDtrsmBatched_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasCtrsmBatched_v2_64", {HIP_6030, HIP_0, HIP_0, HIP_LATEST}},
{"hipblasZtrsmBatched_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
20 changes: 20 additions & 0 deletions tests/unit_tests/synthetic/libraries/cublas2hipblas_v2.cu
Original file line number Diff line number Diff line change
Expand Up @@ -3140,6 +3140,26 @@ int main() {
// CHECK-NEXT: blasStatus = hipblasZtrsm_v2_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, &dcomplexA, lda_64, &dcomplexB, ldb_64);
blasStatus = cublasZtrsm_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, &dcomplexA, lda_64, &dcomplexB, ldb_64);
blasStatus = cublasZtrsm_v2_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, &dcomplexA, lda_64, &dcomplexB, ldb_64);

// 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);
// 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);
// CHECK: blasStatus = hipblasStrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &fa, fAarray_const, lda_64, fBarray, ldb_64, batchCount_64);
blasStatus = cublasStrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &fa, fAarray_const, lda_64, fBarray, ldb_64, batchCount_64);

// 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);
// 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);
// CHECK: blasStatus = hipblasDtrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &da, dAarray_const, lda_64, dBarray, ldb_64, batchCount_64);
blasStatus = cublasDtrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &da, dAarray_const, lda_64, dBarray, ldb_64, batchCount_64);

// 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);
// 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);
// CHECK: blasStatus = hipblasCtrsmBatched_v2_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &complexa, complexAarray_const, lda_64, complexBarray, ldb_64, batchCount_64);
blasStatus = cublasCtrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &complexa, complexAarray_const, lda_64, complexBarray, ldb_64, batchCount_64);

// 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);
// 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);
// CHECK: blasStatus = hipblasZtrsmBatched_v2_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, dcomplexAarray_const, lda_64, dcomplexBarray, ldb_64, batchCount_64);
blasStatus = cublasZtrsmBatched_64(blasHandle, blasSideMode, blasFillMode, blasOperation, blasDiagType, m_64, n_64, &dcomplexa, dcomplexAarray_const, lda_64, dcomplexBarray, ldb_64, batchCount_64);
#endif

return 0;
Expand Down

0 comments on commit be0f836

Please sign in to comment.