44 #ifndef KOKKOS_THREADS_HPP
45 #define KOKKOS_THREADS_HPP
47 #include <Kokkos_Macros.hpp>
48 #if defined( KOKKOS_ENABLE_THREADS )
50 #include <Kokkos_Core_fwd.hpp>
54 #include <Kokkos_HostSpace.hpp>
55 #include <Kokkos_ScratchSpace.hpp>
57 #include <Kokkos_MemoryTraits.hpp>
58 #include <impl/Kokkos_Tags.hpp>
77 typedef Threads execution_space ;
82 typedef Kokkos::Device<execution_space,memory_space> device_type;
85 typedef memory_space::size_type size_type ;
87 typedef ScratchMemorySpace< Threads > scratch_memory_space ;
97 static int in_parallel();
111 static int concurrency();
113 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
120 static void initialize(
unsigned threads_count = 0 ,
121 unsigned use_numa_count = 0 ,
122 unsigned use_cores_per_numa = 0 ,
123 bool allow_asynchronous_threadpool =
false );
125 static int is_initialized();
127 static Threads & instance(
int = 0 );
131 static int thread_pool_size(
int depth = 0 );
132 #if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST )
133 static int thread_pool_rank();
135 KOKKOS_INLINE_FUNCTION
static int thread_pool_rank() {
return 0 ; }
138 inline static unsigned max_hardware_threads() {
return thread_pool_size(0); }
139 KOKKOS_INLINE_FUNCTION
static unsigned hardware_thread_id() {
return thread_pool_rank(); }
141 static void impl_finalize();
169 static void impl_initialize(
unsigned threads_count = 0 ,
170 unsigned use_numa_count = 0 ,
171 unsigned use_cores_per_numa = 0 ,
172 bool allow_asynchronous_threadpool =
false );
174 static int impl_is_initialized();
176 static Threads & impl_instance(
int = 0 );
180 static int impl_thread_pool_size(
int depth = 0 );
181 #if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST )
182 static int impl_thread_pool_rank();
184 KOKKOS_INLINE_FUNCTION
static int impl_thread_pool_rank() {
return 0 ; }
187 inline static unsigned impl_max_hardware_threads() {
return impl_thread_pool_size(0); }
188 KOKKOS_INLINE_FUNCTION
static unsigned impl_hardware_thread_id() {
return impl_thread_pool_rank(); }
191 static const char* name();
204 struct MemorySpaceAccess
205 < Kokkos::Threads::memory_space
206 , Kokkos::Threads::scratch_memory_space
209 enum { assignable =
false };
210 enum { accessible =
true };
211 enum { deepcopy =
false };
215 struct VerifyExecutionCanAccessMemorySpace
216 < Kokkos::Threads::memory_space
217 , Kokkos::Threads::scratch_memory_space
220 enum { value =
true };
221 inline static void verify(
void ) { }
222 inline static void verify(
const void * ) { }
230 #include <Kokkos_ExecPolicy.hpp>
232 #include <Threads/Kokkos_ThreadsExec.hpp>
233 #include <Threads/Kokkos_ThreadsTeam.hpp>
234 #include <Threads/Kokkos_Threads_Parallel.hpp>
236 #include <KokkosExp_MDRangePolicy.hpp>
void print_configuration(std::ostream &, const bool detail=false)
Print "Bill of Materials".
Memory management for host memory.
Memory layout tag indicating right-to-left (C or lexigraphical scheme) striding of multi-indices...
Declaration of various MemoryLayout options.
Declaration of parallel operators.
void finalize()
Finalize the spaces that were initialized via Kokkos::initialize.