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

Any problems calling vml routines this way ??

Deleted_U_Intel
Employee
174 Views

I have been playing around with ways to use vml functions more efficiently and have come up with the following technique (c++/cli) which appears to work faster, and take up less memory (than having the last parameter be a blank target array).

Can anyone tell me if there might be any issues calling the functions this way ??

//////////////////////
// CODE SNIPPET //
// __cdecl //
//////////////////////

#define N 5
int n = N;
array^ x = gcnew array(N);
array^ y = gcnew array(N);

for(i = 0; i < n; i++){
x = static_cast(i);
y = static_cast(i * 2.0);
}

pin_ptr xptr = &x[0];
pin_ptr yptr = &y[0];

vdmul( &n, xptr, yptr, yptr );

for (i = 0; i < n; i++)
{
Console::Write(y + " ");
}

// Pls note that using the c-interface in this way will throw an error
// i.e. vdAdd(n, x, y, y); //c2664 error

0 Kudos
0 Replies
Reply