@@ -90,7 +90,10 @@ function transform_gpu!(def, constargs, force_inbounds, unsafe_indices)
9090 pushfirst! (def[:args ], :__ctx__ )
9191 new_stmts = Expr[]
9292 body = MacroTools. flatten (def[:body ])
93- push! (new_stmts, Expr (:aliasscope ))
93+ # On 1.11 and later having this aliasscope causes issues
94+ # even with kernels that don't use `@Const` on arguments
95+ # See https://github.com/JuliaGPU/KernelAbstractions.jl/issues/652
96+ # push!(new_stmts, Expr(:aliasscope))
9497 if ! unsafe_indices
9598 push! (new_stmts, :(__active_lane__ = $ __validindex (__ctx__)))
9699 end
@@ -105,7 +108,7 @@ function transform_gpu!(def, constargs, force_inbounds, unsafe_indices)
105108 if force_inbounds
106109 push! (new_stmts, Expr (:inbounds , :pop ))
107110 end
108- push! (new_stmts, Expr (:popaliasscope ))
111+ # push!(new_stmts, Expr(:popaliasscope))
109112 push! (new_stmts, :(return nothing ))
110113 def[:body ] = Expr (
111114 :let ,
@@ -132,15 +135,18 @@ function transform_cpu!(def, constargs, force_inbounds)
132135 pushfirst! (def[:args ], :__ctx__ )
133136 new_stmts = Expr[]
134137 body = MacroTools. flatten (def[:body ])
135- push! (new_stmts, Expr (:aliasscope ))
138+ # On 1.11 and later having this aliasscope causes issues
139+ # even with kernels that don't use `@Const` on arguments
140+ # See https://github.com/JuliaGPU/KernelAbstractions.jl/issues/652
141+ # push!(new_stmts, Expr(:aliasscope))
136142 if force_inbounds
137143 push! (new_stmts, Expr (:inbounds , true ))
138144 end
139145 append! (new_stmts, split (emit_cpu, body. args))
140146 if force_inbounds
141147 push! (new_stmts, Expr (:inbounds , :pop ))
142148 end
143- push! (new_stmts, Expr (:popaliasscope ))
149+ # push!(new_stmts, Expr(:popaliasscope))
144150 push! (new_stmts, :(return nothing ))
145151 def[:body ] = Expr (
146152 :let ,
0 commit comments