From 18caed60e3ba26ea8a556ddd497078df3c4a2694 Mon Sep 17 00:00:00 2001 From: Petar Hristov Date: Thu, 5 Dec 2019 13:50:44 +0000 Subject: [PATCH] Fixed some of the compiler warning from CDash. --- .../worklet/contourtree_augmented/EulerTour.h | 14 +++++----- .../ProcessContourTree.h | 14 +++++----- .../processcontourtree/ComputeEulerTourList.h | 27 ++++++++----------- .../processcontourtree/ComputeMinMaxValues.h | 2 +- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/vtkm/worklet/contourtree_augmented/EulerTour.h b/vtkm/worklet/contourtree_augmented/EulerTour.h index 5bec1473b..410351886 100644 --- a/vtkm/worklet/contourtree_augmented/EulerTour.h +++ b/vtkm/worklet/contourtree_augmented/EulerTour.h @@ -113,10 +113,12 @@ public: cont::ArrayHandle next; vtkm::cont::ArrayCopy( - vtkm::cont::make_ArrayHandle(std::vector(superarcs.GetNumberOfValues(), NO_SUCH_ELEMENT)), + vtkm::cont::make_ArrayHandle(std::vector( + static_cast(superarcs.GetNumberOfValues()), NO_SUCH_ELEMENT)), first); vtkm::cont::ArrayCopy( - vtkm::cont::make_ArrayHandle(std::vector(edges.GetNumberOfValues(), NO_SUCH_ELEMENT)), + vtkm::cont::make_ArrayHandle( + std::vector(static_cast(edges.GetNumberOfValues()), NO_SUCH_ELEMENT)), next); // @@ -132,8 +134,8 @@ public: succ.Allocate(edges.GetNumberOfValues()); vtkm::worklet::contourtree_augmented::process_contourtree_inc::ComputeEulerTourList - eulerTourListWorklet(edges); - this->Invoke(eulerTourListWorklet, next, first, succ); + eulerTourListWorklet; + this->Invoke(eulerTourListWorklet, next, first, edges, succ); } // Reroot the euler tour at a different root (O(n) for finding the first occurence of the new root and O(1) for rerouting and O(n) for returning it as an array) @@ -144,8 +146,8 @@ public: // // Reroot at the global min/max // - int i = 0; - int start = -1; + Id i = 0; + Id start = NO_SUCH_ELEMENT; do { if (edgesPortal.Get(i)[0] == root) diff --git a/vtkm/worklet/contourtree_augmented/ProcessContourTree.h b/vtkm/worklet/contourtree_augmented/ProcessContourTree.h index 708ecdbd2..6ea1cb73a 100644 --- a/vtkm/worklet/contourtree_augmented/ProcessContourTree.h +++ b/vtkm/worklet/contourtree_augmented/ProcessContourTree.h @@ -866,22 +866,24 @@ public: long long index; }; - std::vector vertexData(supernodes.GetNumberOfValues(), { -1, -1 }); - for (unsigned int i = 0; i < vertexData.size(); i++) + std::vector vertexData(static_cast(supernodes.GetNumberOfValues()), + { -1, -1 }); + for (unsigned long i = 0; i < vertexData.size(); i++) { vertexData[i].index = i; } parents.Set(root, root); - vertexData[root].distance = 0; + vertexData[static_cast(root)].distance = 0; for (int i = 0; i < tourEdges.GetNumberOfValues(); i++) { const Vec e = tourEdges.Get(i); - if (-1 == vertexData[e[1]].distance) + if (-1 == vertexData[static_cast(e[1])].distance) { parents.Set(e[1], e[0]); - vertexData[e[1]].distance = vertexData[e[0]].distance + 1; + vertexData[static_cast(e[1])].distance = + vertexData[static_cast(e[0])].distance + 1; } } @@ -896,7 +898,7 @@ public: for (unsigned int i = 0; i < vertexData.size(); i++) { - Id vertex = vertexData[i].index; + Id vertex = static_cast(vertexData[i].index); Id parent = parents.Get(vertex); Id vertexValue = maskedIndex(supernodes.Get(minMaxIndex.Get(vertex))); diff --git a/vtkm/worklet/contourtree_augmented/processcontourtree/ComputeEulerTourList.h b/vtkm/worklet/contourtree_augmented/processcontourtree/ComputeEulerTourList.h index f775c28ae..9180f8c69 100644 --- a/vtkm/worklet/contourtree_augmented/processcontourtree/ComputeEulerTourList.h +++ b/vtkm/worklet/contourtree_augmented/processcontourtree/ComputeEulerTourList.h @@ -76,39 +76,34 @@ namespace process_contourtree_inc class ComputeEulerTourList : public vtkm::worklet::WorkletMapField { public: - typedef void ControlSignature(WholeArrayIn next, WholeArrayIn first, WholeArrayOut succ); + typedef void ControlSignature(WholeArrayIn next, + WholeArrayIn first, + WholeArrayIn edges, + WholeArrayOut succ); - typedef void ExecutionSignature(InputIndex, _1, _2, _3); + typedef void ExecutionSignature(InputIndex, _1, _2, _3, _4); using InputDomain = _1; - vtkm::cont::ArrayHandle> edges; - - // Default Constructor - VTKM_EXEC_CONT ComputeEulerTourList(vtkm::cont::ArrayHandle> _edges) - : edges(_edges) - { - } - template VTKM_EXEC void operator()(const vtkm::Id i, const NextArrayPortalType& next, const FirstArrayPortalType& first, + const EdgesArrayPortalType& edges, const OutputArrayPortalType& succ) const { // For edge (a, b) find the opposite edge (b, a) in the sorted list of edges // This relies on the fact that in the contour tree nodes have bounded degree. // This comes from the fact that vertices in a 2D/3D mesh have a bounded degree. - auto edgesPortal = edges.GetPortalConstControl(); - - auto currentEdge = edgesPortal.Get(i); + auto currentEdge = edges.Get(i); auto oppositeIndex = first.Get(currentEdge[1]); while (oppositeIndex < edges.GetNumberOfValues() && - currentEdge[1] == edgesPortal.Get(oppositeIndex)[0]) + currentEdge[1] == edges.Get(oppositeIndex)[0]) { - if (currentEdge[0] == edgesPortal.Get(oppositeIndex)[1]) + if (currentEdge[0] == edges.Get(oppositeIndex)[1]) { break; } @@ -118,7 +113,7 @@ public: if (NO_SUCH_ELEMENT == next.Get(oppositeIndex)) { - succ.Set(i, first.Get(edges.GetPortalConstControl().Get(i)[1])); + succ.Set(i, first.Get(edges.Get(i)[1])); } else { diff --git a/vtkm/worklet/contourtree_augmented/processcontourtree/ComputeMinMaxValues.h b/vtkm/worklet/contourtree_augmented/processcontourtree/ComputeMinMaxValues.h index 7da23ae88..fec0e55a1 100644 --- a/vtkm/worklet/contourtree_augmented/processcontourtree/ComputeMinMaxValues.h +++ b/vtkm/worklet/contourtree_augmented/processcontourtree/ComputeMinMaxValues.h @@ -108,7 +108,7 @@ public: { Id optimal = tourEdges.Get(firstLast.Get(i).first)[1]; - for (int j = firstLast.Get(i).first; j < firstLast.Get(i).second; j++) + for (Id j = firstLast.Get(i).first; j < firstLast.Get(i).second; j++) { Id vertex = tourEdges.Get(j)[1];