Arcane  v4.1.1.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
IMemoryResourceMng.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/* IMemoryResourceMng.h (C) 2000-2025 */
9/* */
10/* Gestion des ressources mémoire pour les CPU et accélérateurs. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_IMEMORYRESOURCEMNG_H
13#define ARCCORE_COMMON_IMEMORYRESOURCEMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/common/CommonGlobal.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27/*!
28 * \internal
29 * \brief Gestion des ressources mémoire pour les CPU et accélérateurs.
30 */
31class ARCCORE_COMMON_EXPORT IMemoryResourceMng
32{
33 public:
34
35 virtual ~IMemoryResourceMng() = default;
36
37 public:
38
39 /*!
40 * \brief Allocateur mémoire pour la ressource \a r.
41 *
42 * Lève une exception si aucun allocateur pour la ressource \a v existe.
43 */
45
46 /*!
47 * \brief Allocateur mémoire pour la ressource \a r.
48 *
49 * Si aucun allocateur pour la ressoruce \a v existe, lève une
50 * exception si \a throw_if_not_found est vrai ou retourne \a nullptr
51 * si \a throw_if_not_found est faux.
52 */
53 virtual IMemoryAllocator* getAllocator(eMemoryResource r, bool throw_if_not_found) = 0;
54
55 public:
56
57 //! Interface interne
58 virtual IMemoryResourceMngInternal* _internal() = 0;
59};
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64} // End namespace Arcane
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
68
69#endif
Interface d'un allocateur pour la mémoire.
virtual IMemoryAllocator * getAllocator(eMemoryResource r, bool throw_if_not_found)=0
Allocateur mémoire pour la ressource r.
virtual IMemoryResourceMngInternal * _internal()=0
Interface interne.
virtual IMemoryAllocator * getAllocator(eMemoryResource r)=0
Allocateur mémoire pour la ressource r.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
eMemoryResource
Liste des ressources mémoire disponibles.