Skip to content

Commit

Permalink
Precompile Matrix*Vector
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Jan 26, 2023
1 parent 946e0de commit 033dd22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/BandedMatrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,14 @@ include("interfaceimpl.jl")

# _precompile_()

# precompile instructions
let B = BandedMatrix(0=>zeros(0)), v = zeros(size(B,2))
BT = typeof(B)
vT = typeof(v)
@assert precompile(+, (BT, BT))
@assert precompile(-, (BT,))
@assert precompile(-, (BT, BT))
@assert precompile(*, (BT, vT))
end

end #module
8 changes: 0 additions & 8 deletions src/banded/BandedMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -825,11 +825,3 @@ end

bandedbroadcaststyle(_) = BandedStyle()
BroadcastStyle(::Type{<:BandedMatrix{<:Any,Dat}}) where Dat = bandedbroadcaststyle(BroadcastStyle(Dat))

# precompile instructions
let B = BandedMatrix(0=>zeros(0))
BT = typeof(B)
@assert precompile(+, (BT, BT))
@assert precompile(-, (BT,))
@assert precompile(-, (BT, BT))
end

0 comments on commit 033dd22

Please sign in to comment.