45 #ifndef KOKKOS_TASKSCHEDULER_FWD_HPP
46 #define KOKKOS_TASKSCHEDULER_FWD_HPP
50 #include <Kokkos_Macros.hpp>
51 #if defined(KOKKOS_ENABLE_TASKDAG)
53 #include <Kokkos_Core_fwd.hpp>
60 template <
typename ValueType,
typename Scheduler>
63 template <
class Space,
class Queue>
64 class SimpleTaskScheduler;
66 template <
class Space,
class Queue>
67 class BasicTaskScheduler;
69 template <
typename Space>
70 struct is_scheduler :
public std::false_type {};
72 template <
class Space,
class Queue>
73 struct is_scheduler<BasicTaskScheduler<Space, Queue>> :
public std::true_type {
76 template <
class Space,
class Queue>
77 struct is_scheduler<SimpleTaskScheduler<Space, Queue>> :
public std::true_type {
80 enum class TaskPriority : int { High = 0, Regular = 1, Low = 2 };
88 template <
class Device>
93 template <
class TaskQueueTraits>
112 template <
typename Space,
typename ResultType,
typename FunctorType>
117 template <
typename Space,
typename MemorySpace>
120 template <
typename ExecSpace,
typename MemorySpace>
121 class TaskQueueMultiple;
123 template <
typename ExecSpace,
typename MemSpace,
typename TaskQueueTraits,
125 Kokkos::MemoryPool<Kokkos::Device<ExecSpace, MemSpace>>>
126 class SingleTaskQueue;
128 template <
typename ExecSpace,
typename MemSpace,
typename TaskQueueTraits,
130 class MultipleTaskQueue;
132 struct TaskQueueTraitsLockBased;
134 template <
size_t CircularBufferSize = 64>
135 struct TaskQueueTraitsChaseLev;
137 template <
typename ResultType>
140 struct TaskSchedulerBase;
142 template <
class ExecSpace>
143 struct default_tasking_memory_space_for_execution_space {
144 using type =
typename ExecSpace::memory_space;
147 #if defined(KOKKOS_ENABLE_CUDA)
149 struct default_tasking_memory_space_for_execution_space<Kokkos::Cuda> {
150 using type = Kokkos::CudaUVMSpace;
154 template <
class ExecSpace>
155 using default_tasking_memory_space_for_execution_space_t =
156 typename default_tasking_memory_space_for_execution_space<ExecSpace>::type;
165 template <
typename Space>
166 using DeprecatedTaskScheduler = BasicTaskScheduler<
170 Impl::default_tasking_memory_space_for_execution_space_t<Space>>>;
172 template <
typename Space>
173 using DeprecatedTaskSchedulerMultiple = BasicTaskScheduler<
175 Impl::TaskQueueMultiple<
177 Impl::default_tasking_memory_space_for_execution_space_t<Space>>>;
179 template <
typename Space>
180 using TaskScheduler = SimpleTaskScheduler<
182 Impl::SingleTaskQueue<
183 Space, Impl::default_tasking_memory_space_for_execution_space_t<Space>,
184 Impl::TaskQueueTraitsLockBased>>;
186 template <
typename Space>
187 using TaskSchedulerMultiple = SimpleTaskScheduler<
189 Impl::MultipleTaskQueue<
190 Space, Impl::default_tasking_memory_space_for_execution_space_t<Space>,
191 Impl::TaskQueueTraitsLockBased,
192 Kokkos::MemoryPool<Kokkos::Device<
194 Impl::default_tasking_memory_space_for_execution_space_t<Space>>>>>;
196 template <
typename Space>
197 using ChaseLevTaskScheduler = SimpleTaskScheduler<
199 Impl::MultipleTaskQueue<
200 Space, Impl::default_tasking_memory_space_for_execution_space_t<Space>,
201 Impl::TaskQueueTraitsChaseLev<>,
202 Kokkos::MemoryPool<Kokkos::Device<
204 Impl::default_tasking_memory_space_for_execution_space_t<Space>>>>>;
206 template <
class Space,
class QueueType>
207 void wait(BasicTaskScheduler<Space, QueueType>
const&);
211 struct TaskSchedulerBase {};
213 class TaskQueueBase {};
215 template <
typename Scheduler,
typename EnableIfConstra
int =
void>
216 class TaskQueueSpecializationConstrained {};
218 template <
typename Scheduler>
219 struct TaskQueueSpecialization : TaskQueueSpecializationConstrained<Scheduler> {
222 template <
int,
typename>
223 struct TaskPolicyData;