Arcane  v3.15.3.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
31class IOnlineDebuggerService;
32class IProfilingService;
33class IProcessorAffinityService;
34class IDynamicLibraryLoader;
35class ISymbolizerService;
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*
267
268
269/*---------------------------------------------------------------------------*/
270/*---------------------------------------------------------------------------*/
279extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane. Use methods from MemoryUtils instead.")
280ARCANE_UTILS_EXPORT IMemoryRessourceMng*
282
283/*---------------------------------------------------------------------------*/
284/*---------------------------------------------------------------------------*/
295extern "C++" ARCANE_UTILS_EXPORT bool
297
298/*---------------------------------------------------------------------------*/
299/*---------------------------------------------------------------------------*/
310extern "C++" ARCANE_UTILS_EXPORT bool
311readAllFile(StringView filename, bool is_binary, Array<std::byte>& out_bytes);
312
313/*---------------------------------------------------------------------------*/
314/*---------------------------------------------------------------------------*/
318extern "C++" ARCANE_UTILS_EXPORT String
320
321/*---------------------------------------------------------------------------*/
322/*---------------------------------------------------------------------------*/
326extern "C++" ARCANE_UTILS_EXPORT Int64
328
329/*---------------------------------------------------------------------------*/
330/*---------------------------------------------------------------------------*/
342extern "C++" ARCANE_UTILS_EXPORT String
344
345/*---------------------------------------------------------------------------*/
346/*---------------------------------------------------------------------------*/
356extern "C++" ARCANE_UTILS_EXPORT void
358
359/*---------------------------------------------------------------------------*/
360/*---------------------------------------------------------------------------*/
364extern "C++" ARCANE_UTILS_EXPORT Int64
366
367/*---------------------------------------------------------------------------*/
368/*---------------------------------------------------------------------------*/
379extern "C++" ARCANE_UTILS_EXPORT String
381
382/*---------------------------------------------------------------------------*/
383/*---------------------------------------------------------------------------*/
391extern "C++" ARCANE_UTILS_EXPORT String
393
394/*---------------------------------------------------------------------------*/
395/*---------------------------------------------------------------------------*/
396
397// Définition du pragma pour indiquer l'indépendance des itérations
398
410// Pour les définitions, il faut finir par GCC car Clang et ICC définissent
411// la macro __GNU__
412// Pour CLANG, il n'y a pas encore d'équivalent au pragma ivdep de ICC.
413// Celui qui s'en approche le plus est:
414// #pragma clang loop vectorize(enable)
415// mais il ne force pas la vectorisation.
416#ifdef __clang__
417# define ARCANE_PRAGMA_IVDEP_VALUE "clang loop vectorize(enable)"
418#else
419# ifdef __INTEL_COMPILER
420# define ARCANE_PRAGMA_IVDEP_VALUE "ivdep"
421# else
422# ifdef __GNUC__
423# if (__GNUC__>=5)
424# define ARCANE_PRAGMA_IVDEP_VALUE "GCC ivdep"
425# endif
426# endif
427# endif
428#endif
429
430#ifdef ARCANE_PRAGMA_IVDEP_VALUE
431#define ARCANE_PRAGMA_IVDEP _Pragma(ARCANE_PRAGMA_IVDEP_VALUE)
432#else
433#define ARCANE_PRAGMA_IVDEP
434#define ARCANE_PRAGMA_IVDEP_VALUE ""
435#endif
436
437/*---------------------------------------------------------------------------*/
438/*---------------------------------------------------------------------------*/
439
440} // End namespace platform
441
442/*---------------------------------------------------------------------------*/
443/*---------------------------------------------------------------------------*/
444
445} // End namespace Arcane
446
447/*---------------------------------------------------------------------------*/
448/*---------------------------------------------------------------------------*/
449
450#endif
Déclarations des types utilisés dans Arcane.
Tableau d'items de types quelconques.
Gestion des ressources mémoire pour les CPU et accélérateurs.
Vue typée sur une liste d'entités d'une connectivité.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:149
Vue sur une chaîne de caractères UTF-8.
Definition StringView.h:47
Chaîne de caractères unicode.
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.
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.
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 * getDefaultDataAllocator()
Allocateur par défaut pour les données.
Int64 getPageSize()
Taille des pages du système hôte en octets.
String getExeFullPath()
Retourne le nom complet avec le chemin de l'exécutable.
Int64 getRealTimeNS()
Temps horloge en nano-secondes.
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.
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 -*-