mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Vectorized the evaluation of tensor expression (using SSE, AVX, NEON, ...)
Added the ability to parallelize the evaluation of a tensor expression over multiple cpu cores. Added the ability to offload the evaluation of a tensor expression to a GPU.
This commit is contained in:
@@ -28,6 +28,7 @@ class TensorBase
|
||||
typedef typename internal::traits<Derived>::Scalar Scalar;
|
||||
typedef typename internal::traits<Derived>::Index Index;
|
||||
typedef Scalar CoeffReturnType;
|
||||
typedef typename internal::packet_traits<Scalar>::type PacketReturnType;
|
||||
|
||||
Derived& setZero() {
|
||||
return setConstant(Scalar(0));
|
||||
@@ -83,6 +84,17 @@ class TensorBase
|
||||
return TensorCwiseBinaryOp<internal::scalar_sum_op<Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
const TensorCwiseBinaryOp<internal::scalar_difference_op<Scalar>, const Derived, const OtherDerived>
|
||||
operator-(const OtherDerived& other) const {
|
||||
return TensorCwiseBinaryOp<internal::scalar_difference_op<Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
template <typename DeviceType>
|
||||
TensorDevice<Derived, DeviceType> device(const DeviceType& device) {
|
||||
return TensorDevice<Derived, DeviceType>(device, derived());
|
||||
}
|
||||
|
||||
protected:
|
||||
template <typename OtherDerived> friend class TensorBase;
|
||||
EIGEN_DEVICE_FUNC
|
||||
|
||||
Reference in New Issue
Block a user