Viskores  1.0
WorkletBase.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_worklet_internal_WorkletBase_h
19 #define viskores_worklet_internal_WorkletBase_h
20 
22 
34 
50 
52 
56 
57 namespace viskores
58 {
59 namespace worklet
60 {
61 namespace internal
62 {
63 
68 class VISKORES_ALWAYS_EXPORT WorkletBase : public viskores::exec::FunctorBase
69 {
70 public:
71  using _1 = viskores::placeholders::Arg<1>;
72  using _2 = viskores::placeholders::Arg<2>;
73  using _3 = viskores::placeholders::Arg<3>;
74  using _4 = viskores::placeholders::Arg<4>;
75  using _5 = viskores::placeholders::Arg<5>;
76  using _6 = viskores::placeholders::Arg<6>;
77  using _7 = viskores::placeholders::Arg<7>;
78  using _8 = viskores::placeholders::Arg<8>;
79  using _9 = viskores::placeholders::Arg<9>;
80  using _10 = viskores::placeholders::Arg<10>;
81  using _11 = viskores::placeholders::Arg<11>;
82  using _12 = viskores::placeholders::Arg<12>;
83  using _13 = viskores::placeholders::Arg<13>;
84  using _14 = viskores::placeholders::Arg<14>;
85  using _15 = viskores::placeholders::Arg<15>;
86  using _16 = viskores::placeholders::Arg<16>;
87  using _17 = viskores::placeholders::Arg<17>;
88  using _18 = viskores::placeholders::Arg<18>;
89  using _19 = viskores::placeholders::Arg<19>;
90  using _20 = viskores::placeholders::Arg<20>;
91 
93  using WorkIndex = viskores::exec::arg::WorkIndex;
94 
96  using InputIndex = viskores::exec::arg::InputIndex;
97 
99  using OutputIndex = viskores::exec::arg::OutputIndex;
100 
102  using ThreadIndices = viskores::exec::arg::ThreadIndices;
103 
105  using VisitIndex = viskores::exec::arg::VisitIndex;
106 
113  {
114  // INDEX 0 (which is an invalid parameter index) is reserved to mean the device adapter tag.
115  static constexpr viskores::IdComponent INDEX = 0;
116  using AspectTag = viskores::exec::arg::AspectTagDefault;
117  };
118 
129  {
130  using TypeCheckTag = viskores::cont::arg::TypeCheckTagExecObject;
131  using TransportTag = viskores::cont::arg::TransportTagExecObject;
133  };
134 
137  using InputDomain = _1;
138 
142  using ScatterType = viskores::worklet::ScatterIdentity;
143 
147  using MaskType = viskores::worklet::MaskNone;
148 
152  using Hints = viskores::cont::internal::HintList<>;
153 
161  {
162  using TypeCheckTag = viskores::cont::arg::TypeCheckTagArrayIn;
165  };
166 
174  struct WholeArrayOut : viskores::cont::arg::ControlSignatureTagBase
175  {
176  using TypeCheckTag = viskores::cont::arg::TypeCheckTagArrayOut;
179  };
180 
189  struct WholeArrayInOut : viskores::cont::arg::ControlSignatureTagBase
190  {
191  using TypeCheckTag = viskores::cont::arg::TypeCheckTagArrayInOut;
194  };
195 
204  struct AtomicArrayInOut : viskores::cont::arg::ControlSignatureTagBase
205  {
206  using TypeCheckTag = viskores::cont::arg::TypeCheckTagAtomicArray;
209  };
210 
222  {
223  using TypeCheckTag = viskores::cont::arg::TypeCheckTagBitField;
224  using TransportTag = viskores::cont::arg::TransportTagBitFieldIn;
226  };
228  {
229  using TypeCheckTag = viskores::cont::arg::TypeCheckTagBitField;
232  };
233  struct BitFieldInOut : viskores::cont::arg::ControlSignatureTagBase
234  {
235  using TypeCheckTag = viskores::cont::arg::TypeCheckTagBitField;
238  };
240 
241  using Point = viskores::TopologyElementTagPoint;
245 
252  template <typename VisitTopology = Cell, typename IncidentTopology = Point>
253  struct WholeCellSetIn : viskores::cont::arg::ControlSignatureTagBase
254  {
255  using TypeCheckTag = viskores::cont::arg::TypeCheckTagCellSet;
256  using TransportTag =
259  };
260 
267  template <typename OutToInArrayType,
268  typename VisitArrayType,
269  typename ThreadToOutArrayType,
270  typename InputDomainType>
272  const viskores::Id& threadIndex,
273  const OutToInArrayType& outToIn,
274  const VisitArrayType& visit,
275  const ThreadToOutArrayType& threadToOut,
276  const InputDomainType&) const
277  {
278  viskores::Id outIndex = threadToOut.Get(threadIndex);
280  threadIndex, outToIn.Get(outIndex), visit.Get(outIndex), outIndex);
281  }
282 
289  template <typename OutToInArrayType,
290  typename VisitArrayType,
291  typename ThreadToOutArrayType,
292  typename InputDomainType>
294  viskores::Id threadIndex1D,
295  const viskores::Id3& threadIndex3D,
296  const OutToInArrayType& outToIn,
297  const VisitArrayType& visit,
298  const ThreadToOutArrayType& threadToOut,
299  const InputDomainType&) const
300  {
301  viskores::Id outIndex = threadToOut.Get(threadIndex1D);
303  threadIndex3D, threadIndex1D, outToIn.Get(outIndex), visit.Get(outIndex), outIndex);
304  }
305 };
306 }
307 }
308 } // namespace viskores::worklet::internal
309 
310 #endif //viskores_worklet_internal_WorkletBase_h
viskores::cont::arg::TypeCheckTagArrayIn
The Array type check passes for any object that behaves like an ArrayHandle class and can be passed t...
Definition: TypeCheckTagArrayIn.h:39
ThreadIndices.h
viskores::exec::FunctorBase
Base class for all user worklets invoked in the execution environment from a call to viskores::cont::...
Definition: FunctorBase.h:38
TransportTagWholeArrayOut.h
viskores::TopologyElementTagCell
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:32
viskores::exec::arg::ThreadIndices
The ExecutionSignature tag to use to get the thread indices.
Definition: ThreadIndices.h:52
ThreadIndicesBasic.h
TransportTagCellSetIn.h
TypeCheckTagArrayOut.h
viskores::cont::arg::TransportTagWholeArrayOut
Transport tag for in-place arrays with random access.
Definition: TransportTagWholeArrayOut.h:45
ControlSignatureTagBase.h
VisitIndex.h
Placeholders.h
viskores::cont::arg::TransportTagCellSetIn
Transport tag for input arrays.
Definition: TransportTagCellSetIn.h:40
viskores::cont::arg::TypeCheckTagArrayInOut
The Array type check passes for any object that behaves like an ArrayHandle class and can be passed t...
Definition: TypeCheckTagArrayInOut.h:39
VISKORES_SUPPRESS_EXEC_WARNINGS
#define VISKORES_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:61
viskores::exec::arg::FetchTagExecObject
Fetch tag for execution objects.
Definition: FetchTagExecObject.h:40
viskores::cont::arg::TypeCheckTagCellSet
Check for a CellSet-like object.
Definition: TypeCheckTagCellSet.h:34
viskores::cont::arg::TypeCheckTagExecObject
The ExecObject type check passes for any object that inherits from ExecutionObjectBase.
Definition: TypeCheckTagExecObject.h:40
viskores::IdComponent
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
viskores::TopologyElementTagEdge
A tag used to identify the edge elements in a topology.
Definition: TopologyElementTag.h:52
viskores::cont::arg::TypeCheckTagBitField
Definition: TypeCheckTagBitField.h:34
Hints.h
TransportTagExecObject.h
viskores::cont::arg::TransportTagBitFieldIn
Definition: TransportTagBitField.h:32
viskores::exec::arg::ThreadIndicesBasic
Basic container for thread indices in a worklet invocation.
Definition: ThreadIndicesBasic.h:43
viskores::TopologyElementTagPoint
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:42
viskores::cont::arg::ControlSignatureTagBase
The base class for all tags used in a ControlSignature.
Definition: ControlSignatureTagBase.h:44
TypeCheckTagArrayInOut.h
FetchTagExecObject.h
viskores::exec::arg::VisitIndex
The ExecutionSignature tag to use to get the visit index.
Definition: VisitIndex.h:54
InputIndex.h
TransportTagBitField.h
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::exec::arg::OutputIndex
The ExecutionSignature tag to use to get the output index.
Definition: OutputIndex.h:52
TypeCheckTagAtomicArray.h
viskores::cont::arg::TransportTagAtomicArray
Transport tag for in-place arrays with atomic operations.
Definition: TransportTagAtomicArray.h:44
viskores::cont::arg::TransportTagExecObject
Transport tag for execution objects.
Definition: TransportTagExecObject.h:40
FunctorBase.h
TypeCheckTagArrayIn.h
MaskNone.h
viskores::worklet::MaskNone
Default mask object that does not suppress anything.
Definition: MaskNone.h:35
ScatterIdentity.h
viskores::worklet::ScatterIdentity
A scatter that maps input directly to output.
Definition: ScatterIdentity.h:38
ThreadIndicesBasic3D.h
TypeCheckTagExecObject.h
TransportTagWholeArrayIn.h
viskores::exec::arg::AspectTagDefault
Aspect tag to use for default load/store of data.
Definition: AspectTagDefault.h:30
viskores::cont::arg::TypeCheckTagArrayOut
The Array type check passes for any object that behaves like an ArrayHandle class and can be passed t...
Definition: TypeCheckTagArrayOut.h:39
viskores::TopologyElementTagFace
A tag used to identify the face elements in a topology.
Definition: TopologyElementTag.h:62
viskores::exec::arg::ThreadIndicesBasic3D
Container for 3D thread indices in a worklet invocation.
Definition: ThreadIndicesBasic3D.h:39
TransportTagWholeArrayInOut.h
TransportTagAtomicArray.h
WorkIndex.h
viskores::exec::arg::ExecutionSignatureTagBase
The base class for all tags used in an ExecutionSignature.
Definition: ExecutionSignatureTagBase.h:45
BasicArg.h
viskores::cont::arg::TransportTagWholeArrayIn
Transport tag for in-place arrays with random access.
Definition: TransportTagWholeArrayIn.h:43
TypeCheckTagBitField.h
viskores::cont::arg::TransportTagBitFieldOut
Definition: TransportTagBitField.h:35
viskores::exec::arg::FetchTagWholeCellSetIn
Fetch tag for whole cell sets.
Definition: FetchTagWholeCellSetIn.h:36
viskores::cont::arg::TransportTagWholeArrayInOut
Transport tag for in-place arrays with random access.
Definition: TransportTagWholeArrayInOut.h:45
OutputIndex.h
FetchTagWholeCellSetIn.h
TypeCheckTagCellSet.h
viskores::Vec< viskores::Id, 3 >
VISKORES_EXEC
#define VISKORES_EXEC
Definition: ExportMacros.h:59
viskores::cont::arg::TransportTagBitFieldInOut
Definition: TransportTagBitField.h:38
viskores::exec::arg::InputIndex
The ExecutionSignature tag to use to get the input index.
Definition: InputIndex.h:51
TopologyElementTag.h
viskores::exec::arg::WorkIndex
The ExecutionSignature tag to use to get the work index.
Definition: WorkIndex.h:47