Created
August 28, 2015 16:26
-
-
Save FrankNiemeyer/bb74e23c059ffd433edb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Dot3AosGather(Vector3[] vs, float[] dp) { | |
var xtmp = new float[laneWidth]; | |
var ytmp = new float[laneWidth]; | |
var ztmp = new float[laneWidth]; | |
for (var j = 0; j < reps; ++j) { | |
for (var i = 0; i < dp.Length; i += laneWidth) { | |
for (var k = 0; k < laneWidth; ++k) { | |
xtmp[k] = vs[i + k].X; | |
ytmp[k] = vs[i + k].Y; | |
ztmp[k] = vs[i + k].Z; | |
} | |
var x = new Vector<float>(xtmp); | |
var y = new Vector<float>(ytmp); | |
var z = new Vector<float>(ztmp); | |
var dpv = x * x + y * y + z * z; | |
dpv.CopyTo(dp, i); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment