fixed: ensure we have a non-empty element list

this to flag that partitioning is enabled. we use -1
as this is an invalid element id.
This commit is contained in:
Arne Morten Kvarving 2020-11-25 15:26:47 +01:00
parent a243650ceb
commit 064a27d4ab
4 changed files with 16 additions and 0 deletions

View File

@ -3205,5 +3205,9 @@ void ASMs2D::generateThreadGroupsFromElms (const IntVec& elms)
if (this->getElmIndex(elm+1) > 0)
myElms.push_back(this->getElmIndex(elm+1)-1);
// We need myElms to be non-empty to flag that partitioning is enabled
if (myElms.empty())
myElms.push_back(-1);
threadGroups = threadGroups.filter(myElms);
}

View File

@ -3688,6 +3688,10 @@ void ASMs3D::generateThreadGroupsFromElms (const IntVec& elms)
if (this->getElmIndex(elm+1) > 0)
myElms.push_back(this->getElmIndex(elm+1)-1);
// We need myElms to be non-empty to flag that partitioning is enabled
if (myElms.empty())
myElms.push_back(-1);
threadGroupsVol = threadGroupsVol.filter(myElms);
for (std::pair<const char,ThreadGroups>& group : threadGroupsFace)

View File

@ -2924,6 +2924,10 @@ void ASMu2D::generateThreadGroupsFromElms (const IntVec& elms)
if (this->getElmIndex(elm+1) > 0)
myElms.push_back(this->getElmIndex(elm+1)-1);
// We need myElms to be non-empty to flag that partitioning is enabled
if (myElms.empty())
myElms.push_back(-1);
if (projThreadGroups.size() == 0 || projThreadGroups[0].empty())
projThreadGroups = threadGroups;

View File

@ -2499,6 +2499,10 @@ void ASMu3D::generateThreadGroupsFromElms (const IntVec& elms)
if (this->getElmIndex(elm+1) > 0)
myElms.push_back(this->getElmIndex(elm+1)-1);
// We need myElms to be non-empty to flag that partitioning is enabled
if (myElms.empty())
myElms.push_back(-1);
if (projThreadGroups.size() == 0 || projThreadGroups[0].empty())
projThreadGroups = threadGroups;