3 ms·
Really well with LoopVectorization The following code is 4x faster than openblas for small matrices, and 10% faster at 1000x1000. It still loses to MKL at large
by adgjlsfhk1 5y ago
Really well with LoopVectorization The following code is 4x faster than openblas for small matrices, and 10% faster at 1000x1000. It still loses to MKL at larger sizes, but if you look at Octavian.jl, it's a pure Julia library that beats or is equal to MKL at pretty much all sizes.
using LoopVectorization
function mul!(C,A,B)
@tturbo for i in 1:size(C,1)
for j in 1:size(C,2)
C[i,j] = zero(eltype(C))
for k in 1:size(A,1)
C[i,j] += A[i,k]*B[k,j]
end
end
end
return C
end