From 804b2353aff7feef565bbbc9d54f9b81221cb489 Mon Sep 17 00:00:00 2001 From: Tom Lin Date: Mon, 2 Oct 2023 15:21:22 +0100 Subject: [PATCH] Prevent NVHPC from optimising away task barrier (likely a bug) --- src/omp/fasten.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/omp/fasten.hpp b/src/omp/fasten.hpp index ef5c228..cae2328 100644 --- a/src/omp/fasten.hpp +++ b/src/omp/fasten.hpp @@ -12,6 +12,8 @@ #endif #define IMPL_CLS OmpBude +static volatile float discard; + template class IMPL_CLS final : public Bude { static inline void fasten_main(size_t group, size_t ntypes, size_t nposes, size_t natlig, size_t natpro, // @@ -245,6 +247,8 @@ template class IMPL_CLS final : public Bude { poses_0, poses_1, poses_2, poses_3, poses_4, poses_5, // forcefield, energies); } + #pragma omp target update from(energies[:1]) + discard = energies[0]; auto kernelEnd = now(); sample.kernelTimes.emplace_back(kernelStart, kernelEnd); }