diff options
author | Mehdi Goli <mehdi.goli@codeplay.com> | 2016-11-18 16:34:54 +0000 |
---|---|---|
committer | Mehdi Goli <mehdi.goli@codeplay.com> | 2016-11-18 16:34:54 +0000 |
commit | 15e226d7d3b80d89d04a5b51baaf5b5d2aaad589 (patch) | |
tree | 720065f8fb029ca7d93e0aa7a66f6330404d5067 /unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h | |
parent | 622805a0c5d216141eca3090e80d58c159e175ee (diff) |
adding Benoit changes on the TensorDeviceSycl.h
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h index d6d127153..ec7d80c7c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h @@ -21,6 +21,8 @@ namespace Eigen { struct QueueInterface { /// class members: + bool exception_caught_ = false; + /// std::map is the container used to make sure that we create only one buffer /// per pointer. The lifespan of the buffer now depends on the lifespan of SyclDevice. /// If a non-read-only pointer is needed to be accessed on the host we should manually deallocate it. @@ -35,7 +37,7 @@ struct QueueInterface { for (const auto& e : l) { try { if(e){ - std::rethrow_exception(e); + exception_caught_ = true;; } } catch (cl::sycl::exception e) { std::cerr << e.what() << std::endl; @@ -86,6 +88,11 @@ struct QueueInterface { //return buffer_map.end(); } + // This function checks if the runtime recorded an error for the + // underlying stream device. + EIGEN_STRONG_INLINE bool ok() const { + return !exception_caught_; + } // destructor ~QueueInterface() { buffer_map.clear(); } }; @@ -227,8 +234,14 @@ struct SyclDevice { EIGEN_STRONG_INLINE void synchronize() const { sycl_queue().wait_and_throw(); } + // This function checks if the runtime recorded an error for the + // underlying stream device. + EIGEN_STRONG_INLINE bool ok() const { + return m_queu_stream->ok(); + } }; + } // end namespace Eigen #endif // EIGEN_CXX11_TENSOR_TENSOR_DEVICE_SYCL_H |