aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-11-17 21:29:15 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-11-17 21:29:15 -0800
commit72a45d32e99f24411c822fe1edd8b33735dd8e0c (patch)
tree80328ce246af4c02388fd1a8a55e9e60cacb912d /unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h
parent4349fc640ee107ad1833a9f44f312e9becdfc7ed (diff)
Cleanup
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h
index 19686177e..67cf66e5f 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h
@@ -33,10 +33,12 @@ struct SyclDevice {
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;
+ if (e) {
+ std::rethrow_exception(e);
}
+ } catch (const cl::sycl::exception& e) {
+ std::cerr << e.what() << std::endl;
+ }
}
}))
#else
@@ -200,7 +202,7 @@ struct SyclDevice {
});
m_queue.throw_asynchronous();
- } else{
+ } else {
eigen_assert("no device memory found. The memory might be destroyed before creation");
}
}
@@ -226,8 +228,9 @@ struct SyclDevice {
EIGEN_STRONG_INLINE int majorDeviceVersion() const {
return 1;
}
- /// There is no need to synchronise the stream in sycl as it is automatically handled by sycl runtime scheduler.
- EIGEN_STRONG_INLINE void synchronize() const {}
+ EIGEN_STRONG_INLINE void synchronize() const {
+ m_queue.wait_and_throw();
+ }
};
} // end namespace Eigen