Skip to content

Commit 54fbcb6

Browse files
committed
Handle transposed StaticStridedPointers well, rearrange tests to perform matmul tests last.
1 parent ee20262 commit 54fbcb6

File tree

2 files changed

+1384
-1376
lines changed

2 files changed

+1384
-1376
lines changed

src/reconstruct_loopset.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,13 @@ function add_mref!(ls::LoopSet, ars::ArrayRefStruct, arraysymbolinds::Vector{Sym
9090
end
9191
function add_mref!(ls::LoopSet, ars::ArrayRefStruct, arraysymbolinds::Vector{Symbol}, opsymbols::Vector{Symbol}, i::Int, ::Type{StaticStridedStruct{T, X}}) where {T, X <: Tuple}
9292
ar = ArrayReferenceMeta(ls, ars, arraysymbolinds, opsymbols, Symbol(""), gensym())
93-
pushpreamble!(ls, Expr(:(=), vptr(ar), Expr(:macrocall, Symbol("@inbounds"), LineNumberNode(@__LINE__, @__FILE__), Expr(:ref, :vargs, i))))
94-
pushfirst!(getindices(ar), Symbol("##DISCONTIGUOUSSUBARRAY##"))
93+
if last(X.parameters)::Int == 1
94+
reverse!(ar.loopedindex); reverse!(getindices(ar))
95+
pushpreamble!(ls, Expr(:(=), vptr(ar), Expr(:call, lv(:Transpose), Expr(:macrocall, Symbol("@inbounds"), LineNumberNode(@__LINE__, @__FILE__), Expr(:ref, :vargs, i)))))
96+
else
97+
pushpreamble!(ls, Expr(:(=), vptr(ar), Expr(:macrocall, Symbol("@inbounds"), LineNumberNode(@__LINE__, @__FILE__), Expr(:ref, :vargs, i))))
98+
pushfirst!(getindices(ar), Symbol("##DISCONTIGUOUSSUBARRAY##"))
99+
end
95100
ar
96101
end
97102
function add_mref!(ls::LoopSet, ars::ArrayRefStruct, arraysymbolinds::Vector{Symbol}, opsymbols::Vector{Symbol}, i::Int, ::Type{LoopValue})

0 commit comments

Comments
 (0)