Skip to content

Commit

Permalink
use nothing instead
Browse files Browse the repository at this point in the history
Update simdloop.jl
  • Loading branch information
N5N3 committed Dec 6, 2021
1 parent 1692bb3 commit bbf2dbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/simdloop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function compile(x, ivdep)
(isa(x, Expr) && x.head === :for) || throw(SimdError("for loop expected"))
length(x.args) == 2 || throw(SimdError("1D for loop expected"))
check_body!(x)

ivdepend = ivdep === nothing ? nothing : Symbol("julia.ivdep.end")
var, range = parse_iteration_space(x.args[1])
r = gensym("r") # Range value
j = gensym("i") # Iteration variable for outer loop
Expand All @@ -77,7 +77,7 @@ function compile(x, ivdep)
local $var = Base.simd_index($r, $j, $i)
$(x.args[2]) # Body of loop
$i += 1
$(Expr(:loopinfo, Symbol("julia.simdloop"), Symbol("julia.ivdep.end"))) # Mark loop as SIMD loop
$(Expr(:loopinfo, Symbol("julia.simdloop"), ivdepend)) # Mark loop as SIMD loop
end
end
end
Expand Down Expand Up @@ -126,7 +126,7 @@ either case, your inner loop should have the following properties to allow vecto
* No iteration ever waits on a previous iteration to make forward progress.
"""
macro simd(forloop)
esc(compile(forloop, Symbol("julia.ivdep.end")))
esc(compile(forloop, nothing))
end

macro simd(ivdep, forloop)
Expand Down

0 comments on commit bbf2dbb

Please sign in to comment.