45 #ifndef KOKKOS_OPENMP_HPP 46 #define KOKKOS_OPENMP_HPP 48 #include <Kokkos_Macros.hpp> 49 #if defined(KOKKOS_ENABLE_OPENMP) 51 #include <Kokkos_Core_fwd.hpp> 55 #include <Kokkos_HostSpace.hpp> 57 #ifdef KOKKOS_ENABLE_HBWSPACE 58 #include <Kokkos_HBWSpace.hpp> 61 #include <Kokkos_ScratchSpace.hpp> 63 #include <Kokkos_TaskScheduler.hpp> 65 #include <impl/Kokkos_Tags.hpp> 82 using execution_space = OpenMP;
85 #ifdef KOKKOS_ENABLE_HBWSPACE 86 Experimental::HBWSpace;
92 using device_type = Kokkos::Device<execution_space, memory_space>;
93 using array_layout = LayoutRight;
94 using size_type = memory_space::size_type;
95 using scratch_memory_space = ScratchMemorySpace<OpenMP>;
101 inline static bool in_parallel(OpenMP
const& = OpenMP()) noexcept;
106 static
void impl_static_fence(OpenMP const& = OpenMP()) noexcept;
108 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE 109 static void fence(OpenMP
const& = OpenMP()) noexcept;
118 inline static bool is_asynchronous(OpenMP
const& = OpenMP()) noexcept;
125 static std::vector<OpenMP> partition(...);
131 static OpenMP create_instance(...);
138 template <typename F>
139 static
void partition_master(F const& f,
int requested_num_partitions = 0,
140 int requested_partition_size = 0);
143 static
int concurrency();
145 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE 146 static void initialize(
int thread_count,
int use_numa_count,
148 int use_cores_per_numa = 0);
160 static void initialize(
int thread_count = -1);
164 static bool is_initialized() noexcept;
169 inline static
int thread_pool_size() noexcept;
172 KOKKOS_INLINE_FUNCTION
173 static
int thread_pool_rank() noexcept;
175 inline static
int thread_pool_size(
int depth);
177 static
void sleep(){};
178 static void wake(){};
188 static int get_current_max_threads() noexcept;
191 inline static
int max_hardware_threads() noexcept;
194 KOKKOS_INLINE_FUNCTION
195 static
int hardware_thread_id() noexcept;
197 static void impl_initialize(
int thread_count = -1);
201 static bool impl_is_initialized() noexcept;
204 static
void impl_finalize();
206 inline static
int impl_thread_pool_size() noexcept;
209 KOKKOS_INLINE_FUNCTION
210 static
int impl_thread_pool_rank() noexcept;
212 inline static
int impl_thread_pool_size(
int depth);
215 inline static
int impl_max_hardware_threads() noexcept;
218 KOKKOS_INLINE_FUNCTION
219 static
int impl_hardware_thread_id() noexcept;
221 static
int impl_get_current_max_threads() noexcept;
224 static constexpr
const char* name() noexcept {
return "OpenMP"; }
225 uint32_t impl_instance_id() const noexcept {
return 0; }
228 namespace Profiling {
231 struct DeviceTypeTraits<OpenMP> {
232 static constexpr DeviceType
id = DeviceType::OpenMP;
245 struct MemorySpaceAccess<
Kokkos::OpenMP::memory_space,
246 Kokkos::OpenMP::scratch_memory_space> {
247 enum { assignable =
false };
248 enum { accessible =
true };
249 enum { deepcopy =
false };
253 struct VerifyExecutionCanAccessMemorySpace<
254 Kokkos::OpenMP::memory_space, Kokkos::OpenMP::scratch_memory_space> {
255 enum { value =
true };
256 inline static void verify(
void) {}
257 inline static void verify(
const void*) {}
266 #include <OpenMP/Kokkos_OpenMP_Exec.hpp> 267 #include <OpenMP/Kokkos_OpenMP_Team.hpp> 268 #include <OpenMP/Kokkos_OpenMP_Parallel.hpp> 269 #include <OpenMP/Kokkos_OpenMP_Task.hpp> 271 #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.