From 18b866d6e08509ff34c5b832c41d0ccad9899e07 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 8 Jan 2016 13:32:04 -0500 Subject: [PATCH] Threshold worklet is not templated on device adapter. This should help reduce the amount of code generation, when building the Threshold worklet for all device adapters. --- vtkm/worklet/Threshold.h | 9 ++++---- vtkm/worklet/testing/UnitTestThreshold.cxx | 24 ++++++++++++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/vtkm/worklet/Threshold.h b/vtkm/worklet/Threshold.h index def884693..14864040c 100644 --- a/vtkm/worklet/Threshold.h +++ b/vtkm/worklet/Threshold.h @@ -33,7 +33,6 @@ namespace vtkm { namespace worklet { -template class Threshold { public: @@ -102,10 +101,12 @@ public: UnaryPredicate Predicate; }; - template + template vtkm::cont::CellSetPermutation, CellSetType> - Run(const CellSetType &cellSet, const vtkm::cont::Field &field, - const UnaryPredicate &predicate) + Run(const CellSetType &cellSet, + const vtkm::cont::Field &field, + const UnaryPredicate &predicate, + DeviceAdapter) { typedef vtkm::cont::CellSetPermutation, CellSetType> OutputType; diff --git a/vtkm/worklet/testing/UnitTestThreshold.cxx b/vtkm/worklet/testing/UnitTestThreshold.cxx index 279c482cf..c40ad1e2d 100644 --- a/vtkm/worklet/testing/UnitTestThreshold.cxx +++ b/vtkm/worklet/testing/UnitTestThreshold.cxx @@ -70,9 +70,11 @@ public: CellSetType cellset = dataset.GetCellSet(0).CastTo(CellSetType()); - vtkm::worklet::Threshold threshold; - OutCellSetType outCellSet = threshold.Run(cellset, dataset.GetField("pointvar"), - HasValue(60.1f)); + vtkm::worklet::Threshold threshold; + OutCellSetType outCellSet = threshold.Run(cellset, + dataset.GetField("pointvar"), + HasValue(60.1f), + DeviceAdapter()); vtkm::cont::Field cellField = threshold.ProcessCellField(dataset.GetField("cellvar")); @@ -101,9 +103,11 @@ public: CellSetType cellset = dataset.GetCellSet(0).CastTo(CellSetType()); - vtkm::worklet::Threshold threshold; - OutCellSetType outCellSet = threshold.Run(cellset, dataset.GetField("pointvar"), - HasValue(20.1f)); + vtkm::worklet::Threshold threshold; + OutCellSetType outCellSet = threshold.Run(cellset, + dataset.GetField("pointvar"), + HasValue(20.1f), + DeviceAdapter()); vtkm::cont::Field cellField = threshold.ProcessCellField(dataset.GetField("cellvar")); @@ -133,9 +137,11 @@ public: CellSetType cellset = dataset.GetCellSet(0).CastTo(CellSetType()); - vtkm::worklet::Threshold threshold; - OutCellSetType outCellSet = threshold.Run(cellset, dataset.GetField("cellvar"), - HasValue(100.1f)); + vtkm::worklet::Threshold threshold; + OutCellSetType outCellSet = threshold.Run(cellset, + dataset.GetField("cellvar"), + HasValue(100.1f), + DeviceAdapter()); vtkm::cont::Field cellField = threshold.ProcessCellField(dataset.GetField("cellvar"));