Skip to content

Commit

Permalink
Merge pull request #175 from oscardssmith/os/sparse-naivemul
Browse files Browse the repository at this point in the history
don't use generated function implimentation of naivemul for sparse matrices
  • Loading branch information
ChrisRackauckas authored Jun 3, 2024
2 parents c9fc842 + 10cd547 commit 4e5be62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/exp_generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ function naivemul!(C::StridedMatrix{T}, A::StridedMatrix{T},
B::StridedMatrix{T}) where {T <: LinearAlgebra.BlasFloat}
mul!(C, A, B)
end
function naivemul!(C::AbstractSparseMatrix, A::AbstractSparseMatrix,
B::AbstractSparseMatrix)
mul!(C, A, B)
end
function naivemul!(C, A, B)
Maxis, Naxis = axes(C)
# TODO: heuristically pick `Nunroll` and `Munroll` using `sizeof(T)`, and maybe based on size of register file as well.
Expand Down Expand Up @@ -136,7 +140,7 @@ function exponential!(x, method::ExpMethodGeneric{Vk},
(Vk === Val{13}() && x isa AbstractMatrix && ismutable(x)) &&
return exp_generic_mutable(x, s, Val{13}())
if s >= 1
return exponential!(x / (2^s), method)^(2^s)
return exponential!(x / (2^s), method, cache)^(2^s)
else
return exp_pade_p(x, Vk, Vk) / exp_pade_q(x, Vk, Vk)
end
Expand Down

0 comments on commit 4e5be62

Please sign in to comment.