More changes to Neighborhood code to make it more easy to use.

These changes allow other worklets to be able to call neighborhood worklets.
This commit is contained in:
Robert Maynard 2017-09-04 10:16:51 -04:00
parent 83165f0cde
commit d7d5da4fa5
2 changed files with 22 additions and 3 deletions

@ -46,7 +46,7 @@ template <int NeighborhoodSize, typename ExecObjectType>
struct Neighborhood
{
VTKM_EXEC
Neighborhood(ExecObjectType portal, const vtkm::exec::arg::BoundaryState& boundary)
Neighborhood(const ExecObjectType& portal, const vtkm::exec::arg::BoundaryState& boundary)
: Boundary(&boundary)
, Portal(portal)
{
@ -83,7 +83,7 @@ template <int NeighborhoodSize>
struct Neighborhood<NeighborhoodSize, vtkm::internal::ArrayPortalUniformPointCoordinates>
{
VTKM_EXEC
Neighborhood(vtkm::internal::ArrayPortalUniformPointCoordinates portal,
Neighborhood(const vtkm::internal::ArrayPortalUniformPointCoordinates& portal,
const vtkm::exec::arg::BoundaryState& boundary)
: Boundary(&boundary)
, Portal(portal)

@ -266,7 +266,26 @@ public:
NeighborhoodSize)
, InputIndex(outToIn.Get(outIndex))
, OutputIndex(outIndex)
, VisitIndex(static_cast<vtkm::IdComponent>(visit.Get(this->OutputIndex)))
, VisitIndex(static_cast<vtkm::IdComponent>(visit.Get(outIndex)))
, GlobalThreadIndexOffset(globalThreadIndexOffset)
{
}
template <vtkm::IdComponent Dimension>
VTKM_EXEC ThreadIndicesPointNeighborhood(
const vtkm::Id& outIndex,
const vtkm::Id& inIndex,
const vtkm::IdComponent& visitIndex,
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
Dimension>& connectivity,
vtkm::Id globalThreadIndexOffset = 0)
: State(detail::To3D(connectivity.FlatToLogicalToIndex(inIndex)),
detail::To3D(connectivity.GetPointDimensions()),
NeighborhoodSize)
, InputIndex(inIndex)
, OutputIndex(outIndex)
, VisitIndex(visitIndex)
, GlobalThreadIndexOffset(globalThreadIndexOffset)
{
}