VTK-m  2.2
ArrayRangeComputeTemplate.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_cont_ArrayRangeComputeTemplate_h
11 #define vtk_m_cont_ArrayRangeComputeTemplate_h
12 
13 #include <vtkm/cont/Algorithm.h>
18 
19 #include <vtkm/BinaryOperators.h>
20 #include <vtkm/Deprecated.h>
21 #include <vtkm/VecFlat.h>
22 #include <vtkm/VecTraits.h>
23 #include <vtkm/VectorAnalysis.h>
24 
26 
27 namespace vtkm
28 {
29 namespace cont
30 {
31 
32 namespace internal
33 {
34 
35 //-------------------------------------------------------------------------------------------------
36 struct ComputeRangeOptionsDecorator
37 {
38  bool IgnoreInf = false;
39 
40  template <typename SrcPortal, typename MaskPortal>
41  struct Functor
42  {
43  SrcPortal Src;
44  MaskPortal Mask;
45  bool IgnoreInf;
46 
47  using InValueType = typename SrcPortal::ValueType;
48  using InVecTraits = vtkm::VecTraits<InValueType>;
50 
52  ResultType operator()(vtkm::Id idx) const
53  {
54  if ((this->Mask.GetNumberOfValues() != 0) && (this->Mask.Get(idx) == 0))
55  {
56  return { { vtkm::Range{}.Min }, { vtkm::Range{}.Max } };
57  }
58 
59  const auto& inVal = this->Src.Get(idx);
60  ResultType outVal;
62  {
63  auto val = static_cast<vtkm::Float64>(InVecTraits::GetComponent(inVal, i));
64  if (vtkm::IsNan(val) || (this->IgnoreInf && !vtkm::IsFinite(val)))
65  {
66  outVal[0][i] = vtkm::Range{}.Min;
67  outVal[1][i] = vtkm::Range{}.Max;
68  }
69  else
70  {
71  outVal[0][i] = outVal[1][i] = val;
72  }
73  }
74 
75  return outVal;
76  }
77  };
78 
79  template <typename SrcPortal, typename GhostPortal>
80  Functor<SrcPortal, GhostPortal> CreateFunctor(const SrcPortal& sp, const GhostPortal& gp) const
81  {
82  return { sp, gp, this->IgnoreInf };
83  }
84 };
85 
86 template <typename ArrayHandleType>
87 struct ArrayValueIsNested
88 {
89  static constexpr bool Value =
90  !vtkm::internal::IsFlatVec<typename ArrayHandleType::ValueType>::value;
91 };
92 
93 template <typename ArrayHandleType, bool IsNested = ArrayValueIsNested<ArrayHandleType>::Value>
94 struct NestedToFlat;
95 
96 template <typename ArrayHandleType>
97 struct NestedToFlat<ArrayHandleType, true>
98 {
99  static auto Transform(const ArrayHandleType& in)
100  {
102  ArrayHandleType>(in);
103  }
104 };
105 
106 template <typename ArrayHandleType>
107 struct NestedToFlat<ArrayHandleType, false>
108 {
109  static auto Transform(const ArrayHandleType& in) { return in; }
110 };
111 
112 template <typename ArrayHandleType>
113 inline auto NestedToFlatTransform(const ArrayHandleType& input)
114 {
116 }
117 
118 //-------------------------------------------------------------------------------------------------
122 template <typename T, typename S>
123 inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeComputeGeneric(
124  const vtkm::cont::ArrayHandle<T, S>& input,
125  const vtkm::cont::ArrayHandle<vtkm::UInt8>& maskArray,
126  bool computeFiniteRange,
128 {
129  VTKM_LOG_SCOPE(vtkm::cont::LogLevel::Perf, "ArrayRangeCompute");
130 
131  using VecTraits = vtkm::VecTraits<T>;
132 
135 
136  //We want to minimize the amount of code that we do in try execute as
137  //it is repeated for each
138  if (input.GetNumberOfValues() < 1)
139  {
140  range.Fill(vtkm::Range{});
141  }
142  else
143  {
144  // if input is an array of nested vectors, transform them to `VecFlat` using ArrayHandleCast
145  auto flattened = NestedToFlatTransform(input);
146  ComputeRangeOptionsDecorator decorator{ computeFiniteRange };
147  auto decorated =
148  make_ArrayHandleDecorator(flattened.GetNumberOfValues(), decorator, flattened, maskArray);
149 
152  ResultType identity{ { vtkm::Range{}.Min }, { vtkm::Range{}.Max } };
153 
154  auto result = vtkm::cont::Algorithm::Reduce(device, decorated, identity, MinAndMaxFunctor{});
155 
156  auto portal = range.WritePortal();
157  for (vtkm::IdComponent i = 0; i < VecTraits::NUM_COMPONENTS; ++i)
158  {
159  portal.Set(i, vtkm::Range(result[0][i], result[1][i]));
160  }
161  }
162 
163  return range;
164 }
165 
166 //-------------------------------------------------------------------------------------------------
167 struct ScalarMagnitudeFunctor
168 {
169  template <typename T>
170  VTKM_EXEC_CONT vtkm::Float64 operator()(const T& val) const
171  {
172  // spcilization of `vtkm::Magnitude` for scalars should avoid `sqrt` computation by using `abs`
173  // instead
174  return static_cast<vtkm::Float64>(vtkm::Magnitude(val));
175  }
176 };
177 
178 struct MagnitudeSquareFunctor
179 {
180  template <typename T>
181  VTKM_EXEC_CONT vtkm::Float64 operator()(const T& val) const
182  {
183  using VecTraits = vtkm::VecTraits<T>;
184  vtkm::Float64 result = 0;
185  for (vtkm::IdComponent i = 0; i < VecTraits::GetNumberOfComponents(val); ++i)
186  {
187  auto comp = static_cast<vtkm::Float64>(VecTraits::GetComponent(val, i));
188  result += comp * comp;
189  }
190  return result;
191  }
192 };
193 
194 template <typename ArrayHandleType>
195 vtkm::Range ArrayRangeComputeMagnitudeGenericImpl(
197  const ArrayHandleType& input,
198  const vtkm::cont::ArrayHandle<vtkm::UInt8>& maskArray,
199  bool computeFiniteRange,
201 {
202  auto mag = vtkm::cont::make_ArrayHandleTransform(input, ScalarMagnitudeFunctor{});
203  auto rangeAH = ArrayRangeComputeGeneric(mag, maskArray, computeFiniteRange, device);
204  return rangeAH.ReadPortal().Get(0);
205 }
206 
207 template <typename ArrayHandleType>
208 vtkm::Range ArrayRangeComputeMagnitudeGenericImpl(
210  const ArrayHandleType& input,
211  const vtkm::cont::ArrayHandle<vtkm::UInt8>& maskArray,
212  bool computeFiniteRange,
214 {
215  auto magsqr = vtkm::cont::make_ArrayHandleTransform(input, MagnitudeSquareFunctor{});
216  auto rangeAH = ArrayRangeComputeGeneric(magsqr, maskArray, computeFiniteRange, device);
217  auto range = rangeAH.ReadPortal().Get(0);
218  if (range.IsNonEmpty())
219  {
220  range.Min = vtkm::Sqrt(range.Min);
221  range.Max = vtkm::Sqrt(range.Max);
222  }
223  return range;
224 }
225 
229 template <typename T, typename S>
230 inline vtkm::Range ArrayRangeComputeMagnitudeGeneric(
231  const vtkm::cont::ArrayHandle<T, S>& input,
232  const vtkm::cont::ArrayHandle<vtkm::UInt8>& maskArray,
233  bool computeFiniteRange,
235 {
236  VTKM_LOG_SCOPE(vtkm::cont::LogLevel::Perf, "ArrayRangeComputeMagnitude");
237 
238  using VecTraits = vtkm::VecTraits<T>;
239 
240  //We want to minimize the amount of code that we do in try execute as
241  //it is repeated for each
242  if (input.GetNumberOfValues() < 1)
243  {
244  return vtkm::Range{};
245  }
246 
247  auto flattened = NestedToFlatTransform(input);
248  return ArrayRangeComputeMagnitudeGenericImpl(
249  typename VecTraits::HasMultipleComponents{}, flattened, maskArray, computeFiniteRange, device);
250 }
251 
252 //-------------------------------------------------------------------------------------------------
253 template <typename S>
254 struct ArrayRangeComputeImpl
255 {
256  template <typename T>
258  const vtkm::cont::ArrayHandle<T, S>& input,
259  const vtkm::cont::ArrayHandle<vtkm::UInt8>& maskArray,
260  bool computeFiniteRange,
261  vtkm::cont::DeviceAdapterId device) const
262  {
263  return vtkm::cont::internal::ArrayRangeComputeGeneric(
264  input, maskArray, computeFiniteRange, device);
265  }
266 };
267 
268 template <typename S>
269 struct ArrayRangeComputeMagnitudeImpl
270 {
271  template <typename T>
272  vtkm::Range operator()(const vtkm::cont::ArrayHandle<T, S>& input,
273  const vtkm::cont::ArrayHandle<vtkm::UInt8>& maskArray,
274  bool computeFiniteRange,
275  vtkm::cont::DeviceAdapterId device) const
276  {
277  return vtkm::cont::internal::ArrayRangeComputeMagnitudeGeneric(
278  input, maskArray, computeFiniteRange, device);
279  }
280 };
281 
282 } // namespace internal
283 
284 //-------------------------------------------------------------------------------------------------
289 template <typename T, typename S>
291  const vtkm::cont::ArrayHandle<T, S>& input,
292  bool computeFiniteRange = false,
294 {
296  input, vtkm::cont::ArrayHandle<vtkm::UInt8>{}, computeFiniteRange, device);
297 }
298 
299 template <typename T, typename S>
301  const vtkm::cont::ArrayHandle<T, S>& input,
302  const vtkm::cont::ArrayHandle<vtkm::UInt8>& maskArray,
303  bool computeFiniteRange = false,
305 {
306  VTKM_ASSERT(maskArray.GetNumberOfValues() == 0 ||
307  maskArray.GetNumberOfValues() == input.GetNumberOfValues());
308  return internal::ArrayRangeComputeImpl<S>{}(input, maskArray, computeFiniteRange, device);
309 }
310 
311 template <typename T, typename S>
313  const vtkm::cont::ArrayHandle<T, S>& input,
315 {
316  return ArrayRangeComputeTemplate(input, false, device);
317 }
318 
320 
325 template <typename T, typename S>
327  const vtkm::cont::ArrayHandle<T, S>& input,
328  bool computeFiniteRange = false,
330 {
332  input, vtkm::cont::ArrayHandle<vtkm::UInt8>{}, computeFiniteRange, device);
333 }
334 
335 template <typename T, typename S>
337  const vtkm::cont::ArrayHandle<T, S>& input,
338  const vtkm::cont::ArrayHandle<vtkm::UInt8>& maskArray,
339  bool computeFiniteRange = false,
341 {
342  VTKM_ASSERT(maskArray.GetNumberOfValues() == 0 ||
343  maskArray.GetNumberOfValues() == input.GetNumberOfValues());
344  return internal::ArrayRangeComputeMagnitudeImpl<S>{}(
345  input, maskArray, computeFiniteRange, device);
346 }
347 
348 template <typename T, typename S>
351 {
352  return ArrayRangeComputeMagnitudeTemplate(input, false, device);
353 }
355 
356 //-----------------------------------------------------------------------------
357 template <typename ArrayHandleType>
358 VTKM_DEPRECATED(2.1, "Use precompiled ArrayRangeCompute or ArrayRangeComputeTemplate.")
360  const ArrayHandleType& input,
361  vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny{})
362 {
363  return ArrayRangeComputeTemplate(input, false, device);
364 }
365 
366 }
367 } // namespace vtkm::cont
368 
369 #define VTK_M_ARRAY_RANGE_COMPUTE_DCLR(...) \
370  vtkm::cont::ArrayHandle<vtkm::Range> vtkm::cont::ArrayRangeComputeTemplate( \
371  const vtkm::cont::ArrayHandle<__VA_ARGS__>&, \
372  const vtkm::cont::ArrayHandle<vtkm::UInt8>&, \
373  bool, \
374  vtkm::cont::DeviceAdapterId)
375 
376 #define VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(...) \
377  vtkm::Range vtkm::cont::ArrayRangeComputeMagnitudeTemplate( \
378  const vtkm::cont::ArrayHandle<__VA_ARGS__>&, \
379  const vtkm::cont::ArrayHandle<vtkm::UInt8>&, \
380  bool, \
381  vtkm::cont::DeviceAdapterId)
382 
383 #define VTK_M_ARRAY_RANGE_COMPUTE_INT_SCALARS(modifiers, ...) \
384  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Int8, __VA_ARGS__); \
385  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Int8, __VA_ARGS__); \
386  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::UInt8, __VA_ARGS__); \
387  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::UInt8, __VA_ARGS__); \
388  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Int16, __VA_ARGS__); \
389  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Int16, __VA_ARGS__); \
390  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::UInt16, __VA_ARGS__); \
391  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::UInt16, __VA_ARGS__); \
392  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Int32, __VA_ARGS__); \
393  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Int32, __VA_ARGS__); \
394  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::UInt32, __VA_ARGS__); \
395  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::UInt32, __VA_ARGS__); \
396  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Int64, __VA_ARGS__); \
397  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Int64, __VA_ARGS__); \
398  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::UInt64, __VA_ARGS__); \
399  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::UInt64, __VA_ARGS__)
400 
401 #define VTK_M_ARRAY_RANGE_COMPUTE_FLOAT_SCALARS(modifiers, ...) \
402  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Float32, __VA_ARGS__); \
403  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Float32, __VA_ARGS__); \
404  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Float64, __VA_ARGS__); \
405  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Float64, __VA_ARGS__)
406 
407 #define VTK_M_ARRAY_RANGE_COMPUTE_BOOL_SCALARS(modifiers, ...) \
408  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(bool, __VA_ARGS__); \
409  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(bool, __VA_ARGS__)
410 
411 #define VTK_M_ARRAY_RANGE_COMPUTE_OTHER_SCALARS(modifiers, ...) \
412  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(char, __VA_ARGS__); \
413  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(char, __VA_ARGS__); \
414  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(signed VTKM_UNUSED_INT_TYPE, __VA_ARGS__); \
415  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(signed VTKM_UNUSED_INT_TYPE, __VA_ARGS__); \
416  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(unsigned VTKM_UNUSED_INT_TYPE, __VA_ARGS__); \
417  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(unsigned VTKM_UNUSED_INT_TYPE, __VA_ARGS__)
418 
419 #define VTK_M_ARRAY_RANGE_COMPUTE_ALL_SCALARS(modifiers, ...) \
420  VTK_M_ARRAY_RANGE_COMPUTE_INT_SCALARS(modifiers, __VA_ARGS__); \
421  VTK_M_ARRAY_RANGE_COMPUTE_FLOAT_SCALARS(modifiers, __VA_ARGS__); \
422  VTK_M_ARRAY_RANGE_COMPUTE_BOOL_SCALARS(modifiers, __VA_ARGS__); \
423  VTK_M_ARRAY_RANGE_COMPUTE_OTHER_SCALARS(modifiers, __VA_ARGS__)
424 
425 #define VTK_M_ARRAY_RANGE_COMPUTE_INT_VECN(modifiers, N, ...) \
426  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::Int8, N>, __VA_ARGS__); \
427  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::Int8, N>, __VA_ARGS__); \
428  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::UInt8, N>, __VA_ARGS__); \
429  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::UInt8, N>, __VA_ARGS__); \
430  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::Int16, N>, __VA_ARGS__); \
431  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::Int16, N>, __VA_ARGS__); \
432  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::UInt16, N>, __VA_ARGS__); \
433  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::UInt16, N>, __VA_ARGS__); \
434  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::Int32, N>, __VA_ARGS__); \
435  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::Int32, N>, __VA_ARGS__); \
436  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::UInt32, N>, __VA_ARGS__); \
437  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::UInt32, N>, __VA_ARGS__); \
438  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::Int64, N>, __VA_ARGS__); \
439  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::Int64, N>, __VA_ARGS__); \
440  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::UInt64, N>, __VA_ARGS__); \
441  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::UInt64, N>, __VA_ARGS__)
442 
443 #define VTK_M_ARRAY_RANGE_COMPUTE_FLOAT_VECN(modifiers, N, ...) \
444  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::Float32, N>, __VA_ARGS__); \
445  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::Float32, N>, __VA_ARGS__); \
446  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<vtkm::Float64, N>, __VA_ARGS__); \
447  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<vtkm::Float64, N>, __VA_ARGS__)
448 
449 #define VTK_M_ARRAY_RANGE_COMPUTE_BOOL_VECN(modifiers, N, ...) \
450  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<bool, N>, __VA_ARGS__); \
451  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<bool, N>, __VA_ARGS__)
452 
453 #define VTK_M_ARRAY_RANGE_COMPUTE_OTHER_VECN(modifiers, N, ...) \
454  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<char, N>, __VA_ARGS__); \
455  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<char, N>, __VA_ARGS__); \
456  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<signed VTKM_UNUSED_INT_TYPE, N>, \
457  __VA_ARGS__); \
458  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<signed VTKM_UNUSED_INT_TYPE, N>, \
459  __VA_ARGS__); \
460  modifiers VTK_M_ARRAY_RANGE_COMPUTE_DCLR(vtkm::Vec<unsigned VTKM_UNUSED_INT_TYPE, N>, \
461  __VA_ARGS__); \
462  modifiers VTK_M_ARRAY_RANGE_COMPUTE_MAG_DCLR(vtkm::Vec<unsigned VTKM_UNUSED_INT_TYPE, N>, \
463  __VA_ARGS__)
464 
465 #define VTK_M_ARRAY_RANGE_COMPUTE_ALL_VECN(modifiers, N, ...) \
466  VTK_M_ARRAY_RANGE_COMPUTE_INT_VECN(modifiers, N, __VA_ARGS__); \
467  VTK_M_ARRAY_RANGE_COMPUTE_FLOAT_VECN(modifiers, N, __VA_ARGS__); \
468  VTK_M_ARRAY_RANGE_COMPUTE_BOOL_VECN(modifiers, N, __VA_ARGS__); \
469  VTK_M_ARRAY_RANGE_COMPUTE_OTHER_VECN(modifiers, N, __VA_ARGS__)
470 
471 namespace vtkm
472 {
473 namespace cont
474 {
475 
476 struct StorageTagSOA;
477 
478 template <typename ST1, typename ST2, typename ST3>
479 struct StorageTagCartesianProduct;
480 
481 struct StorageTagConstant;
482 
483 struct StorageTagCounting;
484 
485 struct StorageTagXGCCoordinates;
486 
487 struct StorageTagStride;
488 
489 }
490 } // vtkm::cont
491 
492 //-------------------------------------------------------------------------------------------------
498 
501  2,
504 
507  3,
510 
513  4,
516 
517 //-------------------------------------------------------------------------------------------------
520  2,
523 
526  3,
529 
532  4,
535 
536 //-------------------------------------------------------------------------------------------------
539  extern template VTKM_CONT_TEMPLATE_EXPORT,
540  3,
545 
546 //-------------------------------------------------------------------------------------------------
549  3,
550  StorageTagXGCCoordinates);
552 
553 //-------------------------------------------------------------------------------------------------
558 
561  2,
564 
567  3,
570 
573  4,
576 
577 //-------------------------------------------------------------------------------------------------
586 
589  2,
592  2,
595  2,
598 
601  3,
604  3,
607  3,
610 
613  4,
616  4,
619  4,
622 
623 //-------------------------------------------------------------------------------------------------
629 
630 #endif //vtk_m_cont_ArrayRangeComputeTemplate_h
VTK_M_ARRAY_RANGE_COMPUTE_FLOAT_SCALARS
#define VTK_M_ARRAY_RANGE_COMPUTE_FLOAT_SCALARS(modifiers,...)
Definition: ArrayRangeComputeTemplate.h:401
VecFlat.h
VTKM_LOG_SCOPE
#define VTKM_LOG_SCOPE(level,...)
Definition: Logging.h:211
vtkm::cont::ArrayHandle< vtkm::Range >
vtkm::VecTraitsTagMultipleComponents
A tag for vectors that are "true" vectors (i.e.
Definition: VecTraits.h:23
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Sqrt
vtkm::Float32 Sqrt(vtkm::Float32 x)
Definition: Math.h:943
ArrayHandleCast.h
VTKM_ASSERT
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
vtkm::MinAndMax
Binary Predicate that takes two arguments argument x, and y and returns a vtkm::Vec<T,...
Definition: BinaryOperators.h:112
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::cont::StorageTagStride
Definition: ArrayHandleStride.h:149
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::Transform
auto Transform(const TupleType &&tuple, Function &&f) -> decltype(Apply(tuple, detail::TupleTransformFunctor(), std::forward< Function >(f)))
Construct a new vtkm::Tuple by applying a function to each value.
Definition: Tuple.h:213
Instantiations.h
vtkm::cont::StorageTagSOA
Definition: ArrayHandleSOA.h:123
vtkm::cont::ArrayHandle::Fill
void Fill(const ValueType &fillValue, vtkm::Id startIndex, vtkm::Id endIndex, vtkm::cont::Token &token) const
Fills the array with a given value.
Definition: ArrayHandle.h:554
vtkm::VecTraits::NUM_COMPONENTS
static constexpr vtkm::IdComponent NUM_COMPONENTS
Number of components in the vector.
Definition: VecTraits.h:85
ArrayHandleTransform.h
vtkm::cont::ArrayHandle::GetNumberOfValues
vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:468
vtkm::cont::StorageTagCartesianProduct
Definition: ArrayHandleCartesianProduct.h:161
vtkm::cont::Algorithm::Reduce
static U Reduce(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Definition: Algorithm.h:657
VTK_M_ARRAY_RANGE_COMPUTE_FLOAT_VECN
#define VTK_M_ARRAY_RANGE_COMPUTE_FLOAT_VECN(modifiers, N,...)
Definition: ArrayRangeComputeTemplate.h:443
ArrayHandleDecorator.h
VTK_M_ARRAY_RANGE_COMPUTE_ALL_SCALARS
#define VTK_M_ARRAY_RANGE_COMPUTE_ALL_SCALARS(modifiers,...)
Definition: ArrayRangeComputeTemplate.h:419
vtkm::cont::StorageTagConstant
Definition: ArrayHandleConstant.h:27
VectorAnalysis.h
VTK_M_ARRAY_RANGE_COMPUTE_OTHER_SCALARS
#define VTK_M_ARRAY_RANGE_COMPUTE_OTHER_SCALARS(modifiers,...)
Definition: ArrayRangeComputeTemplate.h:411
vtkm::cont::StorageTagCounting
Definition: ArrayHandleCounting.h:27
vtkm::VecTraits::GetNumberOfComponents
static constexpr vtkm::IdComponent GetNumberOfComponents(const T &)
Returns the number of components in the given vector.
Definition: VecTraits.h:94
Algorithm.h
vtkm::cont::ArrayRangeComputeMagnitudeTemplate
vtkm::Range ArrayRangeComputeMagnitudeTemplate(const vtkm::cont::ArrayHandle< T, S > &input, bool computeFiniteRange=false, vtkm::cont::DeviceAdapterId device=vtkm::cont::DeviceAdapterTagAny{})
Templated version of ArrayRangeComputeMagnitude.
Definition: ArrayRangeComputeTemplate.h:326
VTKM_INSTANTIATION_END
#define VTKM_INSTANTIATION_END
Definition: Instantiations.h:48
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::cont::DeviceAdapterTagAny
Tag for a device adapter used to specify that any device may be used for an operation.
Definition: DeviceAdapterTag.h:180
BinaryOperators.h
vtkm::cont::ArrayRangeComputeTemplate
vtkm::cont::ArrayHandle< vtkm::Range > ArrayRangeComputeTemplate(const vtkm::cont::ArrayHandle< T, S > &input, bool computeFiniteRange=false, vtkm::cont::DeviceAdapterId device=vtkm::cont::DeviceAdapterTagAny{})
Templated version of ArrayRangeCompute.
Definition: ArrayRangeComputeTemplate.h:290
vtkm::cont::ArrayHandle::ReadPortal
ReadPortalType ReadPortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:433
VTK_M_ARRAY_RANGE_COMPUTE_INT_SCALARS
#define VTK_M_ARRAY_RANGE_COMPUTE_INT_SCALARS(modifiers,...)
Definition: ArrayRangeComputeTemplate.h:383
vtkm::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
vtkm::VecTraitsTagSingleComponent
A tag for vectors that are really just scalars (i.e.
Definition: VecTraits.h:30
VTKM_CONT_TEMPLATE_EXPORT
#define VTKM_CONT_TEMPLATE_EXPORT
Definition: vtkm_cont_export.h:62
vtkm::Vec
A short fixed-length array.
Definition: Types.h:357
vtkm::Magnitude
detail::FloatingPointReturnType< T >::Type Magnitude(const T &x)
Returns the magnitude of a vector.
Definition: VectorAnalysis.h:100
vtkm::VecTraits::GetComponent
static const ComponentType & GetComponent(const T &vector, vtkm::IdComponent)
Returns the value in a given component of the vector.
Definition: VecTraits.h:117
vtkm::VecTraits::HasMultipleComponents
vtkm::VecTraitsTagSingleComponent HasMultipleComponents
A tag specifying whether this vector has multiple components (i.e.
Definition: VecTraits.h:105
vtkm::cont::ArrayHandleCast
Cast the values of an array to the specified type, on demand.
Definition: ArrayHandleCast.h:141
vtkm::Range::Min
vtkm::Float64 Min
The minumum value of the range (inclusive).
Definition: Range.h:34
VTK_M_ARRAY_RANGE_COMPUTE_ALL_VECN
#define VTK_M_ARRAY_RANGE_COMPUTE_ALL_VECN(modifiers, N,...)
Definition: ArrayRangeComputeTemplate.h:465
Deprecated.h
vtkm::cont::ArrayRangeCompute
vtkm::cont::ArrayHandle< vtkm::Range > ArrayRangeCompute(const vtkm::cont::UnknownArrayHandle &array, bool computeFiniteRange=false, vtkm::cont::DeviceAdapterId device=vtkm::cont::DeviceAdapterTagAny{})
Compute the range of the data in an array handle.
vtkm::cont::StorageTagBasic
A tag for the basic implementation of a Storage object.
Definition: ArrayHandle.h:45
vtkm::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
VTK_M_ARRAY_RANGE_COMPUTE_OTHER_VECN
#define VTK_M_ARRAY_RANGE_COMPUTE_OTHER_VECN(modifiers, N,...)
Definition: ArrayRangeComputeTemplate.h:453
VTK_M_ARRAY_RANGE_COMPUTE_INT_VECN
#define VTK_M_ARRAY_RANGE_COMPUTE_INT_VECN(modifiers, N,...)
Definition: ArrayRangeComputeTemplate.h:425
vtkm::cont::ArrayHandle::Allocate
void Allocate(vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:490
vtkm::Range::Max
vtkm::Float64 Max
Tha maximum value of the range (inclusive).
Definition: Range.h:36
vtkm::VecTraits
Traits that can be queried to treat any type as a Vec.
Definition: VecTraits.h:61
ArrayRangeComputeUtils.h
vtkm::cont::ArrayHandle::WritePortal
WritePortalType WritePortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:454
vtkm::cont::make_ArrayHandleTransform
vtkm::cont::ArrayHandleTransform< HandleType, FunctorType > make_ArrayHandleTransform(HandleType handle, FunctorType functor)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandleTransform.h:480
VTKM_DEPRECATED
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
VTKM_INSTANTIATION_BEGIN
#define VTKM_INSTANTIATION_BEGIN
The following empty macros are instantiation delimiters used by vtk_add_instantiations at CMake/VTKmW...
Definition: Instantiations.h:47
VecTraits.h
vtkm::cont::LogLevel::Perf
@ Perf
General timing data and algorithm flow information, such as filter execution, worklet dispatches,...
vtkm::cont::make_ArrayHandleDecorator
ArrayHandleDecorator< typename std::decay< DecoratorImplT >::type, typename std::decay< ArrayTs >::type... > make_ArrayHandleDecorator(vtkm::Id numValues, DecoratorImplT &&f, ArrayTs &&... arrays)
Create an ArrayHandleDecorator with the specified number of values that uses the provided DecoratorIm...
Definition: ArrayHandleDecorator.h:694
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31