The methods in Yeppp! library have two overloads: one that takes array + offset and another that takes pointers (e.g. if you want to call them with stackalloc'ed memory). E.g. for cosine computation Yeppp! offers two overloads:
Yeppp.Math.Cos_V64f_V64f(double[] xArray, int xOffset, double[] yArray, int yOffset, int length)
which operates on array argumentsYeppp.Math.Cos_V64f_V64f(double* x, double* y, int length)
which operates on pointer arguments
Thus, your example should be rewritten as:
double[] ValuesToCalculate = new double[MAX_SIZE];
double[] CalculatedCosines = new double[MAX_SIZE];
long Result;
Result = CalculateCosineArray(ValuesToCalculate, CalculatedCosines);
public static long CalculateCosineArraySIMD(double[] array, double[] result)
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
Yeppp.Math.Cos_V64f_V64f(array, 0, result, 0, MAX_SIZE);
stopwatch.Stop();
return stopwatch.ElapsedMilliseconds;
}
Note that only one call per array is required (even if you used pointers).