mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-02 18:20:38 +08:00
Cleaned up the TensorDevice code a little bit.
This commit is contained in:
parent
abdbe8562e
commit
ccf290a65c
@ -80,8 +80,8 @@
|
|||||||
#include "unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h"
|
#include "unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h"
|
||||||
#include "unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h"
|
#include "unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h"
|
||||||
|
|
||||||
#include "unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h"
|
|
||||||
#include "unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h"
|
#include "unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h"
|
||||||
|
#include "unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h"
|
||||||
|
|
||||||
#include "unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h"
|
#include "unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h"
|
||||||
#include "unsupported/Eigen/CXX11/src/Tensor/Tensor.h"
|
#include "unsupported/Eigen/CXX11/src/Tensor/Tensor.h"
|
||||||
|
@ -32,8 +32,7 @@ template <typename ExpressionType, typename DeviceType> class TensorDevice {
|
|||||||
EIGEN_STRONG_INLINE TensorDevice& operator=(const OtherDerived& other) {
|
EIGEN_STRONG_INLINE TensorDevice& operator=(const OtherDerived& other) {
|
||||||
typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
|
typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
|
||||||
Assign assign(m_expression, other);
|
Assign assign(m_expression, other);
|
||||||
static const bool Vectorize = TensorEvaluator<const Assign, DeviceType>::PacketAccess;
|
internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
|
||||||
internal::TensorExecutor<const Assign, DeviceType, Vectorize>::run(assign, m_device);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,8 +43,7 @@ template <typename ExpressionType, typename DeviceType> class TensorDevice {
|
|||||||
Sum sum(m_expression, other);
|
Sum sum(m_expression, other);
|
||||||
typedef TensorAssignOp<ExpressionType, const Sum> Assign;
|
typedef TensorAssignOp<ExpressionType, const Sum> Assign;
|
||||||
Assign assign(m_expression, sum);
|
Assign assign(m_expression, sum);
|
||||||
static const bool Vectorize = TensorEvaluator<const Assign, DeviceType>::PacketAccess;
|
internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
|
||||||
internal::TensorExecutor<const Assign, DeviceType, Vectorize>::run(assign, m_device);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,8 +54,7 @@ template <typename ExpressionType, typename DeviceType> class TensorDevice {
|
|||||||
Difference difference(m_expression, other);
|
Difference difference(m_expression, other);
|
||||||
typedef TensorAssignOp<ExpressionType, const Difference> Assign;
|
typedef TensorAssignOp<ExpressionType, const Difference> Assign;
|
||||||
Assign assign(m_expression, difference);
|
Assign assign(m_expression, difference);
|
||||||
static const bool Vectorize = TensorEvaluator<const Assign, DeviceType>::PacketAccess;
|
internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
|
||||||
internal::TensorExecutor<const Assign, DeviceType, Vectorize>::run(assign, m_device);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,8 +73,7 @@ template <typename ExpressionType> class TensorDevice<ExpressionType, ThreadPool
|
|||||||
EIGEN_STRONG_INLINE TensorDevice& operator=(const OtherDerived& other) {
|
EIGEN_STRONG_INLINE TensorDevice& operator=(const OtherDerived& other) {
|
||||||
typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
|
typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
|
||||||
Assign assign(m_expression, other);
|
Assign assign(m_expression, other);
|
||||||
static const bool Vectorize = TensorEvaluator<const Assign, ThreadPoolDevice>::PacketAccess;
|
internal::TensorExecutor<const Assign, ThreadPoolDevice>::run(assign, m_device);
|
||||||
internal::TensorExecutor<const Assign, ThreadPoolDevice, Vectorize>::run(assign, m_device);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,8 +84,7 @@ template <typename ExpressionType> class TensorDevice<ExpressionType, ThreadPool
|
|||||||
Sum sum(m_expression, other);
|
Sum sum(m_expression, other);
|
||||||
typedef TensorAssignOp<ExpressionType, const Sum> Assign;
|
typedef TensorAssignOp<ExpressionType, const Sum> Assign;
|
||||||
Assign assign(m_expression, sum);
|
Assign assign(m_expression, sum);
|
||||||
static const bool Vectorize = TensorEvaluator<const Assign, ThreadPoolDevice>::PacketAccess;
|
internal::TensorExecutor<const Assign, ThreadPoolDevice>::run(assign, m_device);
|
||||||
internal::TensorExecutor<const Assign, ThreadPoolDevice, Vectorize>::run(assign, m_device);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,8 +95,7 @@ template <typename ExpressionType> class TensorDevice<ExpressionType, ThreadPool
|
|||||||
Difference difference(m_expression, other);
|
Difference difference(m_expression, other);
|
||||||
typedef TensorAssignOp<ExpressionType, const Difference> Assign;
|
typedef TensorAssignOp<ExpressionType, const Difference> Assign;
|
||||||
Assign assign(m_expression, difference);
|
Assign assign(m_expression, difference);
|
||||||
static const bool Vectorize = TensorEvaluator<const Assign, ThreadPoolDevice>::PacketAccess;
|
internal::TensorExecutor<const Assign, ThreadPoolDevice>::run(assign, m_device);
|
||||||
internal::TensorExecutor<const Assign, ThreadPoolDevice, Vectorize>::run(assign, m_device);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +116,7 @@ template <typename ExpressionType> class TensorDevice<ExpressionType, GpuDevice>
|
|||||||
EIGEN_STRONG_INLINE TensorDevice& operator=(const OtherDerived& other) {
|
EIGEN_STRONG_INLINE TensorDevice& operator=(const OtherDerived& other) {
|
||||||
typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
|
typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
|
||||||
Assign assign(m_expression, other);
|
Assign assign(m_expression, other);
|
||||||
internal::TensorExecutor<const Assign, GpuDevice, false>::run(assign, m_device);
|
internal::TensorExecutor<const Assign, GpuDevice>::run(assign, m_device);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +127,7 @@ template <typename ExpressionType> class TensorDevice<ExpressionType, GpuDevice>
|
|||||||
Sum sum(m_expression, other);
|
Sum sum(m_expression, other);
|
||||||
typedef TensorAssignOp<ExpressionType, const Sum> Assign;
|
typedef TensorAssignOp<ExpressionType, const Sum> Assign;
|
||||||
Assign assign(m_expression, sum);
|
Assign assign(m_expression, sum);
|
||||||
internal::TensorExecutor<const Assign, GpuDevice, false>::run(assign, m_device);
|
internal::TensorExecutor<const Assign, GpuDevice>::run(assign, m_device);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,8 +138,7 @@ template <typename ExpressionType> class TensorDevice<ExpressionType, GpuDevice>
|
|||||||
Difference difference(m_expression, other);
|
Difference difference(m_expression, other);
|
||||||
typedef TensorAssignOp<ExpressionType, const Difference> Assign;
|
typedef TensorAssignOp<ExpressionType, const Difference> Assign;
|
||||||
Assign assign(m_expression, difference);
|
Assign assign(m_expression, difference);
|
||||||
static const bool Vectorize = TensorEvaluator<const Assign, GpuDevice>::PacketAccess;
|
internal::TensorExecutor<const Assign, GpuDevice>::run(assign, m_device);
|
||||||
internal::TensorExecutor<const Assign, GpuDevice, Vectorize>::run(assign, m_device);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user