Intel® Math Kernel Library 2019 Developer Reference - Fortran

mkl_jit_create_?gemm

Create a GEMM kernel that computes a scalar-matrix-matrix product and adds the result to a scalar-matrix product.

Syntax

status = mkl_jit_create_sgemm(jitter, transa, transb, m, n, k, alpha, lda, ldb, beta, ldc)

status = mkl_jit_create_dgemm(jitter, transa, transb, m, n, k, alpha, lda, ldb, beta, ldc)

Include Files

Description

The mkl_jit_create_?gemm functions belong to a set of related routines that enable use of just-in-time code generation.

The mkl_jit_create_?gemm functions create a handle on a jitter and generate a GEMM kernel that computes a scalar-matrix-matrix product and adds the result to a scalar-matrix product, with general matrices. The operation of the generated GEMM kernel is defined as follows:

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

Where:

Note

Just-in-time (JIT) code generation introduces a runtime overhead when calling mkl_jit_create_?gemm. To benefit from JIT code generation, use this feature when you need to call the generated kernel many times (for example, several hundred calls).

Note

The JIT API requires Fortran 90 and the ISO_C_BINDING module.

Input Parameters

transa

CHARACTER*1.

Specifies the form of op(A) used in the generated matrix multiplication:

  • if transa = 'N', then op(A) = A
  • if transa = 'T', then op(A) = AT

transb

CHARACTER*1.

Specifies the form of op(B) used in the generated matrix multiplication:

  • if transb = 'N', then op(B) = B
  • if transb = 'T', then op(B) = BT

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 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.

alpha

REAL for mkl_jit_create_sgemm

DOUBLE PRECISION for mkl_jit_create_dgemm.

Specifies the scalar alpha.

lda

INTEGER.

Specifies the leading dimension of a.

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

  • If transa = 'T'lda must be at least max(1,k).

ldb

INTEGER.

Specifies the leading dimension of b:

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

  • If transb = 'T'ldb must be at least max(1,n).

beta

REAL for mkl_jit_create_sgemm

DOUBLE PRECISION for mkl_jit_create_dgemm.

Specifies the scalar beta.

ldc

INTEGER.

Specifies the leading dimension of c which must be at least max(1,m).

Output Parameters

jitter

TYPE(C_PTR). C pointer to a jitter handle.

Return Values

status

INTEGER

Returns one of the following:

  • MKL_JIT_ERROR if the handle cannot be created (no memory)

    —or—

  • MKL_JIT_SUCCESS if the jitter has been created and a GEMM kernel JIT-ed

    —or—

  • MKL_NO_JIT if the jitter has been created and the GEMM kernel will point to a standard GEMM function