12#ifndef ARCANE_ACCELERATOR_ASYNC_RUNQUEUE_POOL_H
13#define ARCANE_ACCELERATOR_ASYNC_RUNQUEUE_POOL_H
18#include "arcane/accelerator/core/Runner.h"
19#include "arcane/accelerator/core/RunQueue.h"
20#include "arcane/accelerator/core/RunQueueBuildInfo.h"
43class AsyncRunQueuePool
53 AsyncRunQueuePool() =
delete;
54 AsyncRunQueuePool(
const AsyncRunQueuePool&) =
delete;
55 AsyncRunQueuePool(AsyncRunQueuePool&&) =
delete;
56 AsyncRunQueuePool& operator=(
const AsyncRunQueuePool&) =
delete;
57 AsyncRunQueuePool& operator=(AsyncRunQueuePool&&) =
delete;
63 m_pool.reserve(m_pool_size);
64 for (
Int32 i(0); i < m_pool_size; ++i) {
67 bi.
setPriority(
static_cast<std::underlying_type_t<eRunQueuePriority>
>(queues_priority));
69 queue_ref->setAsync(
true);
70 m_pool.add(queue_ref);
84 return *(m_pool[i % m_pool_size].get());
90 return m_pool[i % m_pool_size].get();
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
Collection of asynchronous execution queues with priority on accelerator.
Int32 poolSize() const
Size of the collection.
RunQueue * operator[](Int32 i)
To retrieve the i % poolSize() i-th execution queue.
static constexpr Int32 POOL_MAX_SIZE
Up to 32 queues (32 = max number of kernels executable simultaneously).
const RunQueue & operator[](Int32 i) const
To retrieve the i % poolSize() i-th execution queue.
void waitAll() const
Forces waiting for all RunQueues.
Information to create a RunQueue.
void setPriority(int priority)
Sets the priority.
Execution queue for an accelerator.
Execution manager for accelerator.
1D data vector with value semantics (STL style).
Namespace for accelerator usage.
Ref< RunQueue > makeQueueRef(const Runner &runner)
Creates a reference to a queue with the default execution policy of runner.
AsyncRunQueuePool makeAsyncQueuePool(Runner &runner)
Creates a temporary queue pool associated with runner.
eRunQueuePriority
Predefined priority levels for run queues on accelerators.
@ Default
Uses 0 as the default value.
std::int32_t Int32
Signed integer type of 32 bits.