14#include "arccore/common/NumArray.h"
16#include "arccore/base/FatalErrorException.h"
17#include "arccore/base/MemoryView.h"
29MemoryAllocationOptions NumArrayBaseCommon::
38MemoryAllocationOptions NumArrayBaseCommon::
47void NumArrayBaseCommon::
52 ARCCORE_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)
80void NumArrayBaseCommon::
81_memoryAwareFill(Span<std::byte> to,
Int64 nb_element,
const void* fill_address,
82 Int32 datatype_size,
const RunQueue* queue)
112 template class NumArrayContainer<Real>;
#define ARCCORE_FATAL(...)
Macro throwing a FatalErrorException.
Memory management utility functions.
Class to maintain the stride in each dimension.
Multi-dimensional arrays for numerical types accessible on accelerators.
void fill(MutableMemoryView destination, ConstMemoryView source, const RunQueue *run_queue=nullptr)
Fills a memory region with a value.
MemoryAllocationOptions getAllocationOptions(eMemoryResource mem_resource)
Default allocation for the resource mem_resource.
void fillIndexed(MutableMemoryView destination, ConstMemoryView source, SmallSpan< const Int32 > indexes, const RunQueue *run_queue=nullptr)
Fills an indexed memory region with a value.
eMemoryResource getDefaultDataMemoryResource()
Memory resource used by the default allocator for data.
void copy(MutableMemoryView destination, eMemoryResource destination_mem, ConstMemoryView source, eMemoryResource source_mem, const RunQueue *queue=nullptr)
Copies source to destination using the queue queue.
MutableMemoryView makeMutableMemoryView(void *ptr, Int32 datatype_size, Int64 nb_element)
Creates a mutable memory view.
std::int64_t Int64
Signed integer type of 64 bits.
ConstMemoryView makeConstMemoryView(const void *ptr, Int32 datatype_size, Int64 nb_element)
Creates a read-only memory view.
eMemoryResource
List of available memory resources.
@ HostPinned
Allocates on the host.
@ Host
Allocates on the host.
@ UnifiedMemory
Allocates using unified memory.
std::int32_t Int32
Signed integer type of 32 bits.