From e4f62eb64bfabfd3cfd541f5d3b08432f7288d38 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti <5535617+Iximiel@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:03:29 +0100 Subject: [PATCH] corrected a bug in dual when doing many v somehting that don't start from 0 --- plugins/cudaCoord/Coordination.cu | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/plugins/cudaCoord/Coordination.cu b/plugins/cudaCoord/Coordination.cu index e29fe72970..6d2e2f4079 100644 --- a/plugins/cudaCoord/Coordination.cu +++ b/plugins/cudaCoord/Coordination.cu @@ -559,8 +559,8 @@ getDerivDual (const unsigned natLoop, const PLMD::GPU::ortoPBCs myPBC, const calculateFloat *coordLoop, const calculateFloat *coordActive, - const unsigned *trueIndexesActive, const unsigned *trueIndexesLoop, + const unsigned *trueIndexesActive, calculateFloat *devOut) { // auto sdata = shared_memory_proxy(); // // loading shared memory @@ -583,18 +583,7 @@ getDerivDual (const unsigned natLoop, calculateFloat mydevY = 0.0; calculateFloat mydevZ = 0.0; calculateFloat mycoord = 0.0; - // the previous version used static array for myVirial and d - // using explicit variables guarantees that this data will be stored in - // registers - calculateFloat myVirial_0 = 0.0; - calculateFloat myVirial_1 = 0.0; - calculateFloat myVirial_2 = 0.0; - calculateFloat myVirial_3 = 0.0; - calculateFloat myVirial_4 = 0.0; - calculateFloat myVirial_5 = 0.0; - calculateFloat myVirial_6 = 0.0; - calculateFloat myVirial_7 = 0.0; - calculateFloat myVirial_8 = 0.0; + // local calculation aid const calculateFloat x = coordActive[X (i)]; const calculateFloat y = coordActive[Y (i)];