Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::Runner Class Reference

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 DeviceInfodeviceInfo () 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 IDeviceInfoListdeviceInfoList (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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ Runner() [1/3]

Creates an uninitialized execution manager.

initialize() must be called before the instance can be used

Definition at line 260 of file Runner.cc.

◆ Runner() [2/3]

Creates and initializes a manager for the accelerator p.

Definition at line 269 of file Runner.cc.

◆ Runner() [3/3]

Creates and initializes a manager for the accelerator p and the device device.

Definition at line 279 of file Runner.cc.

Member Function Documentation

◆ _internalApi()

Internal API for Arcane.

Definition at line 491 of file Runner.cc.

◆ cumulativeCommandTime()

Total time spent in commands associated with this instance.

This time is only meaningful if the RunQueues are synchronous.

Definition at line 385 of file Runner.cc.

◆ deviceId()

Device associated with this instance.

Definition at line 424 of file Runner.cc.

◆ deviceInfo()

Information about the device associated with this instance.

Definition at line 433 of file Runner.cc.

◆ deviceInfoList()

List of devices for the execution policy policy.

If the associated runtime has not yet been initialized, this method returns nullptr.

Definition at line 450 of file Runner.cc.

◆ deviceMemoryInfo()

Information about the device associated with this instance.

Definition at line 462 of file Runner.cc.

◆ deviceReducePolicy()

Reduction execution policy.

Definition at line 348 of file Runner.cc.

◆ executionPolicy()

Associated execution policy.

Definition at line 302 of file Runner.cc.

◆ fillPointerAttribute()

Fills attr with information concerning the memory region pointed to by ptr.

Definition at line 472 of file Runner.cc.

◆ initialize() [1/2]

Initializes the instance. This method must be called only once.

Definition at line 357 of file Runner.cc.

◆ initialize() [2/2]

Initializes the instance. This method must be called only once.

Definition at line 366 of file Runner.cc.

◆ isConcurrentQueueCreation()

Indicates whether concurrent creation of multiple RunQueues is allowed.

Definition at line 329 of file Runner.cc.

◆ isInitialized()

Indicates whether the instance has been initialized.

Definition at line 311 of file Runner.cc.

◆ setAsCurrentDevice()

Sets the device associated with this instance as the default context device.

This call is equivalent to cudaSetDevice() or hipSetDevice();

Definition at line 414 of file Runner.cc.

◆ setConcurrentQueueCreation()

Indicates whether multiple threads are allowed to create RunQueues.

Deprecated
Queue creation is always thread-safe since Arcane version 3.15.

Definition at line 320 of file Runner.cc.

◆ setDeviceReducePolicy()

Sets the execution policy for reductions.

Definition at line 338 of file Runner.cc.

◆ setMemoryAdvice()

Sets memory advice for a memory region.

Definition at line 394 of file Runner.cc.

◆ unsetMemoryAdvice()

Unsets memory advice for a memory region.

Definition at line 404 of file Runner.cc.

◆ makeQueue [1/4]

RunQueue makeQueue ( const Runner & runner)
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.

◆ makeQueue [2/4]

RunQueue makeQueue ( const Runner & runner,
const RunQueueBuildInfo & bi )
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.

◆ makeQueue [3/4]

RunQueue makeQueue ( const Runner * runner)
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.

◆ makeQueue [4/4]

RunQueue makeQueue ( const Runner * runner,
const RunQueueBuildInfo & bi )
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.

◆ makeQueueRef [1/3]

Ref< RunQueue > makeQueueRef ( const Runner & runner)
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 279 of file arccore/src/common/arccore/common/accelerator/Runner.h.

◆ makeQueueRef [2/3]

Ref< RunQueue > makeQueueRef ( Runner & runner,
const RunQueueBuildInfo & bi )
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.

◆ makeQueueRef [3/3]

Ref< RunQueue > makeQueueRef ( Runner * runner)
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 311 of file arccore/src/common/arccore/common/accelerator/Runner.h.


The documentation for this class was generated from the following files: