22 #ifdef ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLED
25 # error If ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLED is set, the compiler has to support OpenMP 2.0 or higher!
37 # pragma clang diagnostic push
38 # pragma clang diagnostic ignored "-Wweak-vtables"
43 # pragma clang diagnostic pop
90 :
m_spQueueImpl(std::make_shared<cpu::detail::QueueCpuOmp2CollectiveImpl>(dev))
102 return !((*this) == rhs);
123 return queue.m_spQueueImpl->m_dev;
136 template<
typename TTask>
141 if(::omp_in_parallel() != 0)
144 queue.m_spQueueImpl->busyWaitUntilBlockingQueueEmpty();
145 ++queue.m_spQueueImpl->m_uCurrentlyExecutingTask;
146 # pragma omp single nowait
148 --queue.m_spQueueImpl->m_uCurrentlyExecutingTask;
152 std::lock_guard<std::mutex> lk(queue.m_spQueueImpl->m_mutex);
164 return queue.m_spQueueImpl->m_uCurrentlyExecutingTask == 0u
189 if(::omp_in_parallel() != 0)
192 queue.m_spQueueImpl->busyWaitUntilBlockingQueueEmpty();
204 template<
typename TDim,
typename TIdx,
typename TKernelFnObj,
typename... TArgs>
211 if(::omp_in_parallel() != 0)
213 queue.m_spQueueImpl->busyWaitUntilBlockingQueueEmpty();
214 ++queue.m_spQueueImpl->m_uCurrentlyExecutingTask;
217 --queue.m_spQueueImpl->m_uCurrentlyExecutingTask;
221 std::lock_guard<std::mutex> lk(queue.m_spQueueImpl->m_mutex);
246 if(::omp_in_parallel() != 0)
249 queue.m_spQueueImpl->busyWaitUntilBlockingQueueEmpty();
254 std::lock_guard<std::mutex> lk(queue.m_spQueueImpl->m_mutex);
255 wait(queue.m_spQueueImpl->blockingQueue);
276 if(::omp_in_parallel() != 0)
279 queue.m_spQueueImpl->busyWaitUntilBlockingQueueEmpty();
283 wait(queue.m_spQueueImpl->blockingQueue, event);
#define ALPAKA_DEBUG_MINIMAL_LOG_SCOPE
ALPAKA_FN_HOST auto registerQueue(std::shared_ptr< cpu::ICpuQueue > spQueue) const -> void
Registers the given queue on this device. NOTE: Every queue has to be registered for correct function...
The CPU OpenMP 2.0 block accelerator execution task.
Event that can be enqueued into a queue and can be triggered by the Host.
The alpaka accelerator library.
ALPAKA_FN_HOST auto empty(TQueue const &queue) -> bool
Tests if the queue is empty (all ops in the given queue have been completed).
ALPAKA_FN_HOST auto enqueue(TQueue &queue, TTask &&task) -> void
Queues the given task in the given queue.
EventGenericThreads< DevCpu > EventCpu
ALPAKA_FN_HOST auto wait(TAwaited const &awaited) -> void
Waits the thread for the completion of the given awaited action to complete.
The CPU collective device queue.
std::shared_ptr< cpu::detail::QueueCpuOmp2CollectiveImpl > m_spQueueImpl
auto operator==(QueueCpuOmp2Collective const &rhs) const -> bool
QueueCpuOmp2Collective(DevCpu const &dev)
auto operator!=(QueueCpuOmp2Collective const &rhs) const -> bool
The CPU collective device queue implementation.
void wait(EventCpu const &ev) final
void busyWaitUntilBlockingQueueEmpty()
QueueCpuOmp2CollectiveImpl(DevCpu const &dev) noexcept
DevCpu const m_dev
The device this queue is bound to.
QueueCpuBlocking blockingQueue
std::atomic< uint32_t > m_uCurrentlyExecutingTask
void enqueue(EventCpu &ev) final
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
The blocking queue trait.
static ALPAKA_FN_HOST auto currentThreadWaitFor(QueueCpuOmp2Collective const &queue) -> void
static ALPAKA_FN_HOST auto empty(QueueCpuOmp2Collective const &queue) -> bool
static ALPAKA_FN_HOST auto enqueue(QueueCpuOmp2Collective &queue, EventCpu &event) -> void
static ALPAKA_FN_HOST auto enqueue(QueueCpuOmp2Collective &queue, TTask const &task) -> void
static ALPAKA_FN_HOST auto enqueue(QueueCpuOmp2Collective &queue, TaskKernelCpuOmp2Blocks< TDim, TIdx, TKernelFnObj, TArgs... > const &task) -> void
static ALPAKA_FN_HOST auto enqueue(QueueCpuOmp2Collective &, test::EventHostManualTriggerCpu<> &) -> void
static ALPAKA_FN_HOST auto enqueue(cpu::detail::QueueCpuOmp2CollectiveImpl &, EventCpu &) -> void
static ALPAKA_FN_HOST auto getDev(QueueCpuOmp2Collective const &queue) -> DevCpu
static ALPAKA_FN_HOST auto waiterWaitFor(QueueCpuOmp2Collective &queue, EventCpu const &event) -> void
static ALPAKA_FN_HOST auto waiterWaitFor(cpu::detail::QueueCpuOmp2CollectiveImpl &, EventCpu const &) -> void