Skip to content

Commit ce95488

Browse files
committed
move uniform and localmem outside control-flow
1 parent b1f8a03 commit ce95488

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/macros.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ function transform_gpu!(def, constargs, force_inbounds)
105105
push!(new_stmts, stmt)
106106
continue
107107
end
108+
if @capture(stmt, @uniform x_)
109+
push!(new_stmts, stmt)
110+
continue
111+
elseif @capture(stmt, lhs_ = rhs_ | (vs__, lhs_ = rhs_))
112+
if @capture(rhs, @localmem(args__) | @uniform(args__))
113+
push!(new_stmts, stmt)
114+
continue
115+
end
116+
end
108117
push!(active_stmts, stmt)
109118
end
110119
push!(new_stmts, Expr(:if, :__active_lane__, Expr(:block, active_stmts...)))

0 commit comments

Comments
 (0)