Skip to content

Commit

Permalink
don't use generated function implimentation of naivemul for sparse ma…
Browse files Browse the repository at this point in the history
…trices
  • Loading branch information
oscardssmith committed May 31, 2024
1 parent c9fc842 commit 10cd547
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,

Check warning on line 9 in src/exp_generic.jl

View check run for this annotation

Codecov / codecov/patch

src/exp_generic.jl#L9

Added line #L9 was not covered by tests
B::AbstractSparseMatrix)
mul!(C, A, B)

Check warning on line 11 in src/exp_generic.jl

View check run for this annotation

Codecov / codecov/patch

src/exp_generic.jl#L11

Added line #L11 was not covered by tests
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)

Check warning on line 143 in src/exp_generic.jl

View check run for this annotation

Codecov / codecov/patch

src/exp_generic.jl#L143

Added line #L143 was not covered by tests
else
return exp_pade_p(x, Vk, Vk) / exp_pade_q(x, Vk, Vk)
end
Expand Down

0 comments on commit 10cd547

Please sign in to comment.