Any problems calling vml routines this way ??

Any problems calling vml routines this way ??

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[i] = static_cast(i);
y[i] = 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[i] + " ");
}

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

1 contribution / 0 nouveau(x)
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.