diff --git a/.clang-format b/.clang-format index 3f82e9f94..335c7d846 100644 --- a/.clang-format +++ b/.clang-format @@ -6,6 +6,8 @@ AlignOperands: false AlwaysBreakAfterReturnType: None AlwaysBreakAfterDefinitionReturnType: None BreakBeforeBraces: Allman +BinPackArguments: false +BinPackParameters: false ColumnLimit: 100 Standard: Cpp11 # This requires clang-format 4.0 (at least). diff --git a/examples/clipping/Clipping.cxx b/examples/clipping/Clipping.cxx index b0bd60c5c..15a001022 100644 --- a/examples/clipping/Clipping.cxx +++ b/examples/clipping/Clipping.cxx @@ -59,8 +59,10 @@ int main(int argc, char* argv[]) vtkm::cont::Timer total; vtkm::cont::Timer timer; vtkm::cont::CellSetExplicit<> outputCellSet = - clip.Run(input.GetCellSet(0), scalarField.GetData().ResetTypeList(vtkm::TypeListTagScalarAll()), - clipValue, DeviceAdapter()); + clip.Run(input.GetCellSet(0), + scalarField.GetData().ResetTypeList(vtkm::TypeListTagScalarAll()), + clipValue, + DeviceAdapter()); vtkm::Float64 clipTime = timer.GetElapsedTime(); vtkm::cont::DataSet output; diff --git a/examples/demo/Demo.cxx b/examples/demo/Demo.cxx index 02b3725d2..494112638 100644 --- a/examples/demo/Demo.cxx +++ b/examples/demo/Demo.cxx @@ -34,11 +34,15 @@ #include -void makeScene(const vtkm::cont::DataSet& inputData, const vtkm::rendering::ColorTable& colorTable, - const std::string& fieldName, vtkm::rendering::Scene& scene) +void makeScene(const vtkm::cont::DataSet& inputData, + const vtkm::rendering::ColorTable& colorTable, + const std::string& fieldName, + vtkm::rendering::Scene& scene) { - scene.AddActor(vtkm::rendering::Actor(inputData.GetCellSet(), inputData.GetCoordinateSystem(), - inputData.GetField(fieldName), colorTable)); + scene.AddActor(vtkm::rendering::Actor(inputData.GetCellSet(), + inputData.GetCoordinateSystem(), + inputData.GetField(fieldName), + colorTable)); } // This example reads an input vtk file specified on the command-line (or generates a default diff --git a/examples/dynamic_dispatcher/main.cxx b/examples/dynamic_dispatcher/main.cxx index 5fc8f9f2c..6c4599545 100644 --- a/examples/dynamic_dispatcher/main.cxx +++ b/examples/dynamic_dispatcher/main.cxx @@ -31,13 +31,21 @@ struct ExampleFieldWorklet : public vtkm::worklet::WorkletMapField { - typedef void ControlSignature(FieldIn<>, FieldIn<>, FieldIn<>, FieldOut<>, FieldOut<>, + typedef void ControlSignature(FieldIn<>, + FieldIn<>, + FieldIn<>, + FieldOut<>, + FieldOut<>, FieldOut<>); typedef void ExecutionSignature(_1, _2, _3, _4, _5, _6); template - VTKM_EXEC void operator()(const vtkm::Vec& vec, const U& scalar1, const V& scalar2, - vtkm::Vec& out_vec, U& out_scalar1, V& out_scalar2) const + VTKM_EXEC void operator()(const vtkm::Vec& vec, + const U& scalar1, + const V& scalar2, + vtkm::Vec& out_vec, + U& out_scalar1, + V& out_scalar2) const { out_vec = vec * scalar1; out_scalar1 = static_cast(scalar1 + scalar2); diff --git a/examples/hello_world/HelloWorld.cxx b/examples/hello_world/HelloWorld.cxx index 7ad404f98..5b8d8a2e3 100644 --- a/examples/hello_world/HelloWorld.cxx +++ b/examples/hello_world/HelloWorld.cxx @@ -86,8 +86,8 @@ struct HelloVTKMInterop { for (int j = 0; j < dim; ++j) { - this->InputData.push_back(vtkm::Vec(2.f * static_cast(i / dim) - 1.f, 0.f, - 2.f * static_cast(j / dim) - 1.f)); + this->InputData.push_back(vtkm::Vec( + 2.f * static_cast(i / dim) - 1.f, 0.f, 2.f * static_cast(j / dim) - 1.f)); } } @@ -143,7 +143,8 @@ struct HelloVTKMInterop typedef void ExecutionSignature(_1, _2, _3); VTKM_EXEC - void operator()(const vtkm::Vec& input, vtkm::Vec& output, + void operator()(const vtkm::Vec& input, + vtkm::Vec& output, vtkm::Vec& color) const { output[0] = input[0]; diff --git a/examples/isosurface/IsosurfaceUniformGrid.cxx b/examples/isosurface/IsosurfaceUniformGrid.cxx index 3b237a709..15904f76b 100644 --- a/examples/isosurface/IsosurfaceUniformGrid.cxx +++ b/examples/isosurface/IsosurfaceUniformGrid.cxx @@ -116,8 +116,8 @@ vtkm::cont::DataSet MakeIsosurfaceTestDataSet(vtkm::Id3 dims) vtkm::Float32 maxs[3] = { 1.0f, 1.0f, 1.0f }; vtkm::cont::ArrayHandle fieldArray; - vtkm::cont::ArrayHandleCounting vertexCountImplicitArray(0, 1, vdims[0] * vdims[1] * - vdims[2]); + vtkm::cont::ArrayHandleCounting vertexCountImplicitArray( + 0, 1, vdims[0] * vdims[1] * vdims[2]); vtkm::worklet::DispatcherMapField tangleFieldDispatcher( TangleField(vdims, mins, maxs)); tangleFieldDispatcher.Invoke(vertexCountImplicitArray, fieldArray); diff --git a/examples/multi_backend/MultiBackend.cxx b/examples/multi_backend/MultiBackend.cxx index e7879a96a..c244bef74 100644 --- a/examples/multi_backend/MultiBackend.cxx +++ b/examples/multi_backend/MultiBackend.cxx @@ -46,7 +46,8 @@ struct GenerateSurfaceWorklet : public vtkm::worklet::WorkletMapField typedef void ExecutionSignature(_1, _2, _3); template - VTKM_EXEC void operator()(const vtkm::Vec& input, vtkm::Vec& output, + VTKM_EXEC void operator()(const vtkm::Vec& input, + vtkm::Vec& output, vtkm::Vec& color) const { output[0] = input[0]; @@ -93,8 +94,8 @@ std::vector> make_testData(int size) { for (int j = 0; j < size; ++j) { - data.push_back(vtkm::Vec(2.f * static_cast(i / size) - 1.f, 0.f, - 2.f * static_cast(j / size) - 1.f)); + data.push_back(vtkm::Vec( + 2.f * static_cast(i / size) - 1.f, 0.f, 2.f * static_cast(j / size) - 1.f)); } } return data; @@ -102,9 +103,9 @@ std::vector> make_testData(int size) //This is the list of devices to compile in support for. The order of the //devices determines the runtime preference. -struct DevicesToTry - : vtkm::ListTagBase +struct DevicesToTry : vtkm::ListTagBase { }; diff --git a/examples/rendering/Rendering.cxx b/examples/rendering/Rendering.cxx index f1c5ffe5e..2efcc045b 100644 --- a/examples/rendering/Rendering.cxx +++ b/examples/rendering/Rendering.cxx @@ -138,7 +138,8 @@ int main(int argc, char* argv[]) vtkm::rendering::MapperGL mapper; vtkm::rendering::Scene scene; - scene.AddActor(vtkm::rendering::Actor(ds.GetCellSet(), ds.GetCoordinateSystem(), + scene.AddActor(vtkm::rendering::Actor(ds.GetCellSet(), + ds.GetCoordinateSystem(), ds.GetField("pointvar"), vtkm::rendering::ColorTable("thermal"))); diff --git a/examples/tetrahedra/TetrahedralizeUniformGrid.cxx b/examples/tetrahedra/TetrahedralizeUniformGrid.cxx index e022bb401..ef9846df8 100644 --- a/examples/tetrahedra/TetrahedralizeUniformGrid.cxx +++ b/examples/tetrahedra/TetrahedralizeUniformGrid.cxx @@ -70,9 +70,10 @@ vtkm::cont::DataSet MakeTetrahedralizeTestDataSet(vtkm::Id3 dim) // Place uniform grid on a set physical space so OpenGL drawing is easier const vtkm::Id3 vdims(dim[0] + 1, dim[1] + 1, dim[2] + 1); const vtkm::Vec origin = vtkm::make_Vec(0.0f, 0.0f, 0.0f); - const vtkm::Vec spacing = vtkm::make_Vec( - 1.0f / static_cast(dim[0]), 1.0f / static_cast(dim[1]), - 1.0f / static_cast(dim[2])); + const vtkm::Vec spacing = + vtkm::make_Vec(1.0f / static_cast(dim[0]), + 1.0f / static_cast(dim[1]), + 1.0f / static_cast(dim[2])); // Generate coordinate system vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); diff --git a/vtkm/Bounds.h b/vtkm/Bounds.h index 97864fe55..0ce31dbe7 100644 --- a/vtkm/Bounds.h +++ b/vtkm/Bounds.h @@ -54,8 +54,12 @@ struct Bounds } template - VTKM_EXEC_CONT Bounds(const T1& minX, const T2& maxX, const T3& minY, const T4& maxY, - const T5& minZ, const T6& maxZ) + VTKM_EXEC_CONT Bounds(const T1& minX, + const T2& maxX, + const T3& minY, + const T4& maxY, + const T5& minZ, + const T6& maxZ) : X(vtkm::Range(minX, maxX)) , Y(vtkm::Range(minY, maxY)) , Z(vtkm::Range(minZ, maxZ)) diff --git a/vtkm/Math.h b/vtkm/Math.h index 680e17477..7be36b9c5 100644 --- a/vtkm/Math.h +++ b/vtkm/Math.h @@ -1738,8 +1738,8 @@ static inline VTKM_EXEC_CONT T Max(const T& x, const T& y, vtkm::TypeTraitsVecto T result; for (vtkm::IdComponent index = 0; index < Traits::NUM_COMPONENTS; index++) { - Traits::SetComponent(result, index, - vtkm::Max(Traits::GetComponent(x, index), Traits::GetComponent(y, index))); + Traits::SetComponent( + result, index, vtkm::Max(Traits::GetComponent(x, index), Traits::GetComponent(y, index))); } return result; } @@ -1757,8 +1757,8 @@ static inline VTKM_EXEC_CONT T Min(const T& x, const T& y, vtkm::TypeTraitsVecto T result; for (vtkm::IdComponent index = 0; index < Traits::NUM_COMPONENTS; index++) { - Traits::SetComponent(result, index, - vtkm::Min(Traits::GetComponent(x, index), Traits::GetComponent(y, index))); + Traits::SetComponent( + result, index, vtkm::Min(Traits::GetComponent(x, index), Traits::GetComponent(y, index))); } return result; } diff --git a/vtkm/Matrix.h b/vtkm/Matrix.h index 43ff8b1fd..2b0e4b210 100644 --- a/vtkm/Matrix.h +++ b/vtkm/Matrix.h @@ -115,7 +115,8 @@ private: /// template VTKM_EXEC_CONT const vtkm::Vec& MatrixGetRow( - const vtkm::Matrix& matrix, vtkm::IdComponent rowIndex) + const vtkm::Matrix& matrix, + vtkm::IdComponent rowIndex) { return matrix[rowIndex]; } @@ -139,7 +140,8 @@ VTKM_EXEC_CONT vtkm::Vec MatrixGetColumn(const vtkm::Matrix VTKM_EXEC_CONT void MatrixSetRow(vtkm::Matrix& matrix, - vtkm::IdComponent rowIndex, const vtkm::Vec& rowValues) + vtkm::IdComponent rowIndex, + const vtkm::Vec& rowValues) { matrix[rowIndex] = rowValues; } @@ -159,7 +161,9 @@ VTKM_EXEC_CONT void MatrixSetColumn(vtkm::Matrix& matrix, /// Standard matrix multiplication. /// -template VTKM_EXEC_CONT vtkm::Matrix MatrixMultiply( const vtkm::Matrix& leftFactor, @@ -185,7 +189,8 @@ VTKM_EXEC_CONT vtkm::Matrix MatrixMultiply( /// template VTKM_EXEC_CONT vtkm::Vec MatrixMultiply( - const vtkm::Matrix& leftFactor, const vtkm::Vec& rightFactor) + const vtkm::Matrix& leftFactor, + const vtkm::Vec& rightFactor) { vtkm::Vec product; for (vtkm::IdComponent rowIndex = 0; rowIndex < NumRow; rowIndex++) @@ -199,7 +204,8 @@ VTKM_EXEC_CONT vtkm::Vec MatrixMultiply( /// template VTKM_EXEC_CONT vtkm::Vec MatrixMultiply( - const vtkm::Vec& leftFactor, const vtkm::Matrix& rightFactor) + const vtkm::Vec& leftFactor, + const vtkm::Matrix& rightFactor) { vtkm::Vec product; for (vtkm::IdComponent colIndex = 0; colIndex < NumCol; colIndex++) @@ -260,7 +266,8 @@ namespace detail template VTKM_EXEC_CONT void MatrixLUPFactorFindPivot(vtkm::Matrix& A, vtkm::Vec& permutation, - vtkm::IdComponent topCornerIndex, T& inversionParity, + vtkm::IdComponent topCornerIndex, + T& inversionParity, bool& valid) { vtkm::IdComponent maxRowIndex = topCornerIndex; @@ -351,7 +358,8 @@ VTKM_EXEC_CONT void MatrixLUPFactorFindUpperTriangleElements(vtkm::Matrix VTKM_EXEC_CONT void MatrixLUPFactor(vtkm::Matrix& A, vtkm::Vec& permutation, - T& inversionParity, bool& valid) + T& inversionParity, + bool& valid) { // Initialize permutation. for (vtkm::IdComponent index = 0; index < Size; index++) @@ -374,7 +382,8 @@ VTKM_EXEC_CONT void MatrixLUPFactor(vtkm::Matrix& A, /// template VTKM_EXEC_CONT vtkm::Vec MatrixLUPSolve( - const vtkm::Matrix& LU, const vtkm::Vec& permutation, + const vtkm::Matrix& LU, + const vtkm::Vec& permutation, const vtkm::Vec& b) { // The LUP-factorization gives us PA = LU or equivalently A = inv(P)LU. @@ -418,7 +427,8 @@ VTKM_EXEC_CONT vtkm::Vec MatrixLUPSolve( /// template VTKM_EXEC_CONT vtkm::Vec SolveLinearSystem(const vtkm::Matrix& A, - const vtkm::Vec& b, bool& valid) + const vtkm::Vec& b, + bool& valid) { // First, we will make an LUP-factorization to help us. vtkm::Matrix LU = A; diff --git a/vtkm/NewtonsMethod.h b/vtkm/NewtonsMethod.h index 1ecc6146c..a1ee0eeae 100644 --- a/vtkm/NewtonsMethod.h +++ b/vtkm/NewtonsMethod.h @@ -37,13 +37,17 @@ namespace vtkm /// returned. /// VTKM_SUPPRESS_EXEC_WARNINGS -template VTKM_EXEC_CONT vtkm::Vec NewtonsMethod( - JacobianFunctor jacobianEvaluator, FunctionFunctor functionEvaluator, + JacobianFunctor jacobianEvaluator, + FunctionFunctor functionEvaluator, vtkm::Vec desiredFunctionOutput, vtkm::Vec initialGuess = vtkm::Vec(ScalarType(0)), - ScalarType convergeDifference = ScalarType(1e-3), vtkm::IdComponent maxIterations = 10) + ScalarType convergeDifference = ScalarType(1e-3), + vtkm::IdComponent maxIterations = 10) { typedef vtkm::Vec VectorType; typedef vtkm::Matrix MatrixType; diff --git a/vtkm/Transform3D.h b/vtkm/Transform3D.h index 28f60a3be..45145af5c 100644 --- a/vtkm/Transform3D.h +++ b/vtkm/Transform3D.h @@ -93,7 +93,8 @@ VTKM_EXEC_CONT vtkm::Vec Transform3DVector(const vtkm::Matrix& ma /// transformation matrix for those scales. /// template -VTKM_EXEC_CONT vtkm::Matrix Transform3DScale(const T& scaleX, const T& scaleY, +VTKM_EXEC_CONT vtkm::Matrix Transform3DScale(const T& scaleX, + const T& scaleY, const T& scaleZ) { vtkm::Matrix scaleMatrix(T(0)); diff --git a/vtkm/TypeListTag.h b/vtkm/TypeListTag.h index f758f08d5..00f28be1e 100644 --- a/vtkm/TypeListTag.h +++ b/vtkm/TypeListTag.h @@ -27,132 +27,148 @@ #include #include -namespace vtkm { +namespace vtkm +{ /// A list containing the type vtkm::Id. /// -struct TypeListTagId : vtkm::ListTagBase { }; +struct TypeListTagId : vtkm::ListTagBase +{ +}; /// A list containing the type vtkm::Id2. /// -struct TypeListTagId2 : vtkm::ListTagBase { }; +struct TypeListTagId2 : vtkm::ListTagBase +{ +}; /// A list containing the type vtkm::Id3. /// -struct TypeListTagId3 : vtkm::ListTagBase { }; +struct TypeListTagId3 : vtkm::ListTagBase +{ +}; /// A list containing the type vtkm::IdComponent /// -struct TypeListTagIdComponent : vtkm::ListTagBase { }; +struct TypeListTagIdComponent : vtkm::ListTagBase +{ +}; /// A list containing types used to index arrays. Contains vtkm::Id, vtkm::Id2, /// and vtkm::Id3. /// -struct TypeListTagIndex - : vtkm::ListTagBase { }; +struct TypeListTagIndex : vtkm::ListTagBase +{ +}; /// A list containing types used for scalar fields. Specifically, contains /// floating point numbers of different widths (i.e. vtkm::Float32 and /// vtkm::Float64). -struct TypeListTagFieldScalar : vtkm::ListTagBase { }; +struct TypeListTagFieldScalar : vtkm::ListTagBase +{ +}; /// A list containing types for values for fields with two dimensional /// vectors. /// struct TypeListTagFieldVec2 - : vtkm::ListTagBase, - vtkm::Vec > { }; + : vtkm::ListTagBase, vtkm::Vec> +{ +}; /// A list containing types for values for fields with three dimensional /// vectors. /// struct TypeListTagFieldVec3 - : vtkm::ListTagBase, - vtkm::Vec > { }; + : vtkm::ListTagBase, vtkm::Vec> +{ +}; /// A list containing types for values for fields with four dimensional /// vectors. /// struct TypeListTagFieldVec4 - : vtkm::ListTagBase, - vtkm::Vec > { }; + : vtkm::ListTagBase, vtkm::Vec> +{ +}; /// A list containing common types for values in fields. Specifically contains /// floating point scalars and vectors of size 2, 3, and 4 with floating point /// components. /// -struct TypeListTagField - : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec > -{ }; +struct TypeListTagField : vtkm::ListTagBase, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec> +{ +}; /// A list of all scalars defined in vtkm/Types.h. A scalar is a type that /// holds a single number. /// -struct TypeListTagScalarAll - : vtkm::ListTagBase -{ }; +struct TypeListTagScalarAll : vtkm::ListTagBase +{ +}; /// A list of the most commonly use Vec classes. Specifically, these are /// vectors of size 2, 3, or 4 containing either unsigned bytes, signed /// integers of 32 or 64 bits, or floating point values of 32 or 64 bits. /// -struct TypeListTagVecCommon - : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec > -{ }; +struct TypeListTagVecCommon : vtkm::ListTagBase, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec> +{ +}; -namespace internal { +namespace internal +{ /// A list of uncommon Vec classes with length up to 4. This is not much /// use in general, but is used when joined with \c TypeListTagVecCommon /// to get a list of all vectors up to size 4. /// -struct TypeListTagVecUncommon - : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec > -{ }; +struct TypeListTagVecUncommon : vtkm::ListTagBase, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec> +{ +}; } // namespace internal @@ -160,35 +176,35 @@ struct TypeListTagVecUncommon /// lengths between 2 and 4. /// struct TypeListTagVecAll - : vtkm::ListTagJoin< - vtkm::TypeListTagVecCommon, vtkm::internal::TypeListTagVecUncommon> -{ }; + : vtkm::ListTagJoin +{ +}; /// A list of all basic types listed in vtkm/Types.h. Does not include all /// possible VTK-m types like arbitrarily typed and sized Vecs (only up to /// length 4) or math types like matrices. /// -struct TypeListTagAll - : vtkm::ListTagJoin -{ }; +struct TypeListTagAll : vtkm::ListTagJoin +{ +}; /// A list of the most commonly used types across multiple domains. Includes /// integers, floating points, and 3 dimensional vectors of floating points. /// -struct TypeListTagCommon - : vtkm::ListTagBase, - vtkm::Vec > -{ }; +struct TypeListTagCommon : vtkm::ListTagBase, + vtkm::Vec> +{ +}; // Special implementation of ListContains for TypeListTagAll to always be // true. Although TypeListTagAll is necessarily finite, the point is to // be all inclusive. Besides, this should speed up the compilation when // checking a list that should contain everything. -template +template struct ListContains { static const bool value = true; diff --git a/vtkm/VecTraits.h b/vtkm/VecTraits.h index 15f378906..d4e864f23 100644 --- a/vtkm/VecTraits.h +++ b/vtkm/VecTraits.h @@ -109,13 +109,16 @@ struct VecTraits /// Returns the value in a given component of the vector. /// VTKM_EXEC_CONT static const ComponentType& GetComponent( - const typename std::remove_const::type& vector, vtkm::IdComponent component); + const typename std::remove_const::type& vector, + vtkm::IdComponent component); VTKM_EXEC_CONT static ComponentType& GetComponent( - typename std::remove_const::type& vector, vtkm::IdComponent component); + typename std::remove_const::type& vector, + vtkm::IdComponent component); /// Changes the value in a given component of the vector. /// - VTKM_EXEC_CONT static void SetComponent(VecType& vector, vtkm::IdComponent component, + VTKM_EXEC_CONT static void SetComponent(VecType& vector, + vtkm::IdComponent component, ComponentType value); /// Copies the components in the given vector into a given Vec object. @@ -183,7 +186,8 @@ struct VecTraits> /// Changes the value in a given component of the vector. /// - VTKM_EXEC_CONT static void SetComponent(VecType& vector, vtkm::IdComponent component, + VTKM_EXEC_CONT static void SetComponent(VecType& vector, + vtkm::IdComponent component, ComponentType value) { vector[component] = value; @@ -346,7 +350,8 @@ struct VecTraitsBasic VTKM_EXEC_CONT static ComponentType& GetComponent(ScalarType& vector, vtkm::IdComponent) { return vector; } - VTKM_EXEC_CONT static void SetComponent(ScalarType& vector, vtkm::IdComponent, + VTKM_EXEC_CONT static void SetComponent(ScalarType& vector, + vtkm::IdComponent, ComponentType value) { vector = value; diff --git a/vtkm/VecVariable.h b/vtkm/VecVariable.h index 5116038c4..4ff2903a6 100644 --- a/vtkm/VecVariable.h +++ b/vtkm/VecVariable.h @@ -142,7 +142,8 @@ struct VecTraits> } VTKM_EXEC_CONT - static void SetComponent(VecType& vector, vtkm::IdComponent componentIndex, + static void SetComponent(VecType& vector, + vtkm::IdComponent componentIndex, const ComponentType& value) { vector[componentIndex] = value; diff --git a/vtkm/VectorAnalysis.h b/vtkm/VectorAnalysis.h index 9521ec4fe..0663265cb 100644 --- a/vtkm/VectorAnalysis.h +++ b/vtkm/VectorAnalysis.h @@ -41,7 +41,8 @@ namespace vtkm /// extrapolates. If w=0 => v0 is returned if w=1 => v1 is returned. /// template -VTKM_EXEC_CONT ValueType Lerp(const ValueType& value0, const ValueType& value1, +VTKM_EXEC_CONT ValueType Lerp(const ValueType& value0, + const ValueType& value1, const WeightType& weight) { return static_cast((WeightType(1) - weight) * value0 + weight * value1); @@ -80,14 +81,16 @@ namespace detail { template VTKM_EXEC_CONT typename detail::FloatingPointReturnType::Type MagnitudeTemplate( - T x, vtkm::TypeTraitsScalarTag) + T x, + vtkm::TypeTraitsScalarTag) { return static_cast::Type>(vtkm::Abs(x)); } template VTKM_EXEC_CONT typename detail::FloatingPointReturnType::Type MagnitudeTemplate( - const T& x, vtkm::TypeTraitsVectorTag) + const T& x, + vtkm::TypeTraitsVectorTag) { return vtkm::Sqrt(vtkm::MagnitudeSquared(x)); } @@ -113,14 +116,16 @@ namespace detail { template VTKM_EXEC_CONT typename detail::FloatingPointReturnType::Type RMagnitudeTemplate( - T x, vtkm::TypeTraitsScalarTag) + T x, + vtkm::TypeTraitsScalarTag) { return T(1) / vtkm::Abs(x); } template VTKM_EXEC_CONT typename detail::FloatingPointReturnType::Type RMagnitudeTemplate( - const T& x, vtkm::TypeTraitsVectorTag) + const T& x, + vtkm::TypeTraitsVectorTag) { return vtkm::RSqrt(vtkm::MagnitudeSquared(x)); } @@ -179,7 +184,8 @@ VTKM_EXEC_CONT void Normalize(T& x) /// template VTKM_EXEC_CONT vtkm::Vec::Type, 3> Cross( - const vtkm::Vec& x, const vtkm::Vec& y) + const vtkm::Vec& x, + const vtkm::Vec& y) { return vtkm::Vec::Type, 3>( x[1] * y[2] - x[2] * y[1], x[2] * y[0] - x[0] * y[2], x[0] * y[1] - x[1] * y[0]); @@ -193,8 +199,8 @@ VTKM_EXEC_CONT vtkm::Vec::Type, 3> C /// to that triangle/plane. /// template -VTKM_EXEC_CONT vtkm::Vec::Type, 3> TriangleNormal( - const vtkm::Vec& a, const vtkm::Vec& b, const vtkm::Vec& c) +VTKM_EXEC_CONT vtkm::Vec::Type, 3> +TriangleNormal(const vtkm::Vec& a, const vtkm::Vec& b, const vtkm::Vec& c) { return vtkm::Cross(b - a, c - a); } diff --git a/vtkm/benchmarking/BenchmarkDeviceAdapter.cxx b/vtkm/benchmarking/BenchmarkDeviceAdapter.cxx index 2bc7b73d7..903b8b1c5 100644 --- a/vtkm/benchmarking/BenchmarkDeviceAdapter.cxx +++ b/vtkm/benchmarking/BenchmarkDeviceAdapter.cxx @@ -604,10 +604,16 @@ private: VTKM_MAKE_BENCHMARK(UpperBounds30, BenchUpperBounds, 30); public: - struct ValueTypes - : vtkm::ListTagBase, vtkm::Vec, vtkm::Float32, - vtkm::Float64, vtkm::Vec, vtkm::Vec> + struct ValueTypes : vtkm::ListTagBase, + vtkm::Vec, + vtkm::Float32, + vtkm::Float64, + vtkm::Vec, + vtkm::Vec> { }; diff --git a/vtkm/benchmarking/BenchmarkFieldAlgorithms.cxx b/vtkm/benchmarking/BenchmarkFieldAlgorithms.cxx index 58fc0ccdc..db4e10edb 100644 --- a/vtkm/benchmarking/BenchmarkFieldAlgorithms.cxx +++ b/vtkm/benchmarking/BenchmarkFieldAlgorithms.cxx @@ -64,7 +64,10 @@ class BlackScholes : public vtkm::worklet::WorkletMapField T Volatility; public: - typedef void ControlSignature(FieldIn, FieldIn, FieldIn, FieldOut, + typedef void ControlSignature(FieldIn, + FieldIn, + FieldIn, + FieldOut, FieldOut); typedef void ExecutionSignature(_1, _2, _3, _4, _5); @@ -99,8 +102,8 @@ public: } template - VTKM_EXEC void operator()(const U& sp, const V& os, const W& oy, T& callResult, - T& putResult) const + VTKM_EXEC void operator()(const U& sp, const V& os, const W& oy, T& callResult, T& putResult) + const { const T stockPrice = static_cast(sp); const T optionStrike = static_cast(os); @@ -226,13 +229,15 @@ class InterpolateField : public vtkm::worklet::WorkletMapField { public: typedef void ControlSignature(FieldIn interpolation_ids, - FieldIn interpolation_weights, WholeArrayIn<> inputField, + FieldIn interpolation_weights, + WholeArrayIn<> inputField, FieldOut<> output); typedef void ExecutionSignature(_1, _2, _3, _4); typedef _1 InputDomain; template - VTKM_EXEC void operator()(const vtkm::Id2& low_high, const WeightType& weight, + VTKM_EXEC void operator()(const vtkm::Id2& low_high, + const WeightType& weight, const vtkm::exec::ExecutionWholeArrayConst& inPortal, T& result) const { @@ -241,8 +246,10 @@ public: } template - VTKM_EXEC void operator()(const vtkm::Id2&, const WeightType&, - const vtkm::exec::ExecutionWholeArrayConst&, U&) const + VTKM_EXEC void operator()(const vtkm::Id2&, + const WeightType&, + const vtkm::exec::ExecutionWholeArrayConst&, + U&) const { //the inPortal and result need to be the same type so this version only //exists to generate code when using dynamic arrays @@ -300,9 +307,10 @@ struct ValueTypes : vtkm::ListTagBase { }; -struct InterpValueTypes - : vtkm::ListTagBase, - vtkm::Vec> +struct InterpValueTypes : vtkm::ListTagBase, + vtkm::Vec> { }; using StorageListTag = ::vtkm::cont::StorageListTagBasic; @@ -371,8 +379,8 @@ private: BlackScholes worklet(RISKFREE, VOLATILITY); vtkm::worklet::DispatcherMapField> dispatcher(worklet); - dispatcher.Invoke(this->StockPrice, this->OptionStrike, this->OptionYears, callResultHandle, - putResultHandle); + dispatcher.Invoke( + this->StockPrice, this->OptionStrike, this->OptionYears, callResultHandle, putResultHandle); return timer.GetElapsedTime(); } diff --git a/vtkm/benchmarking/BenchmarkTopologyAlgorithms.cxx b/vtkm/benchmarking/BenchmarkTopologyAlgorithms.cxx index 56b91bfca..2cb63b5d9 100644 --- a/vtkm/benchmarking/BenchmarkTopologyAlgorithms.cxx +++ b/vtkm/benchmarking/BenchmarkTopologyAlgorithms.cxx @@ -54,14 +54,16 @@ enum BenchmarkName class AveragePointToCell : public vtkm::worklet::WorkletMapPointToCell { public: - typedef void ControlSignature(FieldInPoint<> inPoints, CellSetIn cellset, + typedef void ControlSignature(FieldInPoint<> inPoints, + CellSetIn cellset, FieldOutCell<> outCells); typedef void ExecutionSignature(_1, PointCount, _3); typedef _2 InputDomain; template VTKM_EXEC void operator()(const PointValueVecType& pointValues, - const vtkm::IdComponent& numPoints, OutType& average) const + const vtkm::IdComponent& numPoints, + OutType& average) const { OutType sum = static_cast(pointValues[0]); for (vtkm::IdComponent pointIndex = 1; pointIndex < numPoints; ++pointIndex) @@ -81,7 +83,8 @@ public: typedef _2 InputDomain; template - VTKM_EXEC void operator()(const CellVecType& cellValues, OutType& avgVal, + VTKM_EXEC void operator()(const CellVecType& cellValues, + OutType& avgVal, const vtkm::IdComponent& numCellIDs) const { //simple functor that returns the average cell Value. @@ -99,7 +102,8 @@ template class Classification : public vtkm::worklet::WorkletMapPointToCell { public: - typedef void ControlSignature(FieldInPoint<> inNodes, CellSetIn cellset, + typedef void ControlSignature(FieldInPoint<> inNodes, + CellSetIn cellset, FieldOutCell outCaseId); typedef void ExecutionSignature(_1, _3); typedef _2 InputDomain; diff --git a/vtkm/cont/ArrayHandle.h b/vtkm/cont/ArrayHandle.h index ab0896869..aea1afd24 100644 --- a/vtkm/cont/ArrayHandle.h +++ b/vtkm/cont/ArrayHandle.h @@ -420,7 +420,8 @@ public: /// template VTKM_CONT typename ExecutionTypes::Portal PrepareForOutput( - vtkm::Id numberOfValues, DeviceAdapterTag); + vtkm::Id numberOfValues, + DeviceAdapterTag); /// Prepares this array to be used in an in-place operation (both as input /// and output) in the execution environment. If necessary, copies data to @@ -508,15 +509,17 @@ namespace detail { template -VTKM_NEVER_EXPORT VTKM_CONT inline void printSummary_ArrayHandle_Value( - const T& value, std::ostream& out, vtkm::VecTraitsTagSingleComponent) +VTKM_NEVER_EXPORT VTKM_CONT inline void +printSummary_ArrayHandle_Value(const T& value, std::ostream& out, vtkm::VecTraitsTagSingleComponent) { out << value; } template VTKM_NEVER_EXPORT VTKM_CONT inline void printSummary_ArrayHandle_Value( - const T& value, std::ostream& out, vtkm::VecTraitsTagMultipleComponents) + const T& value, + std::ostream& out, + vtkm::VecTraitsTagMultipleComponents) { using Traits = vtkm::VecTraits; using ComponentType = typename Traits::ComponentType; @@ -534,7 +537,8 @@ VTKM_NEVER_EXPORT VTKM_CONT inline void printSummary_ArrayHandle_Value( VTKM_NEVER_EXPORT VTKM_CONT -inline void printSummary_ArrayHandle_Value(UInt8 value, std::ostream& out, +inline void printSummary_ArrayHandle_Value(UInt8 value, + std::ostream& out, vtkm::VecTraitsTagSingleComponent) { out << static_cast(value); @@ -542,7 +546,8 @@ inline void printSummary_ArrayHandle_Value(UInt8 value, std::ostream& out, VTKM_NEVER_EXPORT VTKM_CONT -inline void printSummary_ArrayHandle_Value(Int8 value, std::ostream& out, +inline void printSummary_ArrayHandle_Value(Int8 value, + std::ostream& out, vtkm::VecTraitsTagSingleComponent) { out << static_cast(value); @@ -550,14 +555,16 @@ inline void printSummary_ArrayHandle_Value(Int8 value, std::ostream& out, template VTKM_NEVER_EXPORT VTKM_CONT inline void printSummary_ArrayHandle_Value( - const vtkm::Pair& value, std::ostream& out, vtkm::VecTraitsTagSingleComponent) + const vtkm::Pair& value, + std::ostream& out, + vtkm::VecTraitsTagSingleComponent) { out << "{"; - printSummary_ArrayHandle_Value(value.first, out, - typename vtkm::VecTraits::HasMultipleComponents()); + printSummary_ArrayHandle_Value( + value.first, out, typename vtkm::VecTraits::HasMultipleComponents()); out << ","; - printSummary_ArrayHandle_Value(value.second, out, - typename vtkm::VecTraits::HasMultipleComponents()); + printSummary_ArrayHandle_Value( + value.second, out, typename vtkm::VecTraits::HasMultipleComponents()); out << "}"; } @@ -565,7 +572,8 @@ VTKM_NEVER_EXPORT VTKM_CONT inline void printSummary_ArrayHandle_Value( template VTKM_NEVER_EXPORT VTKM_CONT inline void printSummary_ArrayHandle( - const vtkm::cont::ArrayHandle& array, std::ostream& out) + const vtkm::cont::ArrayHandle& array, + std::ostream& out) { using ArrayType = vtkm::cont::ArrayHandle; using PortalType = typename ArrayType::PortalConstControl; diff --git a/vtkm/cont/ArrayHandle.hxx b/vtkm/cont/ArrayHandle.hxx index 0be500adf..8ded2de67 100644 --- a/vtkm/cont/ArrayHandle.hxx +++ b/vtkm/cont/ArrayHandle.hxx @@ -186,7 +186,8 @@ void ArrayHandle::CopyInto(IteratorType dest, DeviceAdapterTag) const { PortalConstControl portal = this->GetPortalConstControl(); std::copy(vtkm::cont::ArrayPortalToIteratorBegin(portal), - vtkm::cont::ArrayPortalToIteratorEnd(portal), dest); + vtkm::cont::ArrayPortalToIteratorEnd(portal), + dest); } } diff --git a/vtkm/cont/ArrayHandleCartesianProduct.h b/vtkm/cont/ArrayHandleCartesianProduct.h index 0ac98ddf4..0128e1fc5 100644 --- a/vtkm/cont/ArrayHandleCartesianProduct.h +++ b/vtkm/cont/ArrayHandleCartesianProduct.h @@ -34,7 +34,9 @@ namespace internal /// \brief An array portal that acts as a 3D cartesian product of 3 arrays. /// -template class VTKM_ALWAYS_EXPORT ArrayPortalCartesianProduct { @@ -101,8 +103,8 @@ public: vtkm::Id i2 = idx12 / dim1; vtkm::Id i3 = index / dim12; - return vtkm::make_Vec(this->PortalFirst.Get(i1), this->PortalSecond.Get(i2), - this->PortalThird.Get(i3)); + return vtkm::make_Vec( + this->PortalFirst.Get(i1), this->PortalSecond.Get(i2), this->PortalThird.Get(i3)); } VTKM_SUPPRESS_EXEC_WARNINGS @@ -190,12 +192,16 @@ public: typedef T ValueType; typedef vtkm::exec::internal::ArrayPortalCartesianProduct< - ValueType, typename FirstHandleType::PortalControl, typename SecondHandleType::PortalControl, + ValueType, + typename FirstHandleType::PortalControl, + typename SecondHandleType::PortalControl, typename ThirdHandleType::PortalControl> PortalType; typedef vtkm::exec::internal::ArrayPortalCartesianProduct< - ValueType, typename FirstHandleType::PortalConstControl, - typename SecondHandleType::PortalConstControl, typename ThirdHandleType::PortalConstControl> + ValueType, + typename FirstHandleType::PortalConstControl, + typename SecondHandleType::PortalConstControl, + typename ThirdHandleType::PortalConstControl> PortalConstType; VTKM_CONT @@ -207,7 +213,8 @@ public: } VTKM_CONT - Storage(const FirstHandleType& array1, const SecondHandleType& array2, + Storage(const FirstHandleType& array1, + const SecondHandleType& array2, const ThirdHandleType& array3) : FirstArray(array1) , SecondArray(array2) @@ -218,7 +225,8 @@ public: VTKM_CONT PortalType GetPortal() { - return PortalType(this->FirstArray.GetPortalControl(), this->SecondArray.GetPortalControl(), + return PortalType(this->FirstArray.GetPortalControl(), + this->SecondArray.GetPortalControl(), this->ThirdArray.GetPortalControl()); } @@ -271,10 +279,14 @@ private: ThirdHandleType ThirdArray; }; -template -class ArrayTransfer< - T, StorageTagCartesianProduct, Device> +class ArrayTransfer, + Device> { typedef StorageTagCartesianProduct StorageTag; typedef vtkm::cont::internal::Storage StorageType; @@ -286,13 +298,15 @@ public: typedef typename StorageType::PortalConstType PortalConstControl; typedef vtkm::exec::internal::ArrayPortalCartesianProduct< - ValueType, typename FirstHandleType::template ExecutionTypes::Portal, + ValueType, + typename FirstHandleType::template ExecutionTypes::Portal, typename SecondHandleType::template ExecutionTypes::Portal, typename ThirdHandleType::template ExecutionTypes::Portal> PortalExecution; typedef vtkm::exec::internal::ArrayPortalCartesianProduct< - ValueType, typename FirstHandleType::template ExecutionTypes::PortalConst, + ValueType, + typename FirstHandleType::template ExecutionTypes::PortalConst, typename SecondHandleType::template ExecutionTypes::PortalConst, typename ThirdHandleType::template ExecutionTypes::PortalConst> PortalConstExecution; @@ -371,7 +385,8 @@ private: /// template class ArrayHandleCartesianProduct - : public internal::ArrayHandleCartesianProductTraits::Superclass { // If the following line gives a compile error, then the FirstHandleType @@ -384,7 +399,8 @@ public: VTKM_ARRAY_HANDLE_SUBCLASS( ArrayHandleCartesianProduct, (ArrayHandleCartesianProduct), - (typename internal::ArrayHandleCartesianProductTraits::Superclass)); private: @@ -406,7 +422,8 @@ public: template VTKM_CONT vtkm::cont::ArrayHandleCartesianProduct - make_ArrayHandleCartesianProduct(const FirstHandleType& first, const SecondHandleType& second, + make_ArrayHandleCartesianProduct(const FirstHandleType& first, + const SecondHandleType& second, const ThirdHandleType& third) { return ArrayHandleCartesianProduct( diff --git a/vtkm/cont/ArrayHandleCast.h b/vtkm/cont/ArrayHandleCast.h index 5e823d75b..b5e6a5bab 100644 --- a/vtkm/cont/ArrayHandleCast.h +++ b/vtkm/cont/ArrayHandleCast.h @@ -49,14 +49,17 @@ struct VTKM_ALWAYS_EXPORT Cast /// template class ArrayHandleCast - : public vtkm::cont::ArrayHandleTransform, internal::Cast> { public: VTKM_ARRAY_HANDLE_SUBCLASS( - ArrayHandleCast, (ArrayHandleCast), - (vtkm::cont::ArrayHandleTransform), + (vtkm::cont::ArrayHandleTransform, internal::Cast>)); diff --git a/vtkm/cont/ArrayHandleCompositeVector.h b/vtkm/cont/ArrayHandleCompositeVector.h index e177c2a59..f2bf9e4f7 100644 --- a/vtkm/cont/ArrayHandleCompositeVector.h +++ b/vtkm/cont/ArrayHandleCompositeVector.h @@ -123,7 +123,8 @@ struct CompositeVectorArrayToPortalCont template VTKM_CONT typename ReturnType::type operator()( - const ArrayHandleType& array, vtkm::internal::IndexTag) const + const ArrayHandleType& array, + vtkm::internal::IndexTag) const { return array.GetPortalConstControl(); } @@ -140,7 +141,8 @@ struct CompositeVectorArrayToPortalExec template VTKM_CONT typename ReturnType::type operator()( - const ArrayHandleType& array, vtkm::internal::IndexTag) const + const ArrayHandleType& array, + vtkm::internal::IndexTag) const { return array.PrepareForInput(DeviceAdapterTag()); } @@ -464,7 +466,8 @@ class ArrayHandleCompositeVector public: VTKM_ARRAY_HANDLE_SUBCLASS( - ArrayHandleCompositeVector, (ArrayHandleCompositeVector), + ArrayHandleCompositeVector, + (ArrayHandleCompositeVector), (typename internal::ArrayHandleCompositeVectorTraits::Superclass)); VTKM_CONT @@ -506,13 +509,18 @@ public: ComponentMapType(sourceComponent1, sourceComponent2, sourceComponent3))) { } - template - VTKM_CONT ArrayHandleCompositeVector( - const ArrayHandleType1& array1, vtkm::IdComponent sourceComponent1, - const ArrayHandleType2& array2, vtkm::IdComponent sourceComponent2, - const ArrayHandleType3& array3, vtkm::IdComponent sourceComponent3, - const ArrayHandleType4& array4, vtkm::IdComponent sourceComponent4) + VTKM_CONT ArrayHandleCompositeVector(const ArrayHandleType1& array1, + vtkm::IdComponent sourceComponent1, + const ArrayHandleType2& array2, + vtkm::IdComponent sourceComponent2, + const ArrayHandleType3& array3, + vtkm::IdComponent sourceComponent3, + const ArrayHandleType4& array4, + vtkm::IdComponent sourceComponent4) : Superclass(StorageType( vtkm::internal::make_FunctionInterface(array1, array2, array3, array4), ComponentMapType(sourceComponent1, sourceComponent2, sourceComponent3, sourceComponent4))) @@ -533,8 +541,10 @@ public: /// OutArrayType outArray = vtkm::cont::make_ArrayHandleCompositeVector(a1,a2); /// \endcode /// -template +template struct ArrayHandleCompositeVectorType { VTKM_IS_ARRAY_HANDLE(ArrayHandleType1); @@ -545,8 +555,10 @@ struct ArrayHandleCompositeVectorType private: typedef typename vtkm::VecTraits::ComponentType ComponentType; - typedef vtkm::Vec Signature(ArrayHandleType1, ArrayHandleType2, - ArrayHandleType3, ArrayHandleType4); + typedef vtkm::Vec Signature(ArrayHandleType1, + ArrayHandleType2, + ArrayHandleType3, + ArrayHandleType4); public: typedef vtkm::cont::ArrayHandleCompositeVector type; @@ -562,7 +574,8 @@ struct ArrayHandleCompositeVectorType::ComponentType ComponentType; - typedef vtkm::Vec Signature(ArrayHandleType1, ArrayHandleType2, + typedef vtkm::Vec Signature(ArrayHandleType1, + ArrayHandleType2, ArrayHandleType3); public: @@ -622,8 +635,10 @@ make_ArrayHandleCompositeVector(const ArrayHandleType1& array1, vtkm::IdComponen } template VTKM_CONT typename ArrayHandleCompositeVectorType::type -make_ArrayHandleCompositeVector(const ArrayHandleType1& array1, vtkm::IdComponent sourceComponent1, - const ArrayHandleType2& array2, vtkm::IdComponent sourceComponent2) +make_ArrayHandleCompositeVector(const ArrayHandleType1& array1, + vtkm::IdComponent sourceComponent1, + const ArrayHandleType2& array2, + vtkm::IdComponent sourceComponent2) { VTKM_IS_ARRAY_HANDLE(ArrayHandleType1); VTKM_IS_ARRAY_HANDLE(ArrayHandleType2); @@ -631,39 +646,55 @@ make_ArrayHandleCompositeVector(const ArrayHandleType1& array1, vtkm::IdComponen array1, sourceComponent1, array2, sourceComponent2); } template -VTKM_CONT typename ArrayHandleCompositeVectorType::type -make_ArrayHandleCompositeVector(const ArrayHandleType1& array1, vtkm::IdComponent sourceComponent1, - const ArrayHandleType2& array2, vtkm::IdComponent sourceComponent2, - const ArrayHandleType3& array3, vtkm::IdComponent sourceComponent3) +make_ArrayHandleCompositeVector(const ArrayHandleType1& array1, + vtkm::IdComponent sourceComponent1, + const ArrayHandleType2& array2, + vtkm::IdComponent sourceComponent2, + const ArrayHandleType3& array3, + vtkm::IdComponent sourceComponent3) { VTKM_IS_ARRAY_HANDLE(ArrayHandleType1); VTKM_IS_ARRAY_HANDLE(ArrayHandleType2); VTKM_IS_ARRAY_HANDLE(ArrayHandleType3); - return typename ArrayHandleCompositeVectorType::type(array1, sourceComponent1, - array2, sourceComponent2, - array3, sourceComponent3); + return + typename ArrayHandleCompositeVectorType:: + type(array1, sourceComponent1, array2, sourceComponent2, array3, sourceComponent3); } -template -VTKM_CONT typename ArrayHandleCompositeVectorType::type -make_ArrayHandleCompositeVector(const ArrayHandleType1& array1, vtkm::IdComponent sourceComponent1, - const ArrayHandleType2& array2, vtkm::IdComponent sourceComponent2, - const ArrayHandleType3& array3, vtkm::IdComponent sourceComponent3, - const ArrayHandleType4& array4, vtkm::IdComponent sourceComponent4) +VTKM_CONT typename ArrayHandleCompositeVectorType::type +make_ArrayHandleCompositeVector(const ArrayHandleType1& array1, + vtkm::IdComponent sourceComponent1, + const ArrayHandleType2& array2, + vtkm::IdComponent sourceComponent2, + const ArrayHandleType3& array3, + vtkm::IdComponent sourceComponent3, + const ArrayHandleType4& array4, + vtkm::IdComponent sourceComponent4) { VTKM_IS_ARRAY_HANDLE(ArrayHandleType1); VTKM_IS_ARRAY_HANDLE(ArrayHandleType2); VTKM_IS_ARRAY_HANDLE(ArrayHandleType3); VTKM_IS_ARRAY_HANDLE(ArrayHandleType4); - return - typename ArrayHandleCompositeVectorType::type(array1, sourceComponent1, - array2, sourceComponent2, - array3, sourceComponent3, - array4, sourceComponent4); + return typename ArrayHandleCompositeVectorType::type(array1, + sourceComponent1, + array2, + sourceComponent2, + array3, + sourceComponent3, + array4, + sourceComponent4); } } } // namespace vtkm::cont diff --git a/vtkm/cont/ArrayHandleConcatenate.h b/vtkm/cont/ArrayHandleConcatenate.h index 450db8990..81c7dc98e 100644 --- a/vtkm/cont/ArrayHandleConcatenate.h +++ b/vtkm/cont/ArrayHandleConcatenate.h @@ -200,7 +200,8 @@ private: template class ArrayTransfer, Device> + StorageTagConcatenate, + Device> { public: typedef typename ArrayHandleType1::ValueType ValueType; @@ -299,7 +300,8 @@ class ArrayHandleConcatenate { public: VTKM_ARRAY_HANDLE_SUBCLASS( - ArrayHandleConcatenate, (ArrayHandleConcatenate), + ArrayHandleConcatenate, + (ArrayHandleConcatenate), (vtkm::cont::ArrayHandle>)); @@ -316,7 +318,8 @@ public: template VTKM_CONT ArrayHandleConcatenate make_ArrayHandleConcatenate( - const ArrayHandleType1& array1, const ArrayHandleType2& array2) + const ArrayHandleType1& array1, + const ArrayHandleType2& array2) { return ArrayHandleConcatenate(array1, array2); } diff --git a/vtkm/cont/ArrayHandleConstant.h b/vtkm/cont/ArrayHandleConstant.h index c442ef8fe..8280dc629 100644 --- a/vtkm/cont/ArrayHandleConstant.h +++ b/vtkm/cont/ArrayHandleConstant.h @@ -62,7 +62,8 @@ template class ArrayHandleConstant : public vtkm::cont::ArrayHandleImplicit> { public: - VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleConstant, (ArrayHandleConstant), + VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleConstant, + (ArrayHandleConstant), (vtkm::cont::ArrayHandleImplicit>)); VTKM_CONT diff --git a/vtkm/cont/ArrayHandleCounting.h b/vtkm/cont/ArrayHandleCounting.h index 23d0c252a..719bfe0a4 100644 --- a/vtkm/cont/ArrayHandleCounting.h +++ b/vtkm/cont/ArrayHandleCounting.h @@ -113,15 +113,17 @@ struct ArrayHandleCountingTraits /// contains a increment value, that is increment for each step between zero /// and the passed in length template -class ArrayHandleCounting - : public vtkm::cont::ArrayHandle< - CountingValueType, typename internal::ArrayHandleCountingTraits::Tag> +class ArrayHandleCounting : public vtkm::cont::ArrayHandle< + CountingValueType, + typename internal::ArrayHandleCountingTraits::Tag> { public: VTKM_ARRAY_HANDLE_SUBCLASS( - ArrayHandleCounting, (ArrayHandleCounting), + ArrayHandleCounting, + (ArrayHandleCounting), (vtkm::cont::ArrayHandle< - CountingValueType, typename internal::ArrayHandleCountingTraits::Tag>)); + CountingValueType, + typename internal::ArrayHandleCountingTraits::Tag>)); VTKM_CONT ArrayHandleCounting(CountingValueType start, CountingValueType step, vtkm::Id length) @@ -133,8 +135,8 @@ public: /// A convenience function for creating an ArrayHandleCounting. It takes the /// value to start counting from and and the number of times to increment. template -VTKM_CONT vtkm::cont::ArrayHandleCounting make_ArrayHandleCounting( - CountingValueType start, CountingValueType step, vtkm::Id length) +VTKM_CONT vtkm::cont::ArrayHandleCounting +make_ArrayHandleCounting(CountingValueType start, CountingValueType step, vtkm::Id length) { return vtkm::cont::ArrayHandleCounting(start, step, length); } diff --git a/vtkm/cont/ArrayHandleDiscard.h b/vtkm/cont/ArrayHandleDiscard.h index 96fd5e2e5..e8da33b0c 100644 --- a/vtkm/cont/ArrayHandleDiscard.h +++ b/vtkm/cont/ArrayHandleDiscard.h @@ -221,7 +221,8 @@ template class ArrayHandleDiscard : public internal::ArrayHandleDiscardTraits::Superclass { public: - VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleDiscard, (ArrayHandleDiscard), + VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleDiscard, + (ArrayHandleDiscard), (typename internal::ArrayHandleDiscardTraits::Superclass)); }; diff --git a/vtkm/cont/ArrayHandleGroupVec.h b/vtkm/cont/ArrayHandleGroupVec.h index 0d46ad665..0beab4385 100644 --- a/vtkm/cont/ArrayHandleGroupVec.h +++ b/vtkm/cont/ArrayHandleGroupVec.h @@ -136,9 +136,9 @@ public: typedef vtkm::exec::internal::ArrayPortalGroupVec PortalType; - typedef vtkm::exec::internal::ArrayPortalGroupVec< - typename SourceArrayHandleType::PortalConstControl, NUM_COMPONENTS> - PortalConstType; + typedef vtkm::exec::internal:: + ArrayPortalGroupVec + PortalConstType; VTKM_CONT Storage() @@ -235,10 +235,12 @@ public: typedef typename StorageType::PortalConstType PortalConstControl; typedef vtkm::exec::internal::ArrayPortalGroupVec< - typename SourceArrayHandleType::template ExecutionTypes::Portal, NUM_COMPONENTS> + typename SourceArrayHandleType::template ExecutionTypes::Portal, + NUM_COMPONENTS> PortalExecution; typedef vtkm::exec::internal::ArrayPortalGroupVec< - typename SourceArrayHandleType::template ExecutionTypes::PortalConst, NUM_COMPONENTS> + typename SourceArrayHandleType::template ExecutionTypes::PortalConst, + NUM_COMPONENTS> PortalConstExecution; VTKM_CONT @@ -333,7 +335,8 @@ class ArrayHandleGroupVec public: VTKM_ARRAY_HANDLE_SUBCLASS( - ArrayHandleGroupVec, (ArrayHandleGroupVec), + ArrayHandleGroupVec, + (ArrayHandleGroupVec), (vtkm::cont::ArrayHandle< vtkm::Vec, vtkm::cont::internal::StorageTagGroupVec>)); diff --git a/vtkm/cont/ArrayHandleGroupVecVariable.h b/vtkm/cont/ArrayHandleGroupVecVariable.h index 87d243b2c..1155d6ae4 100644 --- a/vtkm/cont/ArrayHandleGroupVecVariable.h +++ b/vtkm/cont/ArrayHandleGroupVecVariable.h @@ -96,7 +96,8 @@ public: } return ValueType(this->SourcePortal, - static_cast(nextOffsetIndex - offsetIndex), offsetIndex); + static_cast(nextOffsetIndex - offsetIndex), + offsetIndex); } VTKM_SUPPRESS_EXEC_WARNINGS @@ -135,7 +136,8 @@ namespace arg // can also ignore the Store because the data is already set in the array at // that point. template -struct Fetch> { @@ -187,7 +189,8 @@ public: using ValueType = vtkm::VecFromPortal; using PortalType = vtkm::exec::internal::ArrayPortalGroupVecVariable< - typename SourceArrayHandleType::PortalControl, typename OffsetsArrayHandleType::PortalControl>; + typename SourceArrayHandleType::PortalControl, + typename OffsetsArrayHandleType::PortalControl>; using PortalConstType = vtkm::exec::internal::ArrayPortalGroupVecVariable< typename SourceArrayHandleType::PortalConstControl, typename OffsetsArrayHandleType::PortalConstControl>; @@ -402,9 +405,10 @@ public: VTKM_ARRAY_HANDLE_SUBCLASS( ArrayHandleGroupVecVariable, (ArrayHandleGroupVecVariable), - (vtkm::cont::ArrayHandle, - vtkm::cont::internal::StorageTagGroupVecVariable< - SourceArrayHandleType, OffsetsArrayHandleType>>)); + (vtkm::cont::ArrayHandle< + vtkm::VecFromPortal, + vtkm::cont::internal::StorageTagGroupVecVariable>)); using ComponentType = typename SourceArrayHandleType::ValueType; @@ -496,7 +500,8 @@ VTKM_CONT void DoConvertNumComponentsToOffsets(const NumComponentsArrayType& num template VTKM_CONT void ConvertNumComponentsToOffsets( const NumComponentsArrayType& numComponentsArray, - vtkm::cont::ArrayHandle& offsetsArray, vtkm::Id& sourceArraySize) + vtkm::cont::ArrayHandle& offsetsArray, + vtkm::Id& sourceArraySize) { VTKM_IS_ARRAY_HANDLE(NumComponentsArrayType); @@ -513,7 +518,8 @@ VTKM_CONT void ConvertNumComponentsToOffsets( } template VTKM_CONT vtkm::cont::ArrayHandle ConvertNumComponentsToOffsets( - const NumComponentsArrayType& numComponentsArray, vtkm::Id& sourceArraySize) + const NumComponentsArrayType& numComponentsArray, + vtkm::Id& sourceArraySize) { VTKM_IS_ARRAY_HANDLE(NumComponentsArrayType); diff --git a/vtkm/cont/ArrayHandleImplicit.h b/vtkm/cont/ArrayHandleImplicit.h index 22904835c..721373fcb 100644 --- a/vtkm/cont/ArrayHandleImplicit.h +++ b/vtkm/cont/ArrayHandleImplicit.h @@ -115,7 +115,8 @@ private: typedef typename detail::ArrayHandleImplicitTraits ArrayTraits; public: - VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleImplicit, (ArrayHandleImplicit), + VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleImplicit, + (ArrayHandleImplicit), (typename ArrayTraits::Superclass)); VTKM_CONT @@ -131,7 +132,8 @@ public: template VTKM_CONT vtkm::cont::ArrayHandleImplicit make_ArrayHandleImplicit( - FunctorType functor, vtkm::Id length) + FunctorType functor, + vtkm::Id length) { return ArrayHandleImplicit(functor, length); } diff --git a/vtkm/cont/ArrayHandlePermutation.h b/vtkm/cont/ArrayHandlePermutation.h index 51b73abfc..699dd0376 100644 --- a/vtkm/cont/ArrayHandlePermutation.h +++ b/vtkm/cont/ArrayHandlePermutation.h @@ -205,7 +205,8 @@ private: template class ArrayTransfer, Device> + StorageTagPermutation, + Device> { public: typedef typename ValueArrayType::ValueType ValueType; @@ -342,7 +343,8 @@ class ArrayHandlePermutation public: VTKM_ARRAY_HANDLE_SUBCLASS( - ArrayHandlePermutation, (ArrayHandlePermutation), + ArrayHandlePermutation, + (ArrayHandlePermutation), (vtkm::cont::ArrayHandle< typename ValueArrayHandleType::ValueType, internal::StorageTagPermutation>)); diff --git a/vtkm/cont/ArrayHandleReverse.h b/vtkm/cont/ArrayHandleReverse.h index ba92f8e26..6679f7185 100644 --- a/vtkm/cont/ArrayHandleReverse.h +++ b/vtkm/cont/ArrayHandleReverse.h @@ -238,7 +238,8 @@ class ArrayHandleReverse : public vtkm::cont::ArrayHandle), + VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleReverse, + (ArrayHandleReverse), (vtkm::cont::ArrayHandle>)); diff --git a/vtkm/cont/ArrayHandleStreaming.h b/vtkm/cont/ArrayHandleStreaming.h index edf122eff..ebc4411cc 100644 --- a/vtkm/cont/ArrayHandleStreaming.h +++ b/vtkm/cont/ArrayHandleStreaming.h @@ -47,7 +47,9 @@ public: } VTKM_CONT - ArrayPortalStreaming(const PortalType& inputPortal, vtkm::Id blockIndex, vtkm::Id blockSize, + ArrayPortalStreaming(const PortalType& inputPortal, + vtkm::Id blockIndex, + vtkm::Id blockSize, vtkm::Id curBlockSize) : InputPortal(inputPortal) , BlockIndex(blockIndex) @@ -137,7 +139,9 @@ public: } VTKM_CONT - Storage(const ArrayHandleInputType inputArray, vtkm::Id blockSize, vtkm::Id blockIndex, + Storage(const ArrayHandleInputType inputArray, + vtkm::Id blockSize, + vtkm::Id blockIndex, vtkm::Id curBlockSize) : InputArray(inputArray) , BlockSize(blockSize) @@ -158,8 +162,8 @@ public: PortalConstType GetPortalConst() const { VTKM_ASSERT(this->Valid); - return PortalConstType(this->InputArray.GetPortalConstControl(), BlockSize, BlockIndex, - CurBlockSize); + return PortalConstType( + this->InputArray.GetPortalConstControl(), BlockSize, BlockIndex, CurBlockSize); } VTKM_CONT @@ -226,7 +230,8 @@ class ArrayHandleStreaming StorageTagStreaming> { public: - VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleStreaming, (ArrayHandleStreaming), + VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleStreaming, + (ArrayHandleStreaming), (vtkm::cont::ArrayHandle>)); @@ -235,8 +240,10 @@ private: public: VTKM_CONT - ArrayHandleStreaming(const ArrayHandleInputType& inputArray, const vtkm::Id blockIndex, - const vtkm::Id blockSize, const vtkm::Id curBlockSize) + ArrayHandleStreaming(const ArrayHandleInputType& inputArray, + const vtkm::Id blockIndex, + const vtkm::Id blockSize, + const vtkm::Id curBlockSize) : Superclass(StorageType(inputArray, blockIndex, blockSize, curBlockSize)) { this->GetPortalConstControl().SetBlockIndex(blockIndex); diff --git a/vtkm/cont/ArrayHandleTransform.h b/vtkm/cont/ArrayHandleTransform.h index 6a3265da3..761d7390c 100644 --- a/vtkm/cont/ArrayHandleTransform.h +++ b/vtkm/cont/ArrayHandleTransform.h @@ -52,7 +52,9 @@ typedef vtkm::cont::internal::NullFunctorType NullFunctorType; /// \brief An array portal that transforms a value from another portal. /// -template class VTKM_ALWAYS_EXPORT ArrayPortalTransform; @@ -117,7 +119,9 @@ protected: FunctorType Functor; }; -template class VTKM_ALWAYS_EXPORT ArrayPortalTransform : public ArrayPortalTransform @@ -174,7 +178,9 @@ namespace cont namespace internal { -template struct VTKM_ALWAYS_EXPORT StorageTagTransform { @@ -194,8 +200,9 @@ public: typedef void* IteratorType; }; - typedef vtkm::exec::internal::ArrayPortalTransform< - ValueType, typename ArrayHandleType::PortalConstControl, FunctorType> + typedef vtkm::exec::internal::ArrayPortalTransform PortalConstType; VTKM_CONT @@ -275,11 +282,15 @@ class Storage + typedef vtkm::exec::internal::ArrayPortalTransform PortalType; - typedef vtkm::exec::internal::ArrayPortalTransform< - ValueType, typename ArrayHandleType::PortalConstControl, FunctorType, InverseFunctorType> + typedef vtkm::exec::internal::ArrayPortalTransform PortalConstType; VTKM_CONT @@ -289,7 +300,8 @@ public: } VTKM_CONT - Storage(const ArrayHandleType& array, const FunctorType& functor, + Storage(const ArrayHandleType& array, + const FunctorType& functor, const InverseFunctorType& inverseFunctor) : Array(array) , Functor(functor) @@ -309,8 +321,8 @@ public: PortalConstType GetPortalConst() const { VTKM_ASSERT(this->Valid); - return PortalConstType(this->Array.GetPortalConstControl(), this->Functor, - this->InverseFunctor); + return PortalConstType( + this->Array.GetPortalConstControl(), this->Functor, this->InverseFunctor); } VTKM_CONT @@ -372,7 +384,9 @@ public: //meant to be an invalid writeable execution portal typedef typename StorageType::PortalType PortalExecution; typedef vtkm::exec::internal::ArrayPortalTransform< - ValueType, typename ArrayHandleType::template ExecutionTypes::PortalConst, FunctorType> + ValueType, + typename ArrayHandleType::template ExecutionTypes::PortalConst, + FunctorType> PortalConstExecution; VTKM_CONT @@ -427,9 +441,13 @@ private: FunctorType Functor; }; -template -class ArrayTransfer, +class ArrayTransfer, Device> { typedef StorageTagTransform StorageTag; @@ -442,11 +460,15 @@ public: typedef typename StorageType::PortalConstType PortalConstControl; typedef vtkm::exec::internal::ArrayPortalTransform< - ValueType, typename ArrayHandleType::template ExecutionTypes::Portal, FunctorType, + ValueType, + typename ArrayHandleType::template ExecutionTypes::Portal, + FunctorType, InverseFunctorType> PortalExecution; typedef vtkm::exec::internal::ArrayPortalTransform< - ValueType, typename ArrayHandleType::template ExecutionTypes::PortalConst, FunctorType, + ValueType, + typename ArrayHandleType::template ExecutionTypes::PortalConst, + FunctorType, InverseFunctorType> PortalConstExecution; @@ -464,22 +486,22 @@ public: VTKM_CONT PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) { - return PortalConstExecution(this->Array.PrepareForInput(Device()), this->Functor, - this->InverseFunctor); + return PortalConstExecution( + this->Array.PrepareForInput(Device()), this->Functor, this->InverseFunctor); } VTKM_CONT PortalExecution PrepareForInPlace(bool& vtkmNotUsed(updateData)) { - return PortalExecution(this->Array.PrepareForInPlace(Device()), this->Functor, - this->InverseFunctor); + return PortalExecution( + this->Array.PrepareForInPlace(Device()), this->Functor, this->InverseFunctor); } VTKM_CONT PortalExecution PrepareForOutput(vtkm::Id numberOfValues) { - return PortalExecution(this->Array.PrepareForOutput(numberOfValues, Device()), this->Functor, - this->InverseFunctor); + return PortalExecution( + this->Array.PrepareForOutput(numberOfValues, Device()), this->Functor, this->InverseFunctor); } VTKM_CONT @@ -514,7 +536,9 @@ private: /// the functor operator should work in both the control and execution /// environments. /// -template class ArrayHandleTransform; @@ -529,7 +553,8 @@ class ArrayHandleTransform), + ArrayHandleTransform, + (ArrayHandleTransform), (vtkm::cont::ArrayHandle>)); private: @@ -549,7 +574,8 @@ public: template VTKM_CONT vtkm::cont::ArrayHandleTransform make_ArrayHandleTransform( - HandleType handle, FunctorType functor) + HandleType handle, + FunctorType functor) { return ArrayHandleTransform(handle, functor); } @@ -559,7 +585,8 @@ VTKM_CONT vtkm::cont::ArrayHandleTransform make_Arra template class ArrayHandleTransform : public vtkm::cont::ArrayHandle< - T, internal::StorageTagTransform> + T, + internal::StorageTagTransform> { VTKM_IS_ARRAY_HANDLE(ArrayHandleType); @@ -568,13 +595,15 @@ public: ArrayHandleTransform, (ArrayHandleTransform), (vtkm::cont::ArrayHandle< - T, internal::StorageTagTransform>)); + T, + internal::StorageTagTransform>)); private: typedef vtkm::cont::internal::Storage StorageType; public: - ArrayHandleTransform(const ArrayHandleType& handle, const FunctorType& functor = FunctorType(), + ArrayHandleTransform(const ArrayHandleType& handle, + const FunctorType& functor = FunctorType(), const InverseFunctorType& inverseFunctor = InverseFunctorType()) : Superclass(StorageType(handle, functor, inverseFunctor)) { @@ -585,8 +614,8 @@ template make_ArrayHandleTransform(HandleType handle, FunctorType functor, InverseFunctorType inverseFunctor) { - return ArrayHandleTransform(handle, functor, - inverseFunctor); + return ArrayHandleTransform( + handle, functor, inverseFunctor); } } } // namespace vtkm::cont diff --git a/vtkm/cont/ArrayHandleZip.h b/vtkm/cont/ArrayHandleZip.h index 4289d4358..7853c9676 100644 --- a/vtkm/cont/ArrayHandleZip.h +++ b/vtkm/cont/ArrayHandleZip.h @@ -139,7 +139,8 @@ class Storage> public: typedef T ValueType; - typedef vtkm::exec::internal::ArrayPortalZip PortalType; typedef vtkm::exec::internal::ArrayPortalZip::Portal, + ValueType, + typename FirstHandleType::template ExecutionTypes::Portal, typename SecondHandleType::template ExecutionTypes::Portal> PortalExecution; typedef vtkm::exec::internal::ArrayPortalZip< - ValueType, typename FirstHandleType::template ExecutionTypes::PortalConst, + ValueType, + typename FirstHandleType::template ExecutionTypes::PortalConst, typename SecondHandleType::template ExecutionTypes::PortalConst> PortalConstExecution; @@ -316,7 +319,8 @@ class ArrayHandleZip public: VTKM_ARRAY_HANDLE_SUBCLASS( - ArrayHandleZip, (ArrayHandleZip), + ArrayHandleZip, + (ArrayHandleZip), (typename internal::ArrayHandleZipTraits::Superclass)); private: @@ -335,7 +339,8 @@ public: /// template VTKM_CONT vtkm::cont::ArrayHandleZip make_ArrayHandleZip( - const FirstHandleType& first, const SecondHandleType& second) + const FirstHandleType& first, + const SecondHandleType& second) { return ArrayHandleZip(first, second); } diff --git a/vtkm/cont/ArrayRangeCompute.cxx b/vtkm/cont/ArrayRangeCompute.cxx index c796181f0..4c4affb2c 100644 --- a/vtkm/cont/ArrayRangeCompute.cxx +++ b/vtkm/cont/ArrayRangeCompute.cxx @@ -104,9 +104,10 @@ VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( const vtkm::cont::ArrayHandle< vtkm::Vec, - typename vtkm::cont::ArrayHandleCompositeVector( - vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle)>::StorageTag>& input, + typename vtkm::cont::ArrayHandleCompositeVector< + vtkm::Vec(vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle)>::StorageTag>& input, vtkm::cont::RuntimeDeviceTracker tracker) { return detail::ArrayRangeComputeImpl(input, tracker); @@ -116,9 +117,10 @@ VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( const vtkm::cont::ArrayHandle< vtkm::Vec, - typename vtkm::cont::ArrayHandleCompositeVector( - vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle)>::StorageTag>& input, + typename vtkm::cont::ArrayHandleCompositeVector< + vtkm::Vec(vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle)>::StorageTag>& input, vtkm::cont::RuntimeDeviceTracker tracker) { return detail::ArrayRangeComputeImpl(input, tracker); diff --git a/vtkm/cont/ArrayRangeCompute.h b/vtkm/cont/ArrayRangeCompute.h index ea185e61c..84a93e736 100644 --- a/vtkm/cont/ArrayRangeCompute.h +++ b/vtkm/cont/ArrayRangeCompute.h @@ -93,7 +93,8 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::UInt8, 4, vtkm::cont::StorageTagBasic) VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::Float32, 4, vtkm::cont::StorageTagBasic); VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasic); -VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::FloatDefault, 3, +VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::FloatDefault, + 3, vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag); #undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T @@ -105,9 +106,10 @@ VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( const vtkm::cont::ArrayHandle< vtkm::Vec, - typename vtkm::cont::ArrayHandleCompositeVector( - vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle)>::StorageTag>& input, + typename vtkm::cont::ArrayHandleCompositeVector< + vtkm::Vec(vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle)>::StorageTag>& input, vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker()); VTKM_CONT_EXPORT @@ -115,16 +117,18 @@ VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( const vtkm::cont::ArrayHandle< vtkm::Vec, - typename vtkm::cont::ArrayHandleCompositeVector( - vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle)>::StorageTag>& input, + typename vtkm::cont::ArrayHandleCompositeVector< + vtkm::Vec(vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle)>::StorageTag>& input, vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker()); // Implementation of cartesian products template VTKM_CONT inline vtkm::cont::ArrayHandle ArrayRangeCompute( const vtkm::cont::ArrayHandle< - T, vtkm::cont::internal::StorageTagCartesianProduct>& input, + T, + vtkm::cont::internal::StorageTagCartesianProduct>& input, vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker()) { vtkm::cont::ArrayHandle result; diff --git a/vtkm/cont/ArrayRangeCompute.hxx b/vtkm/cont/ArrayRangeCompute.hxx index f85855abd..a84f63452 100644 --- a/vtkm/cont/ArrayRangeCompute.hxx +++ b/vtkm/cont/ArrayRangeCompute.hxx @@ -90,7 +90,8 @@ struct ArrayRangeComputeFunctor template inline vtkm::cont::ArrayHandle ArrayRangeComputeImpl( - const ArrayHandleType& input, vtkm::cont::RuntimeDeviceTracker tracker) + const ArrayHandleType& input, + vtkm::cont::RuntimeDeviceTracker tracker) { VTKM_IS_ARRAY_HANDLE(ArrayHandleType); @@ -108,7 +109,8 @@ inline vtkm::cont::ArrayHandle ArrayRangeComputeImpl( template inline vtkm::cont::ArrayHandle ArrayRangeCompute( - const ArrayHandleType& input, vtkm::cont::RuntimeDeviceTracker tracker) + const ArrayHandleType& input, + vtkm::cont::RuntimeDeviceTracker tracker) { VTKM_IS_ARRAY_HANDLE(ArrayHandleType); diff --git a/vtkm/cont/CellSetExplicit.h b/vtkm/cont/CellSetExplicit.h index d9ab7d9ad..74845254a 100644 --- a/vtkm/cont/CellSetExplicit.h +++ b/vtkm/cont/CellSetExplicit.h @@ -73,15 +73,18 @@ template class VTKM_ALWAYS_EXPORT CellSetExplicit : public CellSet { - typedef CellSetExplicit Thisclass; template struct ConnectivityChooser { - typedef typename detail::CellSetExplicitConnectivityChooser< - Thisclass, FromTopology, ToTopology>::ConnectivityType ConnectivityType; + typedef + typename detail::CellSetExplicitConnectivityChooser:: + ConnectivityType ConnectivityType; typedef typename ConnectivityType::ShapeArrayType ShapeArrayType; typedef typename ConnectivityType::NumIndicesArrayType NumIndicesArrayType; @@ -296,14 +299,16 @@ public: typedef typename ConnectivityTypes::IndexOffsetArrayType::template ExecutionTypes< DeviceAdapter>::PortalConst IndexOffsetPortalType; - typedef vtkm::exec::ConnectivityExplicit + typedef vtkm::exec::ConnectivityExplicit ExecObjectType; }; template - typename ExecutionTypes::ExecObjectType PrepareForInput( - Device, FromTopology, ToTopology) const + typename ExecutionTypes::ExecObjectType + PrepareForInput(Device, FromTopology, ToTopology) const { this->BuildConnectivity(Device(), FromTopology(), ToTopology()); @@ -322,7 +327,9 @@ public: template VTKM_CONT void BuildConnectivity(Device, FromTopology, ToTopology) const { - typedef CellSetExplicit CSE; @@ -334,7 +341,8 @@ public: } template - VTKM_CONT void CreateConnectivity(Device, vtkm::TopologyElementTagPoint, + VTKM_CONT void CreateConnectivity(Device, + vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) { // nothing to do @@ -344,7 +352,9 @@ public: class ExpandIndices : public vtkm::worklet::WorkletMapField { public: - typedef void ControlSignature(FieldIn<> cellIndex, FieldIn<> offset, FieldIn<> numIndices, + typedef void ControlSignature(FieldIn<> cellIndex, + FieldIn<> offset, + FieldIn<> numIndices, WholeArrayOut<> cellIndices); typedef void ExecutionSignature(_1, _2, _3, _4); typedef _1 InputDomain; @@ -353,8 +363,10 @@ public: ExpandIndices() {} template - VTKM_EXEC void operator()(const vtkm::Id& cellIndex, const vtkm::Id& offset, - const vtkm::Id& numIndices, const PortalType& cellIndices) const + VTKM_EXEC void operator()(const vtkm::Id& cellIndex, + const vtkm::Id& offset, + const vtkm::Id& numIndices, + const PortalType& cellIndices) const { VTKM_ASSERT(cellIndices.GetNumberOfValues() >= offset + numIndices); vtkm::Id startIndex = offset; @@ -366,7 +378,8 @@ public: }; template - VTKM_CONT void CreateConnectivity(Device, vtkm::TopologyElementTagCell, + VTKM_CONT void CreateConnectivity(Device, + vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) { // PointToCell connectivity array (point indices) will be @@ -397,7 +410,9 @@ public: this->PointToCell.BuildIndexOffsets(Device()); vtkm::worklet::DispatcherMapField expandDispatcher; - expandDispatcher.Invoke(index, this->PointToCell.IndexOffsets, this->PointToCell.NumIndices, + expandDispatcher.Invoke(index, + this->PointToCell.IndexOffsets, + this->PointToCell.NumIndices, this->CellToPoint.Connectivity); // SortByKey where key is PointToCell connectivity and value is the expanded cellIndex @@ -490,9 +505,11 @@ private: return this->Ivar; \ } - VTKM_GET_CONNECTIVITY_METHOD(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, + VTKM_GET_CONNECTIVITY_METHOD(vtkm::TopologyElementTagPoint, + vtkm::TopologyElementTagCell, PointToCell) - VTKM_GET_CONNECTIVITY_METHOD(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, + VTKM_GET_CONNECTIVITY_METHOD(vtkm::TopologyElementTagCell, + vtkm::TopologyElementTagPoint, CellToPoint) #undef VTKM_GET_CONNECTIVITY_METHOD @@ -512,15 +529,17 @@ namespace detail template struct CellSetExplicitConnectivityChooser< vtkm::cont::CellSetExplicit, - vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell> + vtkm::TopologyElementTagPoint, + vtkm::TopologyElementTagCell> { - typedef vtkm::cont::internal::ConnectivityExplicitInternals - ConnectivityType; + typedef vtkm::cont::internal:: + ConnectivityExplicitInternals + ConnectivityType; }; template -struct CellSetExplicitConnectivityChooser { //only specify the shape type as it will be constant as everything diff --git a/vtkm/cont/CellSetListTag.h b/vtkm/cont/CellSetListTag.h index af2711d9b..ee6fab3e5 100644 --- a/vtkm/cont/CellSetListTag.h +++ b/vtkm/cont/CellSetListTag.h @@ -55,8 +55,10 @@ template struct VTKM_ALWAYS_EXPORT CellSetListTagExplicit - : vtkm::ListTagBase> + : vtkm::ListTagBase> { }; @@ -64,9 +66,10 @@ struct VTKM_ALWAYS_EXPORT CellSetListTagExplicitDefault : CellSetListTagExplicit { }; -struct VTKM_ALWAYS_EXPORT CellSetListTagCommon - : vtkm::ListTagBase, vtkm::cont::CellSetStructured<3>, - vtkm::cont::CellSetExplicit<>, vtkm::cont::CellSetSingleType<>> +struct VTKM_ALWAYS_EXPORT CellSetListTagCommon : vtkm::ListTagBase, + vtkm::cont::CellSetStructured<3>, + vtkm::cont::CellSetExplicit<>, + vtkm::cont::CellSetSingleType<>> { }; diff --git a/vtkm/cont/CellSetPermutation.h b/vtkm/cont/CellSetPermutation.h index 4e52970ae..5e6461ef3 100644 --- a/vtkm/cont/CellSetPermutation.h +++ b/vtkm/cont/CellSetPermutation.h @@ -44,7 +44,8 @@ class CellSetGeneralPermutation : public CellSet public: VTKM_CONT CellSetGeneralPermutation(const PermutationArrayHandleType& validCellIds, - const OriginalCellSet& cellset, const std::string& name) + const OriginalCellSet& cellset, + const std::string& name) : CellSet(name) , ValidCellIds(validCellIds) , FullCellSet(cellset) @@ -94,15 +95,15 @@ public: typedef typename PermutationArrayHandleType::template ExecutionTypes::PortalConst ExecPortalType; - typedef typename OriginalCellSet::template ExecutionTypes< - Device, FromTopology, ToTopology>::ExecObjectType OrigExecObjectType; + typedef typename OriginalCellSet::template ExecutionTypes:: + ExecObjectType OrigExecObjectType; typedef vtkm::exec::ConnectivityPermuted ExecObjectType; }; template - typename ExecutionTypes::ExecObjectType PrepareForInput( - Device d, FromTopology f, ToTopology t) const + typename ExecutionTypes::ExecObjectType + PrepareForInput(Device d, FromTopology f, ToTopology t) const { typedef typename ExecutionTypes::ExecObjectType ConnectivityType; @@ -143,7 +144,8 @@ class CellSetPermutation public: VTKM_CONT - CellSetPermutation(const PermutationArrayHandleType& validCellIds, const OriginalCellSet& cellset, + CellSetPermutation(const PermutationArrayHandleType& validCellIds, + const OriginalCellSet& cellset, const std::string& name = std::string()) : ParentType(validCellIds, cellset, name) { @@ -166,19 +168,21 @@ public: template vtkm::cont::CellSetPermutation make_CellSetPermutation( - const PermutationArrayHandleType& cellIndexMap, const OriginalCellSet& cellSet, + const PermutationArrayHandleType& cellIndexMap, + const OriginalCellSet& cellSet, const std::string& name) { VTKM_IS_CELL_SET(OriginalCellSet); VTKM_IS_ARRAY_HANDLE(PermutationArrayHandleType); - return vtkm::cont::CellSetPermutation(cellIndexMap, - cellSet, name); + return vtkm::cont::CellSetPermutation( + cellIndexMap, cellSet, name); } template vtkm::cont::CellSetPermutation make_CellSetPermutation( - const PermutationArrayHandleType& cellIndexMap, const OriginalCellSet& cellSet) + const PermutationArrayHandleType& cellIndexMap, + const OriginalCellSet& cellSet) { VTKM_IS_CELL_SET(OriginalCellSet); VTKM_IS_ARRAY_HANDLE(PermutationArrayHandleType); diff --git a/vtkm/cont/CellSetSingleType.h b/vtkm/cont/CellSetSingleType.h index 4b553e133..6a607393d 100644 --- a/vtkm/cont/CellSetSingleType.h +++ b/vtkm/cont/CellSetSingleType.h @@ -50,7 +50,8 @@ class VTKM_ALWAYS_EXPORT CellSetSingleType typedef vtkm::cont::CellSetSingleType Thisclass; typedef vtkm::cont::CellSetExplicit< typename vtkm::cont::ArrayHandleConstant::StorageTag, - typename vtkm::cont::ArrayHandleConstant::StorageTag, ConnectivityStorageTag, + typename vtkm::cont::ArrayHandleConstant::StorageTag, + ConnectivityStorageTag, typename vtkm::cont::ArrayHandleCounting::StorageTag> Superclass; @@ -178,7 +179,9 @@ public: //This is the way you can fill the memory from another system without copying VTKM_CONT - void Fill(vtkm::Id numPoints, vtkm::UInt8 shapeId, vtkm::IdComponent numberOfPointsPerCell, + void Fill(vtkm::Id numPoints, + vtkm::UInt8 shapeId, + vtkm::IdComponent numberOfPointsPerCell, const vtkm::cont::ArrayHandle& connectivity) { this->NumberOfPoints = numPoints; @@ -218,7 +221,8 @@ public: private: template - void CheckNumberOfPointsPerCell(CellShapeTag, vtkm::CellTraitsTagSizeFixed, + void CheckNumberOfPointsPerCell(CellShapeTag, + vtkm::CellTraitsTagSizeFixed, vtkm::IdComponent numVertices) const { if (numVertices != vtkm::CellTraits::NUM_POINTS) @@ -228,7 +232,8 @@ private: } template - void CheckNumberOfPointsPerCell(CellShapeTag, vtkm::CellTraitsTagSizeVariable, + void CheckNumberOfPointsPerCell(CellShapeTag, + vtkm::CellTraitsTagSizeVariable, vtkm::IdComponent vtkmNotUsed(numVertices)) const { // Technically, a shape with a variable number of points probably has a diff --git a/vtkm/cont/CellSetStructured.h b/vtkm/cont/CellSetStructured.h index f6bea466f..1d478481c 100644 --- a/vtkm/cont/CellSetStructured.h +++ b/vtkm/cont/CellSetStructured.h @@ -92,8 +92,8 @@ public: }; template - typename ExecutionTypes::ExecObjectType PrepareForInput( - DeviceAdapter, FromTopology, ToTopology) const; + typename ExecutionTypes::ExecObjectType + PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const; virtual void PrintSummary(std::ostream& out) const; diff --git a/vtkm/cont/CellSetStructured.hxx b/vtkm/cont/CellSetStructured.hxx index 3a0476e9f..8358f9088 100644 --- a/vtkm/cont/CellSetStructured.hxx +++ b/vtkm/cont/CellSetStructured.hxx @@ -50,8 +50,8 @@ typename CellSetStructured::SchedulingRangeType template template -typename CellSetStructured::template ExecutionTypes::ExecObjectType +typename CellSetStructured< + DIMENSION>::template ExecutionTypes::ExecObjectType CellSetStructured::PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const { typedef typename ExecutionTypes::ExecObjectType diff --git a/vtkm/cont/CoordinateSystem.cxx b/vtkm/cont/CoordinateSystem.cxx index c27d75ba5..cd6944682 100644 --- a/vtkm/cont/CoordinateSystem.cxx +++ b/vtkm/cont/CoordinateSystem.cxx @@ -35,7 +35,8 @@ void CoordinateSystem::PrintSummary(std::ostream& out) const VTKM_CONT void CoordinateSystem::GetRange(vtkm::Range* range) const { - this->Superclass::GetRange(range, VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG(), + this->Superclass::GetRange(range, + VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG(), VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG()); } diff --git a/vtkm/cont/CoordinateSystem.h b/vtkm/cont/CoordinateSystem.h index 556c18bba..c40ccf7aa 100644 --- a/vtkm/cont/CoordinateSystem.h +++ b/vtkm/cont/CoordinateSystem.h @@ -44,13 +44,15 @@ namespace cont namespace detail { -typedef vtkm::cont::ArrayHandleCompositeVectorType< - vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle>::type ArrayHandleCompositeVectorFloat32_3Default; +typedef vtkm::cont::ArrayHandleCompositeVectorType, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle>::type + ArrayHandleCompositeVectorFloat32_3Default; -typedef vtkm::cont::ArrayHandleCompositeVectorType< - vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle>::type ArrayHandleCompositeVectorFloat64_3Default; +typedef vtkm::cont::ArrayHandleCompositeVectorType, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle>::type + ArrayHandleCompositeVectorFloat64_3Default; } // namespace detail @@ -60,13 +62,14 @@ typedef vtkm::cont::ArrayHandleCompositeVectorType< /// by default (unless it is defined before including VTK-m headers. /// struct StorageListTagCoordinateSystemDefault - : vtkm::ListTagBase< - vtkm::cont::StorageTagBasic, vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag, - detail::ArrayHandleCompositeVectorFloat32_3Default::StorageTag, - detail::ArrayHandleCompositeVectorFloat64_3Default::StorageTag, - vtkm::cont::ArrayHandleCartesianProduct< - vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle>::StorageTag> + : vtkm::ListTagBase, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle>::StorageTag> { }; @@ -113,10 +116,12 @@ public: /// VTKM_CONT CoordinateSystem( - std::string name, vtkm::Id3 dimensions, + std::string name, + vtkm::Id3 dimensions, vtkm::Vec origin = vtkm::Vec(0.0f, 0.0f, 0.0f), vtkm::Vec spacing = vtkm::Vec(1.0f, 1.0f, 1.0f)) - : Superclass(name, ASSOC_POINTS, + : Superclass(name, + ASSOC_POINTS, vtkm::cont::DynamicArrayHandle( vtkm::cont::ArrayHandleUniformPointCoordinates(dimensions, origin, spacing))) { @@ -145,8 +150,8 @@ public: { VTKM_IS_LIST_TAG(TypeList); - this->Superclass::GetRange(range, TypeList(), - VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG()); + this->Superclass::GetRange( + range, TypeList(), VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG()); } template diff --git a/vtkm/cont/DataSet.h b/vtkm/cont/DataSet.h index a49472699..c705260bb 100644 --- a/vtkm/cont/DataSet.h +++ b/vtkm/cont/DataSet.h @@ -67,8 +67,9 @@ public: } VTKM_CONT - vtkm::Id GetFieldIndex(const std::string& name, vtkm::cont::Field::AssociationEnum assoc = - vtkm::cont::Field::ASSOC_ANY) const + vtkm::Id GetFieldIndex( + const std::string& name, + vtkm::cont::Field::AssociationEnum assoc = vtkm::cont::Field::ASSOC_ANY) const { bool found; vtkm::Id index = this->FindFieldIndex(name, assoc, found); @@ -234,7 +235,8 @@ private: std::vector CellSets; VTKM_CONT - vtkm::Id FindFieldIndex(const std::string& name, vtkm::cont::Field::AssociationEnum association, + vtkm::Id FindFieldIndex(const std::string& name, + vtkm::cont::Field::AssociationEnum association, bool& found) const { for (std::size_t index = 0; index < this->Fields.size(); ++index) diff --git a/vtkm/cont/DataSetBuilderExplicit.h b/vtkm/cont/DataSetBuilderExplicit.h index a81b1e480..0f27cea84 100644 --- a/vtkm/cont/DataSetBuilderExplicit.h +++ b/vtkm/cont/DataSetBuilderExplicit.h @@ -59,8 +59,8 @@ public: const std::string& cellNm = "cells") { std::vector yVals(xVals.size(), 0), zVals(xVals.size(), 0); - return DataSetBuilderExplicit::Create(xVals, yVals, zVals, shapes, numIndices, connectivity, - coordsNm, cellNm); + return DataSetBuilderExplicit::Create( + xVals, yVals, zVals, shapes, numIndices, connectivity, coordsNm, cellNm); } template @@ -73,27 +73,33 @@ public: const std::string& cellNm = "cells") { std::vector zVals(xVals.size(), 0); - return DataSetBuilderExplicit::Create(xVals, yVals, zVals, shapes, numIndices, connectivity, - coordsNm, cellNm); + return DataSetBuilderExplicit::Create( + xVals, yVals, zVals, shapes, numIndices, connectivity, coordsNm, cellNm); } template - VTKM_CONT static vtkm::cont::DataSet Create( - const std::vector& xVals, const std::vector& yVals, const std::vector& zVals, - const std::vector& shapes, const std::vector& numIndices, - const std::vector& connectivity, const std::string& coordsNm = "coords", - const std::string& cellNm = "cells"); + VTKM_CONT static vtkm::cont::DataSet Create(const std::vector& xVals, + const std::vector& yVals, + const std::vector& zVals, + const std::vector& shapes, + const std::vector& numIndices, + const std::vector& connectivity, + const std::string& coordsNm = "coords", + const std::string& cellNm = "cells"); template VTKM_CONT static vtkm::cont::DataSet Create( - const vtkm::cont::ArrayHandle& xVals, const vtkm::cont::ArrayHandle& yVals, - const vtkm::cont::ArrayHandle& zVals, const vtkm::cont::ArrayHandle& shapes, + const vtkm::cont::ArrayHandle& xVals, + const vtkm::cont::ArrayHandle& yVals, + const vtkm::cont::ArrayHandle& zVals, + const vtkm::cont::ArrayHandle& shapes, const vtkm::cont::ArrayHandle& numIndices, - const vtkm::cont::ArrayHandle& connectivity, const std::string& coordsNm = "coords", + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm = "coords", const std::string& cellNm = "cells") { - return DataSetBuilderExplicit::BuildDataSet(xVals, yVals, zVals, shapes, numIndices, - connectivity, coordsNm, cellNm); + return DataSetBuilderExplicit::BuildDataSet( + xVals, yVals, zVals, shapes, numIndices, connectivity, coordsNm, cellNm); } template @@ -109,11 +115,12 @@ public: const vtkm::cont::ArrayHandle>& coords, const vtkm::cont::ArrayHandle& shapes, const vtkm::cont::ArrayHandle& numIndices, - const vtkm::cont::ArrayHandle& connectivity, const std::string& coordsNm = "coords", + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm = "coords", const std::string& cellNm = "cells") { - return DataSetBuilderExplicit::BuildDataSet(coords, shapes, numIndices, connectivity, coordsNm, - cellNm); + return DataSetBuilderExplicit::BuildDataSet( + coords, shapes, numIndices, connectivity, coordsNm, cellNm); } template @@ -126,21 +133,27 @@ public: template VTKM_CONT static vtkm::cont::DataSet Create( - const vtkm::cont::ArrayHandle>& coords, CellShapeTag tag, - vtkm::IdComponent numberOfPointsPerCell, const vtkm::cont::ArrayHandle& connectivity, - const std::string& coordsNm = "coords", const std::string& cellNm = "cells") + const vtkm::cont::ArrayHandle>& coords, + CellShapeTag tag, + vtkm::IdComponent numberOfPointsPerCell, + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm = "coords", + const std::string& cellNm = "cells") { - return DataSetBuilderExplicit::BuildDataSet(coords, tag, numberOfPointsPerCell, connectivity, - coordsNm, cellNm); + return DataSetBuilderExplicit::BuildDataSet( + coords, tag, numberOfPointsPerCell, connectivity, coordsNm, cellNm); } private: template static vtkm::cont::DataSet BuildDataSet( - const vtkm::cont::ArrayHandle& X, const vtkm::cont::ArrayHandle& Y, - const vtkm::cont::ArrayHandle& Z, const vtkm::cont::ArrayHandle& shapes, + const vtkm::cont::ArrayHandle& X, + const vtkm::cont::ArrayHandle& Y, + const vtkm::cont::ArrayHandle& Z, + const vtkm::cont::ArrayHandle& shapes, const vtkm::cont::ArrayHandle& numIndices, - const vtkm::cont::ArrayHandle& connectivity, const std::string& coordsNm, + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm, const std::string& cellNm); template @@ -148,21 +161,30 @@ private: const vtkm::cont::ArrayHandle>& coords, const vtkm::cont::ArrayHandle& shapes, const vtkm::cont::ArrayHandle& numIndices, - const vtkm::cont::ArrayHandle& connectivity, const std::string& coordsNm, + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm, const std::string& cellNm); template VTKM_CONT static vtkm::cont::DataSet BuildDataSet( - const vtkm::cont::ArrayHandle>& coords, CellShapeTag tag, - vtkm::IdComponent numberOfPointsPerCell, const vtkm::cont::ArrayHandle& connectivity, - const std::string& coordsNm, const std::string& cellNm); + const vtkm::cont::ArrayHandle>& coords, + CellShapeTag tag, + vtkm::IdComponent numberOfPointsPerCell, + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm, + const std::string& cellNm); }; template inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::Create( - const std::vector& xVals, const std::vector& yVals, const std::vector& zVals, - const std::vector& shapes, const std::vector& numIndices, - const std::vector& connectivity, const std::string& coordsNm, const std::string& cellNm) + const std::vector& xVals, + const std::vector& yVals, + const std::vector& zVals, + const std::vector& shapes, + const std::vector& numIndices, + const std::vector& connectivity, + const std::string& coordsNm, + const std::string& cellNm) { VTKM_ASSERT(xVals.size() == yVals.size() && yVals.size() == zVals.size() && xVals.size() > 0); @@ -183,10 +205,13 @@ inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::Create( template inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::BuildDataSet( - const vtkm::cont::ArrayHandle& X, const vtkm::cont::ArrayHandle& Y, - const vtkm::cont::ArrayHandle& Z, const vtkm::cont::ArrayHandle& shapes, + const vtkm::cont::ArrayHandle& X, + const vtkm::cont::ArrayHandle& Y, + const vtkm::cont::ArrayHandle& Z, + const vtkm::cont::ArrayHandle& shapes, const vtkm::cont::ArrayHandle& numIndices, - const vtkm::cont::ArrayHandle& connectivity, const std::string& coordsNm, + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm, const std::string& cellNm) { VTKM_ASSERT(X.GetNumberOfValues() == Y.GetNumberOfValues() && @@ -207,9 +232,12 @@ inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::BuildDataSet( template inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::Create( - const std::vector>& coords, const std::vector& shapes, - const std::vector& numIndices, const std::vector& connectivity, - const std::string& coordsNm, const std::string& cellNm) + const std::vector>& coords, + const std::vector& shapes, + const std::vector& numIndices, + const std::vector& connectivity, + const std::string& coordsNm, + const std::string& cellNm) { vtkm::cont::ArrayHandle> coordsArray; DataSetBuilderExplicit::CopyInto(coords, coordsArray); @@ -229,7 +257,8 @@ inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::BuildDataSet( const vtkm::cont::ArrayHandle>& coords, const vtkm::cont::ArrayHandle& shapes, const vtkm::cont::ArrayHandle& numIndices, - const vtkm::cont::ArrayHandle& connectivity, const std::string& coordsNm, + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm, const std::string& cellNm) { vtkm::cont::DataSet dataSet; @@ -246,9 +275,12 @@ inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::BuildDataSet( template inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::Create( - const std::vector>& coords, CellShapeTag tag, - vtkm::IdComponent numberOfPointsPerCell, const std::vector& connectivity, - const std::string& coordsNm, const std::string& cellNm) + const std::vector>& coords, + CellShapeTag tag, + vtkm::IdComponent numberOfPointsPerCell, + const std::vector& connectivity, + const std::string& coordsNm, + const std::string& cellNm) { vtkm::cont::ArrayHandle> coordsArray; DataSetBuilderExplicit::CopyInto(coords, coordsArray); @@ -256,15 +288,18 @@ inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::Create( vtkm::cont::ArrayHandle Cc; DataSetBuilderExplicit::CopyInto(connectivity, Cc); - return DataSetBuilderExplicit::Create(coordsArray, tag, numberOfPointsPerCell, Cc, coordsNm, - cellNm); + return DataSetBuilderExplicit::Create( + coordsArray, tag, numberOfPointsPerCell, Cc, coordsNm, cellNm); } template inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::BuildDataSet( - const vtkm::cont::ArrayHandle>& coords, CellShapeTag tag, - vtkm::IdComponent numberOfPointsPerCell, const vtkm::cont::ArrayHandle& connectivity, - const std::string& coordsNm, const std::string& cellNm) + const vtkm::cont::ArrayHandle>& coords, + CellShapeTag tag, + vtkm::IdComponent numberOfPointsPerCell, + const vtkm::cont::ArrayHandle& connectivity, + const std::string& coordsNm, + const std::string& cellNm) { vtkm::cont::DataSet dataSet; @@ -317,8 +352,8 @@ public: template VTKM_CONT vtkm::Id AddPoint(const T& x, const T& y, const T& z = 0) { - return AddPoint(static_cast(x), static_cast(y), - static_cast(z)); + return AddPoint( + static_cast(x), static_cast(y), static_cast(z)); } template diff --git a/vtkm/cont/DataSetBuilderRectilinear.h b/vtkm/cont/DataSetBuilderRectilinear.h index b11b559e4..8da0cf0b4 100644 --- a/vtkm/cont/DataSetBuilderRectilinear.h +++ b/vtkm/cont/DataSetBuilderRectilinear.h @@ -68,12 +68,14 @@ public: } template - VTKM_CONT static vtkm::cont::DataSet Create(vtkm::Id nx, T* xvals, std::string coordNm = "coords", + VTKM_CONT static vtkm::cont::DataSet Create(vtkm::Id nx, + T* xvals, + std::string coordNm = "coords", std::string cellNm = "cells") { T yvals = 0, zvals = 0; - return DataSetBuilderRectilinear::BuildDataSet(nx, 1, 1, xvals, &yvals, &zvals, coordNm, - cellNm); + return DataSetBuilderRectilinear::BuildDataSet( + nx, 1, 1, xvals, &yvals, &zvals, coordNm, cellNm); } template @@ -101,13 +103,16 @@ public: } template - VTKM_CONT static vtkm::cont::DataSet Create(vtkm::Id nx, vtkm::Id ny, T* xvals, T* yvals, + VTKM_CONT static vtkm::cont::DataSet Create(vtkm::Id nx, + vtkm::Id ny, + T* xvals, + T* yvals, std::string coordNm = "coords", std::string cellNm = "cells") { T zvals = 0; - return DataSetBuilderRectilinear::BuildDataSet(nx, ny, 1, xvals, yvals, &zvals, coordNm, - cellNm); + return DataSetBuilderRectilinear::BuildDataSet( + nx, ny, 1, xvals, yvals, &zvals, coordNm, cellNm); } template @@ -124,12 +129,17 @@ public: //3D grids. template - VTKM_CONT static vtkm::cont::DataSet Create(vtkm::Id nx, vtkm::Id ny, vtkm::Id nz, T* xvals, - T* yvals, T* zvals, std::string coordNm = "coords", + VTKM_CONT static vtkm::cont::DataSet Create(vtkm::Id nx, + vtkm::Id ny, + vtkm::Id nz, + T* xvals, + T* yvals, + T* zvals, + std::string coordNm = "coords", std::string cellNm = "cells") { - return DataSetBuilderRectilinear::BuildDataSet(nx, ny, nz, xvals, yvals, zvals, coordNm, - cellNm); + return DataSetBuilderRectilinear::BuildDataSet( + nx, ny, nz, xvals, yvals, zvals, coordNm, cellNm); } template @@ -157,7 +167,8 @@ private: VTKM_CONT static vtkm::cont::DataSet BuildDataSet(const std::vector& xvals, const std::vector& yvals, const std::vector& zvals, - std::string coordNm, std::string cellNm) + std::string coordNm, + std::string cellNm) { vtkm::cont::ArrayHandle Xc, Yc, Zc; DataSetBuilderRectilinear::CopyInto(xvals, Xc); @@ -168,9 +179,14 @@ private: } template - VTKM_CONT static vtkm::cont::DataSet BuildDataSet(vtkm::Id nx, vtkm::Id ny, vtkm::Id nz, - const T* xvals, const T* yvals, const T* zvals, - std::string coordNm, std::string cellNm) + VTKM_CONT static vtkm::cont::DataSet BuildDataSet(vtkm::Id nx, + vtkm::Id ny, + vtkm::Id nz, + const T* xvals, + const T* yvals, + const T* zvals, + std::string coordNm, + std::string cellNm) { vtkm::cont::ArrayHandle Xc, Yc, Zc; DataSetBuilderRectilinear::CopyInto(xvals, nx, Xc); @@ -184,7 +200,8 @@ private: VTKM_CONT static vtkm::cont::DataSet BuildDataSet(const vtkm::cont::ArrayHandle& X, const vtkm::cont::ArrayHandle& Y, const vtkm::cont::ArrayHandle& Z, - std::string coordNm, std::string cellNm) + std::string coordNm, + std::string cellNm) { vtkm::cont::DataSet dataSet; diff --git a/vtkm/cont/DataSetBuilderUniform.h b/vtkm/cont/DataSetBuilderUniform.h index 077baafb9..74e705c9b 100644 --- a/vtkm/cont/DataSetBuilderUniform.h +++ b/vtkm/cont/DataSetBuilderUniform.h @@ -38,17 +38,23 @@ public: //1D uniform grid template - VTKM_CONT static vtkm::cont::DataSet Create(const vtkm::Id& dimension, const T& origin, - const T& spacing, std::string coordNm = "coords", + VTKM_CONT static vtkm::cont::DataSet Create(const vtkm::Id& dimension, + const T& origin, + const T& spacing, + std::string coordNm = "coords", std::string cellNm = "cells") { return DataSetBuilderUniform::CreateDataSet( - vtkm::Id3(dimension, 1, 1), VecType(static_cast(origin), 0, 0), - VecType(static_cast(spacing), 1, 1), coordNm, cellNm); + vtkm::Id3(dimension, 1, 1), + VecType(static_cast(origin), 0, 0), + VecType(static_cast(spacing), 1, 1), + coordNm, + cellNm); } VTKM_CONT - static vtkm::cont::DataSet Create(const vtkm::Id& dimension, std::string coordNm = "coords", + static vtkm::cont::DataSet Create(const vtkm::Id& dimension, + std::string coordNm = "coords", std::string cellNm = "cells") { return CreateDataSet(vtkm::Id3(dimension, 1, 1), VecType(0), VecType(1), coordNm, cellNm); @@ -62,21 +68,24 @@ public: std::string coordNm = "coords", std::string cellNm = "cells") { - return DataSetBuilderUniform::CreateDataSet( - vtkm::Id3(dimensions[0], dimensions[1], 1), - VecType(static_cast(origin[0]), - static_cast(origin[1]), 0), - VecType(static_cast(spacing[0]), - static_cast(spacing[1]), 1), - coordNm, cellNm); + return DataSetBuilderUniform::CreateDataSet(vtkm::Id3(dimensions[0], dimensions[1], 1), + VecType(static_cast(origin[0]), + static_cast(origin[1]), + 0), + VecType(static_cast(spacing[0]), + static_cast(spacing[1]), + 1), + coordNm, + cellNm); } VTKM_CONT - static vtkm::cont::DataSet Create(const vtkm::Id2& dimensions, std::string coordNm = "coords", + static vtkm::cont::DataSet Create(const vtkm::Id2& dimensions, + std::string coordNm = "coords", std::string cellNm = "cells") { - return CreateDataSet(vtkm::Id3(dimensions[0], dimensions[1], 1), VecType(0), VecType(1), - coordNm, cellNm); + return CreateDataSet( + vtkm::Id3(dimensions[0], dimensions[1], 1), VecType(0), VecType(1), coordNm, cellNm); } //3D uniform grids. @@ -95,15 +104,20 @@ public: VecType(static_cast(spacing[0]), static_cast(spacing[1]), static_cast(spacing[2])), - coordNm, cellNm); + coordNm, + cellNm); } VTKM_CONT - static vtkm::cont::DataSet Create(const vtkm::Id3& dimensions, std::string coordNm = "coords", + static vtkm::cont::DataSet Create(const vtkm::Id3& dimensions, + std::string coordNm = "coords", std::string cellNm = "cells") { - return CreateDataSet(vtkm::Id3(dimensions[0], dimensions[1], dimensions[2]), VecType(0), - VecType(1), coordNm, cellNm); + return CreateDataSet(vtkm::Id3(dimensions[0], dimensions[1], dimensions[2]), + VecType(0), + VecType(1), + coordNm, + cellNm); } private: @@ -111,7 +125,8 @@ private: static vtkm::cont::DataSet CreateDataSet(const vtkm::Id3& dimensions, const vtkm::Vec& origin, const vtkm::Vec& spacing, - std::string coordNm, std::string cellNm) + std::string coordNm, + std::string cellNm) { vtkm::Id dims[3]; int ndims = 0; diff --git a/vtkm/cont/DataSetFieldAdd.h b/vtkm/cont/DataSetFieldAdd.h index 9fea00d81..2fd57c2bc 100644 --- a/vtkm/cont/DataSetFieldAdd.h +++ b/vtkm/cont/DataSetFieldAdd.h @@ -37,36 +37,42 @@ public: //Point centered fields. VTKM_CONT - static void AddPointField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, + static void AddPointField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, const vtkm::cont::DynamicArrayHandle& field) { dataSet.AddField(Field(fieldName, vtkm::cont::Field::ASSOC_POINTS, field)); } template - VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, + VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, const vtkm::cont::ArrayHandle& field) { dataSet.AddField(Field(fieldName, vtkm::cont::Field::ASSOC_POINTS, field)); } template - VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, + VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, const std::vector& field) { dataSet.AddField(Field(fieldName, vtkm::cont::Field::ASSOC_POINTS, field)); } template - VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, - const T* field, const vtkm::Id& n) + VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, + const T* field, + const vtkm::Id& n) { dataSet.AddField(Field(fieldName, vtkm::cont::Field::ASSOC_POINTS, field, n)); } //Cell centered field VTKM_CONT - static void AddCellField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, + static void AddCellField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, const vtkm::cont::DynamicArrayHandle& field, const std::string& cellSetName) { @@ -74,7 +80,8 @@ public: } template - VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, + VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, const vtkm::cont::ArrayHandle& field, const std::string& cellSetName) { @@ -82,29 +89,36 @@ public: } template - VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, - const std::vector& field, const std::string& cellSetName) + VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, + const std::vector& field, + const std::string& cellSetName) { dataSet.AddField(Field(fieldName, vtkm::cont::Field::ASSOC_CELL_SET, cellSetName, field)); } template - VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, - const T* field, const vtkm::Id& n, + VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, + const T* field, + const vtkm::Id& n, const std::string& cellSetName) { dataSet.AddField(Field(fieldName, vtkm::cont::Field::ASSOC_CELL_SET, cellSetName, field, n)); } VTKM_CONT - static void AddCellField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, - const vtkm::cont::DynamicArrayHandle& field, vtkm::Id cellSetIndex = 0) + static void AddCellField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, + const vtkm::cont::DynamicArrayHandle& field, + vtkm::Id cellSetIndex = 0) { std::string cellSetName = dataSet.GetCellSet(cellSetIndex).GetName(); DataSetFieldAdd::AddCellField(dataSet, fieldName, field, cellSetName); } template - VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, + VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, const vtkm::cont::ArrayHandle& field, vtkm::Id cellSetIndex = 0) { @@ -112,16 +126,21 @@ public: DataSetFieldAdd::AddCellField(dataSet, fieldName, field, cellSetName); } template - VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, - const std::vector& field, vtkm::Id cellSetIndex = 0) + VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, + const std::vector& field, + vtkm::Id cellSetIndex = 0) { std::string cellSetName = dataSet.GetCellSet(cellSetIndex).GetName(); DataSetFieldAdd::AddCellField(dataSet, fieldName, field, cellSetName); } template - VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, const std::string& fieldName, - const T* field, const vtkm::Id& n, vtkm::Id cellSetIndex = 0) + VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet, + const std::string& fieldName, + const T* field, + const vtkm::Id& n, + vtkm::Id cellSetIndex = 0) { std::string cellSetName = dataSet.GetCellSet(cellSetIndex).GetName(); DataSetFieldAdd::AddCellField(dataSet, fieldName, field, n, cellSetName); diff --git a/vtkm/cont/DeviceAdapterAlgorithm.h b/vtkm/cont/DeviceAdapterAlgorithm.h index 9f6ea1098..a581f248e 100644 --- a/vtkm/cont/DeviceAdapterAlgorithm.h +++ b/vtkm/cont/DeviceAdapterAlgorithm.h @@ -112,7 +112,8 @@ struct DeviceAdapterAlgorithm /// template VTKM_CONT static bool CopySubRange(const vtkm::cont::ArrayHandle& input, - vtkm::Id inputStartIndex, vtkm::Id numberOfElementsToCopy, + vtkm::Id inputStartIndex, + vtkm::Id numberOfElementsToCopy, vtkm::cont::ArrayHandle& output, vtkm::Id outputIndex = 0); @@ -180,7 +181,8 @@ struct DeviceAdapterAlgorithm /// /// \return The total sum. template - VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, U initialValue, + VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, + U initialValue, BinaryFunctor binary_functor); /// \brief Compute a accumulated sum operation on the input key value pairs @@ -191,7 +193,12 @@ struct DeviceAdapterAlgorithm /// values inside that range. Once finished a single key and value is created /// for each segment. /// - template VTKM_CONT static void ReduceByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, @@ -251,7 +258,11 @@ struct DeviceAdapterAlgorithm /// applied to all values inside that range. Once finished the result is /// stored in \c values_output ArrayHandle. /// - template VTKM_CONT static void ScanInclusiveByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, @@ -310,7 +321,8 @@ struct DeviceAdapterAlgorithm VTKM_CONT static void ScanExclusiveByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, vtkm::cont::ArrayHandle& output, - const U& initialValue, BinaryFunctor binaryFunctor); + const U& initialValue, + BinaryFunctor binaryFunctor); /// \brief Compute a segmented exclusive prefix sum operation on the input key value pairs. /// diff --git a/vtkm/cont/DeviceAdapterListTag.h b/vtkm/cont/DeviceAdapterListTag.h index 993829be8..2d0295aad 100644 --- a/vtkm/cont/DeviceAdapterListTag.h +++ b/vtkm/cont/DeviceAdapterListTag.h @@ -35,9 +35,9 @@ namespace vtkm namespace cont { -struct DeviceAdapterListTagCommon - : vtkm::ListTagBase +struct DeviceAdapterListTagCommon : vtkm::ListTagBase { }; } diff --git a/vtkm/cont/DynamicArrayHandle.h b/vtkm/cont/DynamicArrayHandle.h index e1eb525ee..52653e8b1 100644 --- a/vtkm/cont/DynamicArrayHandle.h +++ b/vtkm/cont/DynamicArrayHandle.h @@ -342,7 +342,8 @@ public: /// template VTKM_CONT DynamicArrayHandleBase ResetTypeAndStorageLists( - NewTypeList = NewTypeList(), NewStorageList = NewStorageList()) const + NewTypeList = NewTypeList(), + NewStorageList = NewStorageList()) const { VTKM_IS_LIST_TAG(NewTypeList); VTKM_IS_LIST_TAG(NewStorageList); @@ -519,8 +520,9 @@ VTKM_CONT void DynamicArrayHandleBase::CastAndCall(const template <> template -VTKM_CONT void DynamicArrayHandleBase< - VTKM_DEFAULT_TYPE_LIST_TAG, VTKM_DEFAULT_STORAGE_LIST_TAG>::CastAndCall(const Functor& f) const +VTKM_CONT void +DynamicArrayHandleBase::CastAndCall( + const Functor& f) const { typedef detail::DynamicArrayHandleTryType TryTypeType; diff --git a/vtkm/cont/Field.h b/vtkm/cont/Field.h index db04b2d2c..a4a68dd4c 100644 --- a/vtkm/cont/Field.h +++ b/vtkm/cont/Field.h @@ -88,7 +88,8 @@ public: } template - VTKM_CONT Field(std::string name, AssociationEnum association, + VTKM_CONT Field(std::string name, + AssociationEnum association, const ArrayHandle& data) : Name(name) , Association(association) @@ -129,7 +130,9 @@ public: /// constructors for cell set associations VTKM_CONT - Field(std::string name, AssociationEnum association, const std::string& cellSetName, + Field(std::string name, + AssociationEnum association, + const std::string& cellSetName, const vtkm::cont::DynamicArrayHandle& data) : Name(name) , Association(association) @@ -143,7 +146,9 @@ public: } template - VTKM_CONT Field(std::string name, AssociationEnum association, const std::string& cellSetName, + VTKM_CONT Field(std::string name, + AssociationEnum association, + const std::string& cellSetName, const vtkm::cont::ArrayHandle& data) : Name(name) , Association(association) @@ -157,7 +162,9 @@ public: } template - VTKM_CONT Field(std::string name, AssociationEnum association, const std::string& cellSetName, + VTKM_CONT Field(std::string name, + AssociationEnum association, + const std::string& cellSetName, const std::vector& data) : Name(name) , Association(association) @@ -171,8 +178,11 @@ public: } template - VTKM_CONT Field(std::string name, AssociationEnum association, const std::string& cellSetName, - const T* data, vtkm::Id nvals) + VTKM_CONT Field(std::string name, + AssociationEnum association, + const std::string& cellSetName, + const T* data, + vtkm::Id nvals) : Name(name) , Association(association) , AssocCellSetName(cellSetName) @@ -186,7 +196,9 @@ public: /// constructors for logical dimension associations VTKM_CONT - Field(std::string name, AssociationEnum association, vtkm::IdComponent logicalDim, + Field(std::string name, + AssociationEnum association, + vtkm::IdComponent logicalDim, const vtkm::cont::DynamicArrayHandle& data) : Name(name) , Association(association) @@ -200,7 +212,9 @@ public: } template - VTKM_CONT Field(std::string name, AssociationEnum association, vtkm::IdComponent logicalDim, + VTKM_CONT Field(std::string name, + AssociationEnum association, + vtkm::IdComponent logicalDim, const vtkm::cont::ArrayHandle& data) : Name(name) , Association(association) @@ -213,7 +227,9 @@ public: } template - VTKM_CONT Field(std::string name, AssociationEnum association, vtkm::IdComponent logicalDim, + VTKM_CONT Field(std::string name, + AssociationEnum association, + vtkm::IdComponent logicalDim, const std::vector& data) : Name(name) , Association(association) @@ -226,8 +242,11 @@ public: } template - VTKM_CONT Field(std::string name, AssociationEnum association, vtkm::IdComponent logicalDim, - const T* data, vtkm::Id nvals) + VTKM_CONT Field(std::string name, + AssociationEnum association, + vtkm::IdComponent logicalDim, + const T* data, + vtkm::Id nvals) : Name(name) , Association(association) , AssocLogicalDim(logicalDim) @@ -342,7 +361,8 @@ public: tmp.Allocate(nvals); //copy into the memory owned by the array handle - std::copy(ptr, ptr + static_cast(nvals), + std::copy(ptr, + ptr + static_cast(nvals), vtkm::cont::ArrayPortalToIteratorBegin(tmp.GetPortalControl())); //assign to the dynamic array handle diff --git a/vtkm/cont/ImplicitFunction.h b/vtkm/cont/ImplicitFunction.h index 774a06620..523cc3f55 100644 --- a/vtkm/cont/ImplicitFunction.h +++ b/vtkm/cont/ImplicitFunction.h @@ -121,7 +121,11 @@ class VTKM_ALWAYS_EXPORT Box : public ImplicitFunctionImpl public: Box(); Box(vtkm::Vec minPoint, vtkm::Vec maxPoint); - Box(FloatDefault xmin, FloatDefault xmax, FloatDefault ymin, FloatDefault ymax, FloatDefault zmin, + Box(FloatDefault xmin, + FloatDefault xmax, + FloatDefault ymin, + FloatDefault ymax, + FloatDefault zmin, FloatDefault zmax); void SetMinPoint(const vtkm::Vec& point); @@ -152,7 +156,8 @@ class VTKM_ALWAYS_EXPORT Cylinder : public ImplicitFunctionImpl public: Cylinder(); Cylinder(const vtkm::Vec& axis, FloatDefault radius); - Cylinder(const vtkm::Vec& center, const vtkm::Vec& axis, + Cylinder(const vtkm::Vec& center, + const vtkm::Vec& axis, FloatDefault radius); void SetCenter(const vtkm::Vec& center); diff --git a/vtkm/cont/ImplicitFunction.hxx b/vtkm/cont/ImplicitFunction.hxx index 72d45c8c0..9aa2cb5bf 100644 --- a/vtkm/cont/ImplicitFunction.hxx +++ b/vtkm/cont/ImplicitFunction.hxx @@ -41,8 +41,12 @@ inline Box::Box(vtkm::Vec minPoint, vtkm::Vec { } -inline Box::Box(FloatDefault xmin, FloatDefault xmax, FloatDefault ymin, FloatDefault ymax, - FloatDefault zmin, FloatDefault zmax) +inline Box::Box(FloatDefault xmin, + FloatDefault xmax, + FloatDefault ymin, + FloatDefault ymax, + FloatDefault zmin, + FloatDefault zmax) { MinPoint[0] = xmin; MaxPoint[0] = xmax; @@ -81,7 +85,8 @@ inline FloatDefault Box::Value(FloatDefault x, FloatDefault y, FloatDefault z) c } VTKM_EXEC_CONT -inline vtkm::Vec Box::Gradient(FloatDefault x, FloatDefault y, +inline vtkm::Vec Box::Gradient(FloatDefault x, + FloatDefault y, FloatDefault z) const { return this->Gradient(vtkm::Vec(x, y, z)); @@ -295,7 +300,8 @@ inline Cylinder::Cylinder(const vtkm::Vec& axis, FloatDefault r } inline Cylinder::Cylinder(const vtkm::Vec& center, - const vtkm::Vec& axis, FloatDefault radius) + const vtkm::Vec& axis, + FloatDefault radius) : Center(center) , Axis(vtkm::Normal(axis)) , Radius(radius) @@ -359,7 +365,8 @@ inline vtkm::Vec Cylinder::Gradient(const vtkm::Vec Cylinder::Gradient(FloatDefault x, FloatDefault y, +inline vtkm::Vec Cylinder::Gradient(FloatDefault x, + FloatDefault y, FloatDefault z) const { return this->Gradient(vtkm::Vec(x, y, z)); @@ -409,7 +416,8 @@ inline const vtkm::Vec* Frustum::GetNormals() const return this->Normals; } -inline void Frustum::SetPlane(int idx, vtkm::Vec& point, +inline void Frustum::SetPlane(int idx, + vtkm::Vec& point, vtkm::Vec& normal) { if (idx < 0 || idx >= 6) @@ -466,7 +474,8 @@ inline FloatDefault Frustum::Value(const vtkm::Vec& x) const } VTKM_EXEC_CONT -inline vtkm::Vec Frustum::Gradient(FloatDefault x, FloatDefault y, +inline vtkm::Vec Frustum::Gradient(FloatDefault x, + FloatDefault y, FloatDefault z) const { FloatDefault maxVal = -std::numeric_limits::max(); @@ -615,7 +624,8 @@ inline FloatDefault Sphere::Value(const vtkm::Vec& x) const } VTKM_EXEC_CONT -inline vtkm::Vec Sphere::Gradient(FloatDefault x, FloatDefault y, +inline vtkm::Vec Sphere::Gradient(FloatDefault x, + FloatDefault y, FloatDefault z) const { return this->Gradient(vtkm::Vec(x, y, z)); diff --git a/vtkm/cont/RuntimeDeviceTracker.cxx b/vtkm/cont/RuntimeDeviceTracker.cxx index d7305b328..a21490fad 100644 --- a/vtkm/cont/RuntimeDeviceTracker.cxx +++ b/vtkm/cont/RuntimeDeviceTracker.cxx @@ -129,8 +129,8 @@ vtkm::cont::RuntimeDeviceTracker RuntimeDeviceTracker::DeepCopy() const VTKM_CONT void RuntimeDeviceTracker::DeepCopy(const vtkm::cont::RuntimeDeviceTracker& src) { - std::copy_n(src.Internals->RuntimeValid, VTKM_MAX_DEVICE_ADAPTER_ID, - this->Internals->RuntimeValid); + std::copy_n( + src.Internals->RuntimeValid, VTKM_MAX_DEVICE_ADAPTER_ID, this->Internals->RuntimeValid); } VTKM_CONT diff --git a/vtkm/cont/RuntimeDeviceTracker.h b/vtkm/cont/RuntimeDeviceTracker.h index b28db6e8a..5b55d09c6 100644 --- a/vtkm/cont/RuntimeDeviceTracker.h +++ b/vtkm/cont/RuntimeDeviceTracker.h @@ -186,12 +186,14 @@ private: VTKM_CONT_EXPORT VTKM_CONT void SetDeviceState(vtkm::cont::DeviceAdapterId deviceId, - const vtkm::cont::DeviceAdapterNameType& deviceName, bool state); + const vtkm::cont::DeviceAdapterNameType& deviceName, + bool state); VTKM_CONT_EXPORT VTKM_CONT void ForceDeviceImpl(vtkm::cont::DeviceAdapterId deviceId, - const vtkm::cont::DeviceAdapterNameType& deviceName, bool runtimeExists); + const vtkm::cont::DeviceAdapterNameType& deviceName, + bool runtimeExists); }; /// \brief Get the global \c RuntimeDeviceTracker. diff --git a/vtkm/cont/StorageImplicit.h b/vtkm/cont/StorageImplicit.h index 8b092b5a8..762027f52 100644 --- a/vtkm/cont/StorageImplicit.h +++ b/vtkm/cont/StorageImplicit.h @@ -151,7 +151,8 @@ public: PortalType portal = this->Storage->GetPortalConst(); std::copy(vtkm::cont::ArrayPortalToIteratorBegin(portal), - vtkm::cont::ArrayPortalToIteratorEnd(portal), dest); + vtkm::cont::ArrayPortalToIteratorEnd(portal), + dest); } VTKM_CONT diff --git a/vtkm/cont/TryExecute.h b/vtkm/cont/TryExecute.h index ee1c50129..2832bfb13 100644 --- a/vtkm/cont/TryExecute.h +++ b/vtkm/cont/TryExecute.h @@ -109,8 +109,9 @@ struct TryExecuteImpl bool Success; VTKM_CONT - TryExecuteImpl(FunctorType& functor, vtkm::cont::RuntimeDeviceTracker tracker = - vtkm::cont::GetGlobalRuntimeDeviceTracker()) + TryExecuteImpl( + FunctorType& functor, + vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker()) : Functor(functor) , Tracker(tracker) , Success(false) @@ -159,7 +160,8 @@ private: /// is used. /// template -VTKM_CONT bool TryExecute(const Functor& functor, vtkm::cont::RuntimeDeviceTracker tracker, +VTKM_CONT bool TryExecute(const Functor& functor, + vtkm::cont::RuntimeDeviceTracker tracker, DeviceList) { detail::TryExecuteImpl internals(functor, tracker); @@ -184,14 +186,16 @@ VTKM_CONT bool TryExecute(Functor& functor, DeviceList) return vtkm::cont::TryExecute(functor, vtkm::cont::GetGlobalRuntimeDeviceTracker(), DeviceList()); } template -VTKM_CONT bool TryExecute(const Functor& functor, vtkm::cont::RuntimeDeviceTracker tracker = - vtkm::cont::GetGlobalRuntimeDeviceTracker()) +VTKM_CONT bool TryExecute( + const Functor& functor, + vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker()) { return vtkm::cont::TryExecute(functor, tracker, VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG()); } template -VTKM_CONT bool TryExecute(Functor& functor, vtkm::cont::RuntimeDeviceTracker tracker = - vtkm::cont::GetGlobalRuntimeDeviceTracker()) +VTKM_CONT bool TryExecute( + Functor& functor, + vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker()) { return vtkm::cont::TryExecute(functor, tracker, VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG()); } diff --git a/vtkm/cont/arg/TransportTagArrayIn.h b/vtkm/cont/arg/TransportTagArrayIn.h index ac4f8a253..949cc9db6 100644 --- a/vtkm/cont/arg/TransportTagArrayIn.h +++ b/vtkm/cont/arg/TransportTagArrayIn.h @@ -52,7 +52,8 @@ struct Transport template VTKM_CONT ExecObjectType operator()(const ContObjectType& object, const InputDomainType& vtkmNotUsed(inputDomain), - vtkm::Id inputRange, vtkm::Id vtkmNotUsed(outputRange)) const + vtkm::Id inputRange, + vtkm::Id vtkmNotUsed(outputRange)) const { if (object.GetNumberOfValues() != inputRange) { diff --git a/vtkm/cont/arg/TransportTagArrayInOut.h b/vtkm/cont/arg/TransportTagArrayInOut.h index 3d802fca4..ea35e6d8b 100644 --- a/vtkm/cont/arg/TransportTagArrayInOut.h +++ b/vtkm/cont/arg/TransportTagArrayInOut.h @@ -55,7 +55,8 @@ struct Transport VTKM_CONT ExecObjectType operator()(ContObjectType object, const InputDomainType& vtkmNotUsed(inputDomain), - vtkm::Id vtkmNotUsed(inputRange), vtkm::Id outputRange) const + vtkm::Id vtkmNotUsed(inputRange), + vtkm::Id outputRange) const { if (object.GetNumberOfValues() != outputRange) { diff --git a/vtkm/cont/arg/TransportTagArrayOut.h b/vtkm/cont/arg/TransportTagArrayOut.h index 77248736b..fcd338b1a 100644 --- a/vtkm/cont/arg/TransportTagArrayOut.h +++ b/vtkm/cont/arg/TransportTagArrayOut.h @@ -54,7 +54,8 @@ struct Transport template VTKM_CONT ExecObjectType operator()(ContObjectType object, const InputDomainType& vtkmNotUsed(inputDomain), - vtkm::Id vtkmNotUsed(inputRange), vtkm::Id outputRange) const + vtkm::Id vtkmNotUsed(inputRange), + vtkm::Id outputRange) const { return object.PrepareForOutput(outputRange, Device()); } diff --git a/vtkm/cont/arg/TransportTagAtomicArray.h b/vtkm/cont/arg/TransportTagAtomicArray.h index 958f9ab42..e6d18b608 100644 --- a/vtkm/cont/arg/TransportTagAtomicArray.h +++ b/vtkm/cont/arg/TransportTagAtomicArray.h @@ -50,13 +50,16 @@ struct TransportTagAtomicArray template struct Transport, Device> + vtkm::cont::ArrayHandle, + Device> { typedef vtkm::exec::AtomicArray ExecObjectType; template VTKM_CONT ExecObjectType operator()(vtkm::cont::ArrayHandle array, - const InputDomainType&, vtkm::Id, vtkm::Id) const + const InputDomainType&, + vtkm::Id, + vtkm::Id) const { // Note: we ignore the size of the domain because the randomly accessed // array might not have the same size depending on how the user is using diff --git a/vtkm/cont/arg/TransportTagCellSetIn.h b/vtkm/cont/arg/TransportTagCellSetIn.h index 4e6189c70..1fc7bdcf7 100644 --- a/vtkm/cont/arg/TransportTagCellSetIn.h +++ b/vtkm/cont/arg/TransportTagCellSetIn.h @@ -44,18 +44,20 @@ struct TransportTagCellSetIn }; template -struct Transport, ContObjectType, +struct Transport, + ContObjectType, Device> { VTKM_IS_CELL_SET(ContObjectType); typedef - typename ContObjectType::template ExecutionTypes::ExecObjectType ExecObjectType; template - VTKM_CONT ExecObjectType operator()(const ContObjectType& object, const InputDomainType&, - vtkm::Id, vtkm::Id) const + VTKM_CONT ExecObjectType + operator()(const ContObjectType& object, const InputDomainType&, vtkm::Id, vtkm::Id) const { return object.PrepareForInput(Device(), FromTopology(), ToTopology()); } diff --git a/vtkm/cont/arg/TransportTagExecObject.h b/vtkm/cont/arg/TransportTagExecObject.h index c94577704..e8818f8c9 100644 --- a/vtkm/cont/arg/TransportTagExecObject.h +++ b/vtkm/cont/arg/TransportTagExecObject.h @@ -56,8 +56,8 @@ struct Transport - VTKM_CONT ExecObjectType operator()(const ContObjectType& object, const InputDomainType&, - vtkm::Id, vtkm::Id) const + VTKM_CONT ExecObjectType + operator()(const ContObjectType& object, const InputDomainType&, vtkm::Id, vtkm::Id) const { return object; } diff --git a/vtkm/cont/arg/TransportTagTopologyFieldIn.h b/vtkm/cont/arg/TransportTagTopologyFieldIn.h index c6cb3b0a7..5dced8af2 100644 --- a/vtkm/cont/arg/TransportTagTopologyFieldIn.h +++ b/vtkm/cont/arg/TransportTagTopologyFieldIn.h @@ -81,7 +81,8 @@ inline static vtkm::Id TopologyDomainSize(const vtkm::cont::CellSet& cellSet, } // namespace detail template -struct Transport, ContObjectType, +struct Transport, + ContObjectType, Device> { VTKM_IS_ARRAY_HANDLE(ContObjectType); @@ -89,8 +90,10 @@ struct Transport::PortalConst ExecObjectType; VTKM_CONT - ExecObjectType operator()(const ContObjectType& object, const vtkm::cont::CellSet& inputDomain, - vtkm::Id, vtkm::Id) const + ExecObjectType operator()(const ContObjectType& object, + const vtkm::cont::CellSet& inputDomain, + vtkm::Id, + vtkm::Id) const { if (object.GetNumberOfValues() != detail::TopologyDomainSize(inputDomain, TopologyElementTag())) { diff --git a/vtkm/cont/arg/TransportTagWholeArrayIn.h b/vtkm/cont/arg/TransportTagWholeArrayIn.h index d0d08a872..759198672 100644 --- a/vtkm/cont/arg/TransportTagWholeArrayIn.h +++ b/vtkm/cont/arg/TransportTagWholeArrayIn.h @@ -60,8 +60,8 @@ struct Transport ExecObjectType; template - VTKM_CONT ExecObjectType operator()(ContObjectType array, const InputDomainType&, vtkm::Id, - vtkm::Id) const + VTKM_CONT ExecObjectType + operator()(ContObjectType array, const InputDomainType&, vtkm::Id, vtkm::Id) const { // Note: we ignore the size of the domain because the randomly accessed // array might not have the same size depending on how the user is using diff --git a/vtkm/cont/arg/TransportTagWholeArrayInOut.h b/vtkm/cont/arg/TransportTagWholeArrayInOut.h index 663966c76..9ad7fa4d4 100644 --- a/vtkm/cont/arg/TransportTagWholeArrayInOut.h +++ b/vtkm/cont/arg/TransportTagWholeArrayInOut.h @@ -62,8 +62,8 @@ struct Transport ExecObjectType; template - VTKM_CONT ExecObjectType operator()(ContObjectType array, const InputDomainType&, vtkm::Id, - vtkm::Id) const + VTKM_CONT ExecObjectType + operator()(ContObjectType array, const InputDomainType&, vtkm::Id, vtkm::Id) const { // Note: we ignore the size of the domain because the randomly accessed // array might not have the same size depending on how the user is using diff --git a/vtkm/cont/arg/TransportTagWholeArrayOut.h b/vtkm/cont/arg/TransportTagWholeArrayOut.h index 21e75863d..5ac4f9432 100644 --- a/vtkm/cont/arg/TransportTagWholeArrayOut.h +++ b/vtkm/cont/arg/TransportTagWholeArrayOut.h @@ -62,8 +62,8 @@ struct Transport ExecObjectType; template - VTKM_CONT ExecObjectType operator()(ContObjectType array, const InputDomainType&, vtkm::Id, - vtkm::Id) const + VTKM_CONT ExecObjectType + operator()(ContObjectType array, const InputDomainType&, vtkm::Id, vtkm::Id) const { // Note: we ignore the size of the domain because the randomly accessed // array might not have the same size depending on how the user is using diff --git a/vtkm/cont/arg/TypeCheckTagArray.h b/vtkm/cont/arg/TypeCheckTagArray.h index 40cd8be72..762b1a6ec 100644 --- a/vtkm/cont/arg/TypeCheckTagArray.h +++ b/vtkm/cont/arg/TypeCheckTagArray.h @@ -66,7 +66,9 @@ template struct TypeCheck, ArrayType> { static const bool value = detail::TypeCheckArrayValueType< - TypeList, ArrayType, vtkm::cont::internal::ArrayHandleCheck::type::value>::value; + TypeList, + ArrayType, + vtkm::cont::internal::ArrayHandleCheck::type::value>::value; }; } } diff --git a/vtkm/cont/arg/testing/UnitTestTransportCellSetIn.cxx b/vtkm/cont/arg/testing/UnitTestTransportCellSetIn.cxx index 551c68d40..723b36be1 100644 --- a/vtkm/cont/arg/testing/UnitTestTransportCellSetIn.cxx +++ b/vtkm/cont/arg/testing/UnitTestTransportCellSetIn.cxx @@ -72,11 +72,12 @@ void TransportWholeCellSetIn(Device) typedef vtkm::TopologyElementTagPoint FromType; typedef vtkm::TopologyElementTagCell ToType; - typedef typename vtkm::cont::CellSetExplicit<>::template ExecutionTypes< - Device, FromType, ToType>::ExecObjectType ExecObjectType; + typedef typename vtkm::cont::CellSetExplicit<>:: + template ExecutionTypes::ExecObjectType ExecObjectType; vtkm::cont::arg::Transport, - vtkm::cont::CellSetExplicit<>, Device> + vtkm::cont::CellSetExplicit<>, + Device> transport; TestKernel kernel; diff --git a/vtkm/cont/arg/testing/UnitTestTransportWholeArray.cxx b/vtkm/cont/arg/testing/UnitTestTransportWholeArray.cxx index b0cfb77f8..4a4aff67d 100644 --- a/vtkm/cont/arg/testing/UnitTestTransportWholeArray.cxx +++ b/vtkm/cont/arg/testing/UnitTestTransportWholeArray.cxx @@ -119,13 +119,16 @@ struct TryWholeArrayType { typedef vtkm::cont::ArrayHandle ArrayHandleType; - typedef vtkm::cont::arg::Transport InTransportType; typedef vtkm::cont::arg::Transport + ArrayHandleType, + Device> InOutTransportType; - typedef vtkm::cont::arg::Transport OutTransportType; @@ -171,7 +174,8 @@ struct TryAtomicArrayType { typedef vtkm::cont::ArrayHandle ArrayHandleType; - typedef vtkm::cont::arg::Transport TransportType; diff --git a/vtkm/cont/cuda/ArrayHandleCuda.h b/vtkm/cont/cuda/ArrayHandleCuda.h index 48269e411..b57a023b1 100644 --- a/vtkm/cont/cuda/ArrayHandleCuda.h +++ b/vtkm/cont/cuda/ArrayHandleCuda.h @@ -257,7 +257,8 @@ public: VTKM_CONT PortalConstType PrepareForInput(bool) { - return PortalConstType(this->Storage->GetDevicePointer(), this->Storage->GetDevicePointer() + + return PortalConstType(this->Storage->GetDevicePointer(), + this->Storage->GetDevicePointer() + static_cast(Storage->GetNumberOfValues())); } @@ -266,7 +267,8 @@ public: VTKM_CONT PortalType PrepareForInPlace(bool) { - return PortalType(this->Storage->GetDevicePointer(), this->Storage->GetDevicePointer() + + return PortalType(this->Storage->GetDevicePointer(), + this->Storage->GetDevicePointer() + static_cast(Storage->GetNumberOfValues())); } @@ -279,7 +281,8 @@ public: this->Storage->ReleaseResources(); this->Storage->Allocate(numberOfValues); - return PortalType(this->Storage->GetDevicePointer(), this->Storage->GetDevicePointer() + + return PortalType(this->Storage->GetDevicePointer(), + this->Storage->GetDevicePointer() + static_cast(Storage->GetNumberOfValues())); } @@ -326,7 +329,8 @@ template class ArrayHandleCuda : public vtkm::cont::ArrayHandle { public: - VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleCuda, (ArrayHandleCuda), + VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleCuda, + (ArrayHandleCuda), (vtkm::cont::ArrayHandle)); VTKM_CONT @@ -340,7 +344,8 @@ public: /// template VTKM_CONT vtkm::cont::ArrayHandle make_ArrayHandleCuda( - T* array, vtkm::Id length) + T* array, + vtkm::Id length) { typedef vtkm::cont::cuda::StorageTagCuda StorageTag; typedef vtkm::cont::ArrayHandle ArrayHandleType; @@ -349,7 +354,8 @@ VTKM_CONT vtkm::cont::ArrayHandle make_Arra template VTKM_CONT void printSummary_ArrayHandle( - const vtkm::cont::ArrayHandle& array, std::ostream& out) + const vtkm::cont::ArrayHandle& array, + std::ostream& out) { vtkm::Id sz = array.GetNumberOfValues(); out << "sz= " << sz << " [(on device)]"; diff --git a/vtkm/cont/cuda/ErrorCuda.h b/vtkm/cont/cuda/ErrorCuda.h index 14df4e348..49c43823e 100644 --- a/vtkm/cont/cuda/ErrorCuda.h +++ b/vtkm/cont/cuda/ErrorCuda.h @@ -36,8 +36,8 @@ const cudaError_t vtkm_cuda_check_async_error = cudaGetLastError(); \ if (vtkm_cuda_check_async_error != cudaSuccess) \ { \ - throw ::vtkm::cont::cuda::ErrorCuda(vtkm_cuda_check_async_error, __FILE__, __LINE__, \ - "Unchecked asynchronous error"); \ + throw ::vtkm::cont::cuda::ErrorCuda( \ + vtkm_cuda_check_async_error, __FILE__, __LINE__, "Unchecked asynchronous error"); \ } \ } \ VTKM_SWALLOW_SEMICOLON_POST_BLOCK @@ -79,7 +79,9 @@ public: this->SetMessage(message.str()); } - ErrorCuda(cudaError_t error, const std::string& file, vtkm::Id line, + ErrorCuda(cudaError_t error, + const std::string& file, + vtkm::Id line, const std::string& description) { std::stringstream message; diff --git a/vtkm/cont/cuda/internal/ArrayManagerExecutionThrustDevice.h b/vtkm/cont/cuda/internal/ArrayManagerExecutionThrustDevice.h index 08bca0059..1d21846c8 100644 --- a/vtkm/cont/cuda/internal/ArrayManagerExecutionThrustDevice.h +++ b/vtkm/cont/cuda/internal/ArrayManagerExecutionThrustDevice.h @@ -215,8 +215,8 @@ public: #ifdef VTKM_USE_UNIFIED_MEMORY cudaDeviceSynchronize(); #endif - ::thrust::copy(this->Begin, this->End, - vtkm::cont::ArrayPortalToIteratorBegin(storage->GetPortal())); + ::thrust::copy( + this->Begin, this->End, vtkm::cont::ArrayPortalToIteratorBegin(storage->GetPortal())); } catch (...) { diff --git a/vtkm/cont/cuda/internal/DeviceAdapterAlgorithmCuda.h b/vtkm/cont/cuda/internal/DeviceAdapterAlgorithmCuda.h index e8d6643b5..887ed304e 100644 --- a/vtkm/cont/cuda/internal/DeviceAdapterAlgorithmCuda.h +++ b/vtkm/cont/cuda/internal/DeviceAdapterAlgorithmCuda.h @@ -204,7 +204,8 @@ public: return vtkmAtomicAdd(lockedValue, value); } - inline __device__ T CompareAndSwap(vtkm::Id index, const vtkm::Int64& newValue, + inline __device__ T CompareAndSwap(vtkm::Id index, + const vtkm::Int64& newValue, const vtkm::Int64& oldValue) const { T* lockedValue = ::thrust::raw_pointer_cast(this->Portal.GetIteratorBegin() + index); @@ -237,7 +238,8 @@ private: const vtkm::Int64& newValue, const vtkm::Int64& oldValue) const { - return atomicCAS((unsigned long long int*)address, (unsigned long long int)oldValue, + return atomicCAS((unsigned long long int*)address, + (unsigned long long int)oldValue, (unsigned long long int)newValue); } }; @@ -248,7 +250,9 @@ class DeviceTaskTypes public: template static vtkm::exec::internal::TaskSingular MakeTask( - const WorkletType& worklet, const InvocationType& invocation, vtkm::Id, + const WorkletType& worklet, + const InvocationType& invocation, + vtkm::Id, vtkm::Id globalIndexOffset = 0) { using Task = vtkm::exec::internal::TaskSingular; @@ -257,7 +261,9 @@ public: template static vtkm::exec::internal::TaskSingular MakeTask( - const WorkletType& worklet, const InvocationType& invocation, vtkm::Id3, + const WorkletType& worklet, + const InvocationType& invocation, + vtkm::Id3, vtkm::Id globalIndexOffset = 0) { using Task = vtkm::exec::internal::TaskSingular; diff --git a/vtkm/cont/cuda/internal/DeviceAdapterAlgorithmThrust.h b/vtkm/cont/cuda/internal/DeviceAdapterAlgorithmThrust.h index 17581b7f6..df0d7f5ba 100644 --- a/vtkm/cont/cuda/internal/DeviceAdapterAlgorithmThrust.h +++ b/vtkm/cont/cuda/internal/DeviceAdapterAlgorithmThrust.h @@ -90,7 +90,8 @@ static __global__ void DetermineProperXGridSize(vtkm::UInt32 desired_size, } template -__global__ void Schedule1DIndexKernel(FunctorType functor, vtkm::Id numberOfKernelsInvoked, +__global__ void Schedule1DIndexKernel(FunctorType functor, + vtkm::Id numberOfKernelsInvoked, vtkm::Id length) { //Note a cuda launch can only handle at most 2B iterations of a kernel @@ -152,7 +153,8 @@ public: template static void compare_3d_schedule_patterns(Functor functor, const vtkm::Id3& rangeMax) { - const dim3 ranges(static_cast(rangeMax[0]), static_cast(rangeMax[1]), + const dim3 ranges(static_cast(rangeMax[0]), + static_cast(rangeMax[1]), static_cast(rangeMax[2])); std::vector results; vtkm::UInt32 indexTable[16] = { 1, 2, 4, 8, 12, 16, 20, 24, 28, 30, 32, 64, 128, 256, 512, 1024 }; @@ -286,8 +288,8 @@ private: { try { - ::thrust::copy(thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), - IteratorBegin(output)); + ::thrust::copy( + thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), IteratorBegin(output)); } catch (...) { @@ -296,8 +298,10 @@ private: } template - VTKM_CONT static vtkm::Id CopyIfPortal(ValueIterator valuesBegin, ValueIterator valuesEnd, - StencilPortal stencil, OutputPortal output, + VTKM_CONT static vtkm::Id CopyIfPortal(ValueIterator valuesBegin, + ValueIterator valuesEnd, + StencilPortal stencil, + OutputPortal output, UnaryPredicate unary_predicate) { typedef typename detail::IteratorTraits::IteratorType IteratorType; @@ -311,8 +315,8 @@ private: try { - IteratorType newLast = ::thrust::copy_if(thrust::cuda::par, valuesBegin, valuesEnd, - IteratorBegin(stencil), outputBegin, up); + IteratorType newLast = ::thrust::copy_if( + thrust::cuda::par, valuesBegin, valuesEnd, IteratorBegin(stencil), outputBegin, up); return static_cast(::thrust::distance(outputBegin, newLast)); } catch (...) @@ -323,22 +327,28 @@ private: } template - VTKM_CONT static vtkm::Id CopyIfPortal(ValuePortal values, StencilPortal stencil, - OutputPortal output, UnaryPredicate unary_predicate) + VTKM_CONT static vtkm::Id CopyIfPortal(ValuePortal values, + StencilPortal stencil, + OutputPortal output, + UnaryPredicate unary_predicate) { - return CopyIfPortal(IteratorBegin(values), IteratorEnd(values), stencil, output, - unary_predicate); + return CopyIfPortal( + IteratorBegin(values), IteratorEnd(values), stencil, output, unary_predicate); } template - VTKM_CONT static void CopySubRangePortal(const InputPortal& input, vtkm::Id inputOffset, - vtkm::Id size, const OutputPortal& output, + VTKM_CONT static void CopySubRangePortal(const InputPortal& input, + vtkm::Id inputOffset, + vtkm::Id size, + const OutputPortal& output, vtkm::Id outputOffset) { try { - ::thrust::copy_n(thrust::cuda::par, IteratorBegin(input) + inputOffset, - static_cast(size), IteratorBegin(output) + outputOffset); + ::thrust::copy_n(thrust::cuda::par, + IteratorBegin(input) + inputOffset, + static_cast(size), + IteratorBegin(output) + outputOffset); } catch (...) { @@ -347,7 +357,8 @@ private: } template - VTKM_CONT static void LowerBoundsPortal(const InputPortal& input, const ValuesPortal& values, + VTKM_CONT static void LowerBoundsPortal(const InputPortal& input, + const ValuesPortal& values, const OutputPortal& output) { typedef typename ValuesPortal::ValueType ValueType; @@ -363,8 +374,10 @@ private: } template - VTKM_CONT static void LowerBoundsPortal(const InputPortal& input, const ValuesPortal& values, - const OutputPortal& output, BinaryCompare binary_compare) + VTKM_CONT static void LowerBoundsPortal(const InputPortal& input, + const ValuesPortal& values, + const OutputPortal& output, + BinaryCompare binary_compare) { typedef typename InputPortal::ValueType ValueType; vtkm::exec::cuda::internal::WrappedBinaryPredicate bop( @@ -372,8 +385,13 @@ private: try { - ::thrust::lower_bound(thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), - IteratorBegin(values), IteratorEnd(values), IteratorBegin(output), bop); + ::thrust::lower_bound(thrust::cuda::par, + IteratorBegin(input), + IteratorEnd(input), + IteratorBegin(values), + IteratorEnd(values), + IteratorBegin(output), + bop); } catch (...) { @@ -388,7 +406,8 @@ private: } template - VTKM_CONT static T ReducePortal(const InputPortal& input, T initialValue, + VTKM_CONT static T ReducePortal(const InputPortal& input, + T initialValue, BinaryFunctor binary_functor) { using fast_path = std::is_same; @@ -396,8 +415,10 @@ private: } template - VTKM_CONT static T ReducePortalImpl(const InputPortal& input, T initialValue, - BinaryFunctor binary_functor, std::true_type) + VTKM_CONT static T ReducePortalImpl(const InputPortal& input, + T initialValue, + BinaryFunctor binary_functor, + std::true_type) { //The portal type and the initial value are the same so we can use //the thrust reduction algorithm @@ -405,8 +426,8 @@ private: try { - return ::thrust::reduce(thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), - initialValue, bop); + return ::thrust::reduce( + thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), initialValue, bop); } catch (...) { @@ -417,8 +438,10 @@ private: } template - VTKM_CONT static T ReducePortalImpl(const InputPortal& input, T initialValue, - BinaryFunctor binary_functor, std::false_type) + VTKM_CONT static T ReducePortalImpl(const InputPortal& input, + T initialValue, + BinaryFunctor binary_functor, + std::false_type) { //The portal type and the initial value ARENT the same type so we have //to a slower approach, where we wrap the input portal inside a cast @@ -431,8 +454,8 @@ private: try { - return ::thrust::reduce(thrust::cuda::par, IteratorBegin(castPortal), IteratorEnd(castPortal), - initialValue, bop); + return ::thrust::reduce( + thrust::cuda::par, IteratorBegin(castPortal), IteratorEnd(castPortal), initialValue, bop); } catch (...) { @@ -442,9 +465,13 @@ private: return initialValue; } - template - VTKM_CONT static vtkm::Id ReduceByKeyPortal(const KeysPortal& keys, const ValuesPortal& values, + VTKM_CONT static vtkm::Id ReduceByKeyPortal(const KeysPortal& keys, + const ValuesPortal& values, const KeysOutputPortal& keys_output, const ValueOutputPortal& values_output, BinaryFunctor binary_functor) @@ -464,9 +491,14 @@ private: try { - result_iterators = ::thrust::reduce_by_key( - vtkm_cuda_policy(), IteratorBegin(keys), IteratorEnd(keys), IteratorBegin(values), - keys_out_begin, values_out_begin, binaryPredicate, bop); + result_iterators = ::thrust::reduce_by_key(vtkm_cuda_policy(), + IteratorBegin(keys), + IteratorEnd(keys), + IteratorBegin(values), + keys_out_begin, + values_out_begin, + binaryPredicate, + bop); } catch (...) { @@ -482,13 +514,17 @@ private: { typedef typename OutputPortal::ValueType ValueType; - return ScanExclusivePortal(input, output, (::thrust::plus()), + return ScanExclusivePortal(input, + output, + (::thrust::plus()), vtkm::TypeTraits::ZeroInitialization()); } template VTKM_CONT static typename InputPortal::ValueType ScanExclusivePortal( - const InputPortal& input, const OutputPortal& output, BinaryFunctor binaryOp, + const InputPortal& input, + const OutputPortal& output, + BinaryFunctor binaryOp, typename InputPortal::ValueType initialValue) { // Use iterator to get value so that thrust device_ptr has chance to handle @@ -509,9 +545,12 @@ private: vtkm::exec::cuda::internal::WrappedBinaryOperator bop(binaryOp); typedef typename detail::IteratorTraits::IteratorType IteratorType; - IteratorType end = - ::thrust::exclusive_scan(thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), - IteratorBegin(output), initialValue, bop); + IteratorType end = ::thrust::exclusive_scan(thrust::cuda::par, + IteratorBegin(input), + IteratorEnd(input), + IteratorBegin(output), + initialValue, + bop); //Store the new value for the end of the array. This is done because //with items such as the transpose array it is unsafe to pass the @@ -548,8 +587,8 @@ private: try { - IteratorType end = ::thrust::inclusive_scan(thrust::cuda::par, IteratorBegin(input), - IteratorEnd(input), IteratorBegin(output), bop); + IteratorType end = ::thrust::inclusive_scan( + thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), IteratorBegin(output), bop); return *(end - 1); } catch (...) @@ -563,19 +602,27 @@ private: template VTKM_CONT static typename ValuesPortal::ValueType ScanInclusiveByKeyPortal( - const KeysPortal& keys, const ValuesPortal& values, const OutputPortal& output) + const KeysPortal& keys, + const ValuesPortal& values, + const OutputPortal& output) { using KeyType = typename KeysPortal::ValueType; typedef typename OutputPortal::ValueType ValueType; - return ScanInclusiveByKeyPortal(keys, values, output, ::thrust::equal_to(), - ::thrust::plus()); + return ScanInclusiveByKeyPortal( + keys, values, output, ::thrust::equal_to(), ::thrust::plus()); } - template + template VTKM_CONT static typename ValuesPortal::ValueType ScanInclusiveByKeyPortal( - const KeysPortal& keys, const ValuesPortal& values, const OutputPortal& output, - BinaryPredicate binary_predicate, AssociativeOperator binary_operator) + const KeysPortal& keys, + const ValuesPortal& values, + const OutputPortal& output, + BinaryPredicate binary_predicate, + AssociativeOperator binary_operator) { typedef typename KeysPortal::ValueType KeyType; vtkm::exec::cuda::internal::WrappedBinaryOperator bpred( @@ -587,9 +634,13 @@ private: typedef typename detail::IteratorTraits::IteratorType IteratorType; try { - IteratorType end = - ::thrust::inclusive_scan_by_key(thrust::cuda::par, IteratorBegin(keys), IteratorEnd(keys), - IteratorBegin(values), IteratorBegin(output), bpred, bop); + IteratorType end = ::thrust::inclusive_scan_by_key(thrust::cuda::par, + IteratorBegin(keys), + IteratorEnd(keys), + IteratorBegin(values), + IteratorBegin(output), + bpred, + bop); return *(end - 1); } catch (...) @@ -602,20 +653,30 @@ private: } template - VTKM_CONT static void ScanExclusiveByKeyPortal(const KeysPortal& keys, const ValuesPortal& values, + VTKM_CONT static void ScanExclusiveByKeyPortal(const KeysPortal& keys, + const ValuesPortal& values, const OutputPortal& output) { using KeyType = typename KeysPortal::ValueType; typedef typename OutputPortal::ValueType ValueType; - ScanExclusiveByKeyPortal(keys, values, output, + ScanExclusiveByKeyPortal(keys, + values, + output, vtkm::TypeTraits::ZeroInitialization(), - ::thrust::equal_to(), ::thrust::plus()); + ::thrust::equal_to(), + ::thrust::plus()); } - template - VTKM_CONT static void ScanExclusiveByKeyPortal(const KeysPortal& keys, const ValuesPortal& values, - const OutputPortal& output, T initValue, + template + VTKM_CONT static void ScanExclusiveByKeyPortal(const KeysPortal& keys, + const ValuesPortal& values, + const OutputPortal& output, + T initValue, BinaryPredicate binary_predicate, AssociativeOperator binary_operator) { @@ -629,9 +690,14 @@ private: typedef typename detail::IteratorTraits::IteratorType IteratorType; try { - IteratorType end = ::thrust::exclusive_scan_by_key( - thrust::cuda::par, IteratorBegin(keys), IteratorEnd(keys), IteratorBegin(values), - IteratorBegin(output), initValue, bpred, bop); + IteratorType end = ::thrust::exclusive_scan_by_key(thrust::cuda::par, + IteratorBegin(keys), + IteratorEnd(keys), + IteratorBegin(values), + IteratorBegin(output), + initValue, + bpred, + bop); return; } catch (...) @@ -674,7 +740,8 @@ private: } template - VTKM_CONT static void SortByKeyPortal(const KeysPortal& keys, const ValuesPortal& values, + VTKM_CONT static void SortByKeyPortal(const KeysPortal& keys, + const ValuesPortal& values, BinaryCompare binary_compare) { typedef typename KeysPortal::ValueType ValueType; @@ -682,8 +749,8 @@ private: binary_compare); try { - ::thrust::sort_by_key(vtkm_cuda_policy(), IteratorBegin(keys), IteratorEnd(keys), - IteratorBegin(values), bop); + ::thrust::sort_by_key( + vtkm_cuda_policy(), IteratorBegin(keys), IteratorEnd(keys), IteratorBegin(values), bop); } catch (...) { @@ -730,13 +797,18 @@ private: } template - VTKM_CONT static void UpperBoundsPortal(const InputPortal& input, const ValuesPortal& values, + VTKM_CONT static void UpperBoundsPortal(const InputPortal& input, + const ValuesPortal& values, const OutputPortal& output) { try { - ::thrust::upper_bound(thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), - IteratorBegin(values), IteratorEnd(values), IteratorBegin(output)); + ::thrust::upper_bound(thrust::cuda::par, + IteratorBegin(input), + IteratorEnd(input), + IteratorBegin(values), + IteratorEnd(values), + IteratorBegin(output)); } catch (...) { @@ -745,8 +817,10 @@ private: } template - VTKM_CONT static void UpperBoundsPortal(const InputPortal& input, const ValuesPortal& values, - const OutputPortal& output, BinaryCompare binary_compare) + VTKM_CONT static void UpperBoundsPortal(const InputPortal& input, + const ValuesPortal& values, + const OutputPortal& output, + BinaryCompare binary_compare) { typedef typename OutputPortal::ValueType ValueType; @@ -754,8 +828,13 @@ private: binary_compare); try { - ::thrust::upper_bound(thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), - IteratorBegin(values), IteratorEnd(values), IteratorBegin(output), bop); + ::thrust::upper_bound(thrust::cuda::par, + IteratorBegin(input), + IteratorEnd(input), + IteratorBegin(values), + IteratorEnd(values), + IteratorBegin(output), + bop); } catch (...) { @@ -769,8 +848,11 @@ private: { try { - ::thrust::upper_bound(thrust::cuda::par, IteratorBegin(input), IteratorEnd(input), - IteratorBegin(values_output), IteratorEnd(values_output), + ::thrust::upper_bound(thrust::cuda::par, + IteratorBegin(input), + IteratorEnd(input), + IteratorBegin(values_output), + IteratorEnd(values_output), IteratorBegin(values_output)); } catch (...) @@ -811,15 +893,17 @@ public: UnaryPredicate unary_predicate) { vtkm::Id size = stencil.GetNumberOfValues(); - vtkm::Id newSize = CopyIfPortal( - input.PrepareForInput(DeviceAdapterTag()), stencil.PrepareForInput(DeviceAdapterTag()), - output.PrepareForOutput(size, DeviceAdapterTag()), unary_predicate); + vtkm::Id newSize = CopyIfPortal(input.PrepareForInput(DeviceAdapterTag()), + stencil.PrepareForInput(DeviceAdapterTag()), + output.PrepareForOutput(size, DeviceAdapterTag()), + unary_predicate); output.Shrink(newSize); } template VTKM_CONT static bool CopySubRange(const vtkm::cont::ArrayHandle& input, - vtkm::Id inputStartIndex, vtkm::Id numberOfElementsToCopy, + vtkm::Id inputStartIndex, + vtkm::Id numberOfElementsToCopy, vtkm::cont::ArrayHandle& output, vtkm::Id outputIndex = 0) { @@ -853,8 +937,10 @@ public: output = temp; } } - CopySubRangePortal(input.PrepareForInput(DeviceAdapterTag()), inputStartIndex, - numberOfElementsToCopy, output.PrepareForInPlace(DeviceAdapterTag()), + CopySubRangePortal(input.PrepareForInput(DeviceAdapterTag()), + inputStartIndex, + numberOfElementsToCopy, + output.PrepareForInPlace(DeviceAdapterTag()), outputIndex); return true; } @@ -879,7 +965,8 @@ public: vtkm::Id numberOfValues = values.GetNumberOfValues(); LowerBoundsPortal(input.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), - output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), binary_compare); + output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), + binary_compare); } template @@ -902,7 +989,8 @@ public: } template - VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, U initialValue, + VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, + U initialValue, BinaryFunctor binary_functor) { const vtkm::Id numberOfValues = input.GetNumberOfValues(); @@ -913,7 +1001,12 @@ public: return ReducePortal(input.PrepareForInput(DeviceAdapterTag()), initialValue, binary_functor); } - template VTKM_CONT static void ReduceByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, @@ -928,10 +1021,12 @@ public: { return; } - vtkm::Id reduced_size = ReduceByKeyPortal( - keys.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), - keys_output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), - values_output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), binary_functor); + vtkm::Id reduced_size = + ReduceByKeyPortal(keys.PrepareForInput(DeviceAdapterTag()), + values.PrepareForInput(DeviceAdapterTag()), + keys_output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), + values_output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), + binary_functor); keys_output.Shrink(reduced_size); values_output.Shrink(reduced_size); @@ -960,7 +1055,8 @@ public: template VTKM_CONT static T ScanExclusive(const vtkm::cont::ArrayHandle& input, vtkm::cont::ArrayHandle& output, - BinaryFunctor binary_functor, const T& initialValue) + BinaryFunctor binary_functor, + const T& initialValue) { const vtkm::Id numberOfValues = input.GetNumberOfValues(); if (numberOfValues <= 0) @@ -976,7 +1072,8 @@ public: input.PrepareForInput(DeviceAdapterTag()); return ScanExclusivePortal(input.PrepareForInput(DeviceAdapterTag()), output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), - binary_functor, initialValue); + binary_functor, + initialValue); } template @@ -1044,7 +1141,11 @@ public: output.PrepareForOutput(numberOfValues, DeviceAdapterTag())); } - template VTKM_CONT static T ScanInclusiveByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, @@ -1067,7 +1168,8 @@ public: return ScanInclusiveByKeyPortal(keys.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), - ::thrust::equal_to(), binary_functor); + ::thrust::equal_to(), + binary_functor); } template @@ -1091,15 +1193,21 @@ public: ScanExnclusiveByKeyPortal(keys.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), - vtkm::TypeTraits::ZeroInitialization(), vtkm::Add()); + vtkm::TypeTraits::ZeroInitialization(), + vtkm::Add()); } - template VTKM_CONT static void ScanExclusiveByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, vtkm::cont::ArrayHandle& output, - const U& initialValue, BinaryFunctor binary_functor) + const U& initialValue, + BinaryFunctor binary_functor) { const vtkm::Id numberOfValues = keys.GetNumberOfValues(); if (numberOfValues <= 0) @@ -1117,7 +1225,9 @@ public: ScanExclusiveByKeyPortal(keys.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), - initialValue, ::thrust::equal_to(), binary_functor); + initialValue, + ::thrust::equal_to(), + binary_functor); } // Because of some funny code conversions in nvcc, kernels for devices have to // be public. @@ -1229,8 +1339,8 @@ public: //handle datasets larger than 2B, we need to execute multiple kernels if (totalBlocks < maxblocksPerLaunch) { - Schedule1DIndexKernel<<>>(functor, vtkm::Id(0), - numInstances); + Schedule1DIndexKernel<<>>( + functor, vtkm::Id(0), numInstances); } else { @@ -1346,7 +1456,8 @@ public: BinaryCompare binary_compare) { SortByKeyPortal(keys.PrepareForInPlace(DeviceAdapterTag()), - values.PrepareForInPlace(DeviceAdapterTag()), binary_compare); + values.PrepareForInPlace(DeviceAdapterTag()), + binary_compare); } template @@ -1386,7 +1497,8 @@ public: vtkm::Id numberOfValues = values.GetNumberOfValues(); UpperBoundsPortal(input.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), - output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), binary_compare); + output.PrepareForOutput(numberOfValues, DeviceAdapterTag()), + binary_compare); } template diff --git a/vtkm/cont/cuda/internal/MakeThrustIterator.h b/vtkm/cont/cuda/internal/MakeThrustIterator.h index 0ffe46e85..f6280eb78 100644 --- a/vtkm/cont/cuda/internal/MakeThrustIterator.h +++ b/vtkm/cont/cuda/internal/MakeThrustIterator.h @@ -97,14 +97,16 @@ struct IteratorTraits template VTKM_CONT typename IteratorTraits::IteratorType MakeIteratorBegin( - PortalType portal, detail::ThrustIteratorFromArrayPortalTag) + PortalType portal, + detail::ThrustIteratorFromArrayPortalTag) { return vtkm::exec::cuda::internal::IteratorFromArrayPortal(portal); } template VTKM_CONT typename IteratorTraits::IteratorType MakeIteratorBegin( - PortalType portal, detail::ThrustIteratorDevicePtrTag) + PortalType portal, + detail::ThrustIteratorDevicePtrTag) { vtkm::cont::ArrayPortalToIterators iterators(portal); return iterators.GetBegin(); @@ -112,7 +114,8 @@ VTKM_CONT typename IteratorTraits::IteratorType MakeIteratorBegin( template VTKM_CONT typename IteratorTraits::IteratorType MakeIteratorEnd( - PortalType portal, detail::ThrustIteratorFromArrayPortalTag) + PortalType portal, + detail::ThrustIteratorFromArrayPortalTag) { vtkm::exec::cuda::internal::IteratorFromArrayPortal iterator(portal); ::thrust::advance(iterator, static_cast(portal.GetNumberOfValues())); @@ -121,7 +124,8 @@ VTKM_CONT typename IteratorTraits::IteratorType MakeIteratorEnd( template VTKM_CONT typename IteratorTraits::IteratorType MakeIteratorEnd( - PortalType portal, detail::ThrustIteratorDevicePtrTag) + PortalType portal, + detail::ThrustIteratorDevicePtrTag) { vtkm::cont::ArrayPortalToIterators iterators(portal); return iterators.GetEnd(); diff --git a/vtkm/cont/internal/ArrayPortalFromIterators.h b/vtkm/cont/internal/ArrayPortalFromIterators.h index 88be6d32f..03921b892 100644 --- a/vtkm/cont/internal/ArrayPortalFromIterators.h +++ b/vtkm/cont/internal/ArrayPortalFromIterators.h @@ -45,9 +45,9 @@ class ArrayPortalFromIterators; /// of begin/end iterators to an ArrayPortal interface. /// template -class ArrayPortalFromIterators< - IteratorT, typename std::enable_if< - !std::is_const::type>::value>::type> +class ArrayPortalFromIterators::type>::value>::type> { public: typedef typename std::iterator_traits::value_type ValueType; @@ -119,9 +119,9 @@ private: }; template -class ArrayPortalFromIterators< - IteratorT, typename std::enable_if< - std::is_const::type>::value>::type> +class ArrayPortalFromIterators::type>::value>::type> { public: typedef typename std::iterator_traits::value_type ValueType; diff --git a/vtkm/cont/internal/ConnectivityExplicitInternals.h b/vtkm/cont/internal/ConnectivityExplicitInternals.h index 2a2d56f9b..706732e27 100644 --- a/vtkm/cont/internal/ConnectivityExplicitInternals.h +++ b/vtkm/cont/internal/ConnectivityExplicitInternals.h @@ -33,8 +33,10 @@ namespace internal { template -void buildIndexOffsets(const NumIndicesArrayType& numIndices, IndexOffsetArrayType& offsets, - DeviceAdapterTag, std::true_type) +void buildIndexOffsets(const NumIndicesArrayType& numIndices, + IndexOffsetArrayType& offsets, + DeviceAdapterTag, + std::true_type) { //We first need to make sure that NumIndices and IndexOffsetArrayType //have the same type so we can call scane exclusive @@ -48,7 +50,9 @@ void buildIndexOffsets(const NumIndicesArrayType& numIndices, IndexOffsetArrayTy } template -void buildIndexOffsets(const NumIndicesArrayType&, IndexOffsetArrayType&, DeviceAdapterTag, +void buildIndexOffsets(const NumIndicesArrayType&, + IndexOffsetArrayType&, + DeviceAdapterTag, std::false_type) { //this is a no-op as the storage for the offsets is an implicit handle @@ -59,7 +63,8 @@ void buildIndexOffsets(const NumIndicesArrayType&, IndexOffsetArrayType&, Device } template -void buildIndexOffsets(const ArrayHandleIndices& numIndices, ArrayHandleOffsets offsets, +void buildIndexOffsets(const ArrayHandleIndices& numIndices, + ArrayHandleOffsets offsets, DeviceAdapterTag tag) { typedef vtkm::cont::internal::IsWriteableArrayHandle diff --git a/vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h b/vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h index 9b38df5c3..cf0585f59 100644 --- a/vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h +++ b/vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h @@ -110,7 +110,8 @@ private: CopyKernel::PortalConst, typename OutputArrayType::template ExecutionTypes::Portal> kernel(input.PrepareForInput(DeviceAdapterTag()), - output.PrepareForOutput(1, DeviceAdapterTag()), index); + output.PrepareForOutput(1, DeviceAdapterTag()), + index); DerivedAlgorithm::Schedule(kernel, 1); @@ -174,7 +175,10 @@ public: OutputPortalType; OutputPortalType outputPortal = output.PrepareForOutput(outArrayLength, DeviceAdapterTag()); - CopyIfKernel copyKernel(inputPortal, stencilPortal, indexPortal, outputPortal, unary_predicate); DerivedAlgorithm::Schedule(copyKernel, arrayLength); @@ -193,7 +197,8 @@ public: // CopySubRange template VTKM_CONT static bool CopySubRange(const vtkm::cont::ArrayHandle& input, - vtkm::Id inputStartIndex, vtkm::Id numberOfElementsToCopy, + vtkm::Id inputStartIndex, + vtkm::Id numberOfElementsToCopy, vtkm::cont::ArrayHandle& output, vtkm::Id outputIndex = 0) { @@ -235,7 +240,9 @@ public: } CopyKernel kernel(input.PrepareForInput(DeviceAdapterTag()), - output.PrepareForInPlace(DeviceAdapterTag()), inputStartIndex, outputIndex); + output.PrepareForInPlace(DeviceAdapterTag()), + inputStartIndex, + outputIndex); DerivedAlgorithm::Schedule(kernel, numberOfElementsToCopy); return true; } @@ -255,7 +262,8 @@ public: DeviceAdapterTag>::PortalConst, typename vtkm::cont::ArrayHandle::template ExecutionTypes< DeviceAdapterTag>::Portal> - kernel(input.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), + kernel(input.PrepareForInput(DeviceAdapterTag()), + values.PrepareForInput(DeviceAdapterTag()), output.PrepareForOutput(arraySize, DeviceAdapterTag())); DerivedAlgorithm::Schedule(kernel, arraySize); @@ -277,8 +285,10 @@ public: typename vtkm::cont::ArrayHandle::template ExecutionTypes::Portal, BinaryCompare> - kernel(input.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), - output.PrepareForOutput(arraySize, DeviceAdapterTag()), binary_compare); + kernel(input.PrepareForInput(DeviceAdapterTag()), + values.PrepareForInput(DeviceAdapterTag()), + output.PrepareForOutput(arraySize, DeviceAdapterTag()), + binary_compare); DerivedAlgorithm::Schedule(kernel, arraySize); } @@ -300,7 +310,8 @@ public: } template - VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, U initialValue, + VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, + U initialValue, BinaryFunctor binary_functor) { //Crazy Idea: @@ -320,8 +331,8 @@ public: typedef vtkm::cont::ArrayHandleImplicit ReduceHandleType; typedef vtkm::cont::ArrayHandle TempArrayType; - ReduceKernelType kernel(input.PrepareForInput(DeviceAdapterTag()), initialValue, - binary_functor); + ReduceKernelType kernel( + input.PrepareForInput(DeviceAdapterTag()), initialValue, binary_functor); vtkm::Id length = (input.GetNumberOfValues() / 16); length += (input.GetNumberOfValues() % 16 == 0) ? 0 : 1; @@ -337,14 +348,16 @@ public: // Streaming Reduce template VTKM_CONT static U StreamingReduce(const vtkm::Id numBlocks, - const vtkm::cont::ArrayHandle& input, U initialValue) + const vtkm::cont::ArrayHandle& input, + U initialValue) { return DerivedAlgorithm::StreamingReduce(numBlocks, input, initialValue, vtkm::Add()); } template VTKM_CONT static U StreamingReduce(const vtkm::Id numBlocks, - const vtkm::cont::ArrayHandle& input, U initialValue, + const vtkm::cont::ArrayHandle& input, + U initialValue, BinaryFunctor binary_functor) { vtkm::Id fullSize = input.GetNumberOfValues(); @@ -360,8 +373,8 @@ public: numberOfInstances = fullSize - blockSize * block; vtkm::cont::ArrayHandleStreaming> streamIn = - vtkm::cont::ArrayHandleStreaming>(input, block, blockSize, - numberOfInstances); + vtkm::cont::ArrayHandleStreaming>( + input, block, blockSize, numberOfInstances); if (block == 0) lastResult = DerivedAlgorithm::Reduce(streamIn, initialValue, binary_functor); @@ -373,7 +386,12 @@ public: //-------------------------------------------------------------------------- // Reduce By Key - template VTKM_CONT static void ReduceByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, @@ -430,8 +448,8 @@ public: ZipInHandleType scanInput(values, keystate); ZipOutHandleType scanOutput(reducedValues, stencil); - DerivedAlgorithm::ScanInclusive(scanInput, scanOutput, - ReduceByKeyAdd(binary_functor)); + DerivedAlgorithm::ScanInclusive( + scanInput, scanOutput, ReduceByKeyAdd(binary_functor)); //at this point we are done with keystate, so free the memory keystate.ReleaseResources(); @@ -453,7 +471,8 @@ public: template VTKM_CONT static T ScanExclusive(const vtkm::cont::ArrayHandle& input, vtkm::cont::ArrayHandle& output, - BinaryFunctor binaryFunctor, const T& initialValue) + BinaryFunctor binaryFunctor, + const T& initialValue) { typedef vtkm::cont::ArrayHandle TempArrayType; typedef vtkm::cont::ArrayHandle OutputArrayType; @@ -474,7 +493,9 @@ public: InclusiveToExclusiveKernel inclusiveToExclusive( inclusiveScan.PrepareForInput(DeviceAdapterTag()), - output.PrepareForOutput(numValues, DeviceAdapterTag()), binaryFunctor, initialValue); + output.PrepareForOutput(numValues, DeviceAdapterTag()), + binaryFunctor, + initialValue); DerivedAlgorithm::Schedule(inclusiveToExclusive, numValues); @@ -485,8 +506,8 @@ public: VTKM_CONT static T ScanExclusive(const vtkm::cont::ArrayHandle& input, vtkm::cont::ArrayHandle& output) { - return DerivedAlgorithm::ScanExclusive(input, output, vtkm::Sum(), - vtkm::TypeTraits::ZeroInitialization()); + return DerivedAlgorithm::ScanExclusive( + input, output, vtkm::Sum(), vtkm::TypeTraits::ZeroInitialization()); } //-------------------------------------------------------------------------- @@ -495,7 +516,8 @@ public: VTKM_CONT static void ScanExclusiveByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, vtkm::cont::ArrayHandle& output, - const U& initialValue, BinaryFunctor binaryFunctor) + const U& initialValue, + BinaryFunctor binaryFunctor) { VTKM_ASSERT(keys.GetNumberOfValues() == values.GetNumberOfValues()); @@ -564,8 +586,8 @@ public: const vtkm::cont::ArrayHandle& values, vtkm::cont::ArrayHandle& output) { - DerivedAlgorithm::ScanExclusiveByKey(keys, values, output, - vtkm::TypeTraits::ZeroInitialization(), vtkm::Sum()); + DerivedAlgorithm::ScanExclusiveByKey( + keys, values, output, vtkm::TypeTraits::ZeroInitialization(), vtkm::Sum()); } //-------------------------------------------------------------------------- @@ -575,15 +597,16 @@ public: const vtkm::cont::ArrayHandle& input, vtkm::cont::ArrayHandle& output) { - return DerivedAlgorithm::StreamingScanExclusive(numBlocks, input, output, vtkm::Sum(), - vtkm::TypeTraits::ZeroInitialization()); + return DerivedAlgorithm::StreamingScanExclusive( + numBlocks, input, output, vtkm::Sum(), vtkm::TypeTraits::ZeroInitialization()); } template VTKM_CONT static T StreamingScanExclusive(const vtkm::Id numBlocks, const vtkm::cont::ArrayHandle& input, vtkm::cont::ArrayHandle& output, - BinaryFunctor binary_functor, const T& initialValue) + BinaryFunctor binary_functor, + const T& initialValue) { vtkm::Id fullSize = input.GetNumberOfValues(); vtkm::Id blockSize = fullSize / numBlocks; @@ -598,12 +621,12 @@ public: numberOfInstances = fullSize - blockSize * block; vtkm::cont::ArrayHandleStreaming> streamIn = - vtkm::cont::ArrayHandleStreaming>(input, block, blockSize, - numberOfInstances); + vtkm::cont::ArrayHandleStreaming>( + input, block, blockSize, numberOfInstances); vtkm::cont::ArrayHandleStreaming> streamOut = - vtkm::cont::ArrayHandleStreaming>(output, block, blockSize, - numberOfInstances); + vtkm::cont::ArrayHandleStreaming>( + output, block, blockSize, numberOfInstances); if (block == 0) { @@ -733,8 +756,8 @@ public: ZipInHandleType scanInput(values, keystate); ZipOutHandleType scanOutput(reducedValues, stencil); - DerivedAlgorithm::ScanInclusive(scanInput, scanOutput, - ReduceByKeyAdd(binary_functor)); + DerivedAlgorithm::ScanInclusive( + scanInput, scanOutput, ReduceByKeyAdd(binary_functor)); //at this point we are done with keystate, so free the memory keystate.ReleaseResources(); DerivedAlgorithm::Copy(reducedValues, values_output); @@ -841,11 +864,12 @@ public: ClassifyUniqueComparisonKernel< typename vtkm::cont::ArrayHandle::template ExecutionTypes< DeviceAdapterTag>::PortalConst, - typename vtkm::cont::ArrayHandle< - vtkm::Id, vtkm::cont::StorageTagBasic>::template ExecutionTypes::Portal, + typename vtkm::cont::ArrayHandle:: + template ExecutionTypes::Portal, WrappedBOpType> classifyKernel(values.PrepareForInput(DeviceAdapterTag()), - stencilArray.PrepareForOutput(inputSize, DeviceAdapterTag()), wrappedCompare); + stencilArray.PrepareForOutput(inputSize, DeviceAdapterTag()), + wrappedCompare); DerivedAlgorithm::Schedule(classifyKernel, inputSize); @@ -872,7 +896,8 @@ public: DeviceAdapterTag>::PortalConst, typename vtkm::cont::ArrayHandle::template ExecutionTypes< DeviceAdapterTag>::Portal> - kernel(input.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), + kernel(input.PrepareForInput(DeviceAdapterTag()), + values.PrepareForInput(DeviceAdapterTag()), output.PrepareForOutput(arraySize, DeviceAdapterTag())); DerivedAlgorithm::Schedule(kernel, arraySize); @@ -894,8 +919,10 @@ public: typename vtkm::cont::ArrayHandle::template ExecutionTypes::Portal, BinaryCompare> - kernel(input.PrepareForInput(DeviceAdapterTag()), values.PrepareForInput(DeviceAdapterTag()), - output.PrepareForOutput(arraySize, DeviceAdapterTag()), binary_compare); + kernel(input.PrepareForInput(DeviceAdapterTag()), + values.PrepareForInput(DeviceAdapterTag()), + output.PrepareForOutput(arraySize, DeviceAdapterTag()), + binary_compare); DerivedAlgorithm::Schedule(kernel, arraySize); } @@ -987,19 +1014,21 @@ private: } VTKM_EXEC - vtkm::Int32 vtkmCompareAndSwap(vtkm::Int32* address, const vtkm::Int32& newValue, + vtkm::Int32 vtkmCompareAndSwap(vtkm::Int32* address, + const vtkm::Int32& newValue, const vtkm::Int32& oldValue) const { - return InterlockedCompareExchange(reinterpret_cast(address), newValue, - oldValue); + return InterlockedCompareExchange( + reinterpret_cast(address), newValue, oldValue); } VTKM_EXEC - vtkm::Int64 vtkmCompareAndSwap(vtkm::Int64* address, const vtkm::Int64& newValue, + vtkm::Int64 vtkmCompareAndSwap(vtkm::Int64* address, + const vtkm::Int64& newValue, const vtkm::Int64& oldValue) const { - return InterlockedCompareExchange64(reinterpret_cast(address), newValue, - oldValue); + return InterlockedCompareExchange64( + reinterpret_cast(address), newValue, oldValue); } #else //gcc built-in atomics @@ -1017,14 +1046,16 @@ private: } VTKM_EXEC - vtkm::Int32 vtkmCompareAndSwap(vtkm::Int32* address, const vtkm::Int32& newValue, + vtkm::Int32 vtkmCompareAndSwap(vtkm::Int32* address, + const vtkm::Int32& newValue, const vtkm::Int32& oldValue) const { return __sync_val_compare_and_swap(address, oldValue, newValue); } VTKM_EXEC - vtkm::Int64 vtkmCompareAndSwap(vtkm::Int64* address, const vtkm::Int64& newValue, + vtkm::Int64 vtkmCompareAndSwap(vtkm::Int64* address, + const vtkm::Int64& newValue, const vtkm::Int64& oldValue) const { return __sync_val_compare_and_swap(address, oldValue, newValue); @@ -1049,7 +1080,9 @@ class DeviceTaskTypes public: template static vtkm::exec::internal::TaskSingular MakeTask( - const WorkletType& worklet, const InvocationType& invocation, vtkm::Id, + const WorkletType& worklet, + const InvocationType& invocation, + vtkm::Id, vtkm::Id globalIndexOffset = 0) { using Task = vtkm::exec::internal::TaskSingular; @@ -1058,7 +1091,9 @@ public: template static vtkm::exec::internal::TaskSingular MakeTask( - const WorkletType& worklet, const InvocationType& invocation, vtkm::Id3, + const WorkletType& worklet, + const InvocationType& invocation, + vtkm::Id3, vtkm::Id globalIndexOffset = 0) { using Task = vtkm::exec::internal::TaskSingular; diff --git a/vtkm/cont/internal/DynamicTransform.h b/vtkm/cont/internal/DynamicTransform.h index a2724b132..680e0d4ed 100644 --- a/vtkm/cont/internal/DynamicTransform.h +++ b/vtkm/cont/internal/DynamicTransform.h @@ -139,24 +139,28 @@ struct DynamicTransformTraits struct DynamicTransform { template - VTKM_CONT void operator()(const InputType& input, const ContinueFunctor& continueFunc, + VTKM_CONT void operator()(const InputType& input, + const ContinueFunctor& continueFunc, vtkm::internal::IndexTag) const { this->DoTransform( - input, continueFunc, + input, + continueFunc, typename vtkm::cont::internal::DynamicTransformTraits::DynamicTag()); } private: template - VTKM_CONT void DoTransform(const InputType& input, const ContinueFunctor& continueFunc, + VTKM_CONT void DoTransform(const InputType& input, + const ContinueFunctor& continueFunc, vtkm::cont::internal::DynamicTransformTagStatic) const { continueFunc(input); } template - VTKM_CONT void DoTransform(const InputType& dynamicInput, const ContinueFunctor& continueFunc, + VTKM_CONT void DoTransform(const InputType& dynamicInput, + const ContinueFunctor& continueFunc, vtkm::cont::internal::DynamicTransformTagCastAndCall) const { CastAndCall(dynamicInput, continueFunc); diff --git a/vtkm/cont/internal/FunctorsGeneral.h b/vtkm/cont/internal/FunctorsGeneral.h index 377dd902e..bf3dfeaa1 100644 --- a/vtkm/cont/internal/FunctorsGeneral.h +++ b/vtkm/cont/internal/FunctorsGeneral.h @@ -68,8 +68,9 @@ struct WrappedBinaryOperator } template - VTKM_CONT ResultType operator()( - const Argument1& x, const vtkm::internal::ArrayPortalValueReference& y) const + VTKM_CONT ResultType + operator()(const Argument1& x, + const vtkm::internal::ArrayPortalValueReference& y) const { using ValueTypeY = typename vtkm::internal::ArrayPortalValueReference::ValueType; return m_f(x, (ValueTypeY)y); @@ -296,7 +297,9 @@ struct ReduceByKeyUnaryStencilOp bool operator()(ReduceKeySeriesStates keySeriesState) const { return keySeriesState.fEnd; } }; -template struct ShiftCopyAndInit : vtkm::exec::FunctorBase { @@ -305,8 +308,10 @@ struct ShiftCopyAndInit : vtkm::exec::FunctorBase OutputPortalType Output; T initValue; - ShiftCopyAndInit(const InputPortalType& _input, const KeyStatePortalType& kstate, - OutputPortalType& _output, T _init) + ShiftCopyAndInit(const InputPortalType& _input, + const KeyStatePortalType& kstate, + OutputPortalType& _output, + T _init) : Input(_input) , KeyState(kstate) , Output(_output) @@ -336,7 +341,9 @@ struct CopyKernel vtkm::Id OutputOffset; VTKM_CONT - CopyKernel(InputPortalType inputPortal, OutputPortalType outputPortal, vtkm::Id inputOffset = 0, + CopyKernel(InputPortalType inputPortal, + OutputPortalType outputPortal, + vtkm::Id inputOffset = 0, vtkm::Id outputOffset = 0) : InputPortal(inputPortal) , OutputPortal(outputPortal) @@ -350,8 +357,9 @@ struct CopyKernel void operator()(vtkm::Id index) const { typedef typename OutputPortalType::ValueType ValueType; - this->OutputPortal.Set(index + this->OutputOffset, static_cast(this->InputPortal.Get( - index + this->InputOffset))); + this->OutputPortal.Set( + index + this->OutputOffset, + static_cast(this->InputPortal.Get(index + this->InputOffset))); } VTKM_CONT @@ -366,7 +374,8 @@ struct LowerBoundsKernel OutputPortalType OutputPortal; VTKM_CONT - LowerBoundsKernel(InputPortalType inputPortal, ValuesPortalType valuesPortal, + LowerBoundsKernel(InputPortalType inputPortal, + ValuesPortalType valuesPortal, OutputPortalType outputPortal) : InputPortal(inputPortal) , ValuesPortal(valuesPortal) @@ -399,7 +408,9 @@ struct LowerBoundsKernel void SetErrorMessageBuffer(const vtkm::exec::internal::ErrorMessageBuffer&) {} }; -template struct LowerBoundsComparisonKernel { @@ -409,8 +420,10 @@ struct LowerBoundsComparisonKernel BinaryCompare CompareFunctor; VTKM_CONT - LowerBoundsComparisonKernel(InputPortalType inputPortal, ValuesPortalType valuesPortal, - OutputPortalType outputPortal, BinaryCompare binary_compare) + LowerBoundsComparisonKernel(InputPortalType inputPortal, + ValuesPortalType valuesPortal, + OutputPortalType outputPortal, + BinaryCompare binary_compare) : InputPortal(inputPortal) , ValuesPortal(valuesPortal) , OutputPortal(outputPortal) @@ -432,8 +445,10 @@ struct LowerBoundsComparisonKernel typedef vtkm::cont::ArrayPortalToIterators InputIteratorsType; InputIteratorsType inputIterators(this->InputPortal); typename InputIteratorsType::IteratorType resultPos = - std::lower_bound(inputIterators.GetBegin(), inputIterators.GetEnd(), - this->ValuesPortal.Get(index), this->CompareFunctor); + std::lower_bound(inputIterators.GetBegin(), + inputIterators.GetEnd(), + this->ValuesPortal.Get(index), + this->CompareFunctor); vtkm::Id resultIndex = static_cast(std::distance(inputIterators.GetBegin(), resultPos)); @@ -515,7 +530,8 @@ struct BitonicSortCrossoverKernel : vtkm::exec::FunctorBase vtkm::Id GroupSize; VTKM_CONT - BitonicSortCrossoverKernel(const PortalType& portal, const BinaryCompare& compare, + BitonicSortCrossoverKernel(const PortalType& portal, + const BinaryCompare& compare, vtkm::Id groupSize) : Portal(portal) , Compare(compare) @@ -558,7 +574,8 @@ struct StencilToIndexFlagKernel UnaryPredicate Predicate; VTKM_CONT - StencilToIndexFlagKernel(StencilPortalType stencilPortal, OutputPortalType outputPortal, + StencilToIndexFlagKernel(StencilPortalType stencilPortal, + OutputPortalType outputPortal, UnaryPredicate unary_predicate) : StencilPortal(stencilPortal) , OutputPortal(outputPortal) @@ -578,8 +595,11 @@ struct StencilToIndexFlagKernel void SetErrorMessageBuffer(const vtkm::exec::internal::ErrorMessageBuffer&) {} }; -template +template struct CopyIfKernel { InputPortalType InputPortal; @@ -589,8 +609,10 @@ struct CopyIfKernel PredicateOperator Predicate; VTKM_CONT - CopyIfKernel(InputPortalType inputPortal, StencilPortalType stencilPortal, - IndexPortalType indexPortal, OutputPortalType outputPortal, + CopyIfKernel(InputPortalType inputPortal, + StencilPortalType stencilPortal, + IndexPortalType indexPortal, + OutputPortalType outputPortal, PredicateOperator unary_predicate) : InputPortal(inputPortal) , StencilPortal(stencilPortal) @@ -663,7 +685,8 @@ struct ClassifyUniqueComparisonKernel BinaryCompare CompareFunctor; VTKM_CONT - ClassifyUniqueComparisonKernel(InputPortalType inputPortal, StencilPortalType stencilPortal, + ClassifyUniqueComparisonKernel(InputPortalType inputPortal, + StencilPortalType stencilPortal, BinaryCompare binary_compare) : InputPortal(inputPortal) , StencilPortal(stencilPortal) @@ -703,7 +726,8 @@ struct UpperBoundsKernel OutputPortalType OutputPortal; VTKM_CONT - UpperBoundsKernel(InputPortalType inputPortal, ValuesPortalType valuesPortal, + UpperBoundsKernel(InputPortalType inputPortal, + ValuesPortalType valuesPortal, OutputPortalType outputPortal) : InputPortal(inputPortal) , ValuesPortal(valuesPortal) @@ -736,7 +760,9 @@ struct UpperBoundsKernel void SetErrorMessageBuffer(const vtkm::exec::internal::ErrorMessageBuffer&) {} }; -template struct UpperBoundsKernelComparisonKernel { @@ -746,8 +772,10 @@ struct UpperBoundsKernelComparisonKernel BinaryCompare CompareFunctor; VTKM_CONT - UpperBoundsKernelComparisonKernel(InputPortalType inputPortal, ValuesPortalType valuesPortal, - OutputPortalType outputPortal, BinaryCompare binary_compare) + UpperBoundsKernelComparisonKernel(InputPortalType inputPortal, + ValuesPortalType valuesPortal, + OutputPortalType outputPortal, + BinaryCompare binary_compare) : InputPortal(inputPortal) , ValuesPortal(valuesPortal) , OutputPortal(outputPortal) @@ -769,8 +797,10 @@ struct UpperBoundsKernelComparisonKernel typedef vtkm::cont::ArrayPortalToIterators InputIteratorsType; InputIteratorsType inputIterators(this->InputPortal); typename InputIteratorsType::IteratorType resultPos = - std::upper_bound(inputIterators.GetBegin(), inputIterators.GetEnd(), - this->ValuesPortal.Get(index), this->CompareFunctor); + std::upper_bound(inputIterators.GetBegin(), + inputIterators.GetEnd(), + this->ValuesPortal.Get(index), + this->CompareFunctor); vtkm::Id resultIndex = static_cast(std::distance(inputIterators.GetBegin(), resultPos)); @@ -792,8 +822,10 @@ struct InclusiveToExclusiveKernel : vtkm::exec::FunctorBase ValueType InitialValue; VTKM_CONT - InclusiveToExclusiveKernel(const InPortalType& inPortal, const OutPortalType& outPortal, - BinaryFunctor& binaryOperator, ValueType initialValue) + InclusiveToExclusiveKernel(const InPortalType& inPortal, + const OutPortalType& outPortal, + BinaryFunctor& binaryOperator, + ValueType initialValue) : InPortal(inPortal) , OutPortal(outPortal) , BinaryOperator(binaryOperator) @@ -822,7 +854,9 @@ struct ScanKernel : vtkm::exec::FunctorBase vtkm::Id Distance; VTKM_CONT - ScanKernel(const PortalType& portal, BinaryFunctor binary_functor, vtkm::Id stride, + ScanKernel(const PortalType& portal, + BinaryFunctor binary_functor, + vtkm::Id stride, vtkm::Id offset) : Portal(portal) , BinaryOperator(binary_functor) diff --git a/vtkm/cont/internal/IteratorFromArrayPortal.h b/vtkm/cont/internal/IteratorFromArrayPortal.h index 512c2d3df..4e8a576b2 100644 --- a/vtkm/cont/internal/IteratorFromArrayPortal.h +++ b/vtkm/cont/internal/IteratorFromArrayPortal.h @@ -172,18 +172,20 @@ std::ptrdiff_t operator-(vtkm::cont::internal::IteratorFromArrayPortal vtkm::cont::internal::IteratorFromArrayPortal operator+( - vtkm::cont::internal::IteratorFromArrayPortal const& iter, std::ptrdiff_t n) + vtkm::cont::internal::IteratorFromArrayPortal const& iter, + std::ptrdiff_t n) { - return vtkm::cont::internal::IteratorFromArrayPortal(iter.Portal, iter.Index + - static_cast(n)); + return vtkm::cont::internal::IteratorFromArrayPortal( + iter.Portal, iter.Index + static_cast(n)); } template vtkm::cont::internal::IteratorFromArrayPortal operator+( - std::ptrdiff_t n, vtkm::cont::internal::IteratorFromArrayPortal const& iter) + std::ptrdiff_t n, + vtkm::cont::internal::IteratorFromArrayPortal const& iter) { - return vtkm::cont::internal::IteratorFromArrayPortal(iter.Portal, iter.Index + - static_cast(n)); + return vtkm::cont::internal::IteratorFromArrayPortal( + iter.Portal, iter.Index + static_cast(n)); } } } diff --git a/vtkm/cont/internal/testing/UnitTestArrayPortalFromIterators.cxx b/vtkm/cont/internal/testing/UnitTestArrayPortalFromIterators.cxx index f4954f7ea..e894a5187 100644 --- a/vtkm/cont/internal/testing/UnitTestArrayPortalFromIterators.cxx +++ b/vtkm/cont/internal/testing/UnitTestArrayPortalFromIterators.cxx @@ -80,8 +80,8 @@ struct TemplatedTests FillIterator(array, array + ARRAY_SIZE, ORIGINAL_VALUE); ::vtkm::cont::internal::ArrayPortalFromIterators portal(array, array + ARRAY_SIZE); - ::vtkm::cont::internal::ArrayPortalFromIterators const_portal(array, array + - ARRAY_SIZE); + ::vtkm::cont::internal::ArrayPortalFromIterators const_portal( + array, array + ARRAY_SIZE); std::cout << " Check that ArrayPortalToIterators is not doing indirection." << std::endl; // If you get a compile error here about mismatched types, it might be diff --git a/vtkm/cont/internal/testing/UnitTestDynamicTransform.cxx b/vtkm/cont/internal/testing/UnitTestDynamicTransform.cxx index 5d2e58475..e602b396c 100644 --- a/vtkm/cont/internal/testing/UnitTestDynamicTransform.cxx +++ b/vtkm/cont/internal/testing/UnitTestDynamicTransform.cxx @@ -113,9 +113,10 @@ struct FunctionInterfaceFunctor VTKM_TEST_FAIL("Called wrong form of functor operator."); } void operator()( - const vtkm::internal::FunctionInterface< - void(vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle, vtkm::cont::CellSetStructured<3>)>&) const + const vtkm::internal::FunctionInterface, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle, + vtkm::cont::CellSetStructured<3>)>&) const { std::cout << " In FunctionInterface<...> functor." << std::endl; g_FunctionCalls++; @@ -142,8 +143,8 @@ void TestBasicTransform() std::cout << " Trying with unusual (string) dynamic array." << std::endl; dynamicArray = vtkm::cont::ArrayHandle(); - TRY_TRANSFORM(transform(dynamicArray.ResetTypeList(TypeListTagString()), - ArrayHandleStringFunctor(), indexTag)); + TRY_TRANSFORM(transform( + dynamicArray.ResetTypeList(TypeListTagString()), ArrayHandleStringFunctor(), indexTag)); std::cout << " Trying with structured cell set." << std::endl; vtkm::cont::CellSetStructured<3> concreteCellSet; @@ -169,7 +170,8 @@ void TestFunctionTransform() std::cout << " Trying dynamic cast" << std::endl; TRY_TRANSFORM( vtkm::internal::make_FunctionInterface( - scalarArray, vtkm::cont::DynamicArrayHandle(scalarArray), + scalarArray, + vtkm::cont::DynamicArrayHandle(scalarArray), vtkm::cont::DynamicArrayHandle(stringArray).ResetTypeList(TypeListTagString()), vtkm::cont::DynamicCellSet(structuredCellSet)) .DynamicTransformCont(vtkm::cont::internal::DynamicTransform(), FunctionInterfaceFunctor())); diff --git a/vtkm/cont/internal/testing/UnitTestIteratorFromArrayPortal.cxx b/vtkm/cont/internal/testing/UnitTestIteratorFromArrayPortal.cxx index 05c98b75b..206554fab 100644 --- a/vtkm/cont/internal/testing/UnitTestIteratorFromArrayPortal.cxx +++ b/vtkm/cont/internal/testing/UnitTestIteratorFromArrayPortal.cxx @@ -132,8 +132,8 @@ struct TemplatedTests FillIterator(array, array + ARRAY_SIZE, ORIGINAL_VALUE()); ::vtkm::cont::internal::ArrayPortalFromIterators portal(array, array + ARRAY_SIZE); - ::vtkm::cont::internal::ArrayPortalFromIterators const_portal(array, array + - ARRAY_SIZE); + ::vtkm::cont::internal::ArrayPortalFromIterators const_portal( + array, array + ARRAY_SIZE); std::cout << " Test read from iterator." << std::endl; TestIteratorRead(portal); diff --git a/vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.cxx b/vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.cxx index 5d57163f5..f60eb1b09 100644 --- a/vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.cxx +++ b/vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.cxx @@ -26,7 +26,8 @@ namespace cont { void DeviceAdapterAlgorithm::ScheduleTask( - vtkm::exec::serial::internal::TaskTiling1D& functor, vtkm::Id size) + vtkm::exec::serial::internal::TaskTiling1D& functor, + vtkm::Id size) { const vtkm::Id MESSAGE_SIZE = 1024; char errorString[MESSAGE_SIZE]; @@ -50,7 +51,8 @@ void DeviceAdapterAlgorithm::ScheduleTask( } void DeviceAdapterAlgorithm::ScheduleTask( - vtkm::exec::serial::internal::TaskTiling3D& functor, vtkm::Id3 size) + vtkm::exec::serial::internal::TaskTiling3D& functor, + vtkm::Id3 size) { const vtkm::Id MESSAGE_SIZE = 1024; char errorString[MESSAGE_SIZE]; diff --git a/vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.h b/vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.h index 06b89a2b8..b9ebca96e 100644 --- a/vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.h +++ b/vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.h @@ -57,7 +57,8 @@ public: } template - VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, U initialValue, + VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, + U initialValue, BinaryFunctor binary_functor) { typedef typename vtkm::cont::ArrayHandle::template ExecutionTypes::PortalConst @@ -66,11 +67,17 @@ public: internal::WrappedBinaryOperator wrappedOp(binary_functor); PortalIn inputPortal = input.PrepareForInput(Device()); return std::accumulate(vtkm::cont::ArrayPortalToIteratorBegin(inputPortal), - vtkm::cont::ArrayPortalToIteratorEnd(inputPortal), initialValue, + vtkm::cont::ArrayPortalToIteratorEnd(inputPortal), + initialValue, wrappedOp); } - template VTKM_CONT static void ReduceByKey(const vtkm::cont::ArrayHandle& keys, const vtkm::cont::ArrayHandle& values, @@ -181,7 +188,8 @@ public: std::partial_sum(vtkm::cont::ArrayPortalToIteratorBegin(inputPortal), vtkm::cont::ArrayPortalToIteratorEnd(inputPortal), - vtkm::cont::ArrayPortalToIteratorBegin(outputPortal), wrappedBinaryOp); + vtkm::cont::ArrayPortalToIteratorBegin(outputPortal), + wrappedBinaryOp); // Return the value at the last index in the array, which is the full sum. return outputPortal.Get(numberOfValues - 1); @@ -190,7 +198,8 @@ public: template VTKM_CONT static T ScanExclusive(const vtkm::cont::ArrayHandle& input, vtkm::cont::ArrayHandle& output, - BinaryFunctor binaryFunctor, const T& initialValue) + BinaryFunctor binaryFunctor, + const T& initialValue) { typedef typename vtkm::cont::ArrayHandle::template ExecutionTypes::Portal PortalOut; @@ -225,7 +234,8 @@ public: std::partial_sum(vtkm::cont::ArrayPortalToIteratorBegin(outputPortal), vtkm::cont::ArrayPortalToIteratorEnd(outputPortal), - vtkm::cont::ArrayPortalToIteratorBegin(outputPortal), wrappedBinaryOp); + vtkm::cont::ArrayPortalToIteratorBegin(outputPortal), + wrappedBinaryOp); return wrappedBinaryOp(outputPortal.Get(numberOfValues - 1), lastValue); } @@ -257,7 +267,11 @@ public: } private: - template VTKM_CONT static void Scatter(vtkm::cont::ArrayHandle& values, vtkm::cont::ArrayHandle& index, diff --git a/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.cxx b/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.cxx index 780a6c1fb..b47fb7d37 100644 --- a/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.cxx +++ b/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.cxx @@ -26,7 +26,8 @@ namespace cont { void DeviceAdapterAlgorithm::ScheduleTask( - vtkm::exec::tbb::internal::TaskTiling1D& functor, vtkm::Id size) + vtkm::exec::tbb::internal::TaskTiling1D& functor, + vtkm::Id size) { const vtkm::Id MESSAGE_SIZE = 1024; char errorString[MESSAGE_SIZE]; @@ -46,7 +47,8 @@ void DeviceAdapterAlgorithm::ScheduleTask( } void DeviceAdapterAlgorithm::ScheduleTask( - vtkm::exec::tbb::internal::TaskTiling3D& functor, vtkm::Id3 size) + vtkm::exec::tbb::internal::TaskTiling3D& functor, + vtkm::Id3 size) { static const vtkm::UInt32 TBB_GRAIN_SIZE_3D[3] = { 1, 4, 256 }; const vtkm::Id MESSAGE_SIZE = 1024; @@ -57,8 +59,15 @@ void DeviceAdapterAlgorithm::ScheduleTask( //memory is generally setup in a way that iterating the first range //in the tightest loop has the best cache coherence. - ::tbb::blocked_range3d range(0, size[2], TBB_GRAIN_SIZE_3D[0], 0, size[1], - TBB_GRAIN_SIZE_3D[1], 0, size[0], TBB_GRAIN_SIZE_3D[2]); + ::tbb::blocked_range3d range(0, + size[2], + TBB_GRAIN_SIZE_3D[0], + 0, + size[1], + TBB_GRAIN_SIZE_3D[1], + 0, + size[0], + TBB_GRAIN_SIZE_3D[2]); ::tbb::parallel_for(range, [&](const ::tbb::blocked_range3d& r) { for (vtkm::Id k = r.pages().begin(); k != r.pages().end(); ++k) { diff --git a/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h b/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h index 162dcd978..f6b027835 100644 --- a/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h +++ b/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h @@ -41,7 +41,8 @@ namespace cont template <> struct DeviceAdapterAlgorithm : vtkm::cont::internal::DeviceAdapterAlgorithmGeneral< - DeviceAdapterAlgorithm, vtkm::cont::DeviceAdapterTagTBB> + DeviceAdapterAlgorithm, + vtkm::cont::DeviceAdapterTagTBB> { public: template @@ -51,11 +52,12 @@ public: } template - VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, U initialValue, + VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle& input, + U initialValue, BinaryFunctor binary_functor) { - return tbb::ReducePortals(input.PrepareForInput(vtkm::cont::DeviceAdapterTagTBB()), - initialValue, binary_functor); + return tbb::ReducePortals( + input.PrepareForInput(vtkm::cont::DeviceAdapterTagTBB()), initialValue, binary_functor); } template @@ -86,18 +88,21 @@ public: return tbb::ScanExclusivePortals( input.PrepareForInput(vtkm::cont::DeviceAdapterTagTBB()), output.PrepareForOutput(input.GetNumberOfValues(), vtkm::cont::DeviceAdapterTagTBB()), - vtkm::Add(), vtkm::TypeTraits::ZeroInitialization()); + vtkm::Add(), + vtkm::TypeTraits::ZeroInitialization()); } template VTKM_CONT static T ScanExclusive(const vtkm::cont::ArrayHandle& input, vtkm::cont::ArrayHandle& output, - BinaryFunctor binary_functor, const T& initialValue) + BinaryFunctor binary_functor, + const T& initialValue) { return tbb::ScanExclusivePortals( input.PrepareForInput(vtkm::cont::DeviceAdapterTagTBB()), output.PrepareForOutput(input.GetNumberOfValues(), vtkm::cont::DeviceAdapterTagTBB()), - binary_functor, initialValue); + binary_functor, + initialValue); } VTKM_CONT_EXPORT static void ScheduleTask(vtkm::exec::tbb::internal::TaskTiling1D& functor, @@ -151,7 +156,8 @@ public: template VTKM_CONT static void SortByKey(vtkm::cont::ArrayHandle& keys, - vtkm::cont::ArrayHandle& values, Compare comp) + vtkm::cont::ArrayHandle& values, + Compare comp) { typedef vtkm::cont::ArrayHandle KeyType; if (sizeof(U) > sizeof(vtkm::Id)) diff --git a/vtkm/cont/tbb/internal/FunctorsTBB.h b/vtkm/cont/tbb/internal/FunctorsTBB.h index 0f550a0e8..f6b799084 100644 --- a/vtkm/cont/tbb/internal/FunctorsTBB.h +++ b/vtkm/cont/tbb/internal/FunctorsTBB.h @@ -95,7 +95,8 @@ struct ReduceBody BinaryOperationType BinaryOperation; VTKM_CONT - ReduceBody(const InputPortalType& inputPortal, T initialValue, + ReduceBody(const InputPortalType& inputPortal, + T initialValue, BinaryOperationType binaryOperation) : Sum(vtkm::TypeTraits::ZeroInitialization()) , InitialValue(initialValue) @@ -166,7 +167,8 @@ struct ReduceBody VTKM_SUPPRESS_EXEC_WARNINGS template -VTKM_CONT static T ReducePortals(InputPortalType inputPortal, T initialValue, +VTKM_CONT static T ReducePortals(InputPortalType inputPortal, + T initialValue, BinaryOperationType binaryOperation) { typedef internal::WrappedBinaryOperator WrappedBinaryOp; @@ -204,7 +206,8 @@ struct ScanInclusiveBody BinaryOperationType BinaryOperation; VTKM_CONT - ScanInclusiveBody(const InputPortalType& inputPortal, const OutputPortalType& outputPortal, + ScanInclusiveBody(const InputPortalType& inputPortal, + const OutputPortalType& outputPortal, BinaryOperationType binaryOperation) : Sum(vtkm::TypeTraits::ZeroInitialization()) , FirstCall(true) @@ -292,8 +295,10 @@ struct ScanExclusiveBody BinaryOperationType BinaryOperation; VTKM_CONT - ScanExclusiveBody(const InputPortalType& inputPortal, const OutputPortalType& outputPortal, - BinaryOperationType binaryOperation, const ValueType& initialValue) + ScanExclusiveBody(const InputPortalType& inputPortal, + const OutputPortalType& outputPortal, + BinaryOperationType binaryOperation, + const ValueType& initialValue) : Sum(initialValue) , FirstCall(true) , InputPortal(inputPortal) @@ -388,7 +393,8 @@ struct ScanExclusiveBody VTKM_SUPPRESS_EXEC_WARNINGS template VTKM_CONT static typename std::remove_reference::type -ScanInclusivePortals(InputPortalType inputPortal, OutputPortalType outputPortal, +ScanInclusivePortals(InputPortalType inputPortal, + OutputPortalType outputPortal, BinaryOperationType binaryOperation) { using ValueType = typename std::remove_reference::type; @@ -409,7 +415,9 @@ VTKM_SUPPRESS_EXEC_WARNINGS template VTKM_CONT static typename std::remove_reference::type ScanExclusivePortals( - InputPortalType inputPortal, OutputPortalType outputPortal, BinaryOperationType binaryOperation, + InputPortalType inputPortal, + OutputPortalType outputPortal, + BinaryOperationType binaryOperation, typename std::remove_reference::type initialValue) { using ValueType = typename std::remove_reference::type; @@ -433,7 +441,8 @@ template -VTKM_CONT static void ScatterPortal(InputPortalType inputPortal, IndexPortalType indexPortal, +VTKM_CONT static void ScatterPortal(InputPortalType inputPortal, + IndexPortalType indexPortal, OutputPortalType outputPortal) { const vtkm::Id size = inputPortal.GetNumberOfValues(); diff --git a/vtkm/cont/tbb/internal/parallel_sort.h b/vtkm/cont/tbb/internal/parallel_sort.h index 276924671..397e50778 100644 --- a/vtkm/cont/tbb/internal/parallel_sort.h +++ b/vtkm/cont/tbb/internal/parallel_sort.h @@ -51,7 +51,9 @@ template class quick_sort_range : private no_assign { - inline size_t median_of_three(const RandomAccessIterator& array, size_t l, size_t m, + inline size_t median_of_three(const RandomAccessIterator& array, + size_t l, + size_t m, size_t r) const { return comp(array[l], array[m]) @@ -63,7 +65,8 @@ class quick_sort_range : private no_assign const quick_sort_range& range) const { size_t offset = range.size / 8u; - return median_of_three(array, median_of_three(array, 0, offset, offset * 2), + return median_of_three(array, + median_of_three(array, 0, offset, offset * 2), median_of_three(array, offset * 3, offset * 4, offset * 5), median_of_three(array, offset * 6, offset * 7, range.size - 1)); } @@ -198,14 +201,16 @@ void parallel_quick_sort(RandomAccessIterator begin, RandomAccessIterator end, c } parallel_for(blocked_range(k + 1, end), - quick_sort_pretest_body(comp), auto_partitioner(), + quick_sort_pretest_body(comp), + auto_partitioner(), my_context); if (my_context.is_group_execution_cancelled()) do_parallel_quick_sort: #endif /* __TBB_TASK_GROUP_CONTEXT */ parallel_for(quick_sort_range(begin, end - begin, comp), - quick_sort_body(), auto_partitioner()); + quick_sort_body(), + auto_partitioner()); } } // namespace internal @@ -248,8 +253,8 @@ void parallel_sort(RandomAccessIterator begin, RandomAccessIterator end, const C template inline void parallel_sort(RandomAccessIterator begin, RandomAccessIterator end) { - parallel_sort(begin, end, - std::less::value_type>()); + parallel_sort( + begin, end, std::less::value_type>()); } //! Sorts the data in the range \c [begin,end) with a default comparator \c std::less diff --git a/vtkm/cont/testing/MakeTestDataSet.h b/vtkm/cont/testing/MakeTestDataSet.h index 0a0c4e9a3..30f208b30 100644 --- a/vtkm/cont/testing/MakeTestDataSet.h +++ b/vtkm/cont/testing/MakeTestDataSet.h @@ -528,8 +528,11 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet1() coords[2] = CoordType(1, 1, 0); coords[3] = CoordType(2, 1, 0); coords[4] = CoordType(2, 2, 0); - CoordType coordinates[nVerts] = { CoordType(0, 0, 0), CoordType(1, 0, 0), CoordType(1, 1, 0), - CoordType(2, 1, 0), CoordType(2, 2, 0) }; + CoordType coordinates[nVerts] = { CoordType(0, 0, 0), + CoordType(1, 0, 0), + CoordType(1, 1, 0), + CoordType(2, 1, 0), + CoordType(2, 2, 0) }; vtkm::Float32 vars[nVerts] = { 10.1f, 20.1f, 30.2f, 40.2f, 50.3f }; dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates, nVerts)); @@ -666,8 +669,9 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet3() const int nVerts = 4; typedef vtkm::Vec CoordType; - CoordType coordinates[nVerts] = { CoordType(0, 0, 0), CoordType(1, 0, 0), CoordType(1, 0, 1), - CoordType(0, 1, 0) }; + CoordType coordinates[nVerts] = { + CoordType(0, 0, 0), CoordType(1, 0, 0), CoordType(1, 0, 1), CoordType(0, 1, 0) + }; vtkm::Float32 vars[nVerts] = { 10.1f, 10.1f, 10.2f, 30.2f }; dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates, nVerts)); diff --git a/vtkm/cont/testing/TestingArrayHandles.h b/vtkm/cont/testing/TestingArrayHandles.h index 62f0bb0d6..7ced9e0aa 100644 --- a/vtkm/cont/testing/TestingArrayHandles.h +++ b/vtkm/cont/testing/TestingArrayHandles.h @@ -257,8 +257,9 @@ private: { gotException = true; } - VTKM_TEST_ASSERT(gotException, "PrepareForOutput should fail when asked to " - "re-allocate user provided memory."); + VTKM_TEST_ASSERT(gotException, + "PrepareForOutput should fail when asked to " + "re-allocate user provided memory."); } } }; diff --git a/vtkm/cont/testing/TestingComputeRange.h b/vtkm/cont/testing/TestingComputeRange.h index 98e32eceb..1022d1698 100644 --- a/vtkm/cont/testing/TestingComputeRange.h +++ b/vtkm/cont/testing/TestingComputeRange.h @@ -39,10 +39,14 @@ namespace cont namespace testing { -struct CustomTypeList - : vtkm::ListTagBase, vtkm::Vec, vtkm::Vec, - vtkm::Vec, vtkm::Vec, vtkm::Vec, - vtkm::Vec, vtkm::Vec> +struct CustomTypeList : vtkm::ListTagBase, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec, + vtkm::Vec> { }; @@ -94,7 +98,8 @@ private: static void TestUniformCoordinateField() { - vtkm::cont::CoordinateSystem field("TestField", vtkm::Id3(10, 20, 5), + vtkm::cont::CoordinateSystem field("TestField", + vtkm::Id3(10, 20, 5), vtkm::Vec(0.0f, -5.0f, 4.0f), vtkm::Vec(1.0f, 0.5f, 2.0f)); diff --git a/vtkm/cont/testing/TestingDataSetExplicit.h b/vtkm/cont/testing/TestingDataSetExplicit.h index 6f9376956..98ec407e4 100644 --- a/vtkm/cont/testing/TestingDataSetExplicit.h +++ b/vtkm/cont/testing/TestingDataSetExplicit.h @@ -43,7 +43,8 @@ class TestingDataSetExplicit { private: template - static bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, const T* expected, + static bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, + const T* expected, vtkm::Id size) { if (size != ah.GetNumberOfValues()) @@ -104,8 +105,8 @@ private: vtkm::cont::CellSetExplicit<> cellset; ds.GetCellSet(0).CopyTo(cellset); - cellset.BuildConnectivity(DeviceAdapterTag(), vtkm::TopologyElementTagCell(), - vtkm::TopologyElementTagPoint()); + cellset.BuildConnectivity( + DeviceAdapterTag(), vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); vtkm::Id connectivitySize = 7; vtkm::Id numPoints = 5; diff --git a/vtkm/cont/testing/TestingDataSetSingleType.h b/vtkm/cont/testing/TestingDataSetSingleType.h index 0d59f818b..f89081e95 100644 --- a/vtkm/cont/testing/TestingDataSetSingleType.h +++ b/vtkm/cont/testing/TestingDataSetSingleType.h @@ -46,7 +46,8 @@ class TestingDataSetSingleType { private: template - static bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, const T* expected, + static bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, + const T* expected, vtkm::Id size) { if (size != ah.GetNumberOfValues()) @@ -112,8 +113,8 @@ private: dataSet.GetCellSet(0).CopyTo(cellset); //verify that we can compute the cell to point connectivity - cellset.BuildConnectivity(DeviceAdapterTag(), vtkm::TopologyElementTagCell(), - vtkm::TopologyElementTagPoint()); + cellset.BuildConnectivity( + DeviceAdapterTag(), vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); dataSet.PrintSummary(std::cout); diff --git a/vtkm/cont/testing/TestingDeviceAdapter.h b/vtkm/cont/testing/TestingDeviceAdapter.h index e6812c3e5..b7021fbb8 100644 --- a/vtkm/cont/testing/TestingDeviceAdapter.h +++ b/vtkm/cont/testing/TestingDeviceAdapter.h @@ -448,7 +448,8 @@ private: { std::cout << "Do array allocation that should fail." << std::endl; vtkm::cont::internal::Storage, StorageTagBasic> supportArray; - vtkm::cont::internal::ArrayManagerExecution, StorageTagBasic, + vtkm::cont::internal::ArrayManagerExecution, + StorageTagBasic, DeviceAdapterTag> bigManager(&supportArray); @@ -755,7 +756,8 @@ private: "LowerBounds returned incorrect size"); std::copy(vtkm::cont::ArrayPortalToIteratorBegin(handle.GetPortalConstControl()), - vtkm::cont::ArrayPortalToIteratorEnd(handle.GetPortalConstControl()), randomData); + vtkm::cont::ArrayPortalToIteratorEnd(handle.GetPortalConstControl()), + randomData); VTKM_TEST_ASSERT(randomData[0] == 2, "Got bad value - LowerBounds"); VTKM_TEST_ASSERT(randomData[1] == 3, "Got bad value - LowerBounds"); VTKM_TEST_ASSERT(randomData[2] == 3, "Got bad value - LowerBounds"); @@ -767,7 +769,8 @@ private: "UppererBounds returned incorrect size"); std::copy(vtkm::cont::ArrayPortalToIteratorBegin(handle1.GetPortalConstControl()), - vtkm::cont::ArrayPortalToIteratorEnd(handle1.GetPortalConstControl()), randomData); + vtkm::cont::ArrayPortalToIteratorEnd(handle1.GetPortalConstControl()), + randomData); VTKM_TEST_ASSERT(randomData[0] == 3, "Got bad value - UpperBound"); VTKM_TEST_ASSERT(randomData[1] == 4, "Got bad value - UpperBound"); VTKM_TEST_ASSERT(randomData[2] == 4, "Got bad value - UpperBound"); diff --git a/vtkm/cont/testing/TestingFancyArrayHandles.h b/vtkm/cont/testing/TestingFancyArrayHandles.h index 5145daec7..f31fd6f7d 100644 --- a/vtkm/cont/testing/TestingFancyArrayHandles.h +++ b/vtkm/cont/testing/TestingFancyArrayHandles.h @@ -157,7 +157,8 @@ private: //for each ValueType. typedef typename vtkm::cont::ArrayHandleCompositeVectorType< - vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle>::type CompositeHandleType; const ValueType value = TestValue(13, ValueType()); @@ -455,7 +456,8 @@ private: vtkm::cont::ArrayHandleCounting counting(start, ValueType(1), length); - vtkm::cont::ArrayHandleTransform, + vtkm::cont::ArrayHandleTransform, FunctorType> countingTransformed = vtkm::cont::make_ArrayHandleTransform(counting, functor); @@ -916,8 +918,10 @@ private: { }; - struct HandleTypesToTest : vtkm::ListTagBase, - vtkm::FloatDefault, vtkm::Vec> + struct HandleTypesToTest : vtkm::ListTagBase, + vtkm::FloatDefault, + vtkm::Vec> { }; diff --git a/vtkm/cont/testing/TestingImplicitFunction.h b/vtkm/cont/testing/TestingImplicitFunction.h index edaa08b13..3c4c26822 100644 --- a/vtkm/cont/testing/TestingImplicitFunction.h +++ b/vtkm/cont/testing/TestingImplicitFunction.h @@ -146,11 +146,12 @@ private: vtkm::cont::Box box({ 0.0f, -0.5f, -0.5f }, { 1.5f, 1.5f, 0.5f }); vtkm::cont::ArrayHandle values; - implicit_function_detail::EvaluateOnCoordinates(this->Input.GetCoordinateSystem(0), box, values, - device); + implicit_function_detail::EvaluateOnCoordinates( + this->Input.GetCoordinateSystem(0), box, values, device); - std::array expected = { { 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, -0.5f, 0.5f, - 0.5f } }; + std::array expected = { + { 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, -0.5f, 0.5f, 0.5f } + }; VTKM_TEST_ASSERT(implicit_function_detail::TestArrayEqual(values, expected), "Result does not match expected values"); } @@ -167,11 +168,12 @@ private: cylinder.SetRadius(1.0f); vtkm::cont::ArrayHandle values; - implicit_function_detail::EvaluateOnCoordinates(this->Input.GetCoordinateSystem(0), cylinder, - values, device); + implicit_function_detail::EvaluateOnCoordinates( + this->Input.GetCoordinateSystem(0), cylinder, values, device); - std::array expected = { { 0.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, - -1.0f } }; + std::array expected = { + { 0.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, -1.0f } + }; VTKM_TEST_ASSERT(implicit_function_detail::TestArrayEqual(values, expected), "Result does not match expected values"); } @@ -196,11 +198,12 @@ private: frustum.CreateFromPoints(points); vtkm::cont::ArrayHandle values; - implicit_function_detail::EvaluateOnCoordinates(this->Input.GetCoordinateSystem(0), frustum, - values, device); + implicit_function_detail::EvaluateOnCoordinates( + this->Input.GetCoordinateSystem(0), frustum, values, device); - std::array expected = { { 0.0f, 0.0f, 0.0f, 0.0f, 0.316228f, 0.316228f, - -0.316228f, 0.316228f } }; + std::array expected = { + { 0.0f, 0.0f, 0.0f, 0.0f, 0.316228f, 0.316228f, -0.316228f, 0.316228f } + }; VTKM_TEST_ASSERT(implicit_function_detail::TestArrayEqual(values, expected), "Result does not match expected values"); } @@ -214,18 +217,20 @@ private: vtkm::cont::Plane plane({ 0.5f, 0.5f, 0.5f }, { 1.0f, 0.0f, 1.0f }); vtkm::cont::ArrayHandle values; - implicit_function_detail::EvaluateOnCoordinates(this->Input.GetCoordinateSystem(0), plane, - values, device); - std::array expected1 = { { -1.0f, 0.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, - 0.0f } }; + implicit_function_detail::EvaluateOnCoordinates( + this->Input.GetCoordinateSystem(0), plane, values, device); + std::array expected1 = { + { -1.0f, 0.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f } + }; VTKM_TEST_ASSERT(implicit_function_detail::TestArrayEqual(values, expected1), "Result does not match expected values"); plane.SetNormal({ -1.0f, 0.0f, -1.0f }); - implicit_function_detail::EvaluateOnCoordinates(this->Input.GetCoordinateSystem(0), plane, - values, device); - std::array expected2 = { { 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, -1.0f, - 0.0f } }; + implicit_function_detail::EvaluateOnCoordinates( + this->Input.GetCoordinateSystem(0), plane, values, device); + std::array expected2 = { + { 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, -1.0f, 0.0f } + }; VTKM_TEST_ASSERT(implicit_function_detail::TestArrayEqual(values, expected2), "Result does not match expected values"); } @@ -238,11 +243,12 @@ private: vtkm::cont::Sphere sphere({ 0.0f, 0.0f, 0.0f }, 1.0f); vtkm::cont::ArrayHandle values; - implicit_function_detail::EvaluateOnCoordinates(this->Input.GetCoordinateSystem(0), sphere, - values, device); + implicit_function_detail::EvaluateOnCoordinates( + this->Input.GetCoordinateSystem(0), sphere, values, device); - std::array expected = { { -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 2.0f, - 1.0f } }; + std::array expected = { + { -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 2.0f, 1.0f } + }; VTKM_TEST_ASSERT(implicit_function_detail::TestArrayEqual(values, expected), "Result does not match expected values"); } diff --git a/vtkm/cont/testing/TestingVirtualObjectCache.h b/vtkm/cont/testing/TestingVirtualObjectCache.h index 3a5118a6f..c11dcf22a 100644 --- a/vtkm/cont/testing/TestingVirtualObjectCache.h +++ b/vtkm/cont/testing/TestingVirtualObjectCache.h @@ -85,7 +85,8 @@ class TestingVirtualObjectCache { private: using FloatArrayHandle = vtkm::cont::ArrayHandle; - using ArrayTransform = vtkm::cont::ArrayHandleTransform; using TransformerCache = vtkm::cont::VirtualObjectCache; @@ -133,7 +134,8 @@ private: class TestStage2 { public: - TestStage2(const FloatArrayHandle& input, virtual_object_detail::Multiply& mul, + TestStage2(const FloatArrayHandle& input, + virtual_object_detail::Multiply& mul, TransformerCache& manager) : Input(&input) , Mul(&mul) diff --git a/vtkm/cont/testing/UnitTestArrayHandleCartesianProduct.cxx b/vtkm/cont/testing/UnitTestArrayHandleCartesianProduct.cxx index 848d051b3..bd87cfb27 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleCartesianProduct.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleCartesianProduct.cxx @@ -35,11 +35,13 @@ namespace ArrayHandleCartesianProductNamespace typedef vtkm::cont::DeviceAdapterAlgorithm DFA; template -void ArrayHandleCPBasic(vtkm::cont::ArrayHandle x, vtkm::cont::ArrayHandle y, +void ArrayHandleCPBasic(vtkm::cont::ArrayHandle x, + vtkm::cont::ArrayHandle y, vtkm::cont::ArrayHandle z) { - vtkm::cont::ArrayHandleCartesianProduct, vtkm::cont::ArrayHandle, + vtkm::cont::ArrayHandleCartesianProduct, + vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle> cpArray; @@ -62,7 +64,8 @@ void ArrayHandleCPBasic(vtkm::cont::ArrayHandle x, vtkm::cont::ArrayHandle vtkm::Id idx1 = (i % (nx * ny)) / nx; vtkm::Id idx2 = i / (nx * ny); - val = vtkm::Vec(x.GetPortalConstControl().Get(idx0), y.GetPortalConstControl().Get(idx1), + val = vtkm::Vec(x.GetPortalConstControl().Get(idx0), + y.GetPortalConstControl().Get(idx1), z.GetPortalConstControl().Get(idx2)); VTKM_TEST_ASSERT(test_equal(cpArray.GetPortalConstControl().Get(i), val), "Wrong value in array"); @@ -93,7 +96,8 @@ void RunTest() createArr(Y, nY); createArr(Z, nZ); - ArrayHandleCPBasic(vtkm::cont::make_ArrayHandle(X), vtkm::cont::make_ArrayHandle(Y), + ArrayHandleCPBasic(vtkm::cont::make_ArrayHandle(X), + vtkm::cont::make_ArrayHandle(Y), vtkm::cont::make_ArrayHandle(Z)); } } diff --git a/vtkm/cont/testing/UnitTestArrayHandleCompositeVector.cxx b/vtkm/cont/testing/UnitTestArrayHandleCompositeVector.cxx index cbd298e6a..3b300a9ee 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleCompositeVector.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleCompositeVector.cxx @@ -61,8 +61,8 @@ vtkm::cont::ArrayHandle MakeInputArray(int arrayId) for (vtkm::IdComponent componentIndex = 0; componentIndex < VTraits::NUM_COMPONENTS; componentIndex++) { - VTraits::SetComponent(buffer[index], componentIndex, - TestValue3Ids(index, componentIndex, arrayId)); + VTraits::SetComponent( + buffer[index], componentIndex, TestValue3Ids(index, componentIndex, arrayId)); } } @@ -82,7 +82,8 @@ vtkm::cont::ArrayHandle MakeInputArray(int arrayId) template void CheckArray(const vtkm::cont::ArrayHandle& outArray, - const vtkm::IdComponent* inComponents, const int* inArrayIds) + const vtkm::IdComponent* inComponents, + const int* inArrayIds) { // ArrayHandleCompositeVector currently does not implement the ability to // get to values on the control side, so copy to an array that is accessible. @@ -146,10 +147,16 @@ void TryVector4(vtkm::cont::ArrayHandle array1, for (inComponents[3] = 0; inComponents[3] < vtkm::VecTraits::NUM_COMPONENTS; inComponents[3]++) { - CheckArray(vtkm::cont::make_ArrayHandleCompositeVector( - array1, inComponents[0], array2, inComponents[1], array3, inComponents[2], - array4, inComponents[3]), - inComponents, arrayIds); + CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(array1, + inComponents[0], + array2, + inComponents[1], + array3, + inComponents[2], + array4, + inComponents[3]), + inComponents, + arrayIds); } } } @@ -175,7 +182,8 @@ void TryVector3(vtkm::cont::ArrayHandle array1, { CheckArray(vtkm::cont::make_ArrayHandleCompositeVector( array1, inComponents[0], array2, inComponents[1], array3, inComponents[2]), - inComponents, arrayIds); + inComponents, + arrayIds); } } } @@ -199,9 +207,10 @@ void TryVector2(vtkm::cont::ArrayHandle array1, for (inComponents[1] = 0; inComponents[1] < vtkm::VecTraits::NUM_COMPONENTS; inComponents[1]++) { - CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(array1, inComponents[0], array2, - inComponents[1]), - inComponents, arrayIds); + CheckArray(vtkm::cont::make_ArrayHandleCompositeVector( + array1, inComponents[0], array2, inComponents[1]), + inComponents, + arrayIds); } } @@ -220,8 +229,8 @@ void TryVector1(vtkm::cont::ArrayHandle array1) for (inComponents[0] = 0; inComponents[0] < vtkm::VecTraits::NUM_COMPONENTS; inComponents[0]++) { - CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(array1, inComponents[0]), inComponents, - arrayIds); + CheckArray( + vtkm::cont::make_ArrayHandleCompositeVector(array1, inComponents[0]), inComponents, arrayIds); } std::cout << " Second component from Scalar." << std::endl; diff --git a/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx b/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx index 494edd98c..69ce9b80c 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx @@ -90,9 +90,9 @@ struct TemplatedTests { typedef vtkm::cont::ArrayHandleCounting ArrayHandleType; - typedef vtkm::cont::ArrayHandle< - ValueType, typename vtkm::cont::internal::ArrayHandleCountingTraits::Tag> - ArrayHandleType2; + typedef vtkm::cont:: + ArrayHandle::Tag> + ArrayHandleType2; typedef typename ArrayHandleType::PortalConstControl PortalType; diff --git a/vtkm/cont/testing/UnitTestArrayHandleTransform.cxx b/vtkm/cont/testing/UnitTestArrayHandleTransform.cxx index 039ac8626..daf39fbae 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleTransform.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleTransform.cxx @@ -71,7 +71,8 @@ VTKM_CONT CheckTransformFunctor< typename OriginalArrayHandleType::template ExecutionTypes::PortalConst, typename TransformedArrayHandleType::template ExecutionTypes::PortalConst> make_CheckTransformFunctor(const OriginalArrayHandleType& originalArray, - const TransformedArrayHandleType& transformedArray, Device) + const TransformedArrayHandleType& transformedArray, + Device) { typedef typename OriginalArrayHandleType::template ExecutionTypes::PortalConst OriginalPortalType; @@ -116,12 +117,14 @@ struct TransformTests typedef typename vtkm::VecTraits::ComponentType OutputValueType; typedef MySquare FunctorType; - typedef vtkm::cont::ArrayHandleTransform, + typedef vtkm::cont::ArrayHandleTransform, FunctorType> TransformHandle; - typedef vtkm::cont::ArrayHandleTransform< - OutputValueType, vtkm::cont::ArrayHandleCounting, FunctorType> + typedef vtkm::cont::ArrayHandleTransform, + FunctorType> CountingTransformHandle; typedef VTKM_DEFAULT_DEVICE_ADAPTER_TAG Device; diff --git a/vtkm/cont/testing/UnitTestArrayPortalToIterators.cxx b/vtkm/cont/testing/UnitTestArrayPortalToIterators.cxx index d7c36c60e..732ab9360 100644 --- a/vtkm/cont/testing/UnitTestArrayPortalToIterators.cxx +++ b/vtkm/cont/testing/UnitTestArrayPortalToIterators.cxx @@ -134,7 +134,8 @@ struct TemplatedTests std::cout << " Testing read-only iterators with convenience functions." << std::endl; CheckIterator(vtkm::cont::ArrayPortalToIteratorBegin(portal), - vtkm::cont::ArrayPortalToIteratorEnd(portal), READ_VALUE); + vtkm::cont::ArrayPortalToIteratorEnd(portal), + READ_VALUE); } void TestIteratorWrite() @@ -151,7 +152,8 @@ struct TemplatedTests std::cout << " Testing write-only iterators with convenience functions." << std::endl; FillIterator(vtkm::cont::ArrayPortalToIteratorBegin(portal), - vtkm::cont::ArrayPortalToIteratorEnd(portal), WRITE_VALUE); + vtkm::cont::ArrayPortalToIteratorEnd(portal), + WRITE_VALUE); } void operator()() diff --git a/vtkm/cont/testing/UnitTestDataSetBuilderExplicit.cxx b/vtkm/cont/testing/UnitTestDataSetBuilderExplicit.cxx index 2ad0c910f..d2a8632ea 100644 --- a/vtkm/cont/testing/UnitTestDataSetBuilderExplicit.cxx +++ b/vtkm/cont/testing/UnitTestDataSetBuilderExplicit.cxx @@ -46,7 +46,9 @@ vtkm::Bounds ComputeBounds(std::size_t numPoints, const T* coords) return bounds; } -void ValidateDataSet(const vtkm::cont::DataSet& ds, vtkm::Id numPoints, vtkm::Id numCells, +void ValidateDataSet(const vtkm::cont::DataSet& ds, + vtkm::Id numPoints, + vtkm::Id numCells, const vtkm::Bounds& bounds) { //Verify basics.. @@ -101,9 +103,13 @@ vtkm::cont::ArrayHandle createAH(std::size_t n, const T* data) } template -vtkm::cont::DataSet CreateDataSetArr(bool useSeparatedCoords, std::size_t numPoints, - const T* coords, std::size_t numCells, std::size_t numConn, - const vtkm::Id* conn, const vtkm::IdComponent* indices, +vtkm::cont::DataSet CreateDataSetArr(bool useSeparatedCoords, + std::size_t numPoints, + const T* coords, + std::size_t numCells, + std::size_t numConn, + const vtkm::Id* conn, + const vtkm::IdComponent* indices, const vtkm::UInt8* shape) { vtkm::cont::DataSet dataSet; @@ -130,8 +136,8 @@ vtkm::cont::DataSet CreateDataSetArr(bool useSeparatedCoords, std::size_t numPoi DFA::Copy(vtkm::cont::make_ArrayHandle(zvals), Z); DFA::Copy(vtkm::cont::make_ArrayHandle(varP), P); DFA::Copy(vtkm::cont::make_ArrayHandle(varC), C); - dataSet = dsb.Create(X, Y, Z, createAH(numCells, shape), createAH(numCells, indices), - createAH(numConn, conn)); + dataSet = dsb.Create( + X, Y, Z, createAH(numCells, shape), createAH(numCells, indices), createAH(numConn, conn)); dsf.AddPointField(dataSet, "pointvar", P); dsf.AddCellField(dataSet, "cellvar", C); return dataSet; @@ -153,8 +159,8 @@ vtkm::cont::DataSet CreateDataSetArr(bool useSeparatedCoords, std::size_t numPoi } vtkm::cont::ArrayHandle> pts; DFA::Copy(vtkm::cont::make_ArrayHandle(tmp), pts); - dataSet = dsb.Create(pts, createAH(numCells, shape), createAH(numCells, indices), - createAH(numConn, conn)); + dataSet = dsb.Create( + pts, createAH(numCells, shape), createAH(numCells, indices), createAH(numConn, conn)); dsf.AddPointField(dataSet, "pointvar", varP); dsf.AddCellField(dataSet, "cellvar", varC); return dataSet; @@ -162,9 +168,13 @@ vtkm::cont::DataSet CreateDataSetArr(bool useSeparatedCoords, std::size_t numPoi } template -vtkm::cont::DataSet CreateDataSetVec(bool useSeparatedCoords, std::size_t numPoints, - const T* coords, std::size_t numCells, std::size_t numConn, - const vtkm::Id* conn, const vtkm::IdComponent* indices, +vtkm::cont::DataSet CreateDataSetVec(bool useSeparatedCoords, + std::size_t numPoints, + const T* coords, + std::size_t numCells, + std::size_t numConn, + const vtkm::Id* conn, + const vtkm::IdComponent* indices, const vtkm::UInt8* shape) { vtkm::cont::DataSet dataSet; @@ -185,8 +195,8 @@ vtkm::cont::DataSet CreateDataSetVec(bool useSeparatedCoords, std::size_t numPoi { varC[i] = static_cast(i * 1.1f); } - dataSet = dsb.Create(X, Y, Z, createVec(numCells, shape), createVec(numCells, indices), - createVec(numConn, conn)); + dataSet = dsb.Create( + X, Y, Z, createVec(numCells, shape), createVec(numCells, indices), createVec(numConn, conn)); dsf.AddPointField(dataSet, "pointvar", varP); dsf.AddCellField(dataSet, "cellvar", varC); return dataSet; @@ -206,8 +216,8 @@ vtkm::cont::DataSet CreateDataSetVec(bool useSeparatedCoords, std::size_t numPoi { varC[i][0] = static_cast(i * 1.1f); } - dataSet = dsb.Create(pts, createVec(numCells, shape), createVec(numCells, indices), - createVec(numConn, conn)); + dataSet = dsb.Create( + pts, createVec(numCells, shape), createVec(numCells, indices), createVec(numConn, conn)); dsf.AddPointField(dataSet, "pointvar", varP); dsf.AddCellField(dataSet, "cellvar", varC); return dataSet; diff --git a/vtkm/cont/testing/UnitTestDataSetBuilderRectilinear.cxx b/vtkm/cont/testing/UnitTestDataSetBuilderRectilinear.cxx index 8b17bbe10..f269ec5af 100644 --- a/vtkm/cont/testing/UnitTestDataSetBuilderRectilinear.cxx +++ b/vtkm/cont/testing/UnitTestDataSetBuilderRectilinear.cxx @@ -35,7 +35,10 @@ namespace DataSetBuilderRectilinearNamespace std::mt19937 g_RandomGenerator; -void ValidateDataSet(const vtkm::cont::DataSet& ds, int dim, vtkm::Id numPoints, vtkm::Id numCells, +void ValidateDataSet(const vtkm::cont::DataSet& ds, + int dim, + vtkm::Id numPoints, + vtkm::Id numCells, const vtkm::Bounds& bounds) { //Verify basics.. @@ -141,8 +144,8 @@ void RectilinearTests() { std::cout << "Trial " << trial << std::endl; - vtkm::Id3 dimensions(randomDim(g_RandomGenerator), randomDim(g_RandomGenerator), - randomDim(g_RandomGenerator)); + vtkm::Id3 dimensions( + randomDim(g_RandomGenerator), randomDim(g_RandomGenerator), randomDim(g_RandomGenerator)); std::cout << "Dimensions: " << dimensions << std::endl; vtkm::IdComponent fillMethodX = randomFill(g_RandomGenerator); @@ -216,8 +219,8 @@ void RectilinearTests() ValidateDataSet(dataSet, ndims, numPoints, numCells, bounds); std::cout << " Create with C array" << std::endl; - dataSet = dataSetBuilder.Create(dimensions[0], dimensions[1], &xCoordinates.front(), - &yCoordinates.front()); + dataSet = dataSetBuilder.Create( + dimensions[0], dimensions[1], &xCoordinates.front(), &yCoordinates.front()); dsf.AddPointField(dataSet, "pointvar", &varP2D.front(), numPoints); dsf.AddCellField(dataSet, "cellvar", &varC2D.front(), numCells); ValidateDataSet(dataSet, ndims, numPoints, numCells, bounds); @@ -258,9 +261,12 @@ void RectilinearTests() ValidateDataSet(dataSet, ndims, numPoints, numCells, bounds); std::cout << " Create with C array" << std::endl; - dataSet = - dataSetBuilder.Create(dimensions[0], dimensions[1], dimensions[2], &xCoordinates.front(), - &yCoordinates.front(), &zCoordinates.front()); + dataSet = dataSetBuilder.Create(dimensions[0], + dimensions[1], + dimensions[2], + &xCoordinates.front(), + &yCoordinates.front(), + &zCoordinates.front()); dsf.AddPointField(dataSet, "pointvar", vtkm::cont::make_ArrayHandle(varP3D)); dsf.AddCellField(dataSet, "cellvar", vtkm::cont::make_ArrayHandle(varC3D)); ValidateDataSet(dataSet, ndims, numPoints, numCells, bounds); diff --git a/vtkm/cont/testing/UnitTestDataSetBuilderUniform.cxx b/vtkm/cont/testing/UnitTestDataSetBuilderUniform.cxx index 92e0062a1..a5b4ee4ea 100644 --- a/vtkm/cont/testing/UnitTestDataSetBuilderUniform.cxx +++ b/vtkm/cont/testing/UnitTestDataSetBuilderUniform.cxx @@ -36,7 +36,10 @@ namespace DataSetBuilderUniformNamespace std::mt19937 g_RandomGenerator; -void ValidateDataSet(const vtkm::cont::DataSet& ds, int dim, vtkm::Id numPoints, vtkm::Id numCells, +void ValidateDataSet(const vtkm::cont::DataSet& ds, + int dim, + vtkm::Id numPoints, + vtkm::Id numCells, vtkm::Bounds bounds) { //Verify basics.. @@ -158,8 +161,8 @@ void UniformTests() { std::cout << "Trial " << trial << std::endl; - vtkm::Id3 dimensions(randomDim(g_RandomGenerator), randomDim(g_RandomGenerator), - randomDim(g_RandomGenerator)); + vtkm::Id3 dimensions( + randomDim(g_RandomGenerator), randomDim(g_RandomGenerator), randomDim(g_RandomGenerator)); vtkm::IdComponent fillMethodX = randomFill(g_RandomGenerator); vtkm::IdComponent fillMethodY = randomFill(g_RandomGenerator); diff --git a/vtkm/cont/testing/UnitTestDataSetPermutation.cxx b/vtkm/cont/testing/UnitTestDataSetPermutation.cxx index 1b57c5f6c..c37657f71 100644 --- a/vtkm/cont/testing/UnitTestDataSetPermutation.cxx +++ b/vtkm/cont/testing/UnitTestDataSetPermutation.cxx @@ -34,7 +34,8 @@ namespace { template -bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, const T* expected, +bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, + const T* expected, vtkm::Id size) { if (size != ah.GetNumberOfValues()) @@ -118,9 +119,9 @@ void TestDataSet_Explicit() vtkm::TopologyElementTagCell>::ExecObjectType ExecObjectType; ExecObjectType execConnectivity; - execConnectivity = - subset.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); + execConnectivity = subset.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagPoint(), + vtkm::TopologyElementTagCell()); //run a basic for-each topology algorithm on this vtkm::cont::ArrayHandle result; @@ -162,8 +163,8 @@ void TestDataSet_Structured2D() typedef vtkm::cont::DeviceAdapterTagSerial DeviceAdapterTag; //verify that PrepareForInput exists - subset.PrepareForInput(DeviceAdapterTag(), vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); + subset.PrepareForInput( + DeviceAdapterTag(), vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); //run a basic for-each topology algorithm on this vtkm::cont::ArrayHandle result; @@ -201,7 +202,8 @@ void TestDataSet_Structured3D() subset.PrintSummary(std::cout); //verify that PrepareForInput exists - subset.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagPoint(), + subset.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); //run a basic for-each topology algorithm on this diff --git a/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx b/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx index b8ae8d2c2..f37ea58dc 100644 --- a/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx +++ b/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx @@ -88,13 +88,13 @@ static void TwoDimRectilinearTest() } vtkm::exec::ConnectivityStructured - pointToCell = - cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); + pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagPoint(), + vtkm::TopologyElementTagCell()); vtkm::exec::ConnectivityStructured - cellToPoint = - cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagCell(), - vtkm::TopologyElementTagPoint()); + cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint()); vtkm::Id cells[2][4] = { { 0, 1, 4, 3 }, { 1, 2, 5, 4 } }; for (vtkm::Id cellIndex = 0; cellIndex < 2; cellIndex++) @@ -176,9 +176,9 @@ static void ThreeDimRectilinearTest() //Test regular connectivity. vtkm::exec::ConnectivityStructured - pointToCell = - cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); + pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagPoint(), + vtkm::TopologyElementTagCell()); vtkm::Id expectedPointIds[8] = { 0, 1, 4, 3, 6, 7, 10, 9 }; vtkm::Vec retrievedPointIds = pointToCell.GetIndices(vtkm::Id3(0)); for (vtkm::IdComponent localPointIndex = 0; localPointIndex < 8; localPointIndex++) @@ -188,15 +188,16 @@ static void ThreeDimRectilinearTest() } vtkm::exec::ConnectivityStructured - cellToPoint = - cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagCell(), - vtkm::TopologyElementTagPoint()); + cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint()); vtkm::Id retrievedCellIds[6] = { 0, -1, -1, -1, -1, -1 }; vtkm::VecVariable expectedCellIds = cellToPoint.GetIndices(vtkm::Id3(0)); VTKM_TEST_ASSERT(expectedCellIds.GetNumberOfComponents() <= 6, "Got unexpected number of cell ids"); for (vtkm::IdComponent localPointIndex = 0; - localPointIndex < expectedCellIds.GetNumberOfComponents(); localPointIndex++) + localPointIndex < expectedCellIds.GetNumberOfComponents(); + localPointIndex++) { VTKM_TEST_ASSERT(expectedCellIds[localPointIndex] == retrievedCellIds[localPointIndex], "Incorrect cell ID for point"); diff --git a/vtkm/cont/testing/UnitTestDataSetUniform.cxx b/vtkm/cont/testing/UnitTestDataSetUniform.cxx index 368ccdb9d..609305e6c 100644 --- a/vtkm/cont/testing/UnitTestDataSetUniform.cxx +++ b/vtkm/cont/testing/UnitTestDataSetUniform.cxx @@ -91,13 +91,13 @@ static void TwoDimUniformTest() } vtkm::exec::ConnectivityStructured - pointToCell = - cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); + pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagPoint(), + vtkm::TopologyElementTagCell()); vtkm::exec::ConnectivityStructured - cellToPoint = - cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagCell(), - vtkm::TopologyElementTagPoint()); + cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint()); vtkm::Id cells[2][4] = { { 0, 1, 4, 3 }, { 1, 2, 5, 4 } }; for (vtkm::Id cellIndex = 0; cellIndex < 2; cellIndex++) @@ -186,9 +186,9 @@ static void ThreeDimUniformTest() //Test uniform connectivity. vtkm::exec::ConnectivityStructured - pointToCell = - cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); + pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagPoint(), + vtkm::TopologyElementTagCell()); vtkm::Id expectedPointIds[8] = { 0, 1, 4, 3, 6, 7, 10, 9 }; vtkm::Vec retrievedPointIds = pointToCell.GetIndices(vtkm::Id3(0)); for (vtkm::IdComponent localPointIndex = 0; localPointIndex < 8; localPointIndex++) @@ -198,15 +198,16 @@ static void ThreeDimUniformTest() } vtkm::exec::ConnectivityStructured - cellToPoint = - cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagCell(), - vtkm::TopologyElementTagPoint()); + cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint()); vtkm::Id retrievedCellIds[6] = { 0, -1, -1, -1, -1, -1 }; vtkm::VecVariable expectedCellIds = cellToPoint.GetIndices(vtkm::Id3(0)); VTKM_TEST_ASSERT(expectedCellIds.GetNumberOfComponents() <= 6, "Got unexpected number of cell ids"); for (vtkm::IdComponent localPointIndex = 0; - localPointIndex < expectedCellIds.GetNumberOfComponents(); localPointIndex++) + localPointIndex < expectedCellIds.GetNumberOfComponents(); + localPointIndex++) { VTKM_TEST_ASSERT(expectedCellIds[localPointIndex] == retrievedCellIds[localPointIndex], "Incorrect cell ID for point"); diff --git a/vtkm/cont/testing/UnitTestDeviceAdapterAlgorithmGeneral.cxx b/vtkm/cont/testing/UnitTestDeviceAdapterAlgorithmGeneral.cxx index 56f2988fa..2f7e5d034 100644 --- a/vtkm/cont/testing/UnitTestDeviceAdapterAlgorithmGeneral.cxx +++ b/vtkm/cont/testing/UnitTestDeviceAdapterAlgorithmGeneral.cxx @@ -72,11 +72,13 @@ namespace internal template class ArrayManagerExecution - : public vtkm::cont::internal::ArrayManagerExecution { public: - typedef vtkm::cont::internal::ArrayManagerExecution Superclass; typedef typename Superclass::ValueType ValueType; @@ -90,7 +92,8 @@ public: }; template -struct VirtualObjectTransfer : public VirtualObjectTransferShareWithControl { diff --git a/vtkm/exec/CellDerivative.h b/vtkm/exec/CellDerivative.h index 20f800fa5..daeab3a8e 100644 --- a/vtkm/exec/CellDerivative.h +++ b/vtkm/exec/CellDerivative.h @@ -53,7 +53,8 @@ namespace // vector [ds/du, ds/dv, ds/dw]. template VTKM_EXEC vtkm::Vec ParametricDerivative( - const FieldVecType& field, const vtkm::Vec& pcoords, + const FieldVecType& field, + const vtkm::Vec& pcoords, vtkm::CellShapeTagHexahedron) { typedef typename FieldVecType::ComponentType FieldType; @@ -76,7 +77,8 @@ VTKM_EXEC vtkm::Vec ParametricDerivativ template VTKM_EXEC vtkm::Vec ParametricDerivative( - const FieldVecType& field, const vtkm::Vec& pcoords, + const FieldVecType& field, + const vtkm::Vec& pcoords, vtkm::CellShapeTagWedge) { #if 0 @@ -92,14 +94,15 @@ VTKM_EXEC vtkm::Vec ParametricDerivativ return parametricDerivative; #else - return ParametricDerivative(vtkm::exec::internal::PermuteWedgeToHex(field), pcoords, - vtkm::CellShapeTagHexahedron()); + return ParametricDerivative( + vtkm::exec::internal::PermuteWedgeToHex(field), pcoords, vtkm::CellShapeTagHexahedron()); #endif } template VTKM_EXEC vtkm::Vec ParametricDerivative( - const FieldVecType& field, const vtkm::Vec& pcoords, + const FieldVecType& field, + const vtkm::Vec& pcoords, vtkm::CellShapeTagPyramid) { #if 0 @@ -115,8 +118,8 @@ VTKM_EXEC vtkm::Vec ParametricDerivativ return parametricDerivative; #else - return ParametricDerivative(vtkm::exec::internal::PermutePyramidToHex(field), pcoords, - vtkm::CellShapeTagHexahedron()); + return ParametricDerivative( + vtkm::exec::internal::PermutePyramidToHex(field), pcoords, vtkm::CellShapeTagHexahedron()); #endif } @@ -128,7 +131,8 @@ VTKM_EXEC vtkm::Vec ParametricDerivativ template VTKM_EXEC vtkm::Vec ParametricDerivative( - const FieldVecType& field, const vtkm::Vec& pcoords, + const FieldVecType& field, + const vtkm::Vec& pcoords, vtkm::CellShapeTagQuad) { typedef typename FieldVecType::ComponentType FieldType; @@ -199,11 +203,15 @@ ParametricDerivative(const FieldVecType &field, namespace detail { -template VTKM_EXEC vtkm::Vec CellDerivativeFor3DCell( - const FieldVecType& field, const WorldCoordType& wCoords, - const vtkm::Vec& pcoords, CellShapeTag) + const FieldVecType& field, + const WorldCoordType& wCoords, + const vtkm::Vec& pcoords, + CellShapeTag) { typedef typename FieldVecType::ComponentType FieldType; typedef vtkm::Vec GradientType; @@ -237,10 +245,13 @@ VTKM_EXEC vtkm::Vec CellDerivativeFor3D template VTKM_EXEC vtkm::Vec CellDerivativeFor2DCellFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, const vtkm::Vec& LUPermutation, const vtkm::Vec& pcoords, - const vtkm::exec::internal::Space2D& space, CellShapeTag, vtkm::TypeTraitsScalarTag) + const vtkm::exec::internal::Space2D& space, + CellShapeTag, + vtkm::TypeTraitsScalarTag) { // Finish solving linear equation. See CellDerivativeFor2DCell implementation // for more detail. @@ -255,10 +266,13 @@ VTKM_EXEC vtkm::Vec CellDerivativeFor2DCellFinish( template VTKM_EXEC vtkm::Vec CellDerivativeFor2DCellFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, const vtkm::Vec& LUPermutation, const vtkm::Vec& pcoords, - const vtkm::exec::internal::Space2D& space, CellShapeTag, vtkm::TypeTraitsVectorTag) + const vtkm::exec::internal::Space2D& space, + CellShapeTag, + vtkm::TypeTraitsVectorTag) { using FieldTraits = vtkm::VecTraits; using FieldComponentType = typename FieldTraits::ComponentType; @@ -266,7 +280,8 @@ VTKM_EXEC vtkm::Vec CellDerivativeFor2DCellFinish( vtkm::Vec gradient; for (vtkm::IdComponent fieldComponent = 0; - fieldComponent < FieldTraits::GetNumberOfComponents(field[0]); fieldComponent++) + fieldComponent < FieldTraits::GetNumberOfComponents(field[0]); + fieldComponent++) { vtkm::Vec subField(FieldTraits::GetComponent(field[0], fieldComponent), FieldTraits::GetComponent(field[1], fieldComponent), @@ -274,7 +289,12 @@ VTKM_EXEC vtkm::Vec CellDerivativeFor2DCellFinish( FieldTraits::GetComponent(field[3], fieldComponent)); vtkm::Vec subGradient = CellDerivativeFor2DCellFinish( - subField, LUFactorization, LUPermutation, pcoords, space, CellShapeTag(), + subField, + LUFactorization, + LUPermutation, + pcoords, + space, + CellShapeTag(), typename vtkm::TypeTraits::DimensionalityTag()); FieldTraits::SetComponent(gradient[0], fieldComponent, subGradient[0]); @@ -287,28 +307,40 @@ VTKM_EXEC vtkm::Vec CellDerivativeFor2DCellFinish( template VTKM_EXEC vtkm::Vec CellDerivativeFor2DCellFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, const vtkm::Vec& LUPermutation, const vtkm::Vec& pcoords, - const vtkm::exec::internal::Space2D& space, CellShapeTag, vtkm::TypeTraitsMatrixTag) + const vtkm::exec::internal::Space2D& space, + CellShapeTag, + vtkm::TypeTraitsMatrixTag) { - return CellDerivativeFor2DCellFinish(field, LUFactorization, LUPermutation, pcoords, space, - CellShapeTag(), vtkm::TypeTraitsVectorTag()); + return CellDerivativeFor2DCellFinish(field, + LUFactorization, + LUPermutation, + pcoords, + space, + CellShapeTag(), + vtkm::TypeTraitsVectorTag()); } -template VTKM_EXEC vtkm::Vec CellDerivativeFor2DCell( - const FieldVecType& field, const WorldCoordType& wCoords, - const vtkm::Vec& pcoords, CellShapeTag) + const FieldVecType& field, + const WorldCoordType& wCoords, + const vtkm::Vec& pcoords, + CellShapeTag) { using FieldType = typename FieldVecType::ComponentType; using BaseFieldType = typename BaseComponent::Type; // We have an underdetermined system in 3D, so create a 2D space in the // plane that the polygon sits. - vtkm::exec::internal::Space2D space(wCoords[0], wCoords[1], - wCoords[wCoords.GetNumberOfComponents() - 1]); + vtkm::exec::internal::Space2D space( + wCoords[0], wCoords[1], wCoords[wCoords.GetNumberOfComponents() - 1]); // For reasons that should become apparent in a moment, we actually want // the transpose of the Jacobian. @@ -349,7 +381,11 @@ VTKM_EXEC vtkm::Vec CellDerivativeFor2D vtkm::detail::MatrixLUPFactor(jacobianTranspose, permutation, inversionParity, valid); // MatrixLUPFactor does in place factorization. jacobianTranspose is now the // LU factorization. - return CellDerivativeFor2DCellFinish(field, jacobianTranspose, permutation, pcoords, space, + return CellDerivativeFor2DCellFinish(field, + jacobianTranspose, + permutation, + pcoords, + space, CellShapeTag(), typename vtkm::TypeTraits::DimensionalityTag()); } @@ -366,15 +402,18 @@ VTKM_EXEC vtkm::Vec CellDerivativeFor2D /// template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& pointFieldValues, const WorldCoordType& worldCoordinateValues, - const vtkm::Vec& parametricCoords, vtkm::CellShapeTagGeneric shape, + const FieldVecType& pointFieldValues, + const WorldCoordType& worldCoordinateValues, + const vtkm::Vec& parametricCoords, + vtkm::CellShapeTagGeneric shape, const vtkm::exec::FunctorBase& worklet) { vtkm::Vec result; switch (shape.Id) { - vtkmGenericCellShapeMacro(result = CellDerivative(pointFieldValues, worldCoordinateValues, - parametricCoords, CellShapeTag(), worklet)); + vtkmGenericCellShapeMacro( + result = CellDerivative( + pointFieldValues, worldCoordinateValues, parametricCoords, CellShapeTag(), worklet)); default: worklet.RaiseError("Unknown cell shape sent to derivative."); return vtkm::Vec(); @@ -385,8 +424,11 @@ VTKM_EXEC vtkm::Vec CellDerivative( //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType&, const WorldCoordType&, const vtkm::Vec&, - vtkm::CellShapeTagEmpty, const vtkm::exec::FunctorBase& worklet) + const FieldVecType&, + const WorldCoordType&, + const vtkm::Vec&, + vtkm::CellShapeTagEmpty, + const vtkm::exec::FunctorBase& worklet) { worklet.RaiseError("Attempted to take derivative in empty cell."); return vtkm::Vec(); @@ -395,8 +437,10 @@ VTKM_EXEC vtkm::Vec CellDerivative( //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& field, const WorldCoordType& wCoords, - const vtkm::Vec&, vtkm::CellShapeTagVertex, + const FieldVecType& field, + const WorldCoordType& wCoords, + const vtkm::Vec&, + vtkm::CellShapeTagVertex, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { (void)field; @@ -416,7 +460,8 @@ template VTKM_EXEC vtkm::Vec CellDerivativeLineImpl( const FieldType& deltaField, const WorldCoordType& vec, // direction of line - const typename WorldCoordType::ComponentType& vecMagSqr, vtkm::TypeTraitsScalarTag) + const typename WorldCoordType::ComponentType& vecMagSqr, + vtkm::TypeTraitsScalarTag) { using GradientType = vtkm::Vec; @@ -432,7 +477,8 @@ template CellDerivativeLineImpl( const FieldType& deltaField, const WorldCoordType& vec, // direction of line - const typename WorldCoordType::ComponentType& vecMagSqr, VectorTypeTraitsTag) + const typename WorldCoordType::ComponentType& vecMagSqr, + VectorTypeTraitsTag) { using FieldTraits = vtkm::VecTraits; using FieldComponentType = typename FieldTraits::ComponentType; @@ -440,11 +486,14 @@ VTKM_EXEC vtkm::Vec CellDerivativeLineImpl( GradientType gradient; for (vtkm::IdComponent fieldComponent = 0; - fieldComponent < FieldTraits::GetNumberOfComponents(deltaField); fieldComponent++) + fieldComponent < FieldTraits::GetNumberOfComponents(deltaField); + fieldComponent++) { using SubGradientType = vtkm::Vec; SubGradientType subGradient = - CellDerivativeLineImpl(FieldTraits::GetComponent(deltaField, fieldComponent), vec, vecMagSqr, + CellDerivativeLineImpl(FieldTraits::GetComponent(deltaField, fieldComponent), + vec, + vecMagSqr, typename vtkm::TypeTraits::DimensionalityTag()); FieldTraits::SetComponent(gradient[0], fieldComponent, subGradient[0]); FieldTraits::SetComponent(gradient[1], fieldComponent, subGradient[1]); @@ -458,8 +507,10 @@ VTKM_EXEC vtkm::Vec CellDerivativeLineImpl( template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& field, const WorldCoordType& wCoords, - const vtkm::Vec& vtkmNotUsed(pcoords), vtkm::CellShapeTagLine, + const FieldVecType& field, + const WorldCoordType& wCoords, + const vtkm::Vec& vtkmNotUsed(pcoords), + vtkm::CellShapeTagLine, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 2); @@ -471,14 +522,18 @@ VTKM_EXEC vtkm::Vec CellDerivative( FieldType deltaField(field[1] - field[0]); vtkm::Vec vec(wCoords[1] - wCoords[0]); - return detail::CellDerivativeLineImpl(deltaField, vec, vtkm::MagnitudeSquared(vec), + return detail::CellDerivativeLineImpl(deltaField, + vec, + vtkm::MagnitudeSquared(vec), typename vtkm::TypeTraits::DimensionalityTag()); } template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& field, const vtkm::VecRectilinearPointCoordinates<1>& wCoords, - const vtkm::Vec& vtkmNotUsed(pcoords), vtkm::CellShapeTagLine, + const FieldVecType& field, + const vtkm::VecRectilinearPointCoordinates<1>& wCoords, + const vtkm::Vec& vtkmNotUsed(pcoords), + vtkm::CellShapeTagLine, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 2); @@ -494,8 +549,10 @@ namespace detail template VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, vtkm::TypeTraitsScalarTag) + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, + const vtkm::Vec& LUPermutation, + vtkm::TypeTraitsScalarTag) { // Finish solving linear equation. See TriangleDerivative implementation // for more detail. @@ -506,8 +563,10 @@ VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( template VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, vtkm::TypeTraitsVectorTag) + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, + const vtkm::Vec& LUPermutation, + vtkm::TypeTraitsVectorTag) { using FieldTraits = vtkm::VecTraits; using FieldComponentType = typename FieldTraits::ComponentType; @@ -515,14 +574,17 @@ VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( vtkm::Vec gradient; for (vtkm::IdComponent fieldComponent = 0; - fieldComponent < FieldTraits::GetNumberOfComponents(field[0]); fieldComponent++) + fieldComponent < FieldTraits::GetNumberOfComponents(field[0]); + fieldComponent++) { vtkm::Vec subField(FieldTraits::GetComponent(field[0], fieldComponent), FieldTraits::GetComponent(field[1], fieldComponent), FieldTraits::GetComponent(field[2], fieldComponent)); vtkm::Vec subGradient = - TriangleDerivativeFinish(subField, LUFactorization, LUPermutation, + TriangleDerivativeFinish(subField, + LUFactorization, + LUPermutation, typename vtkm::TypeTraits::DimensionalityTag()); FieldTraits::SetComponent(gradient[0], fieldComponent, subGradient[0]); @@ -535,11 +597,13 @@ VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( template VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, vtkm::TypeTraitsMatrixTag) + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, + const vtkm::Vec& LUPermutation, + vtkm::TypeTraitsMatrixTag) { - return TriangleDerivativeFinish(field, LUFactorization, LUPermutation, - vtkm::TypeTraitsVectorTag()); + return TriangleDerivativeFinish( + field, LUFactorization, LUPermutation, vtkm::TypeTraitsVectorTag()); } template @@ -598,8 +662,8 @@ VTKM_EXEC vtkm::Vec TriangleDerivative(const vtkm::Vec::DimensionalityTag()); + return TriangleDerivativeFinish( + field, A, permutation, typename vtkm::TypeTraits::DimensionalityTag()); } } // namespace detail @@ -607,8 +671,10 @@ VTKM_EXEC vtkm::Vec TriangleDerivative(const vtkm::Vec VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& inputField, const WorldCoordType& wCoords, - const vtkm::Vec& vtkmNotUsed(pcoords), vtkm::CellShapeTagTriangle, + const FieldVecType& inputField, + const WorldCoordType& wCoords, + const vtkm::Vec& vtkmNotUsed(pcoords), + vtkm::CellShapeTagTriangle, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(inputField.GetNumberOfComponents() == 3); @@ -658,8 +724,11 @@ VTKM_EXEC void PolygonComputeIndices(const vtkm::Vec& pc //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec PolygonDerivative( - const FieldVecType& field, const WorldCoordType& wCoords, vtkm::IdComponent numPoints, - vtkm::IdComponent firstPointIndex, vtkm::IdComponent secondPointIndex) + const FieldVecType& field, + const WorldCoordType& wCoords, + vtkm::IdComponent numPoints, + vtkm::IdComponent firstPointIndex, + vtkm::IdComponent secondPointIndex) { // If we are here, then there are 5 or more points on this polygon. @@ -686,11 +755,11 @@ VTKM_EXEC vtkm::Vec PolygonDerivative( wcoordCenter = wcoordCenter * WCoordType(1.0f / static_cast(numPoints)); // Set up parameters for triangle that pcoords is in - vtkm::Vec triangleField(fieldCenter, field[firstPointIndex], - field[secondPointIndex]); + vtkm::Vec triangleField( + fieldCenter, field[firstPointIndex], field[secondPointIndex]); - vtkm::Vec triangleWCoords(wcoordCenter, wCoords[firstPointIndex], - wCoords[secondPointIndex]); + vtkm::Vec triangleWCoords( + wcoordCenter, wCoords[firstPointIndex], wCoords[secondPointIndex]); // Now use the triangle derivative. pcoords is actually invalid for the // triangle, but that does not matter as the derivative for a triangle does @@ -701,8 +770,10 @@ VTKM_EXEC vtkm::Vec PolygonDerivative( //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& field, const WorldCoordType& wCoords, - const vtkm::Vec& pcoords, vtkm::CellShapeTagPolygon, + const FieldVecType& field, + const WorldCoordType& wCoords, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagPolygon, const vtkm::exec::FunctorBase& worklet) { VTKM_ASSERT(field.GetNumberOfComponents() == wCoords.GetNumberOfComponents()); @@ -730,8 +801,10 @@ VTKM_EXEC vtkm::Vec CellDerivative( //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& inputField, const WorldCoordType& wCoords, - const vtkm::Vec& pcoords, vtkm::CellShapeTagQuad, + const FieldVecType& inputField, + const WorldCoordType& wCoords, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagQuad, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(inputField.GetNumberOfComponents() == 4); @@ -749,8 +822,10 @@ VTKM_EXEC vtkm::Vec CellDerivative( template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& field, const vtkm::VecRectilinearPointCoordinates<2>& wCoords, - const vtkm::Vec& pcoords, vtkm::CellShapeTagQuad, + const FieldVecType& field, + const vtkm::VecRectilinearPointCoordinates<2>& wCoords, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagQuad, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 4); @@ -775,8 +850,10 @@ namespace detail template VTKM_EXEC vtkm::Vec TetraDerivativeFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, vtkm::TypeTraitsScalarTag) + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, + const vtkm::Vec& LUPermutation, + vtkm::TypeTraitsScalarTag) { // Finish solving linear equation. See TriangleDerivative implementation // for more detail. @@ -787,8 +864,10 @@ VTKM_EXEC vtkm::Vec TetraDerivativeFinish( template VTKM_EXEC vtkm::Vec TetraDerivativeFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, vtkm::TypeTraitsVectorTag) + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, + const vtkm::Vec& LUPermutation, + vtkm::TypeTraitsVectorTag) { using FieldTraits = vtkm::VecTraits; using FieldComponentType = typename FieldTraits::ComponentType; @@ -796,7 +875,8 @@ VTKM_EXEC vtkm::Vec TetraDerivativeFinish( vtkm::Vec gradient; for (vtkm::IdComponent fieldComponent = 0; - fieldComponent < FieldTraits::GetNumberOfComponents(field[0]); fieldComponent++) + fieldComponent < FieldTraits::GetNumberOfComponents(field[0]); + fieldComponent++) { vtkm::Vec subField(FieldTraits::GetComponent(field[0], fieldComponent), FieldTraits::GetComponent(field[1], fieldComponent), @@ -804,7 +884,9 @@ VTKM_EXEC vtkm::Vec TetraDerivativeFinish( FieldTraits::GetComponent(field[3], fieldComponent)); vtkm::Vec subGradient = - TetraDerivativeFinish(subField, LUFactorization, LUPermutation, + TetraDerivativeFinish(subField, + LUFactorization, + LUPermutation, typename vtkm::TypeTraits::DimensionalityTag()); FieldTraits::SetComponent(gradient[0], fieldComponent, subGradient[0]); @@ -817,8 +899,10 @@ VTKM_EXEC vtkm::Vec TetraDerivativeFinish( template VTKM_EXEC vtkm::Vec TetraDerivativeFinish( - const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, vtkm::TypeTraitsMatrixTag) + const vtkm::Vec& field, + const vtkm::Matrix& LUFactorization, + const vtkm::Vec& LUPermutation, + vtkm::TypeTraitsMatrixTag) { return TetraDerivativeFinish(field, LUFactorization, LUPermutation, vtkm::TypeTraitsVectorTag()); } @@ -878,8 +962,8 @@ VTKM_EXEC vtkm::Vec TetraDerivative(const vtkm::Vec& BaseComponentType inversionParity; // Unused vtkm::detail::MatrixLUPFactor(A, permutation, inversionParity, valid); // MatrixLUPFactor does in place factorization. A is now the LU factorization. - return TetraDerivativeFinish(field, A, permutation, - typename vtkm::TypeTraits::DimensionalityTag()); + return TetraDerivativeFinish( + field, A, permutation, typename vtkm::TypeTraits::DimensionalityTag()); } } // namespace detail @@ -887,8 +971,10 @@ VTKM_EXEC vtkm::Vec TetraDerivative(const vtkm::Vec& //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& inputField, const WorldCoordType& wCoords, - const vtkm::Vec& vtkmNotUsed(pcoords), vtkm::CellShapeTagTetra, + const FieldVecType& inputField, + const WorldCoordType& wCoords, + const vtkm::Vec& vtkmNotUsed(pcoords), + vtkm::CellShapeTagTetra, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(inputField.GetNumberOfComponents() == 4); @@ -906,8 +992,10 @@ VTKM_EXEC vtkm::Vec CellDerivative( //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& inputField, const WorldCoordType& wCoords, - const vtkm::Vec& pcoords, vtkm::CellShapeTagHexahedron, + const FieldVecType& inputField, + const WorldCoordType& wCoords, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagHexahedron, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(inputField.GetNumberOfComponents() == 8); @@ -925,8 +1013,10 @@ VTKM_EXEC vtkm::Vec CellDerivative( template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& field, const vtkm::VecRectilinearPointCoordinates<3>& wCoords, - const vtkm::Vec& pcoords, vtkm::CellShapeTagHexahedron, + const FieldVecType& field, + const vtkm::VecRectilinearPointCoordinates<3>& wCoords, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagHexahedron, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 8); @@ -952,8 +1042,10 @@ VTKM_EXEC vtkm::Vec CellDerivative( //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& inputField, const WorldCoordType& wCoords, - const vtkm::Vec& pcoords, vtkm::CellShapeTagWedge, + const FieldVecType& inputField, + const WorldCoordType& wCoords, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagWedge, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(inputField.GetNumberOfComponents() == 6); @@ -972,8 +1064,10 @@ VTKM_EXEC vtkm::Vec CellDerivative( //----------------------------------------------------------------------------- template VTKM_EXEC vtkm::Vec CellDerivative( - const FieldVecType& inputField, const WorldCoordType& wCoords, - const vtkm::Vec& pcoords, vtkm::CellShapeTagPyramid, + const FieldVecType& inputField, + const WorldCoordType& wCoords, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagPyramid, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(inputField.GetNumberOfComponents() == 5); diff --git a/vtkm/exec/CellEdge.h b/vtkm/exec/CellEdge.h index be5337a36..a71a567f4 100644 --- a/vtkm/exec/CellEdge.h +++ b/vtkm/exec/CellEdge.h @@ -276,7 +276,8 @@ static inline VTKM_EXEC vtkm::IdComponent CellEdgeNumberOfEdges(vtkm::IdComponen } static inline VTKM_EXEC vtkm::IdComponent CellEdgeNumberOfEdges( - vtkm::IdComponent numPoints, vtkm::CellShapeTagGeneric shape, + vtkm::IdComponent numPoints, + vtkm::CellShapeTagGeneric shape, const vtkm::exec::FunctorBase& worklet) { if (shape.Id == vtkm::CELL_SHAPE_POLYGON) @@ -291,7 +292,9 @@ static inline VTKM_EXEC vtkm::IdComponent CellEdgeNumberOfEdges( template static inline VTKM_EXEC vtkm::Vec CellEdgeLocalIndices( - vtkm::IdComponent numPoints, vtkm::IdComponent edgeIndex, CellShapeTag shape, + vtkm::IdComponent numPoints, + vtkm::IdComponent edgeIndex, + CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) { VTKM_ASSUME(edgeIndex >= 0); @@ -307,7 +310,9 @@ static inline VTKM_EXEC vtkm::Vec CellEdgeLocalIndices( } static inline VTKM_EXEC vtkm::Vec CellEdgeLocalIndices( - vtkm::IdComponent numPoints, vtkm::IdComponent edgeIndex, vtkm::CellShapeTagPolygon, + vtkm::IdComponent numPoints, + vtkm::IdComponent edgeIndex, + vtkm::CellShapeTagPolygon, const vtkm::exec::FunctorBase&) { VTKM_ASSUME(numPoints >= 3); @@ -325,7 +330,9 @@ static inline VTKM_EXEC vtkm::Vec CellEdgeLocalIndices( } static inline VTKM_EXEC vtkm::Vec CellEdgeLocalIndices( - vtkm::IdComponent numPoints, vtkm::IdComponent edgeIndex, vtkm::CellShapeTagGeneric shape, + vtkm::IdComponent numPoints, + vtkm::IdComponent edgeIndex, + vtkm::CellShapeTagGeneric shape, const vtkm::exec::FunctorBase& worklet) { VTKM_ASSUME(edgeIndex >= 0); diff --git a/vtkm/exec/CellFace.h b/vtkm/exec/CellFace.h index 0686b2d68..bb515094a 100644 --- a/vtkm/exec/CellFace.h +++ b/vtkm/exec/CellFace.h @@ -196,7 +196,9 @@ static inline VTKM_EXEC vtkm::IdComponent CellFaceNumberOfFaces(CellShapeTag sha template static inline VTKM_EXEC vtkm::IdComponent CellFaceNumberOfPoints( - vtkm::IdComponent faceIndex, CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) + vtkm::IdComponent faceIndex, + CellShapeTag shape, + const vtkm::exec::FunctorBase& worklet) { VTKM_ASSUME(faceIndex >= 0); VTKM_ASSUME(faceIndex < detail::MAX_NUM_FACES); @@ -210,7 +212,8 @@ static inline VTKM_EXEC vtkm::IdComponent CellFaceNumberOfPoints( } template -static inline VTKM_EXEC vtkm::UInt8 CellFaceShape(vtkm::IdComponent faceIndex, CellShapeTag shape, +static inline VTKM_EXEC vtkm::UInt8 CellFaceShape(vtkm::IdComponent faceIndex, + CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) { VTKM_ASSUME(faceIndex >= 0); @@ -228,7 +231,9 @@ static inline VTKM_EXEC vtkm::UInt8 CellFaceShape(vtkm::IdComponent faceIndex, C template static inline VTKM_EXEC vtkm::VecCConst CellFaceLocalIndices( - vtkm::IdComponent faceIndex, CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) + vtkm::IdComponent faceIndex, + CellShapeTag shape, + const vtkm::exec::FunctorBase& worklet) { vtkm::IdComponent numPointsInFace = vtkm::exec::CellFaceNumberOfPoints(faceIndex, shape, worklet); if (numPointsInFace < 1) diff --git a/vtkm/exec/CellInterpolate.h b/vtkm/exec/CellInterpolate.h index 4850a9288..38bfb4953 100644 --- a/vtkm/exec/CellInterpolate.h +++ b/vtkm/exec/CellInterpolate.h @@ -40,7 +40,8 @@ namespace internal // polygon, which is divided into triangles. template VTKM_EXEC typename WorldCoordVector::ComponentType ReverseInterpolateTriangle( - const WorldCoordVector& pointWCoords, const typename WorldCoordVector::ComponentType& wcoords) + const WorldCoordVector& pointWCoords, + const typename WorldCoordVector::ComponentType& wcoords) { VTKM_ASSERT(pointWCoords.GetNumberOfComponents() == 3); @@ -132,8 +133,10 @@ VTKM_EXEC typename WorldCoordVector::ComponentType ReverseInterpolateTriangle( /// template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& pointFieldValues, const vtkm::Vec& parametricCoords, - vtkm::CellShapeTagGeneric shape, const vtkm::exec::FunctorBase& worklet) + const FieldVecType& pointFieldValues, + const vtkm::Vec& parametricCoords, + vtkm::CellShapeTagGeneric shape, + const vtkm::exec::FunctorBase& worklet) { typename FieldVecType::ComponentType result; switch (shape.Id) @@ -150,7 +153,9 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType&, const vtkm::Vec&, vtkm::CellShapeTagEmpty, + const FieldVecType&, + const vtkm::Vec&, + vtkm::CellShapeTagEmpty, const vtkm::exec::FunctorBase& worklet) { worklet.RaiseError("Attempted to interpolate an empty cell."); @@ -160,8 +165,10 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& pointFieldValues, const vtkm::Vec, - vtkm::CellShapeTagVertex, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) + const FieldVecType& pointFieldValues, + const vtkm::Vec, + vtkm::CellShapeTagVertex, + const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(pointFieldValues.GetNumberOfComponents() == 1); return pointFieldValues[0]; @@ -170,8 +177,10 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& pointFieldValues, const vtkm::Vec& parametricCoords, - vtkm::CellShapeTagLine, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) + const FieldVecType& pointFieldValues, + const vtkm::Vec& parametricCoords, + vtkm::CellShapeTagLine, + const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(pointFieldValues.GetNumberOfComponents() == 2); return vtkm::Lerp(pointFieldValues[0], pointFieldValues[1], parametricCoords[0]); @@ -180,7 +189,8 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( template VTKM_EXEC vtkm::Vec CellInterpolate( const vtkm::VecRectilinearPointCoordinates<1>& field, - const vtkm::Vec& pcoords, vtkm::CellShapeTagLine, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagLine, const vtkm::exec::FunctorBase&) { typedef vtkm::Vec T; @@ -188,15 +198,17 @@ VTKM_EXEC vtkm::Vec CellInterpolate( const T& origin = field.GetOrigin(); const T& spacing = field.GetSpacing(); - return T(origin[0] + static_cast(pcoords[0]) * spacing[0], origin[1], - origin[2]); + return T( + origin[0] + static_cast(pcoords[0]) * spacing[0], origin[1], origin[2]); } //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& field, const vtkm::Vec& pcoords, - vtkm::CellShapeTagTriangle, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) + const FieldVecType& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagTriangle, + const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 3); typedef typename FieldVecType::ComponentType T; @@ -207,8 +219,10 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& field, const vtkm::Vec& pcoords, - vtkm::CellShapeTagPolygon, const vtkm::exec::FunctorBase& worklet) + const FieldVecType& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagPolygon, + const vtkm::exec::FunctorBase& worklet) { const vtkm::IdComponent numPoints = field.GetNumberOfComponents(); VTKM_ASSERT(numPoints > 0); @@ -293,15 +307,17 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( triangleField[2] = field[secondPointIndex]; // Now use the triangle interpolate - return vtkm::exec::CellInterpolate(triangleField, trianglePCoords, vtkm::CellShapeTagTriangle(), - worklet); + return vtkm::exec::CellInterpolate( + triangleField, trianglePCoords, vtkm::CellShapeTagTriangle(), worklet); } //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& field, const vtkm::Vec& pcoords, - vtkm::CellShapeTagQuad, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) + const FieldVecType& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagQuad, + const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 4); @@ -316,7 +332,8 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( template VTKM_EXEC vtkm::Vec CellInterpolate( const vtkm::VecRectilinearPointCoordinates<2>& field, - const vtkm::Vec& pcoords, vtkm::CellShapeTagQuad, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagQuad, const vtkm::exec::FunctorBase&) { typedef vtkm::Vec T; @@ -325,14 +342,17 @@ VTKM_EXEC vtkm::Vec CellInterpolate( const T& spacing = field.GetSpacing(); return T(origin[0] + static_cast(pcoords[0]) * spacing[0], - origin[1] + static_cast(pcoords[1]) * spacing[1], origin[2]); + origin[1] + static_cast(pcoords[1]) * spacing[1], + origin[2]); } //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& field, const vtkm::Vec& pcoords, - vtkm::CellShapeTagTetra, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) + const FieldVecType& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagTetra, + const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 4); typedef typename FieldVecType::ComponentType T; @@ -344,8 +364,10 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& field, const vtkm::Vec& pcoords, - vtkm::CellShapeTagHexahedron, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) + const FieldVecType& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagHexahedron, + const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 8); @@ -365,7 +387,8 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( template VTKM_EXEC vtkm::Vec CellInterpolate( const vtkm::VecRectilinearPointCoordinates<3>& field, - const vtkm::Vec& pcoords, vtkm::CellShapeTagHexahedron, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagHexahedron, const vtkm::exec::FunctorBase&) { vtkm::Vec pcoordsCast(static_cast(pcoords[0]), @@ -378,8 +401,10 @@ VTKM_EXEC vtkm::Vec CellInterpolate( //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& field, const vtkm::Vec& pcoords, - vtkm::CellShapeTagWedge, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) + const FieldVecType& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagWedge, + const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 6); @@ -397,8 +422,10 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( //----------------------------------------------------------------------------- template VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( - const FieldVecType& field, const vtkm::Vec& pcoords, - vtkm::CellShapeTagPyramid, const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) + const FieldVecType& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagPyramid, + const vtkm::exec::FunctorBase& vtkmNotUsed(worklet)) { VTKM_ASSERT(field.GetNumberOfComponents() == 5); diff --git a/vtkm/exec/ConnectivityExplicit.h b/vtkm/exec/ConnectivityExplicit.h index 8717f07fe..be99fdfa5 100644 --- a/vtkm/exec/ConnectivityExplicit.h +++ b/vtkm/exec/ConnectivityExplicit.h @@ -30,7 +30,9 @@ namespace vtkm namespace exec { -template class ConnectivityExplicit { diff --git a/vtkm/exec/ExecutionWholeArray.h b/vtkm/exec/ExecutionWholeArray.h index 0733c1b6e..574e57033 100644 --- a/vtkm/exec/ExecutionWholeArray.h +++ b/vtkm/exec/ExecutionWholeArray.h @@ -34,7 +34,8 @@ namespace exec /// function. This can be used to allow worklets to have a shared search /// structure /// -template class ExecutionWholeArray : public vtkm::exec::ExecutionObjectBase { @@ -85,7 +86,8 @@ private: /// function. This can be used to allow worklets to have a shared search /// structure /// -template class ExecutionWholeArrayConst : public vtkm::exec::ExecutionObjectBase { diff --git a/vtkm/exec/ImplicitFunction.h b/vtkm/exec/ImplicitFunction.h index df2d314ea..09fe23410 100644 --- a/vtkm/exec/ImplicitFunction.h +++ b/vtkm/exec/ImplicitFunction.h @@ -75,7 +75,9 @@ public: private: using ValueCallerSig = FloatDefault(const void*, FloatDefault, FloatDefault, FloatDefault); - using GradientCallerSig = vtkm::Vec(const void*, FloatDefault, FloatDefault, + using GradientCallerSig = vtkm::Vec(const void*, + FloatDefault, + FloatDefault, FloatDefault); const void* Function; diff --git a/vtkm/exec/Jacobian.h b/vtkm/exec/Jacobian.h index 4486d3022..8d55f03fd 100644 --- a/vtkm/exec/Jacobian.h +++ b/vtkm/exec/Jacobian.h @@ -213,8 +213,8 @@ VTKM_EXEC void JacobianFor3DCell(const WorldCoordType& wCoords, jacobian = vtkm::Matrix(0); VTKM_DERIVATIVE_WEIGHTS_WEDGE(pc, rc, VTKM_ACCUM_JACOBIAN_3D); #else - JacobianFor3DCell(internal::PermuteWedgeToHex(wCoords), pcoords, jacobian, - vtkm::CellShapeTagHexahedron()); + JacobianFor3DCell( + internal::PermuteWedgeToHex(wCoords), pcoords, jacobian, vtkm::CellShapeTagHexahedron()); #endif } @@ -232,8 +232,8 @@ VTKM_EXEC void JacobianFor3DCell(const WorldCoordType& wCoords, jacobian = vtkm::Matrix(0); VTKM_DERIVATIVE_WEIGHTS_PYRAMID(pc, rc, VTKM_ACCUM_JACOBIAN_3D); #else - JacobianFor3DCell(internal::PermutePyramidToHex(wCoords), pcoords, jacobian, - vtkm::CellShapeTagHexahedron()); + JacobianFor3DCell( + internal::PermutePyramidToHex(wCoords), pcoords, jacobian, vtkm::CellShapeTagHexahedron()); #endif } @@ -249,12 +249,15 @@ VTKM_EXEC void JacobianFor3DCell(const WorldCoordType& wCoords, jacobian(0, 1) += wcoords2d[0] * (weight1); \ jacobian(1, 1) += wcoords2d[1] * (weight1) -template VTKM_EXEC void JacobianFor2DCell(const WorldCoordType& wCoords, const vtkm::Vec& pcoords, const vtkm::exec::internal::Space2D& space, - vtkm::Matrix& jacobian, vtkm::CellShapeTagQuad) + vtkm::Matrix& jacobian, + vtkm::CellShapeTagQuad) { vtkm::Vec pc(static_cast(pcoords[0]), static_cast(pcoords[1])); diff --git a/vtkm/exec/ParametricCoordinates.h b/vtkm/exec/ParametricCoordinates.h index 2356ad93d..ef7a700bf 100644 --- a/vtkm/exec/ParametricCoordinates.h +++ b/vtkm/exec/ParametricCoordinates.h @@ -205,7 +205,9 @@ static inline VTKM_EXEC void ParametricCoordinatesCenter(vtkm::IdComponent numPo /// template static inline VTKM_EXEC vtkm::Vec ParametricCoordinatesCenter( - vtkm::IdComponent numPoints, CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) + vtkm::IdComponent numPoints, + CellShapeTag shape, + const vtkm::exec::FunctorBase& worklet) { vtkm::Vec pcoords; ParametricCoordinatesCenter(numPoints, pcoords, shape, worklet); @@ -214,7 +216,8 @@ static inline VTKM_EXEC vtkm::Vec ParametricCoordinatesCe //----------------------------------------------------------------------------- template -static inline VTKM_EXEC void ParametricCoordinatesPoint(vtkm::IdComponent, vtkm::IdComponent, +static inline VTKM_EXEC void ParametricCoordinatesPoint(vtkm::IdComponent, + vtkm::IdComponent, vtkm::Vec& pcoords, vtkm::CellShapeTagEmpty, const vtkm::exec::FunctorBase& worklet) @@ -297,15 +300,15 @@ static inline VTKM_EXEC void ParametricCoordinatesPoint(vtkm::IdComponent numPoi switch (numPoints) { case 1: - ParametricCoordinatesPoint(numPoints, pointIndex, pcoords, vtkm::CellShapeTagVertex(), - worklet); + ParametricCoordinatesPoint( + numPoints, pointIndex, pcoords, vtkm::CellShapeTagVertex(), worklet); return; case 2: ParametricCoordinatesPoint(numPoints, pointIndex, pcoords, vtkm::CellShapeTagLine(), worklet); return; case 3: - ParametricCoordinatesPoint(numPoints, pointIndex, pcoords, vtkm::CellShapeTagTriangle(), - worklet); + ParametricCoordinatesPoint( + numPoints, pointIndex, pcoords, vtkm::CellShapeTagTriangle(), worklet); return; case 4: ParametricCoordinatesPoint(numPoints, pointIndex, pcoords, vtkm::CellShapeTagQuad(), worklet); @@ -561,7 +564,9 @@ static inline VTKM_EXEC void ParametricCoordinatesPoint(vtkm::IdComponent numPoi /// template static inline VTKM_EXEC vtkm::Vec ParametricCoordinatesPoint( - vtkm::IdComponent numPoints, vtkm::IdComponent pointIndex, CellShapeTag shape, + vtkm::IdComponent numPoints, + vtkm::IdComponent pointIndex, + CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) { vtkm::Vec pcoords; @@ -573,7 +578,8 @@ static inline VTKM_EXEC vtkm::Vec ParametricCoordinatesPo template static inline VTKM_EXEC typename WorldCoordVector::ComponentType ParametricCoordinatesToWorldCoordinates(const WorldCoordVector& pointWCoords, - const vtkm::Vec& pcoords, CellShapeTag shape, + const vtkm::Vec& pcoords, + CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) { return vtkm::exec::CellInterpolate(pointWCoords, pcoords, shape, worklet); @@ -607,8 +613,11 @@ public: Matrix2x2 operator()(const Vector2& pcoords) const { Matrix2x2 jacobian; - vtkm::exec::JacobianFor2DCell(*this->PointWCoords, vtkm::Vec(pcoords[0], pcoords[1], 0), - *this->Space, jacobian, CellShapeTag()); + vtkm::exec::JacobianFor2DCell(*this->PointWCoords, + vtkm::Vec(pcoords[0], pcoords[1], 0), + *this->Space, + jacobian, + CellShapeTag()); return jacobian; } }; @@ -627,7 +636,8 @@ class CoordinatesFunctorQuad public: VTKM_EXEC - CoordinatesFunctorQuad(const WorldCoordVector* pointWCoords, const SpaceType* space, + CoordinatesFunctorQuad(const WorldCoordVector* pointWCoords, + const SpaceType* space, const vtkm::exec::FunctorBase* worklet) : PointWCoords(pointWCoords) , Space(space) @@ -691,8 +701,8 @@ public: VTKM_EXEC Vector3 operator()(Vector3 pcoords) const { - return vtkm::exec::ParametricCoordinatesToWorldCoordinates(*this->PointWCoords, pcoords, - CellShapeTag(), *this->Worklet); + return vtkm::exec::ParametricCoordinatesToWorldCoordinates( + *this->PointWCoords, pcoords, CellShapeTag(), *this->Worklet); } }; @@ -700,11 +710,13 @@ template static inline VTKM_EXEC typename WorldCoordVector::ComponentType WorldCoordinatesToParametricCoordinates3D(const WorldCoordVector& pointWCoords, const typename WorldCoordVector::ComponentType& wcoords, - CellShapeTag, const vtkm::exec::FunctorBase& worklet) + CellShapeTag, + const vtkm::exec::FunctorBase& worklet) { return vtkm::NewtonsMethod( JacobianFunctor3DCell(&pointWCoords), - CoordinatesFunctor3DCell(&pointWCoords, &worklet), wcoords, + CoordinatesFunctor3DCell(&pointWCoords, &worklet), + wcoords, typename WorldCoordVector::ComponentType(0.5f, 0.5f, 0.5f)); } @@ -784,7 +796,9 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords, static inline VTKM_EXEC vtkm::Vec WorldCoordinatesToParametricCoordinates( const vtkm::VecRectilinearPointCoordinates<1>& pointWCoords, - const vtkm::Vec& wcoords, vtkm::CellShapeTagLine, const FunctorBase&) + const vtkm::Vec& wcoords, + vtkm::CellShapeTagLine, + const FunctorBase&) { return (wcoords - pointWCoords.GetOrigin()) / pointWCoords.GetSpacing(); } @@ -811,17 +825,17 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords, switch (numPoints) { case 1: - return WorldCoordinatesToParametricCoordinates(pointWCoords, wcoords, - vtkm::CellShapeTagVertex(), worklet); + return WorldCoordinatesToParametricCoordinates( + pointWCoords, wcoords, vtkm::CellShapeTagVertex(), worklet); case 2: - return WorldCoordinatesToParametricCoordinates(pointWCoords, wcoords, - vtkm::CellShapeTagLine(), worklet); + return WorldCoordinatesToParametricCoordinates( + pointWCoords, wcoords, vtkm::CellShapeTagLine(), worklet); case 3: - return WorldCoordinatesToParametricCoordinates(pointWCoords, wcoords, - vtkm::CellShapeTagTriangle(), worklet); + return WorldCoordinatesToParametricCoordinates( + pointWCoords, wcoords, vtkm::CellShapeTagTriangle(), worklet); case 4: - return WorldCoordinatesToParametricCoordinates(pointWCoords, wcoords, - vtkm::CellShapeTagQuad(), worklet); + return WorldCoordinatesToParametricCoordinates( + pointWCoords, wcoords, vtkm::CellShapeTagQuad(), worklet); } // If we are here, then there are 5 or more points on this polygon. @@ -913,12 +927,12 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords, // repurposing the ParametricCoordinatesToWorldCoordinates by using the // polygon parametric coordinates as a proxy for world coordinates. triangleWCoords[0] = WCoordType(0.5f, 0.5f, 0); - ParametricCoordinatesPoint(numPoints, firstPointIndex, triangleWCoords[1], - vtkm::CellShapeTagPolygon(), worklet); - ParametricCoordinatesPoint(numPoints, secondPointIndex, triangleWCoords[2], - vtkm::CellShapeTagPolygon(), worklet); - return ParametricCoordinatesToWorldCoordinates(triangleWCoords, trianglePCoords, - vtkm::CellShapeTagTriangle(), worklet); + ParametricCoordinatesPoint( + numPoints, firstPointIndex, triangleWCoords[1], vtkm::CellShapeTagPolygon(), worklet); + ParametricCoordinatesPoint( + numPoints, secondPointIndex, triangleWCoords[2], vtkm::CellShapeTagPolygon(), worklet); + return ParametricCoordinatesToWorldCoordinates( + triangleWCoords, trianglePCoords, vtkm::CellShapeTagTriangle(), worklet); } template @@ -940,16 +954,19 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords, Vector2 pcoords = vtkm::NewtonsMethod( detail::JacobianFunctorQuad(&pointWCoords, &space), - detail::CoordinatesFunctorQuad(&pointWCoords, &space, - &worklet), - space.ConvertCoordToSpace(wcoords), Vector2(0.5f, 0.5f)); + detail::CoordinatesFunctorQuad( + &pointWCoords, &space, &worklet), + space.ConvertCoordToSpace(wcoords), + Vector2(0.5f, 0.5f)); return Vector3(pcoords[0], pcoords[1], 0); } static inline VTKM_EXEC vtkm::Vec WorldCoordinatesToParametricCoordinates( const vtkm::VecRectilinearPointCoordinates<2>& pointWCoords, - const vtkm::Vec& wcoords, vtkm::CellShapeTagQuad, const FunctorBase&) + const vtkm::Vec& wcoords, + vtkm::CellShapeTagQuad, + const FunctorBase&) { return (wcoords - pointWCoords.GetOrigin()) / pointWCoords.GetSpacing(); } @@ -1016,13 +1033,15 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords, { VTKM_ASSERT(pointWCoords.GetNumberOfComponents() == 8); - return detail::WorldCoordinatesToParametricCoordinates3D(pointWCoords, wcoords, - vtkm::CellShapeTagHexahedron(), worklet); + return detail::WorldCoordinatesToParametricCoordinates3D( + pointWCoords, wcoords, vtkm::CellShapeTagHexahedron(), worklet); } static inline VTKM_EXEC vtkm::Vec WorldCoordinatesToParametricCoordinates( const vtkm::VecRectilinearPointCoordinates<3>& pointWCoords, - const vtkm::Vec& wcoords, vtkm::CellShapeTagHexahedron, const FunctorBase&) + const vtkm::Vec& wcoords, + vtkm::CellShapeTagHexahedron, + const FunctorBase&) { return (wcoords - pointWCoords.GetOrigin()) / pointWCoords.GetSpacing(); } @@ -1036,8 +1055,8 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords, { VTKM_ASSERT(pointWCoords.GetNumberOfComponents() == 6); - return detail::WorldCoordinatesToParametricCoordinates3D(pointWCoords, wcoords, - vtkm::CellShapeTagWedge(), worklet); + return detail::WorldCoordinatesToParametricCoordinates3D( + pointWCoords, wcoords, vtkm::CellShapeTagWedge(), worklet); } template @@ -1049,8 +1068,8 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords, { VTKM_ASSERT(pointWCoords.GetNumberOfComponents() == 5); - return detail::WorldCoordinatesToParametricCoordinates3D(pointWCoords, wcoords, - vtkm::CellShapeTagPyramid(), worklet); + return detail::WorldCoordinatesToParametricCoordinates3D( + pointWCoords, wcoords, vtkm::CellShapeTagPyramid(), worklet); } } } // namespace vtkm::exec diff --git a/vtkm/exec/arg/CellShape.h b/vtkm/exec/arg/CellShape.h index 05cee32e2..084f42296 100644 --- a/vtkm/exec/arg/CellShape.h +++ b/vtkm/exec/arg/CellShape.h @@ -49,8 +49,10 @@ struct CellShape : vtkm::exec::arg::ExecutionSignatureTagBase }; template -struct Fetch, ExecObjectType> +struct Fetch, + ExecObjectType> { typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; diff --git a/vtkm/exec/arg/Fetch.h b/vtkm/exec/arg/Fetch.h index 765495b96..b6d3b585a 100644 --- a/vtkm/exec/arg/Fetch.h +++ b/vtkm/exec/arg/Fetch.h @@ -55,7 +55,9 @@ namespace arg /// ExecutionSignature with a particular aspect is pointing to the wrong /// argument or an invalid argument in the ControlSignature. /// -template struct Fetch #ifdef VTKM_DOXYGEN_ONLY @@ -89,7 +91,8 @@ struct Fetch /// fetch), this method can be a no-op. /// VTKM_EXEC - void Store(const ThreadIndicesType& indices, const ExecObjectType& execObject, + void Store(const ThreadIndicesType& indices, + const ExecObjectType& execObject, const ValueType& value) const; }; #else // VTKM_DOXYGEN_ONLY diff --git a/vtkm/exec/arg/FetchTagArrayDirectIn.h b/vtkm/exec/arg/FetchTagArrayDirectIn.h index e41f78adc..6c7a11c96 100644 --- a/vtkm/exec/arg/FetchTagArrayDirectIn.h +++ b/vtkm/exec/arg/FetchTagArrayDirectIn.h @@ -41,8 +41,10 @@ struct FetchTagArrayDirectIn }; template -struct Fetch +struct Fetch { typedef typename ExecObjectType::ValueType ValueType; diff --git a/vtkm/exec/arg/FetchTagArrayDirectInOut.h b/vtkm/exec/arg/FetchTagArrayDirectInOut.h index 404cedd68..9d6bf600a 100644 --- a/vtkm/exec/arg/FetchTagArrayDirectInOut.h +++ b/vtkm/exec/arg/FetchTagArrayDirectInOut.h @@ -51,8 +51,10 @@ struct FetchTagArrayDirectInOut }; template -struct Fetch +struct Fetch { typedef typename ExecObjectType::ValueType ValueType; @@ -65,7 +67,8 @@ struct Fetch -struct Fetch +struct Fetch { typedef typename ExecObjectType::ValueType ValueType; @@ -56,7 +58,8 @@ struct Fetch make_VecRectilinearPointCoordinates( - const vtkm::Vec& origin, const vtkm::Vec& spacing, + const vtkm::Vec& origin, + const vtkm::Vec& spacing, const vtkm::Vec& logicalId) { vtkm::Vec offsetOrigin( @@ -97,24 +98,28 @@ static inline VTKM_EXEC vtkm::VecRectilinearPointCoordinates<1> make_VecRectilin } static inline VTKM_EXEC vtkm::VecRectilinearPointCoordinates<1> make_VecRectilinearPointCoordinates( - const vtkm::Vec& origin, const vtkm::Vec& spacing, + const vtkm::Vec& origin, + const vtkm::Vec& spacing, vtkm::Id logicalId) { return make_VecRectilinearPointCoordinates(origin, spacing, vtkm::Vec(logicalId)); } static inline VTKM_EXEC vtkm::VecRectilinearPointCoordinates<2> make_VecRectilinearPointCoordinates( - const vtkm::Vec& origin, const vtkm::Vec& spacing, + const vtkm::Vec& origin, + const vtkm::Vec& spacing, const vtkm::Vec& logicalId) { vtkm::Vec offsetOrigin( origin[0] + spacing[0] * static_cast(logicalId[0]), - origin[1] + spacing[1] * static_cast(logicalId[1]), origin[2]); + origin[1] + spacing[1] * static_cast(logicalId[1]), + origin[2]); return vtkm::VecRectilinearPointCoordinates<2>(offsetOrigin, spacing); } static inline VTKM_EXEC vtkm::VecRectilinearPointCoordinates<3> make_VecRectilinearPointCoordinates( - const vtkm::Vec& origin, const vtkm::Vec& spacing, + const vtkm::Vec& origin, + const vtkm::Vec& spacing, const vtkm::Vec& logicalId) { vtkm::Vec offsetOrigin( @@ -126,13 +131,15 @@ static inline VTKM_EXEC vtkm::VecRectilinearPointCoordinates<3> make_VecRectilin template struct FetchArrayTopologyMapInImplementation< - vtkm::exec::ConnectivityStructured, vtkm::internal::ArrayPortalUniformPointCoordinates> { typedef vtkm::exec::ConnectivityStructured + vtkm::TopologyElementTagCell, + NumDimensions> ConnectivityType; typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; @@ -152,16 +159,17 @@ struct FetchArrayTopologyMapInImplementation< template struct FetchArrayTopologyMapInImplementation< - vtkm::exec::ConnectivityPermuted< - PermutationPortal, - vtkm::exec::ConnectivityStructured>, + vtkm::exec::ConnectivityPermuted>, vtkm::internal::ArrayPortalUniformPointCoordinates> { typedef vtkm::exec::ConnectivityPermuted< PermutationPortal, - vtkm::exec::ConnectivityStructured> ConnectivityType; typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; @@ -186,8 +194,10 @@ struct FetchArrayTopologyMapInImplementation< } // namespace detail template -struct Fetch, ExecObjectType> +struct Fetch, + ExecObjectType> { typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; diff --git a/vtkm/exec/arg/FetchTagCellSetIn.h b/vtkm/exec/arg/FetchTagCellSetIn.h index 3e814a431..a4c02ac77 100644 --- a/vtkm/exec/arg/FetchTagCellSetIn.h +++ b/vtkm/exec/arg/FetchTagCellSetIn.h @@ -42,8 +42,10 @@ struct FetchTagCellSetIn }; template -struct Fetch, ExecObjectType> +struct Fetch, + ExecObjectType> { typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; diff --git a/vtkm/exec/arg/FetchTagExecObject.h b/vtkm/exec/arg/FetchTagExecObject.h index c2cf9012a..2a821f8b9 100644 --- a/vtkm/exec/arg/FetchTagExecObject.h +++ b/vtkm/exec/arg/FetchTagExecObject.h @@ -46,8 +46,10 @@ struct FetchTagExecObject }; template -struct Fetch +struct Fetch { // If you get a compile error here, it means you tried to use an object that // is not an execution object as an argument that is expected to be one. All diff --git a/vtkm/exec/arg/FetchTagKeysIn.h b/vtkm/exec/arg/FetchTagKeysIn.h index f6e57fc4b..4c5762583 100644 --- a/vtkm/exec/arg/FetchTagKeysIn.h +++ b/vtkm/exec/arg/FetchTagKeysIn.h @@ -44,7 +44,8 @@ struct FetchTagKeysIn template struct Fetch< - vtkm::exec::arg::FetchTagKeysIn, vtkm::exec::arg::AspectTagDefault, + vtkm::exec::arg::FetchTagKeysIn, + vtkm::exec::arg::AspectTagDefault, vtkm::exec::arg::ThreadIndicesReduceByKey, vtkm::exec::internal::ReduceByKeyLookup> { diff --git a/vtkm/exec/arg/FetchTagWholeCellSetIn.h b/vtkm/exec/arg/FetchTagWholeCellSetIn.h index 592b6081d..eba08ce5a 100644 --- a/vtkm/exec/arg/FetchTagWholeCellSetIn.h +++ b/vtkm/exec/arg/FetchTagWholeCellSetIn.h @@ -42,8 +42,10 @@ struct FetchTagWholeCellSetIn }; template -struct Fetch +struct Fetch { typedef ExecObjectType ValueType; diff --git a/vtkm/exec/arg/FromCount.h b/vtkm/exec/arg/FromCount.h index 1b0dd2c2c..cee5e1815 100644 --- a/vtkm/exec/arg/FromCount.h +++ b/vtkm/exec/arg/FromCount.h @@ -55,8 +55,10 @@ struct FromCount : vtkm::exec::arg::ExecutionSignatureTagBase }; template -struct Fetch, ExecObjectType> +struct Fetch, + ExecObjectType> { typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; diff --git a/vtkm/exec/arg/FromIndices.h b/vtkm/exec/arg/FromIndices.h index ffcbaa786..41cc3960a 100644 --- a/vtkm/exec/arg/FromIndices.h +++ b/vtkm/exec/arg/FromIndices.h @@ -55,8 +55,10 @@ struct FromIndices : vtkm::exec::arg::ExecutionSignatureTagBase }; template -struct Fetch, ExecObjectType> +struct Fetch, + ExecObjectType> { typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; diff --git a/vtkm/exec/arg/ThreadIndicesBasic.h b/vtkm/exec/arg/ThreadIndicesBasic.h index 9e7834501..ac6128ad5 100644 --- a/vtkm/exec/arg/ThreadIndicesBasic.h +++ b/vtkm/exec/arg/ThreadIndicesBasic.h @@ -46,7 +46,9 @@ class ThreadIndicesBasic { public: VTKM_EXEC - ThreadIndicesBasic(vtkm::Id threadIndex, vtkm::Id inIndex, vtkm::IdComponent visitIndex, + ThreadIndicesBasic(vtkm::Id threadIndex, + vtkm::Id inIndex, + vtkm::IdComponent visitIndex, vtkm::Id globalThreadIndexOffset = 0) : InputIndex(inIndex) , OutputIndex(threadIndex) diff --git a/vtkm/exec/arg/ThreadIndicesReduceByKey.h b/vtkm/exec/arg/ThreadIndicesReduceByKey.h index 9cdf94f73..1f22331fd 100644 --- a/vtkm/exec/arg/ThreadIndicesReduceByKey.h +++ b/vtkm/exec/arg/ThreadIndicesReduceByKey.h @@ -45,7 +45,9 @@ class ThreadIndicesReduceByKey : public vtkm::exec::arg::ThreadIndicesBasic public: template VTKM_EXEC ThreadIndicesReduceByKey( - vtkm::Id threadIndex, vtkm::Id inIndex, vtkm::IdComponent visitIndex, + vtkm::Id threadIndex, + vtkm::Id inIndex, + vtkm::IdComponent visitIndex, const vtkm::exec::internal::ReduceByKeyLookup& keyLookup, vtkm::Id globalThreadIndexOffset = 0) : Superclass(threadIndex, inIndex, visitIndex, globalThreadIndexOffset) diff --git a/vtkm/exec/arg/ThreadIndicesTopologyMap.h b/vtkm/exec/arg/ThreadIndicesTopologyMap.h index 6ef9e7708..c3dc4e834 100644 --- a/vtkm/exec/arg/ThreadIndicesTopologyMap.h +++ b/vtkm/exec/arg/ThreadIndicesTopologyMap.h @@ -79,11 +79,14 @@ public: VTKM_SUPPRESS_EXEC_WARNINGS template - VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, const OutToInArrayType& outToIn, + VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, + const OutToInArrayType& outToIn, const VisitArrayType& visit, const ConnectivityType& connectivity, vtkm::Id globalThreadIndexOffset = 0) - : Superclass(threadIndex, outToIn.Get(threadIndex), visit.Get(threadIndex), + : Superclass(threadIndex, + outToIn.Get(threadIndex), + visit.Get(threadIndex), globalThreadIndexOffset) , CellShape(detail::CellShapeInitializer::GetDefault()) { @@ -98,7 +101,9 @@ public: VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC - ThreadIndicesTopologyMap(vtkm::Id threadIndex, vtkm::Id inIndex, vtkm::IdComponent visitIndex, + ThreadIndicesTopologyMap(vtkm::Id threadIndex, + vtkm::Id inIndex, + vtkm::IdComponent visitIndex, const ConnectivityType& connectivity, vtkm::Id globalThreadIndexOffset = 0) : Superclass(threadIndex, inIndex, visitIndex, globalThreadIndexOffset) @@ -199,7 +204,8 @@ public: using LogicalIndexType = typename ConnectivityType::SchedulingRangeType; template - VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, const OutToInArrayType& outToIn, + VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, + const OutToInArrayType& outToIn, const VisitArrayType& visit, const ConnectivityType& connectivity, vtkm::Id globalThreadIndexOffset = 0) @@ -215,7 +221,8 @@ public: } template - VTKM_EXEC ThreadIndicesTopologyMap(const vtkm::Id3& threadIndex, const OutToInArrayType&, + VTKM_EXEC ThreadIndicesTopologyMap(const vtkm::Id3& threadIndex, + const OutToInArrayType&, const VisitArrayType& visit, const ConnectivityType& connectivity, const vtkm::Id globalThreadIndexOffset = 0) @@ -237,8 +244,10 @@ public: VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC - ThreadIndicesTopologyMap(vtkm::Id threadIndex, vtkm::Id vtkmNotUsed(inIndex), - vtkm::IdComponent visitIndex, const ConnectivityType& connectivity, + ThreadIndicesTopologyMap(vtkm::Id threadIndex, + vtkm::Id vtkmNotUsed(inIndex), + vtkm::IdComponent visitIndex, + const ConnectivityType& connectivity, vtkm::Id globalThreadIndexOffset = 0) { this->InputIndex = threadIndex; @@ -338,13 +347,17 @@ private: }; // Specialization for permuted structured connectivity types. -template class ThreadIndicesTopologyMap>> + PermutationPortal, + vtkm::exec::ConnectivityStructured>> { using PermutedConnectivityType = vtkm::exec::ConnectivityPermuted< - PermutationPortal, vtkm::exec::ConnectivityStructured>; + PermutationPortal, + vtkm::exec::ConnectivityStructured>; using ConnectivityType = vtkm::exec::ConnectivityStructured; public: @@ -353,7 +366,8 @@ public: using LogicalIndexType = typename ConnectivityType::SchedulingRangeType; template - VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, const OutToInArrayType& outToIn, + VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, + const OutToInArrayType& outToIn, const VisitArrayType& visit, const PermutedConnectivityType& permutation, vtkm::Id globalThreadIndexOffset = 0) @@ -371,7 +385,8 @@ public: VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC - ThreadIndicesTopologyMap(vtkm::Id threadIndex, vtkm::Id vtkmNotUsed(inIndex), + ThreadIndicesTopologyMap(vtkm::Id threadIndex, + vtkm::Id vtkmNotUsed(inIndex), vtkm::IdComponent visitIndex, const PermutedConnectivityType& permutation, vtkm::Id globalThreadIndexOffset = 0) diff --git a/vtkm/exec/arg/ValueCount.h b/vtkm/exec/arg/ValueCount.h index 488c3f5c9..4f6a463ac 100644 --- a/vtkm/exec/arg/ValueCount.h +++ b/vtkm/exec/arg/ValueCount.h @@ -54,8 +54,10 @@ struct ValueCount : vtkm::exec::arg::ExecutionSignatureTagBase }; template -struct Fetch +struct Fetch { using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesReduceByKey; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn.cxx index 9b4fd2c2b..b3fc612f5 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn.cxx @@ -55,7 +55,8 @@ struct FetchArrayDirectInTests typedef vtkm::exec::arg::Fetch> + vtkm::exec::arg::ThreadIndicesTesting, + TestPortal> FetchType; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectInOut.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectInOut.cxx index 1f8780411..a4bc41e15 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectInOut.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectInOut.cxx @@ -68,7 +68,8 @@ struct FetchArrayDirectInTests typedef vtkm::exec::arg::Fetch> + vtkm::exec::arg::ThreadIndicesTesting, + TestPortal> FetchType; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectOut.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectOut.cxx index c3dacccde..77884d63a 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectOut.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectOut.cxx @@ -60,7 +60,8 @@ struct FetchArrayDirectOutTests typedef vtkm::exec::arg::Fetch> + vtkm::exec::arg::ThreadIndicesTesting, + TestPortal> FetchType; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx index 4f8b97891..da34df33d 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx @@ -76,14 +76,15 @@ struct FetchArrayTopologyMapInTests typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; typedef vtkm::exec::arg::Fetch> FetchType; FetchType fetch; - ThreadIndicesType indices(0, invocation.OutputToInputMap, invocation.VisitArray, - invocation.GetInputDomain()); + ThreadIndicesType indices( + 0, invocation.OutputToInputMap, invocation.VisitArray, invocation.GetInputDomain()); typename FetchType::ValueType value = fetch.Load(indices, invocation.Parameters.template GetParameter()); @@ -105,14 +106,17 @@ struct FetchArrayTopologyMapInTests std::cout << "Trying ArrayTopologyMapIn fetch on parameter " << ParamIndex << " with type " << vtkm::testing::TypeName::Name() << std::endl; - typedef vtkm::internal::FunctionInterface + typedef vtkm::internal::FunctionInterface BaseFunctionInterface; vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals; connectivityInternals.SetPointDimensions(vtkm::Id3(2, 2, 2)); - vtkm::exec::ConnectivityStructured connectivity(connectivityInternals); @@ -120,7 +124,10 @@ struct FetchArrayTopologyMapInTests BaseFunctionInterface() .Replace(connectivity) .template Replace(TestPortal()), - BaseFunctionInterface(), BaseFunctionInterface(), TestIndexPortal(), TestZeroPortal())); + BaseFunctionInterface(), + BaseFunctionInterface(), + TestIndexPortal(), + TestZeroPortal())); } }; @@ -144,47 +151,58 @@ void TryStructuredPointCoordinatesInvocation(const Invocation& invocation) typedef vtkm::exec::arg::ThreadIndicesTopologyMap ThreadIndicesType; vtkm::exec::arg::Fetch fetch; vtkm::Vec origin = TestValue(0, vtkm::Vec()); vtkm::Vec spacing = TestValue(1, vtkm::Vec()); - vtkm::VecRectilinearPointCoordinates value = - fetch.Load(ThreadIndicesType(0, invocation.OutputToInputMap, invocation.VisitArray, - invocation.GetInputDomain()), - invocation.Parameters.template GetParameter()); + vtkm::VecRectilinearPointCoordinates value = fetch.Load( + ThreadIndicesType( + 0, invocation.OutputToInputMap, invocation.VisitArray, invocation.GetInputDomain()), + invocation.Parameters.template GetParameter()); VTKM_TEST_ASSERT(test_equal(value.GetOrigin(), origin), "Bad origin."); VTKM_TEST_ASSERT(test_equal(value.GetSpacing(), spacing), "Bad spacing."); origin[0] += spacing[0]; - value = fetch.Load(ThreadIndicesType(1, invocation.OutputToInputMap, invocation.VisitArray, - invocation.GetInputDomain()), - invocation.Parameters.template GetParameter()); + value = fetch.Load( + ThreadIndicesType( + 1, invocation.OutputToInputMap, invocation.VisitArray, invocation.GetInputDomain()), + invocation.Parameters.template GetParameter()); VTKM_TEST_ASSERT(test_equal(value.GetOrigin(), origin), "Bad origin."); VTKM_TEST_ASSERT(test_equal(value.GetSpacing(), spacing), "Bad spacing."); } template void TryStructuredPointCoordinates( - const vtkm::exec::ConnectivityStructured< - vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, NumDimensions>& connectivity, + const vtkm::exec::ConnectivityStructured& connectivity, const vtkm::internal::ArrayPortalUniformPointCoordinates& coordinates) { - typedef vtkm::internal::FunctionInterface BaseFunctionInterface; // Try with topology in argument 1 and point coordinates in argument 2 TryStructuredPointCoordinatesInvocation(vtkm::internal::make_Invocation<1>( BaseFunctionInterface().Replace<1>(connectivity).template Replace<2>(coordinates), - BaseFunctionInterface(), BaseFunctionInterface(), TestIndexPortal(), TestZeroPortal())); + BaseFunctionInterface(), + BaseFunctionInterface(), + TestIndexPortal(), + TestZeroPortal())); // Try again with topology in argument 3 and point coordinates in argument 1 TryStructuredPointCoordinatesInvocation(vtkm::internal::make_Invocation<3>( BaseFunctionInterface().Replace<3>(connectivity).template Replace<1>(coordinates), - BaseFunctionInterface(), BaseFunctionInterface(), TestIndexPortal(), TestZeroPortal())); + BaseFunctionInterface(), + BaseFunctionInterface(), + TestIndexPortal(), + TestZeroPortal())); } void TryStructuredPointCoordinates() @@ -192,7 +210,8 @@ void TryStructuredPointCoordinates() std::cout << "*** Fetching special case of uniform point coordinates. *****" << std::endl; vtkm::internal::ArrayPortalUniformPointCoordinates coordinates( - vtkm::Id3(3, 2, 2), TestValue(0, vtkm::Vec()), + vtkm::Id3(3, 2, 2), + TestValue(0, vtkm::Vec()), TestValue(1, vtkm::Vec())); std::cout << "3D" << std::endl; diff --git a/vtkm/exec/arg/testing/UnitTestFetchExecObject.cxx b/vtkm/exec/arg/testing/UnitTestFetchExecObject.cxx index 95ca5d568..9a36b22bd 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchExecObject.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchExecObject.cxx @@ -50,7 +50,8 @@ void TryInvocation() typedef vtkm::exec::arg::Fetch + vtkm::exec::arg::ThreadIndicesTesting, + TestExecutionObject> FetchType; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchWorkIndex.cxx b/vtkm/exec/arg/testing/UnitTestFetchWorkIndex.cxx index 3db72537c..9769024e6 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchWorkIndex.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchWorkIndex.cxx @@ -35,7 +35,8 @@ void TestWorkIndexFetch() typedef vtkm::exec::arg::Fetch< vtkm::exec::arg::FetchTagArrayDirectIn, // Not used but probably common. - vtkm::exec::arg::AspectTagWorkIndex, vtkm::exec::arg::ThreadIndicesTesting, + vtkm::exec::arg::AspectTagWorkIndex, + vtkm::exec::arg::ThreadIndicesTesting, vtkm::internal::NullType> FetchType; diff --git a/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h b/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h index 731f20457..e05874663 100644 --- a/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h +++ b/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h @@ -196,7 +196,8 @@ struct load_through_texture struct load_through_texture< - T, typename std::enable_if::value>::type> + T, + typename std::enable_if::value>::type> { static const vtkm::IdComponent WillUseTexture = 1; diff --git a/vtkm/exec/cuda/internal/ExecutionPolicy.h b/vtkm/exec/cuda/internal/ExecutionPolicy.h index 95790f8bc..670ca23ad 100644 --- a/vtkm/exec/cuda/internal/ExecutionPolicy.h +++ b/vtkm/exec/cuda/internal/ExecutionPolicy.h @@ -41,7 +41,8 @@ struct vtkm_cuda_policy : thrust::device_execution_policy //or thrust::greater. template __host__ __device__ void sort( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer first, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer first, thrust::system::cuda::pointer last, vtkm::exec::cuda::internal::WrappedBinaryPredicate comp) { //sort for concrete pointers and less than op @@ -51,8 +52,10 @@ __host__ __device__ void sort( template __host__ __device__ void sort_by_key( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer first, - thrust::system::cuda::pointer last, RandomAccessIterator values_first, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer first, + thrust::system::cuda::pointer last, + RandomAccessIterator values_first, vtkm::exec::cuda::internal::WrappedBinaryPredicate comp) { //sort for concrete pointers and less than op //this makes sure that we invoke the thrust radix sort and not merge sort @@ -61,7 +64,8 @@ __host__ __device__ void sort_by_key( template __host__ __device__ void sort( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer first, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer first, thrust::system::cuda::pointer last, vtkm::exec::cuda::internal::WrappedBinaryPredicate> comp) { //sort for concrete pointers and less than op @@ -71,8 +75,10 @@ __host__ __device__ void sort( template __host__ __device__ void sort_by_key( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer first, - thrust::system::cuda::pointer last, RandomAccessIterator values_first, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer first, + thrust::system::cuda::pointer last, + RandomAccessIterator values_first, vtkm::exec::cuda::internal::WrappedBinaryPredicate> comp) { //sort for concrete pointers and less than op //this makes sure that we invoke the thrust radix sort and not merge sort @@ -81,7 +87,8 @@ __host__ __device__ void sort_by_key( template __host__ __device__ void sort( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer first, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer first, thrust::system::cuda::pointer last, vtkm::exec::cuda::internal::WrappedBinaryPredicate comp) { //sort for concrete pointers and greater than op @@ -91,8 +98,10 @@ __host__ __device__ void sort( template __host__ __device__ void sort_by_key( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer first, - thrust::system::cuda::pointer last, RandomAccessIterator values_first, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer first, + thrust::system::cuda::pointer last, + RandomAccessIterator values_first, vtkm::exec::cuda::internal::WrappedBinaryPredicate comp) { //sort for concrete pointers and greater than op //this makes sure that we invoke the thrust radix sort and not merge sort @@ -101,7 +110,8 @@ __host__ __device__ void sort_by_key( template __host__ __device__ void sort( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer first, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer first, thrust::system::cuda::pointer last, vtkm::exec::cuda::internal::WrappedBinaryPredicate> comp) { //sort for concrete pointers and greater than op @@ -111,8 +121,10 @@ __host__ __device__ void sort( template __host__ __device__ void sort_by_key( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer first, - thrust::system::cuda::pointer last, RandomAccessIterator values_first, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer first, + thrust::system::cuda::pointer last, + RandomAccessIterator values_first, vtkm::exec::cuda::internal::WrappedBinaryPredicate> comp) { //sort for concrete pointers and greater than op //this makes sure that we invoke the thrust radix sort and not merge sort @@ -120,8 +132,10 @@ __host__ __device__ void sort_by_key( } template -__host__ __device__ void sort(const vtkm_cuda_policy& exec, RandomAccessIterator first, - RandomAccessIterator last, StrictWeakOrdering comp) +__host__ __device__ void sort(const vtkm_cuda_policy& exec, + RandomAccessIterator first, + RandomAccessIterator last, + StrictWeakOrdering comp) { //At this point the pointer type is not a cuda pointers and/or //the operator is not an approved less/greater operator. @@ -130,9 +144,11 @@ __host__ __device__ void sort(const vtkm_cuda_policy& exec, RandomAccessIterator return thrust::sort(thrust::cuda::par, first, last, comp); } -template -__host__ __device__ void sort_by_key(const vtkm_cuda_policy& exec, RandomAccessIteratorKeys first, +__host__ __device__ void sort_by_key(const vtkm_cuda_policy& exec, + RandomAccessIteratorKeys first, RandomAccessIteratorKeys last, RandomAccessIteratorValues values_first, StrictWeakOrdering comp) @@ -144,19 +160,32 @@ __host__ __device__ void sort_by_key(const vtkm_cuda_policy& exec, RandomAccessI return thrust::sort_by_key(thrust::cuda::par, first, last, values_first, comp); } -template +template __host__ __device__::thrust::pair reduce_by_key( - const vtkm_cuda_policy& exec, thrust::system::cuda::pointer keys_first, - thrust::system::cuda::pointer keys_last, InputIterator2 values_first, - OutputIterator1 keys_output, OutputIterator2 values_output, BinaryPredicate binary_pred, + const vtkm_cuda_policy& exec, + thrust::system::cuda::pointer keys_first, + thrust::system::cuda::pointer keys_last, + InputIterator2 values_first, + OutputIterator1 keys_output, + OutputIterator2 values_output, + BinaryPredicate binary_pred, BinaryFunction binary_op) { #if defined(__CUDACC_VER__) && (__CUDACC_VER__ >= 70500) && (__CUDACC_VER__ < 80000) - ::thrust::pair result = - thrust::reduce_by_key(thrust::cuda::par, keys_first.get(), keys_last.get(), values_first, - keys_output, values_output, binary_pred, binary_op); + ::thrust::pair result = thrust::reduce_by_key(thrust::cuda::par, + keys_first.get(), + keys_last.get(), + values_first, + keys_output, + values_output, + binary_pred, + binary_op); //only sync if we are being invoked from the host #ifndef __CUDA_ARCH__ @@ -165,8 +194,14 @@ __host__ __device__::thrust::pair reduce_by_ke return result; #else - return thrust::reduce_by_key(thrust::cuda::par, keys_first, keys_last, values_first, keys_output, - values_output, binary_pred, binary_op); + return thrust::reduce_by_key(thrust::cuda::par, + keys_first, + keys_last, + values_first, + keys_output, + values_output, + binary_pred, + binary_op); #endif } diff --git a/vtkm/exec/cuda/internal/IteratorFromArrayPortal.h b/vtkm/exec/cuda/internal/IteratorFromArrayPortal.h index 75d84359d..1b73b04d8 100644 --- a/vtkm/exec/cuda/internal/IteratorFromArrayPortal.h +++ b/vtkm/exec/cuda/internal/IteratorFromArrayPortal.h @@ -86,10 +86,12 @@ struct PortalValue template class IteratorFromArrayPortal - : public ::thrust::iterator_facade< - IteratorFromArrayPortal, typename ArrayPortalType::ValueType, - ::thrust::system::cuda::tag, ::thrust::random_access_traversal_tag, - PortalValue, std::ptrdiff_t> + : public ::thrust::iterator_facade, + typename ArrayPortalType::ValueType, + ::thrust::system::cuda::tag, + ::thrust::random_access_traversal_tag, + PortalValue, + std::ptrdiff_t> { public: VTKM_EXEC_CONT diff --git a/vtkm/exec/cuda/internal/ThrustPatches.h b/vtkm/exec/cuda/internal/ThrustPatches.h index b0658e99b..011d34a51 100644 --- a/vtkm/exec/cuda/internal/ThrustPatches.h +++ b/vtkm/exec/cuda/internal/ThrustPatches.h @@ -58,10 +58,16 @@ namespace accumulate_detail // //This specialization needs to be included before ANY thrust includes otherwise //other device code inside thrust that calls it will not see it -template __device__ T -destructive_accumulate_n(ConcurrentGroup& g, RandomAccessIterator first, Size n, T init, +destructive_accumulate_n(ConcurrentGroup& g, + RandomAccessIterator first, + Size n, + T init, vtkm::exec::cuda::internal::WrappedBinaryOperator binary_op) { typedef typename ConcurrentGroup::size_type size_type; diff --git a/vtkm/exec/internal/ReduceByKeyLookup.h b/vtkm/exec/internal/ReduceByKeyLookup.h index cc0feed82..af43f588a 100644 --- a/vtkm/exec/internal/ReduceByKeyLookup.h +++ b/vtkm/exec/internal/ReduceByKeyLookup.h @@ -55,8 +55,10 @@ struct ReduceByKeyLookup : vtkm::exec::ExecutionObjectBase IdComponentPortalType Counts; VTKM_EXEC_CONT - ReduceByKeyLookup(const KeyPortalType& uniqueKeys, const IdPortalType& sortedValuesMap, - const IdPortalType& offsets, const IdComponentPortalType& counts) + ReduceByKeyLookup(const KeyPortalType& uniqueKeys, + const IdPortalType& sortedValuesMap, + const IdPortalType& offsets, + const IdComponentPortalType& counts) : UniqueKeys(uniqueKeys) , SortedValuesMap(sortedValuesMap) , Offsets(offsets) diff --git a/vtkm/exec/internal/TaskSingular.h b/vtkm/exec/internal/TaskSingular.h index 1fca62ffe..b352d9441 100644 --- a/vtkm/exec/internal/TaskSingular.h +++ b/vtkm/exec/internal/TaskSingular.h @@ -46,7 +46,8 @@ class TaskSingular : public vtkm::exec::TaskBase { public: VTKM_CONT - TaskSingular(const WorkletType& worklet, const InvocationType& invocation, + TaskSingular(const WorkletType& worklet, + const InvocationType& invocation, const vtkm::Id& globalIndexOffset = 0) : Worklet(worklet) , Invocation(invocation) @@ -64,11 +65,13 @@ public: VTKM_EXEC void operator()(T index) const { //Todo: rename this function to DoTaskSingular - detail::DoWorkletInvokeFunctor( - this->Worklet, this->Invocation, - this->Worklet.GetThreadIndices(index, this->Invocation.OutputToInputMap, - this->Invocation.VisitArray, this->Invocation.GetInputDomain(), - GlobalIndexOffset)); + detail::DoWorkletInvokeFunctor(this->Worklet, + this->Invocation, + this->Worklet.GetThreadIndices(index, + this->Invocation.OutputToInputMap, + this->Invocation.VisitArray, + this->Invocation.GetInputDomain(), + GlobalIndexOffset)); } private: diff --git a/vtkm/exec/internal/WorkletInvokeFunctorDetail.h b/vtkm/exec/internal/WorkletInvokeFunctorDetail.h index e0dcf6551..efdabee24 100644 --- a/vtkm/exec/internal/WorkletInvokeFunctorDetail.h +++ b/vtkm/exec/internal/WorkletInvokeFunctorDetail.h @@ -28,9 +28,8 @@ #ifndef vtk_m_exec_internal_WorkletInvokeFunctorDetail_h #define vtk_m_exec_internal_WorkletInvokeFunctorDetail_h -#if !defined(vtk_m_exec_internal_TaskSingular_h) && \ - !defined(vtk_m_exec_internal_TaskTiling_h) && \ - !defined(VTKM_TEST_HEADER_BUILD) +#if !defined(vtk_m_exec_internal_TaskSingular_h) && !defined(vtk_m_exec_internal_TaskTiling_h) && \ + !defined(VTKM_TEST_HEADER_BUILD) #error WorkletInvokeFunctorDetail.h must be included from TaskSingular.h or TaskTiling.h #endif @@ -43,82 +42,82 @@ #error Mismatch of maximum parameters between FunctionInterfaceDatailPre.h.in and WorkletInvokeFunctorDetail.h.in #endif - -namespace vtkm { -namespace exec { -namespace internal { -namespace detail { +namespace vtkm +{ +namespace exec +{ +namespace internal +{ +namespace detail +{ /// A helper class that takes an \c Invocation object and an index to a /// parameter in the ExecutionSignature and finds the \c Fetch type valid for /// that parameter. -template +template struct InvocationToFetch { - typedef typename Invocation::ExecutionInterface:: - template ParameterType::type - ExecutionSignatureTag; + typedef + typename Invocation::ExecutionInterface::template ParameterType::type + ExecutionSignatureTag; // Expected fields from ExecutionSignatureTag. If these do not exist in // ExecutionSignatureTag, then something that is not really an execution // signature tag was used in an ExecutionSignature. - static const vtkm::IdComponent ControlParameterIndex = - ExecutionSignatureTag::INDEX; + static const vtkm::IdComponent ControlParameterIndex = ExecutionSignatureTag::INDEX; typedef typename ExecutionSignatureTag::AspectTag AspectTag; // Find the fetch tag from the control signature tag pointed to by // ParameterIndex. typedef typename Invocation::ControlInterface ControlInterface; - typedef typename ControlInterface:: - template ParameterType::type ControlSignatureTag; + typedef typename ControlInterface::template ParameterType::type + ControlSignatureTag; typedef typename ControlSignatureTag::FetchTag FetchTag; - typedef typename Invocation::ParameterInterface:: - template ParameterType::type ExecObjectType; + typedef + typename Invocation::ParameterInterface::template ParameterType::type + ExecObjectType; - typedef vtkm::exec::arg::Fetch< - FetchTag,AspectTag,ThreadIndicesType,ExecObjectType> type; + typedef vtkm::exec::arg::Fetch type; }; -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -134,46 +133,47 @@ void DoWorkletInvokeFunctor( ReturnValueType r = ReturnValueType(worklet(p1)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -186,55 +186,54 @@ void DoWorkletInvokeFunctor( // parameter is wrong and the types that did not match. worklet(p1); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -247,59 +246,61 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2)); + ReturnValueType r = ReturnValueType(worklet(p1, p2)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -310,67 +311,67 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2); + worklet(p1, p2); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -383,69 +384,72 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2,p3)); + ReturnValueType r = ReturnValueType(worklet(p1, p2, p3)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -456,77 +460,78 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2,p3); + worklet(p1, p2, p3); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -539,79 +544,83 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2,p3,p4)); + ReturnValueType r = ReturnValueType(worklet(p1, p2, p3, p4)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -622,87 +631,89 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2,p3,p4); + worklet(p1, p2, p3, p4); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -715,89 +726,94 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2,p3,p4,p5)); + ReturnValueType r = ReturnValueType(worklet(p1, p2, p3, p4, p5)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -808,97 +824,100 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2,p3,p4,p5); + worklet(p1, p2, p3, p4, p5); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { - typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + typedef vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -911,99 +930,106 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2,p3,p4,p5,p6)); + ReturnValueType r = ReturnValueType(worklet(p1, p2, p3, p4, p5, p6)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -1014,107 +1040,112 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2,p3,p4,p5,p6); + worklet(p1, p2, p3, p4, p5, p6); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo7; + typedef InvocationToFetch FetchInfo7; typedef typename FetchInfo7::type FetchType7; FetchType7 fetch7; typename FetchType7::ValueType p7 = - fetch7.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch7.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -1127,109 +1158,118 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2,p3,p4,p5,p6,p7)); + ReturnValueType r = ReturnValueType(worklet(p1, p2, p3, p4, p5, p6, p7)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); - fetch7.Store( - threadIndices, invocation.Parameters.template GetParameter(), p7); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); + fetch7.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p7); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation< + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo7; + typedef InvocationToFetch FetchInfo7; typedef typename FetchInfo7::type FetchType7; FetchType7 fetch7; typename FetchType7::ValueType p7 = - fetch7.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch7.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -1240,117 +1280,124 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2,p3,p4,p5,p6,p7); + worklet(p1, p2, p3, p4, p5, p6, p7); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); - fetch7.Store( - threadIndices, invocation.Parameters.template GetParameter(), p7); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); + fetch7.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p7); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation< + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo7; + typedef InvocationToFetch FetchInfo7; typedef typename FetchInfo7::type FetchType7; FetchType7 fetch7; typename FetchType7::ValueType p7 = - fetch7.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch7.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo8; + typedef InvocationToFetch FetchInfo8; typedef typename FetchInfo8::type FetchType8; FetchType8 fetch8; typename FetchType8::ValueType p8 = - fetch8.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch8.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -1363,119 +1410,129 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2,p3,p4,p5,p6,p7,p8)); + ReturnValueType r = ReturnValueType(worklet(p1, p2, p3, p4, p5, p6, p7, p8)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); - fetch7.Store( - threadIndices, invocation.Parameters.template GetParameter(), p7); - fetch8.Store( - threadIndices, invocation.Parameters.template GetParameter(), p8); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); + fetch7.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p7); + fetch8.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p8); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation< + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo7; + typedef InvocationToFetch FetchInfo7; typedef typename FetchInfo7::type FetchType7; FetchType7 fetch7; typename FetchType7::ValueType p7 = - fetch7.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch7.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo8; + typedef InvocationToFetch FetchInfo8; typedef typename FetchInfo8::type FetchType8; FetchType8 fetch8; typename FetchType8::ValueType p8 = - fetch8.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch8.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -1486,127 +1543,135 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2,p3,p4,p5,p6,p7,p8); + worklet(p1, p2, p3, p4, p5, p6, p7, p8); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); - fetch7.Store( - threadIndices, invocation.Parameters.template GetParameter(), p7); - fetch8.Store( - threadIndices, invocation.Parameters.template GetParameter(), p8); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); + fetch7.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p7); + fetch8.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p8); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation< + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo7; + typedef InvocationToFetch FetchInfo7; typedef typename FetchInfo7::type FetchType7; FetchType7 fetch7; typename FetchType7::ValueType p7 = - fetch7.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch7.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo8; + typedef InvocationToFetch FetchInfo8; typedef typename FetchInfo8::type FetchType8; FetchType8 fetch8; typename FetchType8::ValueType p8 = - fetch8.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch8.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo9; + typedef InvocationToFetch FetchInfo9; typedef typename FetchInfo9::type FetchType9; FetchType9 fetch9; typename FetchType9::ValueType p9 = - fetch9.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch9.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -1619,129 +1684,140 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2,p3,p4,p5,p6,p7,p8,p9)); + ReturnValueType r = ReturnValueType(worklet(p1, p2, p3, p4, p5, p6, p7, p8, p9)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); - fetch7.Store( - threadIndices, invocation.Parameters.template GetParameter(), p7); - fetch8.Store( - threadIndices, invocation.Parameters.template GetParameter(), p8); - fetch9.Store( - threadIndices, invocation.Parameters.template GetParameter(), p9); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); + fetch7.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p7); + fetch8.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p8); + fetch9.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p9); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation< + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo7; + typedef InvocationToFetch FetchInfo7; typedef typename FetchInfo7::type FetchType7; FetchType7 fetch7; typename FetchType7::ValueType p7 = - fetch7.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch7.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo8; + typedef InvocationToFetch FetchInfo8; typedef typename FetchInfo8::type FetchType8; FetchType8 fetch8; typename FetchType8::ValueType p8 = - fetch8.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch8.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo9; + typedef InvocationToFetch FetchInfo9; typedef typename FetchInfo9::type FetchType9; FetchType9 fetch9; typename FetchType9::ValueType p9 = - fetch9.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch9.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -1752,137 +1828,146 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2,p3,p4,p5,p6,p7,p8,p9); + worklet(p1, p2, p3, p4, p5, p6, p7, p8, p9); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); - fetch7.Store( - threadIndices, invocation.Parameters.template GetParameter(), p7); - fetch8.Store( - threadIndices, invocation.Parameters.template GetParameter(), p8); - fetch9.Store( - threadIndices, invocation.Parameters.template GetParameter(), p9); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); + fetch7.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p7); + fetch8.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p8); + fetch9.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p9); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation< + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo7; + typedef InvocationToFetch FetchInfo7; typedef typename FetchInfo7::type FetchType7; FetchType7 fetch7; typename FetchType7::ValueType p7 = - fetch7.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch7.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo8; + typedef InvocationToFetch FetchInfo8; typedef typename FetchInfo8::type FetchType8; FetchType8 fetch8; typename FetchType8::ValueType p8 = - fetch8.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch8.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo9; + typedef InvocationToFetch FetchInfo9; typedef typename FetchInfo9::type FetchType9; FetchType9 fetch9; typename FetchType9::ValueType p9 = - fetch9.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch9.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo10; + typedef InvocationToFetch FetchInfo10; typedef typename FetchInfo10::type FetchType10; FetchType10 fetch10; typename FetchType10::ValueType p10 = - fetch10.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch10.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo0; + typedef InvocationToFetch FetchInfo0; typedef typename FetchInfo0::type ReturnFetchType; typedef typename ReturnFetchType::ValueType ReturnValueType; ReturnFetchType returnFetch; @@ -1895,139 +1980,151 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - ReturnValueType r = ReturnValueType(worklet(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10)); + ReturnValueType r = ReturnValueType(worklet(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)); returnFetch.Store( - threadIndices, invocation.Parameters.template GetParameter(), r); + threadIndices, + invocation.Parameters.template GetParameter(), + r); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); - fetch7.Store( - threadIndices, invocation.Parameters.template GetParameter(), p7); - fetch8.Store( - threadIndices, invocation.Parameters.template GetParameter(), p8); - fetch9.Store( - threadIndices, invocation.Parameters.template GetParameter(), p9); - fetch10.Store( - threadIndices, invocation.Parameters.template GetParameter(), p10); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); + fetch7.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p7); + fetch8.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p8); + fetch9.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p9); + fetch10.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p10); } -template -VTKM_EXEC -void DoWorkletInvokeFunctor( - const WorkletType &worklet, - const vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> &invocation, - const ThreadIndicesType &threadIndices) +template +VTKM_EXEC void DoWorkletInvokeFunctor( + const WorkletType& worklet, + const vtkm::internal::Invocation< + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType>& invocation, + const ThreadIndicesType& threadIndices) { typedef vtkm::internal::Invocation< - ParameterInterface, - ControlInterface, - vtkm::internal::FunctionInterface, - InputDomainIndex, - OutputToInputMapType, - VisitArrayType> Invocation; + ParameterInterface, + ControlInterface, + vtkm::internal::FunctionInterface, + InputDomainIndex, + OutputToInputMapType, + VisitArrayType> + Invocation; - typedef InvocationToFetch FetchInfo1; + typedef InvocationToFetch FetchInfo1; typedef typename FetchInfo1::type FetchType1; FetchType1 fetch1; typename FetchType1::ValueType p1 = - fetch1.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch1.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo2; + typedef InvocationToFetch FetchInfo2; typedef typename FetchInfo2::type FetchType2; FetchType2 fetch2; typename FetchType2::ValueType p2 = - fetch2.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch2.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo3; + typedef InvocationToFetch FetchInfo3; typedef typename FetchInfo3::type FetchType3; FetchType3 fetch3; typename FetchType3::ValueType p3 = - fetch3.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch3.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo4; + typedef InvocationToFetch FetchInfo4; typedef typename FetchInfo4::type FetchType4; FetchType4 fetch4; typename FetchType4::ValueType p4 = - fetch4.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch4.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo5; + typedef InvocationToFetch FetchInfo5; typedef typename FetchInfo5::type FetchType5; FetchType5 fetch5; typename FetchType5::ValueType p5 = - fetch5.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch5.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo6; + typedef InvocationToFetch FetchInfo6; typedef typename FetchInfo6::type FetchType6; FetchType6 fetch6; typename FetchType6::ValueType p6 = - fetch6.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch6.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo7; + typedef InvocationToFetch FetchInfo7; typedef typename FetchInfo7::type FetchType7; FetchType7 fetch7; typename FetchType7::ValueType p7 = - fetch7.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch7.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo8; + typedef InvocationToFetch FetchInfo8; typedef typename FetchInfo8::type FetchType8; FetchType8 fetch8; typename FetchType8::ValueType p8 = - fetch8.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch8.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo9; + typedef InvocationToFetch FetchInfo9; typedef typename FetchInfo9::type FetchType9; FetchType9 fetch9; typename FetchType9::ValueType p9 = - fetch9.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch9.Load(threadIndices, + invocation.Parameters.template GetParameter()); - typedef InvocationToFetch FetchInfo10; + typedef InvocationToFetch FetchInfo10; typedef typename FetchInfo10::type FetchType10; FetchType10 fetch10; typename FetchType10::ValueType p10 = - fetch10.Load( - threadIndices, invocation.Parameters.template GetParameter()); + fetch10.Load(threadIndices, + invocation.Parameters.template GetParameter()); // If you got a compile error on the following line, it probably means that // the operator() of a worklet does not match the definition expected. One @@ -2038,31 +2135,39 @@ void DoWorkletInvokeFunctor( // that the types of the worklet operator() parameters match those in the // ExecutionSignature. The compiler error might help you narrow down which // parameter is wrong and the types that did not match. - worklet(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10); + worklet(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); - fetch1.Store( - threadIndices, invocation.Parameters.template GetParameter(), p1); - fetch2.Store( - threadIndices, invocation.Parameters.template GetParameter(), p2); - fetch3.Store( - threadIndices, invocation.Parameters.template GetParameter(), p3); - fetch4.Store( - threadIndices, invocation.Parameters.template GetParameter(), p4); - fetch5.Store( - threadIndices, invocation.Parameters.template GetParameter(), p5); - fetch6.Store( - threadIndices, invocation.Parameters.template GetParameter(), p6); - fetch7.Store( - threadIndices, invocation.Parameters.template GetParameter(), p7); - fetch8.Store( - threadIndices, invocation.Parameters.template GetParameter(), p8); - fetch9.Store( - threadIndices, invocation.Parameters.template GetParameter(), p9); - fetch10.Store( - threadIndices, invocation.Parameters.template GetParameter(), p10); + fetch1.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p1); + fetch2.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p2); + fetch3.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p3); + fetch4.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p4); + fetch5.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p5); + fetch6.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p6); + fetch7.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p7); + fetch8.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p8); + fetch9.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p9); + fetch10.Store(threadIndices, + invocation.Parameters.template GetParameter(), + p10); } - - } } } diff --git a/vtkm/exec/internal/testing/TestingTaskTiling.h b/vtkm/exec/internal/testing/TestingTaskTiling.h index dc96c9593..2aa834790 100644 --- a/vtkm/exec/internal/testing/TestingTaskTiling.h +++ b/vtkm/exec/internal/testing/TestingTaskTiling.h @@ -107,8 +107,10 @@ namespace arg using namespace vtkm::exec::internal::testing; template <> -struct Fetch +struct Fetch { typedef vtkm::Id ValueType; @@ -127,8 +129,10 @@ struct Fetch -struct Fetch +struct Fetch { typedef vtkm::Id ValueType; @@ -140,7 +144,8 @@ struct Fetch TestExecution typedef vtkm::internal::FunctionInterface ExecutionParameterInterface; -typedef vtkm::internal::Invocation InvocationType1; -typedef vtkm::internal::Invocation InvocationType2; @@ -190,25 +201,35 @@ struct TestWorkletProxy : vtkm::exec::FunctorBase VTKM_EXEC vtkm::Id operator()(vtkm::Id input) const { return input + 200; } - template VTKM_EXEC vtkm::exec::arg::ThreadIndicesBasic GetThreadIndices( - const vtkm::Id& threadIndex, const OutToInArrayType& outToIn, const VisitArrayType& visit, - const InputDomainType&, const G& globalThreadIndexOffset) const + const vtkm::Id& threadIndex, + const OutToInArrayType& outToIn, + const VisitArrayType& visit, + const InputDomainType&, + const G& globalThreadIndexOffset) const { - return vtkm::exec::arg::ThreadIndicesBasic(threadIndex, outToIn.Get(threadIndex), - visit.Get(threadIndex), globalThreadIndexOffset); + return vtkm::exec::arg::ThreadIndicesBasic( + threadIndex, outToIn.Get(threadIndex), visit.Get(threadIndex), globalThreadIndexOffset); } - template VTKM_EXEC vtkm::exec::arg::ThreadIndicesBasic GetThreadIndices( - const vtkm::Id3& threadIndex, const OutToInArrayType& outToIn, const VisitArrayType& visit, - const InputDomainType&, const G& globalThreadIndexOffset) const + const vtkm::Id3& threadIndex, + const OutToInArrayType& outToIn, + const VisitArrayType& visit, + const InputDomainType&, + const G& globalThreadIndexOffset) const { const vtkm::Id index = vtkm::dot(threadIndex, vtkm::Id3(1, 8, 64)); - return vtkm::exec::arg::ThreadIndicesBasic(index, outToIn.Get(index), visit.Get(index), - globalThreadIndexOffset); + return vtkm::exec::arg::ThreadIndicesBasic( + index, outToIn.Get(index), visit.Get(index), globalThreadIndexOffset); } }; @@ -220,25 +241,35 @@ struct TestWorkletErrorProxy : vtkm::exec::FunctorBase VTKM_EXEC void operator()(vtkm::Id, vtkm::Id) const { this->RaiseError(ERROR_MESSAGE); } - template VTKM_EXEC vtkm::exec::arg::ThreadIndicesBasic GetThreadIndices( - const vtkm::Id& threadIndex, const OutToInArrayType& outToIn, const VisitArrayType& visit, - const InputDomainType&, const G& globalThreadIndexOffset) const + const vtkm::Id& threadIndex, + const OutToInArrayType& outToIn, + const VisitArrayType& visit, + const InputDomainType&, + const G& globalThreadIndexOffset) const { - return vtkm::exec::arg::ThreadIndicesBasic(threadIndex, outToIn.Get(threadIndex), - visit.Get(threadIndex), globalThreadIndexOffset); + return vtkm::exec::arg::ThreadIndicesBasic( + threadIndex, outToIn.Get(threadIndex), visit.Get(threadIndex), globalThreadIndexOffset); } - template VTKM_EXEC vtkm::exec::arg::ThreadIndicesBasic GetThreadIndices( - const vtkm::Id3& threadIndex, const OutToInArrayType& outToIn, const VisitArrayType& visit, - const InputDomainType&, const G& globalThreadIndexOffset) const + const vtkm::Id3& threadIndex, + const OutToInArrayType& outToIn, + const VisitArrayType& visit, + const InputDomainType&, + const G& globalThreadIndexOffset) const { const vtkm::Id index = vtkm::dot(threadIndex, vtkm::Id3(1, 8, 64)); - return vtkm::exec::arg::ThreadIndicesBasic(index, outToIn.Get(index), visit.Get(index), - globalThreadIndexOffset); + return vtkm::exec::arg::ThreadIndicesBasic( + index, outToIn.Get(index), visit.Get(index), globalThreadIndexOffset); } }; diff --git a/vtkm/exec/internal/testing/UnitTestTaskSingular.cxx b/vtkm/exec/internal/testing/UnitTestTaskSingular.cxx index 8cc8a5d6c..c36681faf 100644 --- a/vtkm/exec/internal/testing/UnitTestTaskSingular.cxx +++ b/vtkm/exec/internal/testing/UnitTestTaskSingular.cxx @@ -91,8 +91,10 @@ namespace arg { template <> -struct Fetch +struct Fetch { typedef vtkm::Id ValueType; @@ -111,8 +113,10 @@ struct Fetch -struct Fetch +struct Fetch { typedef vtkm::Id ValueType; @@ -124,7 +128,8 @@ struct Fetch TestExecution typedef vtkm::internal::FunctionInterface ExecutionParameterInterface; -typedef vtkm::internal::Invocation InvocationType1; -typedef vtkm::internal::Invocation InvocationType2; @@ -168,14 +179,20 @@ struct TestWorkletProxy : vtkm::exec::FunctorBase VTKM_EXEC vtkm::Id operator()(vtkm::Id input) const { return input + 200; } - template + template VTKM_EXEC vtkm::exec::arg::ThreadIndicesBasic GetThreadIndices( - const T& threadIndex, const OutToInArrayType& outToIn, const VisitArrayType& visit, - const InputDomainType&, const G& globalThreadIndexOffset) const + const T& threadIndex, + const OutToInArrayType& outToIn, + const VisitArrayType& visit, + const InputDomainType&, + const G& globalThreadIndexOffset) const { - return vtkm::exec::arg::ThreadIndicesBasic(threadIndex, outToIn.Get(threadIndex), - visit.Get(threadIndex), globalThreadIndexOffset); + return vtkm::exec::arg::ThreadIndicesBasic( + threadIndex, outToIn.Get(threadIndex), visit.Get(threadIndex), globalThreadIndexOffset); } }; @@ -187,39 +204,48 @@ struct TestWorkletErrorProxy : vtkm::exec::FunctorBase VTKM_EXEC void operator()(vtkm::Id, vtkm::Id) const { this->RaiseError(ERROR_MESSAGE); } - template + template VTKM_EXEC vtkm::exec::arg::ThreadIndicesBasic GetThreadIndices( - const T& threadIndex, const OutToInArrayType& outToIn, const VisitArrayType& visit, - const InputDomainType&, const G& globalThreadIndexOffset) const + const T& threadIndex, + const OutToInArrayType& outToIn, + const VisitArrayType& visit, + const InputDomainType&, + const G& globalThreadIndexOffset) const { - return vtkm::exec::arg::ThreadIndicesBasic(threadIndex, outToIn.Get(threadIndex), - visit.Get(threadIndex), globalThreadIndexOffset); + return vtkm::exec::arg::ThreadIndicesBasic( + threadIndex, outToIn.Get(threadIndex), visit.Get(threadIndex), globalThreadIndexOffset); } }; // Check behavior of InvocationToFetch helper class. VTKM_STATIC_ASSERT( - (std::is_same< - vtkm::exec::internal::detail::InvocationToFetch::type, - vtkm::exec::arg::Fetch>::type::value)); + (std::is_same::type, + vtkm::exec::arg::Fetch>::type::value)); VTKM_STATIC_ASSERT( - (std::is_same< - vtkm::exec::internal::detail::InvocationToFetch::type, - vtkm::exec::arg::Fetch>::type::value)); + (std::is_same::type, + vtkm::exec::arg::Fetch>::type::value)); VTKM_STATIC_ASSERT( - (std::is_same< - vtkm::exec::internal::detail::InvocationToFetch::type, - vtkm::exec::arg::Fetch>::type::value)); + (std::is_same::type, + vtkm::exec::arg::Fetch>::type::value)); void TestNormalFunctorInvoke() { diff --git a/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx b/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx index c7c585c55..3cc08482b 100644 --- a/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx +++ b/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx @@ -91,8 +91,10 @@ namespace arg { template <> -struct Fetch +struct Fetch { typedef vtkm::Id ValueType; @@ -111,8 +113,10 @@ struct Fetch -struct Fetch +struct Fetch { typedef vtkm::Id ValueType; @@ -124,7 +128,8 @@ struct Fetch + template VTKM_EXEC vtkm::exec::arg::ThreadIndicesBasic GetThreadIndices( - const T& threadIndex, const OutToInArrayType& outToIn, const VisitArrayType& visit, - const InputDomainType&, const G& globalThreadIndexOffset) const + const T& threadIndex, + const OutToInArrayType& outToIn, + const VisitArrayType& visit, + const InputDomainType&, + const G& globalThreadIndexOffset) const { - return vtkm::exec::arg::ThreadIndicesBasic(threadIndex, outToIn.Get(threadIndex), - visit.Get(threadIndex), globalThreadIndexOffset); + return vtkm::exec::arg::ThreadIndicesBasic( + threadIndex, outToIn.Get(threadIndex), visit.Get(threadIndex), globalThreadIndexOffset); } }; @@ -170,9 +181,10 @@ template void CallDoWorkletInvokeFunctor(const Invocation& invocation, vtkm::Id index) { vtkm::exec::internal::detail::DoWorkletInvokeFunctor( - TestWorkletProxy(), invocation, - vtkm::exec::arg::ThreadIndicesBasic(index, invocation.OutputToInputMap.Get(index), - invocation.VisitArray.Get(index))); + TestWorkletProxy(), + invocation, + vtkm::exec::arg::ThreadIndicesBasic( + index, invocation.OutputToInputMap.Get(index), invocation.VisitArray.Get(index))); } void TestDoWorkletInvoke() @@ -188,9 +200,11 @@ void TestDoWorkletInvoke() std::cout << " Try void return." << std::endl; inputTestValue = 5; outputTestValue = static_cast(0xDEADDEAD); - CallDoWorkletInvokeFunctor(vtkm::internal::make_Invocation<1>( - execObjects, TestControlInterface(), TestExecutionInterface1(), - MyOutputToInputMapPortal(), MyVisitArrayPortal()), + CallDoWorkletInvokeFunctor(vtkm::internal::make_Invocation<1>(execObjects, + TestControlInterface(), + TestExecutionInterface1(), + MyOutputToInputMapPortal(), + MyVisitArrayPortal()), 1); VTKM_TEST_ASSERT(inputTestValue == 5, "Input value changed."); VTKM_TEST_ASSERT(outputTestValue == inputTestValue + 100 + 30, "Output value not set right."); @@ -198,9 +212,11 @@ void TestDoWorkletInvoke() std::cout << " Try return value." << std::endl; inputTestValue = 6; outputTestValue = static_cast(0xDEADDEAD); - CallDoWorkletInvokeFunctor(vtkm::internal::make_Invocation<1>( - execObjects, TestControlInterface(), TestExecutionInterface2(), - MyOutputToInputMapPortal(), MyVisitArrayPortal()), + CallDoWorkletInvokeFunctor(vtkm::internal::make_Invocation<1>(execObjects, + TestControlInterface(), + TestExecutionInterface2(), + MyOutputToInputMapPortal(), + MyVisitArrayPortal()), 2); VTKM_TEST_ASSERT(inputTestValue == 6, "Input value changed."); VTKM_TEST_ASSERT(outputTestValue == inputTestValue + 200 + 30 * 2, "Output value not set right."); diff --git a/vtkm/exec/serial/internal/TaskTiling.h b/vtkm/exec/serial/internal/TaskTiling.h index 15b541ca7..02d8c379b 100644 --- a/vtkm/exec/serial/internal/TaskTiling.h +++ b/vtkm/exec/serial/internal/TaskTiling.h @@ -44,7 +44,10 @@ void TaskTilingSetErrorBuffer(void* w, const vtkm::exec::internal::ErrorMessageB } template -void TaskTiling1DExecute(void* w, void* const v, vtkm::Id globalIndexOffset, vtkm::Id start, +void TaskTiling1DExecute(void* w, + void* const v, + vtkm::Id globalIndexOffset, + vtkm::Id start, vtkm::Id end) { using WorkletType = typename std::remove_cv::type; @@ -57,9 +60,13 @@ void TaskTiling1DExecute(void* w, void* const v, vtkm::Id globalIndexOffset, vtk { //Todo: rename this function to DoTaskInvokeWorklet vtkm::exec::internal::detail::DoWorkletInvokeFunctor( - *worklet, *invocation, - worklet->GetThreadIndices(index, invocation->OutputToInputMap, invocation->VisitArray, - invocation->GetInputDomain(), globalIndexOffset)); + *worklet, + *invocation, + worklet->GetThreadIndices(index, + invocation->OutputToInputMap, + invocation->VisitArray, + invocation->GetInputDomain(), + globalIndexOffset)); } } @@ -76,8 +83,13 @@ void FunctorTiling1DExecute(void* f, void* const, vtkm::Id, vtkm::Id start, vtkm } template -void TaskTiling3DExecute(void* w, void* const v, vtkm::Id globalIndexOffset, vtkm::Id istart, - vtkm::Id iend, vtkm::Id j, vtkm::Id k) +void TaskTiling3DExecute(void* w, + void* const v, + vtkm::Id globalIndexOffset, + vtkm::Id istart, + vtkm::Id iend, + vtkm::Id j, + vtkm::Id k) { using WorkletType = typename std::remove_cv::type; using InvocationType = typename std::remove_cv::type; @@ -91,15 +103,24 @@ void TaskTiling3DExecute(void* w, void* const v, vtkm::Id globalIndexOffset, vtk index[0] = i; //Todo: rename this function to DoTaskInvokeWorklet vtkm::exec::internal::detail::DoWorkletInvokeFunctor( - *worklet, *invocation, - worklet->GetThreadIndices(index, invocation->OutputToInputMap, invocation->VisitArray, - invocation->GetInputDomain(), globalIndexOffset)); + *worklet, + *invocation, + worklet->GetThreadIndices(index, + invocation->OutputToInputMap, + invocation->VisitArray, + invocation->GetInputDomain(), + globalIndexOffset)); } } template -void FunctorTiling3DExecute(void* f, void* const, vtkm::Id, vtkm::Id istart, vtkm::Id iend, - vtkm::Id j, vtkm::Id k) +void FunctorTiling3DExecute(void* f, + void* const, + vtkm::Id, + vtkm::Id istart, + vtkm::Id iend, + vtkm::Id j, + vtkm::Id k) { using FunctorType = typename std::remove_cv::type; FunctorType const* const functor = static_cast(f); @@ -151,7 +172,8 @@ public: /// This constructor supports any vtkm worklet and the associated invocation /// parameters that go along with it template - TaskTiling1D(WorkletType& worklet, const InvocationType& invocation, + TaskTiling1D(WorkletType& worklet, + const InvocationType& invocation, const vtkm::Id& globalIndexOffset = 0) : Worklet(nullptr) , Invocation(nullptr) @@ -240,7 +262,8 @@ public: } template - TaskTiling3D(WorkletType& worklet, const InvocationType& invocation, + TaskTiling3D(WorkletType& worklet, + const InvocationType& invocation, const vtkm::Id& globalIndexOffset = 0) : Worklet(nullptr) , Invocation(nullptr) @@ -276,16 +299,16 @@ public: void operator()(vtkm::Id istart, vtkm::Id iend, vtkm::Id j, vtkm::Id k) const { - this->ExecuteFunction(this->Worklet, this->Invocation, this->GlobalIndexOffset, istart, iend, j, - k); + this->ExecuteFunction( + this->Worklet, this->Invocation, this->GlobalIndexOffset, istart, iend, j, k); } protected: void* Worklet; void* Invocation; - typedef void (*ExecuteSignature)(void*, void* const, vtkm::Id, vtkm::Id, vtkm::Id, vtkm::Id, - vtkm::Id); + typedef void ( + *ExecuteSignature)(void*, void* const, vtkm::Id, vtkm::Id, vtkm::Id, vtkm::Id, vtkm::Id); ExecuteSignature ExecuteFunction; typedef void (*SetErrorBufferSignature)(void*, const vtkm::exec::internal::ErrorMessageBuffer&); diff --git a/vtkm/exec/testing/UnitTestCellDerivative.cxx b/vtkm/exec/testing/UnitTestCellDerivative.cxx index 13e1a8ddf..79ae8e5a0 100644 --- a/vtkm/exec/testing/UnitTestCellDerivative.cxx +++ b/vtkm/exec/testing/UnitTestCellDerivative.cxx @@ -70,7 +70,9 @@ struct LinearField static const vtkm::IdComponent MAX_POINTS = 8; template -void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeFixed, vtkm::IdComponent& minPoints, +void GetMinMaxPoints(CellShapeTag, + vtkm::CellTraitsTagSizeFixed, + vtkm::IdComponent& minPoints, vtkm::IdComponent& maxPoints) { // If this line fails, then MAX_POINTS is not large enough to support all @@ -80,7 +82,9 @@ void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeFixed, vtkm::IdCompone } template -void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeVariable, vtkm::IdComponent& minPoints, +void GetMinMaxPoints(CellShapeTag, + vtkm::CellTraitsTagSizeVariable, + vtkm::IdComponent& minPoints, vtkm::IdComponent& maxPoints) { minPoints = 1; @@ -91,7 +95,8 @@ template struct TestDerivativeFunctor { template - void DoTestWithWCoords(CellShapeTag shape, const WCoordsVecType worldCoordinates, + void DoTestWithWCoords(CellShapeTag shape, + const WCoordsVecType worldCoordinates, LinearField field, vtkm::Vec expectedGradient) const { @@ -148,7 +153,9 @@ struct TestDerivativeFunctor } template - void DoTest(CellShapeTag shape, vtkm::IdComponent numPoints, LinearField field, + void DoTest(CellShapeTag shape, + vtkm::IdComponent numPoints, + LinearField field, vtkm::Vec expectedGradient) const { // Stuff to fake running in the execution environment. @@ -190,7 +197,8 @@ struct TestDerivativeFunctor std::cout << "Simple field, " << numPoints << " points" << std::endl; for (vtkm::IdComponent fieldComponent = 0; - fieldComponent < FieldTraits::GetNumberOfComponents(FieldType()); fieldComponent++) + fieldComponent < FieldTraits::GetNumberOfComponents(FieldType()); + fieldComponent++) { FieldTraits::SetComponent(field.OriginValue, fieldComponent, 0.0); } @@ -202,7 +210,8 @@ struct TestDerivativeFunctor std::cout << "Uneven gradient, " << numPoints << " points" << std::endl; for (vtkm::IdComponent fieldComponent = 0; - fieldComponent < FieldTraits::GetNumberOfComponents(FieldType()); fieldComponent++) + fieldComponent < FieldTraits::GetNumberOfComponents(FieldType()); + fieldComponent++) { FieldTraits::SetComponent(field.OriginValue, fieldComponent, FieldComponentType(-7.0f)); } @@ -214,7 +223,8 @@ struct TestDerivativeFunctor std::cout << "Negative gradient directions, " << numPoints << " points" << std::endl; for (vtkm::IdComponent fieldComponent = 0; - fieldComponent < FieldTraits::GetNumberOfComponents(FieldType()); fieldComponent++) + fieldComponent < FieldTraits::GetNumberOfComponents(FieldType()); + fieldComponent++) { FieldTraits::SetComponent(field.OriginValue, fieldComponent, FieldComponentType(5.0f)); } @@ -227,7 +237,8 @@ struct TestDerivativeFunctor std::cout << "Random linear field, " << numPoints << " points" << std::endl; std::uniform_real_distribution randomDist(-20.0f, 20.0f); for (vtkm::IdComponent fieldComponent = 0; - fieldComponent < FieldTraits::GetNumberOfComponents(FieldType()); fieldComponent++) + fieldComponent < FieldTraits::GetNumberOfComponents(FieldType()); + fieldComponent++) { FieldTraits::SetComponent(field.OriginValue, fieldComponent, randomDist(g_RandomGenerator)); FieldTraits::SetComponent(field.Gradient[0], fieldComponent, randomDist(g_RandomGenerator)); @@ -245,14 +256,14 @@ struct TestDerivativeFunctor { vtkm::IdComponent minPoints; vtkm::IdComponent maxPoints; - GetMinMaxPoints(CellShapeTag(), typename vtkm::CellTraits::IsSizeFixed(), - minPoints, maxPoints); + GetMinMaxPoints( + CellShapeTag(), typename vtkm::CellTraits::IsSizeFixed(), minPoints, maxPoints); std::cout << "--- Test shape tag directly" << std::endl; for (vtkm::IdComponent numPoints = minPoints; numPoints <= maxPoints; numPoints++) { - this->DoTest(CellShapeTag(), numPoints, - vtkm::CellTraits::TOPOLOGICAL_DIMENSIONS); + this->DoTest( + CellShapeTag(), numPoints, vtkm::CellTraits::TOPOLOGICAL_DIMENSIONS); } std::cout << "--- Test generic shape tag" << std::endl; @@ -298,45 +309,51 @@ void TestDerivative() std::cout << "======== Uniform Point Coordinates 3D =====" << std::endl; testFunctorScalar.DoTestWithWCoords(vtkm::CellShapeTagHexahedron(), vtkm::VecRectilinearPointCoordinates<3>(origin, spacing), - scalarField, expectedScalarGradient); + scalarField, + expectedScalarGradient); std::cout << "======== Uniform Point Coordinates 2D =====" << std::endl; expectedScalarGradient[2] = 0.0; testFunctorScalar.DoTestWithWCoords(vtkm::CellShapeTagQuad(), vtkm::VecRectilinearPointCoordinates<2>(origin, spacing), - scalarField, expectedScalarGradient); + scalarField, + expectedScalarGradient); std::cout << "======== Uniform Point Coordinates 1D =====" << std::endl; expectedScalarGradient[1] = 0.0; testFunctorScalar.DoTestWithWCoords(vtkm::CellShapeTagLine(), vtkm::VecRectilinearPointCoordinates<1>(origin, spacing), - scalarField, expectedScalarGradient); + scalarField, + expectedScalarGradient); LinearField> vectorField; vectorField.OriginValue = vtkm::make_Vec( randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator)); - vectorField.Gradient = - vtkm::make_Vec(vtkm::make_Vec(randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), - randomDist(g_RandomGenerator)), - vtkm::make_Vec(randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), - randomDist(g_RandomGenerator)), - vtkm::make_Vec(randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), - randomDist(g_RandomGenerator))); + vectorField.Gradient = vtkm::make_Vec( + vtkm::make_Vec( + randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator)), + vtkm::make_Vec( + randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator)), + vtkm::make_Vec( + randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator))); vtkm::Vec, 3> expectedVectorGradient = vectorField.Gradient; TestDerivativeFunctor> testFunctorVector; std::cout << "======== Uniform Point Coordinates 3D =====" << std::endl; testFunctorVector.DoTestWithWCoords(vtkm::CellShapeTagHexahedron(), vtkm::VecRectilinearPointCoordinates<3>(origin, spacing), - vectorField, expectedVectorGradient); + vectorField, + expectedVectorGradient); std::cout << "======== Uniform Point Coordinates 2D =====" << std::endl; expectedVectorGradient[2] = vtkm::Vec(0.0); testFunctorVector.DoTestWithWCoords(vtkm::CellShapeTagQuad(), vtkm::VecRectilinearPointCoordinates<2>(origin, spacing), - vectorField, expectedVectorGradient); + vectorField, + expectedVectorGradient); std::cout << "======== Uniform Point Coordinates 1D =====" << std::endl; expectedVectorGradient[1] = vtkm::Vec(0.0); testFunctorVector.DoTestWithWCoords(vtkm::CellShapeTagLine(), vtkm::VecRectilinearPointCoordinates<1>(origin, spacing), - vectorField, expectedVectorGradient); + vectorField, + expectedVectorGradient); } } // anonymous namespace diff --git a/vtkm/exec/testing/UnitTestCellEdgeFace.cxx b/vtkm/exec/testing/UnitTestCellEdgeFace.cxx index fb79ffee2..44103ae3e 100644 --- a/vtkm/exec/testing/UnitTestCellEdgeFace.cxx +++ b/vtkm/exec/testing/UnitTestCellEdgeFace.cxx @@ -46,7 +46,8 @@ void MakeEdgeCononical(EdgeType& edge) struct TestCellFacesFunctor { template - void DoTest(vtkm::IdComponent numPoints, CellShapeTag shape, + void DoTest(vtkm::IdComponent numPoints, + CellShapeTag shape, vtkm::CellTopologicalDimensionsTag<3>) const { // Stuff to fake running in the execution environment. @@ -109,7 +110,8 @@ struct TestCellFacesFunctor // Case of cells that have 2 dimensions (no faces) template - void DoTest(vtkm::IdComponent numPoints, CellShapeTag shape, + void DoTest(vtkm::IdComponent numPoints, + CellShapeTag shape, vtkm::CellTopologicalDimensionsTag<2>) const { // Stuff to fake running in the execution environment. @@ -144,7 +146,8 @@ struct TestCellFacesFunctor // Less important case of cells that have less than 2 dimensions // (no faces or edges) template - void DoTest(vtkm::IdComponent numPoints, CellShapeTag shape, + void DoTest(vtkm::IdComponent numPoints, + CellShapeTag shape, vtkm::CellTopologicalDimensionsTag) const { // Stuff to fake running in the execution environment. @@ -166,12 +169,14 @@ struct TestCellFacesFunctor { std::cout << "--- Test shape tag directly" << " (" << numPoints << " points)" << std::endl; - this->DoTest(numPoints, CellShapeTag(), + this->DoTest(numPoints, + CellShapeTag(), typename vtkm::CellTraits::TopologicalDimensionsTag()); std::cout << "--- Test generic shape tag" << " (" << numPoints << " points)" << std::endl; - this->DoTest(numPoints, vtkm::CellShapeTagGeneric(CellShapeTag::Id), + this->DoTest(numPoints, + vtkm::CellShapeTagGeneric(CellShapeTag::Id), typename vtkm::CellTraits::TopologicalDimensionsTag()); } diff --git a/vtkm/exec/testing/UnitTestCellInterpolate.cxx b/vtkm/exec/testing/UnitTestCellInterpolate.cxx index 630aa3048..b35b4e69b 100644 --- a/vtkm/exec/testing/UnitTestCellInterpolate.cxx +++ b/vtkm/exec/testing/UnitTestCellInterpolate.cxx @@ -36,7 +36,9 @@ namespace static const vtkm::IdComponent MAX_POINTS = 8; template -void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeFixed, vtkm::IdComponent& minPoints, +void GetMinMaxPoints(CellShapeTag, + vtkm::CellTraitsTagSizeFixed, + vtkm::IdComponent& minPoints, vtkm::IdComponent& maxPoints) { // If this line fails, then MAX_POINTS is not large enough to support all @@ -46,7 +48,9 @@ void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeFixed, vtkm::IdCompone } template -void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeVariable, vtkm::IdComponent& minPoints, +void GetMinMaxPoints(CellShapeTag, + vtkm::CellTraitsTagSizeVariable, + vtkm::IdComponent& minPoints, vtkm::IdComponent& maxPoints) { minPoints = 1; @@ -123,8 +127,8 @@ struct TestInterpolateFunctor { vtkm::IdComponent minPoints; vtkm::IdComponent maxPoints; - GetMinMaxPoints(CellShapeTag(), typename vtkm::CellTraits::IsSizeFixed(), - minPoints, maxPoints); + GetMinMaxPoints( + CellShapeTag(), typename vtkm::CellTraits::IsSizeFixed(), minPoints, maxPoints); std::cout << "--- Test shape tag directly" << std::endl; for (vtkm::IdComponent numPoints = minPoints; numPoints <= maxPoints; numPoints++) diff --git a/vtkm/exec/testing/UnitTestParametricCoordinates.cxx b/vtkm/exec/testing/UnitTestParametricCoordinates.cxx index 7c01ed64a..8fda21f77 100644 --- a/vtkm/exec/testing/UnitTestParametricCoordinates.cxx +++ b/vtkm/exec/testing/UnitTestParametricCoordinates.cxx @@ -38,7 +38,9 @@ std::mt19937 g_RandomGenerator; static const vtkm::IdComponent MAX_POINTS = 8; template -void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeFixed, vtkm::IdComponent& minPoints, +void GetMinMaxPoints(CellShapeTag, + vtkm::CellTraitsTagSizeFixed, + vtkm::IdComponent& minPoints, vtkm::IdComponent& maxPoints) { // If this line fails, then MAX_POINTS is not large enough to support all @@ -48,7 +50,9 @@ void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeFixed, vtkm::IdCompone } template -void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeVariable, vtkm::IdComponent& minPoints, +void GetMinMaxPoints(CellShapeTag, + vtkm::CellTraitsTagSizeVariable, + vtkm::IdComponent& minPoints, vtkm::IdComponent& maxPoints) { minPoints = 1; @@ -56,8 +60,10 @@ void GetMinMaxPoints(CellShapeTag, vtkm::CellTraitsTagSizeVariable, vtkm::IdComp } template -static void CompareCoordinates(const PointWCoordsType& pointWCoords, vtkm::Vec truePCoords, - vtkm::Vec trueWCoords, CellShapeTag shape) +static void CompareCoordinates(const PointWCoordsType& pointWCoords, + vtkm::Vec truePCoords, + vtkm::Vec trueWCoords, + CellShapeTag shape) { typedef vtkm::Vec Vector3; @@ -157,8 +163,8 @@ void TestPCoordsSample(const PointWCoordsType& pointWCoords, CellShapeTag shape) // If you convert to world coordinates and back, you should get the // same value. - Vector3 wcoords = vtkm::exec::ParametricCoordinatesToWorldCoordinates(pointWCoords, pcoords, - shape, workletProxy); + Vector3 wcoords = vtkm::exec::ParametricCoordinatesToWorldCoordinates( + pointWCoords, pcoords, shape, workletProxy); VTKM_TEST_ASSERT(!errorMessage.IsErrorRaised(), messageBuffer); Vector3 computedPCoords = vtkm::exec::WorldCoordinatesToParametricCoordinates( pointWCoords, wcoords, shape, workletProxy); @@ -200,8 +206,8 @@ struct TestPCoordsFunctor for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++) { Vector3 pcoords; - vtkm::exec::ParametricCoordinatesPoint(numPoints, pointIndex, pcoords, CellShapeTag(), - workletProxy); + vtkm::exec::ParametricCoordinatesPoint( + numPoints, pointIndex, pcoords, CellShapeTag(), workletProxy); VTKM_TEST_ASSERT(!errorMessage.IsErrorRaised(), messageBuffer); Vector3 wCoords = Vector3(pcoords[0], pcoords[1], pcoords[2] + vtkm::dot(pcoords, sheerVec)); @@ -216,8 +222,8 @@ struct TestPCoordsFunctor { vtkm::IdComponent minPoints; vtkm::IdComponent maxPoints; - GetMinMaxPoints(CellShapeTag(), typename vtkm::CellTraits::IsSizeFixed(), - minPoints, maxPoints); + GetMinMaxPoints( + CellShapeTag(), typename vtkm::CellTraits::IsSizeFixed(), minPoints, maxPoints); std::cout << "--- Test shape tag directly" << std::endl; for (vtkm::IdComponent numPoints = minPoints; numPoints <= maxPoints; numPoints++) diff --git a/vtkm/filter/CellAverage.h b/vtkm/filter/CellAverage.h index cd7421d27..c5d3578d8 100644 --- a/vtkm/filter/CellAverage.h +++ b/vtkm/filter/CellAverage.h @@ -37,9 +37,11 @@ public: template VTKM_CONT vtkm::filter::ResultField DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); private: vtkm::worklet::CellAverage Worklet; diff --git a/vtkm/filter/CellAverage.hxx b/vtkm/filter/CellAverage.hxx index 1cb3469bd..dd47aa7ed 100644 --- a/vtkm/filter/CellAverage.hxx +++ b/vtkm/filter/CellAverage.hxx @@ -37,9 +37,11 @@ inline VTKM_CONT CellAverage::CellAverage() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultField CellAverage::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& inField, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& inField, const vtkm::filter::FieldMetadata& fieldMetadata, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter&) { if (!fieldMetadata.IsPointField()) { @@ -64,8 +66,8 @@ inline VTKM_CONT vtkm::filter::ResultField CellAverage::DoExecute( outputName = fieldMetadata.GetName(); } - return vtkm::filter::ResultField(input, outArray, outputName, vtkm::cont::Field::ASSOC_CELL_SET, - cellSet.GetName()); + return vtkm::filter::ResultField( + input, outArray, outputName, vtkm::cont::Field::ASSOC_CELL_SET, cellSet.GetName()); } } } // namespace vtkm::filter diff --git a/vtkm/filter/CleanGrid.h b/vtkm/filter/CleanGrid.h index d54f54e08..6b00b82b7 100644 --- a/vtkm/filter/CleanGrid.h +++ b/vtkm/filter/CleanGrid.h @@ -59,17 +59,20 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute(const vtkm::cont::DataSet& inData, - vtkm::filter::PolicyBase policy, Device); + vtkm::filter::PolicyBase policy, + Device); template VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, - vtkm::filter::PolicyBase, Device); + vtkm::filter::PolicyBase, + Device); template VTKM_CONT vtkm::cont::ArrayHandle CompactPointArray( - const vtkm::cont::ArrayHandle& inArray, Device) const; + const vtkm::cont::ArrayHandle& inArray, + Device) const; private: bool CompactPointFields; diff --git a/vtkm/filter/CleanGrid.hxx b/vtkm/filter/CleanGrid.hxx index 360341e63..c3a8874ae 100644 --- a/vtkm/filter/CleanGrid.hxx +++ b/vtkm/filter/CleanGrid.hxx @@ -38,7 +38,8 @@ struct CleanCompactPointArrayFunctor std::string Name; const vtkm::filter::CleanGrid* Self; - CleanCompactPointArrayFunctor(vtkm::cont::DataSet& outDataSet, const std::string& name, + CleanCompactPointArrayFunctor(vtkm::cont::DataSet& outDataSet, + const std::string& name, const vtkm::filter::CleanGrid* self) : OutDataSet(outDataSet) , Name(name) @@ -66,7 +67,9 @@ inline VTKM_CONT CleanGrid::CleanGrid() template inline VTKM_CONT vtkm::filter::ResultDataSet CleanGrid::DoExecute( - const vtkm::cont::DataSet& inData, vtkm::filter::PolicyBase policy, Device) + const vtkm::cont::DataSet& inData, + vtkm::filter::PolicyBase policy, + Device) { VTKM_IS_DEVICE_ADAPTER_TAG(Device); @@ -83,8 +86,8 @@ inline VTKM_CONT vtkm::filter::ResultDataSet CleanGrid::DoExecute( vtkm::cont::DynamicCellSet inCellSet = inData.GetCellSet(static_cast(cellSetIndex)); - vtkm::worklet::CellDeepCopy::Run(vtkm::filter::ApplyPolicy(inCellSet, policy), - outputCellSets[cellSetIndex], Device()); + vtkm::worklet::CellDeepCopy::Run( + vtkm::filter::ApplyPolicy(inCellSet, policy), outputCellSets[cellSetIndex], Device()); } // Optionally adjust the cell set indices to remove all unused points @@ -119,7 +122,8 @@ inline VTKM_CONT vtkm::filter::ResultDataSet CleanGrid::DoExecute( // but other fields are not? Why shouldn't the Execute of a filter also set // up all the fields of the output data set? for (vtkm::IdComponent coordSystemIndex = 0; - coordSystemIndex < inData.GetNumberOfCoordinateSystems(); coordSystemIndex++) + coordSystemIndex < inData.GetNumberOfCoordinateSystems(); + coordSystemIndex++) { vtkm::cont::CoordinateSystem coordSystem = inData.GetCoordinateSystem(coordSystemIndex); @@ -140,8 +144,11 @@ inline VTKM_CONT vtkm::filter::ResultDataSet CleanGrid::DoExecute( template inline VTKM_CONT bool CleanGrid::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, - const vtkm::filter::FieldMetadata& fieldMeta, vtkm::filter::PolicyBase, Device) + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, + const vtkm::filter::FieldMetadata& fieldMeta, + vtkm::filter::PolicyBase, + Device) { if (this->GetCompactPointFields() && fieldMeta.IsPointField()) { @@ -158,7 +165,8 @@ inline VTKM_CONT bool CleanGrid::DoMapField( template inline VTKM_CONT vtkm::cont::ArrayHandle CleanGrid::CompactPointArray( - const vtkm::cont::ArrayHandle& inArray, Device) const + const vtkm::cont::ArrayHandle& inArray, + Device) const { VTKM_ASSERT(this->GetCompactPointFields()); diff --git a/vtkm/filter/ClipWithField.h b/vtkm/filter/ClipWithField.h index a65a73361..37dbca7cc 100644 --- a/vtkm/filter/ClipWithField.h +++ b/vtkm/filter/ClipWithField.h @@ -43,9 +43,11 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); //Map a new field onto the resulting dataset after running the filter. //This call is only valid after Execute has been called. diff --git a/vtkm/filter/ClipWithField.hxx b/vtkm/filter/ClipWithField.hxx index c6007b66a..b5cdb563a 100644 --- a/vtkm/filter/ClipWithField.hxx +++ b/vtkm/filter/ClipWithField.hxx @@ -42,9 +42,11 @@ inline VTKM_CONT ClipWithField::ClipWithField() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet ClipWithField::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& device) { if (fieldMeta.IsPointField() == false) { @@ -79,8 +81,10 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ClipWithField::DoExecute( //----------------------------------------------------------------------------- template inline VTKM_CONT bool ClipWithField::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, - const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase&, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, + const vtkm::filter::FieldMetadata& fieldMeta, + const vtkm::filter::PolicyBase&, const DeviceAdapter& device) { if (fieldMeta.IsPointField() == false) diff --git a/vtkm/filter/ClipWithImplicitFunction.h b/vtkm/filter/ClipWithImplicitFunction.h index 0fc1a998d..dc24faaa7 100644 --- a/vtkm/filter/ClipWithImplicitFunction.h +++ b/vtkm/filter/ClipWithImplicitFunction.h @@ -61,7 +61,8 @@ public: bool DoMapField(vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); private: std::shared_ptr Function; diff --git a/vtkm/filter/ClipWithImplicitFunction.hxx b/vtkm/filter/ClipWithImplicitFunction.hxx index 80ccaf6c6..b48a0610f 100644 --- a/vtkm/filter/ClipWithImplicitFunction.hxx +++ b/vtkm/filter/ClipWithImplicitFunction.hxx @@ -32,7 +32,8 @@ namespace filter //----------------------------------------------------------------------------- template inline void ClipWithImplicitFunction::SetImplicitFunction( - const std::shared_ptr& func, const vtkm::filter::PolicyBase&) + const std::shared_ptr& func, + const vtkm::filter::PolicyBase&) { func->ResetDevices(DerivedPolicy::DeviceAdapterList); this->Function = func; @@ -41,7 +42,8 @@ inline void ClipWithImplicitFunction::SetImplicitFunction( //----------------------------------------------------------------------------- template inline vtkm::filter::ResultDataSet ClipWithImplicitFunction::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) { //get the cells and coordinates of the dataset @@ -69,8 +71,10 @@ inline vtkm::filter::ResultDataSet ClipWithImplicitFunction::DoExecute( //----------------------------------------------------------------------------- template inline bool ClipWithImplicitFunction::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, - const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase&, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, + const vtkm::filter::FieldMetadata& fieldMeta, + const vtkm::filter::PolicyBase&, const DeviceAdapter& device) { if (fieldMeta.IsPointField() == false) diff --git a/vtkm/filter/ContourTreeUniform.h b/vtkm/filter/ContourTreeUniform.h index db4c6e0f4..f4c8abb71 100644 --- a/vtkm/filter/ContourTreeUniform.h +++ b/vtkm/filter/ContourTreeUniform.h @@ -83,9 +83,11 @@ public: // Output field "saddlePeak" which is pairs of vertex ids indicating saddle and peak of contour template VTKM_CONT vtkm::filter::ResultField DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); }; template <> @@ -104,9 +106,11 @@ public: // Output field "saddlePeak" which is pairs of vertex ids indicating saddle and peak of contour template VTKM_CONT vtkm::filter::ResultField DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); }; template <> diff --git a/vtkm/filter/ContourTreeUniform.hxx b/vtkm/filter/ContourTreeUniform.hxx index 32360a20a..f9fd0f3d2 100644 --- a/vtkm/filter/ContourTreeUniform.hxx +++ b/vtkm/filter/ContourTreeUniform.hxx @@ -80,9 +80,11 @@ ContourTreeMesh2D::ContourTreeMesh2D() //----------------------------------------------------------------------------- template vtkm::filter::ResultField ContourTreeMesh2D::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& device) { if (fieldMeta.IsPointField() == false) { @@ -106,8 +108,11 @@ vtkm::filter::ResultField ContourTreeMesh2D::DoExecute( vtkm::worklet::ContourTreeMesh2D worklet; worklet.Run(field, nRows, nCols, saddlePeak, device); - return vtkm::filter::ResultField(input, saddlePeak, this->GetOutputFieldName(), - fieldMeta.GetAssociation(), fieldMeta.GetCellSetName()); + return vtkm::filter::ResultField(input, + saddlePeak, + this->GetOutputFieldName(), + fieldMeta.GetAssociation(), + fieldMeta.GetCellSetName()); } //----------------------------------------------------------------------------- ContourTreeMesh3D::ContourTreeMesh3D() @@ -118,9 +123,11 @@ ContourTreeMesh3D::ContourTreeMesh3D() //----------------------------------------------------------------------------- template vtkm::filter::ResultField ContourTreeMesh3D::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& device) { if (fieldMeta.IsPointField() == false) { @@ -145,8 +152,11 @@ vtkm::filter::ResultField ContourTreeMesh3D::DoExecute( vtkm::worklet::ContourTreeMesh3D worklet; worklet.Run(field, nRows, nCols, nSlices, saddlePeak, device); - return vtkm::filter::ResultField(input, saddlePeak, this->GetOutputFieldName(), - fieldMeta.GetAssociation(), fieldMeta.GetCellSetName()); + return vtkm::filter::ResultField(input, + saddlePeak, + this->GetOutputFieldName(), + fieldMeta.GetAssociation(), + fieldMeta.GetCellSetName()); } } } // namespace vtkm::filter diff --git a/vtkm/filter/ExternalFaces.h b/vtkm/filter/ExternalFaces.h index 9068f3eb9..49189a9e3 100644 --- a/vtkm/filter/ExternalFaces.h +++ b/vtkm/filter/ExternalFaces.h @@ -46,7 +46,8 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); //Map a new field onto the resulting dataset after running the filter diff --git a/vtkm/filter/ExternalFaces.hxx b/vtkm/filter/ExternalFaces.hxx index 537751422..c590eb6f5 100644 --- a/vtkm/filter/ExternalFaces.hxx +++ b/vtkm/filter/ExternalFaces.hxx @@ -51,7 +51,8 @@ inline vtkm::filter::PolicyBase> GetCellSet //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet ExternalFaces::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) { //1. extract the cell set @@ -82,9 +83,11 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ExternalFaces::DoExecute( //----------------------------------------------------------------------------- template inline VTKM_CONT bool ExternalFaces::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter&) { if (fieldMeta.IsPointField()) { diff --git a/vtkm/filter/ExtractGeometry.h b/vtkm/filter/ExtractGeometry.h index 77ac84e6c..85e08e399 100644 --- a/vtkm/filter/ExtractGeometry.h +++ b/vtkm/filter/ExtractGeometry.h @@ -89,7 +89,8 @@ public: bool DoMapField(vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); private: bool ExtractInside; diff --git a/vtkm/filter/ExtractGeometry.hxx b/vtkm/filter/ExtractGeometry.hxx index 2884cc52c..9c8e10223 100644 --- a/vtkm/filter/ExtractGeometry.hxx +++ b/vtkm/filter/ExtractGeometry.hxx @@ -79,7 +79,8 @@ inline VTKM_CONT ExtractGeometry::ExtractGeometry() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet ExtractGeometry::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) { // extract the input cell set and coordinates @@ -91,12 +92,14 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ExtractGeometry::DoExecute( vtkm::cont::ArrayHandle passFlags; typedef vtkm::worklet::ExtractGeometry::ExtractCellsByVOI ExtractCellsWorklet; - ExtractCellsWorklet worklet((*this->Function).PrepareForExecution(device), this->ExtractInside, - this->ExtractBoundaryCells, this->ExtractOnlyBoundaryCells); + ExtractCellsWorklet worklet((*this->Function).PrepareForExecution(device), + this->ExtractInside, + this->ExtractBoundaryCells, + this->ExtractOnlyBoundaryCells); vtkm::worklet::DispatcherMapTopology dispatcher(worklet); - dispatcher.Invoke(vtkm::filter::ApplyPolicy(cells, policy), - vtkm::filter::ApplyPolicy(coords, policy), passFlags); + dispatcher.Invoke( + vtkm::filter::ApplyPolicy(cells, policy), vtkm::filter::ApplyPolicy(coords, policy), passFlags); vtkm::cont::ArrayHandleCounting indices = vtkm::cont::make_ArrayHandleCounting(vtkm::Id(0), vtkm::Id(1), passFlags.GetNumberOfValues()); @@ -116,8 +119,10 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ExtractGeometry::DoExecute( //----------------------------------------------------------------------------- template inline VTKM_CONT bool ExtractGeometry::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, - const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase&, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, + const vtkm::filter::FieldMetadata& fieldMeta, + const vtkm::filter::PolicyBase&, const DeviceAdapter&) { // point data is copied as is because it was not collapsed diff --git a/vtkm/filter/ExtractPoints.h b/vtkm/filter/ExtractPoints.h index e74909661..1e684bf78 100644 --- a/vtkm/filter/ExtractPoints.h +++ b/vtkm/filter/ExtractPoints.h @@ -79,7 +79,8 @@ public: bool DoMapField(vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); private: bool ExtractInside; diff --git a/vtkm/filter/ExtractPoints.hxx b/vtkm/filter/ExtractPoints.hxx index 6c125ad60..3ba9b3de6 100644 --- a/vtkm/filter/ExtractPoints.hxx +++ b/vtkm/filter/ExtractPoints.hxx @@ -64,7 +64,8 @@ inline VTKM_CONT ExtractPoints::ExtractPoints() //----------------------------------------------------------------------------- template inline vtkm::filter::ResultDataSet ExtractPoints::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) { // extract the input cell set and coordinates @@ -76,9 +77,11 @@ inline vtkm::filter::ResultDataSet ExtractPoints::DoExecute( vtkm::cont::CellSetSingleType<> outCellSet(cells.GetName()); vtkm::worklet::ExtractPoints worklet; - outCellSet = - worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), vtkm::filter::ApplyPolicy(coords, policy), - *this->Function, this->ExtractInside, device); + outCellSet = worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), + vtkm::filter::ApplyPolicy(coords, policy), + *this->Function, + this->ExtractInside, + device); // create the output dataset vtkm::cont::DataSet output; @@ -100,9 +103,11 @@ inline vtkm::filter::ResultDataSet ExtractPoints::DoExecute( //----------------------------------------------------------------------------- template inline VTKM_CONT bool ExtractPoints::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter&) { // point data is copied as is because it was not collapsed if (fieldMeta.IsPointField()) diff --git a/vtkm/filter/ExtractStructured.h b/vtkm/filter/ExtractStructured.h index 77cdaccf9..5f0a891d0 100644 --- a/vtkm/filter/ExtractStructured.h +++ b/vtkm/filter/ExtractStructured.h @@ -70,7 +70,8 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); // Map new field onto the resulting dataset after running the filter diff --git a/vtkm/filter/ExtractStructured.hxx b/vtkm/filter/ExtractStructured.hxx index 88803246a..ae68d0450 100644 --- a/vtkm/filter/ExtractStructured.hxx +++ b/vtkm/filter/ExtractStructured.hxx @@ -38,15 +38,16 @@ inline VTKM_CONT ExtractStructured::ExtractStructured() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet ExtractStructured::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase&, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase&, const DeviceAdapter&) { const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex()); const vtkm::cont::CoordinateSystem& coordinates = input.GetCoordinateSystem(this->GetActiveCellSetIndex()); - vtkm::cont::DataSet output = this->Worklet.Run(cells, coordinates, this->VOI, this->SampleRate, - this->IncludeBoundary, DeviceAdapter()); + vtkm::cont::DataSet output = this->Worklet.Run( + cells, coordinates, this->VOI, this->SampleRate, this->IncludeBoundary, DeviceAdapter()); return vtkm::filter::ResultDataSet(output); } @@ -54,8 +55,10 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ExtractStructured::DoExecute( //----------------------------------------------------------------------------- template inline VTKM_CONT bool ExtractStructured::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, - const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase&, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, + const vtkm::filter::FieldMetadata& fieldMeta, + const vtkm::filter::PolicyBase&, const DeviceAdapter& device) { // point data is copied as is because it was not collapsed diff --git a/vtkm/filter/FilterDataSet.h b/vtkm/filter/FilterDataSet.h index 1a0b50740..5c844dbe4 100644 --- a/vtkm/filter/FilterDataSet.h +++ b/vtkm/filter/FilterDataSet.h @@ -83,13 +83,15 @@ public: bool MapFieldOntoOutput(ResultDataSet& result, const vtkm::cont::Field& field); template - VTKM_CONT bool MapFieldOntoOutput(ResultDataSet& result, const vtkm::cont::Field& field, + VTKM_CONT bool MapFieldOntoOutput(ResultDataSet& result, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy); private: template - VTKM_CONT ResultDataSet PrepareForExecution( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy); + VTKM_CONT ResultDataSet + PrepareForExecution(const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy); std::string OutputFieldName; vtkm::Id CellSetIndex; diff --git a/vtkm/filter/FilterDataSet.hxx b/vtkm/filter/FilterDataSet.hxx index 4a78fa958..348a03ffb 100644 --- a/vtkm/filter/FilterDataSet.hxx +++ b/vtkm/filter/FilterDataSet.hxx @@ -63,8 +63,9 @@ inline VTKM_CONT ResultDataSet FilterDataSet::Execute(const vtkm::cont: //----------------------------------------------------------------------------- template template -inline VTKM_CONT ResultDataSet FilterDataSet::Execute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy) +inline VTKM_CONT ResultDataSet +FilterDataSet::Execute(const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy) { return this->PrepareForExecution(input, policy); } @@ -81,7 +82,8 @@ struct FilterDataSetPrepareForExecutionFunctor const vtkm::filter::PolicyBase& Policy; VTKM_CONT - FilterDataSetPrepareForExecutionFunctor(Derived* self, const vtkm::cont::DataSet& input, + FilterDataSetPrepareForExecutionFunctor(Derived* self, + const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy) : Self(self) , Input(input) @@ -103,8 +105,9 @@ private: template template -inline VTKM_CONT ResultDataSet FilterDataSet::PrepareForExecution( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy) +inline VTKM_CONT ResultDataSet +FilterDataSet::PrepareForExecution(const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy) { // When we move to C++11, this could probably be an anonymous class detail::FilterDataSetPrepareForExecutionFunctor functor( @@ -127,7 +130,8 @@ inline VTKM_CONT bool FilterDataSet::MapFieldOntoOutput(ResultDataSet& template template inline VTKM_CONT bool FilterDataSet::MapFieldOntoOutput( - ResultDataSet& result, const vtkm::cont::Field& field, + ResultDataSet& result, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy) { bool valid = false; @@ -135,8 +139,8 @@ inline VTKM_CONT bool FilterDataSet::MapFieldOntoOutput( { vtkm::filter::FieldMetadata metaData(field); typedef internal::ResolveFieldTypeAndMap FunctorType; - FunctorType functor(static_cast(this), result, metaData, policy, this->Tracker, - valid); + FunctorType functor( + static_cast(this), result, metaData, policy, this->Tracker, valid); typedef vtkm::filter::FilterTraits Traits; vtkm::cont::CastAndCall(vtkm::filter::ApplyPolicy(field, policy, Traits()), functor); diff --git a/vtkm/filter/FilterDataSetWithField.h b/vtkm/filter/FilterDataSetWithField.h index 44e5d0af0..5f6b3fac8 100644 --- a/vtkm/filter/FilterDataSetWithField.h +++ b/vtkm/filter/FilterDataSetWithField.h @@ -77,11 +77,13 @@ public: const vtkm::cont::CoordinateSystem& field); template - VTKM_CONT ResultDataSet Execute(const vtkm::cont::DataSet& input, const std::string& inFieldName, + VTKM_CONT ResultDataSet Execute(const vtkm::cont::DataSet& input, + const std::string& inFieldName, const vtkm::filter::PolicyBase& policy); template - VTKM_CONT ResultDataSet Execute(const vtkm::cont::DataSet& input, const vtkm::cont::Field& field, + VTKM_CONT ResultDataSet Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy); template @@ -99,19 +101,22 @@ public: bool MapFieldOntoOutput(ResultDataSet& result, const vtkm::cont::Field& field); template - VTKM_CONT bool MapFieldOntoOutput(ResultDataSet& result, const vtkm::cont::Field& field, + VTKM_CONT bool MapFieldOntoOutput(ResultDataSet& result, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy); private: template VTKM_CONT ResultDataSet - PrepareForExecution(const vtkm::cont::DataSet& input, const vtkm::cont::Field& field, + PrepareForExecution(const vtkm::cont::DataSet& input, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy); //How do we specify float/double coordinate types? template VTKM_CONT ResultDataSet - PrepareForExecution(const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field, + PrepareForExecution(const vtkm::cont::DataSet& input, + const vtkm::cont::CoordinateSystem& field, const vtkm::filter::PolicyBase& policy); std::string OutputFieldName; diff --git a/vtkm/filter/FilterDataSetWithField.hxx b/vtkm/filter/FilterDataSetWithField.hxx index b7aff6216..ad3c0d4e7 100644 --- a/vtkm/filter/FilterDataSetWithField.hxx +++ b/vtkm/filter/FilterDataSetWithField.hxx @@ -55,24 +55,27 @@ inline VTKM_CONT FilterDataSetWithField::~FilterDataSetWithField() //----------------------------------------------------------------------------- template -inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( - const vtkm::cont::DataSet& input, const std::string& inFieldName) +inline VTKM_CONT ResultDataSet +FilterDataSetWithField::Execute(const vtkm::cont::DataSet& input, + const std::string& inFieldName) { return this->Execute(input, input.GetField(inFieldName), vtkm::filter::PolicyDefault()); } //----------------------------------------------------------------------------- template -inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( - const vtkm::cont::DataSet& input, const vtkm::cont::Field& field) +inline VTKM_CONT ResultDataSet +FilterDataSetWithField::Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::Field& field) { return this->Execute(input, field, vtkm::filter::PolicyDefault()); } //----------------------------------------------------------------------------- template -inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( - const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field) +inline VTKM_CONT ResultDataSet +FilterDataSetWithField::Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::CoordinateSystem& field) { return this->Execute(input, field, vtkm::filter::PolicyDefault()); } @@ -80,9 +83,10 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( //----------------------------------------------------------------------------- template template -inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( - const vtkm::cont::DataSet& input, const std::string& inFieldName, - const vtkm::filter::PolicyBase& policy) +inline VTKM_CONT ResultDataSet +FilterDataSetWithField::Execute(const vtkm::cont::DataSet& input, + const std::string& inFieldName, + const vtkm::filter::PolicyBase& policy) { return this->Execute(input, input.GetField(inFieldName), policy); } @@ -90,9 +94,10 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( //----------------------------------------------------------------------------- template template -inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( - const vtkm::cont::DataSet& input, const vtkm::cont::Field& field, - const vtkm::filter::PolicyBase& policy) +inline VTKM_CONT ResultDataSet +FilterDataSetWithField::Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::Field& field, + const vtkm::filter::PolicyBase& policy) { return this->PrepareForExecution(input, field, policy); } @@ -100,9 +105,10 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( //----------------------------------------------------------------------------- template template -inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( - const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field, - const vtkm::filter::PolicyBase& policy) +inline VTKM_CONT ResultDataSet +FilterDataSetWithField::Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::CoordinateSystem& field, + const vtkm::filter::PolicyBase& policy) { //we need to state that the field is actually a coordinate system, so that //the filter uses the proper policy to convert the types. @@ -113,7 +119,8 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField::Execute( template template inline VTKM_CONT ResultDataSet FilterDataSetWithField::PrepareForExecution( - const vtkm::cont::DataSet& input, const vtkm::cont::Field& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy) { vtkm::filter::FieldMetadata metaData(field); @@ -131,7 +138,8 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField::PrepareForExecut template template inline VTKM_CONT ResultDataSet FilterDataSetWithField::PrepareForExecution( - const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::CoordinateSystem& field, const vtkm::filter::PolicyBase& policy) { //We have a special signature just for CoordinateSystem, so that we can ask @@ -152,7 +160,8 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField::PrepareForExecut //----------------------------------------------------------------------------- template inline VTKM_CONT bool FilterDataSetWithField::MapFieldOntoOutput( - ResultDataSet& result, const vtkm::cont::Field& field) + ResultDataSet& result, + const vtkm::cont::Field& field) { return this->MapFieldOntoOutput(result, field, vtkm::filter::PolicyDefault()); } @@ -161,7 +170,8 @@ inline VTKM_CONT bool FilterDataSetWithField::MapFieldOntoOutput( template template inline VTKM_CONT bool FilterDataSetWithField::MapFieldOntoOutput( - ResultDataSet& result, const vtkm::cont::Field& field, + ResultDataSet& result, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy) { bool valid = false; @@ -169,8 +179,8 @@ inline VTKM_CONT bool FilterDataSetWithField::MapFieldOntoOutput( { vtkm::filter::FieldMetadata metaData(field); typedef internal::ResolveFieldTypeAndMap FunctorType; - FunctorType functor(static_cast(this), result, metaData, policy, this->Tracker, - valid); + FunctorType functor( + static_cast(this), result, metaData, policy, this->Tracker, valid); vtkm::cont::CastAndCall(vtkm::filter::ApplyPolicy(field, policy), functor); } diff --git a/vtkm/filter/FilterField.h b/vtkm/filter/FilterField.h index 1129dfbaf..b28a63e89 100644 --- a/vtkm/filter/FilterField.h +++ b/vtkm/filter/FilterField.h @@ -69,11 +69,13 @@ public: ResultField Execute(const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field); template - VTKM_CONT ResultField Execute(const vtkm::cont::DataSet& input, const std::string& inFieldName, + VTKM_CONT ResultField Execute(const vtkm::cont::DataSet& input, + const std::string& inFieldName, const vtkm::filter::PolicyBase& policy); template - VTKM_CONT ResultField Execute(const vtkm::cont::DataSet& input, const vtkm::cont::Field& field, + VTKM_CONT ResultField Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy); template diff --git a/vtkm/filter/FilterField.hxx b/vtkm/filter/FilterField.hxx index 175ff4a6a..60e15dcaa 100644 --- a/vtkm/filter/FilterField.hxx +++ b/vtkm/filter/FilterField.hxx @@ -67,8 +67,9 @@ inline VTKM_CONT ResultField FilterField::Execute(const vtkm::cont::Dat //----------------------------------------------------------------------------- template -inline VTKM_CONT ResultField FilterField::Execute( - const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field) +inline VTKM_CONT ResultField +FilterField::Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::CoordinateSystem& field) { return this->Execute(input, field, vtkm::filter::PolicyDefault()); } @@ -77,7 +78,8 @@ inline VTKM_CONT ResultField FilterField::Execute( template template inline VTKM_CONT ResultField -FilterField::Execute(const vtkm::cont::DataSet& input, const std::string& inFieldName, +FilterField::Execute(const vtkm::cont::DataSet& input, + const std::string& inFieldName, const vtkm::filter::PolicyBase& policy) { return this->Execute(input, input.GetField(inFieldName), policy); @@ -87,7 +89,8 @@ FilterField::Execute(const vtkm::cont::DataSet& input, const std::strin template template inline VTKM_CONT ResultField -FilterField::Execute(const vtkm::cont::DataSet& input, const vtkm::cont::Field& field, +FilterField::Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy) { return this->PrepareForExecution(input, field, policy); @@ -96,9 +99,10 @@ FilterField::Execute(const vtkm::cont::DataSet& input, const vtkm::cont //----------------------------------------------------------------------------- template template -inline VTKM_CONT ResultField FilterField::Execute( - const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field, - const vtkm::filter::PolicyBase& policy) +inline VTKM_CONT ResultField +FilterField::Execute(const vtkm::cont::DataSet& input, + const vtkm::cont::CoordinateSystem& field, + const vtkm::filter::PolicyBase& policy) { //we need to state that the field is actually a coordinate system, so that //the filter uses the proper policy to convert the types. @@ -108,9 +112,10 @@ inline VTKM_CONT ResultField FilterField::Execute( //----------------------------------------------------------------------------- template template -inline VTKM_CONT ResultField FilterField::PrepareForExecution( - const vtkm::cont::DataSet& input, const vtkm::cont::Field& field, - const vtkm::filter::PolicyBase& policy) +inline VTKM_CONT ResultField +FilterField::PrepareForExecution(const vtkm::cont::DataSet& input, + const vtkm::cont::Field& field, + const vtkm::filter::PolicyBase& policy) { vtkm::filter::FieldMetadata metaData(field); ResultField result; @@ -126,9 +131,10 @@ inline VTKM_CONT ResultField FilterField::PrepareForExecution( //----------------------------------------------------------------------------- template template -inline VTKM_CONT ResultField FilterField::PrepareForExecution( - const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field, - const vtkm::filter::PolicyBase& policy) +inline VTKM_CONT ResultField +FilterField::PrepareForExecution(const vtkm::cont::DataSet& input, + const vtkm::cont::CoordinateSystem& field, + const vtkm::filter::PolicyBase& policy) { //We have a special signature just for CoordinateSystem, so that we can ask //the policy for the storage types and value types just for coordinate systems diff --git a/vtkm/filter/Gradient.h b/vtkm/filter/Gradient.h index 802db50ed..543d83768 100644 --- a/vtkm/filter/Gradient.h +++ b/vtkm/filter/Gradient.h @@ -99,9 +99,10 @@ template <> class FilterTraits { public: - struct TypeListTagGradientInputs - : vtkm::ListTagBase, - vtkm::Vec> + struct TypeListTagGradientInputs : vtkm::ListTagBase, + vtkm::Vec> { }; diff --git a/vtkm/filter/Gradient.hxx b/vtkm/filter/Gradient.hxx index ad3b67075..ffa73622a 100644 --- a/vtkm/filter/Gradient.hxx +++ b/vtkm/filter/Gradient.hxx @@ -31,7 +31,8 @@ namespace template struct PointGrad { - PointGrad(const vtkm::cont::CoordinateSystem& coords, const vtkm::cont::ArrayHandle& field, + PointGrad(const vtkm::cont::CoordinateSystem& coords, + const vtkm::cont::ArrayHandle& field, vtkm::cont::ArrayHandle>* result) : Points(&coords) , InField(&field) @@ -45,7 +46,8 @@ struct PointGrad vtkm::worklet::DispatcherMapTopology dispatcher; dispatcher.Invoke(cellset, //topology to iterate on a per point basis cellset, //whole cellset in - vtkm::filter::ApplyPolicy(*this->Points, this->Policy), *this->InField, + vtkm::filter::ApplyPolicy(*this->Points, this->Policy), + *this->InField, *this->Result); } @@ -60,7 +62,8 @@ private: //----------------------------------------------------------------------------- template -inline void add_field(vtkm::filter::ResultField& result, const HandleType& handle, +inline void add_field(vtkm::filter::ResultField& result, + const HandleType& handle, const std::string name) { const vtkm::cont::Field::AssociationEnum assoc = result.GetField().GetAssociation(); @@ -80,7 +83,8 @@ inline void add_field(vtkm::filter::ResultField& result, const HandleType& handl template inline void add_extra_vec_fields( const vtkm::cont::ArrayHandle, 3>, S>& inField, - const vtkm::filter::Gradient* const filter, vtkm::filter::ResultField& result, + const vtkm::filter::Gradient* const filter, + vtkm::filter::ResultField& result, const DeviceAdapter&) { if (filter->GetComputeDivergence()) @@ -113,7 +117,8 @@ inline void add_extra_vec_fields( template inline void add_extra_vec_fields(const vtkm::cont::ArrayHandle&, - const vtkm::filter::Gradient* const, vtkm::filter::ResultField&, + const vtkm::filter::Gradient* const, + vtkm::filter::ResultField&, const DeviceAdapter&) { //not a vector array handle so add nothing @@ -140,9 +145,11 @@ Gradient::Gradient() //----------------------------------------------------------------------------- template inline vtkm::filter::ResultField Gradient::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& inField, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& inField, const vtkm::filter::FieldMetadata& fieldMetadata, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& adapter) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& adapter) { if (!fieldMetadata.IsPointField()) { @@ -176,7 +183,9 @@ inline vtkm::filter::ResultField Gradient::DoExecute( { vtkm::worklet::DispatcherMapTopology dispatcher; dispatcher.Invoke(vtkm::filter::ApplyPolicy(cells, policy), - vtkm::filter::ApplyPolicy(coords, policy), inField, outArray); + vtkm::filter::ApplyPolicy(coords, policy), + inField, + outArray); fieldAssociation = vtkm::cont::Field::ASSOC_CELL_SET; } diff --git a/vtkm/filter/Histogram.h b/vtkm/filter/Histogram.h index caab001c3..833fb0724 100644 --- a/vtkm/filter/Histogram.h +++ b/vtkm/filter/Histogram.h @@ -52,9 +52,11 @@ public: template VTKM_CONT vtkm::filter::ResultField DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); private: vtkm::Id NumberOfBins; diff --git a/vtkm/filter/Histogram.hxx b/vtkm/filter/Histogram.hxx index 78fc789a2..00c1fc529 100644 --- a/vtkm/filter/Histogram.hxx +++ b/vtkm/filter/Histogram.hxx @@ -38,8 +38,10 @@ inline VTKM_CONT Histogram::Histogram() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultField Histogram::DoExecute( - const vtkm::cont::DataSet& inDataSet, const vtkm::cont::ArrayHandle& field, - const vtkm::filter::FieldMetadata& fieldMetadata, const vtkm::filter::PolicyBase&, + const vtkm::cont::DataSet& inDataSet, + const vtkm::cont::ArrayHandle& field, + const vtkm::filter::FieldMetadata& fieldMetadata, + const vtkm::filter::PolicyBase&, const DeviceAdapter& device) { vtkm::cont::ArrayHandle binArray; @@ -49,8 +51,11 @@ inline VTKM_CONT vtkm::filter::ResultField Histogram::DoExecute( worklet.Run(field, this->NumberOfBins, this->DataRange, delta, binArray, device); this->BinDelta = static_cast(delta); - return vtkm::filter::ResultField(inDataSet, binArray, this->GetOutputFieldName(), - fieldMetadata.GetAssociation(), fieldMetadata.GetCellSetName()); + return vtkm::filter::ResultField(inDataSet, + binArray, + this->GetOutputFieldName(), + fieldMetadata.GetAssociation(), + fieldMetadata.GetCellSetName()); } } } // namespace vtkm::filter diff --git a/vtkm/filter/MarchingCubes.h b/vtkm/filter/MarchingCubes.h index 9b88d20f4..ade79b5f6 100644 --- a/vtkm/filter/MarchingCubes.h +++ b/vtkm/filter/MarchingCubes.h @@ -82,9 +82,11 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); //Map a new field onto the resulting dataset after running the filter //this call is only valid diff --git a/vtkm/filter/MarchingCubes.hxx b/vtkm/filter/MarchingCubes.hxx index c09d5241b..5cf2fc005 100644 --- a/vtkm/filter/MarchingCubes.hxx +++ b/vtkm/filter/MarchingCubes.hxx @@ -82,9 +82,11 @@ inline vtkm::Float64 MarchingCubes::GetIsoValue(vtkm::Id index) const //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet MarchingCubes::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& device) { if (fieldMeta.IsPointField() == false) { @@ -123,15 +125,24 @@ inline VTKM_CONT vtkm::filter::ResultDataSet MarchingCubes::DoExecute( //a more efficient api if (this->GenerateNormals) { - outputCells = this->Worklet.Run( - &ivalues[0], static_cast(ivalues.size()), vtkm::filter::ApplyPolicy(cells, policy), - vtkm::filter::ApplyPolicy(coords, policy), field, vertices, normals, device); + outputCells = this->Worklet.Run(&ivalues[0], + static_cast(ivalues.size()), + vtkm::filter::ApplyPolicy(cells, policy), + vtkm::filter::ApplyPolicy(coords, policy), + field, + vertices, + normals, + device); } else { - outputCells = this->Worklet.Run( - &ivalues[0], static_cast(ivalues.size()), vtkm::filter::ApplyPolicy(cells, policy), - vtkm::filter::ApplyPolicy(coords, policy), field, vertices, device); + outputCells = this->Worklet.Run(&ivalues[0], + static_cast(ivalues.size()), + vtkm::filter::ApplyPolicy(cells, policy), + vtkm::filter::ApplyPolicy(coords, policy), + field, + vertices, + device); } if (this->GenerateNormals) @@ -153,8 +164,10 @@ inline VTKM_CONT vtkm::filter::ResultDataSet MarchingCubes::DoExecute( //----------------------------------------------------------------------------- template inline VTKM_CONT bool MarchingCubes::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, - const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase&, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, + const vtkm::filter::FieldMetadata& fieldMeta, + const vtkm::filter::PolicyBase&, const DeviceAdapter& device) { if (fieldMeta.IsPointField() == false) diff --git a/vtkm/filter/Mask.h b/vtkm/filter/Mask.h index 253fe08e3..2210ee1fe 100644 --- a/vtkm/filter/Mask.h +++ b/vtkm/filter/Mask.h @@ -51,7 +51,8 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); //Map a new field onto the resulting dataset after running the filter diff --git a/vtkm/filter/Mask.hxx b/vtkm/filter/Mask.hxx index f7049289b..2db4b4061 100644 --- a/vtkm/filter/Mask.hxx +++ b/vtkm/filter/Mask.hxx @@ -60,7 +60,8 @@ inline VTKM_CONT Mask::Mask() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet Mask::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) { const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex()); diff --git a/vtkm/filter/MaskPoints.h b/vtkm/filter/MaskPoints.h index 7ab33919c..0ac39e904 100644 --- a/vtkm/filter/MaskPoints.h +++ b/vtkm/filter/MaskPoints.h @@ -50,7 +50,8 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); //Map a new field onto the resulting dataset after running the filter diff --git a/vtkm/filter/MaskPoints.hxx b/vtkm/filter/MaskPoints.hxx index 004b132cf..350ff80c8 100644 --- a/vtkm/filter/MaskPoints.hxx +++ b/vtkm/filter/MaskPoints.hxx @@ -52,7 +52,8 @@ inline VTKM_CONT MaskPoints::MaskPoints() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet MaskPoints::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) { // extract the input cell set diff --git a/vtkm/filter/PointAverage.h b/vtkm/filter/PointAverage.h index fc8433c87..a86d666da 100644 --- a/vtkm/filter/PointAverage.h +++ b/vtkm/filter/PointAverage.h @@ -37,9 +37,11 @@ public: template VTKM_CONT vtkm::filter::ResultField DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); private: vtkm::worklet::PointAverage Worklet; diff --git a/vtkm/filter/PointAverage.hxx b/vtkm/filter/PointAverage.hxx index 24db2dcc5..67ce420a3 100644 --- a/vtkm/filter/PointAverage.hxx +++ b/vtkm/filter/PointAverage.hxx @@ -37,9 +37,11 @@ inline VTKM_CONT PointAverage::PointAverage() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultField PointAverage::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& inField, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& inField, const vtkm::filter::FieldMetadata& fieldMetadata, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter&) { if (!fieldMetadata.IsCellField()) { @@ -64,8 +66,8 @@ inline VTKM_CONT vtkm::filter::ResultField PointAverage::DoExecute( outputName = fieldMetadata.GetName(); } - return vtkm::filter::ResultField(input, outArray, outputName, vtkm::cont::Field::ASSOC_POINTS, - cellSet.GetName()); + return vtkm::filter::ResultField( + input, outArray, outputName, vtkm::cont::Field::ASSOC_POINTS, cellSet.GetName()); } } } // namespace vtkm::filter diff --git a/vtkm/filter/PointElevation.h b/vtkm/filter/PointElevation.h index 33363465e..d5f6d56be 100644 --- a/vtkm/filter/PointElevation.h +++ b/vtkm/filter/PointElevation.h @@ -46,9 +46,11 @@ public: template VTKM_CONT vtkm::filter::ResultField DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); private: vtkm::worklet::PointElevation Worklet; diff --git a/vtkm/filter/PointElevation.hxx b/vtkm/filter/PointElevation.hxx index e4b841dcd..f5dcab8f4 100644 --- a/vtkm/filter/PointElevation.hxx +++ b/vtkm/filter/PointElevation.hxx @@ -39,7 +39,8 @@ inline VTKM_CONT void PointElevation::SetLowPoint(vtkm::Float64 x, vtkm::Float64 } //----------------------------------------------------------------------------- -inline VTKM_CONT void PointElevation::SetHighPoint(vtkm::Float64 x, vtkm::Float64 y, +inline VTKM_CONT void PointElevation::SetHighPoint(vtkm::Float64 x, + vtkm::Float64 y, vtkm::Float64 z) { this->Worklet.SetHighPoint(vtkm::make_Vec(x, y, z)); @@ -54,8 +55,10 @@ inline VTKM_CONT void PointElevation::SetRange(vtkm::Float64 low, vtkm::Float64 //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultField PointElevation::DoExecute( - const vtkm::cont::DataSet& inDataSet, const vtkm::cont::ArrayHandle& field, - const vtkm::filter::FieldMetadata& fieldMetadata, const vtkm::filter::PolicyBase&, + const vtkm::cont::DataSet& inDataSet, + const vtkm::cont::ArrayHandle& field, + const vtkm::filter::FieldMetadata& fieldMetadata, + const vtkm::filter::PolicyBase&, const DeviceAdapter&) { vtkm::cont::ArrayHandle outArray; @@ -66,8 +69,11 @@ inline VTKM_CONT vtkm::filter::ResultField PointElevation::DoExecute( //that the dispatcher should do dispatcher.Invoke(field, outArray); - return vtkm::filter::ResultField(inDataSet, outArray, this->GetOutputFieldName(), - fieldMetadata.GetAssociation(), fieldMetadata.GetCellSetName()); + return vtkm::filter::ResultField(inDataSet, + outArray, + this->GetOutputFieldName(), + fieldMetadata.GetAssociation(), + fieldMetadata.GetCellSetName()); } } } // namespace vtkm::filter diff --git a/vtkm/filter/PolicyBase.h b/vtkm/filter/PolicyBase.h index e6596f692..892081c45 100644 --- a/vtkm/filter/PolicyBase.h +++ b/vtkm/filter/PolicyBase.h @@ -70,7 +70,8 @@ template VTKM_CONT vtkm::cont::DynamicArrayHandleBase< typename vtkm::filter::DeduceFilterFieldTypes::TypeList, typename DerivedPolicy::FieldStorageList> -ApplyPolicy(const vtkm::cont::Field& field, const vtkm::filter::PolicyBase&, +ApplyPolicy(const vtkm::cont::Field& field, + const vtkm::filter::PolicyBase&, const vtkm::filter::FilterTraits&) { typedef @@ -110,7 +111,8 @@ ApplyPolicy(const vtkm::cont::CoordinateSystem& coordinates, //----------------------------------------------------------------------------- template VTKM_CONT vtkm::cont::DynamicCellSetBase ApplyPolicy( - const vtkm::cont::DynamicCellSet& cellset, const vtkm::filter::PolicyBase&) + const vtkm::cont::DynamicCellSet& cellset, + const vtkm::filter::PolicyBase&) { typedef typename DerivedPolicy::AllCellSetList CellSetList; return cellset.ResetCellSetList(CellSetList()); diff --git a/vtkm/filter/ResultField.h b/vtkm/filter/ResultField.h index 871d446ef..a92736826 100644 --- a/vtkm/filter/ResultField.h +++ b/vtkm/filter/ResultField.h @@ -49,7 +49,8 @@ public: /// association). /// VTKM_CONT - ResultField(const vtkm::cont::DataSet& dataSet, const std::string& fieldName, + ResultField(const vtkm::cont::DataSet& dataSet, + const std::string& fieldName, vtkm::cont::Field::AssociationEnum fieldAssociation = vtkm::cont::Field::ASSOC_ANY) : ResultBase(dataSet) , FieldName(fieldName) @@ -126,7 +127,8 @@ public: /// VTKM_CONT ResultField(const vtkm::cont::DataSet& inDataSet, - const vtkm::cont::DynamicArrayHandle& fieldArray, const std::string& fieldName, + const vtkm::cont::DynamicArrayHandle& fieldArray, + const std::string& fieldName, vtkm::cont::Field::AssociationEnum fieldAssociation, const std::string& elementSetName = "") : FieldName(fieldName) diff --git a/vtkm/filter/Tetrahedralize.h b/vtkm/filter/Tetrahedralize.h index a79284cea..8eed88db0 100644 --- a/vtkm/filter/Tetrahedralize.h +++ b/vtkm/filter/Tetrahedralize.h @@ -37,7 +37,8 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); // Map new field onto the resulting dataset after running the filter diff --git a/vtkm/filter/Tetrahedralize.hxx b/vtkm/filter/Tetrahedralize.hxx index 8a26e8d30..df3a3790d 100644 --- a/vtkm/filter/Tetrahedralize.hxx +++ b/vtkm/filter/Tetrahedralize.hxx @@ -59,7 +59,8 @@ inline VTKM_CONT Tetrahedralize::Tetrahedralize() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet Tetrahedralize::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) { const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex()); @@ -80,8 +81,10 @@ inline VTKM_CONT vtkm::filter::ResultDataSet Tetrahedralize::DoExecute( //----------------------------------------------------------------------------- template inline VTKM_CONT bool Tetrahedralize::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, - const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase&, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, + const vtkm::filter::FieldMetadata& fieldMeta, + const vtkm::filter::PolicyBase&, const DeviceAdapter& device) { // point data is copied as is because it was not collapsed diff --git a/vtkm/filter/Threshold.h b/vtkm/filter/Threshold.h index aa3144897..d7751aec5 100644 --- a/vtkm/filter/Threshold.h +++ b/vtkm/filter/Threshold.h @@ -47,9 +47,11 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); //Map a new field onto the resulting dataset after running the filter //this call is only valid diff --git a/vtkm/filter/Threshold.hxx b/vtkm/filter/Threshold.hxx index 5e91a27c6..fc919947e 100644 --- a/vtkm/filter/Threshold.hxx +++ b/vtkm/filter/Threshold.hxx @@ -90,9 +90,11 @@ inline VTKM_CONT Threshold::Threshold() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet Threshold::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter&) { //get the cells and coordinates of the dataset const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex()); diff --git a/vtkm/filter/ThresholdPoints.h b/vtkm/filter/ThresholdPoints.h index b08386959..a60e17b91 100644 --- a/vtkm/filter/ThresholdPoints.h +++ b/vtkm/filter/ThresholdPoints.h @@ -62,9 +62,11 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); //Map a new field onto the resulting dataset after running the filter //this call is only valid diff --git a/vtkm/filter/ThresholdPoints.hxx b/vtkm/filter/ThresholdPoints.hxx index 6f7257be4..1c52ba190 100644 --- a/vtkm/filter/ThresholdPoints.hxx +++ b/vtkm/filter/ThresholdPoints.hxx @@ -145,9 +145,11 @@ inline VTKM_CONT void ThresholdPoints::SetThresholdBetween(const vtkm::Float64 v //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet ThresholdPoints::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& device) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& device) { // extract the input cell set const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex()); @@ -167,22 +169,27 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ThresholdPoints::DoExecute( { case THRESHOLD_BELOW: { - outCellSet = worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), field, - ValuesBelow(this->GetLowerThreshold()), device); + outCellSet = worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), + field, + ValuesBelow(this->GetLowerThreshold()), + device); break; } case THRESHOLD_ABOVE: { - outCellSet = worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), field, - ValuesAbove(this->GetUpperThreshold()), device); + outCellSet = worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), + field, + ValuesAbove(this->GetUpperThreshold()), + device); break; } case THRESHOLD_BETWEEN: default: { - outCellSet = - worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), field, - ValuesBetween(this->GetLowerThreshold(), this->GetUpperThreshold()), device); + outCellSet = worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), + field, + ValuesBetween(this->GetLowerThreshold(), this->GetUpperThreshold()), + device); break; } } @@ -209,9 +216,11 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ThresholdPoints::DoExecute( //----------------------------------------------------------------------------- template inline VTKM_CONT bool ThresholdPoints::DoMapField( - vtkm::filter::ResultDataSet& result, const vtkm::cont::ArrayHandle& input, + vtkm::filter::ResultDataSet& result, + const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter&) { // point data is copied as is because it was not collapsed if (fieldMeta.IsPointField()) diff --git a/vtkm/filter/Triangulate.h b/vtkm/filter/Triangulate.h index e60647015..297e5adbe 100644 --- a/vtkm/filter/Triangulate.h +++ b/vtkm/filter/Triangulate.h @@ -37,7 +37,8 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); // Map new field onto the resulting dataset after running the filter diff --git a/vtkm/filter/Triangulate.hxx b/vtkm/filter/Triangulate.hxx index 1cfea0778..1f143af93 100644 --- a/vtkm/filter/Triangulate.hxx +++ b/vtkm/filter/Triangulate.hxx @@ -59,7 +59,8 @@ inline VTKM_CONT Triangulate::Triangulate() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet Triangulate::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter&) { const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex()); diff --git a/vtkm/filter/VectorMagnitude.h b/vtkm/filter/VectorMagnitude.h index 678d2d398..f7b37057c 100644 --- a/vtkm/filter/VectorMagnitude.h +++ b/vtkm/filter/VectorMagnitude.h @@ -37,9 +37,11 @@ public: template VTKM_CONT vtkm::filter::ResultField DoExecute( - const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, + const vtkm::cont::DataSet& input, + const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, - const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); + const vtkm::filter::PolicyBase& policy, + const DeviceAdapter& tag); private: vtkm::worklet::Magnitude Worklet; diff --git a/vtkm/filter/VectorMagnitude.hxx b/vtkm/filter/VectorMagnitude.hxx index a77cabcd3..62489ce70 100644 --- a/vtkm/filter/VectorMagnitude.hxx +++ b/vtkm/filter/VectorMagnitude.hxx @@ -36,8 +36,10 @@ inline VTKM_CONT VectorMagnitude::VectorMagnitude() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultField VectorMagnitude::DoExecute( - const vtkm::cont::DataSet& inDataSet, const vtkm::cont::ArrayHandle& field, - const vtkm::filter::FieldMetadata& fieldMetadata, const vtkm::filter::PolicyBase&, + const vtkm::cont::DataSet& inDataSet, + const vtkm::cont::ArrayHandle& field, + const vtkm::filter::FieldMetadata& fieldMetadata, + const vtkm::filter::PolicyBase&, const DeviceAdapter&) { typedef typename detail::FloatingPointReturnType::Type ReturnType; @@ -48,8 +50,11 @@ inline VTKM_CONT vtkm::filter::ResultField VectorMagnitude::DoExecute( dispatcher.Invoke(field, outArray); - return vtkm::filter::ResultField(inDataSet, outArray, this->GetOutputFieldName(), - fieldMetadata.GetAssociation(), fieldMetadata.GetCellSetName()); + return vtkm::filter::ResultField(inDataSet, + outArray, + this->GetOutputFieldName(), + fieldMetadata.GetAssociation(), + fieldMetadata.GetCellSetName()); } } } // namespace vtkm::filter diff --git a/vtkm/filter/VertexClustering.h b/vtkm/filter/VertexClustering.h index cb960519f..9240b82cf 100644 --- a/vtkm/filter/VertexClustering.h +++ b/vtkm/filter/VertexClustering.h @@ -43,7 +43,8 @@ public: template VTKM_CONT vtkm::filter::ResultDataSet DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag); //Map a new field onto the resulting dataset after running the filter diff --git a/vtkm/filter/VertexClustering.hxx b/vtkm/filter/VertexClustering.hxx index d9c75c3e1..9db5e64b5 100644 --- a/vtkm/filter/VertexClustering.hxx +++ b/vtkm/filter/VertexClustering.hxx @@ -33,7 +33,8 @@ inline VTKM_CONT VertexClustering::VertexClustering() //----------------------------------------------------------------------------- template inline VTKM_CONT vtkm::filter::ResultDataSet VertexClustering::DoExecute( - const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy, + const vtkm::cont::DataSet& input, + const vtkm::filter::PolicyBase& policy, const DeviceAdapter& tag) { // todo this code needs to obey the policy for what storage types @@ -46,8 +47,10 @@ inline VTKM_CONT vtkm::filter::ResultDataSet VertexClustering::DoExecute( vtkm::cont::DataSet outDataSet = clustering.Run(vtkm::filter::ApplyPolicyUnstructured(input.GetCellSet(), policy), - vtkm::filter::ApplyPolicy(input.GetCoordinateSystem(), policy), bounds, - this->GetNumberOfDivisions(), tag); + vtkm::filter::ApplyPolicy(input.GetCoordinateSystem(), policy), + bounds, + this->GetNumberOfDivisions(), + tag); return vtkm::filter::ResultDataSet(outDataSet); } diff --git a/vtkm/filter/internal/ResolveFieldTypeAndExecute.h b/vtkm/filter/internal/ResolveFieldTypeAndExecute.h index ff3c68416..94cffa1d8 100644 --- a/vtkm/filter/internal/ResolveFieldTypeAndExecute.h +++ b/vtkm/filter/internal/ResolveFieldTypeAndExecute.h @@ -47,10 +47,12 @@ struct ResolveFieldTypeAndExecute vtkm::cont::RuntimeDeviceTracker Tracker; ResultType& Result; - ResolveFieldTypeAndExecute(Derived* derivedClass, const vtkm::cont::DataSet& inputData, + ResolveFieldTypeAndExecute(Derived* derivedClass, + const vtkm::cont::DataSet& inputData, const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase& policy, - const vtkm::cont::RuntimeDeviceTracker& tracker, ResultType& result) + const vtkm::cont::RuntimeDeviceTracker& tracker, + ResultType& result) : DerivedClass(derivedClass) , InputData(inputData) , Metadata(fieldMeta) diff --git a/vtkm/filter/internal/ResolveFieldTypeAndMap.h b/vtkm/filter/internal/ResolveFieldTypeAndMap.h index 204678492..a5c2c85e0 100644 --- a/vtkm/filter/internal/ResolveFieldTypeAndMap.h +++ b/vtkm/filter/internal/ResolveFieldTypeAndMap.h @@ -56,10 +56,12 @@ struct ResolveFieldTypeAndMap vtkm::cont::RuntimeDeviceTracker Tracker; bool& RanProperly; - ResolveFieldTypeAndMap(Derived* derivedClass, vtkm::filter::ResultDataSet& inResult, + ResolveFieldTypeAndMap(Derived* derivedClass, + vtkm::filter::ResultDataSet& inResult, const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase& policy, - const vtkm::cont::RuntimeDeviceTracker& tracker, bool& ran) + const vtkm::cont::RuntimeDeviceTracker& tracker, + bool& ran) : DerivedClass(derivedClass) , InputResult(inResult) , Metadata(fieldMeta) @@ -88,9 +90,11 @@ private: template bool operator()(DeviceAdapterTag tag) const { - this->Valid = this->Instance.DerivedClass->DoMapField(this->Instance.InputResult, this->Field, + this->Valid = this->Instance.DerivedClass->DoMapField(this->Instance.InputResult, + this->Field, this->Instance.Metadata, - this->Instance.Policy, tag); + this->Instance.Policy, + tag); return this->Valid; } diff --git a/vtkm/filter/testing/UnitTestExternalFacesFilter.cxx b/vtkm/filter/testing/UnitTestExternalFacesFilter.cxx index d8842e2a8..d44a3dd60 100644 --- a/vtkm/filter/testing/UnitTestExternalFacesFilter.cxx +++ b/vtkm/filter/testing/UnitTestExternalFacesFilter.cxx @@ -49,8 +49,10 @@ vtkm::cont::DataSet MakeDataTestSet2() return MakeTestDataSet().Make3DExplicitDataSet5(); } -void TestExternalFacesExplicitGrid(const vtkm::cont::DataSet& ds, bool compactPoints, - vtkm::Id numExpectedExtFaces, vtkm::Id numExpectedPoints = 0) +void TestExternalFacesExplicitGrid(const vtkm::cont::DataSet& ds, + bool compactPoints, + vtkm::Id numExpectedExtFaces, + vtkm::Id numExpectedPoints = 0) { //Run the External Faces filter vtkm::filter::ExternalFaces externalFaces; diff --git a/vtkm/filter/testing/UnitTestFieldMetadata.cxx b/vtkm/filter/testing/UnitTestFieldMetadata.cxx index ecf71bbf5..4de8c2751 100644 --- a/vtkm/filter/testing/UnitTestFieldMetadata.cxx +++ b/vtkm/filter/testing/UnitTestFieldMetadata.cxx @@ -27,13 +27,15 @@ namespace vtkm::cont::Field makeCellField() { - return vtkm::cont::Field("foo", vtkm::cont::Field::ASSOC_CELL_SET, std::string(), + return vtkm::cont::Field("foo", + vtkm::cont::Field::ASSOC_CELL_SET, + std::string(), vtkm::cont::ArrayHandle()); } vtkm::cont::Field makePointField() { - return vtkm::cont::Field("foo", vtkm::cont::Field::ASSOC_POINTS, - vtkm::cont::ArrayHandle()); + return vtkm::cont::Field( + "foo", vtkm::cont::Field::ASSOC_POINTS, vtkm::cont::ArrayHandle()); } void TestFieldTypesUnknown() diff --git a/vtkm/filter/testing/UnitTestHistogramFilter.cxx b/vtkm/filter/testing/UnitTestHistogramFilter.cxx index 297a90b56..e913f35fa 100644 --- a/vtkm/filter/testing/UnitTestHistogramFilter.cxx +++ b/vtkm/filter/testing/UnitTestHistogramFilter.cxx @@ -240,8 +240,8 @@ vtkm::cont::DataSet MakeTestDataSet() vtkm::cont::Field("c_poisson", vtkm::cont::Field::ASSOC_CELL_SET, "cells", poisson, nCells)); dataSet.AddField( vtkm::cont::Field("c_normal", vtkm::cont::Field::ASSOC_CELL_SET, "cells", normal, nCells)); - dataSet.AddField(vtkm::cont::Field("c_chiSquare", vtkm::cont::Field::ASSOC_CELL_SET, "cells", - chiSquare, nCells)); + dataSet.AddField(vtkm::cont::Field( + "c_chiSquare", vtkm::cont::Field::ASSOC_CELL_SET, "cells", chiSquare, nCells)); dataSet.AddField( vtkm::cont::Field("c_uniform", vtkm::cont::Field::ASSOC_CELL_SET, "cells", poisson, nCells)); @@ -257,8 +257,11 @@ vtkm::cont::DataSet MakeTestDataSet() // // Verify the histogram result and tally // -void VerifyHistogram(const vtkm::filter::ResultField& result, vtkm::Id numberOfBins, - const vtkm::Range& range, vtkm::Float64 delta, bool output = true) +void VerifyHistogram(const vtkm::filter::ResultField& result, + vtkm::Id numberOfBins, + const vtkm::Range& range, + vtkm::Float64 delta, + bool output = true) { VTKM_TEST_ASSERT(result.IsValid(), "result should be valid"); VTKM_TEST_ASSERT(result.GetField().GetName() == "histogram", "Output field has wrong name."); diff --git a/vtkm/filter/testing/UnitTestMarchingCubesFilter.cxx b/vtkm/filter/testing/UnitTestMarchingCubesFilter.cxx index 6c3d86a58..a46a4f474 100644 --- a/vtkm/filter/testing/UnitTestMarchingCubesFilter.cxx +++ b/vtkm/filter/testing/UnitTestMarchingCubesFilter.cxx @@ -42,7 +42,8 @@ public: const vtkm::Id cellsPerLayer; VTKM_CONT - TangleField(const vtkm::Id3 dims, const vtkm::FloatDefault mins[3], + TangleField(const vtkm::Id3 dims, + const vtkm::FloatDefault mins[3], const vtkm::FloatDefault maxs[3]) : xdim(dims[0]) , ydim(dims[1]) @@ -133,8 +134,8 @@ public: VTKM_EXEC_CONT vtkm::Float32 operator()(vtkm::Vec v) const { - vtkm::Vec d(v[0] - this->Reference[0], v[1] - this->Reference[1], - v[2] - this->Reference[2]); + vtkm::Vec d( + v[0] - this->Reference[0], v[1] - this->Reference[1], v[2] - this->Reference[2]); return vtkm::Magnitude(d); } @@ -205,15 +206,19 @@ class MakeRadiantDataSet { public: typedef vtkm::cont::ArrayHandleUniformPointCoordinates CoordinateArrayHandle; - typedef vtkm::cont::ArrayHandleTransform< - vtkm::Float32, vtkm::cont::ArrayHandleUniformPointCoordinates, EuclideanNorm> + typedef vtkm::cont::ArrayHandleTransform DataArrayHandle; - typedef vtkm::cont::ArrayHandleTransform, + typedef vtkm::cont::ArrayHandleTransform, CubeGridConnectivity> ConnectivityArrayHandle; - typedef vtkm::cont::CellSetSingleType, CubeGridConnectivity>::StorageTag> + typedef vtkm::cont::CellSetSingleType< + vtkm::cont::ArrayHandleTransform, + CubeGridConnectivity>::StorageTag> CellSet; vtkm::cont::DataSet Make3DRadiantDataSet(vtkm::IdComponent dim = 5); @@ -224,14 +229,15 @@ class PolicyRadiantDataSet : public vtkm::filter::PolicyBase, + typedef vtkm::cont::ArrayHandleTransform, CubeGridConnectivity> TransformHandleType; public: - struct TypeListTagRadiantTypes - : vtkm::ListTagBase + struct TypeListTagRadiantTypes : vtkm::ListTagBase { }; @@ -259,7 +265,8 @@ inline vtkm::cont::DataSet MakeRadiantDataSet::Make3DRadiantDataSet(vtkm::IdComp const vtkm::IdComponent nCells = dim * dim * dim; vtkm::Float32 spacing = vtkm::Float32(1. / dim); - CoordinateArrayHandle coordinates(vtkm::Id3(dim + 1, dim + 1, dim + 1), CoordType(-.5, -.5, -.5), + CoordinateArrayHandle coordinates(vtkm::Id3(dim + 1, dim + 1, dim + 1), + CoordType(-.5, -.5, -.5), CoordType(spacing, spacing, spacing)); DataArrayHandle distanceToOrigin(coordinates); @@ -272,9 +279,11 @@ inline vtkm::cont::DataSet MakeRadiantDataSet::Make3DRadiantDataSet(vtkm::IdComp dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates)); //Set point scalar - dataSet.AddField(vtkm::cont::Field("distanceToOrigin", vtkm::cont::Field::ASSOC_POINTS, + dataSet.AddField(vtkm::cont::Field("distanceToOrigin", + vtkm::cont::Field::ASSOC_POINTS, vtkm::cont::DynamicArrayHandle(distanceToOrigin))); - dataSet.AddField(vtkm::cont::Field("distanceToOther", vtkm::cont::Field::ASSOC_POINTS, + dataSet.AddField(vtkm::cont::Field("distanceToOther", + vtkm::cont::Field::ASSOC_POINTS, vtkm::cont::DynamicArrayHandle(distanceToOther))); CellSet cellSet("cells"); diff --git a/vtkm/filter/testing/UnitTestPointElevationFilter.cxx b/vtkm/filter/testing/UnitTestPointElevationFilter.cxx index d3c446c4c..32d5040ac 100644 --- a/vtkm/filter/testing/UnitTestPointElevationFilter.cxx +++ b/vtkm/filter/testing/UnitTestPointElevationFilter.cxx @@ -52,9 +52,10 @@ vtkm::cont::DataSet MakePointElevationTestDataSet() { for (vtkm::Id i = 0; i < dim - 1; ++i) { - cellSet.AddCell(vtkm::CELL_SHAPE_QUAD, 4, - vtkm::make_Vec(j * dim + i, j * dim + i + 1, (j + 1) * dim + i + 1, - (j + 1) * dim + i)); + cellSet.AddCell(vtkm::CELL_SHAPE_QUAD, + 4, + vtkm::make_Vec( + j * dim + i, j * dim + i + 1, (j + 1) * dim + i + 1, (j + 1) * dim + i)); } } cellSet.CompleteAddingCells(vtkm::Id(coordinates.size())); diff --git a/vtkm/internal/ConnectivityStructuredInternals.h b/vtkm/internal/ConnectivityStructuredInternals.h index d43950efb..e22d254ab 100644 --- a/vtkm/internal/ConnectivityStructuredInternals.h +++ b/vtkm/internal/ConnectivityStructuredInternals.h @@ -402,7 +402,8 @@ public: const vtkm::Id pointDims01 = this->PointDimensions[0] * this->PointDimensions[1]; const vtkm::Id indexij = flatPointIndex % pointDims01; - return vtkm::Id3(indexij % this->PointDimensions[0], indexij / this->PointDimensions[0], + return vtkm::Id3(indexij % this->PointDimensions[0], + indexij / this->PointDimensions[0], flatPointIndex / pointDims01); } @@ -418,7 +419,8 @@ public: vtkm::Id3 FlatToLogicalCellIndex(vtkm::Id flatCellIndex) const { const vtkm::Id indexij = flatCellIndex % this->CellDim01; - return vtkm::Id3(indexij % this->CellDimensions[0], indexij / this->CellDimensions[0], + return vtkm::Id3(indexij % this->CellDimensions[0], + indexij / this->CellDimensions[0], flatCellIndex / this->CellDim01); } @@ -452,7 +454,8 @@ struct ConnectivityStructuredIndexHelper template struct ConnectivityStructuredIndexHelper + vtkm::TopologyElementTagCell, + Dimension> { typedef vtkm::internal::ConnectivityStructuredInternals ConnectivityType; typedef typename ConnectivityType::SchedulingRangeType LogicalIndexType; @@ -497,7 +500,8 @@ struct ConnectivityStructuredIndexHelper struct ConnectivityStructuredIndexHelper + vtkm::TopologyElementTagPoint, + Dimension> { typedef vtkm::internal::ConnectivityStructuredInternals ConnectivityType; typedef typename ConnectivityType::SchedulingRangeType LogicalIndexType; diff --git a/vtkm/internal/FunctionInterface.h b/vtkm/internal/FunctionInterface.h index 6080cd0b6..8498ae8df 100644 --- a/vtkm/internal/FunctionInterface.h +++ b/vtkm/internal/FunctionInterface.h @@ -85,7 +85,9 @@ struct FunctionInterfaceMoveParameters<0, ParameterIndex> template struct FunctionInterfaceStaticTransformType; -template class FunctionInterfaceDynamicTransformContContinue; @@ -686,8 +688,10 @@ public: VTKM_CONT void DynamicTransformCont(const TransformFunctor& transform, const FinishFunctor& finish) const { - typedef detail::FunctionInterfaceDynamicTransformContContinue + typedef detail::FunctionInterfaceDynamicTransformContContinue ContinueFunctorType; FunctionInterface emptyInterface; @@ -735,14 +739,17 @@ private: namespace detail { -template class FunctionInterfaceDynamicTransformContContinue { public: FunctionInterfaceDynamicTransformContContinue( const vtkm::internal::FunctionInterface& originalInterface, - vtkm::internal::FunctionInterface& newInterface, const TransformFunctor& transform, + vtkm::internal::FunctionInterface& newInterface, + const TransformFunctor& transform, const FinishFunctor& finish) : OriginalInterface(originalInterface) , NewInterface(newInterface) @@ -774,8 +781,10 @@ public: template void DoNextTransform(vtkm::internal::FunctionInterface& nextInterface) const { - typedef FunctionInterfaceDynamicTransformContContinue + typedef FunctionInterfaceDynamicTransformContContinue NextContinueType; NextContinueType nextContinue = NextContinueType(this->OriginalInterface, nextInterface, this->Transform, this->Finish); @@ -790,8 +799,10 @@ private: void DoNextTransform(vtkm::internal::FunctionInterface& nextInterface, std::true_type) const { - typedef FunctionInterfaceDynamicTransformContContinue + typedef FunctionInterfaceDynamicTransformContContinue NextContinueType; NextContinueType nextContinue = NextContinueType(this->OriginalInterface, nextInterface, this->Transform, this->Finish); @@ -814,8 +825,10 @@ private: const TransformFunctor& Transform; const FinishFunctor& Finish; - void operator=(const FunctionInterfaceDynamicTransformContContinue< - OriginalFunction, NewFunction, TransformFunctor, FinishFunctor>&) = delete; + void operator=(const FunctionInterfaceDynamicTransformContContinue&) = delete; }; } // namespace detail diff --git a/vtkm/internal/FunctionInterfaceDetailPost.h b/vtkm/internal/FunctionInterfaceDetailPost.h index 3cec8cd9e..6ffaee833 100644 --- a/vtkm/internal/FunctionInterfaceDetailPost.h +++ b/vtkm/internal/FunctionInterfaceDetailPost.h @@ -33,202 +33,178 @@ #error Mismatch of maximum parameters between FunctionInterfaceDatailPre.h.in and FunctionInterfaceDetailPost.h.in #endif +namespace vtkm +{ +namespace internal +{ -namespace vtkm { -namespace internal { - -namespace detail { +namespace detail +{ //============================================================================ -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; -template -struct FunctionInterfaceStaticTransformType { - typedef R(type)( - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type, - typename Transform::template ReturnType::type - ); +template +struct FunctionInterfaceStaticTransformType +{ + typedef R(type)(typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type, + typename Transform::template ReturnType::type); }; - } // namespace detail //============================================================================ @@ -246,11 +222,8 @@ struct FunctionInterfaceStaticTransformType -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface() { FunctionInterface fi; return fi; @@ -269,13 +242,8 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface(const P1& p1) { FunctionInterface fi; fi.template SetParameter<1>(p1); @@ -295,17 +263,10 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface(const P1& p1, const P2& p2) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); return fi; @@ -324,19 +285,12 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2, - const P3& p3 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface(const P1& p1, + const P2& p2, + const P3& p3) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); fi.template SetParameter<3>(p3); @@ -356,21 +310,13 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2, - const P3& p3, - const P4& p4 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface(const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); fi.template SetParameter<3>(p3); @@ -391,23 +337,14 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2, - const P3& p3, - const P4& p4, - const P5& p5 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface(const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); fi.template SetParameter<3>(p3); @@ -429,25 +366,15 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2, - const P3& p3, - const P4& p4, - const P5& p5, - const P6& p6 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface(const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); fi.template SetParameter<3>(p3); @@ -470,27 +397,23 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2, - const P3& p3, - const P4& p4, - const P5& p5, - const P6& p6, - const P7& p7 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface(const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6, + const P7& p7) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); fi.template SetParameter<3>(p3); @@ -514,29 +437,26 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2, - const P3& p3, - const P4& p4, - const P5& p5, - const P6& p6, - const P7& p7, - const P8& p8 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface( + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6, + const P7& p7, + const P8& p8) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); fi.template SetParameter<3>(p3); @@ -561,31 +481,28 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2, - const P3& p3, - const P4& p4, - const P5& p5, - const P6& p6, - const P7& p7, - const P8& p8, - const P9& p9 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface( + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6, + const P7& p7, + const P8& p8, + const P9& p9) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); fi.template SetParameter<3>(p3); @@ -611,33 +528,30 @@ make_FunctionInterface( /// \endcode /// VTKM_SUPPRESS_EXEC_WARNINGS -template -VTKM_EXEC_CONT -FunctionInterface -make_FunctionInterface( - const P1& p1, - const P2& p2, - const P3& p3, - const P4& p4, - const P5& p5, - const P6& p6, - const P7& p7, - const P8& p8, - const P9& p9, - const P10& p10 - ) +template +VTKM_EXEC_CONT FunctionInterface make_FunctionInterface( + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6, + const P7& p7, + const P8& p8, + const P9& p9, + const P10& p10) { - FunctionInterface fi; + FunctionInterface fi; fi.template SetParameter<1>(p1); fi.template SetParameter<2>(p2); fi.template SetParameter<3>(p3); @@ -650,8 +564,6 @@ make_FunctionInterface( fi.template SetParameter<10>(p10); return fi; } - - } } // namespace vtkm::internal diff --git a/vtkm/internal/FunctionInterfaceDetailPre.h b/vtkm/internal/FunctionInterfaceDetailPre.h index 10268e75f..5eb8cb197 100644 --- a/vtkm/internal/FunctionInterfaceDetailPre.h +++ b/vtkm/internal/FunctionInterfaceDetailPre.h @@ -36,83 +36,78 @@ #define VTKM_MAX_FUNCTION_PARAMETERS 10 - -namespace vtkm { -namespace internal { +namespace vtkm +{ +namespace internal +{ /// This struct is used internally by FunctionInterface to store the return /// value of a function. There is a special implementation for a return type of /// void, which stores nothing. /// -template -struct FunctionInterfaceReturnContainer { +template +struct FunctionInterfaceReturnContainer +{ T Value; static VTKM_CONSTEXPR bool VALID = true; }; -template<> -struct FunctionInterfaceReturnContainer { +template <> +struct FunctionInterfaceReturnContainer +{ // Nothing to store for void return. static VTKM_CONSTEXPR bool VALID = false; }; -namespace detail { +namespace detail +{ //============================================================================ // This templated class contains the state of parameters. If you get a compiler // error stating that this class is not specialized, that probably means that // you are using FunctionInterface with an unsupported number of arguments. -template +template struct ParameterContainer; -template -struct ParameterContainer { +template +struct ParameterContainer +{ }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; P3 Parameter3; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; P3 Parameter3; P4 Parameter4; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; P3 Parameter3; @@ -120,14 +115,9 @@ struct ParameterContainer { P5 Parameter5; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; P3 Parameter3; @@ -136,15 +126,16 @@ struct ParameterContainer { P6 Parameter6; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; P3 Parameter3; @@ -154,16 +145,17 @@ struct ParameterContainer { P7 Parameter7; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; P3 Parameter3; @@ -174,17 +166,18 @@ struct ParameterContainer { P8 Parameter8; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; P3 Parameter3; @@ -196,18 +189,19 @@ struct ParameterContainer { P9 Parameter9; }; -template -struct ParameterContainer { +template +struct ParameterContainer +{ P1 Parameter1; P2 Parameter2; P3 Parameter3; @@ -220,413 +214,419 @@ struct ParameterContainer { P10 Parameter10; }; - //============================================================================ -template struct FunctionSigInfo; -template +template +struct FunctionSigInfo; +template struct FunctionSigInfo { static VTKM_CONSTEXPR std::size_t Arity = sizeof...(ArgTypes); using ArityType = std::integral_constant; using ResultType = R; - using Components = brigand::list; + using Components = brigand::list; using Parameters = brigand::list; }; -template struct AtType; -template +template +struct AtType; +template struct AtType { - using type = brigand::at_c< brigand::list, Index>; + using type = brigand::at_c, Index>; }; -template struct AppendType; -template class L, typename T, typename NT, typename... U> +template +struct AppendType; +template