Skip to content

Commit

Permalink
aSD
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmisko committed Sep 4, 2019
1 parent 195cc6b commit e0daa04
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sparseconvnet/SCN/Metadata/SubmanifoldConvolutionRules.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ double SubmanifoldConvolution_SgToRules(SparseGrid<dimension> &grid,
double countActiveInputs = 0;
const Int threadCount = 4;
std::vector<std::thread> threads;
int activeInputs[threadCount] = {0};
std::array<int, threadCount> activeInputs = {};
std::vector<RuleBook> rulebooks;
for (Int t = 0; t < threadCount; ++t) {
rulebooks.push_back(RuleBook(rules.size()));
}

auto func = [&](const int order) {
auto outputIter = grid.mp.begin();
auto &rb = rulebooks[order];
int rem = grid.mp.size();
int aciveInputCount = 0;

if (rem > order) {
std::advance(outputIter, order);
Expand All @@ -54,15 +56,14 @@ double SubmanifoldConvolution_SgToRules(SparseGrid<dimension> &grid,
for (auto inputPoint : inRegion) {
auto inputIter = grid.mp.find(inputPoint);
if (inputIter != grid.mp.end()) {
activeInputs[order]++;
rulebooks[order][rulesOffset].push_back(inputIter->second +
grid.ctr);
rulebooks[order][rulesOffset].push_back(outputIter->second +
grid.ctr);
aciveInputCount++;
rb[rulesOffset].push_back(inputIter->second + grid.ctr);
rb[rulesOffset].push_back(outputIter->second + grid.ctr);
}
rulesOffset++;
}
}
activeInputs[order] = aciveInputCount;
}
};

Expand Down

0 comments on commit e0daa04

Please sign in to comment.