This commit is contained in:
Benoit Steiner 2016-11-17 21:29:15 -08:00
parent 4349fc640e
commit 72a45d32e9

View File

@ -33,10 +33,12 @@ struct SyclDevice {
m_queue(cl::sycl::queue(s, [=](cl::sycl::exception_list l) { m_queue(cl::sycl::queue(s, [=](cl::sycl::exception_list l) {
for (const auto& e : l) { for (const auto& e : l) {
try { try {
std::rethrow_exception(e); if (e) {
} catch (cl::sycl::exception e) { std::rethrow_exception(e);
std::cout << e.what() << std::endl;
} }
} catch (const cl::sycl::exception& e) {
std::cerr << e.what() << std::endl;
}
} }
})) }))
#else #else
@ -200,7 +202,7 @@ struct SyclDevice {
}); });
m_queue.throw_asynchronous(); m_queue.throw_asynchronous();
} else{ } else {
eigen_assert("no device memory found. The memory might be destroyed before creation"); 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 { EIGEN_STRONG_INLINE int majorDeviceVersion() const {
return 1; 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 } // end namespace Eigen