mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Merged latest changes from upstream/eigen
This commit is contained in:
@@ -104,7 +104,7 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
typedef typename TensorEvaluator<ArgType, Device>::Dimensions InputDimensions;
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
typedef typename PacketType<CoeffReturnType, Device>::type PacketReturnType;
|
||||
static const int PacketSize = internal::unpacket_traits<PacketReturnType>::size;
|
||||
static const int PacketSize = PacketType<CoeffReturnType, Device>::size;
|
||||
bool isCopy= false, nByOne = false, oneByN = false;
|
||||
|
||||
enum {
|
||||
@@ -306,7 +306,13 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
|
||||
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||
if (isCopy) {
|
||||
#ifdef EIGEN_GPU_COMPILE_PHASE
|
||||
// See PR 437: on NVIDIA P100 and K20m we observed a x3-4 speed up by enforcing
|
||||
// unaligned loads here. The reason is unclear though.
|
||||
return m_impl.template packet<Unaligned>(index);
|
||||
#else
|
||||
return m_impl.template packet<LoadMode>(index);
|
||||
#endif
|
||||
} else if (oneByN && !nByOne) {
|
||||
return packetNByOne<LoadMode>(index);
|
||||
} else if (!oneByN && nByOne) {
|
||||
@@ -318,7 +324,12 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
|
||||
}
|
||||
} else {
|
||||
if (isCopy) {
|
||||
#ifdef EIGEN_GPU_COMPILE_PHASE
|
||||
// See above.
|
||||
return m_impl.template packet<Unaligned>(index);
|
||||
#else
|
||||
return m_impl.template packet<LoadMode>(index);
|
||||
#endif
|
||||
} else if (oneByN && !nByOne) {
|
||||
return packetOneByN<LoadMode>(index);
|
||||
} else if (!oneByN && nByOne) {
|
||||
|
||||
Reference in New Issue
Block a user