Skip to content

Commit

Permalink
Merge pull request #1304 from LLNL/bugfix/gunney/emplace-back-from-de…
Browse files Browse the repository at this point in the history
…vice

Array emplace_back warning and possible link error
  • Loading branch information
gunney1 committed Mar 28, 2024
2 parents 7c7b7d1 + 71804b8 commit b71b026
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/axom/quest/ArrayIndexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ class ArrayIndexer
}

//!@brief Whether a StackArray represents a permutation.
bool isPermutation(const axom::StackArray<std::uint16_t, DIM>& v)
inline AXOM_HOST_DEVICE bool isPermutation(
const axom::StackArray<std::uint16_t, DIM>& v)
{
// v is a permutation if all its values are unique and in [0, DIM).
axom::StackArray<bool, DIM> found;
Expand All @@ -294,7 +295,7 @@ class ArrayIndexer
}
for(int d = 0; d < DIM; ++d)
{
if(v[d] < 0 || v[d] >= DIM)
if(v[d] >= DIM)
{
return false; // Out of range.
}
Expand Down
11 changes: 8 additions & 3 deletions src/axom/quest/MarchingCubes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ void MarchingCubes::setMesh(const conduit::Node& bpMesh,
*/
auto newDomainCount = conduit::blueprint::mesh::number_of_domains(bpMesh);

while(m_singles.size() < newDomainCount)
if(m_singles.size() < newDomainCount)
{
m_singles.emplace_back(
new detail::marching_cubes::MarchingCubesSingleDomain(*this));
auto tmpSize = m_singles.size();
m_singles.resize(newDomainCount);
for(int d = tmpSize; d < newDomainCount; ++d)
{
m_singles[d].reset(
new detail::marching_cubes::MarchingCubesSingleDomain(*this));
}
}

for(int d = 0; d < newDomainCount; ++d)
Expand Down

0 comments on commit b71b026

Please sign in to comment.