From 6dce84a18c118e10df579b651400a26c09ce3929 Mon Sep 17 00:00:00 2001 From: Mike Jarvis Date: Tue, 18 Jul 2023 08:59:19 -0400 Subject: [PATCH] Copy target back to CPU in SubtractDelta --- src/Silicon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Silicon.cpp b/src/Silicon.cpp index e778a69e12..2d38a16200 100644 --- a/src/Silicon.cpp +++ b/src/Silicon.cpp @@ -1278,6 +1278,12 @@ namespace galsim { // add=false // subtract_delta=false _addDelta(target, _delta); + + // And if doing this on the GPU, we need to copy back to the CPU now. +#ifdef GALSIM_USE_GPU + T* targetData = static_cast(_targetData); +#pragma omp target update from(targetData[0:_targetDataLength]) +#endif } template