Skip to content

Instantly share code, notes, and snippets.

@mellinoe
Created January 6, 2016 21:30
Show Gist options
  • Save mellinoe/f8be93686c98a23800f6 to your computer and use it in GitHub Desktop.
Save mellinoe/f8be93686c98a23800f6 to your computer and use it in GitHub Desktop.
T[] TripleSum(T[] first, T[] second, T[] third)
{
T[] output = new T[first.Length];
for (int i = 0; i < first.Length; i += Vector<T>.Count)
{
Vector<T> a = new Vector<T>(first, i);
Vector<T> b = new Vector<T>(second, i);
Vector<T> c = new Vector<T>(third, i);
Vector<T> sum = a + b + c;
sum.CopyTo(output, i);
}
return T[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment