aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported
diff options
context:
space:
mode:
authorGravatar Eugene Zhulenev <eugene.zhulenev@gmail.com>2020-02-06 22:43:24 +0000
committerGravatar Eugene Zhulenev <eugene.zhulenev@gmail.com>2020-02-06 22:43:24 +0000
commitf584bd9b308b4e62787aed370bd829474510e598 (patch)
tree978dd00438de57cf05d22a47ec83088b7079c9f3 /unsupported
parent3fda850c46e5e589668a85d89299433e0686eec9 (diff)
Fail at compile time if default executor tries to use non-default device
Diffstat (limited to 'unsupported')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h
index 93bab11b1..c52fb77dc 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h
@@ -83,11 +83,14 @@ class TensorExecutor {
typedef typename Expression::Index StorageIndex;
// Including `unsupported/Eigen/CXX11/Tensor` in different translation units
- // with/without `EIGEN_USE_THREADS` is an ODR violation. If this template
- // is instantiated with a thread pool device, it means that this header
- // file was included without defining `EIGEN_USE_THREADS`.
- static_assert(!std::is_same<Device, ThreadPoolDevice>::value,
- "You are missing `#define EIGEN_USE_THREADS`");
+ // with/without `EIGEN_USE_THREADS` or `EIGEN_USE_GPU` is a potential ODR
+ // violation. If this template is instantiated with a non-default device, it
+ // means that this header file was included without defining
+ // `EIGEN_USE_THREADS`, `EIGEN_USE_GPU` or `EIGEN_USE_SYCL`.
+ static_assert(std::is_same<Device, DefaultDevice>::value,
+ "Default executor instantiated with non-default device. "
+ "You must #define EIGEN_USE_THREADS, EIGEN_USE_GPU or "
+ "EIGEN_USE_SYCL before including Eigen headers.");
EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE void run(const Expression& expr,