|
RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
|
Header file containing RAJA index set and segment iteration template methods that take an execution policy as a template parameter. More...
#include "RAJA/config.hpp"#include <functional>#include <iterator>#include <type_traits>#include "RAJA/internal/Iterators.hpp"#include "RAJA/policy/PolicyBase.hpp"#include "RAJA/policy/MultiPolicy.hpp"#include "RAJA/index/IndexSet.hpp"#include "RAJA/index/ListSegment.hpp"#include "RAJA/index/RangeSegment.hpp"#include "RAJA/util/concepts.hpp"#include "RAJA/util/Span.hpp"#include "RAJA/util/types.hpp"#include "RAJA/policy/sequential/forall.hpp"#include "RAJA/pattern/detail/forall.hpp"#include "RAJA/pattern/detail/privatizer.hpp"#include "RAJA/pattern/params/kernel_name.hpp"#include "RAJA/internal/get_platform.hpp"#include "RAJA/util/plugins.hpp"#include "RAJA/util/resource.hpp"Go to the source code of this file.
Classes | |
| struct | RAJA::detail::icount_adapter< Range, Body, IndexT > |
| Adapter to replace specific implementations for the icount variants. More... | |
| struct | RAJA::detail::CallForall |
| struct | RAJA::detail::CallForallIcount |
| struct | RAJA::dynamic_helper< IDX, POLICY_LIST > |
| struct | RAJA::dynamic_helper< 0, POLICY_LIST > |
Namespaces | |
| RAJA | |
| RAJA::detail | |
| RAJA::wrap | |
| The RAJA::wrap layer unwraps dynamic policies before dispatch. | |
| RAJA::policy_by_value_interface | |
| The RAJA::policy_by_value_interface forall functions provide an interface with value-based policies. It also enforces the interface and performs static checks as well as triggering plugins and loop body updates. | |
Functions | |
| template<typename Res , typename ExecutionPolicy , typename Container , typename LoopBody , typename ForallParams > | |
| RAJA_INLINE concepts::enable_if_t< RAJA::resources::EventProxy< Res >, concepts::negate< type_traits::is_indexset_policy< ExecutionPolicy > >, type_traits::is_range< Container > > | RAJA::wrap::forall (Res r, ExecutionPolicy &&p, Container &&c, LoopBody &&loop_body, ForallParams &&f_params) |
| Generic dispatch over containers with a value-based policy. More... | |
| template<typename Res , typename ExecutionPolicy , typename Container , typename LoopBody > | |
| RAJA_INLINE concepts::enable_if_t< RAJA::resources::EventProxy< Res >, concepts::negate< type_traits::is_indexset_policy< ExecutionPolicy > >, type_traits::is_range< Container > > | RAJA::wrap::forall (Res r, ExecutionPolicy &&p, Container &&c, LoopBody &&loop_body) |
| template<typename Res , typename ExecutionPolicy , typename Container , typename IndexType , typename LoopBody , typename ForallParams > | |
| RAJA_INLINE resources::EventProxy< Res > | RAJA::wrap::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. More... | |
| template<typename Res , typename SegmentIterPolicy , typename SegmentExecPolicy , typename... SegmentTypes, typename LoopBody , typename ForallParams > | |
| RAJA_INLINE resources::EventProxy< Res > | RAJA::wrap::forall_Icount (Res r, ExecPolicy< SegmentIterPolicy, SegmentExecPolicy >, const TypedIndexSet< SegmentTypes... > &iset, LoopBody loop_body, ForallParams f_params) |
| Execute segments from forall_Icount traversal method. More... | |
| template<typename Res , typename SegmentIterPolicy , typename SegmentExecPolicy , typename LoopBody , typename... SegmentTypes, typename ForallParams > | |
| RAJA_INLINE resources::EventProxy< Res > | RAJA::wrap::forall (Res r, ExecPolicy< SegmentIterPolicy, SegmentExecPolicy >, const TypedIndexSet< SegmentTypes... > &iset, LoopBody loop_body, ForallParams f_params) |
| template<typename ExecutionPolicy , typename Res , typename IdxSet , typename... Params> | |
| RAJA_INLINE resources::EventProxy< Res > | RAJA::policy_by_value_interface::forall_Icount (ExecutionPolicy &&p, Res r, IdxSet &&c, Params &&... params) |
| Generic dispatch over index set with icount with a value-based policy. More... | |
| template<typename ExecutionPolicy , typename IdxSet , typename LoopBody , typename Res = typename resources::get_resource<ExecutionPolicy>::type> | |
| RAJA_INLINE resources::EventProxy< Res > | RAJA::policy_by_value_interface::forall_Icount (ExecutionPolicy &&p, IdxSet &&c, LoopBody &&loop_body) |
| template<typename ExecutionPolicy , typename Res , typename IdxSet , typename... Params> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_indexset_policy< ExecutionPolicy > > | RAJA::policy_by_value_interface::forall (ExecutionPolicy &&p, Res r, IdxSet &&c, Params &&... params) |
| Generic dispatch over index set with a value-based policy. More... | |
| template<typename ExecutionPolicy , typename IdxSet , typename LoopBody , typename Res = typename resources::get_resource<ExecutionPolicy>::type> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_indexset_policy< ExecutionPolicy > > | RAJA::policy_by_value_interface::forall (ExecutionPolicy &&p, IdxSet &&c, LoopBody &&loop_body) |
| template<typename ExecutionPolicy , typename Container , typename LoopBody , typename Res = typename resources::get_resource<ExecutionPolicy>::type> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_multi_policy< ExecutionPolicy >, type_traits::is_range< Container > > | RAJA::policy_by_value_interface::forall (ExecutionPolicy &&p, Container &&c, LoopBody &&loop_body) |
| Generic dispatch over containers with a multi policy. More... | |
| template<typename ExecutionPolicy , typename Res , typename Container , typename IndexType , typename FirstParam , typename... Params> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_range< Container >, type_traits::is_integral< IndexType > > | RAJA::policy_by_value_interface::forall_Icount (ExecutionPolicy &&p, Res r, Container &&c, IndexType icount, FirstParam &&first, Params &&... params) |
| Generic dispatch over containers with icount with a value-based policy. More... | |
| template<typename ExecutionPolicy , typename Container , typename IndexType , typename LoopBody , typename Res = typename resources::get_resource<ExecutionPolicy>::type> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_range< Container >, concepts::negate< type_traits::is_indexset_policy< ExecutionPolicy > >, type_traits::is_integral< IndexType > > | RAJA::policy_by_value_interface::forall_Icount (ExecutionPolicy &&p, Container &&c, IndexType icount, LoopBody &&loop_body) |
| template<typename ExecutionPolicy , typename Res , typename Container , typename... Params> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, concepts::negate< type_traits::is_indexset_policy< ExecutionPolicy > >, concepts::negate< type_traits::is_multi_policy< ExecutionPolicy > >, type_traits::is_range< Container > > | RAJA::policy_by_value_interface::forall (ExecutionPolicy &&p, Res r, Container &&c, Params &&... params) |
| Generic dispatch over containers with a value-based policy. More... | |
| template<typename ExecutionPolicy , typename Container , typename LoopBody , typename Res = typename resources::get_resource<ExecutionPolicy>::type> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, concepts::negate< type_traits::is_indexset_policy< ExecutionPolicy > >, concepts::negate< type_traits::is_multi_policy< ExecutionPolicy > >, type_traits::is_range< Container > > | RAJA::policy_by_value_interface::forall (ExecutionPolicy &&p, Container &&c, LoopBody &&loop_body) |
| template<typename ExecutionPolicy , typename... Args, typename Res = typename resources::get_resource<ExecutionPolicy>::type> | |
| RAJA_INLINE resources::EventProxy< Res > | RAJA::forall (Args &&... args) |
| Conversion from template-based policy to value-based policy for forall. More... | |
| template<typename ExecutionPolicy , typename Res , typename... Args> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_resource< Res > > | RAJA::forall (Res r, Args &&... args) |
| template<typename ExecutionPolicy , typename... Args, typename Res = typename resources::get_resource<ExecutionPolicy>::type> | |
| RAJA_INLINE resources::EventProxy< Res > | RAJA::forall_Icount (Args &&... args) |
| Conversion from template-based policy to value-based policy for forall_Icount. More... | |
| template<typename ExecutionPolicy , typename Res , typename... Args> | |
| RAJA_INLINE concepts::enable_if_t< resources::EventProxy< Res >, type_traits::is_resource< Res > > | RAJA::forall_Icount (Res r, Args &&... args) |
| template<typename POLICY_LIST , typename SEGMENT , typename... PARAMS> | |
| void | RAJA::dynamic_forall (const int pol, SEGMENT const &seg, PARAMS &&... params) |
| template<typename POLICY_LIST , typename SEGMENT , typename... PARAMS> | |
| resources::EventProxy< resources::Resource > | RAJA::dynamic_forall (RAJA::resources::Resource r, const int pol, SEGMENT const &seg, PARAMS &&... params) |
Header file containing RAJA index set and segment iteration template methods that take an execution policy as a template parameter.
The templates for segments support the following usage pattern:
forall<exec_policy>( index set, loop body );
which is equivalent to:
forall( exec_policy(), index set, loop body );
The former is slightly more concise. Here, the execution policy type is associated with a tag struct defined in the exec_poilicy hearder file. Usage of the forall_Icount() is similar.
The forall() and forall_Icount() methods that take an index set take an execution policy of the form:
TypedIndexSet::ExecPolicy< seg_it_policy, seg_exec_policy >
Here, the first template parameter determines the scheme for iteratiing over the index set segments and the second determines how each segment is executed.
The forall() templates accept a loop body argument that takes a single Index_type argument identifying the index of a loop iteration. The forall_Icount() templates accept a loop body that takes two Index_type arguments. The first is the number of the iteration in the indes set or segment, the second if the actual index of the loop iteration.
IMPORTANT: Use of any of these methods requires a specialization
for the given index set type and execution policy.