diff --git a/vtkm/worklet/contourtree_augmented/PrintVectors.h b/vtkm/worklet/contourtree_augmented/PrintVectors.h index 2a1d49b53..00cc7e0a8 100644 --- a/vtkm/worklet/contourtree_augmented/PrintVectors.h +++ b/vtkm/worklet/contourtree_augmented/PrintVectors.h @@ -162,6 +162,32 @@ inline void PrintHeader(vtkm::Id howMany, std::ostream& outStream = std::cout) } // PrintHeader() +// base routines for reading & writing host vectors +template +inline void PrintArrayHandle(std::string label, + const ARRAYTYPE& dVec, + vtkm::Id nValues, + std::ostream& outStream) +{ // PrintArrayHandle() + // -1 means full size + if (nValues == -1) + { + nValues = dVec.GetNumberOfValues(); + } + + // print the label + PrintLabel(label, outStream); + + // now print the data + auto portal = dVec.ReadPortal(); + for (vtkm::Id entry = 0; entry < nValues; entry++) + { + PrintDataType(portal.Get(entry), outStream); + } + // and an std::endl + outStream << std::endl; +} // PrintArrayHandle() + // base routines for reading & writing host vectors template inline void PrintValues(std::string label,