@@ -175,7 +175,7 @@ function reckernel!(A::AbstractMatrix{T}, pivot::Val{Pivot}, m, n, ipiv, info, b
175175 # We have A22 = L21 U12 + Aβ²22, hence
176176 # Aβ²22 = A22 - L21 U12
177177 # mul!(A22, A21, A12, -one(T), one(T))
178- schur_complement! (A22, A21, A12)
178+ schur_complement! (A22, A21, A12, thread )
179179 # record info
180180 previnfo = info
181181 # P2 A22 = L22 U22
@@ -191,13 +191,24 @@ function reckernel!(A::AbstractMatrix{T}, pivot::Val{Pivot}, m, n, ipiv, info, b
191191 end # inbounds
192192end
193193
194- function schur_complement! (π, π, π)
195- @tturbo warn_check_args= false for m β 1 : size (π,1 ), n β 1 : size (π,2 )
196- πββ = zero (eltype (π))
197- for k β 1 : size (π,2 )
198- πββ -= π[m,k] * π[k,n]
194+ function schur_complement! (π, π, π,:: Val{THREAD} = Val (true )) where {THREAD}
195+ # mul!(π,π,π,-1,1)
196+ if THREAD
197+ @tturbo warn_check_args= false for m β 1 : size (π,1 ), n β 1 : size (π,2 )
198+ πββ = zero (eltype (π))
199+ for k β 1 : size (π,2 )
200+ πββ -= π[m,k] * π[k,n]
201+ end
202+ π[m,n] = πββ + π[m,n]
203+ end
204+ else
205+ @turbo warn_check_args= false for m β 1 : size (π,1 ), n β 1 : size (π,2 )
206+ πββ = zero (eltype (π))
207+ for k β 1 : size (π,2 )
208+ πββ -= π[m,k] * π[k,n]
209+ end
210+ π[m,n] = πββ + π[m,n]
199211 end
200- π[m,n] = πββ + π[m,n]
201212 end
202213end
203214
0 commit comments