Skip to content

Commit b1f8a03

Browse files
committed
make sure barrier is not inside if
1 parent da904eb commit b1f8a03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/macros.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ function transform_gpu!(def, constargs, force_inbounds)
9898
# fix convergence
9999
active_stmts = Any[]
100100
for stmt in stmts
101-
push!(active_stmts, stmt)
102101
has_sync = find_sync(stmt)
103102
if has_sync
104103
push!(new_stmts, Expr(:if, :__active_lane__, Expr(:block, active_stmts...)))
105104
empty!(active_stmts)
105+
push!(new_stmts, stmt)
106+
continue
106107
end
108+
push!(active_stmts, stmt)
107109
end
108110
push!(new_stmts, Expr(:if, :__active_lane__, Expr(:block, active_stmts...)))
109111
if force_inbounds

0 commit comments

Comments
 (0)