From 863c8e3dc655b2a2c0c53831bd8e4730f80bcc37 Mon Sep 17 00:00:00 2001 From: Sujin Philip Date: Mon, 10 Apr 2023 15:23:01 -0400 Subject: [PATCH] Clip: Use vtkm::cont::Invoker Replace use of vtkm::worklet::Dispatcher* with vtkm::cont::Invoker. --- vtkm/filter/contour/worklet/Clip.h | 62 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/vtkm/filter/contour/worklet/Clip.h b/vtkm/filter/contour/worklet/Clip.h index 6544ce91d..e047bf3b7 100644 --- a/vtkm/filter/contour/worklet/Clip.h +++ b/vtkm/filter/contour/worklet/Clip.h @@ -11,9 +11,6 @@ #define vtkm_m_worklet_Clip_h #include -#include -#include -#include #include #include #include @@ -26,6 +23,7 @@ #include #include #include +#include #include #include @@ -589,14 +587,14 @@ public: vtkm::Float64 value, bool invert) { + vtkm::cont::Invoker invoke; // Create the required output fields. vtkm::cont::ArrayHandle clipStats; vtkm::cont::ArrayHandle clipTableIndices; - ComputeStats statsWorklet(value, invert); //Send this CellSet to process - vtkm::worklet::DispatcherMapTopology statsDispatcher(statsWorklet); - statsDispatcher.Invoke(cellSet, scalars, this->ClipTablesInstance, clipStats, clipTableIndices); + ComputeStats statsWorklet(value, invert); + invoke(statsWorklet, cellSet, scalars, this->ClipTablesInstance, clipStats, clipTableIndices); ClipStats zero; vtkm::cont::ArrayHandle cellSetStats; @@ -628,23 +626,23 @@ public: this->InCellInterpolationInfo.Allocate(total.NumberOfInCellInterpPoints); this->CellMapOutputToInput.Allocate(total.NumberOfCells); - GenerateCellSet cellSetWorklet(value); //Send this CellSet to process - vtkm::worklet::DispatcherMapTopology cellSetDispatcher(cellSetWorklet); - cellSetDispatcher.Invoke(cellSet, - scalars, - clipTableIndices, - cellSetStats, - this->ClipTablesInstance, - connectivityObject, - edgePointReverseConnectivity, - edgeInterpolation, - cellPointReverseConnectivity, - cellPointEdgeReverseConnectivity, - cellPointEdgeInterpolation, - this->InCellInterpolationKeys, - this->InCellInterpolationInfo, - this->CellMapOutputToInput); + GenerateCellSet cellSetWorklet(value); + invoke(cellSetWorklet, + cellSet, + scalars, + clipTableIndices, + cellSetStats, + this->ClipTablesInstance, + connectivityObject, + edgePointReverseConnectivity, + edgeInterpolation, + cellPointReverseConnectivity, + cellPointEdgeReverseConnectivity, + cellPointEdgeInterpolation, + this->InCellInterpolationKeys, + this->InCellInterpolationInfo, + this->CellMapOutputToInput); this->InterpolationKeysBuilt = false; // Get unique EdgeInterpolation : unique edge points. @@ -674,18 +672,18 @@ public: // Scatter these values into the connectivity array, // scatter indices are given in reverse connectivity. ScatterEdgeConnectivity scatterEdgePointConnectivity(this->EdgePointsOffset); - vtkm::worklet::DispatcherMapField scatterEdgeDispatcher( - scatterEdgePointConnectivity); - scatterEdgeDispatcher.Invoke( - edgeInterpolationIndexToUnique, edgePointReverseConnectivity, connectivity); - scatterEdgeDispatcher.Invoke(cellInterpolationIndexToUnique, - cellPointEdgeReverseConnectivity, - this->InCellInterpolationInfo); + invoke(scatterEdgePointConnectivity, + edgeInterpolationIndexToUnique, + edgePointReverseConnectivity, + connectivity); + invoke(scatterEdgePointConnectivity, + cellInterpolationIndexToUnique, + cellPointEdgeReverseConnectivity, + this->InCellInterpolationInfo); + // Add offset in connectivity of all new in-cell points. ScatterInCellConnectivity scatterInCellPointConnectivity(this->InCellPointsOffset); - vtkm::worklet::DispatcherMapField scatterInCellDispatcher( - scatterInCellPointConnectivity); - scatterInCellDispatcher.Invoke(cellPointReverseConnectivity, connectivity); + invoke(scatterInCellPointConnectivity, cellPointReverseConnectivity, connectivity); vtkm::cont::CellSetExplicit<> output; vtkm::Id numberOfPoints = scalars.GetNumberOfValues() +