Skip to content

Commit

Permalink
Copy target back to CPU in SubtractDelta
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis committed Jul 18, 2023
1 parent d77325d commit 6dce84a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Silicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,12 @@ namespace galsim {
// add=false
// subtract_delta=false
_addDelta<false, false>(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<T*>(_targetData);
#pragma omp target update from(targetData[0:_targetDataLength])
#endif
}

template <typename T>
Expand Down

0 comments on commit 6dce84a

Please sign in to comment.