VTK-m  2.0
VisitIndex.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_exec_arg_VisitIndex_h
11 #define vtk_m_exec_arg_VisitIndex_h
12 
14 #include <vtkm/exec/arg/Fetch.h>
15 
16 namespace vtkm
17 {
18 namespace exec
19 {
20 namespace arg
21 {
22 
30 {
31 };
32 
44 {
45  // The index does not really matter because the fetch is going to ignore it.
46  // However, it still has to point to a valid parameter in the
47  // ControlSignature because the templating is going to grab a fetch tag
48  // whether we use it or not. 1 should be guaranteed to be valid since you
49  // need at least one argument for the input domain.
50  static constexpr vtkm::IdComponent INDEX = 1;
52 };
53 
54 template <typename FetchTag, typename ExecObjectType>
55 struct Fetch<FetchTag, vtkm::exec::arg::AspectTagVisitIndex, ExecObjectType>
56 {
58 
59  template <typename ThreadIndicesType>
60  VTKM_EXEC vtkm::IdComponent Load(const ThreadIndicesType& indices, const ExecObjectType&) const
61  {
62  return indices.GetVisitIndex();
63  }
64 
65  template <typename ThreadIndicesType>
66  VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const
67  {
68  // Store is a no-op.
69  }
70 };
71 }
72 }
73 } // namespace vtkm::exec::arg
74 
75 #endif //vtk_m_exec_arg_VisitIndex_h
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm::exec::arg::Fetch< FetchTag, vtkm::exec::arg::AspectTagVisitIndex, ExecObjectType >::Store
VTKM_EXEC void Store(const ThreadIndicesType &, const ExecObjectType &, const ValueType &) const
Definition: VisitIndex.h:66
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::exec::arg::AspectTagVisitIndex
Aspect tag to use for getting the work index.
Definition: VisitIndex.h:29
vtkm::exec::arg::ExecutionSignatureTagBase
The base class for all tags used in an ExecutionSignature.
Definition: ExecutionSignatureTagBase.h:37
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::exec::arg::VisitIndex::INDEX
static constexpr vtkm::IdComponent INDEX
Definition: VisitIndex.h:50
vtkm::exec::arg::Fetch< FetchTag, vtkm::exec::arg::AspectTagVisitIndex, ExecObjectType >::ValueType
vtkm::IdComponent ValueType
Definition: VisitIndex.h:57
vtkm::exec::arg::Fetch
Class for loading and storing values in thread instance.
Definition: Fetch.h:49
ExecutionSignatureTagBase.h
Fetch.h
vtkm::exec::arg::Fetch< FetchTag, vtkm::exec::arg::AspectTagVisitIndex, ExecObjectType >::Load
VTKM_EXEC vtkm::IdComponent Load(const ThreadIndicesType &indices, const ExecObjectType &) const
Definition: VisitIndex.h:60
vtkm::exec::arg::VisitIndex
The ExecutionSignature tag to use to get the visit index.
Definition: VisitIndex.h:43