Go to the documentation of this file.
18 #ifndef viskores_worklet_ScatterCounting_h
19 #define viskores_worklet_ScatterCounting_h
36 struct ScatterCountingBuilder;
73 bool saveInputToOutputMap =
false)
75 this->BuildArrays(countArray, device, saveInputToOutputMap);
78 bool saveInputToOutputMap)
85 template <
typename RangeType>
88 return this->OutputToInputMap;
92 template <
typename RangeType>
95 return this->VisitArray;
101 if (inputRange != this->InputRange)
103 std::stringstream msg;
104 msg <<
"ScatterCounting initialized with input domain of size " << this->InputRange
105 <<
" but used with a worklet invoke of size " << inputRange << std::endl;
108 return this->VisitArray.GetNumberOfValues();
113 return this->GetOutputRange(inputRange[0] * inputRange[1] * inputRange[2]);
125 return this->InputToOutputMap;
134 friend struct detail::ScatterCountingBuilder;
138 bool saveInputToOutputMap);
143 #endif //viskores_worklet_ScatterCounting_h
int16_t Int16
Base type to use for 16-bit signed integer numbers.
Definition: Types.h:181
int8_t Int8
Base type to use for 8-bit signed integer numbers.
Definition: Types.h:173
VisitArrayType VisitArray
Definition: ScatterCounting.h:132
uint16_t UInt16
Base type to use for 16-bit unsigned integer numbers.
Definition: Types.h:185
Tag for a device adapter used to specify that any device may be used for an operation.
Definition: DeviceAdapterTag.h:194
A template used to hold a list of types.
Definition: List.h:47
signed long long Int64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:212
viskores::Id GetOutputRange(viskores::Id inputRange) const
Definition: ScatterCounting.h:99
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
#define VISKORES_CONT
Definition: ExportMacros.h:65
VisitArrayType GetVisitArray(RangeType) const
Definition: ScatterCounting.h:93
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::ArrayHandle< viskores::Id > InputToOutputMap
Definition: ScatterCounting.h:130
ScatterCounting(const viskores::cont::UnknownArrayHandle &countArray, viskores::cont::DeviceAdapterId device=viskores::cont::DeviceAdapterTagAny(), bool saveInputToOutputMap=false)
Construct a ScatterCounting object using an array of counts for the number of outputs for each input.
Definition: ScatterCounting.h:70
OutputToInputMapType OutputToInputMap
Definition: ScatterCounting.h:131
viskores::Id GetOutputRange(viskores::Id3 inputRange) const
Definition: ScatterCounting.h:111
unsigned long long UInt64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:215
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:177
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
int32_t Int32
Base type to use for 32-bit signed integer numbers.
Definition: Types.h:189
ScatterCounting(const viskores::cont::UnknownArrayHandle &countArray, bool saveInputToOutputMap)
Definition: ScatterCounting.h:77
This class is thrown when a Viskores function or method encounters an invalid value that inhibits pro...
Definition: ErrorBadValue.h:33
viskores::cont::ArrayHandle< viskores::Id > GetInputToOutputMap() const
This array will not be valid unless explicitly instructed to be saved.
Definition: ScatterCounting.h:123
A scatter that maps input to some numbers of output.
Definition: ScatterCounting.h:52
OutputToInputMapType GetOutputToInputMap(RangeType) const
Definition: ScatterCounting.h:86
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:451
viskores::Id InputRange
Definition: ScatterCounting.h:129
uint32_t UInt32
Base type to use for 32-bit unsigned integer numbers.
Definition: Types.h:193
OutputToInputMapType GetOutputToInputMap() const
Definition: ScatterCounting.h:117