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;
111 static
void fence( OpenMP const& = OpenMP() ) noexcept;
118 static
bool is_asynchronous( OpenMP const& = OpenMP() ) noexcept;
126 static std::vector<OpenMP> partition(...);
132 static OpenMP create_instance(...);
138 template <typename F>
139 static
void partition_master( F const& f
140 ,
int requested_num_partitions = 0
141 ,
int requested_partition_size = 0
145 static
int concurrency();
147 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
148 static void initialize(
int thread_count,
151 int use_cores_per_numa = 0);
163 static void initialize(
int thread_count = -1 );
166 static bool is_initialized() noexcept;
172 static
int thread_pool_size() noexcept;
175 KOKKOS_INLINE_FUNCTION
176 static
int thread_pool_rank() noexcept;
179 static
int thread_pool_size(
int depth );
181 static
void sleep() {};
182 static void wake() {};
192 static int get_current_max_threads() noexcept;
196 static
int max_hardware_threads() noexcept;
199 KOKKOS_INLINE_FUNCTION
200 static
int hardware_thread_id() noexcept;
202 static void impl_initialize(
int thread_count = -1 );
205 static bool impl_is_initialized() noexcept;
208 static
void impl_finalize();
211 static
int impl_thread_pool_size() noexcept;
214 KOKKOS_INLINE_FUNCTION
215 static
int impl_thread_pool_rank() noexcept;
218 static
int impl_thread_pool_size(
int depth );
222 static
int impl_max_hardware_threads() noexcept;
225 KOKKOS_INLINE_FUNCTION
226 static
int impl_hardware_thread_id() noexcept;
228 static
int impl_get_current_max_threads() noexcept;
231 static constexpr
const char* name() noexcept {
return "OpenMP"; }
243 struct MemorySpaceAccess
244 < Kokkos::OpenMP::memory_space
245 , Kokkos::OpenMP::scratch_memory_space
248 enum { assignable =
false };
249 enum { accessible =
true };
250 enum { deepcopy =
false };
254 struct VerifyExecutionCanAccessMemorySpace
255 < Kokkos::OpenMP::memory_space
256 , Kokkos::OpenMP::scratch_memory_space
259 enum { value =
true };
260 inline static void verify(
void ) { }
261 inline static void verify(
const void * ) { }
270 #include <OpenMP/Kokkos_OpenMP_Exec.hpp>
271 #include <OpenMP/Kokkos_OpenMP_Team.hpp>
272 #include <OpenMP/Kokkos_OpenMP_Parallel.hpp>
273 #include <OpenMP/Kokkos_OpenMP_Task.hpp>
275 #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.