Replace std::vector with our own implementation, as using the stl when compiling with nvcc and avx enabled leads to many issues.

This commit is contained in:
Benoit Steiner
2016-03-08 16:37:27 -08:00
parent 6d6413f768
commit 46177c8d64
5 changed files with 143 additions and 17 deletions

View File

@@ -256,9 +256,8 @@ struct FullReducer<Self, Op, ThreadPoolDevice, false> {
const Index numblocks = blocksize > 0 ? num_coeffs / blocksize : 0;
eigen_assert(num_coeffs >= numblocks * blocksize);
std::vector<Notification*> results;
results.reserve(numblocks);
std::vector<typename Self::CoeffReturnType> shards(numblocks, reducer.initialize());
MaxSizeVector<Notification*> results(numblocks);
MaxSizeVector<typename Self::CoeffReturnType> shards(numblocks, reducer.initialize());
for (Index i = 0; i < numblocks; ++i) {
results.push_back(
device.enqueue(&FullReducerShard<Self, Op, false>::run, self,
@@ -308,9 +307,8 @@ struct FullReducer<Self, Op, ThreadPoolDevice, true> {
const Index numblocks = blocksize > 0 ? num_coeffs / blocksize : 0;
eigen_assert(num_coeffs >= numblocks * blocksize);
std::vector<Notification*> results;
results.reserve(numblocks);
std::vector<typename Self::CoeffReturnType> shards(numblocks, reducer.initialize());
MaxSizeVector<Notification*> results(numblocks);
MaxSizeVector<typename Self::CoeffReturnType> shards(numblocks, reducer.initialize());
for (Index i = 0; i < numblocks; ++i) {
results.push_back(device.enqueue(&FullReducerShard<Self, Op, true>::run,
self, i * blocksize, blocksize, reducer,