10 #ifndef vtk_m_exec_internal_ReduceByKeyLookup_h
11 #define vtk_m_exec_internal_ReduceByKeyLookup_h
18 #include <type_traits>
29 template <
typename IdPortalType,
typename IdComponentPortalType>
30 struct ReduceByKeyLookupBase
34 (std::is_same<typename IdComponentPortalType::ValueType, vtkm::IdComponent>::value));
36 IdPortalType SortedValuesMap;
38 IdComponentPortalType Counts;
41 ReduceByKeyLookupBase(
const IdPortalType& sortedValuesMap,
42 const IdPortalType& offsets,
43 const IdComponentPortalType& counts)
44 : SortedValuesMap(sortedValuesMap)
52 ReduceByKeyLookupBase() {}
61 template <
typename KeyPortalType,
typename IdPortalType,
typename IdComponentPortalType>
62 struct ReduceByKeyLookup : ReduceByKeyLookupBase<IdPortalType, IdComponentPortalType>
64 using KeyType =
typename KeyPortalType::ValueType;
66 KeyPortalType UniqueKeys;
69 ReduceByKeyLookup(
const KeyPortalType& uniqueKeys,
70 const IdPortalType& sortedValuesMap,
71 const IdPortalType& offsets,
72 const IdComponentPortalType& counts)
73 : ReduceByKeyLookupBase<IdPortalType, IdComponentPortalType>(sortedValuesMap, offsets, counts)
74 , UniqueKeys(uniqueKeys)
80 ReduceByKeyLookup() {}
86 #endif //vtk_m_exec_internal_ReduceByKeyLookup_h