Commit 18b866d6 authored by Robert Maynard's avatar Robert Maynard
Browse files

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.
parent dbee9275
......@@ -33,7 +33,6 @@
namespace vtkm {
namespace worklet {
template <typename DeviceAdapter>
class Threshold
{
public:
......@@ -102,10 +101,12 @@ public:
UnaryPredicate Predicate;
};
template <typename CellSetType, typename UnaryPredicate>
template <typename CellSetType, typename UnaryPredicate, typename DeviceAdapter>
vtkm::cont::CellSetPermutation<vtkm::cont::ArrayHandle<vtkm::Id>, 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<vtkm::cont::ArrayHandle<vtkm::Id>,
CellSetType> OutputType;
......
......@@ -70,9 +70,11 @@ public:
CellSetType cellset = dataset.GetCellSet(0).CastTo(CellSetType());
vtkm::worklet::Threshold<DeviceAdapter> 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<DeviceAdapter> 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<DeviceAdapter> 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"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment