From 0f0454ec295b3c9fe2ada150534fb5d2e332ccce Mon Sep 17 00:00:00 2001 From: Matthew Martineau Date: Fri, 6 May 2016 21:05:20 +0100 Subject: [PATCH] Added CUDA device syncs to force proper timing --- KOKKOSStream.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/KOKKOSStream.cpp b/KOKKOSStream.cpp index 3834081..0c3f44c 100644 --- a/KOKKOSStream.cpp +++ b/KOKKOSStream.cpp @@ -74,6 +74,7 @@ void KOKKOSStream::copy() { c[index] = a[index]; }); + cudaDeviceSynchronize(); } template @@ -88,6 +89,7 @@ void KOKKOSStream::mul() { b[index] = scalar*c[index]; }); + cudaDeviceSynchronize(); } template @@ -101,6 +103,8 @@ void KOKKOSStream::add() { c[index] = a[index] + b[index]; }); + + cudaDeviceSynchronize(); } template @@ -115,6 +119,8 @@ void KOKKOSStream::triad() { a[index] = b[index] + scalar*c[index]; }); + + cudaDeviceSynchronize(); } void listDevices(void)