JuliaSIMD / Polyester.jl

The cheapest threads you can find!
MIT License
240 stars 13 forks source link

Broadcasts in `@batch` raise `UndefVarError` #143

Closed Keluaa closed 5 months ago

Keluaa commented 5 months ago

Currently using Julia v1.10.2, with Polyester v0.7.12.

MWE (with Julia launched with 2+ threads):

julia> using Polyester

julia> function dummy_broadcast()
           @batch for i in 1:2
               a = (1,) .+ (1,)
           end
       end
dummy_broadcast (generic function with 1 method)

julia> dummy_broadcast()
ERROR: UndefVarError: `.+` not defined
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/Polyester/97EOv/src/closure.jl:455 [inlined]
 [2] dummy_broadcast()
   @ Main ./REPL[2]:2
 [3] top-level scope
   @ REPL[3]:1

This is caused by this change, since isdefined(Main, :var".+") == false we get a different behavior from v0.7.11.