17 #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
18 #include <Kokkos_Macros.hpp>
20 "Including non-public Kokkos header files is not allowed.");
22 #ifndef KOKKOS_TASKSCHEDULER_FWD_HPP
23 #define KOKKOS_TASKSCHEDULER_FWD_HPP
28 #include <Kokkos_Macros.hpp>
29 #if defined(KOKKOS_ENABLE_TASKDAG)
31 #include <Kokkos_Core_fwd.hpp>
38 template <
typename ValueType,
typename Scheduler>
41 template <
class Space,
class Queue>
42 class SimpleTaskScheduler;
44 template <
class Space,
class Queue>
45 class BasicTaskScheduler;
47 template <
typename Space>
48 struct is_scheduler :
public std::false_type {};
50 template <
class Space,
class Queue>
51 struct is_scheduler<BasicTaskScheduler<Space, Queue>> :
public std::true_type {
54 template <
class Space,
class Queue>
55 struct is_scheduler<SimpleTaskScheduler<Space, Queue>> :
public std::true_type {
58 enum class TaskPriority : int { High = 0, Regular = 1, Low = 2 };
66 template <
class Device>
71 template <
class TaskQueueTraits>
90 template <
typename Space,
typename ResultType,
typename FunctorType>
95 template <
typename Space,
typename MemorySpace>
98 template <
typename ExecSpace,
typename MemorySpace>
99 class TaskQueueMultiple;
101 template <
typename ExecSpace,
typename MemSpace,
typename TaskQueueTraits,
103 Kokkos::MemoryPool<Kokkos::Device<ExecSpace, MemSpace>>>
104 class SingleTaskQueue;
106 template <
typename ExecSpace,
typename MemSpace,
typename TaskQueueTraits,
108 class MultipleTaskQueue;
110 struct TaskQueueTraitsLockBased;
112 template <
size_t CircularBufferSize = 64>
113 struct TaskQueueTraitsChaseLev;
115 template <
typename ResultType>
118 struct TaskSchedulerBase;
120 template <
class ExecSpace>
121 struct default_tasking_memory_space_for_execution_space {
122 using type =
typename ExecSpace::memory_space;
125 #if defined(KOKKOS_ENABLE_CUDA)
127 struct default_tasking_memory_space_for_execution_space<Kokkos::Cuda> {
128 using type = Kokkos::CudaUVMSpace;
132 template <
class ExecSpace>
133 using default_tasking_memory_space_for_execution_space_t =
134 typename default_tasking_memory_space_for_execution_space<ExecSpace>::type;
143 template <
typename Space>
144 using DeprecatedTaskScheduler = BasicTaskScheduler<
148 Impl::default_tasking_memory_space_for_execution_space_t<Space>>>;
150 template <
typename Space>
151 using DeprecatedTaskSchedulerMultiple = BasicTaskScheduler<
153 Impl::TaskQueueMultiple<
155 Impl::default_tasking_memory_space_for_execution_space_t<Space>>>;
157 template <
typename Space>
158 using TaskScheduler = SimpleTaskScheduler<
160 Impl::SingleTaskQueue<
161 Space, Impl::default_tasking_memory_space_for_execution_space_t<Space>,
162 Impl::TaskQueueTraitsLockBased>>;
164 template <
typename Space>
165 using TaskSchedulerMultiple = SimpleTaskScheduler<
167 Impl::MultipleTaskQueue<
168 Space, Impl::default_tasking_memory_space_for_execution_space_t<Space>,
169 Impl::TaskQueueTraitsLockBased,
170 Kokkos::MemoryPool<Kokkos::Device<
172 Impl::default_tasking_memory_space_for_execution_space_t<Space>>>>>;
174 template <
typename Space>
175 using ChaseLevTaskScheduler = SimpleTaskScheduler<
177 Impl::MultipleTaskQueue<
178 Space, Impl::default_tasking_memory_space_for_execution_space_t<Space>,
179 Impl::TaskQueueTraitsChaseLev<>,
180 Kokkos::MemoryPool<Kokkos::Device<
182 Impl::default_tasking_memory_space_for_execution_space_t<Space>>>>>;
184 template <
class Space,
class QueueType>
185 void wait(BasicTaskScheduler<Space, QueueType>
const&);
189 struct TaskSchedulerBase {};
191 class TaskQueueBase {};
193 template <
typename Scheduler,
typename EnableIfConstra
int =
void>
194 class TaskQueueSpecializationConstrained {};
196 template <
typename Scheduler>
197 struct TaskQueueSpecialization : TaskQueueSpecializationConstrained<Scheduler> {
200 template <
int,
typename>
201 struct TaskPolicyData;