9#ifndef _COMPADRE_PARALLELMANAGER_HPP_
10#define _COMPADRE_PARALLELMANAGER_HPP_
12#include "Compadre_Config.h"
83#ifdef COMPADRE_USE_CUDA
100 if (
const char* env_threads = std::getenv(
"THREADS")) {
103 if (
const char* env_vector_lanes = std::getenv(
"VECTORLANES")) {
106#ifdef COMPADRE_EXTREME_DEBUG
126 Kokkos::TeamPolicy<device_execution_space>
128 const int vector_lanes_per_thread = -1)
const {
131 Kokkos::TeamPolicy<device_execution_space> tp;
132 if (threads_per_team>0 && vector_lanes_per_thread>0) {
133 tp = Kokkos::TeamPolicy<device_execution_space>(batch_size, threads_per_team, vector_lanes_per_thread);
134 }
else if (threads_per_team>0) {
138 tp = Kokkos::TeamPolicy<device_execution_space>(batch_size, threads_per_team, Kokkos::AUTO);
140 }
else if (vector_lanes_per_thread>0) {
142 tp = Kokkos::TeamPolicy<device_execution_space>(batch_size,
_environment_threads, vector_lanes_per_thread);
144 tp = Kokkos::TeamPolicy<device_execution_space>(batch_size, Kokkos::AUTO, vector_lanes_per_thread);
152 tp = Kokkos::TeamPolicy<device_execution_space>(batch_size,
_environment_threads, Kokkos::AUTO);
154 tp = Kokkos::TeamPolicy<device_execution_space>(batch_size, Kokkos::AUTO, Kokkos::AUTO);
178 KOKKOS_INLINE_FUNCTION
187 KOKKOS_INLINE_FUNCTION
196 KOKKOS_INLINE_FUNCTION
205 KOKKOS_INLINE_FUNCTION
int _scratch_team_level_a
lowest level memory for Kokkos::parallel_for for team access memory
void setTeamScratchLevel(const int level, const int value)
KOKKOS_INLINE_FUNCTION int getThreadScratchLevel(const int level) const
void setThreadScratchSize(const int level, const int value)
int _scratch_thread_level_a
higher (slower) level memory for Kokkos::parallel_for for team access memory
void setThreadScratchLevel(const int level, const int value)
int _environment_threads
number of threads and vector lanes if not specified through environment variables THREADS and VECTORL...
KOKKOS_INLINE_FUNCTION int getTeamScratchSize(const int level) const
int _scratch_team_level_b
lowest level memory for Kokkos::parallel_for for thread access memory
int _environment_vector_lanes
int _scratch_thread_level_b
higher (slower) level memory for Kokkos::parallel_for for thread access memory
void setTeamScratchSize(const int level, const int value)
int _thread_scratch_size_b
KOKKOS_INLINE_FUNCTION int getThreadScratchSize(const int level) const
Kokkos::TeamPolicy< device_execution_space > TeamPolicyThreadsAndVectors(const global_index_type batch_size, const int threads_per_team=-1, const int vector_lanes_per_thread=-1) const
Creates a team policy for a parallel_for parallel_for will break out over loops over teams with each ...
KOKKOS_INLINE_FUNCTION int getTeamScratchLevel(const int level) const
int _thread_scratch_size_a
std::size_t global_index_type