Arcane  v4.1.4.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
arcane/src/arcane/utils/PlatformUtils.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/* PlatformUtils.h (C) 2000-2026 */
9/* */
10/* Fonctions utilitaires dépendant de la plateforme. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_PLATFORMUTILS_H
13#define ARCANE_UTILS_PLATFORMUTILS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/base/PlatformUtils.h"
19
20#include <iosfwd>
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
44namespace platform
45{
46
54extern "C++" ARCANE_UTILS_EXPORT void platformInitialize();
55
61extern "C++" ARCANE_UTILS_EXPORT void platformTerminate();
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
71extern "C++" ARCANE_UTILS_EXPORT IProcessorAffinityService*
73
79extern "C++" ARCCORE_DEPRECATED_REASON("Y2025: This method is internal to Arcane")
80ARCANE_UTILS_EXPORT IProcessorAffinityService*
81setProcessorAffinityService(IProcessorAffinityService* service);
82
88extern "C++" ARCANE_UTILS_EXPORT IProfilingService*
90
96extern "C++" ARCCORE_DEPRECATED_REASON("Y2025: This method is internal to Arcane")
97ARCANE_UTILS_EXPORT IProfilingService*
98setProfilingService(IProfilingService* service);
99
105extern "C++" ARCANE_UTILS_EXPORT IOnlineDebuggerService*
107
113extern "C++" ARCCORE_DEPRECATED_REASON("Y2025: This method is internal to Arcane")
114ARCANE_UTILS_EXPORT IOnlineDebuggerService*
115setOnlineDebuggerService(IOnlineDebuggerService* service);
116
122extern "C++" ARCANE_UTILS_EXPORT IThreadImplementation*
124
130extern "C++" ARCCORE_DEPRECATED_REASON("Y2025: This method is internal to Arcane")
131ARCANE_UTILS_EXPORT IThreadImplementation*
132setThreadImplementationService(IThreadImplementation* service);
133
139extern "C++" ARCCORE_DEPRECATED_REASON("Y2025: This method is internal to Arcane")
140ARCANE_UTILS_EXPORT IPerformanceCounterService*
141setPerformanceCounterService(IPerformanceCounterService* service);
142
148extern "C++" ARCANE_UTILS_EXPORT IPerformanceCounterService*
150
151/*---------------------------------------------------------------------------*/
152/*---------------------------------------------------------------------------*/
158extern "C++" ARCANE_UTILS_EXPORT void
159resetAlarmTimer(Integer nb_second);
160
164extern "C++" ARCANE_UTILS_EXPORT bool
166
173extern "C++" ARCANE_UTILS_EXPORT void
174setHasDotNETRuntime(bool v);
175
176/*---------------------------------------------------------------------------*/
177/*---------------------------------------------------------------------------*/
178
180extern "C++" ARCANE_UTILS_EXPORT void
182
183/*---------------------------------------------------------------------------*/
184/*---------------------------------------------------------------------------*/
190extern "C++" ARCANE_DEPRECATED_REASON("Y2024: Use MemoryUtils::getDefaultDataAllocator() instead.")
191ARCANE_UTILS_EXPORT IMemoryAllocator*
193
194/*---------------------------------------------------------------------------*/
195/*---------------------------------------------------------------------------*/
204extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane")
205ARCANE_UTILS_EXPORT IMemoryAllocator*
206setAcceleratorHostMemoryAllocator(IMemoryAllocator* a);
207
208/*---------------------------------------------------------------------------*/
209/*---------------------------------------------------------------------------*/
222extern "C++" ARCANE_UTILS_EXPORT IMemoryAllocator*
224
225/*---------------------------------------------------------------------------*/
226/*---------------------------------------------------------------------------*/
236extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane")
237ARCANE_UTILS_EXPORT IMemoryRessourceMng*
238setDataMemoryRessourceMng(IMemoryRessourceMng* mng);
239
240/*---------------------------------------------------------------------------*/
241/*---------------------------------------------------------------------------*/
250extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane. Use methods from MemoryUtils instead.")
251ARCANE_UTILS_EXPORT IMemoryRessourceMng*
253
254/*---------------------------------------------------------------------------*/
255/*---------------------------------------------------------------------------*/
266extern "C++" ARCANE_UTILS_EXPORT bool
267readAllFile(StringView filename, bool is_binary, ByteArray& out_bytes);
268
269/*---------------------------------------------------------------------------*/
270/*---------------------------------------------------------------------------*/
281extern "C++" ARCANE_UTILS_EXPORT bool
282readAllFile(StringView filename, bool is_binary, Array<std::byte>& out_bytes);
283
284/*---------------------------------------------------------------------------*/
285/*---------------------------------------------------------------------------*/
289extern "C++" ARCANE_UTILS_EXPORT String
291
292/*---------------------------------------------------------------------------*/
293/*---------------------------------------------------------------------------*/
303extern "C++" ARCANE_UTILS_EXPORT void
305
306/*---------------------------------------------------------------------------*/
307/*---------------------------------------------------------------------------*/
318extern "C++" ARCANE_UTILS_EXPORT String
320
321/*---------------------------------------------------------------------------*/
322/*---------------------------------------------------------------------------*/
330extern "C++" ARCANE_UTILS_EXPORT String
332
333/*---------------------------------------------------------------------------*/
334/*---------------------------------------------------------------------------*/
335
336// Définition du pragma pour indiquer l'indépendance des itérations
337
343
348
349// Pour les définitions, il faut finir par GCC car Clang et ICC définissent
350// la macro __GNU__
351// Pour CLANG, il n'y a pas encore d'équivalent au pragma ivdep de ICC.
352// Celui qui s'en approche le plus est:
353// #pragma clang loop vectorize(enable)
354// mais il ne force pas la vectorisation.
355#ifdef __clang__
356# define ARCANE_PRAGMA_IVDEP_VALUE "clang loop vectorize(enable)"
357#else
358# ifdef __INTEL_COMPILER
359# define ARCANE_PRAGMA_IVDEP_VALUE "ivdep"
360# else
361# ifdef __GNUC__
362# if (__GNUC__>=5)
363# define ARCANE_PRAGMA_IVDEP_VALUE "GCC ivdep"
364# endif
365# endif
366# endif
367#endif
368
369#ifdef ARCANE_PRAGMA_IVDEP_VALUE
370#define ARCANE_PRAGMA_IVDEP _Pragma(ARCANE_PRAGMA_IVDEP_VALUE)
371#else
372#define ARCANE_PRAGMA_IVDEP
373#define ARCANE_PRAGMA_IVDEP_VALUE ""
374#endif
375
376/*---------------------------------------------------------------------------*/
377/*---------------------------------------------------------------------------*/
378
379} // End namespace platform
380
381/*---------------------------------------------------------------------------*/
382/*---------------------------------------------------------------------------*/
383
384} // End namespace Arcane
385
386/*---------------------------------------------------------------------------*/
387/*---------------------------------------------------------------------------*/
388
389#endif
Déclarations des types utilisés dans Arcane.
Interface d'un chargeur dynamique de bibliothèque.
Interface d'un service de debugger hybrid.
Interface d'un service de gestion de l'affinité des coeurs CPU.
Interface d'un service de profiling.
Interface d'un service de récupération des symboles du code source.
Espace de nom pour les fonctions dépendant de la plateforme.
IPerformanceCounterService * setPerformanceCounterService(IPerformanceCounterService *service)
Positionne le service utilisé pour gérer les compteurs interne du processeur.
void callDotNETGarbageCollector()
Appelle le Garbage Collector de '.Net' s'il est disponible.
String getLLDBStack()
Récupère la pile d'appel via lldb.
void fillCommandLineArguments(StringList &arg_list)
Remplit arg_list avec les arguments de la ligne de commande.
IMemoryRessourceMng * setDataMemoryRessourceMng(IMemoryRessourceMng *mng)
Positionne le gestionnaire de ressource mémoire pour les données.
void platformInitialize()
Initialisations spécifiques à une platforme.
IOnlineDebuggerService * setOnlineDebuggerService(IOnlineDebuggerService *service)
Positionne le service a utiliser pour l'architecture en ligne de debug.
IProfilingService * getProfilingService()
Service utilisé pour obtenir pour obtenir des informations de profiling.
IMemoryRessourceMng * getDataMemoryRessourceMng()
Gestionnaire de ressource mémoire pour les données.
void resetAlarmTimer(Integer nb_second)
Remet à timer d'alarme à nb_second.
void platformTerminate()
Routines de fin de programme spécifiques à une platforme.
IProfilingService * setProfilingService(IProfilingService *service)
Positionne le service utilisé pour obtenir des informations de profiling.
IMemoryAllocator * getAcceleratorHostMemoryAllocator()
Allocateur spécifique pour les accélérateurs.
IMemoryAllocator * getDefaultDataAllocator()
Allocateur par défaut pour les données.
String getExeFullPath()
Retourne le nom complet avec le chemin de l'exécutable.
bool readAllFile(StringView filename, bool is_binary, ByteArray &out_bytes)
Lit le contenu d'un fichier et le conserve dans out_bytes.
IProcessorAffinityService * setProcessorAffinityService(IProcessorAffinityService *service)
Positionne le service utilisé pour la gestion de l'affinité des processeurs.
void setHasDotNETRuntime(bool v)
Positionne si le code s'exécute avec le runtime .NET.
IProcessorAffinityService * getProcessorAffinityService()
Service utilisé pour la gestion de l'affinité des processeurs.
IMemoryAllocator * setAcceleratorHostMemoryAllocator(IMemoryAllocator *a)
Positionne l'allocateur spécifique pour les accélérateurs.
IThreadImplementation * getThreadImplementationService()
Service utilisé pour gérer les threads.
IPerformanceCounterService * getPerformanceCounterService()
Service utilisé pour obtenir pour obtenir les compteurs interne du processeur.
bool hasDotNETRuntime()
Vrai si le code s'exécute avec le runtime .NET.
String getGDBStack()
Récupère la pile d'appel via gdb.
IThreadImplementation * setThreadImplementationService(IThreadImplementation *service)
Positionne le service utilisé pour gérer les threads.
IOnlineDebuggerService * getOnlineDebuggerService()
Service utilisé pour obtenir la mise en place d'une architecture en ligne de debug.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
Array< Byte > ByteArray
Tableau dynamique à une dimension de caractères.
Definition UtilsTypes.h:121
List< String > StringList
Tableau de chaînes de caractères unicode.
Definition UtilsTypes.h:509