Commit b2e20bf9 authored by Kenneth Moreland's avatar Kenneth Moreland

Fix issues from removing field type templates

The script fixed up most of the issues. However, there were some
instances that the script was not able to pick up on. There were
also some instances that still needed a means to select types.
parent 2e426ad5
......@@ -26,6 +26,37 @@ It needs to be run in a Unix-compatible shell. It takes a single argument,
which is a top level directory to modify files. The script processes all C++
source files recursively from that directory.
## Selecting data types for auxiliary filter fields
The main rational for making these changes is that the types of the inputs
to worklets is almost always already determined by the calling filter.
However, although it is straightforward to specify the type of the "main"
(active) scalars in a filter, it is less clear what to do for additional
fields if a filter needs a second or third field.
Typically, in the case of a second or third field, it is up to the
`DoExecute` method in the filter implementation to apply a policy to that
field. When applying a policy, you give it a policy object (nominally
passed by the user) and a traits of the filter. Generally, the accepted
list of types for a field should be part of the filter's traits For
example, consider the `WarpVector` filter. This filter only works on
`Vec`s of size 3, so its traits class looks like this.
``` cpp
template <>
class FilterTraits<WarpVector>
{
public:
// WarpVector can only applies to Float and Double Vec3 arrays
using InputFieldTypeList = vtkm::TypeListTagFieldVec3;
};
```
However, the `WarpVector` filter also requires two fields instead of one.
The first (active) field is handled by its superclass (`FilterField`), but
the second (auxiliary) field must be managed in the `DoExecute`. Generally,
this can be done by simply applying the policy with the filter traits.
## Change in executable size
The whole intention of these template parameters in the first place was to
......
......@@ -100,7 +100,7 @@ VTKM_CONT CellSetType* DynamicCellSetTryCast(
///
/// By default, \c DynamicCellSet will assume that the value type in the array
/// matches one of the types specified by \c VTKM_DEFAULT_CELL_SET_LIST_TAG.
/// This list can be changed by using the \c ResetTypeList method. It is
/// This list can be changed by using the \c ResetCellSetList method. It is
/// worthwhile to match these lists closely to the possible types that might be
/// used. If a type is missing you will get a runtime error. If there are more
/// types than necessary, then the template mechanism will create a lot of
......
......@@ -36,7 +36,7 @@ struct TryArraysOfType
void operator()(T) const
{
using vtkm::cont::arg::TypeCheck;
using TypeCheckTagArray = vtkm::cont::arg::TypeCheckTagArray<vtkm::TypeListTagAll>;
using vtkm::cont::arg::TypeCheckTagArray;
using StandardArray = vtkm::cont::ArrayHandle<T>;
VTKM_TEST_ASSERT((TypeCheck<TypeCheckTagArray, StandardArray>::value),
......@@ -70,48 +70,18 @@ void TestCheckAtomicArray()
using Int64Array = vtkm::cont::ArrayHandle<vtkm::Int64>;
using FloatArray = vtkm::cont::ArrayHandle<vtkm::Float32>;
using DefaultTypeCheck = TypeCheckTagAtomicArray<>;
VTKM_TEST_ASSERT((TypeCheck<DefaultTypeCheck, Int32Array>::value),
VTKM_TEST_ASSERT((TypeCheck<TypeCheckTagAtomicArray, Int32Array>::value),
"Check for 32-bit int failed.");
VTKM_TEST_ASSERT((TypeCheck<DefaultTypeCheck, Int64Array>::value),
VTKM_TEST_ASSERT((TypeCheck<TypeCheckTagAtomicArray, Int64Array>::value),
"Check for 64-bit int failed.");
VTKM_TEST_ASSERT(!(TypeCheck<DefaultTypeCheck, FloatArray>::value), "Check for float failed.");
using ExpandedTypeCheck = TypeCheckTagAtomicArray<vtkm::TypeListTagAll>;
VTKM_TEST_ASSERT((TypeCheck<ExpandedTypeCheck, Int32Array>::value),
"Check for 32-bit int failed.");
VTKM_TEST_ASSERT((TypeCheck<ExpandedTypeCheck, Int64Array>::value),
"Check for 64-bit int failed.");
VTKM_TEST_ASSERT(!(TypeCheck<ExpandedTypeCheck, FloatArray>::value), "Check for float failed.");
using RestrictedTypeCheck = TypeCheckTagAtomicArray<vtkm::ListTagBase<vtkm::Int32>>;
VTKM_TEST_ASSERT((TypeCheck<RestrictedTypeCheck, Int32Array>::value),
"Check for 32-bit int failed.");
VTKM_TEST_ASSERT(!(TypeCheck<RestrictedTypeCheck, Int64Array>::value),
"Check for 64-bit int failed.");
VTKM_TEST_ASSERT(!(TypeCheck<RestrictedTypeCheck, FloatArray>::value), "Check for float failed.");
VTKM_TEST_ASSERT(!(TypeCheck<TypeCheckTagAtomicArray, FloatArray>::value),
"Check for float failed.");
}
void TestCheckArray()
{
vtkm::testing::Testing::TryTypes(TryArraysOfType());
std::cout << "Trying some arrays with types that do not match the list." << std::endl;
using vtkm::cont::arg::TypeCheck;
using vtkm::cont::arg::TypeCheckTagArray;
using ScalarArray = vtkm::cont::ArrayHandle<vtkm::FloatDefault>;
VTKM_TEST_ASSERT((TypeCheck<TypeCheckTagArray<vtkm::TypeListTagFieldScalar>, ScalarArray>::value),
"Scalar for scalar check failed.");
VTKM_TEST_ASSERT(!(TypeCheck<TypeCheckTagArray<vtkm::TypeListTagFieldVec3>, ScalarArray>::value),
"Scalar for vector check failed.");
using VecArray = vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>>;
VTKM_TEST_ASSERT((TypeCheck<TypeCheckTagArray<vtkm::TypeListTagFieldVec3>, VecArray>::value),
"Vector for vector check failed.");
VTKM_TEST_ASSERT(!(TypeCheck<TypeCheckTagArray<vtkm::TypeListTagFieldScalar>, VecArray>::value),
"Vector for scalar check failed.");
TestCheckAtomicArray();
}
......
......@@ -21,6 +21,8 @@
#include <vtkm/filter/internal/CreateResult.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/filter/WarpVector.h>
namespace vtkm
{
namespace filter
......@@ -48,7 +50,11 @@ inline VTKM_CONT vtkm::cont::DataSet WarpVector::DoExecute(
using vecType = vtkm::Vec<T, 3>;
auto vectorF = inDataSet.GetField(this->VectorFieldName, this->VectorFieldAssociation);
vtkm::cont::ArrayHandle<vecType> result;
this->Worklet.Run(field, vtkm::filter::ApplyPolicy(vectorF, policy), this->Scale, result);
this->Worklet.Run(
field,
vtkm::filter::ApplyPolicy(vectorF, policy, vtkm::filter::FilterTraits<WarpVector>()),
this->Scale,
result);
return internal::CreateResult(inDataSet,
result,
......
......@@ -45,13 +45,8 @@ public:
{
}
using ControlSignature = void(FieldIn,
WholeArrayInOut,
FieldIn,
FieldIn,
FieldIn,
WholeArrayOut,
WholeArrayOut<vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 4>>>);
using ControlSignature =
void(FieldIn, WholeArrayInOut, FieldIn, FieldIn, FieldIn, WholeArrayOut, WholeArrayOut);
using ExecutionSignature = void(_1, _2, _3, _4, _5, _6, _7, WorkIndex);
template <typename Precision,
typename ColorPortalType,
......
......@@ -277,7 +277,10 @@ void MapperWireframer::RenderCells(const vtkm::cont::DynamicCellSet& inCellSet,
//
vtkm::worklet::DispatcherMapField<Convert1DCoordinates>(
Convert1DCoordinates(this->LogarithmY, this->LogarithmX))
.Invoke(coords.GetData(), inScalarField.GetData(), newCoords, newScalars);
.Invoke(coords.GetData(),
inScalarField.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
newCoords,
newScalars);
actualCoords = vtkm::cont::CoordinateSystem("coords", newCoords);
actualField = vtkm::cont::Field(
......
......@@ -246,8 +246,7 @@ public:
VTKM_CONT
UniqueTriangles() {}
using ControlSignature = void(WholeArrayIn<vtkm::ListTagBase<vtkm::Vec<vtkm::Id, 4>>>,
WholeArrayOut);
using ControlSignature = void(WholeArrayIn, WholeArrayOut);
using ExecutionSignature = void(_1, _2, WorkIndex);
VTKM_EXEC
......
......@@ -397,9 +397,7 @@ public:
VTKM_CONT
BufferConverter() {}
using ControlSignature = void(FieldIn,
WholeArrayOut,
WholeArrayOut<vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 4>>>);
using ControlSignature = void(FieldIn, WholeArrayOut, WholeArrayOut);
using ExecutionSignature = void(_1, _2, _3, WorkIndex);
template <typename DepthBufferPortalType, typename ColorBufferPortalType>
......@@ -553,7 +551,8 @@ private:
Camera.GetClippingRange());
vtkm::worklet::DispatcherMapField<EdgePlotter<DeviceTag>> plotterDispatcher(plotter);
plotterDispatcher.SetDevice(DeviceTag());
plotterDispatcher.Invoke(PointIndices, Coordinates, ScalarField.GetData());
plotterDispatcher.Invoke(
PointIndices, Coordinates, ScalarField.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
BufferConverter converter;
vtkm::worklet::DispatcherMapField<BufferConverter> converterDispatcher(converter);
......
......@@ -1196,7 +1196,7 @@ void ConnectivityTracer::SampleCells(Ray<FloatType>& rays, detail::RayTracking<F
vtkm::Float32(this->ScalarBounds.Max)));
dispatcher.Invoke(rays.HitIdx,
this->Coords,
this->ScalarField.GetData(),
this->ScalarField.GetData().ResetTypes(ScalarRenderingTypes()),
*(tracker.EnterDist),
*(tracker.ExitDist),
tracker.CurrentDistance,
......@@ -1215,7 +1215,7 @@ void ConnectivityTracer::SampleCells(Ray<FloatType>& rays, detail::RayTracking<F
vtkm::Float32(this->ScalarBounds.Max)));
dispatcher.Invoke(rays.HitIdx,
this->ScalarField.GetData(),
this->ScalarField.GetData().ResetTypes(ScalarRenderingTypes()),
*(tracker.EnterDist),
*(tracker.ExitDist),
tracker.CurrentDistance,
......@@ -1243,8 +1243,8 @@ void ConnectivityTracer::IntegrateCells(Ray<FloatType>& rays,
*(tracker.EnterDist),
*(tracker.ExitDist),
rays.Distance,
this->ScalarField.GetData(),
this->EmissionField.GetData(),
this->ScalarField.GetData().ResetTypes(ScalarRenderingTypes()),
this->EmissionField.GetData().ResetTypes(ScalarRenderingTypes()),
absorp,
emission,
rays.HitIdx);
......@@ -1257,7 +1257,7 @@ void ConnectivityTracer::IntegrateCells(Ray<FloatType>& rays,
*(tracker.EnterDist),
*(tracker.ExitDist),
rays.Distance,
this->ScalarField.GetData(),
this->ScalarField.GetData().ResetTypes(ScalarRenderingTypes()),
rays.Buffers.at(0).Buffer,
rays.HitIdx);
}
......
......@@ -282,7 +282,7 @@ void CylinderExtractor::SetVaryingRadius(const vtkm::Float32 minRadius,
Radii.Allocate(this->CylIds.GetNumberOfValues());
vtkm::worklet::DispatcherMapField<detail::FieldRadius>(
detail::FieldRadius(minRadius, maxRadius, range))
.Invoke(this->CylIds, this->Radii, field);
.Invoke(this->CylIds, this->Radii, field.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
}
......
......@@ -492,7 +492,8 @@ void CylinderIntersector::IntersectionDataImp(Ray<Precision>& rays,
vtkm::worklet::DispatcherMapField<detail::GetScalar<Precision>>(
detail::GetScalar<Precision>(vtkm::Float32(scalarRange.Min), vtkm::Float32(scalarRange.Max)))
.Invoke(rays.HitIdx, rays.Scalar, *scalarField, CylIds);
.Invoke(
rays.HitIdx, rays.Scalar, scalarField->GetData().ResetTypes(ScalarRenderingTypes()), CylIds);
}
void CylinderIntersector::IntersectionData(Ray<vtkm::Float32>& rays,
......
......@@ -454,7 +454,10 @@ void QuadIntersector::IntersectionDataImp(Ray<Precision>& rays,
vtkm::worklet::DispatcherMapField<detail::GetScalar<Precision>>(
detail::GetScalar<Precision>(vtkm::Float32(scalarRange.Min), vtkm::Float32(scalarRange.Max)))
.Invoke(rays.HitIdx, rays.Scalar, *scalarField, QuadIds);
.Invoke(rays.HitIdx,
rays.Scalar,
scalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
QuadIds);
}
void QuadIntersector::IntersectionData(Ray<vtkm::Float32>& rays,
......
......@@ -263,7 +263,8 @@ void SphereExtractor::SetVaryingRadius(const vtkm::Float32 minRadius,
Radii.Allocate(this->PointIds.GetNumberOfValues());
vtkm::worklet::DispatcherMapField<detail::FieldRadius>(
detail::FieldRadius(minRadius, maxRadius, range))
.Invoke(this->PointIds, this->Radii, field);
.Invoke(
this->PointIds, this->Radii, field.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
}
vtkm::cont::ArrayHandle<vtkm::Id> SphereExtractor::GetPointIds()
......
......@@ -368,7 +368,10 @@ void SphereIntersector::IntersectionDataImp(Ray<Precision>& rays,
vtkm::worklet::DispatcherMapField<detail::GetScalar<Precision>>(
detail::GetScalar<Precision>(vtkm::Float32(scalarRange.Min), vtkm::Float32(scalarRange.Max)))
.Invoke(rays.HitIdx, rays.Scalar, *scalarField, PointIds);
.Invoke(rays.HitIdx,
rays.Scalar,
scalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
PointIds);
}
void SphereIntersector::IntersectionData(Ray<vtkm::Float32>& rays,
......
......@@ -360,13 +360,21 @@ public:
{
vtkm::worklet::DispatcherMapField<LerpScalar<Precision>>(
LerpScalar<Precision>(vtkm::Float32(scalarRange.Min), vtkm::Float32(scalarRange.Max)))
.Invoke(rays.HitIdx, rays.U, rays.V, rays.Scalar, *scalarField, triangles);
.Invoke(rays.HitIdx,
rays.U,
rays.V,
rays.Scalar,
scalarField->GetData().ResetTypes(ScalarRenderingTypes()),
triangles);
}
else
{
vtkm::worklet::DispatcherMapField<NodalScalar<Precision>>(
NodalScalar<Precision>(vtkm::Float32(scalarRange.Min), vtkm::Float32(scalarRange.Max)))
.Invoke(rays.HitIdx, rays.Scalar, *scalarField, triangles);
.Invoke(rays.HitIdx,
rays.Scalar,
scalarField->GetData().ResetTypes(ScalarRenderingTypes()),
triangles);
}
} // Run
......
......@@ -846,7 +846,7 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray<P
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
*ScalarField);
ScalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
}
else
{
......@@ -861,7 +861,7 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray<P
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
*ScalarField);
ScalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
}
}
else
......@@ -884,7 +884,7 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray<P
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
*ScalarField);
ScalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
}
else
{
......@@ -896,12 +896,13 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray<P
SampleDistance,
locator));
rectilinearLocatorDispatcher.SetDevice(Device());
rectilinearLocatorDispatcher.Invoke(rays.Dir,
rays.Origin,
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
*ScalarField);
rectilinearLocatorDispatcher.Invoke(
rays.Dir,
rays.Origin,
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
ScalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
}
}
......
......@@ -128,7 +128,10 @@ void TestClippingExplicit()
vtkm::worklet::Clip clip;
bool invertClip = false;
vtkm::cont::CellSetExplicit<> outputCellSet =
clip.Run(ds.GetCellSet(0), ds.GetField("scalars").GetData(), clipValue, invertClip);
clip.Run(ds.GetCellSet(0),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
clipValue,
invertClip);
auto coordsIn = ds.GetCoordinateSystem("coords").GetData();
vtkm::cont::ArrayHandle<Coord3D> coords = clip.ProcessPointField(coordsIn);
......@@ -181,7 +184,10 @@ void TestClippingStructured()
bool invertClip = false;
vtkm::worklet::Clip clip;
vtkm::cont::CellSetExplicit<> outputCellSet =
clip.Run(ds.GetCellSet(0), ds.GetField("scalars").GetData(), clipValue, invertClip);
clip.Run(ds.GetCellSet(0),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
clipValue,
invertClip);
auto coordsIn = ds.GetCoordinateSystem("coords").GetData();
CoordsOutType coords = clip.ProcessPointField(coordsIn);
......
......@@ -118,7 +118,9 @@ public:
vtkm::worklet::ThresholdPoints threshold;
OutCellSetType outCellSet;
outCellSet = threshold.Run(
dataset.GetCellSet(0), dataset.GetField("pointvar").GetData(), ValuesBetween(40.0f, 71.0f));
dataset.GetCellSet(0),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ValuesBetween(40.0f, 71.0f));
outDataSet.AddCellSet(outCellSet);
VTKM_TEST_ASSERT(test_equal(outCellSet.GetNumberOfCells(), 11),
......@@ -148,7 +150,9 @@ public:
vtkm::worklet::ThresholdPoints threshold;
OutCellSetType outCellSet;
outCellSet = threshold.Run(
dataset.GetCellSet(0), dataset.GetField("pointvar").GetData(), ValuesAbove(1.0f));
dataset.GetCellSet(0),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ValuesAbove(1.0f));
outDataSet.AddCellSet(outCellSet);
VTKM_TEST_ASSERT(test_equal(outCellSet.GetNumberOfCells(), 27),
......@@ -171,7 +175,9 @@ public:
vtkm::worklet::ThresholdPoints threshold;
OutCellSetType outCellSet;
outCellSet = threshold.Run(
dataset.GetCellSet(0), dataset.GetField("pointvar").GetData(), ValuesBelow(50.0f));
dataset.GetCellSet(0),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ValuesBelow(50.0f));
outDataSet.AddCellSet(outCellSet);
VTKM_TEST_ASSERT(test_equal(outCellSet.GetNumberOfCells(), 6),
......
......@@ -60,30 +60,6 @@ public:
}
};
class TestMapFieldWorkletLimitedTypes : public vtkm::worklet::WorkletMapField
{
public:
using ControlSignature = void(FieldIn, FieldOut, FieldInOut);
using ExecutionSignature = _2(_1, _3, WorkIndex);
template <typename T1, typename T3>
VTKM_EXEC T1 operator()(const T1& in, T3& inout, vtkm::Id workIndex) const
{
if (!test_equal(in, TestValue(workIndex, T1()) + T1(100)))
{
this->RaiseError("Got wrong input value.");
}
if (!test_equal(inout, TestValue(workIndex, T3()) + T3(100)))
{
this->RaiseError("Got wrong in-out value.");
}
inout = inout - T3(100);
return in - T1(100);
}
};
namespace mapfield
{
static constexpr vtkm::Id ARRAY_SIZE = 10;
......@@ -197,26 +173,8 @@ void TestWorkletMapField(vtkm::cont::DeviceAdapterId id)
{
std::cout << "Testing Map Field on device adapter: " << id.GetName() << std::endl;
std::cout << "--- Worklet accepting all types." << std::endl;
vtkm::testing::Testing::TryTypes(mapfield::DoTestWorklet<TestMapFieldWorklet>(),
vtkm::TypeListTagCommon());
std::cout << "--- Worklet accepting some types." << std::endl;
vtkm::testing::Testing::TryTypes(mapfield::DoTestWorklet<TestMapFieldWorkletLimitedTypes>(),
vtkm::TypeListTagFieldScalar());
std::cout << "--- Sending bad type to worklet." << std::endl;
try
{
//can only test with variant arrays, as static arrays will fail to compile
DoVariantTestWorklet<TestMapFieldWorkletLimitedTypes> badWorkletTest;
badWorkletTest(vtkm::Vec<vtkm::Float32, 3>());
VTKM_TEST_FAIL("Did not throw expected error.");
}
catch (vtkm::cont::ErrorBadType& error)
{
std::cout << "Got expected error: " << error.GetMessage() << std::endl;
}
}
} // mapfield namespace
......
......@@ -91,7 +91,7 @@ struct DoTestWorklet
outputHandle = vtkm::cont::ArrayHandle<T>();
outputHandle.Allocate(ARRAY_SIZE);
vtkm::cont::VariantArrayHandle outputFieldDynamic(outputFieldArray);
vtkm::cont::VariantArrayHandleBase<vtkm::ListTagBase<T>> outputFieldDynamic(outputFieldArray);
dispatcher.Invoke(counting, inputHandle, outputHandle, outputFieldDynamic);
std::cout << "Check dynamic array result." << std::endl;
......
......@@ -195,7 +195,10 @@ static void TestMaxNeighborValue()
vtkm::cont::ArrayHandle<vtkm::Float32> output;
vtkm::cont::DataSet dataSet3D = testDataSet.Make3DUniformDataSet0();
dispatcher.Invoke(dataSet3D.GetField("pointvar"), dataSet3D.GetCellSet(), output);
dispatcher.Invoke(
dataSet3D.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
dataSet3D.GetCellSet(),
output);
vtkm::Float32 expected3D[18] = { 110.3f, 120.3f, 120.3f, 110.3f, 120.3f, 120.3f,
170.5f, 180.5f, 180.5f, 170.5f, 180.5f, 180.5f,
......@@ -207,7 +210,10 @@ static void TestMaxNeighborValue()
}
vtkm::cont::DataSet dataSet2D = testDataSet.Make2DUniformDataSet1();
dispatcher.Invoke(dataSet2D.GetField("pointvar"), dataSet2D.GetCellSet(), output);
dispatcher.Invoke(
dataSet2D.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
dataSet2D.GetCellSet(),
output);
vtkm::Float32 expected2D[25] = { 100.0f, 100.0f, 78.0f, 49.0f, 33.0f, 100.0f, 100.0f,
78.0f, 50.0f, 48.0f, 94.0f, 94.0f, 91.0f, 91.0f,
......
......@@ -97,7 +97,11 @@ static void TestMaxPointOrCell()
vtkm::cont::ArrayHandle<vtkm::Float32> result;
vtkm::worklet::DispatcherMapTopology<::test_explicit::MaxPointOrCellValue> dispatcher;
dispatcher.Invoke(dataSet.GetField("cellvar"), dataSet.GetField("pointvar"), &cellset, result);
dispatcher.Invoke(
dataSet.GetField("cellvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
dataSet.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
&cellset,
result);
std::cout << "Make sure we got the right answer." << std::endl;
VTKM_TEST_ASSERT(test_equal(result.GetPortalConstControl().Get(0), 100.1f),
......
......@@ -121,8 +121,8 @@ static void TestMaxPointOrCell()
vtkm::worklet::DispatcherMapTopology<::test_uniform::MaxPointOrCellValue> dispatcher;
dispatcher.Invoke(
dataSet.GetField("cellvar"),
dataSet.GetField("pointvar"),
dataSet.GetField("cellvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
dataSet.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
// We know that the cell set is a structured 2D grid and
// The worklet does not work with general types because
// of the way we get cell indices. We need to make that
......
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