aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h
diff options
context:
space:
mode:
authorGravatar Mehdi Goli <mehdi.goli@codeplay.com>2019-07-01 16:27:28 +0100
committerGravatar Mehdi Goli <mehdi.goli@codeplay.com>2019-07-01 16:27:28 +0100
commit9ea490c82c2603c6185c06e993943099b287a405 (patch)
tree2bf8f48fdd5281d589d0567aa192278998d5e064 /unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h
parent81a03bec75aac90aa343fccf6a7daf735e28c20d (diff)
[SYCL] :
* Modifying TensorDeviceSYCL to use `EIGEN_THROW_X`. * Modifying TensorMacro to use `EIGEN_TRY/CATCH(X)` macro. * Modifying TensorReverse.h to use `EIGEN_DEVICE_REF` instead of `&`. * Fixing the SYCL device macro in SpecialFunctionsImpl.h.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h
index 3d859f42d..af9e5db70 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h
@@ -67,20 +67,16 @@
#endif
// Define a macro for catching SYCL exceptions if exceptions are enabled
-#if defined(EIGEN_EXCEPTIONS)
- #define EIGEN_SYCL_TRY_CATCH(X) \
- do { \
- try { X; } \
- catch(const cl::sycl::exception& e) { \
- std::cerr << "SYCL exception at " \
- << __FILE__ << ":" << __LINE__ << std::endl \
- << e.what() << std::endl; \
- std::rethrow_exception(std::current_exception()); \
- } \
- } while (false)
-#else
- #define EIGEN_SYCL_TRY_CATCH(X) X
-#endif
+#define EIGEN_SYCL_TRY_CATCH(X) \
+ do { \
+ EIGEN_TRY {X;} \
+ EIGEN_CATCH(const cl::sycl::exception& e) { \
+ EIGEN_THROW_X(std::runtime_error("SYCL exception at " + \
+ std::string(__FILE__) + ":" + \
+ std::to_string(__LINE__) + "\n" + \
+ e.what())); \
+ } \
+ } while (false)
// Define a macro if local memory flags are unset or one of them is set
// Setting both flags is the same as unsetting them