VTK-m  2.0
FetchTagKeysIn.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_FetchTagKeysIn_h
11 #define vtk_m_exec_arg_FetchTagKeysIn_h
12 
14 #include <vtkm/exec/arg/Fetch.h>
16 
18 
19 namespace vtkm
20 {
21 namespace exec
22 {
23 namespace arg
24 {
25 
32 {
33 };
34 
35 template <typename KeyPortalType, typename IdPortalType, typename IdComponentPortalType>
36 struct Fetch<
39  vtkm::exec::internal::ReduceByKeyLookup<KeyPortalType, IdPortalType, IdComponentPortalType>>
40 {
41  using ExecObjectType =
42  vtkm::exec::internal::ReduceByKeyLookup<KeyPortalType, IdPortalType, IdComponentPortalType>;
43 
44  using ValueType = typename ExecObjectType::KeyType;
45 
47  template <typename ThreadIndicesType>
48  VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, const ExecObjectType& keys) const
49  {
50  return keys.UniqueKeys.Get(indices.GetInputIndex());
51  }
52 
53  template <typename ThreadIndicesType>
54  VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const
55  {
56  // Store is a no-op for this fetch.
57  }
58 };
59 }
60 }
61 } // namespace vtkm::exec::arg
62 
63 #endif //vtk_m_exec_arg_FetchTagKeysIn_h
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::FetchTagKeysIn
Fetch tag for getting key values in a reduce by key.
Definition: FetchTagKeysIn.h:31
vtkm::exec::arg::Fetch::Load
VTKM_EXEC ValueType Load(const ThreadIndicesType &indices, const ExecObjectType &execObject) const
Load data for a work instance.
vtkm::exec::arg::Fetch::ValueType
typename ExecObjectType::ValueType ValueType
The type of value to load and store.
Definition: Fetch.h:58
vtkm::exec::arg::Fetch
Class for loading and storing values in thread instance.
Definition: Fetch.h:49
Fetch.h
AspectTagDefault.h
ThreadIndicesReduceByKey.h
vtkm::exec::arg::Fetch::Store
VTKM_EXEC void Store(const ThreadIndicesType &indices, const ExecObjectType &execObject, const ValueType &value) const
Store data from a work instance.
vtkm::exec::arg::AspectTagDefault
Aspect tag to use for default load/store of data.
Definition: AspectTagDefault.h:22
VTKM_SUPPRESS_EXEC_WARNINGS
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53
ReduceByKeyLookup.h