VTK-m  2.0
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(keyLookup.Counts.Get(inIndex))
46  {
47  }
48 
49  VTKM_EXEC
50  vtkm::Id GetValueOffset() const { return this->ValueOffset; }
51 
52  VTKM_EXEC
54 
55 private:
58 };
59 }
60 }
61 } // namespace vtkm::exec::arg
62 
63 #endif //vtk_m_exec_arg_ThreadIndicesReduceByKey_h
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
ThreadIndicesBasic.h
vtkm::exec::arg::ThreadIndicesBasic
Basic container for thread indices in a worklet invocation.
Definition: ThreadIndicesBasic.h:35
vtkm::Get
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT auto Get(const vtkm::Tuple< Ts... > &tuple) -> decltype(tuple.template Get< Index >())
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:83
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::exec::arg::ThreadIndicesReduceByKey::NumberOfValues
vtkm::IdComponent NumberOfValues
Definition: ThreadIndicesReduceByKey.h:57
vtkm::exec::arg::ThreadIndicesReduceByKey
Container for thread indices in a reduce by key invocation.
Definition: ThreadIndicesReduceByKey.h:31
vtkm::exec::arg::ThreadIndicesReduceByKey::GetNumberOfValues
VTKM_EXEC vtkm::IdComponent GetNumberOfValues() const
Definition: ThreadIndicesReduceByKey.h:53
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::exec::arg::ThreadIndicesReduceByKey::ValueOffset
vtkm::Id ValueOffset
Definition: ThreadIndicesReduceByKey.h:56
vtkm::exec::arg::ThreadIndicesReduceByKey::GetValueOffset
VTKM_EXEC vtkm::Id GetValueOffset() const
Definition: ThreadIndicesReduceByKey.h:50
vtkm::exec::arg::ThreadIndicesReduceByKey::ThreadIndicesReduceByKey
VTKM_EXEC 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
ReduceByKeyLookup.h