Commit e39c7819 authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot
Browse files

Merge topic 'more_worklets_not_templated_on_deviceadapter'

956cedfd Turn off the benchmarking ExternalsFaces.
18b866d6 Threshold worklet is not templated on device adapter.
dbee9275

 ExternalFaces worklet is not templated on device adapter.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !315
parents f71b59e7 956cedfd
......@@ -39,14 +39,13 @@
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/worklet/WorkletMapField.h>
#define __VTKM_EXTERNAL_FACES_BENCHMARK
// #define __VTKM_EXTERNAL_FACES_BENCHMARK
namespace vtkm
{
namespace worklet
{
template<typename DeviceAdapter>
struct ExternalFaces
{
//Unary predicate operator
......@@ -239,14 +238,15 @@ public:
/// \param output_pointId3Array: Output point-ids
template <typename StorageT,
typename StorageU,
typename StorageV>
typename StorageV,
typename DeviceAdapter>
void run(const vtkm::cont::ArrayHandle<vtkm::UInt8, StorageT> shapes,
const vtkm::cont::ArrayHandle<vtkm::IdComponent, StorageU> numIndices,
const vtkm::cont::ArrayHandle<vtkm::Id, StorageV> conn,
vtkm::cont::ArrayHandle<vtkm::UInt8, StorageT> &output_shapes,
vtkm::cont::ArrayHandle<vtkm::IdComponent, StorageU> &output_numIndices,
vtkm::cont::ArrayHandle<vtkm::Id, StorageV> &output_conn
)
vtkm::cont::ArrayHandle<vtkm::Id, StorageV> &output_conn,
DeviceAdapter)
{
//Create a worklet to map the number of faces to each cell
vtkm::cont::ArrayHandle<vtkm::Id> facesPerCell;
......
......@@ -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;
......
......@@ -44,13 +44,14 @@ vtkm::cont::DataSet RunExternalFaces(vtkm::cont::DataSet &ds)
vtkm::cont::ArrayHandle<vtkm::Id> output_conn;
//Run the External Faces worklet
vtkm::worklet::ExternalFaces<VTKM_DEFAULT_DEVICE_ADAPTER_TAG>().run(
vtkm::worklet::ExternalFaces().run(
shapes,
numIndices,
conn,
output_shapes,
output_numIndices,
output_conn);
output_conn,
VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
vtkm::cont::DataSet new_ds;
for(vtkm::IdComponent i=0; i < ds.GetNumberOfCoordinateSystems(); ++i)
......
......@@ -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