From a20ec03d0b09064da489a4ea3fa29f59cea9b7f6 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Mon, 18 May 2020 13:03:14 -0600 Subject: [PATCH] Disable proxies in filter benchmark This is going to increase the compile time for the filter benchmark, but the overall goal is to move this code into libraries. When that happens, the benchmark will not have to compile any of the filter code and should ultimately go much faster. --- benchmarking/BenchmarkFilters.cxx | 54 +++++++------------------------ 1 file changed, 11 insertions(+), 43 deletions(-) diff --git a/benchmarking/BenchmarkFilters.cxx b/benchmarking/BenchmarkFilters.cxx index 25d0c0d73..419500058 100644 --- a/benchmarking/BenchmarkFilters.cxx +++ b/benchmarking/BenchmarkFilters.cxx @@ -106,27 +106,6 @@ bool InputIsStructured() InputDataSet.GetCellSet().IsType>(); } -// Limit the filter executions to only consider the following types, otherwise -// compile times and binary sizes are nuts. -using FieldTypes = vtkm::List; - -using StructuredCellList = vtkm::List>; - -using UnstructuredCellList = - vtkm::List, vtkm::cont::CellSetSingleType<>>; - -using AllCellList = vtkm::ListAppend; - -class BenchmarkFilterPolicy : public vtkm::filter::PolicyBase -{ -public: - using FieldTypeList = FieldTypes; - - using StructuredCellSetList = StructuredCellList; - using UnstructuredCellSetList = UnstructuredCellList; - using AllCellSetList = AllCellList; -}; - enum GradOpts : int { Gradient = 1, @@ -174,13 +153,12 @@ void BenchGradient(::benchmark::State& state, int options) filter.SetColumnMajorOrdering(); } - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -224,13 +202,12 @@ void BenchThreshold(::benchmark::State& state) filter.SetLowerThreshold(mid - quarter); filter.SetUpperThreshold(mid + quarter); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -261,13 +238,12 @@ void BenchThresholdPoints(::benchmark::State& state) filter.SetUpperThreshold(mid + quarter); filter.SetCompactPoints(compactPoints); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -283,13 +259,12 @@ void BenchCellAverage(::benchmark::State& state) vtkm::filter::CellAverage filter; filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -305,13 +280,12 @@ void BenchPointAverage(::benchmark::State& state) vtkm::filter::PointAverage filter; filter.SetActiveField(CellScalarsName, vtkm::cont::Field::Association::CELL_SET); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -329,13 +303,12 @@ void BenchWarpScalar(::benchmark::State& state) filter.SetNormalField(PointVectorsName, vtkm::cont::Field::Association::POINTS); filter.SetScalarFactorField(PointScalarsName, vtkm::cont::Field::Association::POINTS); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -352,13 +325,12 @@ void BenchWarpVector(::benchmark::State& state) filter.SetUseCoordinateSystemAsField(true); filter.SetVectorField(PointVectorsName, vtkm::cont::Field::Association::POINTS); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -399,13 +371,12 @@ void BenchContour(::benchmark::State& state) filter.SetComputeFastNormalsForStructured(fastNormals); filter.SetComputeFastNormalsForUnstructured(fastNormals); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -438,13 +409,12 @@ void BenchExternalFaces(::benchmark::State& state) vtkm::filter::ExternalFaces filter; filter.SetCompactPoints(compactPoints); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -466,13 +436,12 @@ void BenchTetrahedralize(::benchmark::State& state) vtkm::filter::Tetrahedralize filter; - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop(); @@ -496,13 +465,12 @@ void BenchVertexClustering(::benchmark::State& state) vtkm::filter::VertexClustering filter; filter.SetNumberOfDivisions({ numDivs }); - BenchmarkFilterPolicy policy; vtkm::cont::Timer timer{ device }; for (auto _ : state) { (void)_; timer.Start(); - auto result = filter.Execute(InputDataSet, policy); + auto result = filter.Execute(InputDataSet); ::benchmark::DoNotOptimize(result); timer.Stop();