From c5e8546306059b101a7949e590c97785561ccd85 Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Thu, 15 Dec 2016 16:59:57 +0000 Subject: Adding asynchandler to sycl queue as lack of it can cause undefined behaviour. --- unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h index 46776d777..96c95e294 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h @@ -88,9 +88,15 @@ struct QueueInterface { } } })) -#else - m_queue(cl::sycl::queue(s)) -#endif + #else + m_queue(cl::sycl::queue(s, [&](cl::sycl::exception_list l) { + for (const auto& e : l) { + if (e) { + exception_caught_ = true; + } + } + })) + #endif {} /// Allocating device pointer. This pointer is actually an 8 bytes host pointer used as key to access the sycl device buffer. -- cgit v1.2.3