Toggle table of contents sidebar
NestedPolicies
¶
Header File: <Kokkos_Core.hpp>
Kokkos::PerTeam
¶ Kokkos::PerThread
¶ Kokkos::TeamThreadRange
¶ Kokkos::TeamThreadMDRange
¶ Kokkos::TeamVectorRange
¶ Kokkos::TeamVectorMDRange
¶ Kokkos::ThreadVectorRange
¶ Kokkos::ThreadVectorMDRange
¶ General Template Arguments¶
Valid template arguments are described here
Usage¶parallel_for(TeamThreadRange(team,begin,end), [=] (int i) {}); parallel_for(ThreadVectorRange(team,begin,end), [=] (int i) {}); single(PerTeam(team), [=] () {}); single(PerThread(team), [=] () {});
Nested policies can be used for nested parallel patterns. In contrast to global policies, the public interface for nested policies is implemented as functions, in order to enable implicit templating on the execution space type via the team handle.
Synopsis¶Impl::TeamThreadRangeBoundariesStruct TeamThreadRange(TeamMemberType team, IndexType count); Impl::TeamThreadRangeBoundariesStruct TeamThreadRange(TeamMemberType team, IndexType begin, IndexType end); Impl::ThreadVectorRangeBoundariesStruct ThreadVectorRange(TeamMemberType team, IndexType count); Impl::ThreadVectorRangeBoundariesStruct ThreadVectorRange(TeamMemberType team, IndexType begin, IndexType end); Impl::ThreadSingleStruct PerTeam(TeamMemberType team); Impl::VectorSingleStruct PerThread(TeamMemberType team);Description¶
0
to count-1
over the threads of the team. This call is potentially a synchronization point for the team, and thus must meet the requirements of team_barrier
.
team
: object meeting the requirements of TeamHandle
count
: index range length.
begin
to end-1
over the threads of the team. This call is potentially a synchronization point for the team, and thus must meet the requirements of team_barrier
.
team
: object meeting the requirements of TeamHandle
begin
: start index.
end
: end index.
0
to count-1
over the vector lanes of the calling thread. It is not legal to call this function inside of a vector level loop.
team
: object meeting the requirements of TeamHandle
count
: index range length.
begin
to end-1
over the vector lanes of the calling thread. It is not legal to call this function inside of a vector level loop.
team
: object meeting the requirements of TeamHandle
begin
: start index.
end
: end index.
single
pattern restricts execution to a single vector lane in the calling team. While not a synchronization event, this call must be encountered by the entire team, and thus meet the calling requirements of team_barrier
.
team
: object meeting the requirements of TeamHandle
single
pattern restricts execution to a single vector lane in the calling thread. It is not legal to call this function inside of a vector level loop.
team
: object meeting the requirements of TeamHandle
typedef TeamPolicy<>::member_type team_handle; parallel_for(TeamPolicy<>(N,AUTO,4), KOKKOS_LAMBDA (const team_handle& team) { int n = team.league_rank(); parallel_for(TeamThreadRange(team,M), [&] (const int& i) { int thread_sum; parallel_reduce(ThreadVectorRange(team,K), [&] (const int& j, int& lsum) { //... },thread_sum); single(PerThread(team), [&] () { A(n,i) += thread_sum; }); }); team.team_barrier(); int team_sum; parallel_reduce(TeamThreadRange(team,M), [&] (const int& i, int& lsum) { lsum += A(n,i); },team_sum); single(PerTeam(team),[&] () { A_rowsum(n) += team_sum; }); });
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4