diff --git a/ACCStream.cpp b/ACCStream.cpp index b7ff871..664668d 100644 --- a/ACCStream.cpp +++ b/ACCStream.cpp @@ -8,7 +8,7 @@ #include "ACCStream.h" template -ACCStream::ACCStream(const unsigned int ARRAY_SIZE, int device) +ACCStream::ACCStream(const int ARRAY_SIZE, int device) { acc_device_t device_type = acc_get_device_type(); acc_set_device_num(device, device_type); @@ -27,7 +27,7 @@ template ACCStream::~ACCStream() { // End data region on device - unsigned int array_size = this->array_size; + int array_size = this->array_size; #pragma acc exit data delete(a[0:array_size], b[0:array_size], c[0:array_size]) {} @@ -39,7 +39,7 @@ ACCStream::~ACCStream() template void ACCStream::init_arrays(T initA, T initB, T initC) { - unsigned int array_size = this->array_size; + int array_size = this->array_size; T * restrict a = this->a; T * restrict b = this->b; T * restrict c = this->c; @@ -65,7 +65,7 @@ void ACCStream::read_arrays(std::vector& h_a, std::vector& h_b, std::ve template void ACCStream::copy() { - unsigned int array_size = this->array_size; + int array_size = this->array_size; T * restrict a = this->a; T * restrict c = this->c; #pragma acc parallel loop present(a[0:array_size], c[0:array_size]) wait @@ -80,7 +80,7 @@ void ACCStream::mul() { const T scalar = startScalar; - unsigned int array_size = this->array_size; + int array_size = this->array_size; T * restrict b = this->b; T * restrict c = this->c; #pragma acc parallel loop present(b[0:array_size], c[0:array_size]) wait @@ -93,7 +93,7 @@ void ACCStream::mul() template void ACCStream::add() { - unsigned int array_size = this->array_size; + int array_size = this->array_size; T * restrict a = this->a; T * restrict b = this->b; T * restrict c = this->c; @@ -109,7 +109,7 @@ void ACCStream::triad() { const T scalar = startScalar; - unsigned int array_size = this->array_size; + int array_size = this->array_size; T * restrict a = this->a; T * restrict b = this->b; T * restrict c = this->c; @@ -125,7 +125,7 @@ T ACCStream::dot() { T sum = 0.0; - unsigned int array_size = this->array_size; + int array_size = this->array_size; T * restrict a = this->a; T * restrict b = this->b; #pragma acc parallel loop reduction(+:sum) present(a[0:array_size], b[0:array_size]) wait diff --git a/ACCStream.h b/ACCStream.h index 734c670..3d8695e 100644 --- a/ACCStream.h +++ b/ACCStream.h @@ -21,14 +21,14 @@ class ACCStream : public Stream { protected: // Size of arrays - unsigned int array_size; + int array_size; // Device side pointers T *a; T *b; T *c; public: - ACCStream(const unsigned int, int); + ACCStream(const int, int); ~ACCStream(); virtual void copy() override;