14#include "arcane/core/IData.h"
16#include "arcane/utils/NotSupportedException.h"
17#include "arcane/utils/FatalErrorException.h"
18#include "arcane/utils/ArrayShape.h"
21#include "arcane/core/IDataFactory.h"
22#include "arcane/core/IDataVisitor.h"
23#include "arcane/core/ISerializedData.h"
24#include "arcane/core/internal/IDataInternal.h"
28#include "arcane/accelerator/core/RunQueue.h"
29#include "arcane/accelerator/core/Memory.h"
49 ARCANE_THROW(NotSupportedException,
"using applyDataVisitor with IMultiArray2Data is no longer supported");
65copyContiguousData(INumericDataInternal* num_destination,
ConstMemoryView source_buf,
72 ARCANE_FATAL(
"Source and destination do not have the same datatype s={0} d={1}",
84copyContiguousData(IData* destination, IData* source, RunQueue& queue)
89 INumericDataInternal* num_destination = destination->_commonInternal()->numericData();
92 INumericDataInternal* num_source = source->_commonInternal()->numericData();
95 copyContiguousData(num_destination, num_source->memoryView(), queue);
102fillContiguousDataGeneric(
IData* data,
const void* fill_address,
105 INumericDataInternal* num_data = data->_commonInternal()->numericData();
115 if (data->dimension() > 1) {
116 Int64 total_dim = data->shape().totalNbElement();
117 Int64 nb_element = destination_buf.nbElement();
118 destination_buf =
makeMutableMemoryView(destination_buf.data(), datatype_size, nb_element * total_dim);
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
#define ARCANE_THROW(exception_class,...)
Macro for throwing an exception with formatting.
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
#define ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS(class_name)
Macro to define methods and types for a class that uses a reference counter.
Memory and allocator management functions.
Execution queue for an accelerator.
void copyMemory(const MemoryCopyArgs &args) const
Copies information between two memory regions.
bool isNull() const
Indicates if the RunQueue is null.
Constant view on a contiguous memory region containing fixed-size elements.
constexpr Int32 datatypeSize() const
Size of the associated data type (1 by default).
Interface of a data item.
virtual void visitMultiArray2(IMultiArray2DataVisitor *visitor)
Apply the visitor to the data.
Interface of the visitor pattern for a variable-sized 2D array data item.
Interface of a multi 2D array data item.
Mutable view on a contiguous memory region containing fixed-size elements.
constexpr Int32 datatypeSize() const
Size of the associated data type (1 by default).
void fill(MutableMemoryView destination, ConstMemoryView source, const RunQueue *run_queue=nullptr)
Fills a memory region with a value.
void copy(MutableMemoryView destination, eMemoryResource destination_mem, ConstMemoryView source, eMemoryResource source_mem, const RunQueue *queue=nullptr)
Copies source to destination using the queue queue.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
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.
std::int32_t Int32
Signed integer type of 32 bits.