44 #ifndef KOKKOS_OPENMP_HPP
45 #define KOKKOS_OPENMP_HPP
47 #include <Kokkos_Macros.hpp>
48 #if defined( KOKKOS_ENABLE_OPENMP)
50 #include <Kokkos_Core_fwd.hpp>
54 #include <Kokkos_HostSpace.hpp>
56 #ifdef KOKKOS_ENABLE_HBWSPACE
57 #include <Kokkos_HBWSpace.hpp>
60 #include <Kokkos_ScratchSpace.hpp>
62 #include <Kokkos_TaskScheduler.hpp>
64 #include <impl/Kokkos_Tags.hpp>
81 using execution_space = OpenMP;
84 #ifdef KOKKOS_ENABLE_HBWSPACE
85 Experimental::HBWSpace;
91 using device_type = Kokkos::Device< execution_space, memory_space >;
92 using array_layout = LayoutRight;
93 using size_type = memory_space::size_type;
94 using scratch_memory_space = ScratchMemorySpace< OpenMP >;
105 static
bool in_parallel( OpenMP const& = OpenMP() ) noexcept;
110 static
void impl_static_fence( OpenMP const& = OpenMP() ) noexcept;
112 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
113 static void fence( OpenMP
const& = OpenMP() ) noexcept;
124 static bool is_asynchronous( OpenMP
const& = OpenMP() ) noexcept;
132 static std::vector<OpenMP> partition(...);
138 static OpenMP create_instance(...);
144 template <typename F>
145 static
void partition_master( F const& f
146 ,
int requested_num_partitions = 0
147 ,
int requested_partition_size = 0
151 static
int concurrency();
153 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
154 static void initialize(
int thread_count,
157 int use_cores_per_numa = 0);
169 static void initialize(
int thread_count = -1 );
172 static bool is_initialized() noexcept;
178 static
int thread_pool_size() noexcept;
181 KOKKOS_INLINE_FUNCTION
182 static
int thread_pool_rank() noexcept;
185 static
int thread_pool_size(
int depth );
187 static
void sleep() {};
188 static void wake() {};
198 static int get_current_max_threads() noexcept;
202 static
int max_hardware_threads() noexcept;
205 KOKKOS_INLINE_FUNCTION
206 static
int hardware_thread_id() noexcept;
208 static void impl_initialize(
int thread_count = -1 );
211 static bool impl_is_initialized() noexcept;
214 static
void impl_finalize();
217 static
int impl_thread_pool_size() noexcept;
220 KOKKOS_INLINE_FUNCTION
221 static
int impl_thread_pool_rank() noexcept;
224 static
int impl_thread_pool_size(
int depth );
228 static
int impl_max_hardware_threads() noexcept;
231 KOKKOS_INLINE_FUNCTION
232 static
int impl_hardware_thread_id() noexcept;
234 static
int impl_get_current_max_threads() noexcept;
237 static constexpr
const char* name() noexcept {
return "OpenMP"; }
249 struct MemorySpaceAccess
250 < Kokkos::OpenMP::memory_space
251 , Kokkos::OpenMP::scratch_memory_space
254 enum { assignable =
false };
255 enum { accessible =
true };
256 enum { deepcopy =
false };
260 struct VerifyExecutionCanAccessMemorySpace
261 < Kokkos::OpenMP::memory_space
262 , Kokkos::OpenMP::scratch_memory_space
265 enum { value =
true };
266 inline static void verify(
void ) { }
267 inline static void verify(
const void * ) { }
276 #include <OpenMP/Kokkos_OpenMP_Exec.hpp>
277 #include <OpenMP/Kokkos_OpenMP_Team.hpp>
278 #include <OpenMP/Kokkos_OpenMP_Parallel.hpp>
279 #include <OpenMP/Kokkos_OpenMP_Task.hpp>
281 #include <KokkosExp_MDRangePolicy.hpp>
void print_configuration(std::ostream &, const bool detail=false)
Print "Bill of Materials".
Declaration of various MemoryLayout options.
Declaration of parallel operators.
void finalize()
Finalize the spaces that were initialized via Kokkos::initialize.