Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
AcceleratorInitializer.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* AcceleratorInitializer.h (C) 2000-2026 */
9/* */
10/* Initializer for an accelerator runtime. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_ACCELERATOR_ACCELERATORINITIALIZER_H
13#define ARCCORE_ACCELERATOR_ACCELERATORINITIALIZER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/accelerator/AcceleratorGlobal.h"
18
19#include <memory>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane::Accelerator
25{
26class Initializer;
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31/*!
32 * \brief Class to initialize a runtime for the accelerator API.
33 *
34 * \warning Experimental API currently being defined.
35 *
36 * Only one instance of this class can exist at any given time.
37 */
38class ARCCORE_ACCELERATOR_EXPORT AcceleratorInitializer
39{
40 public:
41
42 //! Initializes a sequential runtime
44
45 /*!
46 * \brief Initializes a runtime.
47 *
48 * If \a use_accelerator is true, the accelerator runtime is initialized
49 * used to compile Arcane. In this case, executionPolicy() will return
50 * this runtime.
51 *
52 * If \a nb_thread is greater than 1, the multi-threaded runtime is also
53 * initialized.
54 */
55 explicit AcceleratorInitializer(bool use_accelerator, Int32 nb_thread = 1);
56
58
59 public:
60
63 AcceleratorInitializer& operator=(const AcceleratorInitializer&) = delete;
65
66 public:
67
68 //! Default initialized execution policy
70
71 //! Associated trace manager
72 ITraceMng* traceMng() const;
73
74 private:
75
76 std::unique_ptr<Initializer> m_initializer;
77};
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82} // namespace Arcane::Accelerator
83
84/*---------------------------------------------------------------------------*/
85/*---------------------------------------------------------------------------*/
86
87#endif
eExecutionPolicy executionPolicy() const
Default initialized execution policy.
ITraceMng * traceMng() const
Associated trace manager.
AcceleratorInitializer()
Initializes a sequential runtime.
Namespace for accelerator usage.
eExecutionPolicy
Execution policy for a Runner.
std::int32_t Int32
Signed integer type of 32 bits.