Skip to content

Commit c17fad7

Browse files
committed
06-optimisation.md: fix simd mask pseudocode
1 parent 3be6f90 commit c17fad7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/06-optimisation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ if ( (tid%2) == 0) {
288288
```cpp
289289
bool mask = (tid%2) == 0;
290290
c[tid] = mask*(b[tid]-a[tid]);
291-
c[tid] += mask*(a[tid]-b[tid]);
291+
c[tid] += (!mask)*(a[tid]-b[tid]);
292292
```
293293
"Solution"
294294
```cpp

0 commit comments

Comments
 (0)