VTK-m  2.2
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 
38 template <typename... Ts>
39 struct List
40 {
41  VTKM_CHECK_LIST_SIZE(sizeof...(Ts));
42 };
43 
44 namespace internal
45 {
46 
47 template <typename T>
48 struct IsListImpl
49 {
50  using type = std::false_type;
51 };
52 
53 template <typename... Ts>
54 struct IsListImpl<vtkm::List<Ts...>>
55 {
56  using type = std::true_type;
57 };
58 
59 template <typename T>
60 using IsList = typename vtkm::internal::IsListImpl<T>::type;
61 
62 } // namespace internal
63 
69 #define VTKM_IS_LIST(type) \
70  VTKM_STATIC_ASSERT_MSG((::vtkm::internal::IsList<type>::value), \
71  "Provided type is not a valid VTK-m list type.")
72 
73 namespace detail
74 {
75 
77 struct UniversalTypeTag
78 {
79  //We never want this tag constructed, and by deleting the constructor
80  //we get an error when trying to use this class with ForEach.
81  UniversalTypeTag() = delete;
82 };
83 
84 } // namespace detail
85 
89 
95 
96 namespace detail
97 {
98 
99 template <typename L>
100 struct ListSizeImpl;
101 
102 template <typename... Ts>
103 struct ListSizeImpl<vtkm::List<Ts...>>
104 {
105  using type =
106  std::integral_constant<vtkm::IdComponent, static_cast<vtkm::IdComponent>(sizeof...(Ts))>;
107 };
108 
109 } // namespace detail
110 
113 template <typename List>
114 using ListSize = typename detail::ListSizeImpl<List>::type;
115 
116 namespace detail
117 {
118 
119 template <typename T, template <typename...> class Target>
120 struct ListApplyImpl;
121 template <typename... Ts, template <typename...> class Target>
122 struct ListApplyImpl<vtkm::List<Ts...>, Target>
123 {
124  using type = Target<Ts...>;
125 };
126 // Cannot apply the universal list.
127 template <template <typename...> class Target>
128 struct ListApplyImpl<vtkm::ListUniversal, Target>;
129 
130 } // namespace detail
131 
137 template <typename List, template <typename...> class Target>
138 using ListApply = typename detail::ListApplyImpl<List, Target>::type;
139 
140 namespace detail
141 {
142 
143 template <typename... Ls>
144 struct ListAppendImpl;
145 
146 template <>
147 struct ListAppendImpl<>
148 {
149  using type = vtkm::ListEmpty;
150 };
151 
152 template <typename L>
153 struct ListAppendImpl<L>
154 {
155  using type = L;
156 };
157 
158 template <typename... T0s, typename... T1s>
159 struct ListAppendImpl<vtkm::List<T0s...>, vtkm::List<T1s...>>
160 {
161  using type = vtkm::List<T0s..., T1s...>;
163 };
164 
165 template <typename... T0s, typename... T1s, typename... T2s>
166 struct ListAppendImpl<vtkm::List<T0s...>, vtkm::List<T1s...>, vtkm::List<T2s...>>
167 {
168  using type = vtkm::List<T0s..., T1s..., T2s...>;
170 };
171 
172 template <typename... T0s, typename... T1s, typename... T2s, typename... T3s>
173 struct ListAppendImpl<vtkm::List<T0s...>,
174  vtkm::List<T1s...>,
175  vtkm::List<T2s...>,
176  vtkm::List<T3s...>>
177 {
178  using type = vtkm::List<T0s..., T1s..., T2s..., T3s...>;
180 };
181 
182 template <typename... T0s, typename... T1s, typename... T2s, typename... T3s, typename... T4s>
183 struct ListAppendImpl<vtkm::List<T0s...>,
184  vtkm::List<T1s...>,
185  vtkm::List<T2s...>,
186  vtkm::List<T3s...>,
187  vtkm::List<T4s...>>
188 {
189  using type = vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s...>;
191 };
192 
193 template <typename... T0s,
194  typename... T1s,
195  typename... T2s,
196  typename... T3s,
197  typename... T4s,
198  typename... T5s>
199 struct ListAppendImpl<vtkm::List<T0s...>,
200  vtkm::List<T1s...>,
201  vtkm::List<T2s...>,
202  vtkm::List<T3s...>,
203  vtkm::List<T4s...>,
204  vtkm::List<T5s...>>
205 {
206  using type = vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s..., T5s...>;
208 };
209 
210 template <typename... T0s,
211  typename... T1s,
212  typename... T2s,
213  typename... T3s,
214  typename... T4s,
215  typename... T5s,
216  typename... T6s>
217 struct ListAppendImpl<vtkm::List<T0s...>,
218  vtkm::List<T1s...>,
219  vtkm::List<T2s...>,
220  vtkm::List<T3s...>,
221  vtkm::List<T4s...>,
222  vtkm::List<T5s...>,
223  vtkm::List<T6s...>>
224 {
225  using type = vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s..., T5s..., T6s...>;
227 };
228 
229 template <typename... T0s,
230  typename... T1s,
231  typename... T2s,
232  typename... T3s,
233  typename... T4s,
234  typename... T5s,
235  typename... T6s,
236  typename... T7s>
237 struct ListAppendImpl<vtkm::List<T0s...>,
238  vtkm::List<T1s...>,
239  vtkm::List<T2s...>,
240  vtkm::List<T3s...>,
241  vtkm::List<T4s...>,
242  vtkm::List<T5s...>,
243  vtkm::List<T6s...>,
244  vtkm::List<T7s...>>
245 {
246  using type = vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s..., T5s..., T6s..., T7s...>;
248 };
249 
250 template <typename... T0s,
251  typename... T1s,
252  typename... T2s,
253  typename... T3s,
254  typename... T4s,
255  typename... T5s,
256  typename... T6s,
257  typename... T7s,
258  typename... Ls>
259 struct ListAppendImpl<vtkm::List<T0s...>,
260  vtkm::List<T1s...>,
261  vtkm::List<T2s...>,
262  vtkm::List<T3s...>,
263  vtkm::List<T4s...>,
264  vtkm::List<T5s...>,
265  vtkm::List<T6s...>,
266  vtkm::List<T7s...>,
267  Ls...>
268 {
269  using type = typename ListAppendImpl<
270  vtkm::List<T0s..., T1s..., T2s..., T3s..., T4s..., T5s..., T6s..., T7s...>,
271  Ls...>::type;
273 };
274 
275 } // namespace detail
276 
280 template <typename... Lists>
281 using ListAppend = typename detail::ListAppendImpl<Lists...>::type;
282 
283 namespace detail
284 {
285 
286 template <typename T, vtkm::IdComponent N>
287 struct ListFillImpl
288 {
289  using type = typename ListAppendImpl<typename ListFillImpl<T, (N / 2)>::type,
290  typename ListFillImpl<T, (N - (N / 2))>::type>::type;
291 };
292 
293 template <typename T>
294 struct ListFillImpl<T, 1>
295 {
296  using type = vtkm::List<T>;
297 };
298 
299 template <typename T>
300 struct ListFillImpl<T, 0>
301 {
302  using type = vtkm::List<>;
303 };
304 
305 } // namespace detail
306 
309 template <typename T, vtkm::IdComponent N>
310 using ListFill = typename detail::ListFillImpl<T, N>::type;
311 
312 namespace detail
313 {
314 
315 template <typename T>
316 struct ListAtImplFunc;
317 
318 template <typename... VoidTypes>
319 struct ListAtImplFunc<vtkm::List<VoidTypes...>>
320 {
321  // Rather than declare a `type`, make a declaration of a function that returns the type
322  // after some number of `const void*` arguments. We can use ListFill to quickly create
323  // the list of `const void*` arguments, so the type can be returned. We can then use
324  // decltype to get the returned type.
325  //
326  // Templating the `Other` should not be strictly necessary. (You should be able to just
327  // end with `...`.) But some compilers (such as CUDA 8 and Intel 18) have a problem with
328  // that.
329  template <typename T, class... Other>
330  static T at(VoidTypes..., T*, Other...);
331 };
332 
333 template <typename T, vtkm::IdComponent Index>
334 struct ListAtImpl;
335 
336 template <typename... Ts, vtkm::IdComponent Index>
337 struct ListAtImpl<vtkm::List<Ts...>, Index>
338 {
339  using type =
340  decltype(ListAtImplFunc<vtkm::ListFill<const void*, Index>>::at(static_cast<Ts*>(nullptr)...));
341 };
342 
343 } // namespace detail
344 
349 template <typename List, vtkm::IdComponent Index>
350 using ListAt = typename detail::ListAtImpl<List, Index>::type;
351 
352 namespace detail
353 {
354 
355 template <vtkm::IdComponent NumSearched, typename Target, typename... Remaining>
356 struct FindFirstOfType;
357 
358 // Not found
359 template <vtkm::IdComponent NumSearched, typename Target>
360 struct FindFirstOfType<NumSearched, Target> : std::integral_constant<vtkm::IdComponent, -1>
361 {
362 };
363 
364 // Basic search next one
365 template <bool NextIsTarget, vtkm::IdComponent NumSearched, typename Target, typename... Remaining>
366 struct FindFirstOfCheckHead;
367 
368 template <vtkm::IdComponent NumSearched, typename Target, typename... Ts>
369 struct FindFirstOfCheckHead<true, NumSearched, Target, Ts...>
370  : std::integral_constant<vtkm::IdComponent, NumSearched>
371 {
372 };
373 
374 template <vtkm::IdComponent NumSearched, typename Target, typename Next, typename... Remaining>
375 struct FindFirstOfCheckHead<false, NumSearched, Target, Next, Remaining...>
376  : FindFirstOfCheckHead<std::is_same<Target, Next>::value, NumSearched + 1, Target, Remaining...>
377 {
378 };
379 
380 // Not found
381 template <vtkm::IdComponent NumSearched, typename Target>
382 struct FindFirstOfCheckHead<false, NumSearched, Target>
383  : std::integral_constant<vtkm::IdComponent, -1>
384 {
385 };
386 
387 template <vtkm::IdComponent NumSearched, typename Target, typename Next, typename... Remaining>
388 struct FindFirstOfType<NumSearched, Target, Next, Remaining...>
389  : FindFirstOfCheckHead<std::is_same<Target, Next>::value, NumSearched, Target, Remaining...>
390 {
391 };
392 
393 // If there are at least 6 entries, check the first 4 to quickly narrow down
394 template <bool OneInFirst4Matches, vtkm::IdComponent NumSearched, typename Target, typename... Ts>
395 struct FindFirstOfSplit4;
396 
397 template <vtkm::IdComponent NumSearched,
398  typename Target,
399  typename T0,
400  typename T1,
401  typename T2,
402  typename T3,
403  typename... Ts>
404 struct FindFirstOfSplit4<true, NumSearched, Target, T0, T1, T2, T3, Ts...>
405  : FindFirstOfCheckHead<std::is_same<Target, T0>::value, NumSearched, Target, T1, T2, T3>
406 {
407 };
408 
409 template <vtkm::IdComponent NumSearched,
410  typename Target,
411  typename T0,
412  typename T1,
413  typename T2,
414  typename T3,
415  typename T4,
416  typename... Ts>
417 struct FindFirstOfSplit4<false, NumSearched, Target, T0, T1, T2, T3, T4, Ts...>
418  : FindFirstOfCheckHead<std::is_same<Target, T4>::value, NumSearched + 4, Target, Ts...>
419 {
420 };
421 
422 template <vtkm::IdComponent NumSearched,
423  typename Target,
424  typename T0,
425  typename T1,
426  typename T2,
427  typename T3,
428  typename T4,
429  typename T5,
430  typename... Ts>
431 struct FindFirstOfType<NumSearched, Target, T0, T1, T2, T3, T4, T5, Ts...>
432  : FindFirstOfSplit4<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
433  std::is_same<Target, T2>::value || std::is_same<Target, T3>::value),
434  NumSearched,
435  Target,
436  T0,
437  T1,
438  T2,
439  T3,
440  T4,
441  T5,
442  Ts...>
443 {
444 };
445 
446 // If there are at least 12 entries, check the first 8 to quickly narrow down
447 template <bool OneInFirst8Matches, vtkm::IdComponent NumSearched, typename Target, typename... Ts>
448 struct FindFirstOfSplit8;
449 
450 template <vtkm::IdComponent NumSearched,
451  typename Target,
452  typename T0,
453  typename T1,
454  typename T2,
455  typename T3,
456  typename T4,
457  typename T5,
458  typename T6,
459  typename T7,
460  typename... Ts>
461 struct FindFirstOfSplit8<true, NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, Ts...>
462  : FindFirstOfSplit4<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
463  std::is_same<Target, T2>::value || std::is_same<Target, T3>::value),
464  NumSearched,
465  Target,
466  T0,
467  T1,
468  T2,
469  T3,
470  T4,
471  T5,
472  T6,
473  T7>
474 {
475 };
476 
477 template <vtkm::IdComponent NumSearched,
478  typename Target,
479  typename T0,
480  typename T1,
481  typename T2,
482  typename T3,
483  typename T4,
484  typename T5,
485  typename T6,
486  typename T7,
487  typename... Ts>
488 struct FindFirstOfSplit8<false, NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, Ts...>
489  : FindFirstOfType<NumSearched + 8, Target, Ts...>
490 {
491 };
492 
493 template <vtkm::IdComponent NumSearched,
494  typename Target,
495  typename T0,
496  typename T1,
497  typename T2,
498  typename T3,
499  typename T4,
500  typename T5,
501  typename T6,
502  typename T7,
503  typename T8,
504  typename T9,
505  typename T10,
506  typename T11,
507  typename... Ts>
508 struct FindFirstOfType<NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Ts...>
509  : FindFirstOfSplit8<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
510  std::is_same<Target, T2>::value || std::is_same<Target, T3>::value ||
511  std::is_same<Target, T4>::value || std::is_same<Target, T5>::value ||
512  std::is_same<Target, T6>::value || std::is_same<Target, T7>::value),
513  NumSearched,
514  Target,
515  T0,
516  T1,
517  T2,
518  T3,
519  T4,
520  T5,
521  T6,
522  T7,
523  T8,
524  T9,
525  T10,
526  T11,
527  Ts...>
528 {
529 };
530 
531 template <typename List, typename Target>
532 struct ListIndexOfImpl;
533 template <typename... Ts, typename Target>
534 struct ListIndexOfImpl<vtkm::List<Ts...>, Target>
535 {
536  using type = std::integral_constant<vtkm::IdComponent, FindFirstOfType<0, Target, Ts...>::value>;
537 };
538 template <typename Target>
539 struct ListIndexOfImpl<vtkm::ListUniversal, Target>
540 {
541  VTKM_STATIC_ASSERT_MSG((std::is_same<Target, void>::value && std::is_same<Target, int>::value),
542  "Cannot get indices in a universal list.");
543 };
544 
545 } // namespace detail
546 
552 template <typename List, typename T>
553 using ListIndexOf = typename detail::ListIndexOfImpl<List, T>::type;
554 
555 namespace detail
556 {
557 
558 template <typename List, typename T>
559 struct ListHasImpl
560 {
561  using type = std::integral_constant<bool, (vtkm::ListIndexOf<List, T>::value >= 0)>;
562 };
563 
564 template <typename T>
565 struct ListHasImpl<vtkm::ListUniversal, T>
566 {
567  using type = std::true_type;
568 };
569 
570 } // namespace detail
571 
576 template <typename List, typename T>
577 using ListHas = typename detail::ListHasImpl<List, T>::type;
578 
579 namespace detail
580 {
581 
582 template <typename T, template <typename> class Target>
583 struct ListTransformImpl;
584 template <typename... Ts, template <typename> class Target>
585 struct ListTransformImpl<vtkm::List<Ts...>, Target>
586 {
587  using type = vtkm::List<Target<Ts>...>;
588 };
589 // Cannot transform the universal list.
590 template <template <typename> class Target>
591 struct ListTransformImpl<vtkm::ListUniversal, Target>;
592 
593 } // namespace detail
594 
597 template <typename List, template <typename> class Transform>
598 using ListTransform = typename detail::ListTransformImpl<List, Transform>::type;
599 
600 namespace detail
601 {
602 
603 #if defined(VTKM_MSVC) && (_MSC_VER < 1920)
604 // Special (inefficient) implementation for MSVC 2017, which has an ICE for the regular version
605 
606 template <typename Passed,
607  typename Next,
608  bool Remove,
609  typename Rest,
610  template <typename>
611  class Predicate>
612 struct ListRemoveIfCheckNext;
613 
614 template <typename Passed, typename Rest, template <typename> class Predicate>
615 struct ListRemoveIfGetNext;
616 
617 template <typename Passed, typename Next, typename Rest, template <typename> class Predicate>
618 struct ListRemoveIfCheckNext<Passed, Next, true, Rest, Predicate>
619 {
620  using type = typename ListRemoveIfGetNext<Passed, Rest, Predicate>::type;
621 };
622 
623 template <typename... PassedTs, typename Next, typename Rest, template <typename> class Predicate>
624 struct ListRemoveIfCheckNext<vtkm::List<PassedTs...>, Next, false, Rest, Predicate>
625 {
626  using type = typename ListRemoveIfGetNext<vtkm::List<PassedTs..., Next>, Rest, Predicate>::type;
627 };
628 
629 template <typename Passed, typename Next, typename... RestTs, template <typename> class Predicate>
630 struct ListRemoveIfGetNext<Passed, vtkm::List<Next, RestTs...>, Predicate>
631 {
632  using type = typename ListRemoveIfCheckNext<Passed,
633  Next,
634  Predicate<Next>::value,
635  vtkm::List<RestTs...>,
636  Predicate>::type;
637 };
638 
639 template <typename Passed, template <typename> class Predicate>
640 struct ListRemoveIfGetNext<Passed, vtkm::List<>, Predicate>
641 {
642  using type = Passed;
643 };
644 
645 template <typename L, template <typename> class Predicate>
646 struct ListRemoveIfImpl
647 {
648  using type = typename ListRemoveIfGetNext<vtkm::List<>, L, Predicate>::type;
649 };
650 
651 #else
652 
653 template <typename L, template <typename> class Predicate>
654 struct ListRemoveIfImpl;
655 
656 template <typename... Ts, template <typename> class Predicate>
657 struct ListRemoveIfImpl<vtkm::List<Ts...>, Predicate>
658 {
659  using type = typename ListAppendImpl<
660  std::conditional_t<Predicate<Ts>::value, vtkm::List<>, vtkm::List<Ts>>...>::type;
661 };
662 
663 #endif
664 
665 } // namespace detail
666 
679 template <typename List, template <typename> class Predicate>
680 using ListRemoveIf = typename detail::ListRemoveIfImpl<List, Predicate>::type;
681 
682 namespace detail
683 {
684 
685 template <typename List1, typename List2>
686 struct ListIntersectImpl
687 {
688  template <typename T>
689  struct Predicate
690  {
691  static constexpr bool value = !vtkm::ListHas<List1, T>::value;
692  };
693 
695 };
696 
697 template <typename List1>
698 struct ListIntersectImpl<List1, vtkm::ListUniversal>
699 {
700  using type = List1;
701 };
702 template <typename List2>
703 struct ListIntersectImpl<vtkm::ListUniversal, List2>
704 {
705  using type = List2;
706 };
707 template <>
708 struct ListIntersectImpl<vtkm::ListUniversal, vtkm::ListUniversal>
709 {
710  using type = vtkm::ListUniversal;
711 };
712 
713 } // namespace detail
714 
717 template <typename List1, typename List2>
718 using ListIntersect = typename detail::ListIntersectImpl<List1, List2>::type;
719 
724 template <typename Functor, typename... Ts, typename... Args>
725 VTKM_EXEC_CONT void ListForEach(Functor&& f, vtkm::List<Ts...>, Args&&... args)
726 {
728  "Cannot call ListFor on vtkm::ListUniversal.");
729  auto init_list = { (f(Ts{}, std::forward<Args>(args)...), false)... };
730  (void)init_list;
731 }
732 template <typename Functor, typename... Args>
733 VTKM_EXEC_CONT void ListForEach(Functor&&, vtkm::ListEmpty, Args&&...)
734 {
735  // No types to run functor on.
736 }
737 
738 namespace detail
739 {
740 
741 template <typename List1, typename List2>
742 struct ListCrossImpl;
743 
744 template <typename... T0s, typename... T1s>
745 struct ListCrossImpl<vtkm::List<T0s...>, vtkm::List<T1s...>>
746 {
747  template <typename T>
748  struct Predicate
749  {
750  using type = vtkm::List<vtkm::List<T, T1s>...>;
751  };
752 
754 };
755 
756 } // namespace detail
757 
762 template <typename List1, typename List2>
763 using ListCross = typename detail::ListCrossImpl<List1, List2>::type;
764 
765 namespace detail
766 {
767 
768 template <typename L, template <typename T1, typename T2> class Operator, typename Result>
769 struct ListReduceImpl;
770 
771 template <template <typename T1, typename T2> class Operator, typename Result>
772 struct ListReduceImpl<vtkm::List<>, Operator, Result>
773 {
774  using type = Result;
775 };
776 
777 template <typename T0,
778  typename... Ts,
779  template <typename O1, typename O2>
780  class Operator,
781  typename Result>
782 struct ListReduceImpl<vtkm::List<T0, Ts...>, Operator, Result>
783 {
784  using type = typename ListReduceImpl<vtkm::List<Ts...>, Operator, Operator<Result, T0>>::type;
785 };
786 
787 template <typename T0,
788  typename T1,
789  typename T2,
790  typename T3,
791  typename T4,
792  typename T5,
793  typename T6,
794  typename T7,
795  typename T8,
796  typename... Ts,
797  template <typename O1, typename O2>
798  class Operator,
799  typename Result>
800 struct ListReduceImpl<vtkm::List<T0, T1, T2, T3, T4, T5, T6, T7, T8, Ts...>, Operator, Result>
801 {
802  using type = typename ListReduceImpl<
803  vtkm::List<T8, Ts...>,
804  Operator,
805  typename ListReduceImpl<vtkm::List<T0, T1, T2, T3, T4, T5, T6, T7>, Operator, Result>::type>::
806  type;
807 };
808 
809 } // namespace detail
810 
818 template <typename List, template <typename T1, typename T2> class Operator, typename Initial>
819 using ListReduce = typename detail::ListReduceImpl<List, Operator, Initial>::type;
820 
841 template <typename List, template <typename> class Predicate = vtkm::internal::meta::Identity>
842 using ListAll =
843  vtkm::ListReduce<vtkm::ListTransform<List, Predicate>, vtkm::internal::meta::And, std::true_type>;
844 
866 template <typename List, template <typename> class Predicate = vtkm::internal::meta::Identity>
867 using ListAny =
868  vtkm::ListReduce<vtkm::ListTransform<List, Predicate>, vtkm::internal::meta::Or, std::false_type>;
869 
870 #undef VTKM_CHECK_LIST_SIZE
871 
872 } // namespace vtkm
873 
874 #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:553
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::ListAppend
typename detail::ListAppendImpl< Lists... >::type ListAppend
Concatinates a set of lists into a single list.
Definition: List.h:281
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:138
vtkm::ListCross
typename detail::ListCrossImpl< List1, List2 >::type ListCross
Generates a list that is the cross product of two input lists.
Definition: List.h:763
vtkm::ListEmpty
vtkm::List<> ListEmpty
A convenience type for an empty list.
Definition: List.h:88
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:680
vtkm::ListSize
typename detail::ListSizeImpl< List >::type ListSize
Becomes an std::integral_constant containing the number of types in a list.
Definition: List.h:114
vtkm::ListReduce
typename detail::ListReduceImpl< List, Operator, Initial >::type ListReduce
Reduces a list to a single type using an operator.
Definition: List.h:819
vtkm::ListAt
typename detail::ListAtImpl< List, Index >::type ListAt
Finds the type at the given index.
Definition: List.h:350
vtkm::ListUniversal
vtkm::List< detail::UniversalTypeTag > ListUniversal
A special type for a list that represents holding all potential values.
Definition: List.h:94
vtkm::ListFill
typename detail::ListFillImpl< T, N >::type ListFill
Returns a list filled with N copies of type T.
Definition: List.h:310
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:598
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:577
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
Index
int Index
Definition: ChooseCudaDevice.h:87
vtkm::ListForEach
void ListForEach(Functor &&f, vtkm::List< Ts... >, Args &&... args)
For each typename represented by the list, call the functor with a default instance of that type.
Definition: List.h:725
vtkm::List
A template used to hold a list of types.
Definition: List.h:39
vtkm::ListIntersect
typename detail::ListIntersectImpl< List1, List2 >::type ListIntersect
Constructs a list containing types present in all lists.
Definition: List.h:718
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:843
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:868
VTKM_SUPPRESS_EXEC_WARNINGS
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53