Arcane  v4.1.2.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 IPerformanceCounterService*
153setPerformanceCounterService(IPerformanceCounterService* service);
154
160extern "C++" ARCANE_UTILS_EXPORT IPerformanceCounterService*
162
163/*---------------------------------------------------------------------------*/
164/*---------------------------------------------------------------------------*/
170extern "C++" ARCANE_UTILS_EXPORT void
171resetAlarmTimer(Integer nb_second);
172
176extern "C++" ARCANE_UTILS_EXPORT bool
178
185extern "C++" ARCANE_UTILS_EXPORT void
186setHasDotNETRuntime(bool v);
187
188/*---------------------------------------------------------------------------*/
189/*---------------------------------------------------------------------------*/
190
192extern "C++" ARCANE_UTILS_EXPORT void
194
195/*---------------------------------------------------------------------------*/
196/*---------------------------------------------------------------------------*/
202extern "C++" ARCANE_DEPRECATED_REASON("Y2024: Use MemoryUtils::getDefaultDataAllocator() instead.")
203ARCANE_UTILS_EXPORT IMemoryAllocator*
205
206/*---------------------------------------------------------------------------*/
207/*---------------------------------------------------------------------------*/
216extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane")
217ARCANE_UTILS_EXPORT IMemoryAllocator*
218setAcceleratorHostMemoryAllocator(IMemoryAllocator* a);
219
220/*---------------------------------------------------------------------------*/
221/*---------------------------------------------------------------------------*/
234extern "C++" ARCANE_UTILS_EXPORT IMemoryAllocator*
236
237/*---------------------------------------------------------------------------*/
238/*---------------------------------------------------------------------------*/
248extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane")
249ARCANE_UTILS_EXPORT IMemoryRessourceMng*
250setDataMemoryRessourceMng(IMemoryRessourceMng* mng);
251
252/*---------------------------------------------------------------------------*/
253/*---------------------------------------------------------------------------*/
262extern "C++" ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane. Use methods from MemoryUtils instead.")
263ARCANE_UTILS_EXPORT IMemoryRessourceMng*
265
266/*---------------------------------------------------------------------------*/
267/*---------------------------------------------------------------------------*/
278extern "C++" ARCANE_UTILS_EXPORT bool
279readAllFile(StringView filename, bool is_binary, ByteArray& out_bytes);
280
281/*---------------------------------------------------------------------------*/
282/*---------------------------------------------------------------------------*/
293extern "C++" ARCANE_UTILS_EXPORT bool
294readAllFile(StringView filename, bool is_binary, Array<std::byte>& out_bytes);
295
296/*---------------------------------------------------------------------------*/
297/*---------------------------------------------------------------------------*/
301extern "C++" ARCANE_UTILS_EXPORT String
303
304/*---------------------------------------------------------------------------*/
305/*---------------------------------------------------------------------------*/
315extern "C++" ARCANE_UTILS_EXPORT void
317
318/*---------------------------------------------------------------------------*/
319/*---------------------------------------------------------------------------*/
330extern "C++" ARCANE_UTILS_EXPORT String
332
333/*---------------------------------------------------------------------------*/
334/*---------------------------------------------------------------------------*/
342extern "C++" ARCANE_UTILS_EXPORT String
344
345/*---------------------------------------------------------------------------*/
346/*---------------------------------------------------------------------------*/
347
348// Définition du pragma pour indiquer l'indépendance des itérations
349
355
360
361// Pour les définitions, il faut finir par GCC car Clang et ICC définissent
362// la macro __GNU__
363// Pour CLANG, il n'y a pas encore d'équivalent au pragma ivdep de ICC.
364// Celui qui s'en approche le plus est:
365// #pragma clang loop vectorize(enable)
366// mais il ne force pas la vectorisation.
367#ifdef __clang__
368# define ARCANE_PRAGMA_IVDEP_VALUE "clang loop vectorize(enable)"
369#else
370# ifdef __INTEL_COMPILER
371# define ARCANE_PRAGMA_IVDEP_VALUE "ivdep"
372# else
373# ifdef __GNUC__
374# if (__GNUC__>=5)
375# define ARCANE_PRAGMA_IVDEP_VALUE "GCC ivdep"
376# endif
377# endif
378# endif
379#endif
380
381#ifdef ARCANE_PRAGMA_IVDEP_VALUE
382#define ARCANE_PRAGMA_IVDEP _Pragma(ARCANE_PRAGMA_IVDEP_VALUE)
383#else
384#define ARCANE_PRAGMA_IVDEP
385#define ARCANE_PRAGMA_IVDEP_VALUE ""
386#endif
387
388/*---------------------------------------------------------------------------*/
389/*---------------------------------------------------------------------------*/
390
391} // End namespace platform
392
393/*---------------------------------------------------------------------------*/
394/*---------------------------------------------------------------------------*/
395
396} // End namespace Arcane
397
398/*---------------------------------------------------------------------------*/
399/*---------------------------------------------------------------------------*/
400
401#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.
ISymbolizerService * setSymbolizerService(ISymbolizerService *service)
Positionne le service pour obtenir des informations sur les symboles du code source.
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.
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:125
List< String > StringList
Tableau de chaînes de caractères unicode.
Definition UtilsTypes.h:513