Execution manager for accelerator. More...
#include <arccore/common/accelerator/Runner.h>
Public Member Functions | |
| Runner () | |
| Creates an uninitialized execution manager. | |
| Runner (eExecutionPolicy p) | |
| Creates and initializes a manager for the accelerator p. | |
| Runner (eExecutionPolicy p, DeviceId device) | |
| Creates and initializes a manager for the accelerator p and the device device. | |
| eExecutionPolicy | executionPolicy () const |
| Associated execution policy. | |
| void | initialize (eExecutionPolicy v) |
| Initializes the instance. This method must be called only once. | |
| void | initialize (eExecutionPolicy v, DeviceId device) |
| Initializes the instance. This method must be called only once. | |
| bool | isInitialized () const |
| Indicates whether the instance has been initialized. | |
| void | setConcurrentQueueCreation (bool v) |
| Indicates whether multiple threads are allowed to create RunQueues. | |
| bool | isConcurrentQueueCreation () const |
| Indicates whether concurrent creation of multiple RunQueues is allowed. | |
| double | cumulativeCommandTime () const |
| Total time spent in commands associated with this instance. | |
| void | setDeviceReducePolicy (eDeviceReducePolicy v) |
| Sets the execution policy for reductions. | |
| eDeviceReducePolicy | deviceReducePolicy () const |
| Reduction execution policy. | |
| void | setMemoryAdvice (ConstMemoryView buffer, eMemoryAdvice advice) |
| Sets memory advice for a memory region. | |
| void | unsetMemoryAdvice (ConstMemoryView buffer, eMemoryAdvice advice) |
| Unsets memory advice for a memory region. | |
| DeviceId | deviceId () const |
| Device associated with this instance. | |
| void | setAsCurrentDevice () |
| Sets the device associated with this instance as the default context device. | |
| const DeviceInfo & | deviceInfo () const |
| Information about the device associated with this instance. | |
| DeviceMemoryInfo | deviceMemoryInfo () const |
| Information about the device associated with this instance. | |
| void | fillPointerAttribute (PointerAttribute &attr, const void *ptr) |
| Fills attr with information concerning the memory region pointed to by ptr. | |
| RunnerInternal * | _internalApi () |
| Internal API for Arcane. | |
Static Public Member Functions | |
| static const IDeviceInfoList * | deviceInfoList (eExecutionPolicy policy) |
| List of devices for the execution policy policy. | |
Friends | |
| RunQueue | makeQueue (const Runner &runner) |
| Creates a queue associated with runner. | |
| RunQueue | makeQueue (const Runner *runner) |
| Creates a queue associated with runner. | |
| RunQueue | makeQueue (const Runner &runner, const RunQueueBuildInfo &bi) |
| Creates a queue associated with runner with properties bi. | |
| RunQueue | makeQueue (const Runner *runner, const RunQueueBuildInfo &bi) |
| Creates a queue associated with runner with properties bi. | |
| Ref< RunQueue > | makeQueueRef (const Runner &runner) |
| Creates a reference to a queue with the default execution policy of runner. | |
| Ref< RunQueue > | makeQueueRef (Runner &runner, const RunQueueBuildInfo &bi) |
| Creates a reference to a queue with the default execution policy of runner. | |
| Ref< RunQueue > | makeQueueRef (Runner *runner) |
| Creates a reference to a queue with the default execution policy of runner. | |
Execution manager for accelerator.
This class uses reference semantics
An instance of this class represents an execution backend. It must be initialized using initialize() before its methods can be used, or one of the constructors other than the default constructor must be called. The backend used is chosen via the eExecutionPolicy enumeration. The backends are of two types:
The function isAcceleratorPolicy() allows you to know if an eExecutionPolicy is associated with an accelerator.
If an instance of this class is associated with an accelerator, that accelerator is not necessarily the one used by default for the current thread. To ensure that the kernels associated with this runner are executed on the correct device, it is necessary to call the setAsCurrentDevice() method at least once, and to do so again if another part of the code or an external library changes the default accelerator.
The Runner class allows creating execution queues (RunQueue) via the makeQueue() function. These queues can then be used to launch commands (RunCommand). The page Accelerator API describes the operation of the accelerator API.
Definition at line 62 of file arccore/src/common/arccore/common/accelerator/Runner.h.
Creates an uninitialized execution manager.
initialize() must be called before the instance can be used
|
explicit |
| Arcane::Accelerator::Runner::Runner | ( | eExecutionPolicy | p, |
| DeviceId | device ) |
| RunnerInternal * Arcane::Accelerator::Runner::_internalApi | ( | ) |
| double Arcane::Accelerator::Runner::cumulativeCommandTime | ( | ) | const |
| const DeviceInfo & Arcane::Accelerator::Runner::deviceInfo | ( | ) | const |
|
static |
| void Arcane::Accelerator::Runner::fillPointerAttribute | ( | PointerAttribute & | attr, |
| const void * | ptr ) |
| void Arcane::Accelerator::Runner::initialize | ( | eExecutionPolicy | v, |
| DeviceId | device ) |
| bool Arcane::Accelerator::Runner::isConcurrentQueueCreation | ( | ) | const |
| bool Arcane::Accelerator::Runner::isInitialized | ( | ) | const |
| void Arcane::Accelerator::Runner::setConcurrentQueueCreation | ( | bool | v | ) |
Indicates whether multiple threads are allowed to create RunQueues.
| void Arcane::Accelerator::Runner::setMemoryAdvice | ( | ConstMemoryView | buffer, |
| eMemoryAdvice | advice ) |
| void Arcane::Accelerator::Runner::unsetMemoryAdvice | ( | ConstMemoryView | buffer, |
| eMemoryAdvice | advice ) |
|
friend |
Creates a queue associated with runner.
This call is thread-safe.
Definition at line 219 of file arccore/src/common/arccore/common/accelerator/Runner.h.
|
friend |
Creates a queue associated with runner with properties bi.
This call is thread-safe.
Definition at line 248 of file arccore/src/common/arccore/common/accelerator/Runner.h.
|
friend |
Creates a queue associated with runner.
This call is thread-safe.
Definition at line 233 of file arccore/src/common/arccore/common/accelerator/Runner.h.
|
friend |
Creates a queue associated with runner with properties bi.
This call is thread-safe.
Definition at line 262 of file arccore/src/common/arccore/common/accelerator/Runner.h.
Creates a reference to a queue with the default execution policy of runner.
If the queue is temporary, it is preferable to use makeQueue() instead to avoid unnecessary allocation.
Definition at line 279 of file arccore/src/common/arccore/common/accelerator/Runner.h.
|
friend |
Creates a reference to a queue with the default execution policy of runner.
If the queue is temporary, it is preferable to use makeQueue() instead to avoid unnecessary allocation.
Definition at line 295 of file arccore/src/common/arccore/common/accelerator/Runner.h.
Creates a reference to a queue with the default execution policy of runner.
If the queue is temporary, it is preferable to use makeQueue() instead to avoid unnecessary allocation.
Definition at line 311 of file arccore/src/common/arccore/common/accelerator/Runner.h.