We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c99f6a commit 57c1b4dCopy full SHA for 57c1b4d
src/graphs.jl
@@ -60,8 +60,16 @@ function stride(var::Variable, sym::Symbol)
60
end
61
function cost(var::Variable, unrolled::Symbol, dim::Int)
62
c = cost(instruction(var), Wshift, T)::Int
63
- if accesses_memory(var) && stride(var, unrolled) != 1
64
- c *= W
+ if accesses_memory(var)
+ # either vbroadcast/reductionstore, vmov(a/u)pd, or gather/scatter
65
+ if (unrolled ∈ loopdependencies(var))
66
+ if (stride(var, unrolled) != 1) # gather/scatter
67
+ c *= W
68
+ # else # vmov(a/u)pd
69
+ end
70
+ elseif sym(var) == :setindex! # broadcast or reductionstore; if store we want to penalize reduction
71
+ c *= 2
72
73
74
c
75
0 commit comments