VTK-m  2.2
ThreadIndicesReduceByKey.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_ThreadIndicesReduceByKey_h
11 #define vtk_m_exec_arg_ThreadIndicesReduceByKey_h
12 
14 
16 
17 namespace vtkm
18 {
19 namespace exec
20 {
21 namespace arg
22 {
23 
32 {
34 
35 public:
36  template <typename P1, typename P2>
38  vtkm::Id threadIndex,
39  vtkm::Id inIndex,
40  vtkm::IdComponent visitIndex,
41  vtkm::Id outIndex,
42  const vtkm::exec::internal::ReduceByKeyLookupBase<P1, P2>& keyLookup)
43  : Superclass(threadIndex, inIndex, visitIndex, outIndex)
44  , ValueOffset(keyLookup.Offsets.Get(inIndex))
45  , NumberOfValues(static_cast<vtkm::IdComponent>(keyLookup.Offsets.Get(inIndex + 1) -
46  keyLookup.Offsets.Get(inIndex)))
47  {
48  }
49 
50  VTKM_EXEC
51  vtkm::Id GetValueOffset() const { return this->ValueOffset; }
52 
53  VTKM_EXEC
55 
56 private:
59 };
60 }
61 }
62 } // namespace vtkm::exec::arg
63 
64 #endif //vtk_m_exec_arg_ThreadIndicesReduceByKey_h
vtkm::exec::arg::ThreadIndicesReduceByKey::ThreadIndicesReduceByKey
ThreadIndicesReduceByKey(vtkm::Id threadIndex, vtkm::Id inIndex, vtkm::IdComponent visitIndex, vtkm::Id outIndex, const vtkm::exec::internal::ReduceByKeyLookupBase< P1, P2 > &keyLookup)
Definition: ThreadIndicesReduceByKey.h:37
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Get
auto Get(const vtkm::Tuple< Ts... > &tuple)
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:81
ThreadIndicesBasic.h
vtkm::exec::arg::ThreadIndicesBasic
Basic container for thread indices in a worklet invocation.
Definition: ThreadIndicesBasic.h:35
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::exec::arg::ThreadIndicesReduceByKey::NumberOfValues
vtkm::IdComponent NumberOfValues
Definition: ThreadIndicesReduceByKey.h:58
vtkm::exec::arg::ThreadIndicesReduceByKey
Container for thread indices in a reduce by key invocation.
Definition: ThreadIndicesReduceByKey.h:31
vtkm::exec::arg::ThreadIndicesReduceByKey::GetValueOffset
vtkm::Id GetValueOffset() const
Definition: ThreadIndicesReduceByKey.h:51
vtkm::exec::arg::ThreadIndicesReduceByKey::ValueOffset
vtkm::Id ValueOffset
Definition: ThreadIndicesReduceByKey.h:57
vtkm::exec::arg::ThreadIndicesReduceByKey::GetNumberOfValues
vtkm::IdComponent GetNumberOfValues() const
Definition: ThreadIndicesReduceByKey.h:54
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
ReduceByKeyLookup.h