Viskores  1.0
ThreadIndicesReduceByKey.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_ThreadIndicesReduceByKey_h
19 #define viskores_exec_arg_ThreadIndicesReduceByKey_h
20 
22 
24 
25 namespace viskores
26 {
27 namespace exec
28 {
29 namespace arg
30 {
31 
40 {
42 
43 public:
44  template <typename P1, typename P2>
46  viskores::Id threadIndex,
47  viskores::Id inIndex,
48  viskores::IdComponent visitIndex,
49  viskores::Id outIndex,
50  const viskores::exec::internal::ReduceByKeyLookupBase<P1, P2>& keyLookup)
51  : Superclass(threadIndex, inIndex, visitIndex, outIndex)
52  , ValueOffset(keyLookup.Offsets.Get(inIndex))
53  , NumberOfValues(static_cast<viskores::IdComponent>(keyLookup.Offsets.Get(inIndex + 1) -
54  keyLookup.Offsets.Get(inIndex)))
55  {
56  }
57 
59  viskores::Id GetValueOffset() const { return this->ValueOffset; }
60 
63 
64 private:
67 };
68 }
69 }
70 } // namespace viskores::exec::arg
71 
72 #endif //viskores_exec_arg_ThreadIndicesReduceByKey_h
viskores::exec::arg::ThreadIndicesReduceByKey::NumberOfValues
viskores::IdComponent NumberOfValues
Definition: ThreadIndicesReduceByKey.h:66
ThreadIndicesBasic.h
viskores::exec::arg::ThreadIndicesReduceByKey::ValueOffset
viskores::Id ValueOffset
Definition: ThreadIndicesReduceByKey.h:65
viskores::IdComponent
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
viskores::exec::arg::ThreadIndicesBasic
Basic container for thread indices in a worklet invocation.
Definition: ThreadIndicesBasic.h:43
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::ThreadIndicesReduceByKey::ThreadIndicesReduceByKey
ThreadIndicesReduceByKey(viskores::Id threadIndex, viskores::Id inIndex, viskores::IdComponent visitIndex, viskores::Id outIndex, const viskores::exec::internal::ReduceByKeyLookupBase< P1, P2 > &keyLookup)
Definition: ThreadIndicesReduceByKey.h:45
viskores::exec::arg::ThreadIndicesReduceByKey::GetNumberOfValues
viskores::IdComponent GetNumberOfValues() const
Definition: ThreadIndicesReduceByKey.h:62
viskores::Get
auto Get(const viskores::Tuple< Ts... > &tuple)
Retrieve the object from a viskores::Tuple at the given index.
Definition: Tuple.h:89
viskores::exec::arg::ThreadIndicesReduceByKey::GetValueOffset
viskores::Id GetValueOffset() const
Definition: ThreadIndicesReduceByKey.h:59
VISKORES_EXEC
#define VISKORES_EXEC
Definition: ExportMacros.h:59
ReduceByKeyLookup.h
viskores::exec::arg::ThreadIndicesReduceByKey
Container for thread indices in a reduce by key invocation.
Definition: ThreadIndicesReduceByKey.h:39