Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ineffective unrolls #96

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/DataWrangling/inpaint_mask.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ using Oceananigans.Fields: instantiated_location, interior, CenterField
using Oceananigans.Architectures: architecture, device, GPU

using KernelAbstractions: @kernel, @index
using KernelAbstractions.Extras.LoopInfo: @unroll

# Maybe we can remove this propagate field in lieu of a diffusion,
# Still we'll need to do this a couple of steps on the original grid
Expand All @@ -25,7 +24,7 @@ using KernelAbstractions.Extras.LoopInfo: @unroll
counter = 0
cumsum = zero(eltype(field))

@unroll for n in nb
for n in nb
counter += ifelse(isnan(n), 0, 1)
cumsum += ifelse(isnan(n), 0, n)
end
Expand Down Expand Up @@ -100,7 +99,7 @@ end
i, j = @index(Global, NTuple)
Nz = size(grid, 3)

@unroll for k = Nz-1 : -1 : 1
for k = Nz-1 : -1 : 1
@inbounds field[i, j, k] = ifelse(mask[i, j, k], field[i, j, k+1], field[i, j, k])
end
end
Expand Down
Loading