Avoid relying on a default value for the Vectorizable template parameter of the EvalRange functor

This commit is contained in:
Benoit Steiner 2015-07-15 17:17:04 -07:00
parent 4b3d697e12
commit b900fe47d5

View File

@ -75,7 +75,7 @@ class TensorExecutor<Expression, DefaultDevice, true>
// Multicore strategy: the index space is partitioned and each partition is executed on a single core // Multicore strategy: the index space is partitioned and each partition is executed on a single core
#ifdef EIGEN_USE_THREADS #ifdef EIGEN_USE_THREADS
template <typename Evaluator, typename Index, bool Vectorizable = Evaluator::PacketAccess> template <typename Evaluator, typename Index, bool Vectorizable>
struct EvalRange { struct EvalRange {
static void run(Evaluator evaluator, const Index first, const Index last) { static void run(Evaluator evaluator, const Index first, const Index last) {
eigen_assert(last > first); eigen_assert(last > first);
@ -129,11 +129,11 @@ class TensorExecutor<Expression, ThreadPoolDevice, Vectorizable>
std::vector<Notification*> results; std::vector<Notification*> results;
results.reserve(numblocks); results.reserve(numblocks);
for (int i = 0; i < numblocks; ++i) { for (int i = 0; i < numblocks; ++i) {
results.push_back(device.enqueue(&EvalRange<Evaluator, Index>::run, evaluator, i*blocksize, (i+1)*blocksize)); results.push_back(device.enqueue(&EvalRange<Evaluator, Index, Vectorizable>::run, evaluator, i*blocksize, (i+1)*blocksize));
} }
if (numblocks * blocksize < size) { if (numblocks * blocksize < size) {
EvalRange<Evaluator, Index>::run(evaluator, numblocks * blocksize, size); EvalRange<Evaluator, Index, Vectorizable>::run(evaluator, numblocks * blocksize, size);
} }
for (int i = 0; i < numblocks; ++i) { for (int i = 0; i < numblocks; ++i) {