From 5b403f9d8f5ecceeefbc0c1527d7ef7784800f59 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 3 Oct 2019 13:32:54 -0400 Subject: [PATCH 1/2] ExecutionSignatures are now optional for simple worklets If a worklet doesn't explicitly state an ExecutionSignature, VTK-m assumes the worklet has no return value, and each ControlSignature argument is passed to the worklet in the same order. For example if we had this worklet: ```cxx struct DotProduct : public vtkm::worklet::WorkletMapField { using ControlSignature = void(FieldIn, FieldIn, FieldOut); using ExecutionSignature = void(_1, _2, _3); template VTKM_EXEC void operator()(const vtkm::Vec& v1, const vtkm::Vec& v2, T& outValue) const { outValue = vtkm::Dot(v1, v2); } }; ``` It can be simplified to be: ```cxx struct DotProduct : public vtkm::worklet::WorkletMapField { using ControlSignature = void(FieldIn, FieldIn, FieldOut); template VTKM_EXEC void operator()(const vtkm::Vec& v1, const vtkm::Vec& v2, T& outValue) const { outValue = vtkm::Dot(v1, v2); } }; --- .../changelog/execution-signature-optional.md | 38 ++++++ vtkm/worklet/internal/DispatcherBase.h | 6 +- vtkm/worklet/internal/Placeholders.h | 123 ++++++++++++++++++ vtkm/worklet/internal/WorkletBase.h | 10 +- 4 files changed, 167 insertions(+), 10 deletions(-) create mode 100644 docs/changelog/execution-signature-optional.md create mode 100644 vtkm/worklet/internal/Placeholders.h diff --git a/docs/changelog/execution-signature-optional.md b/docs/changelog/execution-signature-optional.md new file mode 100644 index 000000000..9611c6248 --- /dev/null +++ b/docs/changelog/execution-signature-optional.md @@ -0,0 +1,38 @@ +ExecutionSignatures are now optional for simple worklets + +If a worklet doesn't explicitly state an `ExecutionSignature`, VTK-m +assumes the worklet has no return value, and each `ControlSignature` +argument is passed to the worklet in the same order. + +For example if we had this worklet: +```cxx +struct DotProduct : public vtkm::worklet::WorkletMapField +{ + using ControlSignature = void(FieldIn, FieldIn, FieldOut); + using ExecutionSignature = void(_1, _2, _3); + + template + VTKM_EXEC void operator()(const vtkm::Vec& v1, + const vtkm::Vec& v2, + T& outValue) const + { + outValue = vtkm::Dot(v1, v2); + } +}; +``` + +It can be simplified to be: + +```cxx +struct DotProduct : public vtkm::worklet::WorkletMapField +{ + using ControlSignature = void(FieldIn, FieldIn, FieldOut); + + template + VTKM_EXEC void operator()(const vtkm::Vec& v1, + const vtkm::Vec& v2, + T& outValue) const + { + outValue = vtkm::Dot(v1, v2); + } +}; diff --git a/vtkm/worklet/internal/DispatcherBase.h b/vtkm/worklet/internal/DispatcherBase.h index 11f5eb179..36eec6086 100644 --- a/vtkm/worklet/internal/DispatcherBase.h +++ b/vtkm/worklet/internal/DispatcherBase.h @@ -489,8 +489,12 @@ private: protected: using ControlInterface = vtkm::internal::FunctionInterface; + + // We go through the GetExecSig as that generates a default ExecutionSignature + // if one doesn't exist on the worklet + using ExecutionSignature = typename vtkm::placeholders::GetExecSig::ExecutionSignature; using ExecutionInterface = - vtkm::internal::FunctionInterface; + vtkm::internal::FunctionInterface; static constexpr vtkm::IdComponent NUM_INVOKE_PARAMS = ControlInterface::ARITY; diff --git a/vtkm/worklet/internal/Placeholders.h b/vtkm/worklet/internal/Placeholders.h new file mode 100644 index 000000000..63b395339 --- /dev/null +++ b/vtkm/worklet/internal/Placeholders.h @@ -0,0 +1,123 @@ +//============================================================================ +// Copyright (c) Kitware, Inc. +// All rights reserved. +// See LICENSE.txt for details. +// +// This software is distributed WITHOUT ANY WARRANTY; without even +// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. See the above copyright notice for more information. +//============================================================================ +#ifndef vtk_m_worklet_internal_Placeholders_h +#define vtk_m_worklet_internal_Placeholders_h + +#include +#include + +#include + +#include + +namespace vtkm +{ +namespace placeholders +{ + +//============================================================================ +template +struct Arg : vtkm::exec::arg::BasicArg +{ +}; + +//============================================================================ +/** +* Type that computes the number of parameters to the given function signature +*/ +template +struct FunctionSigArity; +template +struct FunctionSigArity +{ + static constexpr std::size_t value = sizeof...(ArgTypes); +}; + +//============================================================================ +template +auto DefaultSigGenerator(tao::seq::integer_sequence) -> void (*)(Arg...); + +/** +* Given a desired length will generate the default/assumed ExecutionSignature. +* +* So if you want the ExecutionSignature for a function that has 2 parameters this +* would generate a `type` that is comparable to the user writing: +* +* using ExecutionSignature = void(_1, _2); +* +*/ +template +struct DefaultExecSig +{ + using seq = tao::seq::make_integer_sequence; + using type = typename std::remove_pointer::type; +}; +template<> +struct DefaultExecSig<1> +{ + using type = void(Arg<1>); +}; +template<> +struct DefaultExecSig<2> +{ + using type = void(Arg<1>,Arg<2>); +}; +template<> +struct DefaultExecSig<3> +{ + using type = void(Arg<1>,Arg<2>,Arg<3>); +}; +template<> +struct DefaultExecSig<4> +{ + using type = void(Arg<1>,Arg<2>,Arg<3>,Arg<4>); +}; + +//============================================================================ +/** +* Given a worklet this will produce a typedef `ExecutionSignature` that is +* the ExecutionSignature of the worklet, even if the worklet itself doesn't +* have said typedef. +* +* Logic this class uses: +* +* 1. If the `WorkletType` has a typedef named `ExecutionSignature` use that +* 2. If no typedef exists, generate one! +* - Presume the Worklet has a `void` return type, and each ControlSignature +* argument is passed to the worklet in the same listed order. +* - Generate this assumed `ExecutionSignature` by using `DefaultExecSig` +* +*/ +template +struct GetExecSig +{ + template())> + static vtkmstd::tuple get_exec_sig(int); + + template + static vtkmstd::tuple get_exec_sig(...); + + using cont_sig = typename WorkletType::ControlSignature; + using cont_sig_info = vtkm::placeholders::FunctionSigArity; + + using result = decltype(get_exec_sig(0)); + using has_explicit_exec_sig = typename vtkmstd::tuple_element<0, result>::type; + + using ExecutionSignature = typename std::conditional< + has_explicit_exec_sig::value, + typename vtkmstd::tuple_element<1, result>::type, + typename vtkm::placeholders::DefaultExecSig::type>::type; +}; + + +} +} + +#endif diff --git a/vtkm/worklet/internal/WorkletBase.h b/vtkm/worklet/internal/WorkletBase.h index cc627e918..cbd67101c 100644 --- a/vtkm/worklet/internal/WorkletBase.h +++ b/vtkm/worklet/internal/WorkletBase.h @@ -38,20 +38,12 @@ #include #include +#include #include #include namespace vtkm { -namespace placeholders -{ - -template -struct Arg : vtkm::exec::arg::BasicArg -{ -}; -} - namespace worklet { namespace internal -- GitLab From 2b490a128b4fadb8f80e3a14c61868b44eb71d39 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 3 Oct 2019 13:54:48 -0400 Subject: [PATCH 2/2] Provide convenience macros to make Worklet markup easier for new users --- ...macros-to-make-worklet-signature-easier.md | 41 +++++++ examples/hello_worklet/HelloWorklet.cxx | 4 +- examples/multi_backend/IOGenerator.cxx | 3 +- vtkm/cont/CellSetExtrude.hxx | 7 +- vtkm/cont/CellSetPermutation.h | 8 +- vtkm/cont/PointLocatorUniformGrid.cxx | 5 +- vtkm/filter/GhostCellClassify.hxx | 12 +- vtkm/filter/Lagrangian.hxx | 4 +- vtkm/source/Tangle.cxx | 5 +- vtkm/source/Wavelet.cxx | 5 +- .../taotuple/vtkmtaotuple/include/Tuple.h | 2 + vtkm/worklet/AverageByKey.h | 4 +- vtkm/worklet/CellAverage.h | 4 +- vtkm/worklet/CellDeepCopy.h | 4 +- vtkm/worklet/CellMeasure.h | 7 +- vtkm/worklet/CrossProduct.h | 3 +- vtkm/worklet/DotProduct.h | 3 +- vtkm/worklet/FieldEntropy.h | 3 +- vtkm/worklet/FieldHistogram.h | 8 +- vtkm/worklet/FieldStatistics.h | 13 +-- vtkm/worklet/LagrangianStructures.h | 5 +- vtkm/worklet/Magnitude.h | 3 +- vtkm/worklet/MaskSelect.cxx | 8 +- vtkm/worklet/MeshQuality.h | 7 +- vtkm/worklet/Normalize.h | 6 +- vtkm/worklet/PointAverage.h | 6 +- vtkm/worklet/PointMerge.h | 21 ++-- vtkm/worklet/Probe.h | 34 +++--- vtkm/worklet/RemoveUnusedPoints.h | 3 +- vtkm/worklet/SurfaceNormals.h | 13 +-- vtkm/worklet/Tetrahedralize.h | 3 +- vtkm/worklet/Triangulate.h | 3 +- vtkm/worklet/Tube.h | 108 +++++++++--------- vtkm/worklet/VertexClustering.h | 24 ++-- vtkm/worklet/WarpScalar.h | 4 +- vtkm/worklet/colorconversion/LookupTable.h | 3 +- .../colorconversion/TransferFunction.h | 3 +- .../connectivities/GraphConnectivity.h | 10 +- .../connectivities/ImageConnectivity.h | 12 +- vtkm/worklet/connectivities/UnionFind.h | 10 +- vtkm/worklet/gradient/CellGradient.h | 12 +- vtkm/worklet/gradient/Divergence.h | 4 +- vtkm/worklet/gradient/PointGradient.h | 15 ++- vtkm/worklet/gradient/QCriterion.h | 4 +- .../gradient/StructuredPointGradient.h | 12 +- vtkm/worklet/gradient/Transpose.h | 5 +- vtkm/worklet/gradient/Vorticity.h | 4 +- vtkm/worklet/histogram/ComputeNDEntropy.h | 3 +- vtkm/worklet/histogram/ComputeNDHistogram.h | 4 +- .../histogram/MarginalizeNDHistogram.h | 7 +- vtkm/worklet/internal/Placeholders.h | 39 +++++++ .../ParticleAdvectionWorklets.h | 8 +- .../spatialstructure/KdTree3DConstruction.h | 34 ++---- .../spatialstructure/KdTree3DNNSearch.h | 13 +-- .../tetrahedralize/TetrahedralizeExplicit.h | 7 +- .../tetrahedralize/TetrahedralizeStructured.h | 5 +- .../worklet/triangulate/TriangulateExplicit.h | 7 +- .../triangulate/TriangulateStructured.h | 5 +- vtkm/worklet/zfp/ZFPDecode1.h | 3 +- vtkm/worklet/zfp/ZFPDecode2.h | 3 +- vtkm/worklet/zfp/ZFPDecode3.h | 3 +- vtkm/worklet/zfp/ZFPEncode1.h | 3 +- vtkm/worklet/zfp/ZFPEncode2.h | 3 +- vtkm/worklet/zfp/ZFPEncode3.h | 3 +- vtkm/worklet/zfp/ZFPTools.h | 4 +- 65 files changed, 305 insertions(+), 336 deletions(-) create mode 100644 docs/changelog/provide-macros-to-make-worklet-signature-easier.md diff --git a/docs/changelog/provide-macros-to-make-worklet-signature-easier.md b/docs/changelog/provide-macros-to-make-worklet-signature-easier.md new file mode 100644 index 000000000..c578dfa64 --- /dev/null +++ b/docs/changelog/provide-macros-to-make-worklet-signature-easier.md @@ -0,0 +1,41 @@ +VTK-m now provides three convenience macros to make worklet writing easier + +`VTKM_INVOKE_SIG` is a convenience macro that replaces the `Control` and +`Execution` Signature typedefs for a VTK-m worklet. This assumes the worklet +has no return value, and each `ControlSignature` argument is passed to the +worklet in the same order. It is used like: + +```cxx +struct DotProduct : public vtkm::worklet::WorkletMapField +{ + VTKM_INVOKE_SIG(FieldIn, FieldIn, FieldOut); + template + VTKM_EXEC void operator()(const vtkm::Vec& v1, + const vtkm::Vec& v2, + T& outValue) const + { + outValue = vtkm::Dot(v1, v2); + } +}; +``` + + +VTKM_CONT_INVOKE_SIG is a convenience macro that replaces the `Control` +Signature typedef for a VTK-m worklet. It is used like: +```cxx +VTKM_CONT_INVOKE_SIG(FieldIn, FieldOut); +``` +Instead of the user having to write: +``` +using ControlSignature = void(FieldIn, FieldOut); +``` + +VTKM_EXEC_INVOKE_SIG is a convenience macro that replaces the `Execution` +Signature typedef for a VTK-m worklet that has a `void` return type. It is used like: +```cxx +VTKM_EXEC_INVOKE_SIG(_1, _2, WorkId); +``` +Instead of the user having to write: +``` +using ExecutionSignature = void(_1, _2, WorkId); +``` diff --git a/examples/hello_worklet/HelloWorklet.cxx b/examples/hello_worklet/HelloWorklet.cxx index 0ddd40d6e..b80aea7b1 100644 --- a/examples/hello_worklet/HelloWorklet.cxx +++ b/examples/hello_worklet/HelloWorklet.cxx @@ -28,9 +28,7 @@ namespace worklet struct HelloWorklet : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn inVector, FieldOut outMagnitude); - using ExecutionSignature = void(_1, _2); - + VTKM_INVOKE_SIG(FieldIn inVector, FieldOut outMagnitude); VTKM_EXEC void operator()(const vtkm::Vec3f& inVector, vtkm::FloatDefault& outMagnitude) const { outMagnitude = vtkm::Magnitude(inVector); diff --git a/examples/multi_backend/IOGenerator.cxx b/examples/multi_backend/IOGenerator.cxx index 2c44645e7..4f1880014 100644 --- a/examples/multi_backend/IOGenerator.cxx +++ b/examples/multi_backend/IOGenerator.cxx @@ -24,8 +24,7 @@ struct WaveField : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn, FieldOut); template VTKM_EXEC void operator()(const vtkm::Vec& input, vtkm::Vec& output) const diff --git a/vtkm/cont/CellSetExtrude.hxx b/vtkm/cont/CellSetExtrude.hxx index 9ad2f140e..d55094f70 100644 --- a/vtkm/cont/CellSetExtrude.hxx +++ b/vtkm/cont/CellSetExtrude.hxx @@ -14,8 +14,7 @@ namespace { struct ComputeReverseMapping : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn cellIndex, WholeArrayOut cellIds); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn cellIndex, WholeArrayOut cellIds); VTKM_SUPPRESS_EXEC_WARNINGS template @@ -31,8 +30,8 @@ struct ComputeReverseMapping : public vtkm::worklet::WorkletMapField struct ComputePrevNode : public vtkm::worklet::WorkletMapField { - typedef void ControlSignature(FieldIn nextNode, WholeArrayOut prevNodeArray); - typedef void ExecutionSignature(InputIndex, _1, _2); + VTKM_CONT_INVOKE_SIG(FieldIn nextNode, WholeArrayOut prevNodeArray); + VTKM_EXEC_INVOKE_SIG(InputIndex, _1, _2); template VTKM_EXEC void operator()(vtkm::Id idx, vtkm::Int32 next, PortalType& prevs) const diff --git a/vtkm/cont/CellSetPermutation.h b/vtkm/cont/CellSetPermutation.h index 41fce062e..698318b56 100644 --- a/vtkm/cont/CellSetPermutation.h +++ b/vtkm/cont/CellSetPermutation.h @@ -47,8 +47,8 @@ class RConnTableHelpers public: struct WriteNumIndices : public vtkm::worklet::WorkletVisitCellsWithPoints { - using ControlSignature = void(CellSetIn cellset, FieldOutCell numIndices); - using ExecutionSignature = void(PointCount, _2); + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldOutCell numIndices); + VTKM_EXEC_INVOKE_SIG(PointCount, _2); using InputDomain = _1; VTKM_EXEC void operator()(vtkm::IdComponent pointCount, vtkm::IdComponent& numIndices) const @@ -59,8 +59,8 @@ public: struct WriteConnectivity : public vtkm::worklet::WorkletVisitCellsWithPoints { - using ControlSignature = void(CellSetIn cellset, FieldOutCell connectivity); - using ExecutionSignature = void(PointCount, PointIndices, _2); + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldOutCell connectivity); + VTKM_EXEC_INVOKE_SIG(PointCount, PointIndices, _2); using InputDomain = _1; template diff --git a/vtkm/cont/PointLocatorUniformGrid.cxx b/vtkm/cont/PointLocatorUniformGrid.cxx index 85bb430e6..bcd46f260 100644 --- a/vtkm/cont/PointLocatorUniformGrid.cxx +++ b/vtkm/cont/PointLocatorUniformGrid.cxx @@ -30,9 +30,8 @@ namespace internal class BinPointsWorklet : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn coord, FieldOut label); - - using ExecutionSignature = void(_1, _2); + VTKM_CONT_INVOKE_SIG(FieldIn coord, FieldOut label); + VTKM_EXEC_INVOKE_SIG(_1, _2); VTKM_CONT BinPointsWorklet(vtkm::Vec3f min, vtkm::Vec3f max, vtkm::Id3 dims) diff --git a/vtkm/filter/GhostCellClassify.hxx b/vtkm/filter/GhostCellClassify.hxx index 5f48436a4..7f2ce26ae 100644 --- a/vtkm/filter/GhostCellClassify.hxx +++ b/vtkm/filter/GhostCellClassify.hxx @@ -32,8 +32,8 @@ public: { } - using ControlSignature = void(CellSetIn, FieldOut); - using ExecutionSignature = void(Boundary, _2); + VTKM_CONT_INVOKE_SIG(CellSetIn, FieldOut); + VTKM_EXEC_INVOKE_SIG(Boundary, _2); VTKM_EXEC void operator()(const vtkm::exec::BoundaryState& boundary, vtkm::UInt8& value) const { @@ -53,8 +53,8 @@ public: { } - using ControlSignature = void(CellSetIn, FieldOut); - using ExecutionSignature = void(Boundary, _2); + VTKM_CONT_INVOKE_SIG(CellSetIn, FieldOut); + VTKM_EXEC_INVOKE_SIG(Boundary, _2); VTKM_EXEC void operator()(const vtkm::exec::BoundaryState& boundary, vtkm::UInt8& value) const { @@ -75,8 +75,8 @@ public: { } - using ControlSignature = void(CellSetIn, FieldOut); - using ExecutionSignature = void(Boundary, _2); + VTKM_CONT_INVOKE_SIG(CellSetIn, FieldOut); + VTKM_EXEC_INVOKE_SIG(Boundary, _2); VTKM_EXEC void operator()(const vtkm::exec::BoundaryState& boundary, vtkm::UInt8& value) const { diff --git a/vtkm/filter/Lagrangian.hxx b/vtkm/filter/Lagrangian.hxx index bd27cc3ab..f60e12640 100644 --- a/vtkm/filter/Lagrangian.hxx +++ b/vtkm/filter/Lagrangian.hxx @@ -38,9 +38,7 @@ namespace class ValidityCheck : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn end_point, FieldIn steps, FieldInOut output); - using ExecutionSignature = void(_1, _2, _3); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldIn end_point, FieldIn steps, FieldInOut output); ValidityCheck(vtkm::Bounds b) : bounds(b) diff --git a/vtkm/source/Tangle.cxx b/vtkm/source/Tangle.cxx index 2ecd897d6..a7273f561 100644 --- a/vtkm/source/Tangle.cxx +++ b/vtkm/source/Tangle.cxx @@ -20,9 +20,8 @@ namespace tangle class TangleField : public vtkm::worklet::WorkletVisitPointsWithCells { public: - using ControlSignature = void(CellSetIn, FieldOut v); - using ExecutionSignature = void(ThreadIndices, _2); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn, FieldOut v); + VTKM_EXEC_INVOKE_SIG(ThreadIndices, _2); const vtkm::Vec3f CellDimsf; const vtkm::Vec3f Mins; diff --git a/vtkm/source/Wavelet.cxx b/vtkm/source/Wavelet.cxx index 6c0fc042b..275a035b1 100644 --- a/vtkm/source/Wavelet.cxx +++ b/vtkm/source/Wavelet.cxx @@ -28,9 +28,8 @@ namespace wavelet struct WaveletField : public vtkm::worklet::WorkletVisitPointsWithCells { - using ControlSignature = void(CellSetIn, FieldOut v); - using ExecutionSignature = void(ThreadIndices, _2); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn, FieldOut v); + VTKM_EXEC_INVOKE_SIG(ThreadIndices, _2); using Vec3F = vtkm::Vec3f; diff --git a/vtkm/thirdparty/taotuple/vtkmtaotuple/include/Tuple.h b/vtkm/thirdparty/taotuple/vtkmtaotuple/include/Tuple.h index 34df430f3..2cc5ff0a6 100644 --- a/vtkm/thirdparty/taotuple/vtkmtaotuple/include/Tuple.h +++ b/vtkm/thirdparty/taotuple/vtkmtaotuple/include/Tuple.h @@ -43,11 +43,13 @@ namespace vtkmstd using simple_tuple::get; using simple_tuple::make_tuple; using simple_tuple::tuple; +using simple_tuple::tuple_element; using simple_tuple::tuple_size; #else using tao::get; using tao::make_tuple; using tao::tuple; +using tao::tuple_element; using tao::tuple_size; #endif diff --git a/vtkm/worklet/AverageByKey.h b/vtkm/worklet/AverageByKey.h index 7f27e3e2c..a6dfc8358 100644 --- a/vtkm/worklet/AverageByKey.h +++ b/vtkm/worklet/AverageByKey.h @@ -104,8 +104,8 @@ struct AverageByKey struct DivideWorklet : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn, FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2, _3); + VTKM_CONT_INVOKE_SIG(FieldIn, FieldIn, FieldOut); + VTKM_EXEC_INVOKE_SIG(_1, _2, _3); template VTKM_EXEC void operator()(const ValueType& v, const vtkm::Id& count, ValueType& vout) const diff --git a/vtkm/worklet/CellAverage.h b/vtkm/worklet/CellAverage.h index fe7a632bb..639c5528c 100644 --- a/vtkm/worklet/CellAverage.h +++ b/vtkm/worklet/CellAverage.h @@ -24,8 +24,8 @@ namespace worklet class CellAverage : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, FieldInPoint inPoints, FieldOutCell outCells); - using ExecutionSignature = void(PointCount, _2, _3); + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldInPoint inPoints, FieldOutCell outCells); + VTKM_EXEC_INVOKE_SIG(PointCount, _2, _3); using InputDomain = _1; template diff --git a/vtkm/worklet/CellDeepCopy.h b/vtkm/worklet/CellDeepCopy.h index d7ba9ffdc..1b20e0c1b 100644 --- a/vtkm/worklet/CellDeepCopy.h +++ b/vtkm/worklet/CellDeepCopy.h @@ -39,8 +39,8 @@ struct CellDeepCopy struct PassCellStructure : vtkm::worklet::WorkletVisitCellsWithPoints { - using ControlSignature = void(CellSetIn inputTopology, FieldOut shapes, FieldOut pointIndices); - using ExecutionSignature = void(CellShape, PointIndices, _2, _3); + VTKM_CONT_INVOKE_SIG(CellSetIn inputTopology, FieldOut shapes, FieldOut pointIndices); + VTKM_EXEC_INVOKE_SIG(CellShape, PointIndices, _2, _3); template VTKM_EXEC void operator()(const CellShape& inShape, diff --git a/vtkm/worklet/CellMeasure.h b/vtkm/worklet/CellMeasure.h index 483133373..146815cba 100644 --- a/vtkm/worklet/CellMeasure.h +++ b/vtkm/worklet/CellMeasure.h @@ -63,11 +63,8 @@ template class CellMeasure : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, - FieldInPoint pointCoords, - FieldOutCell volumesOut); - using ExecutionSignature = void(CellShape, PointCount, _2, _3); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldInPoint pointCoords, FieldOutCell volumesOut); + VTKM_EXEC_INVOKE_SIG(CellShape, PointCount, _2, _3); template VTKM_EXEC void operator()(CellShape shape, diff --git a/vtkm/worklet/CrossProduct.h b/vtkm/worklet/CrossProduct.h index a0db8b7b4..91c827a1f 100644 --- a/vtkm/worklet/CrossProduct.h +++ b/vtkm/worklet/CrossProduct.h @@ -22,8 +22,7 @@ namespace worklet class CrossProduct : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn, FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, FieldIn, FieldOut); template VTKM_EXEC void operator()(const vtkm::Vec& vec1, diff --git a/vtkm/worklet/DotProduct.h b/vtkm/worklet/DotProduct.h index 00f32545e..835892409 100644 --- a/vtkm/worklet/DotProduct.h +++ b/vtkm/worklet/DotProduct.h @@ -22,8 +22,7 @@ namespace worklet class DotProduct : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn, FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, FieldIn, FieldOut); template VTKM_EXEC void operator()(const vtkm::Vec& v1, diff --git a/vtkm/worklet/FieldEntropy.h b/vtkm/worklet/FieldEntropy.h index 2b8523e48..84c5b5df1 100644 --- a/vtkm/worklet/FieldEntropy.h +++ b/vtkm/worklet/FieldEntropy.h @@ -34,8 +34,7 @@ public: class SetBinInformationContent : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn freq, FieldOut informationContent); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn freq, FieldOut informationContent); vtkm::Float64 FreqSum; diff --git a/vtkm/worklet/FieldHistogram.h b/vtkm/worklet/FieldHistogram.h index 6984259ec..b142ba760 100644 --- a/vtkm/worklet/FieldHistogram.h +++ b/vtkm/worklet/FieldHistogram.h @@ -58,9 +58,7 @@ public: class SetHistogramBin : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn value, FieldOut binIndex); - using ExecutionSignature = void(_1, _2); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldIn value, FieldOut binIndex); vtkm::Id numberOfBins; FieldType minValue; @@ -89,9 +87,7 @@ public: class AdjacentDifference : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn inputIndex, WholeArrayIn counts, FieldOut outputCount); - using ExecutionSignature = void(_1, _2, _3); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldIn inputIndex, WholeArrayIn counts, FieldOut outputCount); template VTKM_EXEC void operator()(const vtkm::Id& index, diff --git a/vtkm/worklet/FieldStatistics.h b/vtkm/worklet/FieldStatistics.h index 8e02f37ac..1e221161c 100644 --- a/vtkm/worklet/FieldStatistics.h +++ b/vtkm/worklet/FieldStatistics.h @@ -57,13 +57,12 @@ public: class CalculatePowers : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn value, - FieldOut pow1Array, - FieldOut pow2Array, - FieldOut pow3Array, - FieldOut pow4Array); - using ExecutionSignature = void(_1, _2, _3, _4, _5); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(FieldIn value, + FieldOut pow1Array, + FieldOut pow2Array, + FieldOut pow3Array, + FieldOut pow4Array); + VTKM_EXEC_INVOKE_SIG(_1, _2, _3, _4, _5); vtkm::Id numPowers; diff --git a/vtkm/worklet/LagrangianStructures.h b/vtkm/worklet/LagrangianStructures.h index 27a363104..75e8190db 100644 --- a/vtkm/worklet/LagrangianStructures.h +++ b/vtkm/worklet/LagrangianStructures.h @@ -39,9 +39,8 @@ public: { } - using ControlSignature = void(WholeArrayIn, WholeArrayIn, FieldOut); - - using ExecutionSignature = void(WorkIndex, _1, _2, _3); + VTKM_CONT_INVOKE_SIG(WholeArrayIn, WholeArrayIn, FieldOut); + VTKM_EXEC_INVOKE_SIG(WorkIndex, _1, _2, _3); template VTKM_EXEC void operator()(const vtkm::Id index, diff --git a/vtkm/worklet/Magnitude.h b/vtkm/worklet/Magnitude.h index b262c2f11..f9e9123a0 100644 --- a/vtkm/worklet/Magnitude.h +++ b/vtkm/worklet/Magnitude.h @@ -22,8 +22,7 @@ namespace worklet class Magnitude : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn, FieldOut); template VTKM_EXEC void operator()(const T& inValue, T2& outValue) const diff --git a/vtkm/worklet/MaskSelect.cxx b/vtkm/worklet/MaskSelect.cxx index 8bc3df941..01a8c1c1d 100644 --- a/vtkm/worklet/MaskSelect.cxx +++ b/vtkm/worklet/MaskSelect.cxx @@ -22,10 +22,10 @@ namespace struct ReverseOutputToThreadMap : vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn outputToThreadMap, - FieldIn maskArray, - WholeArrayOut threadToOutputMap); - using ExecutionSignature = void(_1, InputIndex, _2, _3); + VTKM_CONT_INVOKE_SIG(FieldIn outputToThreadMap, + FieldIn maskArray, + WholeArrayOut threadToOutputMap); + VTKM_EXEC_INVOKE_SIG(_1, InputIndex, _2, _3); template VTKM_EXEC void operator()(vtkm::Id threadIndex, diff --git a/vtkm/worklet/MeshQuality.h b/vtkm/worklet/MeshQuality.h index 233bdb589..217191581 100644 --- a/vtkm/worklet/MeshQuality.h +++ b/vtkm/worklet/MeshQuality.h @@ -59,11 +59,8 @@ template class MeshQuality : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, - FieldInPoint pointCoords, - FieldOutCell metricOut); - using ExecutionSignature = void(CellShape, PointCount, _2, _3); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldInPoint pointCoords, FieldOutCell metricOut); + VTKM_EXEC_INVOKE_SIG(CellShape, PointCount, _2, _3); void SetMetric(MetricTagType m) { this->Metric = m; } void SetAverageArea(vtkm::FloatDefault a) { this->AverageArea = a; }; diff --git a/vtkm/worklet/Normalize.h b/vtkm/worklet/Normalize.h index 8382e6326..470c0b0d4 100644 --- a/vtkm/worklet/Normalize.h +++ b/vtkm/worklet/Normalize.h @@ -22,8 +22,7 @@ namespace worklet class Normal : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn, FieldOut); template VTKM_EXEC void operator()(const T& inValue, T2& outValue) const @@ -35,8 +34,7 @@ public: class Normalize : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldInOut); - using ExecutionSignature = void(_1); + VTKM_INVOKE_SIG(FieldInOut); template VTKM_EXEC void operator()(T& value) const diff --git a/vtkm/worklet/PointAverage.h b/vtkm/worklet/PointAverage.h index 3eaca5274..884716cf9 100644 --- a/vtkm/worklet/PointAverage.h +++ b/vtkm/worklet/PointAverage.h @@ -25,10 +25,8 @@ namespace worklet class PointAverage : public vtkm::worklet::WorkletVisitPointsWithCells { public: - using ControlSignature = void(CellSetIn cellset, - FieldInCell inCellField, - FieldOutPoint outPointField); - using ExecutionSignature = void(CellCount, _2, _3); + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldInCell inCellField, FieldOutPoint outPointField); + VTKM_EXEC_INVOKE_SIG(CellCount, _2, _3); using InputDomain = _1; template diff --git a/vtkm/worklet/PointMerge.h b/vtkm/worklet/PointMerge.h index 1809003ab..43149ecdc 100644 --- a/vtkm/worklet/PointMerge.h +++ b/vtkm/worklet/PointMerge.h @@ -148,10 +148,7 @@ public: // Converts point coordinates to a hash that represents the bin. struct CoordsToHash : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn pointCoordinates, - ExecObject binLocator, - FieldOut hashesOut); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn pointCoordinates, ExecObject binLocator, FieldOut hashesOut); template VTKM_EXEC void operator()(const vtkm::Vec& coordiantes, @@ -176,12 +173,12 @@ public: { } - using ControlSignature = void(KeysIn keys, - ValuesInOut pointIndices, - ValuesInOut pointCoordinates, - ExecObject binLocator, - ValuesOut neighborIndices); - using ExecutionSignature = void(_2, _3, _4, _5); + VTKM_CONT_INVOKE_SIG(KeysIn keys, + ValuesInOut pointIndices, + ValuesInOut pointCoordinates, + ExecObject binLocator, + ValuesOut neighborIndices); + VTKM_EXEC_INVOKE_SIG(_2, _3, _4, _5); template VTKM_EXEC void operator()(IndexVecInType& pointIndices, @@ -312,8 +309,8 @@ public: struct BuildPointInputToOutputMap : vtkm::worklet::WorkletReduceByKey { - using ControlSignature = void(KeysIn, ValuesOut PointInputToOutputMap); - using ExecutionSignature = void(InputIndex, _2); + VTKM_CONT_INVOKE_SIG(KeysIn, ValuesOut PointInputToOutputMap); + VTKM_EXEC_INVOKE_SIG(InputIndex, _2); template VTKM_EXEC void operator()(vtkm::Id newIndex, MapPortalType outputIndices) const diff --git a/vtkm/worklet/Probe.h b/vtkm/worklet/Probe.h index cd1e73e14..6c4f64b26 100644 --- a/vtkm/worklet/Probe.h +++ b/vtkm/worklet/Probe.h @@ -36,11 +36,7 @@ public: class FindCellWorklet : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn points, - ExecObject locator, - FieldOut cellIds, - FieldOut pcoords); - using ExecutionSignature = void(_1, _2, _3, _4); + VTKM_INVOKE_SIG(FieldIn points, ExecObject locator, FieldOut cellIds, FieldOut pcoords); template VTKM_EXEC void operator()(const vtkm::Vec3f& point, @@ -75,13 +71,12 @@ public: class ProbeUniformPoints : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, - FieldInPoint coords, - WholeArrayIn points, - WholeArrayOut cellIds, - WholeArrayOut parametricCoords); - using ExecutionSignature = void(InputIndex, CellShape, _2, _3, _4, _5); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, + FieldInPoint coords, + WholeArrayIn points, + WholeArrayOut cellIds, + WholeArrayOut parametricCoords); + VTKM_EXEC_INVOKE_SIG(InputIndex, CellShape, _2, _3, _4, _5); template inputCells, - WholeArrayIn inputField, - FieldOut result); - using ExecutionSignature = void(_1, _2, _3, _4, _5); + VTKM_CONT_INVOKE_SIG(FieldIn cellIds, + FieldIn parametricCoords, + WholeCellSetIn<> inputCells, + WholeArrayIn inputField, + FieldOut result); + VTKM_EXEC_INVOKE_SIG(_1, _2, _3, _4, _5); template VTKM_EXEC void operator()(vtkm::Id cellId, @@ -227,8 +222,7 @@ public: class MapCellField : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn cellIds, WholeArrayIn inputField, FieldOut result); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn cellIds, WholeArrayIn inputField, FieldOut result); template VTKM_EXEC void operator()(vtkm::Id cellId, diff --git a/vtkm/worklet/RemoveUnusedPoints.h b/vtkm/worklet/RemoveUnusedPoints.h index fa4b9dbca..123c9e012 100644 --- a/vtkm/worklet/RemoveUnusedPoints.h +++ b/vtkm/worklet/RemoveUnusedPoints.h @@ -40,8 +40,7 @@ public: /// struct GeneratePointMask : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn pointIndices, WholeArrayInOut pointMask); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn pointIndices, WholeArrayInOut pointMask); template VTKM_EXEC void operator()(vtkm::Id pointIndex, const PointMaskPortalType& pointMask) const diff --git a/vtkm/worklet/SurfaceNormals.h b/vtkm/worklet/SurfaceNormals.h index 3b2906643..61f17d3c6 100644 --- a/vtkm/worklet/SurfaceNormals.h +++ b/vtkm/worklet/SurfaceNormals.h @@ -52,10 +52,8 @@ public: class Worklet : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, FieldInPoint points, FieldOutCell normals); - using ExecutionSignature = void(CellShape, _2, _3); - - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldInPoint points, FieldOutCell normals); + VTKM_EXEC_INVOKE_SIG(CellShape, _2, _3); template VTKM_EXEC void operator()(CellShapeTag, @@ -157,12 +155,9 @@ public: class Worklet : public vtkm::worklet::WorkletVisitPointsWithCells { public: - using ControlSignature = void(CellSetIn cellset, - FieldInCell faceNormals, - FieldOutPoint pointNormals); - using ExecutionSignature = void(CellCount, _2, _3); + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldInCell faceNormals, FieldOutPoint pointNormals); + VTKM_EXEC_INVOKE_SIG(CellCount, _2, _3); - using InputDomain = _1; template VTKM_EXEC void operator()(vtkm::IdComponent numCells, diff --git a/vtkm/worklet/Tetrahedralize.h b/vtkm/worklet/Tetrahedralize.h index 881bfd57a..a68e9ad0a 100644 --- a/vtkm/worklet/Tetrahedralize.h +++ b/vtkm/worklet/Tetrahedralize.h @@ -26,8 +26,7 @@ public: // struct DistributeCellData : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn inIndices, FieldOut outIndices); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn inIndices, FieldOut outIndices); using ScatterType = vtkm::worklet::ScatterCounting; diff --git a/vtkm/worklet/Triangulate.h b/vtkm/worklet/Triangulate.h index 1ad60da79..9f30a2e2a 100644 --- a/vtkm/worklet/Triangulate.h +++ b/vtkm/worklet/Triangulate.h @@ -26,8 +26,7 @@ public: // struct DistributeCellData : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn inIndices, FieldOut outIndices); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn inIndices, FieldOut outIndices); using ScatterType = vtkm::worklet::ScatterCounting; diff --git a/vtkm/worklet/Tube.h b/vtkm/worklet/Tube.h index faf7fee21..e1b5099d5 100644 --- a/vtkm/worklet/Tube.h +++ b/vtkm/worklet/Tube.h @@ -39,18 +39,17 @@ public: { } - using ControlSignature = void(CellSetIn, - FieldOut ptsPerPolyline, - FieldOut ptsPerTube, - FieldOut numTubeConnIds, - FieldOut linesPerPolyline); - using ExecutionSignature = void(CellShape shapeType, - PointCount numPoints, - _2 ptsPerPolyline, - _3 ptsPerTube, - _4 numTubeConnIds, - _5 linesPerPolyline); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn, + FieldOut ptsPerPolyline, + FieldOut ptsPerTube, + FieldOut numTubeConnIds, + FieldOut linesPerPolyline); + VTKM_EXEC_INVOKE_SIG(CellShape shapeType, + PointCount numPoints, + _2 ptsPerPolyline, + _3 ptsPerTube, + _4 numTubeConnIds, + _5 linesPerPolyline); template VTKM_EXEC void operator()(const CellShapeTag& shapeType, @@ -103,17 +102,16 @@ public: { } - using ControlSignature = void(CellSetIn cellset, - WholeArrayIn pointCoords, - FieldInCell polylineOffset, - WholeArrayOut newNormals); - using ExecutionSignature = void(CellShape shapeType, - PointCount numPoints, - PointIndices ptIndices, - _2 inPts, - _3 polylineOffset, - _4 outNormals); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, + WholeArrayIn pointCoords, + FieldInCell polylineOffset, + WholeArrayOut newNormals); + VTKM_EXEC_INVOKE_SIG(CellShape shapeType, + PointCount numPoints, + PointIndices ptIndices, + _2 inPts, + _3 polylineOffset, + _4 outNormals); template @@ -266,23 +264,22 @@ public: { } - using ControlSignature = void(CellSetIn cellset, - WholeArrayIn pointCoords, - WholeArrayIn normals, - FieldInCell tubePointOffsets, - FieldInCell polylineOffset, - WholeArrayOut newPointCoords, - WholeArrayOut outPointSrcIdx); - using ExecutionSignature = void(CellShape shapeType, - PointCount numPoints, - PointIndices ptIndices, - _2 inPts, - _3 inNormals, - _4 tubePointOffsets, - _5 polylineOffset, - _6 outPts, - _7 outPointSrcIdx); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, + WholeArrayIn pointCoords, + WholeArrayIn normals, + FieldInCell tubePointOffsets, + FieldInCell polylineOffset, + WholeArrayOut newPointCoords, + WholeArrayOut outPointSrcIdx); + VTKM_EXEC_INVOKE_SIG(CellShape shapeType, + PointCount numPoints, + PointIndices ptIndices, + _2 inPts, + _3 inNormals, + _4 tubePointOffsets, + _5 polylineOffset, + _6 outPts, + _7 outPointSrcIdx); template VTKM_EXEC void operator()(const CellShapeTag& shapeType, @@ -496,9 +492,7 @@ public: class MapField : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn sourceIdx, WholeArrayIn sourceArray, FieldOut output); - using ExecutionSignature = void(_1 sourceIdx, _2 sourceArray, _3 output); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldIn sourceIdx, WholeArrayIn sourceArray, FieldOut output); VTKM_CONT MapField() {} diff --git a/vtkm/worklet/VertexClustering.h b/vtkm/worklet/VertexClustering.h index 3f6b3ffcd..8e001eb35 100644 --- a/vtkm/worklet/VertexClustering.h +++ b/vtkm/worklet/VertexClustering.h @@ -140,8 +140,7 @@ struct VertexClustering GridInfo Grid; public: - using ControlSignature = void(FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn, FieldOut); VTKM_CONT MapPointsWorklet(const GridInfo& grid) @@ -178,10 +177,10 @@ struct VertexClustering class MapCellsWorklet : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, - FieldInPoint pointClusterIds, - FieldOutCell cellClusterIds); - using ExecutionSignature = void(_2, _3); + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, + FieldInPoint pointClusterIds, + FieldOutCell cellClusterIds); + VTKM_EXEC_INVOKE_SIG(_2, _3); VTKM_CONT MapCellsWorklet() {} @@ -201,8 +200,8 @@ struct VertexClustering class IndexingWorklet : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn, WholeArrayOut); - using ExecutionSignature = void(WorkIndex, _1, _2); // WorkIndex: use vtkm indexing + VTKM_CONT_INVOKE_SIG(FieldIn, WholeArrayOut); + VTKM_EXEC_INVOKE_SIG(WorkIndex, _1, _2); // WorkIndex: use vtkm indexing template VTKM_EXEC void operator()(const vtkm::Id& counter, @@ -227,8 +226,7 @@ struct VertexClustering } public: - using ControlSignature = void(FieldIn, FieldOut, WholeArrayIn); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, FieldOut, WholeArrayIn); VTKM_CONT Cid2PointIdWorklet(vtkm::Id nPoints) @@ -275,8 +273,7 @@ struct VertexClustering vtkm::Int64 NPoints; public: - using ControlSignature = void(FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn, FieldOut); VTKM_CONT Cid3HashWorklet(vtkm::Id nPoints) @@ -298,8 +295,7 @@ struct VertexClustering vtkm::Int64 NPoints; public: - using ControlSignature = void(FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn, FieldOut); VTKM_CONT Cid3UnhashWorklet(vtkm::Id nPoints) diff --git a/vtkm/worklet/WarpScalar.h b/vtkm/worklet/WarpScalar.h index bae6e863b..7fef24c42 100644 --- a/vtkm/worklet/WarpScalar.h +++ b/vtkm/worklet/WarpScalar.h @@ -32,8 +32,8 @@ public: class WarpScalarImp : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn, FieldIn, FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2, _3, _4); + VTKM_INVOKE_SIG(FieldIn, FieldIn, FieldIn, FieldOut); + VTKM_CONT WarpScalarImp(vtkm::FloatDefault scaleAmount) : ScaleAmount(scaleAmount) diff --git a/vtkm/worklet/colorconversion/LookupTable.h b/vtkm/worklet/colorconversion/LookupTable.h index f0d42c1f6..b7542458f 100644 --- a/vtkm/worklet/colorconversion/LookupTable.h +++ b/vtkm/worklet/colorconversion/LookupTable.h @@ -58,8 +58,7 @@ struct LookupTable : public vtkm::worklet::WorkletMapField this->NumberOfSamples = colorTableSamples.NumberOfSamples; } - using ControlSignature = void(FieldIn in, WholeArrayIn lookup, FieldOut color); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn in, WholeArrayIn lookup, FieldOut color); template VTKM_EXEC void operator()(const T& in, diff --git a/vtkm/worklet/colorconversion/TransferFunction.h b/vtkm/worklet/colorconversion/TransferFunction.h index fa9d1deed..655fe1cd0 100644 --- a/vtkm/worklet/colorconversion/TransferFunction.h +++ b/vtkm/worklet/colorconversion/TransferFunction.h @@ -28,8 +28,7 @@ struct TransferFunction : public vtkm::worklet::WorkletMapField { } - using ControlSignature = void(FieldIn in, FieldOut color); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn in, FieldOut color); template VTKM_EXEC void operator()(const T& in, vtkm::Vec3ui_8& output) const diff --git a/vtkm/worklet/connectivities/GraphConnectivity.h b/vtkm/worklet/connectivities/GraphConnectivity.h index 9a8fdb511..e9b3f9c78 100644 --- a/vtkm/worklet/connectivities/GraphConnectivity.h +++ b/vtkm/worklet/connectivities/GraphConnectivity.h @@ -27,14 +27,8 @@ namespace detail class Graft : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn start, - FieldIn degree, - WholeArrayIn ids, - WholeArrayInOut comp); - - using ExecutionSignature = void(WorkIndex, _1, _2, _3, _4); - - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(FieldIn start, FieldIn degree, WholeArrayIn ids, WholeArrayInOut comp); + VTKM_EXEC_INVOKE_SIG(WorkIndex, _1, _2, _3, _4); // TODO: Use Scatter? template diff --git a/vtkm/worklet/connectivities/ImageConnectivity.h b/vtkm/worklet/connectivities/ImageConnectivity.h index 232e03c0f..ce9952b8c 100644 --- a/vtkm/worklet/connectivities/ImageConnectivity.h +++ b/vtkm/worklet/connectivities/ImageConnectivity.h @@ -31,13 +31,13 @@ namespace detail class ImageGraft : public vtkm::worklet::WorkletPointNeighborhood { public: - using ControlSignature = void(CellSetIn, - FieldInNeighborhood compIn, - FieldInNeighborhood color, - WholeArrayInOut compOut, - AtomicArrayInOut changed); + VTKM_CONT_INVOKE_SIG(CellSetIn, + FieldInNeighborhood compIn, + FieldInNeighborhood color, + WholeArrayInOut compOut, + AtomicArrayInOut changed); - using ExecutionSignature = void(WorkIndex, _2, _3, _4, _5); + VTKM_EXEC_INVOKE_SIG(WorkIndex, _2, _3, _4, _5); template VTKM_EXEC vtkm::Id findRoot(Comp& comp, vtkm::Id index) const diff --git a/vtkm/worklet/connectivities/UnionFind.h b/vtkm/worklet/connectivities/UnionFind.h index 9e8f5fca6..6e05b54ac 100644 --- a/vtkm/worklet/connectivities/UnionFind.h +++ b/vtkm/worklet/connectivities/UnionFind.h @@ -23,9 +23,8 @@ namespace connectivity class PointerJumping : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(WholeArrayInOut comp); - using ExecutionSignature = void(WorkIndex, _1); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(WholeArrayInOut comp); + VTKM_EXEC_INVOKE_SIG(WorkIndex, _1); template VTKM_EXEC vtkm::Id findRoot(Comp& comp, vtkm::Id index) const @@ -47,9 +46,8 @@ public: class IsStar : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(WholeArrayIn comp, AtomicArrayInOut); - using ExecutionSignature = void(WorkIndex, _1, _2); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(WholeArrayIn comp, AtomicArrayInOut); + VTKM_EXEC_INVOKE_SIG(WorkIndex, _1, _2); template VTKM_EXEC void operator()(vtkm::Id index, InOutPortalType& comp, AtomicInOut& hasStar) const diff --git a/vtkm/worklet/gradient/CellGradient.h b/vtkm/worklet/gradient/CellGradient.h index 6157d4b53..01784df1f 100644 --- a/vtkm/worklet/gradient/CellGradient.h +++ b/vtkm/worklet/gradient/CellGradient.h @@ -32,13 +32,11 @@ struct CellGradientInType : vtkm::ListTagBase template struct CellGradient : vtkm::worklet::WorkletVisitCellsWithPoints { - using ControlSignature = void(CellSetIn, - FieldInPoint pointCoordinates, - FieldInPoint inputField, - GradientOutputs outputFields); - - using ExecutionSignature = void(CellShape, PointCount, _2, _3, _4); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn, + FieldInPoint pointCoordinates, + FieldInPoint inputField, + GradientOutputs outputFields); + VTKM_EXEC_INVOKE_SIG(CellShape, PointCount, _2, _3, _4); template VTKM_EXEC void operator()(const InputType& input, OutputType& divergence) const diff --git a/vtkm/worklet/gradient/PointGradient.h b/vtkm/worklet/gradient/PointGradient.h index b05dda445..37c507680 100644 --- a/vtkm/worklet/gradient/PointGradient.h +++ b/vtkm/worklet/gradient/PointGradient.h @@ -33,14 +33,13 @@ struct PointGradientInType : vtkm::ListTagBase template struct PointGradient : public vtkm::worklet::WorkletVisitPointsWithCells { - using ControlSignature = void(CellSetIn, - WholeCellSetIn, - WholeArrayIn pointCoordinates, - WholeArrayIn inputField, - GradientOutputs outputFields); - - using ExecutionSignature = void(CellCount, CellIndices, WorkIndex, _2, _3, _4, _5); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn, + WholeCellSetIn, + WholeArrayIn pointCoordinates, + WholeArrayIn inputField, + GradientOutputs outputFields); + + VTKM_EXEC_INVOKE_SIG(CellCount, CellIndices, WorkIndex, _2, _3, _4, _5); template VTKM_EXEC void operator()(const InputType& input, OutputType& qcriterion) const diff --git a/vtkm/worklet/gradient/StructuredPointGradient.h b/vtkm/worklet/gradient/StructuredPointGradient.h index 7ad930fd6..08b59c6a7 100644 --- a/vtkm/worklet/gradient/StructuredPointGradient.h +++ b/vtkm/worklet/gradient/StructuredPointGradient.h @@ -31,14 +31,12 @@ template struct StructuredPointGradient : public vtkm::worklet::WorkletPointNeighborhood { - using ControlSignature = void(CellSetIn, - FieldInNeighborhood points, - FieldInNeighborhood, - GradientOutputs outputFields); + VTKM_CONT_INVOKE_SIG(CellSetIn, + FieldInNeighborhood points, + FieldInNeighborhood, + GradientOutputs outputFields); + VTKM_EXEC_INVOKE_SIG(Boundary, _2, _3, _4); - using ExecutionSignature = void(Boundary, _2, _3, _4); - - using InputDomain = _1; template VTKM_EXEC void operator()(const vtkm::exec::BoundaryState& boundary, diff --git a/vtkm/worklet/gradient/Transpose.h b/vtkm/worklet/gradient/Transpose.h index 251e24e42..1dd6fdfdb 100644 --- a/vtkm/worklet/gradient/Transpose.h +++ b/vtkm/worklet/gradient/Transpose.h @@ -29,10 +29,7 @@ struct TransposeType : vtkm::ListTagBase, 3>> template struct Transpose3x3 : vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldInOut field); - - using ExecutionSignature = void(_1); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldInOut field); template VTKM_EXEC void operator()(FieldInVecType& field) const diff --git a/vtkm/worklet/gradient/Vorticity.h b/vtkm/worklet/gradient/Vorticity.h index 1d6b343bc..0b7ed2d0d 100644 --- a/vtkm/worklet/gradient/Vorticity.h +++ b/vtkm/worklet/gradient/Vorticity.h @@ -28,9 +28,7 @@ struct VorticityTypes struct Vorticity : public vtkm::worklet::WorkletMapField { - using ControlSignature = void(FieldIn input, FieldOut output); - using ExecutionSignature = void(_1, _2); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldIn input, FieldOut output); template VTKM_EXEC void operator()(const InputType& input, OutputType& vorticity) const diff --git a/vtkm/worklet/histogram/ComputeNDEntropy.h b/vtkm/worklet/histogram/ComputeNDEntropy.h index a96b2ed19..9e39852a7 100644 --- a/vtkm/worklet/histogram/ComputeNDEntropy.h +++ b/vtkm/worklet/histogram/ComputeNDEntropy.h @@ -23,8 +23,7 @@ namespace histogram class SetBinInformationContent : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn freq, FieldOut informationContent); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn freq, FieldOut informationContent); vtkm::Float64 FreqSum; diff --git a/vtkm/worklet/histogram/ComputeNDHistogram.h b/vtkm/worklet/histogram/ComputeNDHistogram.h index 72c361010..4ba0504ca 100644 --- a/vtkm/worklet/histogram/ComputeNDHistogram.h +++ b/vtkm/worklet/histogram/ComputeNDHistogram.h @@ -47,9 +47,7 @@ template class SetHistogramBin : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn value, FieldIn binIndexIn, FieldOut binIndexOut); - using ExecutionSignature = void(_1, _2, _3); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldIn value, FieldIn binIndexIn, FieldOut binIndexOut); vtkm::Id numberOfBins; vtkm::Float64 minValue; diff --git a/vtkm/worklet/histogram/MarginalizeNDHistogram.h b/vtkm/worklet/histogram/MarginalizeNDHistogram.h index 437182bff..155863b18 100644 --- a/vtkm/worklet/histogram/MarginalizeNDHistogram.h +++ b/vtkm/worklet/histogram/MarginalizeNDHistogram.h @@ -36,8 +36,7 @@ public: BinaryCompare bop; vtkm::Id var; - using ControlSignature = void(FieldIn, FieldIn, FieldOut); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, FieldIn, FieldOut); VTKM_EXEC void operator()(const vtkm::Id& binIdIn, const vtkm::Id& freqIn, vtkm::Id& freqOut) const @@ -53,9 +52,7 @@ public: class To1DIndex : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn bin, FieldIn binIndexIn, FieldOut binIndexOut); - using ExecutionSignature = void(_1, _2, _3); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldIn bin, FieldIn binIndexIn, FieldOut binIndexOut); vtkm::Id numberOfBins; diff --git a/vtkm/worklet/internal/Placeholders.h b/vtkm/worklet/internal/Placeholders.h index 63b395339..598321a4d 100644 --- a/vtkm/worklet/internal/Placeholders.h +++ b/vtkm/worklet/internal/Placeholders.h @@ -116,7 +116,46 @@ struct GetExecSig typename vtkm::placeholders::DefaultExecSig::type>::type; }; +//============================================================================ +/** +* VTKM_INVOKE_SIG is a convenience macro that replaces the `Control` and +* `Execution` Signature typedefs for a VTK-m worklet. +* This assumes the worklet has no return value, and each `argument +* is passed to the worklet in the same order as listed. It is used like: +* ``` +* VTKM_INVOKE_SIG(FieldIn, FieldOut); +* ``` +*/ +#define VTKM_INVOKE_SIG(...) using ControlSignature = void(__VA_ARGS__) +//============================================================================ +/** +* VTKM_CONT_INVOKE_SIG is a convenience macro that replaces the `Control` +* Signature typedef for a VTK-m worklet. It is used like: +* ``` +* VTKM_CONT_INVOKE_SIG(FieldIn, FieldOut); +* ``` +* Instead of the user having to write: +* ``` +* using ControlSignature = void(FieldIn, FieldOut); +* ``` +* +*/ +#define VTKM_CONT_INVOKE_SIG(...) using ControlSignature = void(__VA_ARGS__) + +//============================================================================ +/** +* VTKM_EXEC_INVOKE_SIG is a convenience macro that replaces the `Execution` +* Signature typedef for a VTK-m worklet that has a `void` return type. It is used like: +* ``` +* VTKM_EXEC_INVOKE_SIG(_1, _2, WorkId); +* ``` +* Instead of the user having to write: +* ``` +* using ExecutionSignature = void(_1, _2, WorkId); +* ``` +*/ +#define VTKM_EXEC_INVOKE_SIG(...) using ExecutionSignature = void(__VA_ARGS__) } } diff --git a/vtkm/worklet/particleadvection/ParticleAdvectionWorklets.h b/vtkm/worklet/particleadvection/ParticleAdvectionWorklets.h index f689f14cf..3ea721930 100644 --- a/vtkm/worklet/particleadvection/ParticleAdvectionWorklets.h +++ b/vtkm/worklet/particleadvection/ParticleAdvectionWorklets.h @@ -34,9 +34,7 @@ namespace particleadvection class ParticleAdvectWorklet : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn idx, ExecObject integrator, ExecObject integralCurve); - using ExecutionSignature = void(_1, _2, _3); - using InputDomain = _1; + VTKM_INVOKE_SIG(FieldIn idx, ExecObject integrator, ExecObject integralCurve); template VTKM_EXEC void operator()(const vtkm::Id& idx, @@ -143,8 +141,8 @@ class Subtract : public vtkm::worklet::WorkletMapField public: VTKM_CONT Subtract() {} - using ControlSignature = void(FieldOut, FieldIn, FieldIn); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldOut, FieldIn, FieldIn); + VTKM_EXEC void operator()(vtkm::Id& res, const vtkm::Id& x, const vtkm::Id& y) const { res = x - y; diff --git a/vtkm/worklet/spatialstructure/KdTree3DConstruction.h b/vtkm/worklet/spatialstructure/KdTree3DConstruction.h index 547dfd9b3..d522acf06 100644 --- a/vtkm/worklet/spatialstructure/KdTree3DConstruction.h +++ b/vtkm/worklet/spatialstructure/KdTree3DConstruction.h @@ -39,8 +39,7 @@ public: class ComputeFlag : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn rank, FieldIn pointCountInSeg, FieldOut flag); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn rank, FieldIn pointCountInSeg, FieldOut flag); VTKM_CONT ComputeFlag() {} @@ -58,8 +57,7 @@ public: class InverseArray : public vtkm::worklet::WorkletMapField { //only for 0/1 array public: - using ControlSignature = void(FieldIn in, FieldOut out); - using ExecutionSignature = void(_1, _2); + VTKM_INVOKE_SIG(FieldIn in, FieldOut out); VTKM_CONT InverseArray() {} @@ -77,9 +75,7 @@ public: class SegmentedSplitTransform : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = - void(FieldIn B, FieldIn D, FieldIn F, FieldIn G, FieldIn H, FieldOut I); - using ExecutionSignature = void(_1, _2, _3, _4, _5, _6); + VTKM_INVOKE_SIG(FieldIn B, FieldIn D, FieldIn F, FieldIn G, FieldIn H, FieldOut I); VTKM_CONT SegmentedSplitTransform() {} @@ -102,8 +98,7 @@ public: class ScatterArray : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn in, FieldIn index, WholeArrayOut out); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn in, FieldIn index, WholeArrayOut out); VTKM_CONT ScatterArray() {} @@ -120,8 +115,7 @@ public: class NewSegmentId : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn inSegmentId, FieldIn flag, FieldOut outSegmentId); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn inSegmentId, FieldIn flag, FieldOut outSegmentId); VTKM_CONT NewSegmentId() {} @@ -139,11 +133,10 @@ public: class SaveSplitPointId : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn pointId, - FieldIn flag, - FieldIn oldSplitPointId, - FieldOut newSplitPointId); - using ExecutionSignature = void(_1, _2, _3, _4); + VTKM_INVOKE_SIG(FieldIn pointId, + FieldIn flag, + FieldIn oldSplitPointId, + FieldOut newSplitPointId); VTKM_CONT SaveSplitPointId() {} @@ -164,8 +157,7 @@ public: class FindSplitPointId : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn pointId, FieldIn rank, FieldOut splitIdInsegment); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn pointId, FieldIn rank, FieldOut splitIdInsegment); VTKM_CONT FindSplitPointId() {} @@ -183,8 +175,7 @@ public: class ArrayAdd : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn inArray0, FieldIn inArray1, FieldOut outArray); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn inArray0, FieldIn inArray1, FieldOut outArray); VTKM_CONT ArrayAdd() {} @@ -199,8 +190,7 @@ public: class SeprateVec3AryHandle : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn inVec3, FieldOut out0, FieldOut out1, FieldOut out2); - using ExecutionSignature = void(_1, _2, _3, _4); + VTKM_INVOKE_SIG(FieldIn inVec3, FieldOut out0, FieldOut out1, FieldOut out2); VTKM_CONT SeprateVec3AryHandle() {} diff --git a/vtkm/worklet/spatialstructure/KdTree3DNNSearch.h b/vtkm/worklet/spatialstructure/KdTree3DNNSearch.h index babca3723..2339c45d9 100644 --- a/vtkm/worklet/spatialstructure/KdTree3DNNSearch.h +++ b/vtkm/worklet/spatialstructure/KdTree3DNNSearch.h @@ -37,13 +37,12 @@ public: class NearestNeighborSearch3DWorklet : public vtkm::worklet::WorkletMapField { public: - using ControlSignature = void(FieldIn qcIn, - WholeArrayIn treeIdIn, - WholeArrayIn treeSplitIdIn, - WholeArrayIn treeCoordiIn, - FieldOut nnIdOut, - FieldInOut nnDisOut); - using ExecutionSignature = void(_1, _2, _3, _4, _5, _6); + VTKM_INVOKE_SIG(FieldIn qcIn, + WholeArrayIn treeIdIn, + WholeArrayIn treeSplitIdIn, + WholeArrayIn treeCoordiIn, + FieldOut nnIdOut, + FieldInOut nnDisOut); VTKM_CONT NearestNeighborSearch3DWorklet() {} diff --git a/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h b/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h index 6067aa7bf..e3e89fcef 100644 --- a/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h +++ b/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h @@ -67,11 +67,8 @@ public: class TetrahedralizeCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, - ExecObject tables, - FieldOutCell connectivityOut); - using ExecutionSignature = void(CellShape, PointIndices, _2, _3, VisitIndex); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, ExecObject tables, FieldOutCell connectivityOut); + VTKM_EXEC_INVOKE_SIG(CellShape, PointIndices, _2, _3, VisitIndex); using ScatterType = vtkm::worklet::ScatterCounting; diff --git a/vtkm/worklet/tetrahedralize/TetrahedralizeStructured.h b/vtkm/worklet/tetrahedralize/TetrahedralizeStructured.h index 8e66843df..36adb1ba8 100644 --- a/vtkm/worklet/tetrahedralize/TetrahedralizeStructured.h +++ b/vtkm/worklet/tetrahedralize/TetrahedralizeStructured.h @@ -39,9 +39,8 @@ namespace tetrahedralize class TetrahedralizeCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, FieldOutCell connectivityOut); - using ExecutionSignature = void(PointIndices, _2, ThreadIndices); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldOutCell connectivityOut); + VTKM_EXEC_INVOKE_SIG(PointIndices, _2, ThreadIndices); using ScatterType = vtkm::worklet::ScatterUniform<5>; diff --git a/vtkm/worklet/triangulate/TriangulateExplicit.h b/vtkm/worklet/triangulate/TriangulateExplicit.h index b4268a46f..2c7f6e81e 100644 --- a/vtkm/worklet/triangulate/TriangulateExplicit.h +++ b/vtkm/worklet/triangulate/TriangulateExplicit.h @@ -69,11 +69,8 @@ public: class TriangulateCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, - ExecObject tables, - FieldOutCell connectivityOut); - using ExecutionSignature = void(CellShape, PointIndices, _2, _3, VisitIndex); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, ExecObject tables, FieldOutCell connectivityOut); + VTKM_EXEC_INVOKE_SIG(CellShape, PointIndices, _2, _3, VisitIndex); using ScatterType = vtkm::worklet::ScatterCounting; diff --git a/vtkm/worklet/triangulate/TriangulateStructured.h b/vtkm/worklet/triangulate/TriangulateStructured.h index 1dd1ffed5..8bcd203de 100644 --- a/vtkm/worklet/triangulate/TriangulateStructured.h +++ b/vtkm/worklet/triangulate/TriangulateStructured.h @@ -37,9 +37,8 @@ namespace triangulate class TriangulateCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: - using ControlSignature = void(CellSetIn cellset, FieldOutCell connectivityOut); - using ExecutionSignature = void(PointIndices, _2, VisitIndex); - using InputDomain = _1; + VTKM_CONT_INVOKE_SIG(CellSetIn cellset, FieldOutCell connectivityOut); + VTKM_EXEC_INVOKE_SIG(PointIndices, _2, VisitIndex); using ScatterType = vtkm::worklet::ScatterUniform<2>; diff --git a/vtkm/worklet/zfp/ZFPDecode1.h b/vtkm/worklet/zfp/ZFPDecode1.h index 6cb69f66c..59a8a6796 100644 --- a/vtkm/worklet/zfp/ZFPDecode1.h +++ b/vtkm/worklet/zfp/ZFPDecode1.h @@ -64,9 +64,8 @@ public: { ZFPDims = PaddedDims / 4; } - using ControlSignature = void(FieldIn, WholeArrayOut, WholeArrayIn bitstream); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, WholeArrayOut, WholeArrayIn bitstream); template VTKM_EXEC void operator()(const vtkm::Id blockIdx, InputScalarPortal& scalars, diff --git a/vtkm/worklet/zfp/ZFPDecode2.h b/vtkm/worklet/zfp/ZFPDecode2.h index a0f78f5a1..2d9395ff2 100644 --- a/vtkm/worklet/zfp/ZFPDecode2.h +++ b/vtkm/worklet/zfp/ZFPDecode2.h @@ -76,9 +76,8 @@ public: ZFPDims[0] = PaddedDims[0] / 4; ZFPDims[1] = PaddedDims[1] / 4; } - using ControlSignature = void(FieldIn, WholeArrayOut, WholeArrayIn bitstream); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, WholeArrayOut, WholeArrayIn bitstream); template VTKM_EXEC void operator()(const vtkm::Id blockIdx, InputScalarPortal& scalars, diff --git a/vtkm/worklet/zfp/ZFPDecode3.h b/vtkm/worklet/zfp/ZFPDecode3.h index 62d39a541..3b149f772 100644 --- a/vtkm/worklet/zfp/ZFPDecode3.h +++ b/vtkm/worklet/zfp/ZFPDecode3.h @@ -84,9 +84,8 @@ public: ZFPDims[1] = PaddedDims[1] / 4; ZFPDims[2] = PaddedDims[2] / 4; } - using ControlSignature = void(FieldIn, WholeArrayOut, WholeArrayIn bitstream); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, WholeArrayOut, WholeArrayIn bitstream); template VTKM_EXEC void operator()(const vtkm::Id blockIdx, InputScalarPortal& scalars, diff --git a/vtkm/worklet/zfp/ZFPEncode1.h b/vtkm/worklet/zfp/ZFPEncode1.h index 89e9811eb..80c761e80 100644 --- a/vtkm/worklet/zfp/ZFPEncode1.h +++ b/vtkm/worklet/zfp/ZFPEncode1.h @@ -70,9 +70,8 @@ public: { ZFPDims = PaddedDims / 4; } - using ControlSignature = void(FieldIn, WholeArrayIn, AtomicArrayInOut bitstream); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, WholeArrayIn, AtomicArrayInOut bitstream); template VTKM_EXEC void operator()(const vtkm::Id blockIdx, const InputScalarPortal& scalars, diff --git a/vtkm/worklet/zfp/ZFPEncode2.h b/vtkm/worklet/zfp/ZFPEncode2.h index d36f67b06..a51ae4456 100644 --- a/vtkm/worklet/zfp/ZFPEncode2.h +++ b/vtkm/worklet/zfp/ZFPEncode2.h @@ -83,9 +83,8 @@ public: ZFPDims[0] = PaddedDims[0] / 4; ZFPDims[1] = PaddedDims[1] / 4; } - using ControlSignature = void(FieldIn, WholeArrayIn, AtomicArrayInOut bitstream); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, WholeArrayIn, AtomicArrayInOut bitstream); template VTKM_EXEC void operator()(const vtkm::Id blockIdx, const InputScalarPortal& scalars, diff --git a/vtkm/worklet/zfp/ZFPEncode3.h b/vtkm/worklet/zfp/ZFPEncode3.h index f2facf8eb..550e4f46e 100644 --- a/vtkm/worklet/zfp/ZFPEncode3.h +++ b/vtkm/worklet/zfp/ZFPEncode3.h @@ -102,9 +102,8 @@ public: ZFPDims[1] = PaddedDims[1] / 4; ZFPDims[2] = PaddedDims[2] / 4; } - using ControlSignature = void(FieldIn, WholeArrayIn, AtomicArrayInOut bitstream); - using ExecutionSignature = void(_1, _2, _3); + VTKM_INVOKE_SIG(FieldIn, WholeArrayIn, AtomicArrayInOut bitstream); template VTKM_EXEC void operator()(const vtkm::Id blockIdx, const InputScalarPortal& scalars, diff --git a/vtkm/worklet/zfp/ZFPTools.h b/vtkm/worklet/zfp/ZFPTools.h index c686408dd..0284b9627 100644 --- a/vtkm/worklet/zfp/ZFPTools.h +++ b/vtkm/worklet/zfp/ZFPTools.h @@ -39,9 +39,9 @@ class MemTransfer : public vtkm::worklet::WorkletMapField public: VTKM_CONT MemTransfer() {} - using ControlSignature = void(FieldIn, WholeArrayInOut); - using ExecutionSignature = void(_1, _2); + + VTKM_INVOKE_SIG(FieldIn, WholeArrayInOut); template VTKM_EXEC void operator()(const vtkm::Id id, PortalType& outValue) const { -- GitLab