Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?gemm_compute

Computes a matrix-matrix product with general matrices where one or both input matrices are stored in a packed data structure and adds the result to a scalar-matrix product.

Syntax

call sgemm_compute (transa, transb, m, n, k, a, lda, b, ldb, beta, C, ldc)

call dgemm_compute (transa, transb, m, n, k, a, lda, b, ldb, beta, C, ldc)

Include Files
  • mkl.fi
Description

The ?gemm_compute routine is one of a set of related routines that enable use of an internal packed storage. After calling ?gemm_pack call ?gemm_compute to compute

C := op(A)*op(B) + beta*C,

where:

  • op(X) is one of the operations op(X) = X, op(X) = XT, or op(X) = XH,
  • beta is a scalar,
  • A , B, and C are matrices:
  • op(A) is an m-by-k matrix,
  • op(B) is a k-by-n matrix,
  • C is an m-by-n matrix.

NOTE:

For best performance, use the same number of threads for packing and for computing.

If packing for both A and B matrices, you must use the same number of threads for packing A as for packing B.

Input Parameters
transa

CHARACTER*1. Specifies the form of op(A) used in the matrix multiplication:

If transa = 'N' or 'n'  op(A) = A.

If transa = 'T' or 't'  op(A) = AT.

If transa = 'C' or 'c'  op(A) = AH.

If transa = 'P' or 'p' the matrix in array a is packed and lda is ignored.

transb

CHARACTER*1. Specifies the form of op(B) used in the matrix multiplication:

If transb = 'N' or 'n'  op(B) = B.

If transb = 'T' or 't' op(B) = BT.

If transb = 'C' or 'c' op(B) = BH.

If transb = 'P' or 'p' the matrix in array b is packed and ldb is ignored.

m

INTEGER. Specifies the number of rows of the matrix op(A) and of the matrix C. The value of m must be at least zero.

n

INTEGER. Specifies the number of columns of the matrix op(B) and the number of columns of the matrix C. The value of n must be at least zero.

k

INTEGER. Specifies the number of columns of the matrix op(A) and the number of rows of the matrix op(B). The value of k must be at least zero.

a

REAL for sgemm_compute

DOUBLE PRECISION for dgemm_compute

Array:

transa = 'N' or 'n'

transa = 'T', 't', 'C', or 'c'

transa = 'P' or 'p'

Size lda*k.

Before entry, the leading m-by-k part of the array a must contain the matrix A.

Size lda*m.

Before entry, the leading k-by-m part of the array a must contain the matrix A.

Stored in internal packed format.

lda

INTEGER. Specifies the leading dimension of a as declared in the calling (sub)program.

If transa = 'N' or 'n', lda must be at least max (1, m).

If transa = 'T', 't', 'C', or 'c', lda must be at least max (1, k).

If transa = 'P' or 'p', lda is ignored.

b

REAL for sgemm_compute

DOUBLE PRECISION for dgemm_compute

Array:

transb = 'N' or 'n'

transb = 'T', 't', 'C', or 'c'

transb = 'P' or 'p'

Size ldb*n.

Before entry, the leading k-by-n part of the array b must contain the matrix B.

Size ldb*k.

Before entry, the leading n-by-k part of the array b must contain the matrix B.

Stored in internal packed format.

ldb

INTEGER. Specifies the leading dimension of b as declared in the calling (sub)program.

If transb = 'N' or 'n', ldb must be at least max (1, k).

If transb = 'T', 't', 'C', or 'c', ldb must be at least max (1, n).

If transb = 'P' or 'p', ldb is ignored.

beta

REAL for sgemm_compute

DOUBLE PRECISION for dgemm_compute

Specifies the scalar beta. When beta is equal to zero, then c need not be set on input.

c

REAL for sgemm_compute

DOUBLE PRECISION for dgemm_compute

Array, size ldc by n. Before entry, the leading m-by-n part of the array c must contain the matrix C, except when beta is equal to zero, in which case c need not be set on entry.

ldc

INTEGER. Specifies the leading dimension of c as declared in the calling (sub)program.

The value of ldc must be at least max (1, m).

Output Parameters

c

Overwritten by the m-by-n matrix op(A)*op(B) + beta*C.

See Also