From 341a7d488bff92e4e0d2f842d61a95c7eecebe96 Mon Sep 17 00:00:00 2001 From: ali-ramadhan Date: Wed, 26 May 2021 15:48:55 -0400 Subject: [PATCH] Temporary workaround for JuliaGPU/CUDA.jl#929 --- src/Fields/averaged_field.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fields/averaged_field.jl b/src/Fields/averaged_field.jl index 37002df179..96370f630b 100644 --- a/src/Fields/averaged_field.jl +++ b/src/Fields/averaged_field.jl @@ -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 @@ -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