RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
forall.hpp
Go to the documentation of this file.
1 
45 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
46 // Copyright (c) Lawrence Livermore National Security, LLC and other
47 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
48 // files for dates and other details. No copyright assignment is required
49 // to contribute to RAJA.
50 //
51 // SPDX-License-Identifier: (BSD-3-Clause)
52 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
53 
54 #ifndef RAJA_forall_generic_HPP
55 #define RAJA_forall_generic_HPP
56 
57 #include "RAJA/config.hpp"
58 
59 #include <functional>
60 #include <iterator>
61 #include <type_traits>
62 
64 
67 
68 #include "RAJA/index/IndexSet.hpp"
71 
72 #include "RAJA/util/concepts.hpp"
73 #include "RAJA/util/Span.hpp"
74 #include "RAJA/util/types.hpp"
75 
77 
81 
83 #include "RAJA/util/plugins.hpp"
84 
85 #include "RAJA/util/resource.hpp"
86 
87 namespace RAJA
88 {
89 
90 //
92 //
93 // Iteration over generic iterators
94 //
96 //
97 
98 namespace detail
99 {
101 template<typename Range, typename Body, typename IndexT>
103 {
104  using index_type = typename std::decay<IndexT>::type;
105  typename std::decay<Body>::type body;
106  using container_type = typename std::decay<Range>::type;
107  typename container_type::iterator begin_it;
109 
110  icount_adapter(Range const& r, Body const& b, IndexT icount_)
111  : body {b},
112  icount {icount_}
113  {
114  using std::begin;
115  begin_it = begin(r);
116  }
117 
119  template<typename T>
120  RAJA_HOST_DEVICE void operator()(T const& i) const
121  {
122  body(static_cast<index_type>(i + icount), begin_it[i]);
123  }
124 };
125 
127 {
128  template<typename T,
129  typename ExecPol,
130  typename Body,
131  typename Res,
132  typename ForallParams>
133  RAJA_INLINE camp::resources::EventProxy<Res> operator()(T const&,
134  ExecPol,
135  Body,
136  Res,
137  ForallParams) const;
138 };
139 
141 {
142  constexpr CallForallIcount(int s);
143 
144  template<typename T,
145  typename ExecPol,
146  typename Body,
147  typename Res,
148  typename ForallParams>
149  RAJA_INLINE camp::resources::EventProxy<Res> operator()(T const&,
150  ExecPol,
151  Body,
152  Res,
153  ForallParams) const;
154 
155  const int start;
156 };
157 } // namespace detail
158 
166 namespace wrap
167 {
168 
169 
177 template<typename Res,
178  typename ExecutionPolicy,
179  typename Container,
180  typename LoopBody,
181  typename ForallParams>
182 RAJA_INLINE concepts::enable_if_t<
183  RAJA::resources::EventProxy<Res>,
184  concepts::negate<type_traits::is_indexset_policy<ExecutionPolicy>>,
185  type_traits::is_range<Container>>
186 forall(Res r,
187  ExecutionPolicy&& p,
188  Container&& c,
189  LoopBody&& loop_body,
190  ForallParams&& f_params)
191 {
192  RAJA_FORCEINLINE_RECURSIVE
193  return forall_impl(
194  r, std::forward<ExecutionPolicy>(p), std::forward<Container>(c),
195  std::forward<LoopBody>(loop_body), std::forward<ForallParams>(f_params));
196 }
197 
198 template<typename Res,
199  typename ExecutionPolicy,
200  typename Container,
201  typename LoopBody>
202 RAJA_INLINE concepts::enable_if_t<
203  RAJA::resources::EventProxy<Res>,
204  concepts::negate<type_traits::is_indexset_policy<ExecutionPolicy>>,
205  type_traits::is_range<Container>>
206 forall(Res r, ExecutionPolicy&& p, Container&& c, LoopBody&& loop_body)
207 {
208  RAJA_FORCEINLINE_RECURSIVE
209  return forall_impl(
210  r, std::forward<ExecutionPolicy>(p), std::forward<Container>(c),
211  std::forward<LoopBody>(loop_body), expt::get_empty_forall_param_pack());
212 }
213 
221 template<typename Res,
222  typename ExecutionPolicy,
223  typename Container,
224  typename IndexType,
225  typename LoopBody,
226  typename ForallParams>
227 RAJA_INLINE resources::EventProxy<Res> forall_Icount(Res r,
228  ExecutionPolicy&& p,
229  Container&& c,
230  IndexType&& icount,
231  LoopBody&& loop_body,
232  ForallParams&& f_params)
233 {
234  using std::begin;
235  using std::distance;
236  using std::end;
237  auto range = RangeSegment(0, distance(begin(c), end(c)));
239  icount);
241  RAJA_FORCEINLINE_RECURSIVE
242  return forall_impl(r, std::forward<ExecutionPolicy>(p), range, adapted,
243  std::forward<ForallParams>(f_params));
244 }
245 
255 template<typename Res,
256  typename SegmentIterPolicy,
257  typename SegmentExecPolicy,
258  typename... SegmentTypes,
259  typename LoopBody,
260  typename ForallParams>
261 RAJA_INLINE resources::EventProxy<Res> forall_Icount(
262  Res r,
264  const TypedIndexSet<SegmentTypes...>& iset,
265  LoopBody loop_body,
266  ForallParams f_params)
267 {
268  // no need for icount variant here
269  auto segIterRes =
271  wrap::forall(segIterRes, SegmentIterPolicy(), iset, [=, &r](int segID) {
272  iset.segmentCall(segID,
273  detail::CallForallIcount(iset.getStartingIcount(segID)),
274  SegmentExecPolicy(), loop_body, r, f_params);
275  });
276  return RAJA::resources::EventProxy<Res>(r);
277 }
278 
279 template<typename Res,
280  typename SegmentIterPolicy,
281  typename SegmentExecPolicy,
282  typename LoopBody,
283  typename... SegmentTypes,
284  typename ForallParams>
285 RAJA_INLINE resources::EventProxy<Res> forall(
286  Res r,
288  const TypedIndexSet<SegmentTypes...>& iset,
289  LoopBody loop_body,
290  ForallParams f_params)
291 {
292  auto segIterRes =
294  wrap::forall(segIterRes, SegmentIterPolicy(), iset, [=, &r](int segID) {
295  iset.segmentCall(segID, detail::CallForall {}, SegmentExecPolicy(),
296  loop_body, r, f_params);
297  });
298  return RAJA::resources::EventProxy<Res>(r);
299 }
300 
301 } // end namespace wrap
302 
312 inline namespace policy_by_value_interface
313 {
314 
315 
323 template<typename ExecutionPolicy,
324  typename Res,
325  typename IdxSet,
326  typename... Params>
327 RAJA_INLINE resources::EventProxy<Res> forall_Icount(ExecutionPolicy&& p,
328  Res r,
329  IdxSet&& c,
330  Params&&... params)
331 {
333  "Expected a TypedIndexSet but did not get one. Are you using "
334  "a TypedIndexSet policy by mistake?");
335 
336  std::string kernel_name =
337  expt::get_kernel_name(std::forward<Params>(params)...);
338  auto f_params = expt::make_forall_param_pack(std::forward<Params>(params)...);
339  auto&& loop_body = expt::get_lambda(std::forward<Params>(params)...);
340  // expt::check_forall_optional_args(loop_body, f_params);
341 
342  util::PluginContext context {
343  util::make_context<camp::decay<ExecutionPolicy>>(std::move(kernel_name))};
345 
347  auto body = trigger_updates_before(loop_body);
348 
350 
352 
353  RAJA::resources::EventProxy<Res> e =
354  wrap::forall_Icount(r, std::forward<ExecutionPolicy>(p),
355  std::forward<IdxSet>(c), std::move(body), f_params);
356 
358  return e;
359 }
360 
361 template<typename ExecutionPolicy,
362  typename IdxSet,
363  typename LoopBody,
364  typename Res = typename resources::get_resource<ExecutionPolicy>::type>
365 RAJA_INLINE resources::EventProxy<Res> forall_Icount(ExecutionPolicy&& p,
366  IdxSet&& c,
367  LoopBody&& loop_body)
368 {
369  auto r = Res::get_default();
371  std::forward<ExecutionPolicy>(p), r, std::forward<IdxSet>(c),
372  std::forward<LoopBody>(loop_body));
373 }
374 
382 template<typename ExecutionPolicy,
383  typename Res,
384  typename IdxSet,
385  typename... Params>
386 RAJA_INLINE concepts::enable_if_t<
387  resources::EventProxy<Res>,
388  type_traits::is_indexset_policy<ExecutionPolicy>>
389 forall(ExecutionPolicy&& p, Res r, IdxSet&& c, Params&&... params)
390 {
392  "Expected a TypedIndexSet but did not get one. Are you using "
393  "a TypedIndexSet policy by mistake?");
394 
395  auto f_params = expt::make_forall_param_pack(std::forward<Params>(params)...);
396 
397  std::string kernel_name =
398  expt::get_kernel_name(std::forward<Params>(params)...);
399  auto&& loop_body = expt::get_lambda(std::forward<Params>(params)...);
400  expt::check_forall_optional_args(loop_body, f_params);
401 
402  util::PluginContext context {
403  util::make_context<camp::decay<ExecutionPolicy>>(std::move(kernel_name))};
405 
407  auto body = trigger_updates_before(loop_body);
408 
410 
412 
413  resources::EventProxy<Res> e =
414  wrap::forall(r, std::forward<ExecutionPolicy>(p), std::forward<IdxSet>(c),
415  std::move(body), f_params);
416 
418  return e;
419 }
420 
421 template<typename ExecutionPolicy,
422  typename IdxSet,
423  typename LoopBody,
424  typename Res = typename resources::get_resource<ExecutionPolicy>::type>
425 RAJA_INLINE concepts::enable_if_t<
426  resources::EventProxy<Res>,
427  type_traits::is_indexset_policy<ExecutionPolicy>>
428 forall(ExecutionPolicy&& p, IdxSet&& c, LoopBody&& loop_body)
429 {
430  auto r = Res::get_default();
432  std::forward<ExecutionPolicy>(p), r, std::forward<IdxSet>(c),
433  std::forward<LoopBody>(loop_body));
434 }
435 
443 template<typename ExecutionPolicy,
444  typename Container,
445  typename LoopBody,
446  typename Res = typename resources::get_resource<ExecutionPolicy>::type>
447 RAJA_INLINE concepts::enable_if_t<resources::EventProxy<Res>,
448  type_traits::is_multi_policy<ExecutionPolicy>,
449  type_traits::is_range<Container>>
450 forall(ExecutionPolicy&& p, Container&& c, LoopBody&& loop_body)
451 {
452  static_assert(type_traits::is_random_access_range<Container>::value,
453  "Container does not model RandomAccessIterator");
454 
455  auto r = Res::get_default();
456 
457  // plugins handled in multipolicy policy_invoker
458  return forall_impl(r, std::forward<ExecutionPolicy>(p),
459  std::forward<Container>(c),
460  std::forward<LoopBody>(loop_body));
461 }
462 
470 template<typename ExecutionPolicy,
471  typename Res,
472  typename Container,
473  typename IndexType,
474  typename FirstParam,
475  typename... Params>
476 RAJA_INLINE concepts::enable_if_t<resources::EventProxy<Res>,
477  type_traits::is_range<Container>,
478  type_traits::is_integral<IndexType>>
479 forall_Icount(ExecutionPolicy&& p,
480  Res r,
481  Container&& c,
482  IndexType icount,
483  FirstParam&& first,
484  Params&&... params)
485 {
486  static_assert(type_traits::is_random_access_range<Container>::value,
487  "Container does not model RandomAccessIterator");
488 
489  auto f_params = expt::make_forall_param_pack(std::forward<FirstParam>(first),
490  std::forward<Params>(params)...);
491  std::string kernel_name =
492  expt::get_kernel_name(std::forward<Params>(params)...);
493  auto&& loop_body = expt::get_lambda(std::forward<FirstParam>(first),
494  std::forward<Params>(params)...);
495  // expt::check_forall_optional_args(loop_body, f_params);
496 
497  util::PluginContext context {
498  util::make_context<camp::decay<ExecutionPolicy>>(std::move(kernel_name))};
500 
502  auto body = trigger_updates_before(loop_body);
503 
505 
507 
508  resources::EventProxy<Res> e = wrap::forall_Icount(
509  r, std::forward<ExecutionPolicy>(p), std::forward<Container>(c), icount,
510  std::move(body), f_params);
511 
513  return e;
514 }
515 
516 template<typename ExecutionPolicy,
517  typename Container,
518  typename IndexType,
519  typename LoopBody,
520  typename Res = typename resources::get_resource<ExecutionPolicy>::type>
521 RAJA_INLINE concepts::enable_if_t<
522  resources::EventProxy<Res>,
523  type_traits::is_range<Container>,
524  concepts::negate<type_traits::is_indexset_policy<ExecutionPolicy>>,
525  type_traits::is_integral<IndexType>>
526 forall_Icount(ExecutionPolicy&& p,
527  Container&& c,
528  IndexType icount,
529  LoopBody&& loop_body)
530 {
531  auto r = Res::get_default();
533  std::forward<ExecutionPolicy>(p), r, std::forward<Container>(c), icount,
534  std::forward<LoopBody>(loop_body));
535 }
536 
545 template<typename ExecutionPolicy,
546  typename Res,
547  typename Container,
548  typename... Params>
549 RAJA_INLINE concepts::enable_if_t<
550  resources::EventProxy<Res>,
551  concepts::negate<type_traits::is_indexset_policy<ExecutionPolicy>>,
552  concepts::negate<type_traits::is_multi_policy<ExecutionPolicy>>,
553  type_traits::is_range<Container>>
554 forall(ExecutionPolicy&& p, Res r, Container&& c, Params&&... params)
555 {
556  static_assert(type_traits::is_random_access_range<Container>::value,
557  "Container does not model RandomAccessIterator");
558 
559  auto f_params = expt::make_forall_param_pack(std::forward<Params>(params)...);
560 
561  std::string kernel_name =
562  expt::get_kernel_name(std::forward<Params>(params)...);
563  auto&& loop_body = expt::get_lambda(std::forward<Params>(params)...);
564 
565  expt::check_forall_optional_args(loop_body, f_params);
566 
567  util::PluginContext context {
568  util::make_context<camp::decay<ExecutionPolicy>>(std::move(kernel_name))};
570 
572  auto body = trigger_updates_before(loop_body);
573 
575 
577 
578  resources::EventProxy<Res> e =
579  wrap::forall(r, std::forward<ExecutionPolicy>(p),
580  std::forward<Container>(c), std::move(body), f_params);
581 
583  return e;
584 }
585 
586 template<typename ExecutionPolicy,
587  typename Container,
588  typename LoopBody,
589  typename Res = typename resources::get_resource<ExecutionPolicy>::type>
590 RAJA_INLINE concepts::enable_if_t<
591  resources::EventProxy<Res>,
592  concepts::negate<type_traits::is_indexset_policy<ExecutionPolicy>>,
593  concepts::negate<type_traits::is_multi_policy<ExecutionPolicy>>,
594  type_traits::is_range<Container>>
595 forall(ExecutionPolicy&& p, Container&& c, LoopBody&& loop_body)
596 {
597  auto r = Res::get_default();
599  std::forward<ExecutionPolicy>(p), r, std::forward<Container>(c),
600  std::forward<LoopBody>(loop_body));
601 }
602 
603 } // namespace policy_by_value_interface
604 
610 template<typename ExecutionPolicy,
611  typename... Args,
612  typename Res = typename resources::get_resource<ExecutionPolicy>::type>
613 RAJA_INLINE resources::EventProxy<Res> forall(Args&&... args)
614 {
615  Res r = Res::get_default();
617  std::forward<Args>(args)...);
618 }
619 
620 template<typename ExecutionPolicy, typename Res, typename... Args>
621 RAJA_INLINE concepts::enable_if_t<resources::EventProxy<Res>,
622  type_traits::is_resource<Res>>
623 forall(Res r, Args&&... args)
624 {
626  std::forward<Args>(args)...);
627 }
628 
635 template<typename ExecutionPolicy,
636  typename... Args,
637  typename Res = typename resources::get_resource<ExecutionPolicy>::type>
638 RAJA_INLINE resources::EventProxy<Res> forall_Icount(Args&&... args)
639 {
640  Res r = Res::get_default();
642  ExecutionPolicy(), r, std::forward<Args>(args)...);
643 }
644 
645 template<typename ExecutionPolicy, typename Res, typename... Args>
646 RAJA_INLINE concepts::enable_if_t<resources::EventProxy<Res>,
647  type_traits::is_resource<Res>>
648 forall_Icount(Res r, Args&&... args)
649 {
651  ExecutionPolicy(), r, std::forward<Args>(args)...);
652 }
653 
654 namespace detail
655 {
656 
657 template<typename T,
658  typename ExecutionPolicy,
659  typename LoopBody,
660  typename Res,
661  typename ForallParams>
662 RAJA_INLINE camp::resources::EventProxy<Res> CallForall::operator()(
663  T const& segment,
664  ExecutionPolicy,
665  LoopBody body,
666  Res r,
667  ForallParams f_params) const
668 {
669  // this is only called inside a region, use impl
671  RAJA_FORCEINLINE_RECURSIVE
672  return forall_impl(r, ExecutionPolicy(), segment, body, f_params);
673 }
674 
675 constexpr CallForallIcount::CallForallIcount(int s) : start(s) {}
676 
677 template<typename T,
678  typename ExecutionPolicy,
679  typename LoopBody,
680  typename Res,
681  typename ForallParams>
682 RAJA_INLINE camp::resources::EventProxy<Res> CallForallIcount::operator()(
683  T const& segment,
684  ExecutionPolicy,
685  LoopBody body,
686  Res r,
687  ForallParams f_params) const
688 {
689  // go through wrap to unwrap icount
690  return wrap::forall_Icount(r, ExecutionPolicy(), segment, start, body,
691  f_params);
692 }
693 
694 } // namespace detail
695 
696 //
697 // Experimental support for dynamic policy selection
698 //
699 // Future directions:
700 // - Tuple of resources one for each platform
701 // - Returns a generic event proxy only if a resource is provided
702 // avoids overhead of constructing a typed erased resource
703 //
704 template<camp::idx_t IDX, typename POLICY_LIST>
706 {
707  template<typename SEGMENT, typename... PARAMS>
708  static void invoke_forall(const int pol,
709  SEGMENT const& seg,
710  PARAMS&&... params)
711  {
712  if (IDX == pol)
713  {
714  using t_pol = typename camp::at<POLICY_LIST, camp::num<IDX>>::type;
715  RAJA::forall<t_pol>(seg, params...);
716  return;
717  }
719  }
720 
721  template<typename SEGMENT, typename... PARAMS>
722  static resources::EventProxy<resources::Resource> invoke_forall(
723  RAJA::resources::Resource r,
724  const int pol,
725  SEGMENT const& seg,
726  PARAMS&&... params)
727  {
728 
729  using t_pol = typename camp::at<POLICY_LIST, camp::num<IDX>>::type;
730  using resource_type = typename resources::get_resource<t_pol>::type;
731 
732  if (IDX == pol)
733  {
734  RAJA::forall<t_pol>(r.get<resource_type>(), seg, params...);
735 
736  // Return a generic event proxy from r,
737  // because forall returns a typed event proxy
738  return {r};
739  }
740 
742  params...);
743  }
744 };
745 
746 template<typename POLICY_LIST>
747 struct dynamic_helper<0, POLICY_LIST>
748 {
749  template<typename SEGMENT, typename... PARAMS>
750  static void invoke_forall(const int pol,
751  SEGMENT const& seg,
752  PARAMS&&... params)
753  {
754  if (0 == pol)
755  {
756  using t_pol = typename camp::at<POLICY_LIST, camp::num<0>>::type;
757  RAJA::forall<t_pol>(seg, params...);
758  return;
759  }
760  RAJA_ABORT_OR_THROW("Policy enum not supported ");
761  }
762 
763  template<typename SEGMENT, typename... PARAMS>
764  static resources::EventProxy<resources::Resource> invoke_forall(
765  RAJA::resources::Resource r,
766  const int pol,
767  SEGMENT const& seg,
768  PARAMS&&... params)
769  {
770  if (pol != 0) RAJA_ABORT_OR_THROW("Policy value out of range ");
771 
772  using t_pol = typename camp::at<POLICY_LIST, camp::num<0>>::type;
773  using resource_type = typename resources::get_resource<t_pol>::type;
774 
775  RAJA::forall<t_pol>(r.get<resource_type>(), seg, params...);
776 
777  // Return a generic event proxy from r,
778  // because forall returns a typed event proxy
779  return {r};
780  }
781 };
782 
783 template<typename POLICY_LIST, typename SEGMENT, typename... PARAMS>
784 void dynamic_forall(const int pol, SEGMENT const& seg, PARAMS&&... params)
785 {
786  constexpr int N = camp::size<POLICY_LIST>::value;
787  static_assert(N > 0, "RAJA policy list must not be empty");
788 
789  if (pol > N - 1)
790  {
791  RAJA_ABORT_OR_THROW("Policy enum not supported");
792  }
794 }
795 
796 template<typename POLICY_LIST, typename SEGMENT, typename... PARAMS>
797 resources::EventProxy<resources::Resource> dynamic_forall(
798  RAJA::resources::Resource r,
799  const int pol,
800  SEGMENT const& seg,
801  PARAMS&&... params)
802 {
803  constexpr int N = camp::size<POLICY_LIST>::value;
804  static_assert(N > 0, "RAJA policy list must not be empty");
805 
806  if (pol > N - 1)
807  {
808  RAJA_ABORT_OR_THROW("Policy value out of range");
809  }
810 
812  params...);
813 }
814 
815 
816 } // namespace RAJA
817 
818 
819 #endif // closing endif for header file include guard
RAJA header file defining index set classes.
Header file for RAJA iterator constructs.
Header file containing definition of RAJA list segment class.
RAJA wrapper for "multi-policy" and dynamic policy selection.
Header file for basic RAJA policy mechanics.
Header file containing definitions of RAJA range segment classes.
Header file for RAJA span constructs.
Definition: IndexSet.hpp:52
Header file for RAJA concept definitions.
RAJA_HOST_DEVICE void RAJA_ABORT_OR_THROW(const char *str)
Definition: macros.hpp:143
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
#define RAJA_SUPPRESS_HD_WARN
Definition: macros.hpp:68
Args args
Definition: WorkRunner.hpp:212
std::string get_kernel_name(Args &&... args)
Definition: forall.hpp:442
constexpr void check_forall_optional_args(Lambda &&l, ForallParams &fpp)
Definition: forall.hpp:557
constexpr auto && get_lambda(Args &&... args)
Definition: forall.hpp:396
constexpr auto make_forall_param_pack(Args &&... args)
Definition: forall.hpp:377
RAJA_INLINE concepts::enable_if_t< resources::EventProxy< resources::Host >, expt::type_traits::is_ForallParamPack< ForallParam > > forall_impl(resources::Host host_res, const seq_exec &pol, Iterable &&iter, Func &&body, ForallParam f_params)
Definition: forall.hpp:62
RAJA_INLINE concepts::enable_if_t< resources::EventProxy< resources::Host >, expt::type_traits::is_ForallParamPack< ForallParam >, expt::type_traits::is_ForallParamPack_empty< ForallParam > > forall_impl(resources::Host host_res, const simd_exec &, Iterable &&iter, Func &&body, ForallParam)
Definition: forall.hpp:81
RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_indexset_policy< ExecutionPolicy > > forall(ExecutionPolicy &&p, Res r, IdxSet &&c, Params &&... params)
Generic dispatch over index set with a value-based policy.
Definition: forall.hpp:389
RAJA_INLINE resources::EventProxy< Res > forall_Icount(ExecutionPolicy &&p, Res r, IdxSet &&c, Params &&... params)
Generic dispatch over index set with icount with a value-based policy.
Definition: forall.hpp:327
RAJA_INLINE void callPreLaunchPlugins(const PluginContext &p)
Definition: plugins.hpp:56
RAJA_INLINE void callPostCapturePlugins(const PluginContext &p)
Definition: plugins.hpp:46
RAJA_INLINE auto trigger_updates_before(T &&item) -> typename std::remove_reference< T >::type
Definition: plugins.hpp:29
RAJA_INLINE void callPostLaunchPlugins(const PluginContext &p)
Definition: plugins.hpp:66
RAJA_INLINE void callPreCapturePlugins(const PluginContext &p)
Definition: plugins.hpp:36
RAJA_INLINE concepts::enable_if_t< RAJA::resources::EventProxy< Res >, concepts::negate< type_traits::is_indexset_policy< ExecutionPolicy > >, type_traits::is_range< Container > > forall(Res r, ExecutionPolicy &&p, Container &&c, LoopBody &&loop_body, ForallParams &&f_params)
Generic dispatch over containers with a value-based policy.
Definition: forall.hpp:186
RAJA_INLINE resources::EventProxy< Res > forall_Icount(Res r, ExecutionPolicy &&p, Container &&c, IndexType &&icount, LoopBody &&loop_body, ForallParams &&f_params)
Generic dispatch over containers with a value-based policy with icount.
Definition: forall.hpp:227
Definition: AlignedRangeIndexSetBuilders.cpp:35
TypedRangeSegment< Index_type > RangeSegment
Alias for TypedRangeSegment<Index_type>
Definition: RangeSegment.hpp:528
RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_resource< Res > > forall_Icount(Res r, Args &&... args)
Definition: forall.hpp:648
std::ptrdiff_t Index_type
Definition: types.hpp:226
camp::list< internal::LambdaArg< internal::lambda_arg_param_t, args >... > Params
Definition: Lambda.hpp:95
auto & body
Definition: launch.hpp:177
void dynamic_forall(const int pol, SEGMENT const &seg, PARAMS &&... params)
Definition: forall.hpp:784
RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_resource< Res > > forall(Res r, Args &&... args)
Definition: forall.hpp:623
Internal header for RAJA forall "BED" macros (i.e., loop bounds 'BED' --> begin, end,...
Header file containing RAJA index set and segment iteration template methods for sequential execution...
Header file for RAJA resource definitions.
Definition: forall.hpp:141
constexpr CallForallIcount(int s)
Definition: forall.hpp:675
RAJA_INLINE camp::resources::EventProxy< Res > operator()(T const &, ExecPol, Body, Res, ForallParams) const
const int start
Definition: forall.hpp:155
Definition: forall.hpp:127
RAJA_INLINE camp::resources::EventProxy< Res > operator()(T const &, ExecPol, Body, Res, ForallParams) const
Adapter to replace specific implementations for the icount variants.
Definition: forall.hpp:103
RAJA_SUPPRESS_HD_WARN RAJA_HOST_DEVICE void operator()(T const &i) const
Definition: forall.hpp:120
icount_adapter(Range const &r, Body const &b, IndexT icount_)
Definition: forall.hpp:110
Index_type icount
Definition: forall.hpp:108
container_type::iterator begin_it
Definition: forall.hpp:107
typename std::decay< IndexT >::type index_type
Definition: forall.hpp:104
std::decay< Body >::type body
Definition: forall.hpp:105
typename std::decay< Range >::type container_type
Definition: forall.hpp:106
static resources::EventProxy< resources::Resource > invoke_forall(RAJA::resources::Resource r, const int pol, SEGMENT const &seg, PARAMS &&... params)
Definition: forall.hpp:764
static void invoke_forall(const int pol, SEGMENT const &seg, PARAMS &&... params)
Definition: forall.hpp:750
Definition: forall.hpp:706
static void invoke_forall(const int pol, SEGMENT const &seg, PARAMS &&... params)
Definition: forall.hpp:708
static resources::EventProxy< resources::Resource > invoke_forall(RAJA::resources::Resource r, const int pol, SEGMENT const &seg, PARAMS &&... params)
Definition: forall.hpp:722
Definition: IndexSet.hpp:70
Definition: resource.hpp:48
camp::resources::Host type
Definition: resource.hpp:49
Definition: IndexSet.hpp:796
Definition: PluginContext.hpp:26
Header file for RAJA type definitions.