From 5f9b288570cb148245715deb8c3e5b62ba5f72b6 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Thu, 6 Apr 2017 10:15:11 +0100 Subject: [PATCH] [RAJA] Declare pointers using RAJA_RESTRICT --- RAJAStream.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/RAJAStream.cpp b/RAJAStream.cpp index 8d3f365..6c6098e 100644 --- a/RAJAStream.cpp +++ b/RAJAStream.cpp @@ -50,9 +50,9 @@ RAJAStream::~RAJAStream() template void RAJAStream::init_arrays(T initA, T initB, T initC) { - T* a = d_a; - T* b = d_b; - T* c = d_c; + T* RAJA_RESTRICT a = d_a; + T* RAJA_RESTRICT b = d_b; + T* RAJA_RESTRICT c = d_c; forall(index_set, [=] RAJA_DEVICE (int index) { a[index] = initA; @@ -73,8 +73,8 @@ void RAJAStream::read_arrays( template void RAJAStream::copy() { - T* a = d_a; - T* c = d_c; + T* RAJA_RESTRICT a = d_a; + T* RAJA_RESTRICT c = d_c; forall(index_set, [=] RAJA_DEVICE (int index) { c[index] = a[index]; @@ -84,8 +84,8 @@ void RAJAStream::copy() template void RAJAStream::mul() { - T* b = d_b; - T* c = d_c; + T* RAJA_RESTRICT b = d_b; + T* RAJA_RESTRICT c = d_c; const T scalar = startScalar; forall(index_set, [=] RAJA_DEVICE (int index) { @@ -96,9 +96,9 @@ void RAJAStream::mul() template void RAJAStream::add() { - T* a = d_a; - T* b = d_b; - T* c = d_c; + T* RAJA_RESTRICT a = d_a; + T* RAJA_RESTRICT b = d_b; + T* RAJA_RESTRICT c = d_c; forall(index_set, [=] RAJA_DEVICE (int index) { c[index] = a[index] + b[index]; @@ -108,9 +108,9 @@ void RAJAStream::add() template void RAJAStream::triad() { - T* a = d_a; - T* b = d_b; - T* c = d_c; + T* RAJA_RESTRICT a = d_a; + T* RAJA_RESTRICT b = d_b; + T* RAJA_RESTRICT c = d_c; const T scalar = startScalar; forall(index_set, [=] RAJA_DEVICE (int index) { @@ -121,8 +121,8 @@ void RAJAStream::triad() template T RAJAStream::dot() { - T* a = d_a; - T* b = d_b; + T* RAJA_RESTRICT a = d_a; + T* RAJA_RESTRICT b = d_b; RAJA::ReduceSum sum(0.0);