AUTO, AUTO_t¶
Defined in header <Kokkos_Core.hpp>
Usage¶
Kokkos::TeamPolicy<>(league_size, Kokkos::AUTO);
Kokkos::TeamPolicy<>(league_size, Kokkos::AUTO());
AUTO is a tag used in place of the team_size argument of
TeamPolicy to let Kokkos determine, at launch time, a good team size
for the given functor and execution space.
Both Kokkos::AUTO and Kokkos::AUTO() syntax are supported.
Interface¶
-
struct AUTO_t¶
Tag type passed in place of
team_sizeto TeamPolicy to request that Kokkos selects the team size automatically.
-
inline constexpr AUTO_t AUTO{};¶
Constant instance of
AUTO_tused to request automatic team size selection for TeamPolicy.
Example¶
// Let Kokkos pick a team size for N leagues
Kokkos::parallel_for(Kokkos::TeamPolicy<>(N, Kokkos::AUTO),
KOKKOS_LAMBDA(const Kokkos::TeamPolicy<>::member_type& team) {
// ...
});
// Both syntaxes work
Kokkos::TeamPolicy<> policy1(N, Kokkos::AUTO);
Kokkos::TeamPolicy<> policy2(N, Kokkos::AUTO());
// AUTO can be combined with an explicit vector length
Kokkos::TeamPolicy<> policy3(N, Kokkos::AUTO, /*vector_length=*/8);
See Also¶
See also
- TeamPolicy
Execution policy for hierarchical (thread team) parallelism