|
63 | 63 | # xSYR2
|
64 | 64 | # xSPR2
|
65 | 65 | # Level 3
|
| 66 | + gemmt!, |
| 67 | + gemmt, |
66 | 68 | gemm!,
|
67 | 69 | gemm,
|
68 | 70 | symm!,
|
@@ -1481,6 +1483,88 @@ end
|
1481 | 1483 | # Level 3
|
1482 | 1484 | ## (GE) general matrix-matrix multiplication
|
1483 | 1485 |
|
| 1486 | +""" |
| 1487 | + gemmt!(uplo, tA, tB, alpha, A, B, beta, C) |
| 1488 | +
|
| 1489 | +Update the lower or upper triangular part specified by [`uplo`](@ref stdlib-blas-uplo) of `C` as |
| 1490 | +`alpha*A*B + beta*C` or the other variants according to [`tA`](@ref stdlib-blas-trans) and `tB`. |
| 1491 | +Return the updated `C`. |
| 1492 | +
|
| 1493 | +!!! compat "Julia 1.11" |
| 1494 | + `gemmt!` requires at least Julia 1.11. |
| 1495 | +""" |
| 1496 | +function gemmt! end |
| 1497 | + |
| 1498 | +for (gemmt, elty) in |
| 1499 | + ((:dgemmt_,:Float64), |
| 1500 | + (:sgemmt_,:Float32), |
| 1501 | + (:zgemmt_,:ComplexF64), |
| 1502 | + (:cgemmt_,:ComplexF32)) |
| 1503 | + @eval begin |
| 1504 | + # SUBROUTINE DGEMMT(UPLO,TRANSA,TRANSB,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) |
| 1505 | + # * .. Scalar Arguments .. |
| 1506 | + # DOUBLE PRECISION ALPHA,BETA |
| 1507 | + # INTEGER K,LDA,LDB,LDC,N |
| 1508 | + # CHARACTER UPLO,TRANSA,TRANSB |
| 1509 | + # * .. Array Arguments .. |
| 1510 | + # DOUBLE PRECISION A(LDA,*),B(LDB,*),C(LDC,*) |
| 1511 | + function gemmt!(uplo::AbstractChar, transA::AbstractChar, transB::AbstractChar, |
| 1512 | + alpha::Union{($elty), Bool}, |
| 1513 | + A::AbstractVecOrMat{$elty}, B::AbstractVecOrMat{$elty}, |
| 1514 | + beta::Union{($elty), Bool}, |
| 1515 | + C::AbstractVecOrMat{$elty}) |
| 1516 | + chkuplo(uplo) |
| 1517 | + require_one_based_indexing(A, B, C) |
| 1518 | + m = size(A, transA == 'N' ? 1 : 2) |
| 1519 | + ka = size(A, transA == 'N' ? 2 : 1) |
| 1520 | + kb = size(B, transB == 'N' ? 1 : 2) |
| 1521 | + n = size(B, transB == 'N' ? 2 : 1) |
| 1522 | + if ka != kb || m != n || m != size(C,1) || n != size(C,2) |
| 1523 | + throw(DimensionMismatch(lazy"A has size ($m,$ka), B has size ($kb,$n), C has size $(size(C))")) |
| 1524 | + end |
| 1525 | + chkstride1(A) |
| 1526 | + chkstride1(B) |
| 1527 | + chkstride1(C) |
| 1528 | + ccall((@blasfunc($gemmt), libblastrampoline), Cvoid, |
| 1529 | + (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, |
| 1530 | + Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, |
| 1531 | + Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, |
| 1532 | + Ref{BlasInt}, Clong, Clong, Clong), |
| 1533 | + uplo, transA, transB, n, |
| 1534 | + ka, alpha, A, max(1,stride(A,2)), |
| 1535 | + B, max(1,stride(B,2)), beta, C, |
| 1536 | + max(1,stride(C,2)), 1, 1, 1) |
| 1537 | + C |
| 1538 | + end |
| 1539 | + function gemmt(uplo::AbstractChar, transA::AbstractChar, transB::AbstractChar, alpha::($elty), A::AbstractMatrix{$elty}, B::AbstractMatrix{$elty}) |
| 1540 | + gemmt!(uplo, transA, transB, alpha, A, B, zero($elty), similar(B, $elty, (size(A, transA == 'N' ? 1 : 2), size(B, transB == 'N' ? 2 : 1)))) |
| 1541 | + end |
| 1542 | + function gemmt(uplo::AbstractChar, transA::AbstractChar, transB::AbstractChar, A::AbstractMatrix{$elty}, B::AbstractMatrix{$elty}) |
| 1543 | + gemmt(uplo, transA, transB, one($elty), A, B) |
| 1544 | + end |
| 1545 | + end |
| 1546 | +end |
| 1547 | + |
| 1548 | +""" |
| 1549 | + gemmt(uplo, tA, tB, alpha, A, B) |
| 1550 | +
|
| 1551 | +Return the lower or upper triangular part specified by [`uplo`](@ref stdlib-blas-uplo) of `A*B` or the other three variants according to [`tA`](@ref stdlib-blas-trans) and `tB`. |
| 1552 | +
|
| 1553 | +!!! compat "Julia 1.11" |
| 1554 | + `gemmt` requires at least Julia 1.11. |
| 1555 | +""" |
| 1556 | +gemmt(uplo, tA, tB, alpha, A, B) |
| 1557 | + |
| 1558 | +""" |
| 1559 | + gemmt(uplo, tA, tB, A, B) |
| 1560 | +
|
| 1561 | +Return the lower or upper triangular part specified by [`uplo`](@ref stdlib-blas-uplo) of `A*B` or the other three variants according to [`tA`](@ref stdlib-blas-trans) and `tB`. |
| 1562 | +
|
| 1563 | +!!! compat "Julia 1.11" |
| 1564 | + `gemmt` requires at least Julia 1.11. |
| 1565 | +""" |
| 1566 | +gemmt(uplo, tA, tB, A, B) |
| 1567 | + |
1484 | 1568 | """
|
1485 | 1569 | gemm!(tA, tB, alpha, A, B, beta, C)
|
1486 | 1570 |
|
|
0 commit comments