use signed array size for CUDA

This commit is contained in:
Tom Deakin 2021-01-12 10:20:44 +00:00
parent 850c63d69b
commit 693a7e7478
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ void check_error(void)
} }
template <class T> template <class T>
CUDAStream<T>::CUDAStream(const unsigned int ARRAY_SIZE, const int device_index) CUDAStream<T>::CUDAStream(const int ARRAY_SIZE, const int device_index)
{ {
// The array size must be divisible by TBSIZE for kernel launches // The array size must be divisible by TBSIZE for kernel launches
@ -213,7 +213,7 @@ void CUDAStream<T>::triad()
} }
template <class T> template <class T>
__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]; __shared__ T tb_sum[TBSIZE];

View File

@ -29,7 +29,7 @@ class CUDAStream : public Stream<T>
{ {
protected: protected:
// Size of arrays // Size of arrays
unsigned int array_size; int array_size;
// Host array for partial sums for dot kernel // Host array for partial sums for dot kernel
T *sums; T *sums;
@ -43,7 +43,7 @@ class CUDAStream : public Stream<T>
public: public:
CUDAStream(const unsigned int, const int); CUDAStream(const int, const int);
~CUDAStream(); ~CUDAStream();
virtual void copy() override; virtual void copy() override;