Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia keyword local not supported by @turbo #424

Closed
nsajko opened this issue Aug 23, 2022 · 0 comments
Closed

Julia keyword local not supported by @turbo #424

nsajko opened this issue Aug 23, 2022 · 0 comments

Comments

@nsajko
Copy link

nsajko commented Aug 23, 2022

$ julia -O3 --min-optlevel=3 -g 2 --threads 4
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.0 (2022-08-17)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using LoopVectorization

julia> function myminmax(x)
         a = b = first(x)
         for i in eachindex(x)
           local e = x[i]
           b = max(b, e)
           a = min(a, e)
         end
         a, b
       end
myminmax (generic function with 1 method)

julia> function myminmax_turbo(x)
         a = b = first(x)
         @turbo for i in eachindex(x)
           local e = x[i]
           b = max(b, e)
           a = min(a, e)
         end
         a, b
       end
ERROR: LoadError: Don't know how to handle expression.
x[i]
Stacktrace:
  [1] push!(ls::LoopVectorization.LoopSet, ex::Expr, elementbytes::Int64, position::Int64, mpref::Nothing)
    @ LoopVectorization ~/.julia/packages/LoopVectorization/aw6pf/src/modeling/graphs.jl:1657
  [2] push!(ls::LoopVectorization.LoopSet, ex::Expr, elementbytes::Int64, position::Int64, mpref::Nothing)
    @ LoopVectorization ~/.julia/packages/LoopVectorization/aw6pf/src/modeling/graphs.jl:1650
  [3] push!(ls::LoopVectorization.LoopSet, ex::Expr, elementbytes::Int64, position::Int64)
    @ LoopVectorization ~/.julia/packages/LoopVectorization/aw6pf/src/modeling/graphs.jl:1617
  [4] add_block!
    @ ~/.julia/packages/LoopVectorization/aw6pf/src/modeling/graphs.jl:927 [inlined]
  [5] add_loop!(ls::LoopVectorization.LoopSet, q::Expr, elementbytes::Int64)
    @ LoopVectorization ~/.julia/packages/LoopVectorization/aw6pf/src/modeling/graphs.jl:1264
  [6] copyto!
    @ ~/.julia/packages/LoopVectorization/aw6pf/src/constructors.jl:15 [inlined]
  [7] LoopVectorization.LoopSet(q::Expr, mod::Symbol)
    @ LoopVectorization ~/.julia/packages/LoopVectorization/aw6pf/src/constructors.jl:84
  [8] LoopVectorization.LoopSet(q::Expr, m::Module)
    @ LoopVectorization ~/.julia/packages/LoopVectorization/aw6pf/src/constructors.jl:88
  [9] turbo_macro(::Module, ::LineNumberNode, ::Expr)
    @ LoopVectorization ~/.julia/packages/LoopVectorization/aw6pf/src/constructors.jl:227
 [10] var"@turbo"(__source__::LineNumberNode, __module__::Module, args::Vararg{Any})
    @ LoopVectorization ~/.julia/packages/LoopVectorization/aw6pf/src/constructors.jl:330
in expression starting at REPL[3]:3
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant