diff --git a/content/english/hpc/simd/reduction.md b/content/english/hpc/simd/reduction.md index 89678103..f5111175 100644 --- a/content/english/hpc/simd/reduction.md +++ b/content/english/hpc/simd/reduction.md @@ -40,7 +40,8 @@ int sum_simd(v8si *a, int n) { // add the remainder of a for (int i = n / 8 * 8; i < n; i++) - res += a[i]; + for(int j = 0; j < 8; j++) + res += a[i][j]; return res; }