Fixed off-by-one error that prevented the evaluation of small tensor expressions from being vectorized

This commit is contained in:
Benoit Steiner 2015-02-27 09:22:37 -08:00
parent f074bb4b5f
commit 90f4e90f1d

View File

@ -97,7 +97,7 @@ struct EvalRange<Evaluator, Index, true> {
Index i = first;
static const int PacketSize = unpacket_traits<typename Evaluator::PacketReturnType>::size;
if (last - first > PacketSize) {
if (last - first >= PacketSize) {
eigen_assert(first % PacketSize == 0);
Index lastPacket = last - (last % PacketSize);
for (; i < lastPacket; i += PacketSize) {