Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

A question on syntax of ?gemm.

woshiwuxin
Novice
195 Views

Hi, eveyone. I have a simple question on the syntax of ?gemm.

In Intel MKL Reference Manual, the syntax of dgemm is

dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)

The parameter description of beta is "When beta is equal to zero, then c need not be set on input". I just don't quite understand the meaning of "c need not be set on input". If I merely want to do a matrix multiplication, say c=matmul(a,b). According to the description of ?gemm, c:=alpha*op(a)*op(b)+beta*c, I set beta equal zero. I expect the result should be c:=alpha*op(a)*op(b), however, what I get is c equals zero! So, what's the problem? What's the meaning of "c need not be set on input"?

Thanks in advance!

0 Kudos
1 Reply
barragan_villanueva_
Valued Contributor I
195 Views

Hi,

In case if beta is equal to zero matrix c will not be as input matrix and therefore c:=alpha*op(a)*op(b).

But if c matrix is set with all rezos on input and beta is not equal to zero then the result will be the samebut withjust worseperformance.

0 Kudos
Reply