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
I want to get an inner product between two symmetric matrices, and dot seems to dispatch to a pretty slow method.
E.g.
using BenchmarkTools, LinearAlgebra
n =5000;
A =Symmetric(randn(n, n));
B =Symmetric(randn(n, n));
functionsymdot(A::Symmetric{T, Matrix{T}}, B::Symmetric{T, Matrix{T}}) where {T}
ret =zero(T)
m =size(A, 2)
@inboundsfor j in1:m
for i in1:(j -1)
ret += A[i, j] * B[i, j] *2end
ret += A[j, j] * B[j, j]
endreturn ret
end
julia>@benchmarkdot($A, $B)
benchmark symdot($A, $B)
BenchmarkTools.Trial:
memory estimate:0 bytes
allocs estimate:0--------------
minimum time:371.083 ms (0.00% GC)
median time:371.527 ms (0.00% GC)
mean time:371.907 ms (0.00% GC)
maximum time:377.313 ms (0.00% GC)
--------------
samples:14
evals/sample:1
julia>@benchmarksymdot($A, $B)
BenchmarkTools.Trial:
memory estimate:0 bytes
allocs estimate:0--------------
minimum time:39.275 ms (0.00% GC)
median time:39.359 ms (0.00% GC)
mean time:39.378 ms (0.00% GC)
maximum time:39.814 ms (0.00% GC)
--------------
samples:127
evals/sample:1
Any chance of getting a faster dot product in?
This is very specific, but related to #25565 and #16573.
The text was updated successfully, but these errors were encountered:
Might be significantly faster to linearly index into the parents if they are IndexLinear() (and possibly only if the uplos match). Still, that's a common case.
I want to get an inner product between two symmetric matrices, and
dot
seems to dispatch to a pretty slow method.E.g.
Any chance of getting a faster dot product in?
This is very specific, but related to #25565 and #16573.
The text was updated successfully, but these errors were encountered: