Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

Commit e0daa04

Browse files
committed
aSD
1 parent 195cc6b commit e0daa04

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sparseconvnet/SCN/Metadata/SubmanifoldConvolutionRules.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ double SubmanifoldConvolution_SgToRules(SparseGrid<dimension> &grid,
3131
double countActiveInputs = 0;
3232
const Int threadCount = 4;
3333
std::vector<std::thread> threads;
34-
int activeInputs[threadCount] = {0};
34+
std::array<int, threadCount> activeInputs = {};
3535
std::vector<RuleBook> rulebooks;
3636
for (Int t = 0; t < threadCount; ++t) {
3737
rulebooks.push_back(RuleBook(rules.size()));
3838
}
3939

4040
auto func = [&](const int order) {
4141
auto outputIter = grid.mp.begin();
42+
auto &rb = rulebooks[order];
4243
int rem = grid.mp.size();
44+
int aciveInputCount = 0;
4345

4446
if (rem > order) {
4547
std::advance(outputIter, order);
@@ -54,15 +56,14 @@ double SubmanifoldConvolution_SgToRules(SparseGrid<dimension> &grid,
5456
for (auto inputPoint : inRegion) {
5557
auto inputIter = grid.mp.find(inputPoint);
5658
if (inputIter != grid.mp.end()) {
57-
activeInputs[order]++;
58-
rulebooks[order][rulesOffset].push_back(inputIter->second +
59-
grid.ctr);
60-
rulebooks[order][rulesOffset].push_back(outputIter->second +
61-
grid.ctr);
59+
aciveInputCount++;
60+
rb[rulesOffset].push_back(inputIter->second + grid.ctr);
61+
rb[rulesOffset].push_back(outputIter->second + grid.ctr);
6262
}
6363
rulesOffset++;
6464
}
6565
}
66+
activeInputs[order] = aciveInputCount;
6667
}
6768
};
6869

0 commit comments

Comments
 (0)