Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MemoryAllocationOptions.cc
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/* MemoryAllocationOptions.cc (C) 2000-2024 */
9/* */
10/* Options pour configurer les allocations. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arccore/collections/MemoryAllocationOptions.h"
15#include "arccore/collections/MemoryAllocationArgs.h"
16#include "arccore/collections/ArrayDebugInfo.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arccore
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27String MemoryAllocationArgs::
28arrayName() const
29{
30 return (m_debug_info) ? m_debug_info->name() : String();
31}
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
37allocationArgs(RunQueue* queue) const
38{
40 x.setMemoryLocationHint(m_memory_location_hint);
41 x.setDevice(m_device);
42 x.setDebugInfo(m_debug_info);
43 x.setRunQueue(queue);
44 return x;
45}
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
50void MemoryAllocationOptions::
51setArrayName(const String& name)
52{
53 if (!m_debug_info) {
54 m_debug_info = new ArrayDebugInfo();
55 m_debug_info->addReference();
56 }
57 m_debug_info->setName(name);
58}
59
60/*---------------------------------------------------------------------------*/
61/*---------------------------------------------------------------------------*/
62
63String MemoryAllocationOptions::
64arrayName() const
65{
66 return (m_debug_info) ? m_debug_info->name() : String{};
67}
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72void MemoryAllocationOptions::
73_addDebugReference()
74{
75 m_debug_info->addReference();
76}
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81void MemoryAllocationOptions::
82_removeDebugReference()
83{
84 m_debug_info->removeReference();
85}
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90} // End namespace Arccore
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
File d'exécution pour un accélérateur.
Informations de debug pour les classes tableaux.
Classe contenant des informations pour spécialiser les allocations.
MemoryAllocationArgs allocationArgs(RunQueue *queue=nullptr) const
Arguments pour 'IMemoryAllocator' associés à ces options et à la file queue.
Chaîne de caractères unicode.
Espace de nom de Arccore.
Definition ArcaneTypes.h:24