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

Simple MKL VML test in Visual Studio .Net

nupshur
Beginner
562 Views

Hi,

I have a simple loop that computes an exponential of anarrayof doubles with 5000 elements (I've tried many different sizes - same result). Replacing this loop with a call to vdExp degrades performance significantly. I've run the test in Visual Studio .Net in both Debug and Release modes -- doesn't matter. Here's the code:

double *arr = new double[5000];

for (int j = 1; j < 5000; ++j)

arr = 5.99;

double *result = new double[5000];

for

(int i = 0; i < 5000; ++i) {

result = exp(arr);

// replace this loop with vdExp(5000, arr, result)

}

VML performance is worse both with the VS compiler and the Intel 9.1 compiler. Am I missing something?

0 Kudos
3 Replies
TimP
Honored Contributor III
562 Views
Without a complete example, we can't see whether you are permitting the compiler to optimize away your test. You leave open the possibility that a single exp() function result could be copied across the entire array, or that your result array is unused, so the compiler can see that it need not be computed. If you did compute the entire array, allowing auto-vectorization, the Intel compiler should invoke svml library, which would be much faster than the Microsoft library. You would see vectorization reported on the screen when you compile.
0 Kudos
nupshur
Beginner
562 Views
Compiler optimizations are turned off by default in Debug mode. And yes, the Intel compiler is much faster than the Microsoft one, presumably because of SVML. But VML is an order of magnitude slower than unoptimized code produced by the Microsoft compiler. Doesn't matter whether I use the result array afterwards or populate the argument array with random values -- same result. The code I posted is the exact code I ran in Visual Studio.
0 Kudos
Chao_Y_Intel
Moderator
562 Views

Hi,

Could you let us know which platform (IA32, EM64T or Itanium) and MKL version you are using now? We got one performance issue with VML functions on Itanium platforms before. We expect to fixed the problem in the latest Intel MKL 9.0 Bata release.

Could you let us know a bit more about your system?

Regards,
Chao Y.
Intel Corp.


0 Kudos
Reply