VTK-m  2.2
Types.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_Types_h
11 #define vtk_m_Types_h
12 
15 
16 #include <vtkm/Assert.h>
17 #include <vtkm/StaticAssert.h>
18 
19 #include <cstdint>
20 #include <iostream>
21 #include <type_traits>
22 
149 namespace vtkm
150 {
151 //*****************************************************************************
152 // Typedefs for basic types.
153 //*****************************************************************************
154 
157 using Float32 = float;
158 
161 using Float64 = double;
162 
165 using Int8 = int8_t;
166 
169 using UInt8 = uint8_t;
170 
173 using Int16 = int16_t;
174 
177 using UInt16 = uint16_t;
178 
181 using Int32 = int32_t;
182 
185 using UInt32 = uint32_t;
186 
195 
199 
200 //In this order so that we exactly match the logic that exists in VTK
201 #if (VTKM_SIZE_LONG_LONG == 8) || defined(VTKM_DOXYGEN_ONLY)
202 using Int64 = signed long long;
207 using UInt64 = unsigned long long;
208 #define VTKM_UNUSED_INT_TYPE long
209 #elif VTKM_SIZE_LONG == 8
210 using Int64 = signed long;
215 using UInt64 = unsigned long;
216 #define VTKM_UNUSED_INT_TYPE long long
217 #else
218 #error Could not find a 64-bit integer.
219 #endif
220 
226 #ifdef VTKM_USE_64BIT_IDS
227 using Id = vtkm::Int64;
228 #else
229 using Id = vtkm::Int32;
230 #endif
231 
233 #ifdef VTKM_USE_DOUBLE_PRECISION
235 #else
237 #endif
238 
239 
240 namespace internal
241 {
242 
244 struct NullType
245 {
246 };
247 
248 } // namespace internal
249 
250 // Disable conversion warnings for Add, Subtract, Multiply, Divide on GCC only.
251 // GCC creates false positive warnings for signed/unsigned char* operations.
252 // This occurs because the values are implicitly casted up to int's for the
253 // operation, and than casted back down to char's when return.
254 // This causes a false positive warning, even when the values is within
255 // the value types range
256 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
257 #pragma GCC diagnostic push
258 #pragma GCC diagnostic ignored "-Wconversion"
259 #endif // gcc || clang
260 struct Add
261 {
262  template <typename T, typename U>
263  inline VTKM_EXEC_CONT auto operator()(const T& a, const U& b) const -> decltype(a + b)
264  {
265  return a + b;
266  }
267 
268  // If both arguments are short integers, explicitly cast the result back to the
269  // type to avoid narrowing conversion warnings from operations that promote to
270  // integers.
271  template <typename T>
272  inline VTKM_EXEC_CONT
273  typename std::enable_if<std::is_integral<T>::value && sizeof(T) < sizeof(int), T>::type
274  operator()(T a, T b) const
275  {
276  return static_cast<T>(a + b);
277  }
278 };
279 
280 struct Subtract
281 {
282  template <typename T, typename U>
283  inline VTKM_EXEC_CONT auto operator()(const T& a, const U& b) const -> decltype(a - b)
284  {
285  return a - b;
286  }
287 
288  // If both arguments are short integers, explicitly cast the result back to the
289  // type to avoid narrowing conversion warnings from operations that promote to
290  // integers.
291  template <typename T>
292  inline VTKM_EXEC_CONT
293  typename std::enable_if<std::is_integral<T>::value && sizeof(T) < sizeof(int), T>::type
294  operator()(T a, T b) const
295  {
296  return static_cast<T>(a - b);
297  }
298 };
299 
300 struct Multiply
301 {
302  template <typename T, typename U>
303  inline VTKM_EXEC_CONT auto operator()(const T& a, const U& b) const -> decltype(a * b)
304  {
305  return a * b;
306  }
307 
308  // If both arguments are short integers, explicitly cast the result back to the
309  // type to avoid narrowing conversion warnings from operations that promote to
310  // integers.
311  template <typename T>
312  inline VTKM_EXEC_CONT
313  typename std::enable_if<std::is_integral<T>::value && sizeof(T) < sizeof(int), T>::type
314  operator()(T a, T b) const
315  {
316  return static_cast<T>(a * b);
317  }
318 };
319 
320 struct Divide
321 {
322  template <typename T, typename U>
323  inline VTKM_EXEC_CONT auto operator()(const T& a, const U& b) const -> decltype(a / b)
324  {
325  return a / b;
326  }
327 
328  // If both arguments are short integers, explicitly cast the result back to the
329  // type to avoid narrowing conversion warnings from operations that promote to
330  // integers.
331  template <typename T>
332  inline VTKM_EXEC_CONT
333  typename std::enable_if<std::is_integral<T>::value && sizeof(T) < sizeof(int), T>::type
334  operator()(T a, T b) const
335  {
336  return static_cast<T>(a / b);
337  }
338 };
339 
340 struct Negate
341 {
342  template <typename T>
343  inline VTKM_EXEC_CONT T operator()(const T& x) const
344  {
345  return T(-x);
346  }
347 };
348 
349 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
350 #pragma GCC diagnostic pop
351 #endif // gcc || clang
352 
353 //-----------------------------------------------------------------------------
354 
355 // Pre declaration
356 template <typename T, vtkm::IdComponent Size>
358 
359 template <typename T>
361 
362 template <typename T>
364 
365 namespace detail
366 {
367 
370 // Disable conversion warnings for Add, Subtract, Multiply, Divide on GCC only.
371 // GCC creates false positive warnings for signed/unsigned char* operations.
372 // This occurs because the values are implicitly casted up to int's for the
373 // operation, and than casted back down to char's when return.
374 // This causes a false positive warning, even when the values is within
375 // the value types range
376 //
377 // NVCC 7.5 and below does not recognize this pragma inside of class bodies,
378 // so put them before entering the class.
379 //
380 #if (defined(VTKM_CUDA) && (__CUDACC_VER_MAJOR__ < 8))
381 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
382 #pragma GCC diagnostic push
383 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
384 #pragma GCC diagnostic ignored "-Wpragmas"
385 #pragma GCC diagnostic ignored "-Wconversion"
386 #pragma GCC diagnostic ignored "-Wfloat-conversion"
387 #endif // gcc || clang
388 #endif // use cuda < 8
389 template <typename T, typename DerivedClass>
390 class VTKM_ALWAYS_EXPORT VecBaseCommon
391 {
392 public:
393  using ComponentType = T;
394 
395 protected:
396  constexpr VecBaseCommon() = default;
397 
399  constexpr const DerivedClass& Derived() const { return *static_cast<const DerivedClass*>(this); }
400 
402  constexpr DerivedClass& Derived() { return *static_cast<DerivedClass*>(this); }
403 
404 private:
405  // Only for internal use
407  constexpr vtkm::IdComponent NumComponents() const
408  {
409  return this->Derived().GetNumberOfComponents();
410  }
411 
412  // Only for internal use
414  constexpr const T& Component(vtkm::IdComponent index) const { return this->Derived()[index]; }
415 
416  // Only for internal use
418  constexpr T& Component(vtkm::IdComponent index) { return this->Derived()[index]; }
419 
420 public:
421  template <vtkm::IdComponent OtherSize>
422  VTKM_EXEC_CONT void CopyInto(vtkm::Vec<ComponentType, OtherSize>& dest) const
423  {
424  for (vtkm::IdComponent index = 0; (index < this->NumComponents()) && (index < OtherSize);
425  index++)
426  {
427  dest[index] = this->Component(index);
428  }
429  }
430 
431  // Only works with Vec-like objects with operator[] and GetNumberOfComponents().
432  template <typename OtherVecType>
433  VTKM_EXEC_CONT DerivedClass& operator=(const OtherVecType& src)
434  {
435  VTKM_ASSERT(this->NumComponents() == src.GetNumberOfComponents());
436  for (vtkm::IdComponent i = 0; i < this->NumComponents(); ++i)
437  {
438  this->Component(i) = src[i];
439  }
440  return this->Derived();
441  }
442 
444  bool operator==(const DerivedClass& other) const
445  {
446  bool equal = true;
447  for (vtkm::IdComponent i = 0; i < this->NumComponents() && equal; ++i)
448  {
449  equal = (this->Component(i) == other[i]);
450  }
451  return equal;
452  }
453 
455  bool operator<(const DerivedClass& other) const
456  {
457  for (vtkm::IdComponent i = 0; i < this->NumComponents(); ++i)
458  {
459  // ignore equals as that represents check next value
460  if (this->Component(i) < other[i])
461  {
462  return true;
463  }
464  else if (other[i] < this->Component(i))
465  {
466  return false;
467  }
468  } // if all same we are not less
469 
470  return false;
471  }
472 
474  bool operator!=(const DerivedClass& other) const { return !(this->operator==(other)); }
475 
476 #if (!(defined(VTKM_CUDA) && (__CUDACC_VER_MAJOR__ < 8)))
477 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
478 #pragma GCC diagnostic push
479 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
480 #pragma GCC diagnostic ignored "-Wpragmas"
481 #pragma GCC diagnostic ignored "-Wconversion"
482 #pragma GCC diagnostic ignored "-Wfloat-conversion"
483 #endif // gcc || clang
484 #endif // not using cuda < 8
485 
486  template <vtkm::IdComponent Size>
488  const vtkm::Vec<ComponentType, Size>& other) const
489  {
490  VTKM_ASSERT(Size == this->NumComponents());
492  for (vtkm::IdComponent i = 0; i < Size; ++i)
493  {
494  result[i] = this->Component(i) + other[i];
495  }
496  return result;
497  }
498 
499  template <typename OtherClass>
500  inline VTKM_EXEC_CONT DerivedClass& operator+=(const OtherClass& other)
501  {
502  VTKM_ASSERT(this->NumComponents() == other.GetNumberOfComponents());
503  for (vtkm::IdComponent i = 0; i < this->NumComponents(); ++i)
504  {
505  this->Component(i) += other[i];
506  }
507  return this->Derived();
508  }
509 
510  template <vtkm::IdComponent Size>
512  const vtkm::Vec<ComponentType, Size>& other) const
513  {
514  VTKM_ASSERT(Size == this->NumComponents());
516  for (vtkm::IdComponent i = 0; i < Size; ++i)
517  {
518  result[i] = this->Component(i) - other[i];
519  }
520  return result;
521  }
522 
523  template <typename OtherClass>
524  inline VTKM_EXEC_CONT DerivedClass& operator-=(const OtherClass& other)
525  {
526  VTKM_ASSERT(this->NumComponents() == other.GetNumberOfComponents());
527  for (vtkm::IdComponent i = 0; i < this->NumComponents(); ++i)
528  {
529  this->Component(i) -= other[i];
530  }
531  return this->Derived();
532  }
533 
534  template <vtkm::IdComponent Size>
536  const vtkm::Vec<ComponentType, Size>& other) const
537  {
539  for (vtkm::IdComponent i = 0; i < Size; ++i)
540  {
541  result[i] = this->Component(i) * other[i];
542  }
543  return result;
544  }
545 
546  template <typename OtherClass>
547  inline VTKM_EXEC_CONT DerivedClass& operator*=(const OtherClass& other)
548  {
549  VTKM_ASSERT(this->NumComponents() == other.GetNumberOfComponents());
550  for (vtkm::IdComponent i = 0; i < this->NumComponents(); ++i)
551  {
552  this->Component(i) *= other[i];
553  }
554  return this->Derived();
555  }
556 
557  template <vtkm::IdComponent Size>
559  const vtkm::Vec<ComponentType, Size>& other) const
560  {
562  for (vtkm::IdComponent i = 0; i < Size; ++i)
563  {
564  result[i] = this->Component(i) / other[i];
565  }
566  return result;
567  }
568 
569  template <typename OtherClass>
570  VTKM_EXEC_CONT DerivedClass& operator/=(const OtherClass& other)
571  {
572  VTKM_ASSERT(this->NumComponents() == other.GetNumberOfComponents());
573  for (vtkm::IdComponent i = 0; i < this->NumComponents(); ++i)
574  {
575  this->Component(i) /= other[i];
576  }
577  return this->Derived();
578  }
579 
580 #if (!(defined(VTKM_CUDA) && (__CUDACC_VER_MAJOR__ < 8)))
581 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
582 #pragma GCC diagnostic pop
583 #endif // gcc || clang
584 #endif // not using cuda < 8
585 
587  constexpr ComponentType* GetPointer() { return &this->Component(0); }
588 
590  constexpr const ComponentType* GetPointer() const { return &this->Component(0); }
591 };
592 
593 
596 template <typename T, vtkm::IdComponent Size, typename DerivedClass>
597 class VTKM_ALWAYS_EXPORT VecBase : public vtkm::detail::VecBaseCommon<T, DerivedClass>
598 {
599 public:
600  using ComponentType = T;
601  static constexpr vtkm::IdComponent NUM_COMPONENTS = Size;
602 
603  VecBase() = default;
604 
605  // The enable_if predicate will disable this constructor for Size=1 so that
606  // the variadic constructor constexpr VecBase(T, Ts&&...) is called instead.
608  template <vtkm::IdComponent Size2 = Size, typename std::enable_if<Size2 != 1, int>::type = 0>
609  VTKM_EXEC_CONT explicit VecBase(const ComponentType& value)
610  {
611  for (vtkm::IdComponent i = 0; i < Size; ++i)
612  {
613  this->Components[i] = value;
614  }
615  }
616 
618  template <typename... Ts>
619  VTKM_EXEC_CONT constexpr VecBase(ComponentType value0, Ts&&... values)
620  : Components{ value0, values... }
621  {
622  VTKM_STATIC_ASSERT(sizeof...(Ts) + 1 == Size);
623  }
624 
627  VecBase(std::initializer_list<ComponentType> values)
628  {
629  ComponentType* dest = this->Components;
630  auto src = values.begin();
631  if (values.size() == 1)
632  {
633  for (vtkm::IdComponent i = 0; i < Size; ++i)
634  {
635  this->Components[i] = *src;
636  ++dest;
637  }
638  }
639  else
640  {
641  VTKM_ASSERT((values.size() == NUM_COMPONENTS) &&
642  "Vec object initialized wrong number of components.");
643  for (; src != values.end(); ++src)
644  {
645  *dest = *src;
646  ++dest;
647  }
648  }
649  }
650 
651 #if (!(defined(VTKM_CUDA) && (__CUDACC_VER_MAJOR__ < 8)))
652 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
653 #pragma GCC diagnostic push
654 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
655 #pragma GCC diagnostic ignored "-Wpragmas"
656 #pragma GCC diagnostic ignored "-Wconversion"
657 #pragma GCC diagnostic ignored "-Wfloat-conversion"
658 #endif // gcc || clang
659 #endif //not using cuda < 8
660 #if defined(VTKM_MSVC)
661 #pragma warning(push)
662 #pragma warning(disable : 4244)
663 #endif
664 
666  template <typename OtherValueType, typename OtherDerivedType>
667  VTKM_EXEC_CONT explicit VecBase(const VecBase<OtherValueType, Size, OtherDerivedType>& src)
668  {
669  //DO NOT CHANGE THIS AND THE ABOVE PRAGMA'S UNLESS YOU FULLY UNDERSTAND THE
670  //ISSUE https://gitlab.kitware.com/vtk/vtk-m/-/issues/221
671  for (vtkm::IdComponent i = 0; i < Size; ++i)
672  {
673  this->Components[i] = src[i];
674  }
675  }
676 
677 public:
678  inline VTKM_EXEC_CONT constexpr vtkm::IdComponent GetNumberOfComponents() const
679  {
680  return NUM_COMPONENTS;
681  }
682 
683  inline VTKM_EXEC_CONT constexpr const ComponentType& operator[](vtkm::IdComponent idx) const
684  {
685  return this->Components[idx];
686  }
687 
688  inline VTKM_EXEC_CONT constexpr ComponentType& operator[](vtkm::IdComponent idx)
689  {
690  VTKM_ASSERT(idx >= 0);
691  VTKM_ASSERT(idx < NUM_COMPONENTS);
692  return this->Components[idx];
693  }
694 
696  template <typename OtherComponentType, typename OtherClass>
697  inline VTKM_EXEC_CONT DerivedClass
698  operator+(const VecBaseCommon<OtherComponentType, OtherClass>& other) const
699  {
700  const OtherClass& other_derived = static_cast<const OtherClass&>(other);
701  VTKM_ASSERT(NUM_COMPONENTS == other_derived.GetNumberOfComponents());
702 
703  DerivedClass result;
704  for (vtkm::IdComponent i = 0; i < NUM_COMPONENTS; ++i)
705  {
706  result[i] = this->Components[i] + static_cast<ComponentType>(other_derived[i]);
707  }
708  return result;
709  }
710 
712  template <typename OtherComponentType, typename OtherClass>
713  inline VTKM_EXEC_CONT DerivedClass
714  operator-(const VecBaseCommon<OtherComponentType, OtherClass>& other) const
715  {
716  const OtherClass& other_derived = static_cast<const OtherClass&>(other);
717  VTKM_ASSERT(NUM_COMPONENTS == other_derived.GetNumberOfComponents());
718 
719  DerivedClass result;
720  for (vtkm::IdComponent i = 0; i < NUM_COMPONENTS; ++i)
721  {
722  result[i] = this->Components[i] - static_cast<ComponentType>(other_derived[i]);
723  }
724  return result;
725  }
726 
728  template <typename OtherComponentType, typename OtherClass>
729  inline VTKM_EXEC_CONT DerivedClass
730  operator*(const VecBaseCommon<OtherComponentType, OtherClass>& other) const
731  {
732  const OtherClass& other_derived = static_cast<const OtherClass&>(other);
733  VTKM_ASSERT(NUM_COMPONENTS == other_derived.GetNumberOfComponents());
734 
735  DerivedClass result;
736  for (vtkm::IdComponent i = 0; i < NUM_COMPONENTS; ++i)
737  {
738  result[i] = this->Components[i] * static_cast<ComponentType>(other_derived[i]);
739  }
740  return result;
741  }
742 
744  template <typename OtherComponentType, typename OtherClass>
745  inline VTKM_EXEC_CONT DerivedClass
746  operator/(const VecBaseCommon<OtherComponentType, OtherClass>& other) const
747  {
748  const OtherClass& other_derived = static_cast<const OtherClass&>(other);
749  VTKM_ASSERT(NUM_COMPONENTS == other_derived.GetNumberOfComponents());
750 
751  DerivedClass result;
752  for (vtkm::IdComponent i = 0; i < NUM_COMPONENTS; ++i)
753  {
754  result[i] = this->Components[i] / static_cast<ComponentType>(other_derived[i]);
755  }
756  return result;
757  }
758 
759 #if (!(defined(VTKM_CUDA) && (__CUDACC_VER_MAJOR__ < 8)))
760 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
761 #pragma GCC diagnostic pop
762 #endif // gcc || clang
763 #endif // not using cuda < 8
764 #if defined(VTKM_MSVC)
765 #pragma warning(pop)
766 #endif
767 
768 protected:
769  ComponentType Components[NUM_COMPONENTS];
770 };
771 
772 #if (defined(VTKM_CUDA) && (__CUDACC_VER_MAJOR__ < 8))
773 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
774 #pragma GCC diagnostic pop
775 #endif // gcc || clang
776 #endif // use cuda < 8
777 
780 template <typename T, typename DerivedClass>
781 class VTKM_ALWAYS_EXPORT VecCBase : public vtkm::detail::VecBaseCommon<T, DerivedClass>
782 {
783 protected:
785  constexpr VecCBase() {}
786 };
787 
788 } // namespace detail
789 
790 //-----------------------------------------------------------------------------
791 
807 template <typename T, vtkm::IdComponent Size>
808 class VTKM_ALWAYS_EXPORT Vec : public detail::VecBase<T, Size, Vec<T, Size>>
809 {
810  using Superclass = detail::VecBase<T, Size, Vec<T, Size>>;
811 
812 public:
813 #ifdef VTKM_DOXYGEN_ONLY
814  using ComponentType = T;
815  static constexpr vtkm::IdComponent NUM_COMPONENTS = Size;
816 #endif
817 
818  using Superclass::Superclass;
819  constexpr Vec() = default;
820 #if defined(_MSC_VER) && _MSC_VER < 1910
821  template <typename... Ts>
822  constexpr Vec(T value, Ts&&... values)
823  : Superclass(value, std::forward<Ts>(values)...)
824  {
825  }
826 #endif
827 
828  inline VTKM_EXEC_CONT void CopyInto(Vec<T, Size>& dest) const { dest = *this; }
829 };
830 
831 //-----------------------------------------------------------------------------
832 // Specializations for common small tuples. We implement them a bit specially.
833 
834 // A vector of size 0 cannot use VecBase because it will try to create a
835 // zero length array which troubles compilers. Vecs of size 0 are a bit
836 // pointless but might occur in some generic functions or classes.
837 template <typename T>
839 {
840 public:
841  using ComponentType = T;
842  static constexpr vtkm::IdComponent NUM_COMPONENTS = 0;
843 
844  constexpr Vec() = default;
845  VTKM_EXEC_CONT explicit Vec(const ComponentType&) {}
846 
847  template <typename OtherType>
849  {
850  }
851 
854  {
855  return *this;
856  }
857 
859  {
860  return NUM_COMPONENTS;
861  }
862 
865  {
866  return ComponentType();
867  }
868 
870  bool operator==(const Vec<T, NUM_COMPONENTS>& vtkmNotUsed(other)) const { return true; }
872  bool operator!=(const Vec<T, NUM_COMPONENTS>& vtkmNotUsed(other)) const { return false; }
873 };
874 
875 // Vectors of size 1 should implicitly convert between the scalar and the
876 // vector. Otherwise, it should behave the same.
877 template <typename T>
878 class VTKM_ALWAYS_EXPORT Vec<T, 1> : public detail::VecBase<T, 1, Vec<T, 1>>
879 {
880  using Superclass = detail::VecBase<T, 1, Vec<T, 1>>;
881 
882 public:
883  Vec() = default;
884  VTKM_EXEC_CONT constexpr Vec(const T& value)
885  : Superclass(value)
886  {
887  }
888 
889  template <typename OtherType>
891  : Superclass(src)
892  {
893  }
894 };
895 
896 //-----------------------------------------------------------------------------
897 // Specializations for common tuple sizes (with special names).
898 
899 template <typename T>
900 class VTKM_ALWAYS_EXPORT Vec<T, 2> : public detail::VecBase<T, 2, Vec<T, 2>>
901 {
902  using Superclass = detail::VecBase<T, 2, Vec<T, 2>>;
903 
904 public:
905  constexpr Vec() = default;
906  VTKM_EXEC_CONT Vec(const T& value)
907  : Superclass(value)
908  {
909  }
910 
911  template <typename OtherType>
913  : Superclass(src)
914  {
915  }
916 
918  constexpr Vec(const T& x, const T& y)
919  : Superclass(x, y)
920  {
921  }
922 };
923 
927 
931 
938 
944 
950 
956 
962 
968 
974 
980 
985 #ifdef VTKM_USE_64BIT_IDS
987 #else
989 #endif
990 
996 
1002 
1008 
1014 
1015 template <typename T>
1016 class VTKM_ALWAYS_EXPORT Vec<T, 3> : public detail::VecBase<T, 3, Vec<T, 3>>
1017 {
1018  using Superclass = detail::VecBase<T, 3, Vec<T, 3>>;
1019 
1020 public:
1021  constexpr Vec() = default;
1022  VTKM_EXEC_CONT Vec(const T& value)
1023  : Superclass(value)
1024  {
1025  }
1026 
1027  template <typename OtherType>
1029  : Superclass(src)
1030  {
1031  }
1032 
1034  constexpr Vec(const T& x, const T& y, const T& z)
1035  : Superclass(x, y, z)
1036  {
1037  }
1038 };
1039 
1045 
1049 
1056 
1062 
1068 
1074 
1080 
1086 
1092 
1098 
1103 #ifdef VTKM_USE_64BIT_IDS
1105 #else
1107 #endif
1108 
1114 
1120 
1126 
1132 
1133 template <typename T>
1134 class VTKM_ALWAYS_EXPORT Vec<T, 4> : public detail::VecBase<T, 4, Vec<T, 4>>
1135 {
1136  using Superclass = detail::VecBase<T, 4, Vec<T, 4>>;
1137 
1138 public:
1139  constexpr Vec() = default;
1140  VTKM_EXEC_CONT Vec(const T& value)
1141  : Superclass(value)
1142  {
1143  }
1144 
1145  template <typename OtherType>
1147  : Superclass(src)
1148  {
1149  }
1150 
1152  constexpr Vec(const T& x, const T& y, const T& z, const T& w)
1153  : Superclass(x, y, z, w)
1154  {
1155  }
1156 };
1157 
1161 
1165 
1172 
1178 
1184 
1190 
1196 
1202 
1208 
1214 
1219 #ifdef VTKM_USE_64BIT_IDS
1221 #else
1223 #endif
1224 
1230 
1236 
1242 
1248 
1252 template <typename T, typename... Ts>
1253 VTKM_EXEC_CONT constexpr vtkm::Vec<T, vtkm::IdComponent(sizeof...(Ts) + 1)> make_Vec(T value0,
1254  Ts&&... args)
1255 {
1256  return vtkm::Vec<T, vtkm::IdComponent(sizeof...(Ts) + 1)>(value0, T(args)...);
1257 }
1258 
1277 template <typename T>
1278 class VTKM_ALWAYS_EXPORT VecC : public detail::VecCBase<T, VecC<T>>
1279 {
1280  using Superclass = detail::VecCBase<T, VecC<T>>;
1281 
1282  VTKM_STATIC_ASSERT_MSG(std::is_const<T>::value == false,
1283  "You cannot use VecC with a const type as its template argument. "
1284  "Use either const VecC or VecCConst.");
1285 
1286 public:
1287 #ifdef VTKM_DOXYGEN_ONLY
1288  using ComponentType = T;
1289 #endif
1290 
1292  constexpr VecC()
1293  : Components(nullptr)
1294  , NumberOfComponents(0)
1295  {
1296  }
1297 
1299  constexpr VecC(T* array, vtkm::IdComponent size)
1300  : Components(array)
1301  , NumberOfComponents(size)
1302  {
1303  }
1304 
1305  template <vtkm::IdComponent Size>
1307  : Components(src.GetPointer())
1308  , NumberOfComponents(Size)
1309  {
1310  }
1311 
1313  explicit constexpr VecC(T& src)
1314  : Components(&src)
1315  , NumberOfComponents(1)
1316  {
1317  }
1318 
1320  constexpr VecC(const VecC<T>& src)
1321  : Components(src.Components)
1322  , NumberOfComponents(src.NumberOfComponents)
1323  {
1324  }
1325 
1326  inline VTKM_EXEC_CONT constexpr const T& operator[](vtkm::IdComponent index) const
1327  {
1328  VTKM_ASSERT(index >= 0);
1329  VTKM_ASSERT(index < this->NumberOfComponents);
1330  return this->Components[index];
1331  }
1332 
1333  inline VTKM_EXEC_CONT constexpr T& operator[](vtkm::IdComponent index)
1334  {
1335  VTKM_ASSERT(index >= 0);
1336  VTKM_ASSERT(index < this->NumberOfComponents);
1337  return this->Components[index];
1338  }
1339 
1341  {
1342  return this->NumberOfComponents;
1343  }
1344 
1347  {
1348  VTKM_ASSERT(this->NumberOfComponents == src.GetNumberOfComponents());
1349  for (vtkm::IdComponent index = 0; index < this->NumberOfComponents; index++)
1350  {
1351  (*this)[index] = src[index];
1352  }
1353 
1354  return *this;
1355  }
1356 
1357 private:
1358  T* const Components;
1360 };
1361 
1371 template <typename T>
1372 class VTKM_ALWAYS_EXPORT VecCConst : public detail::VecCBase<T, VecCConst<T>>
1373 {
1374  using Superclass = detail::VecCBase<T, VecCConst<T>>;
1375 
1376  VTKM_STATIC_ASSERT_MSG(std::is_const<T>::value == false,
1377  "You cannot use VecCConst with a const type as its template argument. "
1378  "Remove the const from the type.");
1379 
1380 public:
1381 #ifdef VTKM_DOXYGEN_ONLY
1382  using ComponentType = T;
1383 #endif
1384 
1386  constexpr VecCConst()
1387  : Components(nullptr)
1388  , NumberOfComponents(0)
1389  {
1390  }
1391 
1393  constexpr VecCConst(const T* array, vtkm::IdComponent size)
1394  : Components(array)
1395  , NumberOfComponents(size)
1396  {
1397  }
1398 
1399  template <vtkm::IdComponent Size>
1401  : Components(src.GetPointer())
1402  , NumberOfComponents(Size)
1403  {
1404  }
1405 
1407  explicit constexpr VecCConst(const T& src)
1408  : Components(&src)
1409  , NumberOfComponents(1)
1410  {
1411  }
1412 
1414  constexpr VecCConst(const VecCConst<T>& src)
1415  : Components(src.Components)
1416  , NumberOfComponents(src.NumberOfComponents)
1417  {
1418  }
1419 
1421  constexpr VecCConst(const VecC<T>& src)
1422  : Components(src.Components)
1423  , NumberOfComponents(src.NumberOfComponents)
1424  {
1425  }
1426 
1427  inline VTKM_EXEC_CONT constexpr const T& operator[](vtkm::IdComponent index) const
1428  {
1429  VTKM_ASSERT(index >= 0);
1430  VTKM_ASSERT(index < this->NumberOfComponents);
1431  return this->Components[index];
1432  }
1433 
1435  {
1436  return this->NumberOfComponents;
1437  }
1438 
1439 private:
1440  const T* const Components;
1442 
1443  // You are not allowed to assign to a VecCConst, so these operators are not
1444  // implemented and are disallowed.
1445  void operator=(const VecCConst<T>&) = delete;
1446  void operator+=(const VecCConst<T>&) = delete;
1447  void operator-=(const VecCConst<T>&) = delete;
1448  void operator*=(const VecCConst<T>&) = delete;
1449  void operator/=(const VecCConst<T>&) = delete;
1450 };
1451 
1454 template <typename T>
1455 static inline VTKM_EXEC_CONT constexpr vtkm::VecC<T> make_VecC(T* array, vtkm::IdComponent size)
1456 {
1457  return vtkm::VecC<T>(array, size);
1458 }
1459 
1462 template <typename T>
1463 static inline VTKM_EXEC_CONT constexpr vtkm::VecCConst<T> make_VecC(const T* array,
1464  vtkm::IdComponent size)
1465 {
1466  return vtkm::VecCConst<T>(array, size);
1467 }
1468 
1469 namespace detail
1470 {
1471 
1472 template <typename T>
1473 static inline VTKM_EXEC_CONT auto vec_dot(const T& a, const T& b)
1474 {
1475  auto result = a[0] * b[0];
1476  for (vtkm::IdComponent i = 1; i < a.GetNumberOfComponents(); ++i)
1477  {
1478  result = result + a[i] * b[i];
1479  }
1480  return result;
1481 }
1482 template <typename T, vtkm::IdComponent Size>
1483 static inline VTKM_EXEC_CONT auto vec_dot(const vtkm::Vec<T, Size>& a, const vtkm::Vec<T, Size>& b)
1484 {
1485  auto result = a[0] * b[0];
1486  for (vtkm::IdComponent i = 1; i < Size; ++i)
1487  {
1488  result = result + a[i] * b[i];
1489  }
1490  return result;
1491 }
1492 
1493 } // namespace detail
1494 
1495 template <typename T>
1496 static inline VTKM_EXEC_CONT auto Dot(const T& a, const T& b)
1497 {
1498  return detail::vec_dot(a, b);
1499 }
1500 
1501 template <typename T>
1502 static inline VTKM_EXEC_CONT auto Dot(const vtkm::Vec<T, 2>& a, const vtkm::Vec<T, 2>& b)
1503 {
1504  return (a[0] * b[0]) + (a[1] * b[1]);
1505 }
1506 template <typename T>
1507 static inline VTKM_EXEC_CONT auto Dot(const vtkm::Vec<T, 3>& a, const vtkm::Vec<T, 3>& b)
1508 {
1509  return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);
1510 }
1511 template <typename T>
1512 static inline VTKM_EXEC_CONT auto Dot(const vtkm::Vec<T, 4>& a, const vtkm::Vec<T, 4>& b)
1513 {
1514  return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);
1515 }
1516 // Integer types of a width less than an integer get implicitly casted to
1517 // an integer when doing a multiplication.
1518 #define VTK_M_SCALAR_DOT(stype) \
1519  static inline VTKM_EXEC_CONT auto dot(stype a, stype b) { return a * b; } /* LEGACY */ \
1520  static inline VTKM_EXEC_CONT auto Dot(stype a, stype b) { return a * b; }
1531 
1532 // v============ LEGACY =============v
1533 template <typename T>
1534 static inline VTKM_EXEC_CONT auto dot(const T& a, const T& b) -> decltype(detail::vec_dot(a, b))
1535 {
1536  return vtkm::Dot(a, b);
1537 }
1538 template <typename T>
1539 static inline VTKM_EXEC_CONT auto dot(const vtkm::Vec<T, 2>& a, const vtkm::Vec<T, 2>& b)
1540 {
1541  return vtkm::Dot(a, b);
1542 }
1543 template <typename T>
1544 static inline VTKM_EXEC_CONT auto dot(const vtkm::Vec<T, 3>& a, const vtkm::Vec<T, 3>& b)
1545 {
1546  return vtkm::Dot(a, b);
1547 }
1548 template <typename T>
1549 static inline VTKM_EXEC_CONT auto dot(const vtkm::Vec<T, 4>& a, const vtkm::Vec<T, 4>& b)
1550 {
1551  return vtkm::Dot(a, b);
1552 }
1553 // ^============ LEGACY =============^
1554 
1555 template <typename T, vtkm::IdComponent Size>
1557 {
1558  T result = a[0];
1559  for (vtkm::IdComponent i = 1; i < Size; ++i)
1560  {
1561  result += a[i];
1562  }
1563  return result;
1564 }
1565 
1566 template <typename T>
1568 {
1569  return a[0] + a[1];
1570 }
1571 
1572 template <typename T>
1574 {
1575  return a[0] + a[1] + a[2];
1576 }
1577 
1578 template <typename T>
1580 {
1581  return a[0] + a[1] + a[2] + a[3];
1582 }
1583 
1584 template <typename T, vtkm::IdComponent Size>
1586 {
1587  T result = a[0];
1588  for (vtkm::IdComponent i = 1; i < Size; ++i)
1589  {
1590  result *= a[i];
1591  }
1592  return result;
1593 }
1594 
1595 template <typename T>
1597 {
1598  return a[0] * a[1];
1599 }
1600 
1601 template <typename T>
1603 {
1604  return a[0] * a[1] * a[2];
1605 }
1606 
1607 template <typename T>
1609 {
1610  return a[0] * a[1] * a[2] * a[3];
1611 }
1612 
1613 // A pre-declaration of vtkm::Pair so that classes templated on them can refer
1614 // to it. The actual implementation is in vtkm/Pair.h.
1615 template <typename U, typename V>
1616 struct Pair;
1617 
1620 template <typename T, vtkm::IdComponent Size>
1621 inline VTKM_CONT std::ostream& operator<<(std::ostream& stream, const vtkm::Vec<T, Size>& vec)
1622 {
1623  stream << "[";
1624  for (vtkm::IdComponent component = 0; component < Size - 1; component++)
1625  {
1626  stream << vec[component] << ",";
1627  }
1628  return stream << vec[Size - 1] << "]";
1629 }
1630 
1633 template <typename T, typename U>
1634 inline VTKM_EXEC_CONT std::ostream& operator<<(std::ostream& stream, const vtkm::Pair<T, U>& vec)
1635 {
1636  return stream << "[" << vec.first << "," << vec.second << "]";
1637 }
1638 
1639 } // End of namespace vtkm
1640 
1642 // Declared inside of vtkm namespace so that the operator work with ADL lookup
1643 #endif //vtk_m_Types_h
vtkm::operator!=
bool operator!=(const vtkm::Matrix< T, NumRow, NumCol > &a, const vtkm::Matrix< T, NumRow, NumCol > &b)
Definition: Matrix.h:631
vtkm::Vec< T, 1 >::Superclass
detail::VecBase< T, 1, Vec< T, 1 > > Superclass
Definition: Types.h:880
vtkm::Divide
Definition: Types.h:320
vtkm::Vec< T, 2 >::Vec
Vec(const Vec< OtherType, 2 > &src)
Definition: Types.h:912
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Subtract
Definition: Types.h:280
VTKM_ASSERT
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::make_Vec
constexpr vtkm::Vec< T, vtkm::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1253
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::operator/
VTKM_EXEC_CONT vtkm::Vec< T, Size > operator/(vtkm::Vec< T, Size > a, const vtkm::Vec< T, Size > &b)
Definition: VecOperators.h:371
vtkm::Add::operator()
auto operator()(const T &a, const U &b) const -> decltype(a+b)
Definition: Types.h:263
vtkm::ReduceProduct
T ReduceProduct(const vtkm::Vec< T, Size > &a)
Definition: Types.h:1585
vtkm::VecCConst::VecCConst
constexpr VecCConst(const T &src)
Definition: Types.h:1407
vtkm::Vec< T, 3 >::Superclass
detail::VecBase< T, 3, Vec< T, 3 > > Superclass
Definition: Types.h:1018
vtkm::operator<<
std::ostream & operator<<(std::ostream &stream, const vtkm::Bounds &bounds)
Helper function for printing bounds during testing.
Definition: Bounds.h:248
vtkm::WordTypeDefault
vtkm::UInt32 WordTypeDefault
The default word size used for atomic bitwise operations.
Definition: Types.h:198
vtkm::VecCConst::VecCConst
constexpr VecCConst(const VecCConst< T > &src)
Definition: Types.h:1414
vtkm::ReduceSum
T ReduceSum(const vtkm::Vec< T, Size > &a)
Definition: Types.h:1556
vtkm::Vec< vtkm::Float32, 2 >::ComponentType
vtkm::Float32 ComponentType
Definition: Types.h:814
vtkm::Int16
int16_t Int16
Base type to use for 16-bit signed integer numbers.
Definition: Types.h:173
vtkm::operator*
VTKM_EXEC_CONT vtkm::Vec< T, Size > operator*(vtkm::Vec< T, Size > a, const vtkm::Vec< T, Size > &b)
Definition: VecOperators.h:185
vtkm::Vec< T, 0 >::GetNumberOfComponents
constexpr vtkm::IdComponent GetNumberOfComponents() const
Definition: Types.h:858
vtkm::Vec< T, 3 >::Vec
Vec(const T &value)
Definition: Types.h:1022
Assert.h
vtkm::VecC::ComponentType
T ComponentType
Definition: Types.h:1288
vtkm::Multiply::operator()
auto operator()(const T &a, const U &b) const -> decltype(a *b)
Definition: Types.h:303
vtkm::Vec< T, 3 >::Vec
constexpr Vec(const T &x, const T &y, const T &z)
Definition: Types.h:1034
vtkm::Vec< T, 1 >::Vec
constexpr Vec(const T &value)
Definition: Types.h:884
vtkm::Vec< vtkm::Float32, 2 >::Superclass
detail::VecBase< vtkm::Float32, Size, Vec< vtkm::Float32, Size > > Superclass
Definition: Types.h:810
VecOperators.h
VTK_M_SCALAR_DOT
#define VTK_M_SCALAR_DOT(stype)
Definition: Types.h:1518
vtkm::operator==
bool operator==(const vtkm::Matrix< T, NumRow, NumCol > &a, const vtkm::Matrix< T, NumRow, NumCol > &b)
Definition: Matrix.h:617
vtkm::Add
Definition: Types.h:260
ExportMacros.h
vtkm::operator+
VTKM_EXEC_CONT vtkm::Vec< T, Size > operator+(vtkm::Vec< T, Size > a, const vtkm::Vec< T, Size > &b)
Definition: VecOperators.h:92
vtkm::VecC::VecC
constexpr VecC(const VecC< T > &src)
Definition: Types.h:1320
vtkm::Negate::operator()
T operator()(const T &x) const
Definition: Types.h:343
vtkm::Vec< T, 2 >::Vec
constexpr Vec(const T &x, const T &y)
Definition: Types.h:918
vtkm::Vec< T, 4 >
Definition: Types.h:1134
vtkm::operator-
VTKM_EXEC_CONT std::enable_if<(std::is_floating_point< T >::value||std::is_signed< T >::value), vtkm::Vec< T, Size > >::type operator-(vtkm::Vec< T, Size > x)
Definition: VecOperators.h:41
vtkm::Vec< T, 1 >::Vec
Vec(const Vec< OtherType, 1 > &src)
Definition: Types.h:890
vtkm::Vec< T, 4 >::Superclass
detail::VecBase< T, 4, Vec< T, 4 > > Superclass
Definition: Types.h:1136
vtkm::VecCConst::VecCConst
constexpr VecCConst(const T *array, vtkm::IdComponent size)
Definition: Types.h:1393
VTKM_STATIC_ASSERT
#define VTKM_STATIC_ASSERT(condition)
Definition: StaticAssert.h:16
vtkm::VecC::operator=
VecC< T > & operator=(const VecC< T > &src)
Definition: Types.h:1346
vtkm::Vec< T, 4 >::Vec
Vec(const T &value)
Definition: Types.h:1140
vtkm::VecC::Components
T *const Components
Definition: Types.h:1358
vtkm::Multiply
Definition: Types.h:300
vtkm::Int8
int8_t Int8
Base type to use for 8-bit signed integer numbers.
Definition: Types.h:165
vtkm::VecCConst
A const version of VecC.
Definition: Types.h:363
vtkm::Pair::first
FirstType first
The pair's first object.
Definition: Pair.h:50
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
vtkm::VecC::VecC
constexpr VecC(T *array, vtkm::IdComponent size)
Definition: Types.h:1299
vtkm::VecCConst::operator[]
constexpr const T & operator[](vtkm::IdComponent index) const
Definition: Types.h:1427
vtkm::Vec< T, 2 >
Definition: Types.h:900
vtkm::Vec< T, 4 >::Vec
constexpr Vec(const T &x, const T &y, const T &z, const T &w)
Definition: Types.h:1152
Configure.h
vtkm::VecC::VecC
constexpr VecC()
Definition: Types.h:1292
vtkm::Vec< T, 0 >::operator[]
constexpr ComponentType operator[](vtkm::IdComponent) const
Definition: Types.h:864
vtkm::VecCConst::VecCConst
constexpr VecCConst()
Definition: Types.h:1386
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::Int64
signed long long Int64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:204
vtkm::VecCConst::Superclass
detail::VecCBase< T, VecCConst< T > > Superclass
Definition: Types.h:1374
vtkm::Divide::operator()
auto operator()(const T &a, const U &b) const -> decltype(a/b)
Definition: Types.h:323
vtkm::Vec< T, 0 >::Vec
Vec(const ComponentType &)
Definition: Types.h:845
vtkm::VecC::VecC
constexpr VecC(T &src)
Definition: Types.h:1313
vtkm::UInt8
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:169
vtkm::Vec< T, 3 >::Vec
Vec(const Vec< OtherType, 3 > &src)
Definition: Types.h:1028
vtkm::Subtract::operator()
auto operator()(const T &a, const U &b) const -> decltype(a - b)
Definition: Types.h:283
vtkm::VecCConst::GetNumberOfComponents
constexpr vtkm::IdComponent GetNumberOfComponents() const
Definition: Types.h:1434
vtkmNotUsed
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
vtkm::VecCConst::ComponentType
T ComponentType
Definition: Types.h:1382
vtkm::Vec< T, 3 >
Definition: Types.h:1016
vtkm::Vec
A short fixed-length array.
Definition: Types.h:357
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
vtkm::VecC::operator[]
constexpr T & operator[](vtkm::IdComponent index)
Definition: Types.h:1333
vtkm::UInt32
uint32_t UInt32
Base type to use for 32-bit unsigned integer numbers.
Definition: Types.h:185
vtkm::Vec< T, 2 >::Superclass
detail::VecBase< T, 2, Vec< T, 2 > > Superclass
Definition: Types.h:902
StaticAssert.h
vtkm::Float32
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:157
vtkm::Vec::CopyInto
void CopyInto(Vec< T, Size > &dest) const
Definition: Types.h:828
vtkm::UInt64
unsigned long long UInt64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:207
vtkm::VecC::VecC
constexpr VecC(vtkm::Vec< T, Size > &src)
Definition: Types.h:1306
vtkm::Int32
int32_t Int32
Base type to use for 32-bit signed integer numbers.
Definition: Types.h:181
vtkm::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
vtkm::Vec< T, 2 >::Vec
Vec(const T &value)
Definition: Types.h:906
vtkm::VecCConst::Components
const T *const Components
Definition: Types.h:1440
vtkm::VecC::Superclass
detail::VecCBase< T, VecC< T > > Superclass
Definition: Types.h:1280
vtkm::VecCConst::NumberOfComponents
vtkm::IdComponent NumberOfComponents
Definition: Types.h:1441
vtkm::VecC::NumberOfComponents
vtkm::IdComponent NumberOfComponents
Definition: Types.h:1359
vtkm::VecC
A Vec-like representation for short arrays.
Definition: Types.h:360
vtkm::Vec< T, 0 >::operator!=
bool operator!=(const Vec< T, NUM_COMPONENTS > &) const
Definition: Types.h:872
VTKM_ALWAYS_EXPORT
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
vtkm::VecCConst::VecCConst
constexpr VecCConst(const VecC< T > &src)
Definition: Types.h:1421
vtkm::Vec< T, 0 >::operator=
Vec< ComponentType, NUM_COMPONENTS > & operator=(const Vec< ComponentType, NUM_COMPONENTS > &)
Definition: Types.h:853
vtkm::Vec< T, 0 >::Vec
Vec(const Vec< OtherType, NUM_COMPONENTS > &)
Definition: Types.h:848
vtkm::UInt16
uint16_t UInt16
Base type to use for 16-bit unsigned integer numbers.
Definition: Types.h:177
vtkm::VecCConst::VecCConst
constexpr VecCConst(const vtkm::Vec< T, Size > &src)
Definition: Types.h:1400
vtkm::Vec< T, 4 >::Vec
Vec(const Vec< OtherType, 4 > &src)
Definition: Types.h:1146
vtkm::VecC::GetNumberOfComponents
constexpr vtkm::IdComponent GetNumberOfComponents() const
Definition: Types.h:1340
vtkm::Pair
A vtkm::Pair is essentially the same as an STL pair object except that the methods (constructors and ...
Definition: Pair.h:29
VTKM_SUPPRESS_EXEC_WARNINGS
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53
vtkm::Vec< T, 0 >::operator==
bool operator==(const Vec< T, NUM_COMPONENTS > &) const
Definition: Types.h:870
vtkm::Pair::second
SecondType second
The pair's second object.
Definition: Pair.h:55
vtkm::VecC::operator[]
constexpr const T & operator[](vtkm::IdComponent index) const
Definition: Types.h:1326
vtkm::Vec< T, 0 >::ComponentType
T ComponentType
Definition: Types.h:841
vtkm::Negate
Definition: Types.h:340