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