diff --git a/benchmarking/BenchmarkAtomicArray.cxx b/benchmarking/BenchmarkAtomicArray.cxx index 965c307b0..f2dd2cbd1 100644 --- a/benchmarking/BenchmarkAtomicArray.cxx +++ b/benchmarking/BenchmarkAtomicArray.cxx @@ -10,6 +10,7 @@ #include "Benchmarker.h" +#include #include #include #include diff --git a/benchmarking/BenchmarkCopySpeeds.cxx b/benchmarking/BenchmarkCopySpeeds.cxx index 1bd5fe244..2f845003a 100644 --- a/benchmarking/BenchmarkCopySpeeds.cxx +++ b/benchmarking/BenchmarkCopySpeeds.cxx @@ -17,8 +17,6 @@ #include -#include - #include #include diff --git a/benchmarking/BenchmarkDeviceAdapter.cxx b/benchmarking/BenchmarkDeviceAdapter.cxx index a9cbbab54..eee6c14cf 100644 --- a/benchmarking/BenchmarkDeviceAdapter.cxx +++ b/benchmarking/BenchmarkDeviceAdapter.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -28,6 +29,8 @@ #include #include +#include + #include #ifdef VTKM_ENABLE_TBB @@ -128,7 +131,37 @@ template struct TestValueFunctor { VTKM_EXEC_CONT - T operator()(vtkm::Id i) const { return TestValue(i, T{}); } + T operator()(vtkm::Id i) const { return static_cast(i + 10); } +}; + +template +VTKM_EXEC_CONT T TestValue(vtkm::Id index) +{ + return TestValueFunctor{}(index); +} + +template +struct TestValueFunctor> +{ + VTKM_EXEC_CONT vtkm::Pair operator()(vtkm::Id i) const + { + return vtkm::make_Pair(TestValue(i), TestValue(i + 1)); + } +}; + +template +struct TestValueFunctor> +{ + template + VTKM_EXEC_CONT vtkm::Vec FillVec(vtkm::Id i, vtkmstd::index_sequence) const + { + return vtkm::make_Vec(TestValue(i + static_cast(Ns))...); + } + + VTKM_EXEC_CONT vtkm::Vec operator()(vtkm::Id i) const + { + return FillVec(i, vtkmstd::make_index_sequence(N)>{}); + } }; template @@ -139,28 +172,12 @@ VTKM_CONT void FillTestValue(ArrayT& array, vtkm::Id numValues) vtkm::cont::make_ArrayHandleImplicit(TestValueFunctor{}, numValues), array); } -template -struct ScaledTestValueFunctor -{ - vtkm::Id Scale; - VTKM_EXEC_CONT - T operator()(vtkm::Id i) const { return TestValue(i * this->Scale, T{}); } -}; - -template -VTKM_CONT void FillScaledTestValue(ArrayT& array, vtkm::Id scale, vtkm::Id numValues) -{ - using T = typename ArrayT::ValueType; - vtkm::cont::Algorithm::Copy( - vtkm::cont::make_ArrayHandleImplicit(ScaledTestValueFunctor{ scale }, numValues), array); -} - template struct ModuloTestValueFunctor { vtkm::Id Mod; VTKM_EXEC_CONT - T operator()(vtkm::Id i) const { return TestValue(i % this->Mod, T{}); } + T operator()(vtkm::Id i) const { return TestValue(i % this->Mod); } }; template @@ -186,7 +203,7 @@ struct BinaryTestValueFunctor T retVal; do { - retVal = TestValue(i++, T{}); + retVal = TestValue(i++); } while (retVal == zero); return retVal; } @@ -213,7 +230,7 @@ VTKM_CONT void FillRandomTestValue(ArrayT& array, vtkm::Id numValues) auto portal = array.WritePortal(); for (vtkm::Id i = 0; i < portal.GetNumberOfValues(); ++i) { - portal.Set(i, TestValue(static_cast(rng()), ValueType{})); + portal.Set(i, TestValue(static_cast(rng()))); } } @@ -228,7 +245,7 @@ VTKM_CONT void FillRandomModTestValue(ArrayT& array, vtkm::Id mod, vtkm::Id numV auto portal = array.WritePortal(); for (vtkm::Id i = 0; i < portal.GetNumberOfValues(); ++i) { - portal.Set(i, TestValue(static_cast(rng()) % mod, ValueType{})); + portal.Set(i, TestValue(static_cast(rng()) % mod)); } } @@ -593,7 +610,7 @@ void BenchFillArrayHandle(benchmark::State& state) { (void)_; timer.Start(); - vtkm::cont::Algorithm::Fill(device, array, TestValue(19, ValueType{}), numValues); + vtkm::cont::Algorithm::Fill(device, array, TestValue(19), numValues); timer.Stop(); state.SetIterationTime(timer.GetElapsedTime()); diff --git a/benchmarking/BenchmarkFieldAlgorithms.cxx b/benchmarking/BenchmarkFieldAlgorithms.cxx index a7f50a59c..13899d63c 100644 --- a/benchmarking/BenchmarkFieldAlgorithms.cxx +++ b/benchmarking/BenchmarkFieldAlgorithms.cxx @@ -27,7 +27,6 @@ #include #include "Benchmarker.h" -#include #include #include diff --git a/benchmarking/BenchmarkFilters.cxx b/benchmarking/BenchmarkFilters.cxx index 509135df2..27837781d 100644 --- a/benchmarking/BenchmarkFilters.cxx +++ b/benchmarking/BenchmarkFilters.cxx @@ -25,7 +25,6 @@ #include #include #include -#include #include diff --git a/benchmarking/BenchmarkRayTracing.cxx b/benchmarking/BenchmarkRayTracing.cxx index c4534b480..8c3f786ef 100644 --- a/benchmarking/BenchmarkRayTracing.cxx +++ b/benchmarking/BenchmarkRayTracing.cxx @@ -16,7 +16,8 @@ #include #include #include -#include + +#include #include #include @@ -40,9 +41,9 @@ void BenchRayTracing(::benchmark::State& state) { const vtkm::Id3 dims(128, 128, 128); - vtkm::cont::testing::MakeTestDataSet maker; - auto dataset = maker.Make3DUniformDataSet3(dims); - auto coords = dataset.GetCoordinateSystem(); + vtkm::source::Tangle maker(dims); + vtkm::cont::DataSet dataset = maker.Execute(); + vtkm::cont::CoordinateSystem coords = dataset.GetCoordinateSystem(); vtkm::rendering::Camera camera; vtkm::Bounds bounds = dataset.GetCoordinateSystem().GetBounds(); @@ -68,7 +69,7 @@ void BenchRayTracing(::benchmark::State& state) rays.Buffers.at(0).InitConst(0.f); - vtkm::cont::Field field = dataset.GetField("pointvar"); + vtkm::cont::Field field = dataset.GetField("nodevar"); vtkm::Range range = field.GetRange().ReadPortal().Get(0); tracer.SetField(field, range); diff --git a/benchmarking/BenchmarkTopologyAlgorithms.cxx b/benchmarking/BenchmarkTopologyAlgorithms.cxx index d8f1fffbc..df08558da 100644 --- a/benchmarking/BenchmarkTopologyAlgorithms.cxx +++ b/benchmarking/BenchmarkTopologyAlgorithms.cxx @@ -22,8 +22,6 @@ #include #include -#include - #include #include #include diff --git a/benchmarking/Benchmarker.h b/benchmarking/Benchmarker.h index d009fee2b..6e2bc9733 100644 --- a/benchmarking/Benchmarker.h +++ b/benchmarking/Benchmarker.h @@ -11,11 +11,11 @@ #ifndef vtk_m_benchmarking_Benchmarker_h #define vtk_m_benchmarking_Benchmarker_h +#include +#include #include #include -#include - #include #include @@ -308,7 +308,7 @@ private: void operator()(brigand::type_>) const { std::ostringstream name; - name << this->BenchName << "<" << vtkm::testing::TypeName

