Require SYCL array size to be multiple of WGSIZE
This commit is contained in:
parent
2462023ed9
commit
81fa9e1922
@ -24,6 +24,14 @@ SYCLStream<T>::SYCLStream(const unsigned int ARRAY_SIZE, const int device_index)
|
|||||||
if (!cached)
|
if (!cached)
|
||||||
getDeviceList();
|
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;
|
array_size = ARRAY_SIZE;
|
||||||
|
|
||||||
if (device_index >= devices.size())
|
if (device_index >= devices.size())
|
||||||
|
|||||||
@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include "Stream.h"
|
#include "Stream.h"
|
||||||
|
|
||||||
#include "CL/sycl.hpp"
|
#include "CL/sycl.hpp"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user