mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-13 09:53:13 +08:00
Prevent potential ODR in TensorExecutor
This commit is contained in:
parent
6332aff0b2
commit
bd864ab42b
@ -82,6 +82,13 @@ class TensorExecutor {
|
||||
public:
|
||||
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`");
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
static EIGEN_STRONG_INLINE void run(const Expression& expr,
|
||||
const Device& device = Device()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user