Arcane  4.1.12.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>
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
125
126/*---------------------------------------------------------------------------*/
127/*---------------------------------------------------------------------------*/
128
129//! Indices for expected memory location
130enum class eMemoryLocationHint : int8_t
131{
132 //! No hint
133 None = 0,
134 //! Indicates that the data will primarily be used on the accelerator
136 //! Indicates that the data will primarily be used on the CPU
138 /*!
139 * \brief Indicates that the data will be used both on the accelerator and
140 * on the CPU and will not be frequently modified.
141 */
143};
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
148/*!
149 * \brief Physical location of a memory address.
150 *
151 * For the ManagedMemoryDevice and ManagedMemoryHost values, this is an
152 * indication because there is no simple way to know where
153 * the memory is actually located.
154 */
155enum class eHostDeviceMemoryLocation : int8_t
156{
157 //! Unknown location
159 //! The memory is on the accelerator
161 //! The memory is on the host.
162 Host = 2,
163 //! The memory is managed memory on the accelerator
165 //! The memory is managed memory on the host.
167};
168
169extern "C++" ARCCORE_COMMON_EXPORT std::ostream&
170operator<<(std::ostream& o, eHostDeviceMemoryLocation r);
171
172/*---------------------------------------------------------------------------*/
173/*---------------------------------------------------------------------------*/
174
175/*!
176 * \brief List of available memory resources.
177 */
179{
180 //! Unknown or uninitialized value
182 //! Allocates on the host.
184 //! Allocates on the host.
186 //! Allocates on the device
188 //! Allocates using unified memory.
190};
191
192//! Number of valid values for eMemoryResource
193static constexpr int ARCCORE_NB_MEMORY_RESOURCE = 5;
194
195/*---------------------------------------------------------------------------*/
196/*---------------------------------------------------------------------------*/
197
198extern "C++" ARCCORE_COMMON_EXPORT std::ostream&
199operator<<(std::ostream& o, eMemoryResource r);
200
201/*---------------------------------------------------------------------------*/
202/*---------------------------------------------------------------------------*/
203
204/*!
205 * \brief Padding size for indices in SIMD operations.
206 *
207 * To ensure the same code regardless of the vectorization mechanism
208 * used, this value is fixed and corresponds to the largest SIMD vector.
209 *
210 * \sa arcanedoc_simd
211 */
212static const Integer SIMD_PADDING_SIZE = 8;
213
214/*---------------------------------------------------------------------------*/
215/*---------------------------------------------------------------------------*/
216
217namespace Impl
218{
219 class StridedLoopRangesBase;
220 template <typename LoopRangesType>
222}; // namespace Impl
223
224/*---------------------------------------------------------------------------*/
225/*---------------------------------------------------------------------------*/
226
227} // namespace Arcane
228
229/*---------------------------------------------------------------------------*/
230/*---------------------------------------------------------------------------*/
231
232#endif
Definitions and globals of Arccore.
Abstract base class for a vector.
Memory allocator with specific memory alignment.
Information about an allocated memory region.
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.
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:509
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.