From 4cd2f582f47011b078a526e72c3887b1a4063c3e Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 4 Jan 2016 16:00:29 -0500 Subject: [PATCH 1/2] Add a default constructor for ScatterCounting. Without a default constructor for ScatterCounting any class that wants to hold onto a ScatterCounting object is required to know what device they are running on. By allowing default construction, we can move that requirement to just have a method on the object require a device adapter object. --- vtkm/worklet/ScatterCounting.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vtkm/worklet/ScatterCounting.h b/vtkm/worklet/ScatterCounting.h index b5b2df5d8..3b46a602b 100644 --- a/vtkm/worklet/ScatterCounting.h +++ b/vtkm/worklet/ScatterCounting.h @@ -137,6 +137,11 @@ struct SubtractToVisitIndexKernel : vtkm::exec::FunctorBase /// struct ScatterCounting { + VTKM_CONT_EXPORT + ScatterCounting() + { + } + template VTKM_CONT_EXPORT ScatterCounting(const CountArrayType &countArray, Device) From 8079dc28f000a65d6555f8a05706863953f4d251 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 4 Jan 2016 16:38:11 -0500 Subject: [PATCH 2/2] MarchingCubes generate step now requires a ScatterCounting object. Instead of having the generate step templated on the device adapter and the counting handle, we take in a fully constructed scatter counting object. --- vtkm/worklet/MarchingCubes.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/vtkm/worklet/MarchingCubes.h b/vtkm/worklet/MarchingCubes.h index c3a39cd85..bca9f9aeb 100644 --- a/vtkm/worklet/MarchingCubes.h +++ b/vtkm/worklet/MarchingCubes.h @@ -120,15 +120,12 @@ public: return this->Scatter; } - template VTKM_CONT_EXPORT IsosurfaceGenerate(FieldType isovalue, - const CountArrayType &countArray, - Device, + const vtkm::worklet::ScatterCounting& scatter, IdPortalConstType edgeTable) : EdgeTable(edgeTable), Isovalue(isovalue), - Scatter(countArray, - Device()) { } + Scatter(scatter) { } template