Skip to content

Commit c42d272

Browse files
committed
docs: add sqrtf/fabsf rule and OMP parallel printf anti-pattern
1 parent ff6a1f7 commit c42d272

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.agents/rules/performance-practices.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,9 @@ non-GCC compilers.
201201
magnitude.
202202
- Do not use standalone `if` for datatype
203203
dispatch — always use `else if` chains.
204+
- Do not place `printf()` or `fflush()` inside
205+
`#pragma omp parallel` regions. In a parallel
206+
region all threads execute the call,
207+
causing N simultaneous kernel writes.
208+
Guard with `if(VERBOSE > 0)` and/or
209+
`#pragma omp master`.

0 commit comments

Comments
 (0)