Skip to content

Commit

Permalink
unsafe indices disable avx
Browse files Browse the repository at this point in the history
closes #27
  • Loading branch information
Michael Abbott committed Aug 18, 2020
1 parent aa2137f commit 65b0555
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/macro.jl
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ detectunsafe(expr, store) = MacroTools_postwalk(expr) do ex
unique!(store.unsafeind)
# and don't compute a gradient for the inner array
B isa Symbol && push!(store.nograd, B)
# Any unsafe index turns off @avx, https://github.com/chriselrod/LoopVectorization.jl/issues/145
store.axv = false
x
end
end
Expand Down Expand Up @@ -690,6 +692,9 @@ function action_functions(store)
# divides axisred up with re-starts, and treads axisunsafe like scalar arguments.
# This is independent of the grouping inner/outer for make_many_actors().

# (Not entirely sure that unsafe couldn't be lumped with axisred?)
# (Also not sure that unsafe-ness shouldn't be LHR/RHS for fwd/grad?)

#===== constructing loops =====#

init = store.redfun == :* ? :(one($TYP)) :
Expand Down

0 comments on commit 65b0555

Please sign in to comment.