VTK-m  2.2
OutputIndex.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_OutputIndex_h
11 #define vtk_m_exec_arg_OutputIndex_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 
45 {
46  // The index does not really matter because the fetch is going to ignore it.
47  // However, it still has to point to a valid parameter in the
48  // ControlSignature because the templating is going to grab a fetch tag
49  // whether we use it or not. 1 should be guaranteed to be valid since you
50  // need at least one argument for the output domain.
51  static constexpr vtkm::IdComponent INDEX = 1;
53 };
54 
55 template <typename FetchTag, typename ExecObjectType>
56 struct Fetch<FetchTag, vtkm::exec::arg::AspectTagOutputIndex, ExecObjectType>
57 {
59 
60  template <typename ThreadIndicesType>
61  VTKM_EXEC vtkm::Id Load(const ThreadIndicesType& indices, const ExecObjectType&) const
62  {
63  return indices.GetOutputIndex();
64  }
65 
66  template <typename ThreadIndicesType>
67  VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const
68  {
69  // Store is a no-op.
70  }
71 };
72 }
73 }
74 } // namespace vtkm::exec::arg
75 
76 #endif //vtk_m_exec_arg_OutputIndex_h
vtkm::exec::arg::Fetch< FetchTag, vtkm::exec::arg::AspectTagOutputIndex, ExecObjectType >::ValueType
vtkm::Id ValueType
Definition: OutputIndex.h:58
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::exec::arg::Fetch< FetchTag, vtkm::exec::arg::AspectTagOutputIndex, ExecObjectType >::Load
vtkm::Id Load(const ThreadIndicesType &indices, const ExecObjectType &) const
Definition: OutputIndex.h:61
vtkm::exec::arg::ExecutionSignatureTagBase
The base class for all tags used in an ExecutionSignature.
Definition: ExecutionSignatureTagBase.h:37
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::exec::arg::OutputIndex
The ExecutionSignature tag to use to get the output index.
Definition: OutputIndex.h:44
vtkm::exec::arg::Fetch
Class for loading and storing values in thread instance.
Definition: Fetch.h:49
vtkm::exec::arg::Fetch< FetchTag, vtkm::exec::arg::AspectTagOutputIndex, ExecObjectType >::Store
void Store(const ThreadIndicesType &, const ExecObjectType &, const ValueType &) const
Definition: OutputIndex.h:67
ExecutionSignatureTagBase.h
vtkm::exec::arg::OutputIndex::INDEX
static constexpr vtkm::IdComponent INDEX
Definition: OutputIndex.h:51
Fetch.h
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::exec::arg::AspectTagOutputIndex
Aspect tag to use for getting the work index.
Definition: OutputIndex.h:29