Skip to content

Commit

Permalink
BEM: use :static scheduling for implicit solvers
Browse files Browse the repository at this point in the history
Our implicit solvers currently rely on thread IDs remaining constant
during computation in order to access per-thread pre-allocated data
caches.

Fixes: #7
  • Loading branch information
tkemmer committed Jan 23, 2025
1 parent 47d554b commit 9b51b16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bem/implicit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function Base.:*(
x ::AbstractVector{T}
) where T
dst = zeros(T, size(A, 1))
Threads.@threads for i in 1:size(A, 1)
Threads.@threads :static for i in 1:size(A, 1)
s = zero(T)
for j in 1:size(A, 2)
s += A[i, j] * x[j]
Expand All @@ -178,7 +178,7 @@ function Base.:*(
) where T
m, n, p = (size(A)..., size(B, 2))
dst = zeros(T, m, p)
Threads.@threads for i in 1:m
Threads.@threads :static for i in 1:m
for k in 1:p
s = zero(T)
for j in 1:n
Expand Down

0 comments on commit 9b51b16

Please sign in to comment.