Skip to content

Commit

Permalink
Temporary workaround for JuliaGPU/CUDA.jl#929
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ramadhan committed May 26, 2021
1 parent 64f3090 commit 341a7d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Fields/averaged_field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ using Statistics
using Oceananigans.Grids
using Oceananigans.Grids: interior_parent_indices

import CUDA

struct AveragedField{X, Y, Z, S, A, D, G, T, N, O} <: AbstractReducedField{X, Y, Z, A, G, T, N}
data :: D
architecture :: A
Expand Down Expand Up @@ -59,7 +61,7 @@ Compute the average of `avg.operand` and store the result in `avg.data`.
"""
function compute!(avg::AveragedField, time=nothing)
compute_at!(avg.operand, time)
mean!(avg, avg.operand)
CUDA.@sync mean!(avg, avg.operand)
return nothing
end

Expand Down

0 comments on commit 341a7d4

Please sign in to comment.