From 1b345b08959429f4905eee4dfbe0d5bd1bb95a4e Mon Sep 17 00:00:00 2001 From: Luke Iwanski Date: Tue, 8 Nov 2016 21:56:31 +0000 Subject: [PATCH] Fix for SYCL queue initialisation. --- .../Eigen/CXX11/src/Tensor/TensorDeviceSycl.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h index 0abc6fe30..84dede904 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h @@ -26,19 +26,21 @@ struct SyclDevice { mutable std::map> buffer_map; /// creating device by using selector template SyclDevice(dev_Selector s) - :m_queue(cl::sycl::queue(s, [=](cl::sycl::exception_list l) { - for (const auto& e : l) { + : #if EXCEPTIONS_ENABLED + m_queue(cl::sycl::queue(s, [=](cl::sycl::exception_list l) { + for (const auto& e : l) { try { std::rethrow_exception(e); } catch (cl::sycl::exception e) { std::cout << e.what() << std::endl; } -#else - assert(false && "SyclDevice: Unhandled exception cought!"); -#endif } - })) {} + })) +#else + m_queue(cl::sycl::queue(s)) +#endif + {} // destructor ~SyclDevice() { deallocate_all(); }