Skip to content

Commit

Permalink
Add multithread optimization to remap_ts
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzovarese committed Aug 23, 2024
1 parent b1f539e commit 9a8b90b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/GridTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ using Base: @propagate_inbounds
using MacroTools
using OffsetArrays: IdOffsetRange
using Debugger
using Polyester: @batch

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

Expand Down Expand Up @@ -441,7 +442,7 @@ function remap_ts(
# end
#end, CartesianIndices(map(len -> Base.OneTo(len), out_field_size)))
out_field = zeros(eltype(field.data), out_field_size)
for position in eachindex(IndexCartesian(), out_field)
@batch for position in eachindex(IndexCartesian(), out_field)
neighbor_exists, new_position =
remap_position(Tuple(position), out_field_dims, offset, nb_ind, conn)
if neighbor_exists
Expand Down

0 comments on commit 9a8b90b

Please sign in to comment.