Skip to content

Instantly share code, notes, and snippets.

@FrankNiemeyer
Created August 28, 2015 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrankNiemeyer/ca7a02c5adb25e0c4e99 to your computer and use it in GitHub Desktop.
Save FrankNiemeyer/ca7a02c5adb25e0c4e99 to your computer and use it in GitHub Desktop.
void dot3_soa_autovec(const vector<float>& xs, const vector<float>& ys, const vector<float>& zs, vector<float>& dp) {
for (auto j = 0; j < reps; ++j) {
for (auto i = 0; i < vector_len; ++i) {
dp[i] = xs[i] * xs[i] + ys[i] * ys[i] + zs[i] * zs[i];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment