Add GPU workgroup barrier via __sync_threads and Barrier.arrive_and_w… - #27
Merged
K-T0BIAS merged 1 commit intoSep 16, 2026
Conversation
…ait. Lower both call forms to the same GLSL barrier and memoryBarrierShared through a CallPlugin, wire Call expr-stmts on the GPU path, and export a sync stub.
K-T0BIAS
merged commit Sep 16, 2026
d3203ac
into
4-native-gpu-support-cthreads-for-vulkanspir-v
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a workgroup-scoped GPU barrier on the
@Gpupath. CUDA-style__sync_threads()and beginner-friendlyBarrier.arrive_and_wait()both lowerto the same GLSL
barrier()/memoryBarrierShared(). RejectsBarrier(...)construction inside
@Gpu. CPUBarrier(parties)is unchanged.Features
cthreads.sync.__sync_threads: compile-only stub; RuntimeError in plain PythonSyncThreadsPlugin: matches__sync_threads()andBarrier.arrive_and_wait()GpuFlow.expr_stmt: Call statements lower via CallPlugins (needed for barriers)Barrier(4)rejected