11 #ifndef PANZER_HIERARCHIC_PARALLELISM_HPP
12 #define PANZER_HIERARCHIC_PARALLELISM_HPP
14 #include "Phalanx_KokkosDeviceTypes.hpp"
46 const int& vector_size,
47 const int& fad_vector_size,
48 const bool force_override_safety=
false);
65 template<
typename Scalar>
89 const bool& fad_use_shared_memory);
91 template<
typename Scalar>
98 template<
typename ScalarT,
typename ... TeamPolicyProperties>
99 Kokkos::TeamPolicy<TeamPolicyProperties...>
teamPolicy(
const int& league_size)
101 const int tmp_vector_size = this->
template vectorSize<ScalarT>();
104 return Kokkos::TeamPolicy<TeamPolicyProperties...>(league_size,Kokkos::AUTO(),
107 return Kokkos::TeamPolicy<TeamPolicyProperties...>(league_size,
team_size_,tmp_vector_size);
111 template<
typename ScalarT,
typename ... TeamPolicyProperties,
typename ExecSpace>
112 Kokkos::TeamPolicy<ExecSpace, TeamPolicyProperties...>
teamPolicy(ExecSpace exec_space,
const int& league_size)
114 const int tmp_vector_size = this->
template vectorSize<ScalarT>();
117 return Kokkos::TeamPolicy<TeamPolicyProperties...>(exec_space,league_size,Kokkos::AUTO(),
120 return Kokkos::TeamPolicy<TeamPolicyProperties...>(exec_space,league_size,
team_size_,tmp_vector_size);
void resetSizes()
Reset the sizes to default.
int fad_vector_size_
Default vector size for non-AD types.
bool use_shared_memory_
FAD vector size.
int vector_size_
User specified team size.
Kokkos::TeamPolicy< TeamPolicyProperties...> teamPolicy(const int &league_size)
Returns a TeamPolicy for hierarchic parallelism.
bool fad_use_shared_memory_
Use shared memory kokkos kernels for non-fad types.
int team_size_
If true, the team size is set with Kokkos::AUTO()
void overrideSizes(const int &team_size, const int &vector_size, const int &fad_vector_size, const bool force_override_safety=false)
bool useSharedMemory() const
Kokkos::TeamPolicy< ExecSpace, TeamPolicyProperties...> teamPolicy(ExecSpace exec_space, const int &league_size)
Returns a TeamPolicy for hierarchic parallelism using an exec_space instance (for cuda streams)...
HP()
Use shared memory kokkos kernels for fad types.
int vectorSize() const
Returns the vector size. Specialized for AD scalar types.
Singleton class for accessing kokkos hierarchical parallelism parameters.
static HP & inst()
Private ctor.
void setUseSharedMemory(const bool &use_shared_memory, const bool &fad_use_shared_memory)
Tell kokkos kernels if they should use shared memory. This is very problem dependent.