Added exception after printing the SYCL exceptions

This commit is contained in:
Vanya Yaneva 2017-07-31 17:38:59 +01:00
parent 6d7e4b5f3f
commit b8f7a5427e

View File

@ -47,14 +47,25 @@ SYCLStream<T>::SYCLStream(const unsigned int ARRAY_SIZE, const int device_index)
std::cout << "Driver: " << getDeviceDriver(device_index) << std::endl;
std::cout << "Reduction kernel config: " << dot_num_groups << " groups of size " << dot_wgsize << std::endl;
queue = new cl::sycl::queue(dev, [&](cl::sycl::exception_list l) {
try {
for(auto e: l) {
std::rethrow_exception(e);
}
} catch (cl::sycl::exception e) {
std::cout << e.what();
queue = new cl::sycl::queue(dev, [&](cl::sycl::exception_list l)
{
bool error = false;
for(auto e: l)
{
try
{
std::rethrow_exception(e);
}
catch (cl::sycl::exception e)
{
std::cout << e.what();
error = true;
}
}
if(error)
{
throw std::runtime_error("SYCL errors detected");
}
});
/* Pre-build the kernels */