Require SYCL array size to be multiple of WGSIZE

This commit is contained in:
Tom Deakin 2016-05-11 12:23:21 +01:00
parent 2462023ed9
commit 81fa9e1922
2 changed files with 10 additions and 0 deletions

View File

@ -24,6 +24,14 @@ SYCLStream<T>::SYCLStream(const unsigned int ARRAY_SIZE, const int device_index)
if (!cached)
getDeviceList();
// The array size must be divisible by WGSIZE
if (ARRAY_SIZE % WGSIZE != 0)
{
std::stringstream ss;
ss << "Array size must be a multiple of " << WGSIZE;
throw std::runtime_error(ss.str());
}
array_size = ARRAY_SIZE;
if (device_index >= devices.size())

View File

@ -7,6 +7,8 @@
#pragma once
#include <sstream>
#include "Stream.h"
#include "CL/sycl.hpp"