Arcane  v4.1.1.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-2025 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-2025 */
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/*---------------------------------------------------------------------------*/
71extern "C++" ARCANE_UTILS_EXPORT ISymbolizerService*
73
80extern "C++" ARCANE_UTILS_EXPORT ISymbolizerService*
81setSymbolizerService(ISymbolizerService* service);
82
88extern "C++" ARCANE_UTILS_EXPORT IProcessorAffinityService*
90
96extern "C++" ARCANE_UTILS_EXPORT IProcessorAffinityService*
97setProcessorAffinityService(IProcessorAffinityService* service);
98
104extern "C++" ARCANE_UTILS_EXPORT IProfilingService*
106
112extern "C++" ARCANE_UTILS_EXPORT IProfilingService*
113setProfilingService(IProfilingService* service);
114
120extern "C++" ARCANE_UTILS_EXPORT IOnlineDebuggerService*
122
128extern "C++" ARCANE_UTILS_EXPORT IOnlineDebuggerService*
129setOnlineDebuggerService(IOnlineDebuggerService* service);
130
136extern "C++" ARCANE_UTILS_EXPORT IThreadImplementation*
138
144extern "C++" ARCANE_UTILS_EXPORT IThreadImplementation*
145setThreadImplementationService(IThreadImplementation* service);
146
152extern "C++" ARCANE_UTILS_EXPORT IDynamicLibraryLoader*
154
160extern "C++" ARCANE_UTILS_EXPORT IDynamicLibraryLoader*
161setDynamicLibraryLoader(IDynamicLibraryLoader* idll);
162
168extern "C++" ARCANE_UTILS_EXPORT IPerformanceCounterService*
169setPerformanceCounterService(IPerformanceCounterService* service);
170
176extern "C++" ARCANE_UTILS_EXPORT IPerformanceCounterService*
178
179/*---------------------------------------------------------------------------*/
180/*---------------------------------------------------------------------------*/
186extern "C++" ARCANE_UTILS_EXPORT void
187resetAlarmTimer(Integer nb_second);
188
192extern "C++" ARCANE_UTILS_EXPORT bool
194
201extern "C++" ARCANE_UTILS_EXPORT void
202setHasDotNETRuntime(bool v);
203
204/*---------------------------------------------------------------------------*/
205/*---------------------------------------------------------------------------*/
206
208extern "C++" ARCANE_UTILS_EXPORT void
210
211/*---------------------------------------------------------------------------*/
212/*---------------------------------------------------------------------------*/
218extern "C++" ARCANE_DEPRECATED_REASON("Y2024: Use MemoryUtils::getDefaultDataAllocator() instead.")
219ARCANE_UTILS_EXPORT IMemoryAllocator*
221
222/*---------------------------------------------------------------------------*/
223/*---------------------------------------------------------------------------*/
232extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane")
233ARCANE_UTILS_EXPORT IMemoryAllocator*
234setAcceleratorHostMemoryAllocator(IMemoryAllocator* a);
235
236/*---------------------------------------------------------------------------*/
237/*---------------------------------------------------------------------------*/
250extern "C++" ARCANE_UTILS_EXPORT IMemoryAllocator*
252
253/*---------------------------------------------------------------------------*/
254/*---------------------------------------------------------------------------*/
264extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane")
265ARCANE_UTILS_EXPORT IMemoryRessourceMng*
266setDataMemoryRessourceMng(IMemoryRessourceMng* mng);
267
268/*---------------------------------------------------------------------------*/
269/*---------------------------------------------------------------------------*/
278extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane. Use methods from MemoryUtils instead.")
279ARCANE_UTILS_EXPORT IMemoryRessourceMng*
281
282/*---------------------------------------------------------------------------*/
283/*---------------------------------------------------------------------------*/
294extern "C++" ARCANE_UTILS_EXPORT bool
295readAllFile(StringView filename, bool is_binary, ByteArray& out_bytes);
296
297/*---------------------------------------------------------------------------*/
298/*---------------------------------------------------------------------------*/
309extern "C++" ARCANE_UTILS_EXPORT bool
310readAllFile(StringView filename, bool is_binary, Array<std::byte>& out_bytes);
311
312/*---------------------------------------------------------------------------*/
313/*---------------------------------------------------------------------------*/
317extern "C++" ARCANE_UTILS_EXPORT String
319
320/*---------------------------------------------------------------------------*/
321/*---------------------------------------------------------------------------*/
333extern "C++" ARCANE_UTILS_EXPORT String
334getLoadedSharedLibraryFullPath(const String& dll_name);
335
336/*---------------------------------------------------------------------------*/
337/*---------------------------------------------------------------------------*/
347extern "C++" ARCANE_UTILS_EXPORT void
349
350/*---------------------------------------------------------------------------*/
351/*---------------------------------------------------------------------------*/
362extern "C++" ARCANE_UTILS_EXPORT String
364
365/*---------------------------------------------------------------------------*/
366/*---------------------------------------------------------------------------*/
374extern "C++" ARCANE_UTILS_EXPORT String
376
377/*---------------------------------------------------------------------------*/
378/*---------------------------------------------------------------------------*/
379
380// Définition du pragma pour indiquer l'indépendance des itérations
381
387
392
393// Pour les définitions, il faut finir par GCC car Clang et ICC définissent
394// la macro __GNU__
395// Pour CLANG, il n'y a pas encore d'équivalent au pragma ivdep de ICC.
396// Celui qui s'en approche le plus est:
397// #pragma clang loop vectorize(enable)
398// mais il ne force pas la vectorisation.
399#ifdef __clang__
400# define ARCANE_PRAGMA_IVDEP_VALUE "clang loop vectorize(enable)"
401#else
402# ifdef __INTEL_COMPILER
403# define ARCANE_PRAGMA_IVDEP_VALUE "ivdep"
404# else
405# ifdef __GNUC__
406# if (__GNUC__>=5)
407# define ARCANE_PRAGMA_IVDEP_VALUE "GCC ivdep"
408# endif
409# endif
410# endif
411#endif
412
413#ifdef ARCANE_PRAGMA_IVDEP_VALUE
414#define ARCANE_PRAGMA_IVDEP _Pragma(ARCANE_PRAGMA_IVDEP_VALUE)
415#else
416#define ARCANE_PRAGMA_IVDEP
417#define ARCANE_PRAGMA_IVDEP_VALUE ""
418#endif
419
420/*---------------------------------------------------------------------------*/
421/*---------------------------------------------------------------------------*/
422
423} // End namespace platform
424
425/*---------------------------------------------------------------------------*/
426/*---------------------------------------------------------------------------*/
427
428} // End namespace Arcane
429
430/*---------------------------------------------------------------------------*/
431/*---------------------------------------------------------------------------*/
432
433#endif
Déclarations des types utilisés dans Arcane.
Interface d'une chargeur dynamique de bibliothèque.
Interface d'un service de debugger hybrid.
Interface d'un service de de trace des appels de fonctions.
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.
String getLoadedSharedLibraryFullPath(const String &dll_name)
Retourne le chemin complet d'une bibliothèque dynamique chargée.
ISymbolizerService * setSymbolizerService(ISymbolizerService *service)
Positionne le service pour obtenir des informations sur les symboles du code source.
IDynamicLibraryLoader * getDynamicLibraryLoader()
Service utilisé pour charger dynamiquement des bibliothèques.
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.
ISymbolizerService * getSymbolizerService()
Service utilisé pour obtenir des informations sur les symboles du code source.
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.
IDynamicLibraryLoader * setDynamicLibraryLoader(IDynamicLibraryLoader *idll)
Positionne le service utilisé pour charger dynamiquement des bibliothèques.
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:137
List< String > StringList
Tableau de chaînes de caractères unicode.
Definition UtilsTypes.h:525