Arcane  v4.1.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
CommonGlobal.cc
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/* CommonGlobal.cc (C) 2000-2025 */
9/* */
10/* Définitions globales de la composante 'Common' de 'Arccore'. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arccore/common/CommonGlobal.h"
15
16#include "arccore/common/internal/IMemoryResourceMngInternal.h"
17#include "arccore/common/IMemoryResourceMng.h"
18
19#include <iostream>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27namespace
28{
29 const char* _toName(eHostDeviceMemoryLocation v)
30 {
31 switch (v) {
33 return "Unknown";
35 return "Device";
37 return "Host";
39 return "ManagedMemoryDevice";
41 return "ManagedMemoryHost";
42 }
43 return "Invalid";
44 }
45
46 const char* _toName(eMemoryResource r)
47 {
48 switch (r) {
50 return "Unknown";
52 return "Host";
54 return "HostPinned";
56 return "Device";
58 return "UnifiedMemory";
59 }
60 return "Invalid";
61 }
62
63} // namespace
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
68std::ostream&
69operator<<(std::ostream& o, eHostDeviceMemoryLocation v)
70{
71 o << _toName(v);
72 return o;
73}
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78std::ostream&
79operator<<(std::ostream& o, eMemoryResource v)
80{
81 o << _toName(v);
82 return o;
83}
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88} // namespace Arcane
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
std::ostream & operator<<(std::ostream &o, eExecutionPolicy exec_policy)
Affiche le nom de la politique d'exécution.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
eHostDeviceMemoryLocation
Localisation physique d'une adresse mémoire.
@ Unknown
Localisation inconnue.
@ ManagedMemoryDevice
La mémoire est de la mémoire managée sur accélérateur.
@ Host
La mémoire est sur l'hôte.
@ ManagedMemoryHost
La mémoire est de la mémoire managée sur l'hôte.
@ Device
La mémoire est sur accélérateur.
eMemoryResource
Liste des ressources mémoire disponibles.
@ HostPinned
Alloue sur l'hôte.
@ Unknown
Valeur inconnue ou non initialisée.
@ Host
Alloue sur l'hôte.
@ UnifiedMemory
Alloue en utilisant la mémoire unifiée.
@ Device
Alloue sur le device.