VTK-m  2.0
List.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_List_h
11 #define vtk_m_List_h
12 
13 #include <vtkm/Types.h>
14 
15 #include <vtkm/internal/Meta.h>
16 
17 #include <functional>
18 
19 namespace vtkm
20 {
21 
22 // We are currently limiting the size of a `vtkm::List`. Generally, a compiler will
23 // happily create a list of any size. However, to make sure the compiler does not go
24 // into an infinite loop, you can only iterate on a list so far. As such, it is safer
25 // to limit the size of the lists.
26 #define VTKM_CHECK_LIST_SIZE(size) \
27  static_assert((size) <= 512, \
28  "A vtkm::List with more than 512 elements is not supported." \
29  " A list this long is problematic for compilers." \
30  " Compilers often have a recursive template instantiation limit of around 1024," \
31  " so operations on lists this large can lead to confusing and misleading errors.")
32 
33 template <typename... Ts>
34 struct List
35 {
36  VTKM_CHECK_LIST_SIZE(sizeof...(Ts));
37 };
38 
39 namespace internal
40 {
41 
42 template <typename T>
43 struct IsListImpl
44 {
45  using type = std::false_type;
46 };
47 
48 template <typename... Ts>
49 struct IsListImpl<vtkm::List<Ts...>>
50 {
51  using type = std::true_type;
52 };
53 
54 template <typename T>
55 using IsList = typename vtkm::internal::IsListImpl<T>::type;
56 
57 } // namespace internal
58 
64 #define VTKM_IS_LIST(type) \
65  VTKM_STATIC_ASSERT_MSG((::vtkm::internal::IsList<type>::value), \
66  "Provided type is not a valid VTK-m list type.")
67 
68 namespace detail
69 {
70 
72 struct UniversalTypeTag
73 {
74  //We never want this tag constructed, and by deleting the constructor
75  //we get an error when trying to use this class with ForEach.
76  UniversalTypeTag() = delete;
77 };
78 
79 } // namespace detail
80 
84 
89 
90 namespace detail
91 {
92 
93 template <typename L>
94 struct ListSizeImpl;
95 
96 template <typename... Ts>
97 struct ListSizeImpl<vtkm::List<Ts...>>
98 {
99  using type =
100  std::integral_constant<vtkm::IdComponent, static_cast<vtkm::IdComponent>(sizeof...(Ts))>;
101 };
102 
103 } // namespace detail
104 
107 template <typename List>
108 using ListSize = typename detail::ListSizeImpl<List>::type;
109 
110 namespace detail
111 {
112 
113 template <typename T, template <typename...> class Target>
114 struct ListApplyImpl;
115 template <typename... Ts, template <typename...> class Target>
116 struct ListApplyImpl<vtkm::List<Ts...>, Target>
117 {
118  using type = Target<Ts...>;
119 };
120 // Cannot apply the universal list.
121 template <template <typename...> class Target>
122 struct ListApplyImpl<vtkm::ListUniversal, Target>;
123 
124 } // namespace detail
125 
131 template <typename List, template <typename...> class Target>
132 using ListApply = typename detail::ListApplyImpl<List, Target>::type;
133 
134 namespace detail
135 {
136 
137 template <typename... Ls>
138 struct ListAppendImpl;
139 
140 template <>
141 struct ListAppendImpl<>
142 {
143  using type = vtkm::ListEmpty;
144 };
145 
146 template <typename L>
147 struct ListAppendImpl<L>
148 {
149  using type = L;
150 };
151 
152 template <typename... T0s, typename... T1s>
153 struct ListAppendImpl<vtkm::List<T0s...>, vtkm::List<T1s...>>
154 {
155  using type = vtkm::List<T0s..., T1s...>;
157 };
158 
159 template <typename... T0s, typename... T1s, typename... T2s>
160 struct ListAppendImpl<vtkm::List<T0s...>, vtkm::List<T1s...>, vtkm::List<T2s...>>
161 {
162  using type = vtkm::List<T0s..., T1s..., T2s...>;
164 };
165 
166 template <typename... T0s, typename... T1s, typename... T2s, typename... T3s>
167 struct ListAppendImpl<vtkm::List<T0s...>,
168  vtkm::List<T1s...>,
169  vtkm::List<T2s...>,
170  vtkm::List<T3s...>>
171 {
172  using type = vtkm::List<T0s..., T1s..., T2s..., T3s...>;
174 };
175 
176 template <typename... T0s, typename... T1s, typename... T2s, typename... T3s, typename... T4s>
177 struct ListAppendImpl<vtkm::List<T0s...>,
178  vtkm::List<T1s...>,
179  vtkm::List<T2s...>,
180  vtkm::List<T3s...>,
181  vtkm::List<T4s...>>
182 {
183  using type = vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s...>;
185 };
186 
187 template <typename... T0s,
188  typename... T1s,
189  typename... T2s,
190  typename... T3s,
191  typename... T4s,
192  typename... T5s>
193 struct ListAppendImpl<vtkm::List<T0s...>,
194  vtkm::List<T1s...>,
195  vtkm::List<T2s...>,
196  vtkm::List<T3s...>,
197  vtkm::List<T4s...>,
198  vtkm::List<T5s...>>
199 {
200  using type = vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s..., T5s...>;
202 };
203 
204 template <typename... T0s,
205  typename... T1s,
206  typename... T2s,
207  typename... T3s,
208  typename... T4s,
209  typename... T5s,
210  typename... T6s>
211 struct ListAppendImpl<vtkm::List<T0s...>,
212  vtkm::List<T1s...>,
213  vtkm::List<T2s...>,
214  vtkm::List<T3s...>,
215  vtkm::List<T4s...>,
216  vtkm::List<T5s...>,
217  vtkm::List<T6s...>>
218 {
219  using type = vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s..., T5s..., T6s...>;
221 };
222 
223 template <typename... T0s,
224  typename... T1s,
225  typename... T2s,
226  typename... T3s,
227  typename... T4s,
228  typename... T5s,
229  typename... T6s,
230  typename... T7s>
231 struct ListAppendImpl<vtkm::List<T0s...>,
232  vtkm::List<T1s...>,
233  vtkm::List<T2s...>,
234  vtkm::List<T3s...>,
235  vtkm::List<T4s...>,
236  vtkm::List<T5s...>,
237  vtkm::List<T6s...>,
238  vtkm::List<T7s...>>
239 {
240  using type = vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s..., T5s..., T6s..., T7s...>;
242 };
243 
244 template <typename... T0s,
245  typename... T1s,
246  typename... T2s,
247  typename... T3s,
248  typename... T4s,
249  typename... T5s,
250  typename... T6s,
251  typename... T7s,
252  typename... Ls>
253 struct ListAppendImpl<vtkm::List<T0s...>,
254  vtkm::List<T1s...>,
255  vtkm::List<T2s...>,
256  vtkm::List<T3s...>,
257  vtkm::List<T4s...>,
258  vtkm::List<T5s...>,
259  vtkm::List<T6s...>,
260  vtkm::List<T7s...>,
261  Ls...>
262 {
263  using type = typename ListAppendImpl<
264  vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s..., T5s..., T6s..., T7s...>,
265  Ls...>::type;
267 };
268 
269 } // namespace detail
270 
274 template <typename... Lists>
275 using ListAppend = typename detail::ListAppendImpl<Lists...>::type;
276 
277 namespace detail
278 {
279 
280 template <typename T, vtkm::IdComponent N>
281 struct ListFillImpl
282 {
283  using type = typename ListAppendImpl<typename ListFillImpl<T, (N / 2)>::type,
284  typename ListFillImpl<T, (N - (N / 2))>::type>::type;
285 };
286 
287 template <typename T>
288 struct ListFillImpl<T, 1>
289 {
290  using type = vtkm::List<T>;
291 };
292 
293 template <typename T>
294 struct ListFillImpl<T, 0>
295 {
296  using type = vtkm::List<>;
297 };
298 
299 } // namespace detail
300 
303 template <typename T, vtkm::IdComponent N>
304 using ListFill = typename detail::ListFillImpl<T, N>::type;
305 
306 namespace detail
307 {
308 
309 template <typename T>
310 struct ListAtImplFunc;
311 
312 template <typename... VoidTypes>
313 struct ListAtImplFunc<vtkm::List<VoidTypes...>>
314 {
315  // Rather than declare a `type`, make a declaration of a function that returns the type
316  // after some number of `const void*` arguments. We can use ListFill to quickly create
317  // the list of `const void*` arguments, so the type can be returned. We can then use
318  // decltype to get the returned type.
319  //
320  // Templating the `Other` should not be strictly necessary. (You should be able to just
321  // end with `...`.) But some compilers (such as CUDA 8 and Intel 18) have a problem with
322  // that.
323  template <typename T, class... Other>
324  static T at(VoidTypes..., T*, Other...);
325 };
326 
327 template <typename T, vtkm::IdComponent Index>
328 struct ListAtImpl;
329 
330 template <typename... Ts, vtkm::IdComponent Index>
331 struct ListAtImpl<vtkm::List<Ts...>, Index>
332 {
333  using type =
334  decltype(ListAtImplFunc<vtkm::ListFill<const void*, Index>>::at(static_cast<Ts*>(nullptr)...));
335 };
336 
337 } // namespace detail
338 
343 template <typename List, vtkm::IdComponent Index>
344 using ListAt = typename detail::ListAtImpl<List, Index>::type;
345 
346 namespace detail
347 {
348 
349 template <vtkm::IdComponent NumSearched, typename Target, typename... Remaining>
350 struct FindFirstOfType;
351 
352 // Not found
353 template <vtkm::IdComponent NumSearched, typename Target>
354 struct FindFirstOfType<NumSearched, Target> : std::integral_constant<vtkm::IdComponent, -1>
355 {
356 };
357 
358 // Basic search next one
359 template <bool NextIsTarget, vtkm::IdComponent NumSearched, typename Target, typename... Remaining>
360 struct FindFirstOfCheckHead;
361 
362 template <vtkm::IdComponent NumSearched, typename Target, typename... Ts>
363 struct FindFirstOfCheckHead<true, NumSearched, Target, Ts...>
364  : std::integral_constant<vtkm::IdComponent, NumSearched>
365 {
366 };
367 
368 template <vtkm::IdComponent NumSearched, typename Target, typename Next, typename... Remaining>
369 struct FindFirstOfCheckHead<false, NumSearched, Target, Next, Remaining...>
370  : FindFirstOfCheckHead<std::is_same<Target, Next>::value, NumSearched + 1, Target, Remaining...>
371 {
372 };
373 
374 // Not found
375 template <vtkm::IdComponent NumSearched, typename Target>
376 struct FindFirstOfCheckHead<false, NumSearched, Target>
377  : std::integral_constant<vtkm::IdComponent, -1>
378 {
379 };
380 
381 template <vtkm::IdComponent NumSearched, typename Target, typename Next, typename... Remaining>
382 struct FindFirstOfType<NumSearched, Target, Next, Remaining...>
383  : FindFirstOfCheckHead<std::is_same<Target, Next>::value, NumSearched, Target, Remaining...>
384 {
385 };
386 
387 // If there are at least 6 entries, check the first 4 to quickly narrow down
388 template <bool OneInFirst4Matches, vtkm::IdComponent NumSearched, typename Target, typename... Ts>
389 struct FindFirstOfSplit4;
390 
391 template <vtkm::IdComponent NumSearched,
392  typename Target,
393  typename T0,
394  typename T1,
395  typename T2,
396  typename T3,
397  typename... Ts>
398 struct FindFirstOfSplit4<true, NumSearched, Target, T0, T1, T2, T3, Ts...>
399  : FindFirstOfCheckHead<std::is_same<Target, T0>::value, NumSearched, Target, T1, T2, T3>
400 {
401 };
402 
403 template <vtkm::IdComponent NumSearched,
404  typename Target,
405  typename T0,
406  typename T1,
407  typename T2,
408  typename T3,
409  typename T4,
410  typename... Ts>
411 struct FindFirstOfSplit4<false, NumSearched, Target, T0, T1, T2, T3, T4, Ts...>
412  : FindFirstOfCheckHead<std::is_same<Target, T4>::value, NumSearched + 4, Target, Ts...>
413 {
414 };
415 
416 template <vtkm::IdComponent NumSearched,
417  typename Target,
418  typename T0,
419  typename T1,
420  typename T2,
421  typename T3,
422  typename T4,
423  typename T5,
424  typename... Ts>
425 struct FindFirstOfType<NumSearched, Target, T0, T1, T2, T3, T4, T5, Ts...>
426  : FindFirstOfSplit4<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
427  std::is_same<Target, T2>::value || std::is_same<Target, T3>::value),
428  NumSearched,
429  Target,
430  T0,
431  T1,
432  T2,
433  T3,
434  T4,
435  T5,
436  Ts...>
437 {
438 };
439 
440 // If there are at least 12 entries, check the first 8 to quickly narrow down
441 template <bool OneInFirst8Matches, vtkm::IdComponent NumSearched, typename Target, typename... Ts>
442 struct FindFirstOfSplit8;
443 
444 template <vtkm::IdComponent NumSearched,
445  typename Target,
446  typename T0,
447  typename T1,
448  typename T2,
449  typename T3,
450  typename T4,
451  typename T5,
452  typename T6,
453  typename T7,
454  typename... Ts>
455 struct FindFirstOfSplit8<true, NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, Ts...>
456  : FindFirstOfSplit4<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
457  std::is_same<Target, T2>::value || std::is_same<Target, T3>::value),
458  NumSearched,
459  Target,
460  T0,
461  T1,
462  T2,
463  T3,
464  T4,
465  T5,
466  T6,
467  T7>
468 {
469 };
470 
471 template <vtkm::IdComponent NumSearched,
472  typename Target,
473  typename T0,
474  typename T1,
475  typename T2,
476  typename T3,
477  typename T4,
478  typename T5,
479  typename T6,
480  typename T7,
481  typename... Ts>
482 struct FindFirstOfSplit8<false, NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, Ts...>
483  : FindFirstOfType<NumSearched + 8, Target, Ts...>
484 {
485 };
486 
487 template <vtkm::IdComponent NumSearched,
488  typename Target,
489  typename T0,
490  typename T1,
491  typename T2,
492  typename T3,
493  typename T4,
494  typename T5,
495  typename T6,
496  typename T7,
497  typename T8,
498  typename T9,
499  typename T10,
500  typename T11,
501  typename... Ts>
502 struct FindFirstOfType<NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Ts...>
503  : FindFirstOfSplit8<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
504  std::is_same<Target, T2>::value || std::is_same<Target, T3>::value ||
505  std::is_same<Target, T4>::value || std::is_same<Target, T5>::value ||
506  std::is_same<Target, T6>::value || std::is_same<Target, T7>::value),
507  NumSearched,
508  Target,
509  T0,
510  T1,
511  T2,
512  T3,
513  T4,
514  T5,
515  T6,
516  T7,
517  T8,
518  T9,
519  T10,
520  T11,
521  Ts...>
522 {
523 };
524 
525 template <typename List, typename Target>
526 struct ListIndexOfImpl;
527 template <typename... Ts, typename Target>
528 struct ListIndexOfImpl<vtkm::List<Ts...>, Target>
529 {
530  using type = std::integral_constant<vtkm::IdComponent, FindFirstOfType<0, Target, Ts...>::value>;
531 };
532 template <typename Target>
533 struct ListIndexOfImpl<vtkm::ListUniversal, Target>
534 {
535  VTKM_STATIC_ASSERT_MSG((std::is_same<Target, void>::value && std::is_same<Target, int>::value),
536  "Cannot get indices in a universal list.");
537 };
538 
539 } // namespace detail
540 
546 template <typename List, typename T>
547 using ListIndexOf = typename detail::ListIndexOfImpl<List, T>::type;
548 
549 namespace detail
550 {
551 
552 template <typename List, typename T>
553 struct ListHasImpl
554 {
555  using type = std::integral_constant<bool, (vtkm::ListIndexOf<List, T>::value >= 0)>;
556 };
557 
558 template <typename T>
559 struct ListHasImpl<vtkm::ListUniversal, T>
560 {
561  using type = std::true_type;
562 };
563 
564 } // namespace detail
565 
570 template <typename List, typename T>
571 using ListHas = typename detail::ListHasImpl<List, T>::type;
572 
573 namespace detail
574 {
575 
576 template <typename T, template <typename> class Target>
577 struct ListTransformImpl;
578 template <typename... Ts, template <typename> class Target>
579 struct ListTransformImpl<vtkm::List<Ts...>, Target>
580 {
581  using type = vtkm::List<Target<Ts>...>;
582 };
583 // Cannot transform the universal list.
584 template <template <typename> class Target>
585 struct ListTransformImpl<vtkm::ListUniversal, Target>;
586 
587 } // namespace detail
588 
591 template <typename List, template <typename> class Transform>
592 using ListTransform = typename detail::ListTransformImpl<List, Transform>::type;
593 
594 namespace detail
595 {
596 
597 #if defined(VTKM_MSVC) && (_MSC_VER < 1920)
598 // Special (inefficient) implementation for MSVC 2017, which has an ICE for the regular version
599 
600 template <typename Passed,
601  typename Next,
602  bool Remove,
603  typename Rest,
604  template <typename>
605  class Predicate>
606 struct ListRemoveIfCheckNext;
607 
608 template <typename Passed, typename Rest, template <typename> class Predicate>
609 struct ListRemoveIfGetNext;
610 
611 template <typename Passed, typename Next, typename Rest, template <typename> class Predicate>
612 struct ListRemoveIfCheckNext<Passed, Next, true, Rest, Predicate>
613 {
614  using type = typename ListRemoveIfGetNext<Passed, Rest, Predicate>::type;
615 };
616 
617 template <typename... PassedTs, typename Next, typename Rest, template <typename> class Predicate>
618 struct ListRemoveIfCheckNext<vtkm::List<PassedTs...>, Next, false, Rest, Predicate>
619 {
620  using type = typename ListRemoveIfGetNext<vtkm::List<PassedTs..., Next>, Rest, Predicate>::type;
621 };
622 
623 template <typename Passed, typename Next, typename... RestTs, template <typename> class Predicate>
624 struct ListRemoveIfGetNext<Passed, vtkm::List<Next, RestTs...>, Predicate>
625 {
626  using type = typename ListRemoveIfCheckNext<Passed,
627  Next,
628  Predicate<Next>::value,
629  vtkm::List<RestTs...>,
630  Predicate>::type;
631 };
632 
633 template <typename Passed, template <typename> class Predicate>
634 struct ListRemoveIfGetNext<Passed, vtkm::List<>, Predicate>
635 {
636  using type = Passed;
637 };
638 
639 template <typename L, template <typename> class Predicate>
640 struct ListRemoveIfImpl
641 {
642  using type = typename ListRemoveIfGetNext<vtkm::List<>, L, Predicate>::type;
643 };
644 
645 #else
646 
647 template <typename L, template <typename> class Predicate>
648 struct ListRemoveIfImpl;
649 
650 template <typename... Ts, template <typename> class Predicate>
651 struct ListRemoveIfImpl<vtkm::List<Ts...>, Predicate>
652 {
653  using type = typename ListAppendImpl<
654  std::conditional_t<Predicate<Ts>::value, vtkm::List<>, vtkm::List<Ts>>...>::type;
655 };
656 
657 #endif
658 
659 } // namespace detail
660 
673 template <typename List, template <typename> class Predicate>
674 using ListRemoveIf = typename detail::ListRemoveIfImpl<List, Predicate>::type;
675 
676 namespace detail
677 {
678 
679 template <typename List1, typename List2>
680 struct ListIntersectImpl
681 {
682  template <typename T>
683  struct Predicate
684  {
685  static constexpr bool value = !vtkm::ListHas<List1, T>::value;
686  };
687 
689 };
690 
691 template <typename List1>
692 struct ListIntersectImpl<List1, vtkm::ListUniversal>
693 {
694  using type = List1;
695 };
696 template <typename List2>
697 struct ListIntersectImpl<vtkm::ListUniversal, List2>
698 {
699  using type = List2;
700 };
701 template <>
702 struct ListIntersectImpl<vtkm::ListUniversal, vtkm::ListUniversal>
703 {
704  using type = vtkm::ListUniversal;
705 };
706 
707 } // namespace detail
708 
711 template <typename List1, typename List2>
712 using ListIntersect = typename detail::ListIntersectImpl<List1, List2>::type;
713 
719 template <typename Functor, typename... Ts, typename... Args>
720 VTKM_EXEC_CONT void ListForEach(Functor&& f, vtkm::List<Ts...>, Args&&... args)
721 {
723  "Cannot call ListFor on vtkm::ListUniversal.");
724  auto init_list = { (f(Ts{}, std::forward<Args>(args)...), false)... };
725  (void)init_list;
726 }
727 template <typename Functor, typename... Args>
728 VTKM_EXEC_CONT void ListForEach(Functor&&, vtkm::ListEmpty, Args&&...)
729 {
730  // No types to run functor on.
731 }
733 
734 namespace detail
735 {
736 
737 template <typename List1, typename List2>
738 struct ListCrossImpl;
739 
740 template <typename... T0s, typename... T1s>
741 struct ListCrossImpl<vtkm::List<T0s...>, vtkm::List<T1s...>>
742 {
743  template <typename T>
744  struct Predicate
745  {
746  using type = vtkm::List<vtkm::List<T, T1s>...>;
747  };
748 
750 };
751 
752 } // namespace detail
753 
758 template <typename List1, typename List2>
759 using ListCross = typename detail::ListCrossImpl<List1, List2>::type;
760 
761 namespace detail
762 {
763 
764 template <typename L, template <typename T1, typename T2> class Operator, typename Result>
765 struct ListReduceImpl;
766 
767 template <template <typename T1, typename T2> class Operator, typename Result>
768 struct ListReduceImpl<vtkm::List<>, Operator, Result>
769 {
770  using type = Result;
771 };
772 
773 template <typename T0,
774  typename... Ts,
775  template <typename O1, typename O2>
776  class Operator,
777  typename Result>
778 struct ListReduceImpl<vtkm::List<T0, Ts...>, Operator, Result>
779 {
780  using type = typename ListReduceImpl<vtkm::List<Ts...>, Operator, Operator<Result, T0>>::type;
781 };
782 
783 template <typename T0,
784  typename T1,
785  typename T2,
786  typename T3,
787  typename T4,
788  typename T5,
789  typename T6,
790  typename T7,
791  typename T8,
792  typename... Ts,
793  template <typename O1, typename O2>
794  class Operator,
795  typename Result>
796 struct ListReduceImpl<vtkm::List<T0, T1, T2, T3, T4, T5, T6, T7, T8, Ts...>, Operator, Result>
797 {
798  using type = typename ListReduceImpl<
799  vtkm::List<T8, Ts...>,
800  Operator,
801  typename ListReduceImpl<vtkm::List<T0, T1, T2, T3, T4, T5, T6, T7>, Operator, Result>::type>::
802  type;
803 };
804 
805 } // namespace detail
806 
814 template <typename List, template <typename T1, typename T2> class Operator, typename Initial>
815 using ListReduce = typename detail::ListReduceImpl<List, Operator, Initial>::type;
816 
837 template <typename List, template <typename> class Predicate = vtkm::internal::meta::Identity>
838 using ListAll =
839  vtkm::ListReduce<vtkm::ListTransform<List, Predicate>, vtkm::internal::meta::And, std::true_type>;
840 
862 template <typename List, template <typename> class Predicate = vtkm::internal::meta::Identity>
863 using ListAny =
864  vtkm::ListReduce<vtkm::ListTransform<List, Predicate>, vtkm::internal::meta::Or, std::false_type>;
865 
866 #undef VTKM_CHECK_LIST_SIZE
867 
868 } // namespace vtkm
869 
870 #endif //vtk_m_List_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::ListIndexOf
typename detail::ListIndexOfImpl< List, T >::type ListIndexOf
Finds the index of a given type.
Definition: List.h:547
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::ListAppend
typename detail::ListAppendImpl< Lists... >::type ListAppend
Concatinates a set of lists into a single list.
Definition: List.h:275
VTKM_CHECK_LIST_SIZE
#define VTKM_CHECK_LIST_SIZE(size)
Definition: List.h:26
vtkm::ListApply
typename detail::ListApplyImpl< List, Target >::type ListApply
Applies the list of types to a template.
Definition: List.h:132
vtkm::ListCross
typename detail::ListCrossImpl< List1, List2 >::type ListCross
Generates a list that is the cross product of two input lists.
Definition: List.h:759
vtkm::ListEmpty
vtkm::List<> ListEmpty
A special tag for an empty list.
Definition: List.h:83
vtkm::ListRemoveIf
typename detail::ListRemoveIfImpl< List, Predicate >::type ListRemoveIf
Takes an existing List and a predicate template that is applied to each type in the List.
Definition: List.h:674
vtkm::ListForEach
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT void ListForEach(Functor &&f, vtkm::List< Ts... >, Args &&... args)
Definition: List.h:720
vtkm::ListSize
typename detail::ListSizeImpl< List >::type ListSize
Becomes an std::integral_constant containing the number of types in a list.
Definition: List.h:108
vtkm::ListReduce
typename detail::ListReduceImpl< List, Operator, Initial >::type ListReduce
Reduces a list to a single type using an operator.
Definition: List.h:815
vtkm::ListAt
typename detail::ListAtImpl< List, Index >::type ListAt
Finds the type at the given index.
Definition: List.h:344
vtkm::List::VTKM_CHECK_LIST_SIZE
VTKM_CHECK_LIST_SIZE(sizeof...(Ts))
vtkm::ListUniversal
vtkm::List< detail::UniversalTypeTag > ListUniversal
A special tag for a list that represents holding all potential values.
Definition: List.h:88
vtkm::ListFill
typename detail::ListFillImpl< T, N >::type ListFill
Returns a list filled with N copies of type T.
Definition: List.h:304
vtkm::ListTransform
typename detail::ListTransformImpl< List, Transform >::type ListTransform
Constructs a list containing all types in a source list applied to a transform template.
Definition: List.h:592
Meta.h
vtkm::ListHas
typename detail::ListHasImpl< List, T >::type ListHas
Checks to see if the given T is in the list pointed to by List.
Definition: List.h:571
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
Index
int Index
Definition: ChooseCudaDevice.h:87
vtkm::List
Definition: List.h:34
vtkm::ListIntersect
typename detail::ListIntersectImpl< List1, List2 >::type ListIntersect
Constructs a list containing types present in all lists.
Definition: List.h:712
vtkm::ListAll
vtkm::ListReduce< vtkm::ListTransform< List, Predicate >, vtkm::internal::meta::And, std::true_type > ListAll
Determines whether all the types in the list are "true.".
Definition: List.h:839
vtkm::ListAny
vtkm::ListReduce< vtkm::ListTransform< List, Predicate >, vtkm::internal::meta::Or, std::false_type > ListAny
Determines whether any of the types in the list are "true.".
Definition: List.h:864
VTKM_SUPPRESS_EXEC_WARNINGS
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53