From 8be4b26bb18cbbba770e17f3814f071e6a5f5e94 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Thu, 30 Jun 2016 16:24:32 +0100 Subject: [PATCH] Add restrict to extra pointers in OpenACC --- ACCStream.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ACCStream.cpp b/ACCStream.cpp index 48e042e..d3fbd6a 100644 --- a/ACCStream.cpp +++ b/ACCStream.cpp @@ -59,8 +59,8 @@ template void ACCStream::copy() { unsigned int array_size = this->array_size; - T *a = this->a; - T *c = this->c; + T * restrict a = this->a; + T * restrict c = this->c; #pragma acc kernels present(a[0:array_size], c[0:array_size]) wait for (int i = 0; i < array_size; i++) { @@ -74,8 +74,8 @@ void ACCStream::mul() const T scalar = 0.3; unsigned int array_size = this->array_size; - T *b = this->b; - T *c = this->c; + T * restrict b = this->b; + T * restrict c = this->c; #pragma acc kernels present(b[0:array_size], c[0:array_size]) wait for (int i = 0; i < array_size; i++) { @@ -87,9 +87,9 @@ template void ACCStream::add() { unsigned int array_size = this->array_size; - T *a = this->a; - T *b = this->b; - T *c = this->c; + T * restrict a = this->a; + T * restrict b = this->b; + T * restrict c = this->c; #pragma acc kernels present(a[0:array_size], b[0:array_size], c[0:array_size]) wait for (int i = 0; i < array_size; i++) { @@ -103,9 +103,9 @@ void ACCStream::triad() const T scalar = 0.3; unsigned int array_size = this->array_size; - T *a = this->a; - T *b = this->b; - T *c = this->c; + T * restrict a = this->a; + T * restrict b = this->b; + T * restrict c = this->c; #pragma acc kernels present(a[0:array_size], b[0:array_size], c[0:array_size]) wait for (int i = 0; i < array_size; i++) {