mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 02:25:42 +00:00
c3f0060cc5
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 <typename T, vtkm::IdComponent Size> VTKM_EXEC void operator()(const vtkm::Vec<T, Size>& v1, const vtkm::Vec<T, Size>& 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 <typename T, vtkm::IdComponent Size> VTKM_EXEC void operator()(const vtkm::Vec<T, Size>& v1, const vtkm::Vec<T, Size>& v2, T& outValue) const { outValue = vtkm::Dot(v1, v2); } }; |
||
---|---|---|
.. | ||
1.3 | ||
1.4 | ||
0-sample-topic.md | ||
apply-policy-with-single-type.md | ||
array-get-values.md | ||
array-handle-decorator.md | ||
array-handle-multiplexer.md | ||
array-handle-soa.md | ||
BoundaryState-refactor.md | ||
cell_locator_changes.md | ||
cellsetexplicit_remove_numindices.md | ||
cellsets-dont-have-names.md | ||
dataset_sources.md | ||
dataset-no-throw-on-index-queries.md | ||
dataset-only-single-cellset.md | ||
execution-signature-optional.md | ||
field-no-cellset-name-required.md | ||
filters-no-active-cellset.md | ||
filters-removal-of-filter-cell.md | ||
fix-polygon-gradient.md | ||
invoker-used-by-filters.md | ||
invoker-vtkm-cont.md | ||
lagrangian-coherent-structures.md | ||
multiblock_renamed_partitioneddataset.md | ||
orient-normals.md | ||
particle_status_changes.md | ||
provide-cmake-helper-functions.md | ||
provide-prebuilt-filters.md | ||
refactor-topo-mapping.md | ||
remove-array-portal-shrink.md | ||
scan-extended.md | ||
simplify-create-fields.md | ||
simplify-create-result.md | ||
simplify-examples.md | ||
simplify-specifying-filter-allowed-value-types.md | ||
threshold-explicit-cells.md | ||
vec-traits-base-components.md | ||
vec-typedefs.md | ||
vtkm-vec-operator-constexpr.md | ||
write-to-array-handle-cast.md |