Arcane  v3.15.0.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.setHostDeviceMemoryLocation(m_host_device_memory_location);
42 x.setDevice(m_device);
43 x.setDebugInfo(m_debug_info);
44 x.setRunQueue(queue);
45 return x;
46}
47
48/*---------------------------------------------------------------------------*/
49/*---------------------------------------------------------------------------*/
50
51void MemoryAllocationOptions::
52setArrayName(const String& name)
53{
54 if (!m_debug_info) {
55 m_debug_info = new ArrayDebugInfo();
56 m_debug_info->addReference();
57 }
58 m_debug_info->setName(name);
59}
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64String MemoryAllocationOptions::
65arrayName() const
66{
67 return (m_debug_info) ? m_debug_info->name() : String{};
68}
69
70/*---------------------------------------------------------------------------*/
71/*---------------------------------------------------------------------------*/
72
73void MemoryAllocationOptions::
74_addDebugReference()
75{
76 m_debug_info->addReference();
77}
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82void MemoryAllocationOptions::
83_removeDebugReference()
84{
85 m_debug_info->removeReference();
86}
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
91} // End namespace Arccore
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
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