::Name() << ">"; + name << this->BenchName << "<" << vtkm::cont::TypeToString

() << ">"; auto bm = ::benchmark::internal::RegisterBenchmarkInternal( new ::benchmark::internal::FunctionBenchmark(name.str().c_str(), BenchType

::GetFunction())); diff --git a/benchmarking/CMakeLists.txt b/benchmarking/CMakeLists.txt index de0723753..c01a0ec1b 100644 --- a/benchmarking/CMakeLists.txt +++ b/benchmarking/CMakeLists.txt @@ -60,5 +60,5 @@ target_compile_definitions(BenchmarkDeviceAdapter PUBLIC VTKm_BENCHS_RANGE_LOWER target_compile_definitions(BenchmarkDeviceAdapter PUBLIC VTKm_BENCHS_RANGE_UPPER_BOUNDARY=${VTKm_BENCHS_RANGE_UPPER_BOUNDARY}) if(TARGET vtkm_rendering) - add_benchmark(NAME BenchmarkRayTracing FILE BenchmarkRayTracing.cxx LIBS vtkm_rendering) + add_benchmark(NAME BenchmarkRayTracing FILE BenchmarkRayTracing.cxx LIBS vtkm_rendering vtkm_source) endif() diff --git a/vtkm/exec/arg/FetchExtrude.h b/vtkm/exec/arg/FetchExtrude.h index e7a08a864..8f6f835de 100644 --- a/vtkm/exec/arg/FetchExtrude.h +++ b/vtkm/exec/arg/FetchExtrude.h @@ -13,7 +13,8 @@ #include #include #include -#include + +#include //optimized fetches for ArrayPortalXGCCoordinates for // - 3D Scheduling @@ -25,6 +26,15 @@ namespace exec namespace arg { +/// \brief Aspect tag to use for getting the visited indices. +/// +/// The \c AspectTagIncidentElementIndices aspect tag causes the \c Fetch class +/// to obtain the indices that map to the current topology element. +/// +struct AspectTagIncidentElementIndices +{ +}; + //Optimized fetch for point ids when iterating the cells ConnectivityExtrude template struct Fetch diff --git a/vtkm/exec/arg/IncidentElementIndices.h b/vtkm/exec/arg/IncidentElementIndices.h index d90b930f6..8432712c4 100644 --- a/vtkm/exec/arg/IncidentElementIndices.h +++ b/vtkm/exec/arg/IncidentElementIndices.h @@ -12,6 +12,7 @@ #include #include +#include namespace vtkm { @@ -20,15 +21,6 @@ namespace exec namespace arg { -/// \brief Aspect tag to use for getting the visited indices. -/// -/// The \c AspectTagIncidentElementIndices aspect tag causes the \c Fetch class -/// to obtain the indices that map to the current topology element. -/// -struct AspectTagIncidentElementIndices -{ -}; - /// \brief The \c ExecutionSignature tag to get the indices of visited elements. /// /// In a topology map, there are \em visited and \em incident topology elements