1#ifndef __COMMON_KOKKOS_GET_POLICY_HPP__
2#define __COMMON_KOKKOS_GET_POLICY_HPP__
4#include <Kokkos_Core.hpp>
5#include <common/common.hpp>
6#include <common/env_var.hpp>
14 return x != 0 && (x & (x - 1)) == 0;
17 std::size_t
c_league_size(std::size_t n_tot, std::size_t n_per_team)
noexcept;
19 template <
typename Tag =
void>
20 Kokkos::TeamPolicy<ComputeSpace, Tag>
23 const auto _league_size =
read_env_or(
"BIOMC_LEAGUE_SIZE", league_size);
24 return Kokkos::TeamPolicy<ComputeSpace, Tag>(_league_size, Kokkos::AUTO);
27 template <
typename Tag =
void>
28 Kokkos::TeamPolicy<ComputeSpace, Tag>
31 return Kokkos::TeamPolicy<ComputeSpace, Tag>(
32 c_league_size(n_tot, n_per_team), Kokkos::AUTO(), Kokkos::AUTO());
Definition config_loader.hpp:8
std::size_t c_league_size(std::size_t n_tot, std::size_t n_per_team) noexcept
Definition common.cpp:17
T read_env_or(std::string_view varname, T vdefault)
Wrapper arround get_env to get envariable with fallback to default.
Definition env_var.hpp:49
Kokkos::TeamPolicy< ComputeSpace, Tag > get_policy_team(std::size_t league_size=1)
Definition kokkos_getpolicy.hpp:21
Kokkos::TeamPolicy< ComputeSpace, Tag > get_policy_team_from_npt(std::size_t n_tot, std::size_t n_per_team)
Definition kokkos_getpolicy.hpp:29
constexpr bool is_power_of_2(std::size_t x)
Definition kokkos_getpolicy.hpp:12