14#include "arcane/utils/NumArray.h"
16#include "arcane/utils/FatalErrorException.h"
17#include "arcane/utils/MemoryView.h"
29MemoryAllocationOptions NumArrayBaseCommon::
32 return _getDefaultAllocator(eMemoryRessource::UnifiedMemory);
38MemoryAllocationOptions NumArrayBaseCommon::
47void NumArrayBaseCommon::
50 if (r == eMemoryRessource::Host || r == eMemoryRessource::UnifiedMemory)
52 ARCANE_FATAL(
"Invalid access from '{0}' ressource memory to host memory", r);
58void NumArrayBaseCommon::
62 MemoryUtils::copy(MutableMemoryView(to), to_mem, ConstMemoryView(from), from_mem, queue);
68void NumArrayBaseCommon::
69_memoryAwareFill(Span<std::byte> to,
Int64 nb_element,
const void* fill_address,
70 Int32 datatype_size, SmallSpan<const Int32> indexes,
const RunQueue* queue)
72 ConstMemoryView fill_value_view(makeConstMemoryView(fill_address, datatype_size, 1));
73 MutableMemoryView destination(makeMutableMemoryView(to.data(), datatype_size, nb_element));
74 destination.fillIndexes(fill_value_view, indexes, queue);
80void NumArrayBaseCommon::
81_memoryAwareFill(Span<std::byte> to,
Int64 nb_element,
const void* fill_address,
82 Int32 datatype_size,
const RunQueue* queue)
84 ConstMemoryView fill_value_view(makeConstMemoryView(fill_address, datatype_size, 1));
85 MutableMemoryView destination(makeMutableMemoryView(to.data(), datatype_size, nb_element));
86 destination.fill(fill_value_view, queue);
100template class NumArray<Real, MDDim4>;
101template class NumArray<Real, MDDim3>;
102template class NumArray<Real, MDDim2>;
103template class NumArray<Real, MDDim1>;
105template class ArrayStridesBase<1>;
106template class ArrayStridesBase<2>;
107template class ArrayStridesBase<3>;
108template class ArrayStridesBase<4>;
112 template class NumArrayContainer<Real>;
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Fonctions de gestion mémoire et des allocateurs.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
MemoryAllocationOptions getAllocationOptions(eMemoryResource mem_resource)
Allocation par défaut pour la ressource mem_resource.
void copy(MutableMemoryView destination, eMemoryResource destination_mem, ConstMemoryView source, eMemoryResource source_mem, const RunQueue *queue=nullptr)
Copie de source vers destination en utilisant la file queue.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Arccore::eMemoryResource eMemoryRessource
Typedef pour la version Arcane historique (avec 2's')