ContourTreeUniform ignores strict-overflow optimization warnings.
Numerous worklets of ContourTreeUniform generate optimizations that presume no vtkm::Id overflow. This assumption is correct, and the related warning about this optimization can be safely ignored.
This commit is contained in:
parent
c69fa0f39c
commit
b7ab0f1194
@ -75,6 +75,13 @@
|
||||
#include <vtkm/worklet/DispatcherMapField.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
// For numerous functions inside contourTree GCC is able to determine if i is
|
||||
// always greater than j ( or vice-versa ) and optimizes those call sites.
|
||||
// But when it does these optimizations is presumes that i and j will not
|
||||
// overflow and emits a Wstrict-overflow warning
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
||||
|
||||
#include <vtkm/worklet/contourtree/ChainGraph.h>
|
||||
#include <vtkm/worklet/contourtree/ContourTree.h>
|
||||
#include <vtkm/worklet/contourtree/MergeTree.h>
|
||||
@ -202,4 +209,8 @@ public:
|
||||
}
|
||||
} // namespace vtkm::worklet
|
||||
|
||||
#ifdef VTKM_GCC
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif // vtk_m_worklet_ContourTreeUniform_h
|
||||
|
@ -192,7 +192,7 @@ public:
|
||||
// and set the initial inverse index to a flag
|
||||
isCritical = (outDegree != 1) ? 1 : 0;
|
||||
}
|
||||
}; // Mesh2D_DEM_VertexStarter
|
||||
}; // Mesh2D_DEM_VertexOutdegreeStarter
|
||||
|
||||
} // namespace contourtree
|
||||
} // namespace worklet
|
||||
|
@ -123,15 +123,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
// For numerous calls of this function GCC is able to determine if i is
|
||||
// always greater than j ( or vice-versa ) and optimizes those call sites.
|
||||
// But when it does these optimizations is presumes that i and j will not
|
||||
// overflow and emits a Wstrict-overflow warning
|
||||
#ifdef VTKM_GCC
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
||||
#endif
|
||||
|
||||
// Locate the next vertex in direction indicated
|
||||
template <typename InFieldPortalType>
|
||||
VTKM_EXEC void operator()(const vtkm::Id& vertex,
|
||||
@ -223,10 +214,6 @@ public:
|
||||
chain = destination;
|
||||
} // operator()
|
||||
|
||||
#ifdef VTKM_GCC
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
}; // Mesh2D_DEM_VertexStarter
|
||||
}
|
||||
}
|
||||
|
@ -103,14 +103,6 @@ public:
|
||||
|
||||
inline VTKM_EXEC bool operator()(const vtkm::Id& i, const vtkm::Id& j, bool ascending) const
|
||||
{
|
||||
// For numerous calls of this function GCC is able to determine if i is
|
||||
// always greater than j ( or vice-versa ) and optimizes those call sites.
|
||||
// But when it does these optimizations is presumes that i and j will not
|
||||
// overflow and emits a Wstrict-overflow warning
|
||||
#ifdef VTKM_GCC
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
||||
#endif
|
||||
if (values.Get(i) < values.Get(j))
|
||||
{
|
||||
return ascending ^ true;
|
||||
@ -127,9 +119,6 @@ public:
|
||||
{
|
||||
return ascending ^ false;
|
||||
}
|
||||
#ifdef VTKM_GCC
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
// fall through to return false
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user