mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
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.
This commit is contained in:
parent
5128d5a1fe
commit
71486f0864
@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user