Skip to content

Commit 9a8b90b

Browse files
committed
Add multithread optimization to remap_ts
1 parent b1f539e commit 9a8b90b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/GridTools.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ using Base: @propagate_inbounds
1010
using MacroTools
1111
using OffsetArrays: IdOffsetRange
1212
using Debugger
13+
using Polyester: @batch
1314

1415
import Base.Broadcast: Extruded, Style, BroadcastStyle, ArrayStyle, Broadcasted
1516

@@ -441,7 +442,7 @@ function remap_ts(
441442
# end
442443
#end, CartesianIndices(map(len -> Base.OneTo(len), out_field_size)))
443444
out_field = zeros(eltype(field.data), out_field_size)
444-
for position in eachindex(IndexCartesian(), out_field)
445+
@batch for position in eachindex(IndexCartesian(), out_field)
445446
neighbor_exists, new_position =
446447
remap_position(Tuple(position), out_field_dims, offset, nb_ind, conn)
447448
if neighbor_exists

0 commit comments

Comments
 (0)