Commit b1387986 authored by Robert Maynard's avatar Robert Maynard

Update examples to work with ArrayHandleVariant/Virtual

parent 9ca4d36e
......@@ -38,11 +38,11 @@ namespace
struct FieldMapper
{
vtkm::cont::DynamicArrayHandle& Output;
vtkm::cont::ArrayHandleVariant& Output;
vtkm::worklet::Clip& Worklet;
bool IsCellField;
FieldMapper(vtkm::cont::DynamicArrayHandle& output,
FieldMapper(vtkm::cont::ArrayHandleVariant& output,
vtkm::worklet::Clip& worklet,
bool isCellField)
: Output(output)
......@@ -90,7 +90,7 @@ int main(int argc, char* argv[])
bool invertClip = false;
vtkm::cont::CellSetExplicit<> outputCellSet =
clip.Run(input.GetCellSet(0),
scalarField.GetData().ResetTypeList(vtkm::TypeListTagScalarAll()),
scalarField.GetData().ResetTypes(vtkm::TypeListTagScalarAll()),
clipValue,
invertClip);
vtkm::Float64 clipTime = timer.GetElapsedTime();
......@@ -124,7 +124,7 @@ int main(int argc, char* argv[])
continue;
}
vtkm::cont::DynamicArrayHandle outField;
vtkm::cont::ArrayHandleVariant outField;
FieldMapper fieldMapper(outField, clip, isCellField);
inField.GetData().CastAndCall(fieldMapper);
output.AddField(vtkm::cont::Field(inField.GetName(), inField.GetAssociation(), outField));
......
......@@ -64,12 +64,11 @@ public:
VTKM_CONT
vtkm::Range GetComputedRange() const { return this->ComputedRange; }
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
template <typename T, typename StorageType, typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<T, StorageType>& field,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
const DeviceAdapter& tag);
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
//@{
/// when operating on vtkm::cont::MultiBlock, we
......
......@@ -123,13 +123,12 @@ inline VTKM_CONT HistogramMPI::HistogramMPI()
}
//-----------------------------------------------------------------------------
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
template <typename T, typename StorageType, typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet HistogramMPI::DoExecute(
const vtkm::cont::DataSet&,
const vtkm::cont::ArrayHandle<T, StorageType>& field,
const vtkm::filter::FieldMetadata&,
const vtkm::filter::PolicyBase<DerivedPolicy>&,
const DeviceAdapter& device)
const vtkm::filter::PolicyBase<DerivedPolicy>&)
{
vtkm::cont::ArrayHandle<vtkm::Id> binArray;
T delta;
......@@ -142,12 +141,11 @@ inline VTKM_CONT vtkm::cont::DataSet HistogramMPI::DoExecute(
static_cast<T>(this->ComputedRange.Min),
static_cast<T>(this->ComputedRange.Max),
delta,
binArray,
device);
binArray);
}
else
{
worklet.Run(field, this->NumberOfBins, this->ComputedRange, delta, binArray, device);
worklet.Run(field, this->NumberOfBins, this->ComputedRange, delta, binArray);
}
this->BinDelta = static_cast<vtkm::Float64>(delta);
......
......@@ -47,7 +47,6 @@
#include <vtkm/cont/testing/MakeTestDataSet.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/io/writer/VTKDataSetWriter.h>
static bool printProgress = true;
......
Markdown is supported
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