I am wondering which I should use in my code, for example if I do matrix multiplication A(100,100)*B(100,100), matmul(A,B) or gemm()?
The same uncertainty for other functions, e.g. dot_product, and those VML functions, e.g. exp(A) v.s. vsexp().
Let's ignore parallelization, because mostly I do these operations for each openmp thread.
MKL DGEMM is well optimized for the large problem size. For the matrix size of (100,100), dgemm expect to have a better performance. There is a post discussed here: http://software.intel.com/en-us/forums/topic/269726
matmul may be faster in a very small case, but for large problem size, MKL is well optimized and have performance.
For the VML functions, both MKL and compiler provides vectorized functions and have good performance. In the MKL , it also provide precision control ( by setting VML_HA/VML_LA/VML_EP), so it provide more options to balance the precision and performance.
For some dot_product function, the code is very simple. The compiler could well optimize the code,so Both the compiler and MKL can have good performance there.