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 1.9 error: @turbo for empty iterator #492

Closed
kongdd opened this issue May 11, 2023 · 3 comments
Closed

Julia 1.9 error: @turbo for empty iterator #492

kongdd opened this issue May 11, 2023 · 3 comments

Comments

@kongdd
Copy link

kongdd commented May 11, 2023

using LoopVectorization

Nu = 0
@turbo for i  3:2
  Nu += 1
end

Nu
ERROR: DivideError: integer division error
Stacktrace:
  [1] div
    @ .\int.jl:295 [inlined]
  [2] div
    @ .\div.jl:308 [inlined]
  [3] div
    @ .\div.jl:363 [inlined]
  [4] cld
    @ .\div.jl:320 [inlined]
  [5] evaluate_cost_unroll(ls::LoopVectorization.LoopSet, order::Vector{Symbol}, vloopsym::Symbol, max_cost::Float64, sld::Vector{Vector{Symbol}})
    @ LoopVectorization C:\Users\hydro\.julia\packages\LoopVectorization\5ukqQ\src\modeling\determinestrategy.jl:214 
  [6] choose_unroll_order(ls::LoopVectorization.LoopSet, lowest_cost::Float64, sld::Vector{Vector{Symbol}}, v::Int64)

    @ LoopVectorization C:\Users\hydro\.julia\packages\LoopVectorization\5ukqQ\src\modeling\determinestrategy.jl:1644

  [7] choose_order_cost(ls::LoopVectorization.LoopSet, v::Int64)
    @ LoopVectorization C:\Users\hydro\.julia\packages\LoopVectorization\5ukqQ\src\modeling\determinestrategy.jl:1821

  [8] choose_order_cost
    @ C:\Users\hydro\.julia\packages\LoopVectorization\5ukqQ\src\modeling\determinestrategy.jl:1809 [inlined]        
  [9] lower
    @ C:\Users\hydro\.julia\packages\LoopVectorization\5ukqQ\src\codegen\lowering.jl:1290 [inlined]
 [10] lower_and_split_loops(ls::LoopVectorization.LoopSet, inline::Int64)
    @ LoopVectorization C:\Users\hydro\.julia\packages\LoopVectorization\5ukqQ\src\codegen\split_loops.jl:141        
 [11] avx_body(ls::LoopVectorization.LoopSet, UNROLL::Tuple{Bool, Int8, Int8, Int8, Bool, Int64, Int64, Int64, Int64, UInt64, Int64, Bool})
    @ LoopVectorization C:\Users\hydro\.julia\packages\LoopVectorization\5ukqQ\src\reconstruct_loopset.jl:1014       
 [12] #s221#85
    @ C:\Users\hydro\.julia\packages\LoopVectorization\5ukqQ\src\reconstruct_loopset.jl:1162 [inlined]
 [13] var"#s221#85"(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, vargs#::Any, ::Any, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Any, var#arguments#::Any)
    @ LoopVectorization .\none:0
 [14] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any})
    @ Core .\boot.jl:602
 [15] top-level scope
@chriselrod
Copy link
Member

chriselrod commented May 11, 2023

@turbo check_empty=true

julia> @turbo check_empty=true for i  3:2
         Nu += 1
       end

@kongdd
Copy link
Author

kongdd commented May 11, 2023

Got it. Thank u very much!

@kongdd kongdd closed this as completed May 11, 2023
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

2 participants