Commit 71486f08 authored by Kenneth Moreland's avatar Kenneth Moreland

Fix TestingPointLocatorUniformGrid for double precision

There was an error in TestingPointLocatorUniformGrid in which it was
creating arrays of type vtkm::Float32 and passing them to a worklet that
expected vtkm::FloatDefault. This is corrected.
parent 5128d5a1
......@@ -90,12 +90,11 @@ public:
VTKM_CONT
PointLocatorUniformGridWorklet() {}
// TODO: change IdType, it is used for other purpose.
template <typename CoordiVecType, typename Locator, typename IdType, typename CoordiType>
template <typename CoordiVecType, typename Locator>
VTKM_EXEC void operator()(const CoordiVecType& qc,
const Locator& locator,
IdType& nnIdOut,
CoordiType& nnDis) const
vtkm::Id& nnIdOut,
vtkm::FloatDefault& nnDis) const
{
locator->FindNearestNeighbor(qc, nnIdOut, nnDis);
}
......@@ -142,7 +141,7 @@ public:
auto qc_Handle = vtkm::cont::make_ArrayHandle(qcVec);
vtkm::cont::ArrayHandle<vtkm::Id> nnId_Handle;
vtkm::cont::ArrayHandle<vtkm::Float32> nnDis_Handle;
vtkm::cont::ArrayHandle<vtkm::FloatDefault> nnDis_Handle;
PointLocatorUniformGridWorklet pointLocatorUniformGridWorklet;
vtkm::worklet::DispatcherMapField<PointLocatorUniformGridWorklet, DeviceAdapter>
......@@ -163,9 +162,9 @@ public:
for (vtkm::Int32 i = 0; i < nTestingPoint; i++)
{
vtkm::Id workletIdx = nnId_Handle.GetPortalControl().Get(i);
vtkm::Float32 workletDis = nnDis_Handle.GetPortalConstControl().Get(i);
vtkm::FloatDefault workletDis = nnDis_Handle.GetPortalConstControl().Get(i);
vtkm::Id bfworkletIdx = bfnnId_Handle.GetPortalControl().Get(i);
vtkm::Float32 bfworkletDis = bfnnDis_Handle.GetPortalConstControl().Get(i);
vtkm::FloatDefault bfworkletDis = bfnnDis_Handle.GetPortalConstControl().Get(i);
if (workletIdx != bfworkletIdx)
{
......
......@@ -32,7 +32,7 @@ class PointLocator : public vtkm::VirtualObjectBase
public:
VTKM_EXEC virtual void FindNearestNeighbor(const vtkm::Vec<vtkm::FloatDefault, 3>& queryPoint,
vtkm::Id& pointId,
FloatDefault& distanceSquared) const = 0;
vtkm::FloatDefault& distanceSquared) const = 0;
};
}
}
......
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