You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the general issue name but im not sure yet what is actually slower.
I was looking into doing matrix multiplication with tuples and stumbled upon a performance regression that might be interesting.
Script:
typealias Mat{M, N, T} NTuple{M, NTuple{N, T}}
# Generates expression for an unrolled matrix multiply@generatedfunctionunrolled_matmult_noinline{T, M, N, K}(A::Mat{M, N, T}, B::Mat{N, K, T})
ex =Expr(:tuple, [Expr(:tuple, [:(loopdot_noinline(A, B, $i, $j)) for j=1:N]...) for i=1:N]...)
return ex
end# Does the contraction on K@noinlinefunctionloopdot_noinline{M, N, K, T}(A::Mat{M,K,T}, B::Mat{K,N,T}, Arow, Bcol)
s =zero(T)
for k =1:K
s += A[Arow][k] * B[k][Bcol]
end
s
end# Creates a random tuple@generatedfunctionrand_tuple{N, T}(::Type{Mat{N,N,T}})
return ex =Expr(:tuple, [Expr(:tuple, [rand(T) for j=1:N]...) for i=1:N]...)
endfunctionbench_noinline{N}(::Type{Val{N}})
A =rand_tuple(Mat{N,N, Float64})
@timefor i in1:10^5unrolled_matmult_noinline(A, A)
endendfor i in1:9bench_noinline(Val{i})
end
Sorry for the general issue name but im not sure yet what is actually slower.
I was looking into doing matrix multiplication with tuples and stumbled upon a performance regression that might be interesting.
Script:
0.4.3:
Master:
Note that the inlined version is about the same on both versions.
The text was updated successfully, but these errors were encountered: