Viskores  1.0
FetchTagKeysIn.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_exec_arg_FetchTagKeysIn_h
19 #define viskores_exec_arg_FetchTagKeysIn_h
20 
24 
26 
27 namespace viskores
28 {
29 namespace exec
30 {
31 namespace arg
32 {
33 
40 {
41 };
42 
43 template <typename KeyPortalType, typename IdPortalType, typename IdComponentPortalType>
44 struct Fetch<
47  viskores::exec::internal::ReduceByKeyLookup<KeyPortalType, IdPortalType, IdComponentPortalType>>
48 {
49  using ExecObjectType =
50  viskores::exec::internal::ReduceByKeyLookup<KeyPortalType, IdPortalType, IdComponentPortalType>;
51 
52  using ValueType = typename ExecObjectType::KeyType;
53 
55  template <typename ThreadIndicesType>
56  VISKORES_EXEC ValueType Load(const ThreadIndicesType& indices, const ExecObjectType& keys) const
57  {
58  return keys.UniqueKeys.Get(indices.GetInputIndex());
59  }
60 
61  template <typename ThreadIndicesType>
62  VISKORES_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const
63  {
64  // Store is a no-op for this fetch.
65  }
66 };
67 }
68 }
69 } // namespace viskores::exec::arg
70 
71 #endif //viskores_exec_arg_FetchTagKeysIn_h
VISKORES_SUPPRESS_EXEC_WARNINGS
#define VISKORES_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:61
viskores::exec::arg::FetchTagKeysIn
Fetch tag for getting key values in a reduce by key.
Definition: FetchTagKeysIn.h:39
viskores::exec::arg::Fetch::ValueType
typename ExecObjectType::ValueType ValueType
The type of value to load and store.
Definition: Fetch.h:66
viskores::exec::arg::Fetch
Class for loading and storing values in thread instance.
Definition: Fetch.h:57
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::exec::arg::Fetch::Store
void Store(const ThreadIndicesType &indices, const ExecObjectType &execObject, const ValueType &value) const
Store data from a work instance.
Fetch.h
AspectTagDefault.h
viskores::exec::arg::AspectTagDefault
Aspect tag to use for default load/store of data.
Definition: AspectTagDefault.h:30
ThreadIndicesReduceByKey.h
viskores::exec::arg::Fetch::Load
ValueType Load(const ThreadIndicesType &indices, const ExecObjectType &execObject) const
Load data for a work instance.
VISKORES_EXEC
#define VISKORES_EXEC
Definition: ExportMacros.h:59
ReduceByKeyLookup.h