Skip to content

Don't report write races for loops that have a single iteration#1007

Open
majosm wants to merge 2 commits intoinducer:mainfrom
majosm:ignore-single-iteration-write-races
Open

Don't report write races for loops that have a single iteration#1007
majosm wants to merge 2 commits intoinducer:mainfrom
majosm:ignore-single-iteration-write-races

Conversation

@majosm
Copy link
Copy Markdown
Contributor

@majosm majosm commented May 6, 2026

When realize_reduction generates code for thread-parallel reductions, the last stage of the reduction is a loop nest over workgroup and thread that assigns to a variable that is only indexed by workgroup. check_for_write_races reports this as a race, but since the thread loop only has one iteration (thread 0), it isn't really. This change tightens the race check to avoid the false positive.

@majosm majosm force-pushed the ignore-single-iteration-write-races branch from e4aad6b to d6d153c Compare May 6, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant