Skip to content

Commit

Permalink
Add some SIMD here and there
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Feb 13, 2024
1 parent f112c15 commit 1404ee7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/filtering/markov_kernel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function marginalize_cov!(
) where {T,S}
_Σ_out = PSDMatrix(Σ_out.R.B)
_Σ_curr = PSDMatrix(Σ_curr.R.B)
_K = AffineNormalKernel(K.A.B, K.b, PSDMatrix(K.C.R.B))
_K = AffineNormalKernel(K.A.B, nothing, PSDMatrix(K.C.R.B))
_D = size(_Σ_out, 1)
_C_DxD = C_DxD.B
_C_3DxD = C_3DxD.B
Expand All @@ -131,10 +131,10 @@ function marginalize_cov!(
C_DxD::AbstractMatrix,
C_3DxD::AbstractMatrix,
) where {T,S}
for i in eachindex(blocks(Σ_out.R))
@inbounds @simd ivdep for i in eachindex(blocks(Σ_out.R))
_Σ_out = PSDMatrix(Σ_out.R.blocks[i])
_Σ_curr = PSDMatrix(Σ_curr.R.blocks[i])
_K = AffineNormalKernel(K.A.blocks[i], K.b, PSDMatrix(K.C.R.blocks[i]))
_K = AffineNormalKernel(K.A.blocks[i], nothing, PSDMatrix(K.C.R.blocks[i]))
_C_DxD = C_DxD.blocks[i]
_C_3DxD = C_3DxD.blocks[i]
marginalize_cov!(_Σ_out, _Σ_curr, _K; C_DxD=_C_DxD, C_3DxD=_C_3DxD)
Expand Down Expand Up @@ -288,7 +288,7 @@ function compute_backward_kernel!(
}
d = length(blocks(xpred.Σ.R))
q = size(blocks(xpred.Σ.R)[1], 1) - 1
for i in eachindex(blocks(xpred.Σ.R))
@inbounds @simd ivdep for i in eachindex(blocks(xpred.Σ.R))
_Kout = AffineNormalKernel(
Kout.A.blocks[i],
view(Kout.b, (i-1)*(q+1)+1:i*(q+1)),
Expand Down

0 comments on commit 1404ee7

Please sign in to comment.