Skip to content

Instantly share code, notes, and snippets.

@tuckerzp
Created October 10, 2019 23:19
Show Gist options
  • Save tuckerzp/c887836a9e0a4a0a735b3a644119cfd3 to your computer and use it in GitHub Desktop.
Save tuckerzp/c887836a9e0a4a0a735b3a644119cfd3 to your computer and use it in GitHub Desktop.
/* Compute prefix sum of vector a */
void psum1(float a[], float p[], long n) {
float l_v, v;
l_v = p[0] = a[0];
for (long i = 0; i < n; i++) {
v = l_v + a[i];
p[i] = v;
l_v = v;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment