Skip to content

Commit

Permalink
Handle pixel modules with all invalid pixels
Browse files Browse the repository at this point in the history
Handle the case where all pixels in a module are invalid or duplicate.
  • Loading branch information
fwyzard committed Aug 8, 2022
1 parent 2522012 commit c869ddb
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ namespace gpuClustering {
auto endModule = moduleStart[0];
for (auto module = firstModule; module < endModule; module += gridDim.x) {
auto firstPixel = moduleStart[1 + module];
while (id[firstPixel] == invalidModuleId)
++firstPixel; // could be duplicates!
while (id[firstPixel] == invalidModuleId) {
// could be duplicates!
++firstPixel;
}
auto thisModuleId = id[firstPixel];
if (thisModuleId != moduleId[module]) {
// all pixels are either invalid or duplicates, skip this module
continue;
}
assert(thisModuleId < nMaxModules);
assert(thisModuleId == moduleId[module]);

auto nclus = nClustersInModule[thisModuleId];
if (nclus == 0)
Expand Down

0 comments on commit c869ddb

Please sign in to comment.