Arcane  4.2.3.0
User documentation
Loading...
Searching...
No Matches
CommonGlobal.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/* CommonGlobal.h (C) 2000-2026 */
9/* */
10/* Global definitions for the 'Common' component of 'Arccore'. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_COMMONGLOBAL_H
13#define ARCCORE_COMMON_COMMONGLOBAL_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19#include <iosfwd>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24#if defined(ARCCORE_COMPONENT_arccore_common)
25#define ARCCORE_COMMON_EXPORT ARCCORE_EXPORT
26#define ARCCORE_COMMON_EXTERN_TPL
27#else
28#define ARCCORE_COMMON_EXPORT ARCCORE_IMPORT
29#define ARCCORE_COMMON_EXTERN_TPL extern
30#endif
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35namespace Arcane::Accelerator
36{
37class RunQueue;
38};
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
43// For now, ArrayTraits must remain in the Arccore namespace
44// for compatibility reasons with the ARCCORE_DEFINE_ARRAY_PODTYPE macro
45namespace Arccore
46{
47template <typename DataType> class ArrayTraits;
48}
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53namespace Arcane
54{
55using Arcane::Accelerator::RunQueue;
56
57/*---------------------------------------------------------------------------*/
58/*---------------------------------------------------------------------------*/
59
60class IMemoryResourceMngInternal;
62class IMemoryCopier;
63class IMemoryPool;
64
67class ArrayDebugInfo;
73
74class ArrayImplBase;
75class ArrayMetaData;
76template <typename DataType> class ArrayImplT;
77template <typename DataType> class Array;
78template <typename DataType> class AbstractArray;
79template <typename DataType> class UniqueArray;
80template <typename DataType> class SharedArray;
81using Arccore::ArrayTraits;
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86template <typename T> class EnumeratorT;
87template <typename T> class ListEnumeratorT;
88
89template <typename T> class Collection;
90template <typename T> class List;
91
94template <typename... Args> class EventObservable;
95template <typename... Args> class EventObserver;
96template <typename... Args> class EventObservableView;
97
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
103class JSONWriter;
104class JSONValue;
105class JSONDocument;
106class JSONValueList;
107class JSONWrapperUtils;
108class JSONKeyValue;
109class JSONKeyValueList;
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114template <typename DataType>
115class DataViewSetter;
116template <typename DataType>
117class DataViewGetter;
118template <typename DataType>
120template <typename DataType_, int Size>
122template <typename DataType_, int Size>
124template <typename DataType_, int Row, int Column>
126template <typename DataType_, int Row, int Column>
128
129/*---------------------------------------------------------------------------*/
130/*---------------------------------------------------------------------------*/
131
133class ArcaNetReader;
134
135/*---------------------------------------------------------------------------*/
136/*---------------------------------------------------------------------------*/
137
138//! Indices for expected memory location
139enum class eMemoryLocationHint : int8_t
140{
141 //! No hint
142 None = 0,
143 //! Indicates that the data will primarily be used on the accelerator
145 //! Indicates that the data will primarily be used on the CPU
147 /*!
148 * \brief Indicates that the data will be used both on the accelerator and
149 * on the CPU and will not be frequently modified.
150 */
152};
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
157/*!
158 * \brief Physical location of a memory address.
159 *
160 * For the ManagedMemoryDevice and ManagedMemoryHost values, this is an
161 * indication because there is no simple way to know where
162 * the memory is actually located.
163 */
164enum class eHostDeviceMemoryLocation : int8_t
165{
166 //! Unknown location
168 //! The memory is on the accelerator
170 //! The memory is on the host.
171 Host = 2,
172 //! The memory is managed memory on the accelerator
174 //! The memory is managed memory on the host.
176};
177
178extern "C++" ARCCORE_COMMON_EXPORT std::ostream&
179operator<<(std::ostream& o, eHostDeviceMemoryLocation r);
180
181/*---------------------------------------------------------------------------*/
182/*---------------------------------------------------------------------------*/
183
184/*!
185 * \brief List of available memory resources.
186 */
188{
189 //! Unknown or uninitialized value
191 //! Allocates on the host.
193 //! Allocates on the host.
195 //! Allocates on the device
197 //! Allocates using unified memory.
199};
200
201//! Number of valid values for eMemoryResource
202static constexpr int ARCCORE_NB_MEMORY_RESOURCE = 5;
203
204/*---------------------------------------------------------------------------*/
205/*---------------------------------------------------------------------------*/
206
207extern "C++" ARCCORE_COMMON_EXPORT std::ostream&
208operator<<(std::ostream& o, eMemoryResource r);
209
210/*---------------------------------------------------------------------------*/
211/*---------------------------------------------------------------------------*/
212
213/*!
214 * \brief Padding size for indices in SIMD operations.
215 *
216 * To ensure the same code regardless of the vectorization mechanism
217 * used, this value is fixed and corresponds to the largest SIMD vector.
218 *
219 * \sa arcanedoc_simd
220 */
221static const Integer SIMD_PADDING_SIZE = 8;
222
223/*---------------------------------------------------------------------------*/
224/*---------------------------------------------------------------------------*/
225
226namespace Impl
227{
228 class StridedLoopRangesBase;
229 template <typename LoopRangesType>
231}; // namespace Impl
232
233/*---------------------------------------------------------------------------*/
234/*---------------------------------------------------------------------------*/
235
236} // namespace Arcane
237
238/*---------------------------------------------------------------------------*/
239/*---------------------------------------------------------------------------*/
240
241#endif
Definitions and globals of Arccore.
Abstract base class for a vector.
Memory allocator with specific memory alignment.
Information about an allocated memory region.
Class allowing to read ArcaNet files.
Debug information for array classes.
Base class for 1D data vectors.
Base class for a strongly typed collection.
Class for accessing an element of a read/write view.
Class for accessing an element of a read view.
Class for accessing an element of a write view.
Memory allocator via malloc/realloc/free.
Class managing observers associated with an event.
Interface of a memory pool.
Definition IMemoryPool.h:32
List of (key,value) pairs of a JSON document.
Implementation of a collection of elements in vector form.
Class containing information to specialize allocations.
Mutable view for a NumMatrix<DataType_,Row,Column>.
Read-only view for a NumMatrix<DataType_,Row,Column>.
Mutable view for a NumVector<DataType_,Size>.
Read-only view for a NumVector<DataType_, Size_>.
Memory allocator via malloc/realloc/free with listing output.
1D vector of data with reference semantics.
1D data vector with value semantics (STL style).
Characteristics for an array.
Namespace for accelerator usage.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
@ Unknown
Unknown or not initialized.
Definition MeshKind.h:32
List< String > StringList
Unicode string list.
Definition UtilsTypes.h:503
eMemoryLocationHint
Indices for expected memory location.
@ MainlyHost
Indicates that the data will primarily be used on the CPU.
@ HostAndDeviceMostlyRead
Indicates that the data will be used both on the accelerator and on the CPU and will not be frequentl...
@ MainlyDevice
Indicates that the data will primarily be used on the accelerator.
eHostDeviceMemoryLocation
Physical location of a memory address.
@ ManagedMemoryDevice
The memory is managed memory on the accelerator.
@ Host
The memory is on the host.
@ ManagedMemoryHost
The memory is managed memory on the host.
@ Device
The memory is on the accelerator.
eMemoryResource
List of available memory resources.
@ HostPinned
Allocates on the host.
@ UnifiedMemory
Allocates using unified memory.
std::ostream & operator<<(std::ostream &ostr, eItemKind item_kind)
Output operator for a stream.
@ None
The mesh is not AMR.
Definition MeshKind.h:51
Namespace of Arccore.