mkl_jit_get_?gemm_ptr
mkl_jit_get_?gemm_ptr
Return the GEMM kernel associated with a jitter previously created with
mkl_jit_create_?gemm
.Syntax
sgemm_jit_kernel_t
mkl_jit_get_sgemm_ptr
(
const
void*
jitter
);
dgemm_jit_kernel_t
mkl_jit_get_dgemm_ptr
(
const
void*
jitter
);
cgemm_jit_kernel_t
mkl_jit_get_cgemm_ptr
(
const
void*
jitter
);
zgemm_jit_kernel_t
mkl_jit_get_zgemm_ptr
(
const
void*
jitter
);
Include Files
- mkl.h
Description
The
mkl_jit_get_?gemm_ptr
functions belong to a set of related routines that enable use of just-in-time code generation.The
mkl_jit_get_?gemm_ptr
functions take as input a jitter previously created with mkl_jit_create_?gemm
, and return the GEMM kernel associated with that jitter. The returned GEMM kernel computes a scalar-matrix-matrix product and adds the result to a scalar-matrix product, with general matrices. The operation is defined as follows:C := alpha*op(A)*op(B) + beta*C
Where:
- op(X)is one ofop(X) = Xorop(X) = XorTop(X) = XH
- alphaandbetaare scalars
- A,B, andCare matrices
- op(A)is anm-by-kmatrix
- op(B)is ak-by-nmatrix
- C is anm-by-nmatrix
Generating a new kernel with
mkl_jit_create_?gemm
involves moderate runtime overhead. To benefit from JIT code generation, use this feature when you need to call the generated kernel many times (for example, several hundred calls).Input Parameter
- jitter
- Handle to the code generator.
Return Values
- func
- sgemm_jit_kernel_t– A function pointer type expecting four inputs of typevoid*,float*,float*, andfloat*typedef void (*sgemm_jit_kernel_t)(void*,float*,float*,float*);
- dgemm_jit_kernel_t– A function pointer type expecting four inputs of typevoid*,double*,double*, anddouble*typedef void(*dgemm_jit_kernel_t)(void*,double*,double*,double*);
- cgemm_jit_kernel_t– A function pointer type expecting four inputs of typevoid*,MKL_Complex8*,MKL_Complex8*, andMKL_Complex8*typedef void(*cgemm_jit_kernel_t)(void*,MKL_Complex8*,MKL_Complex8*,MKL_Complex8*);
- zgemm_jit_kernel_t– A function pointer type expecting four inputs of typevoid*,MKL_Complex16*,MKL_Complex16*, andMKL_Complex16*typedef void(*zgemm_jit_kernel_t)(void*,MKL_Complex16*,MKL_Complex16*,MKL_Complex16*);
Returns a function pointer to a GEMM kernel. The GEMM kernel is called with four parameters: the jitter, and the three matricesa,b, andc.
If
layout
, transa
, transb
, m
, n
, k
, lda
, ldb
, and ldc
are the parameters used during the creation of the input jitter, then:- a
- layout=MKL_COL_MAJORlayout=MKL_ROW_MAJORtransa=MKL_NOTRANSArray of sizelda*kBefore calling the returned function pointer, the leadingm-by-kpart of the arrayamust contain the matrix A.Array of sizelda*mBefore calling the returned function pointer, the leadingk-by-mpart of the arrayamust contain the matrix A.transa=MKL_TRANSortransa=MKL_CONJTRANSArray of sizelda*mBefore calling the returned function pointer, the leadingk-by-mpart of the arrayamust contain the matrix A.Array of sizelda*kBefore calling the returned function pointer, the leadingm-by-kpart of the arrayamust contain the matrix A.
- b
- layout=MKL_COL_MAJORlayout=MKL_ROW_MAJORtransb=MKL_NOTRANSArray of sizeldb*nBefore calling the returned function pointer, the leadingk-by-npart of the arraybmust contain the matrix B.Array of sizeldb*kBefore calling the returned function pointer, the leadingn-by-kpart of the arraybmust contain the matrix B.transb=MKL_TRANSortransb=MKL_CONJTRANSArray of sizeldb*kBefore calling the returned function pointer, the leadingn-by-kpart of the arraybmust contain the matrix B.Array of sizeldb*nBefore calling the returned function pointer, the leadingk-by-npart of the arraybmust contain the matrix B.
- c
- layout=MKL_COL_MAJORlayout=MKL_ROW_MAJORArray of sizeldc*nBefore calling the returned function pointer, the leadingm-by-npart of the arraycmust contain the matrix C.Array of sizeldc*mBefore calling the returned function pointer, the leadingn-by-mpart of the arraycmust contain the matrix C.