From 699d84681af3a28ddb39e5a15aaf19f9e479553e Mon Sep 17 00:00:00 2001 From: Dave Pugmire Date: Wed, 10 Aug 2022 07:40:53 -0400 Subject: [PATCH] Fixes kokkos builds. Need to call ReadPortal(). --- .../testing/UnitTestCellLocatorTwoLevel.cxx | 24 ++++++------------- vtkm/exec/CellLocatorTwoLevel.h | 3 --- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/vtkm/cont/testing/UnitTestCellLocatorTwoLevel.cxx b/vtkm/cont/testing/UnitTestCellLocatorTwoLevel.cxx index c34d908e6..1f228750a 100644 --- a/vtkm/cont/testing/UnitTestCellLocatorTwoLevel.cxx +++ b/vtkm/cont/testing/UnitTestCellLocatorTwoLevel.cxx @@ -199,7 +199,6 @@ public: typename LocatorType::LastCell& lastCell) const { vtkm::ErrorCode status = locator.FindCell(point, cellId, pcoords, lastCell); - std::cout << "FindCellWorkletWithLast: " << point << " " << cellId << std::endl; if (status != vtkm::ErrorCode::Success) this->RaiseError(vtkm::ErrorString(status)); } @@ -242,42 +241,33 @@ void TestCellLocator(const vtkm::Vec& dim, vtkm::Id number "Incorrect parameteric coordinates"); } - std::cout << __FILE__ << " " << __LINE__ << std::endl; //Test the last cell option. //Call the locator to fill in the lastCell array. std::vector lastCell(numberOfPoints); - auto lastCellArray = vtkm::cont::make_ArrayHandle(lastCell, vtkm::CopyFlag::On); + auto lastCellArray = vtkm::cont::make_ArrayHandle(lastCell, vtkm::CopyFlag::Off); - //vtkm::cont::printSummary_ArrayHandle(lastCellArray, std::cout); - std::cout << __FILE__ << " " << __LINE__ << std::endl; invoker(FindCellWorkletWithLastCell{}, points, locator, cellIds, pcoords, lastCellArray); //Call it again so that it uses the last-cell array. We should get the same results. - std::cout << __FILE__ << " " << __LINE__ << std::endl; invoker(FindCellWorkletWithLastCell{}, points, locator, cellIds, pcoords, lastCellArray); - //vtkm::exec::CellLocatorTwoLevel<>::LastCell x = lastCell[0].Get(); - //using LastCellType = vtkm::exec::CellLocatorTwoLevel>::LastCell; - //auto x = lastCell[0].Get(); - //std::cout<<"LastCell: "< lastCell2; lastCell2.Allocate(numberOfPoints); invoker(FindCellWorkletWithLastCell{}, points, locator, cellIds, pcoords, lastCell2); - std::cout << __FILE__ << " " << __LINE__ << std::endl; + cellIdsPortal = cellIds.ReadPortal(); + pcoordsPortal = pcoords.ReadPortal(); for (vtkm::Id i = 0; i < numberOfPoints; ++i) { VTKM_TEST_ASSERT(cellIdsPortal.Get(i) == expCellIdsPortal.Get(i), "Incorrect cell ids"); @@ -292,8 +282,8 @@ void TestingCellLocatorTwoLevel() std::cout << "Seed: " << seed << std::endl; RandomGenerator.seed(seed); - TestCellLocator(vtkm::Id3(8), 8); // 3D dataset - TestCellLocator(vtkm::Id2(18), 8); // 2D dataset + TestCellLocator(vtkm::Id3(8), 512); // 3D dataset + TestCellLocator(vtkm::Id2(18), 512); // 2D dataset } } // anonymous diff --git a/vtkm/exec/CellLocatorTwoLevel.h b/vtkm/exec/CellLocatorTwoLevel.h index 77c04cf58..d0212efc1 100644 --- a/vtkm/exec/CellLocatorTwoLevel.h +++ b/vtkm/exec/CellLocatorTwoLevel.h @@ -284,9 +284,6 @@ private: { lastCell.CellId = cellId; lastCell.LeafIdx = leafIdx; - std::cout << " ::FindCell(" << point << ") lastCell= " << lastCell.CellId << " " - << lastCell.LeafIdx << std::endl; - return vtkm::ErrorCode::Success; } }