From 693a7e7478808a7bd3253c7ade1327aa855c4867 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Tue, 12 Jan 2021 10:20:44 +0000 Subject: [PATCH] use signed array size for CUDA --- CUDAStream.cu | 4 ++-- CUDAStream.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CUDAStream.cu b/CUDAStream.cu index 7c2e6e9..32aae49 100644 --- a/CUDAStream.cu +++ b/CUDAStream.cu @@ -19,7 +19,7 @@ void check_error(void) } template -CUDAStream::CUDAStream(const unsigned int ARRAY_SIZE, const int device_index) +CUDAStream::CUDAStream(const int ARRAY_SIZE, const int device_index) { // The array size must be divisible by TBSIZE for kernel launches @@ -213,7 +213,7 @@ void CUDAStream::triad() } template -__global__ void dot_kernel(const T * a, const T * b, T * sum, unsigned int array_size) +__global__ void dot_kernel(const T * a, const T * b, T * sum, int array_size) { __shared__ T tb_sum[TBSIZE]; diff --git a/CUDAStream.h b/CUDAStream.h index 2953a5f..df85802 100644 --- a/CUDAStream.h +++ b/CUDAStream.h @@ -29,7 +29,7 @@ class CUDAStream : public Stream { protected: // Size of arrays - unsigned int array_size; + int array_size; // Host array for partial sums for dot kernel T *sums; @@ -43,7 +43,7 @@ class CUDAStream : public Stream public: - CUDAStream(const unsigned int, const int); + CUDAStream(const int, const int); ~CUDAStream(); virtual void copy() override;