From d961c185acddc3ae4dc53cc2702f5a86a934cd64 Mon Sep 17 00:00:00 2001 From: NAThompson Date: Tue, 12 May 2020 15:43:40 -0400 Subject: [PATCH 1/3] Deprecate ReadPortal().Get pattern. --- vtkm/cont/CellLocatorUniformGrid.cxx | 5 +++-- vtkm/cont/CellSetExplicit.h | 1 + vtkm/cont/CellSetExplicit.hxx | 15 +++++++++++---- vtkm/cont/testing/TestingCellLocatorUniformBins.h | 9 ++++++--- vtkm/cont/testing/TestingDataSetExplicit.h | 6 ++++-- .../testing/UnitTestArrayHandleConcatenate.cxx | 6 ++++-- vtkm/cont/testing/UnitTestArrayHandleCounting.cxx | 10 +++++++--- vtkm/cont/testing/UnitTestArrayHandleImplicit.cxx | 7 ++++--- vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx | 9 ++++++--- vtkm/cont/testing/UnitTestCellSet.cxx | 4 ++-- vtkm/cont/testing/UnitTestDataSetPermutation.cxx | 12 ++++++++---- .../testing/UnitTestContourFilterNormals.cxx | 8 +++++--- .../testing/UnitTestVertexClusteringFilter.cxx | 3 ++- vtkm/worklet/cosmotools/CosmoTools.h | 8 ++++---- vtkm/worklet/testing/UnitTestCellGradient.cxx | 9 ++++++--- vtkm/worklet/testing/UnitTestCosmoTools.cxx | 4 +++- 16 files changed, 76 insertions(+), 40 deletions(-) diff --git a/vtkm/cont/CellLocatorUniformGrid.cxx b/vtkm/cont/CellLocatorUniformGrid.cxx index 3310ee3fa..d39535d2a 100644 --- a/vtkm/cont/CellLocatorUniformGrid.cxx +++ b/vtkm/cont/CellLocatorUniformGrid.cxx @@ -54,9 +54,10 @@ void CellLocatorUniformGrid::Build() } UniformType uniformCoords = coords.GetData().Cast(); - this->Origin = uniformCoords.ReadPortal().GetOrigin(); + auto coordsPortal = uniformCoords.ReadPortal(); + this->Origin = coordsPortal.GetOrigin(); - vtkm::Vec3f spacing = uniformCoords.ReadPortal().GetSpacing(); + vtkm::Vec3f spacing = coordsPortal.GetSpacing(); vtkm::Vec3f unitLength; unitLength[0] = static_cast(this->PointDims[0] - 1); unitLength[1] = static_cast(this->PointDims[1] - 1); diff --git a/vtkm/cont/CellSetExplicit.h b/vtkm/cont/CellSetExplicit.h index 4e92fb1a3..7877a7726 100644 --- a/vtkm/cont/CellSetExplicit.h +++ b/vtkm/cont/CellSetExplicit.h @@ -186,6 +186,7 @@ public: VTKM_CONT vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id cellid) const override; VTKM_CONT void GetCellPointIds(vtkm::Id id, vtkm::Id* ptids) const override; + VTKM_CONT auto ShapesReadPortal() const; VTKM_CONT vtkm::UInt8 GetCellShape(vtkm::Id cellid) const override; template diff --git a/vtkm/cont/CellSetExplicit.hxx b/vtkm/cont/CellSetExplicit.hxx index 27789b8e1..7ff00e367 100644 --- a/vtkm/cont/CellSetExplicit.hxx +++ b/vtkm/cont/CellSetExplicit.hxx @@ -9,7 +9,7 @@ //============================================================================ #ifndef vtk_m_cont_CellSetExplicit_hxx #define vtk_m_cont_CellSetExplicit_hxx - +#include #include #include @@ -176,14 +176,21 @@ vtkm::IdComponent CellSetExplicit template VTKM_CONT +auto CellSetExplicit::ShapesReadPortal() const +{ + return this->Data->CellPointIds.Shapes.ReadPortal(); +} + +template +VTKM_CONT +VTKM_DEPRECATED(1.6, "Calling GetCellShape(cellid) is a performance bug. Call ShapesReadPortal() and loop over the .Get.") vtkm::UInt8 CellSetExplicit ::GetCellShape(vtkm::Id cellid) const { - // Looping over GetCellShape(cellid) is a performance bug. - // Don't know quite what to do about it right now. - return this->Data->CellPointIds.Shapes.ReadPortal().Get(cellid); + return this->ShapesReadPortal().Get(cellid); } + template template VTKM_CONT diff --git a/vtkm/cont/testing/TestingCellLocatorUniformBins.h b/vtkm/cont/testing/TestingCellLocatorUniformBins.h index 23e7e01c9..0380f277a 100644 --- a/vtkm/cont/testing/TestingCellLocatorUniformBins.h +++ b/vtkm/cont/testing/TestingCellLocatorUniformBins.h @@ -204,11 +204,14 @@ void TestCellLocator(const vtkm::Vec& dim, vtkm::Id number vtkm::worklet::DispatcherMapField dispatcher; dispatcher.Invoke(points, locator, cellIds, pcoords); + auto cellIdsPortal = cellIds.ReadPortal(); + auto expCellIdsPortal = expCellIds.ReadPortal(); + auto pcoordsPortal = pcoords.ReadPortal(); + auto expPCoordsPortal = expPCoords.ReadPortal(); for (vtkm::Id i = 0; i < numberOfPoints; ++i) { - VTKM_TEST_ASSERT(cellIds.ReadPortal().Get(i) == expCellIds.ReadPortal().Get(i), - "Incorrect cell ids"); - VTKM_TEST_ASSERT(test_equal(pcoords.ReadPortal().Get(i), expPCoords.ReadPortal().Get(i), 1e-3), + VTKM_TEST_ASSERT(cellIdsPortal.Get(i) == expCellIdsPortal.Get(i), "Incorrect cell ids"); + VTKM_TEST_ASSERT(test_equal(pcoordsPortal.Get(i), expPCoordsPortal.Get(i), 1e-3), "Incorrect parameteric coordinates"); } } diff --git a/vtkm/cont/testing/TestingDataSetExplicit.h b/vtkm/cont/testing/TestingDataSetExplicit.h index 469fd9e38..6d7896935 100644 --- a/vtkm/cont/testing/TestingDataSetExplicit.h +++ b/vtkm/cont/testing/TestingDataSetExplicit.h @@ -42,9 +42,10 @@ private: return false; } + auto ahPortal = ah.ReadPortal(); for (vtkm::Id i = 0; i < size; ++i) { - if (ah.ReadPortal().Get(i) != expected[i]) + if (ahPortal.Get(i) != expected[i]) { return false; } @@ -115,6 +116,7 @@ private: VTKM_TEST_ASSERT(conn.GetNumberOfValues() == connectivitySize, "Connectivity array wrong size."); vtkm::Id connectivityIndex = 0; + auto connPortal = conn.ReadPortal(); for (vtkm::Id pointIndex = 0; pointIndex < numPoints; pointIndex++) { vtkm::IdComponent numIncidentCells = correctNumIndices[pointIndex]; @@ -125,7 +127,7 @@ private: } for (vtkm::IdComponent cellIndex = 0; cellIndex < numIncidentCells; cellIndex++) { - vtkm::Id expectedCell = conn.ReadPortal().Get(connectivityIndex + cellIndex); + vtkm::Id expectedCell = connPortal.Get(connectivityIndex + cellIndex); std::set::iterator foundCell = correctIncidentCells.find(expectedCell); VTKM_TEST_ASSERT(foundCell != correctIncidentCells.end(), "An incident cell in the connectivity list is wrong or repeated."); diff --git a/vtkm/cont/testing/UnitTestArrayHandleConcatenate.cxx b/vtkm/cont/testing/UnitTestArrayHandleConcatenate.cxx index 329b5dae2..1becee061 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleConcatenate.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleConcatenate.cxx @@ -36,9 +36,10 @@ void TestArrayHandleConcatenate() array5 = vtkm::cont::make_ArrayHandleConcatenate(array3, array4); } + auto array5Portal = array5.ReadPortal(); for (vtkm::Id index = 0; index < array5.GetNumberOfValues(); index++) { - std::cout << array5.ReadPortal().Get(index) << std::endl; + std::cout << array5Portal.Get(index) << std::endl; } } @@ -59,8 +60,9 @@ void TestConcatenateEmptyArray() ArrayConcat arrConc(arr2, arr1); ArrayConcat2 arrConc2(arrConc, arr3); + auto arrConc2Portal = arrConc2.ReadPortal(); for (vtkm::Id i = 0; i < arrConc2.GetNumberOfValues(); i++) - std::cout << arrConc2.ReadPortal().Get(i) << std::endl; + std::cout << arrConc2Portal.Get(i) << std::endl; } } // namespace UnitTestArrayHandleIndexNamespace diff --git a/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx b/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx index 4aca0a7eb..b5e975fa3 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx @@ -102,14 +102,17 @@ struct TemplatedTests "Counting array using raw array handle + tag has wrong size."); ValueType properValue = startingValue; + auto arrayConstPortal = arrayConst.ReadPortal(); + auto arrayMakePortal = arrayMake.ReadPortal(); + auto arrayHandlePortal = arrayHandle.ReadPortal(); for (vtkm::Id index = 0; index < ARRAY_SIZE; index++) { - VTKM_TEST_ASSERT(arrayConst.ReadPortal().Get(index) == properValue, + VTKM_TEST_ASSERT(arrayConstPortal.Get(index) == properValue, "Counting array using constructor has unexpected value."); - VTKM_TEST_ASSERT(arrayMake.ReadPortal().Get(index) == properValue, + VTKM_TEST_ASSERT(arrayMakePortal.Get(index) == properValue, "Counting array using make has unexpected value."); - VTKM_TEST_ASSERT(arrayHandle.ReadPortal().Get(index) == properValue, + VTKM_TEST_ASSERT(arrayHandlePortal.Get(index) == properValue, "Counting array using raw array handle + tag has unexpected value."); properValue = properValue + step; } @@ -128,6 +131,7 @@ void TestArrayHandleCounting() TemplatedTests()(StringInt(10), StringInt(2)); } + } // namespace UnitTestArrayHandleCountingNamespace int UnitTestArrayHandleCounting(int argc, char* argv[]) diff --git a/vtkm/cont/testing/UnitTestArrayHandleImplicit.cxx b/vtkm/cont/testing/UnitTestArrayHandleImplicit.cxx index 13c75b77c..fa7d79f0f 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleImplicit.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleImplicit.cxx @@ -42,12 +42,13 @@ struct ImplicitTests using ImplicitHandle = vtkm::cont::ArrayHandleImplicit; - ImplicitHandle implict = vtkm::cont::make_ArrayHandleImplicit(functor, ARRAY_SIZE); + ImplicitHandle implicit = vtkm::cont::make_ArrayHandleImplicit(functor, ARRAY_SIZE); //verify that the control portal works + auto implicitPortal = implicit.ReadPortal(); for (int i = 0; i < ARRAY_SIZE; ++i) { - const ValueType v = implict.ReadPortal().Get(i); + const ValueType v = implicitPortal.Get(i); const ValueType correct_value = functor(i); VTKM_TEST_ASSERT(v == correct_value, "Implicit Handle Failed"); } @@ -56,7 +57,7 @@ struct ImplicitTests vtkm::cont::Token token; using Device = vtkm::cont::DeviceAdapterTagSerial; using CEPortal = typename ImplicitHandle::template ExecutionTypes::PortalConst; - CEPortal execPortal = implict.PrepareForInput(Device(), token); + CEPortal execPortal = implicit.PrepareForInput(Device(), token); for (int i = 0; i < ARRAY_SIZE; ++i) { const ValueType v = execPortal.Get(i); diff --git a/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx b/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx index 737601b0e..c90fee88e 100644 --- a/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx +++ b/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx @@ -188,11 +188,14 @@ void TestWithDataSet(vtkm::cont::CellLocatorGeneral& locator, const vtkm::cont:: // CellLocatorGeneral is non-copyable. Pass it via a pointer. dispatcher.Invoke(points, &locator, cellIds, pcoords); + auto cellIdPortal = cellIds.ReadPortal(); + auto expCellIdsPortal = expCellIds.ReadPortal(); + auto pcoordsPortal = pcoords.ReadPortal(); + auto expPCoordsPortal = expPCoords.ReadPortal(); for (vtkm::Id i = 0; i < 128; ++i) { - VTKM_TEST_ASSERT(cellIds.ReadPortal().Get(i) == expCellIds.ReadPortal().Get(i), - "Incorrect cell ids"); - VTKM_TEST_ASSERT(test_equal(pcoords.ReadPortal().Get(i), expPCoords.ReadPortal().Get(i), 1e-3), + VTKM_TEST_ASSERT(cellIdPortal.Get(i) == expCellIdsPortal.Get(i), "Incorrect cell ids"); + VTKM_TEST_ASSERT(test_equal(pcoordsPortal.Get(i), expPCoordsPortal.Get(i), 1e-3), "Incorrect parameteric coordinates"); } diff --git a/vtkm/cont/testing/UnitTestCellSet.cxx b/vtkm/cont/testing/UnitTestCellSet.cxx index ef889a99a..733d1da00 100644 --- a/vtkm/cont/testing/UnitTestCellSet.cxx +++ b/vtkm/cont/testing/UnitTestCellSet.cxx @@ -117,13 +117,13 @@ void TestAgainstBaseLine(const vtkm::cont::CellSet& cellset, : PermutationArray.GetNumberOfValues(); VTKM_TEST_ASSERT(numCells == expectedNumCell, "Wrong number of cells"); + auto permutationPortal = PermutationArray.ReadPortal(); for (vtkm::Id i = 0; i < numCells; ++i) { VTKM_TEST_ASSERT(cellset.GetCellShape(i) == vtkm::CELL_SHAPE_HEXAHEDRON, "Wrong shape"); VTKM_TEST_ASSERT(cellset.GetNumberOfPointsInCell(i) == 8, "Wrong number of points-of-cell"); - vtkm::Id baseLineCellId = - (flag == IsPermutationCellSet::YES) ? PermutationArray.ReadPortal().Get(i) : i; + vtkm::Id baseLineCellId = (flag == IsPermutationCellSet::YES) ? permutationPortal.Get(i) : i; auto baseLinePointIds = baseLineStructure.GetPointsOfCell(baseLineCellId); vtkm::Id pointIds[8]; diff --git a/vtkm/cont/testing/UnitTestDataSetPermutation.cxx b/vtkm/cont/testing/UnitTestDataSetPermutation.cxx index 9d7df938c..4586d29da 100644 --- a/vtkm/cont/testing/UnitTestDataSetPermutation.cxx +++ b/vtkm/cont/testing/UnitTestDataSetPermutation.cxx @@ -32,9 +32,10 @@ bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, return false; } + auto ahPortal = ah.ReadPortal(); for (vtkm::Id i = 0; i < size; ++i) { - if (ah.ReadPortal().Get(i) != expected[i]) + if (ahPortal.Get(i) != expected[i]) { return false; } @@ -110,9 +111,10 @@ void TestDataSet_Explicit() //iterate same cell 4 times vtkm::Float32 expected[4] = { 30.1667f, 30.1667f, 30.1667f, 30.1667f }; + auto resultPortal = result.ReadPortal(); for (int i = 0; i < 4; ++i) { - VTKM_TEST_ASSERT(test_equal(result.ReadPortal().Get(i), expected[i]), + VTKM_TEST_ASSERT(test_equal(resultPortal.Get(i), expected[i]), "Wrong result for CellAverage worklet on explicit subset data"); } } @@ -145,9 +147,10 @@ void TestDataSet_Structured2D() dispatcher.Invoke(subset, dataSet.GetField("pointvar"), result); vtkm::Float32 expected[4] = { 40.1f, 40.1f, 40.1f, 40.1f }; + auto resultPortal = result.ReadPortal(); for (int i = 0; i < 4; ++i) { - VTKM_TEST_ASSERT(test_equal(result.ReadPortal().Get(i), expected[i]), + VTKM_TEST_ASSERT(test_equal(resultPortal.Get(i), expected[i]), "Wrong result for CellAverage worklet on 2d structured subset data"); } } @@ -180,9 +183,10 @@ void TestDataSet_Structured3D() dispatcher.Invoke(subset, dataSet.GetField("pointvar"), result); vtkm::Float32 expected[4] = { 70.2125f, 70.2125f, 70.2125f, 70.2125f }; + auto resultPortal = result.ReadPortal(); for (int i = 0; i < 4; ++i) { - VTKM_TEST_ASSERT(test_equal(result.ReadPortal().Get(i), expected[i]), + VTKM_TEST_ASSERT(test_equal(resultPortal.Get(i), expected[i]), "Wrong result for CellAverage worklet on 2d structured subset data"); } } diff --git a/vtkm/filter/testing/UnitTestContourFilterNormals.cxx b/vtkm/filter/testing/UnitTestContourFilterNormals.cxx index 5b2fc3a7e..c454d21c3 100644 --- a/vtkm/filter/testing/UnitTestContourFilterNormals.cxx +++ b/vtkm/filter/testing/UnitTestContourFilterNormals.cxx @@ -97,11 +97,12 @@ void TestNormals(const vtkm::cont::DataSet& dataset, bool structured) result.GetField("normals").GetData().CopyTo(normals); VTKM_TEST_ASSERT(normals.GetNumberOfValues() == numVerts, "Wrong number of values in normals field"); + auto normalsPortal = normals.ReadPortal(); for (vtkm::Id i = 0; i < numVerts; ++i) { - VTKM_TEST_ASSERT(test_equal(normals.ReadPortal().Get(i), expected[i], 0.001), + VTKM_TEST_ASSERT(test_equal(normalsPortal.Get(i), expected[i], 0.001), "Result (", - normals.ReadPortal().Get(i), + normalsPortal.Get(i), ") does not match expected value (", expected[i], ") vert ", @@ -124,9 +125,10 @@ void TestNormals(const vtkm::cont::DataSet& dataset, bool structured) result.GetField("normals").GetData().CopyTo(normals); VTKM_TEST_ASSERT(normals.GetNumberOfValues() == numVerts, "Wrong number of values in normals field"); + normalsPortal = normals.ReadPortal(); for (vtkm::Id i = 0; i < numVerts; ++i) { - VTKM_TEST_ASSERT(test_equal(normals.ReadPortal().Get(i), expected[i], 0.001), + VTKM_TEST_ASSERT(test_equal(normalsPortal.Get(i), expected[i], 0.001), "Result does not match expected values"); } } diff --git a/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx b/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx index 805d1587c..11ddccb55 100644 --- a/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx +++ b/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx @@ -73,9 +73,10 @@ void TestVertexClustering() auto pointArray = output.GetCoordinateSystem(0).GetData(); VTKM_TEST_ASSERT(pointArray.GetNumberOfValues() == output_points, "Number of output points mismatch"); + auto pointArrayPortal = pointArray.ReadPortal(); for (vtkm::Id i = 0; i < pointArray.GetNumberOfValues(); ++i) { - const PointType& p1 = pointArray.ReadPortal().Get(i); + const PointType& p1 = pointArrayPortal.Get(i); PointType p2 = vtkm::make_Vec(output_point[i][0], output_point[i][1], output_point[i][2]); VTKM_TEST_ASSERT(test_equal(p1, p2), "Point Array mismatch"); } diff --git a/vtkm/worklet/cosmotools/CosmoTools.h b/vtkm/worklet/cosmotools/CosmoTools.h index 282e2ad45..faa7da3a0 100644 --- a/vtkm/worklet/cosmotools/CosmoTools.h +++ b/vtkm/worklet/cosmotools/CosmoTools.h @@ -88,8 +88,6 @@ #include #include -//#define DEBUG_PRINT 1 - namespace { @@ -103,9 +101,10 @@ void DebugPrint(const char* msg, vtkm::cont::ArrayHandle& array) { vtkm::Id count = 20; count = std::min(count, array.GetNumberOfValues()); + auto portal = array.ReadPortal(); std::cout << std::setw(15) << msg << ": "; for (vtkm::Id i = 0; i < count; i++) - std::cout << std::setprecision(3) << std::setw(5) << array.ReadPortal().Get(i) << " "; + std::cout << std::setprecision(3) << std::setw(5) << portal.Get(i) << " "; std::cout << std::endl; } @@ -114,9 +113,10 @@ void DebugPrint(const char* msg, vtkm::cont::ArrayHandleReverse eg = expected_gradients[i]; - vtkm::Float64 d = extraOutput.Divergence.ReadPortal().Get(i); + vtkm::Float64 d = divergencePortal.Get(i); VTKM_TEST_ASSERT(test_equal((eg[0][0] + eg[1][1] + eg[2][2]), d), "Wrong result for Divergence on 3D uniform data"); vtkm::Vec3f_64 ev(eg[1][2] - eg[2][1], eg[2][0] - eg[0][2], eg[0][1] - eg[1][0]); - vtkm::Vec3f_64 v = extraOutput.Vorticity.ReadPortal().Get(i); + vtkm::Vec3f_64 v = vorticityPortal.Get(i); VTKM_TEST_ASSERT(test_equal(ev, v), "Wrong result for Vorticity on 3D uniform data"); } } @@ -220,9 +222,10 @@ void TestCellGradientExplicit() result = gradient.Run(dataSet.GetCellSet(), dataSet.GetCoordinateSystem(), input); vtkm::Vec3f_32 expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, -0.0f } }; + auto resultPortal = result.ReadPortal(); for (int i = 0; i < 2; ++i) { - VTKM_TEST_ASSERT(test_equal(result.ReadPortal().Get(i), expected[i]), + VTKM_TEST_ASSERT(test_equal(resultPortal.Get(i), expected[i]), "Wrong result for CellGradient worklet on 3D explicit data"); } } diff --git a/vtkm/worklet/testing/UnitTestCosmoTools.cxx b/vtkm/worklet/testing/UnitTestCosmoTools.cxx index e569e8edb..71d9d7885 100644 --- a/vtkm/worklet/testing/UnitTestCosmoTools.cxx +++ b/vtkm/worklet/testing/UnitTestCosmoTools.cxx @@ -36,9 +36,11 @@ bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, return false; } + auto ahPortal = ah.ReadPortal(); + auto expectedPortal = expected.ReadPortal(); for (vtkm::Id i = 0; i < size; ++i) { - if (ah.ReadPortal().Get(i) != expected.ReadPortal().Get(i)) + if (ahPortal.Get(i) != expectedPortal.Get(i)) { return false; } From 9991179e6dcd27786438198894ac3b7c64259fcc Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 May 2020 18:10:32 -0400 Subject: [PATCH 2/3] Do not use auto return type; it's not supported until C++14. --- vtkm/cont/CellSetExplicit.h | 4 +++- vtkm/cont/CellSetExplicit.hxx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vtkm/cont/CellSetExplicit.h b/vtkm/cont/CellSetExplicit.h index 7877a7726..261ea25bf 100644 --- a/vtkm/cont/CellSetExplicit.h +++ b/vtkm/cont/CellSetExplicit.h @@ -186,7 +186,9 @@ public: VTKM_CONT vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id cellid) const override; VTKM_CONT void GetCellPointIds(vtkm::Id id, vtkm::Id* ptids) const override; - VTKM_CONT auto ShapesReadPortal() const; + VTKM_CONT typename vtkm::cont::ArrayHandle::ReadPortalType + ShapesReadPortal() const; + VTKM_CONT vtkm::UInt8 GetCellShape(vtkm::Id cellid) const override; template diff --git a/vtkm/cont/CellSetExplicit.hxx b/vtkm/cont/CellSetExplicit.hxx index 7ff00e367..da7ec8e99 100644 --- a/vtkm/cont/CellSetExplicit.hxx +++ b/vtkm/cont/CellSetExplicit.hxx @@ -176,7 +176,8 @@ vtkm::IdComponent CellSetExplicit template VTKM_CONT -auto CellSetExplicit::ShapesReadPortal() const +typename vtkm::cont::ArrayHandle::ReadPortalType +CellSetExplicit::ShapesReadPortal() const { return this->Data->CellPointIds.Shapes.ReadPortal(); } From 9aa350ee3df3343b1888fbc4ee90f281813b86e3 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 May 2020 18:13:03 -0400 Subject: [PATCH 3/3] Fix bad whitespace. --- vtkm/cont/CellSetExplicit.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtkm/cont/CellSetExplicit.hxx b/vtkm/cont/CellSetExplicit.hxx index da7ec8e99..815df2f8d 100644 --- a/vtkm/cont/CellSetExplicit.hxx +++ b/vtkm/cont/CellSetExplicit.hxx @@ -176,7 +176,7 @@ vtkm::IdComponent CellSetExplicit template VTKM_CONT -typename vtkm::cont::ArrayHandle::ReadPortalType +typename vtkm::cont::ArrayHandle::ReadPortalType CellSetExplicit::ShapesReadPortal() const { return this->Data->CellPointIds.Shapes.ReadPortal();