1#ifndef included_AMP_ArrayVectorData
2#define included_AMP_ArrayVectorData
6#include "AMP/utils/Array.h"
7#include "AMP/utils/FunctionTable.h"
8#include "AMP/utils/Memory.h"
9#include "AMP/utils/UtilityMacros.h"
10#include "AMP/vectors/data/GhostDataHelper.hpp"
11#include "AMP/vectors/data/VectorData.h"
19template<
typename T,
typename FUN = FunctionTable<T>,
typename Allocator = AMP::HostAllocator<
void>>
44 static std::shared_ptr<ArrayVectorData>
47 static std::shared_ptr<ArrayVectorData>
48 create(
const size_t localSize, std::shared_ptr<CommunicationList> commList, T *data );
109 const size_t *indices,
111 const typeID &
id )
override;
125 const size_t *indices,
127 const typeID &
id )
override;
138 const size_t *indices,
140 const typeID &
id )
const override;
149 uint64_t
getDataID()
const override {
return reinterpret_cast<uint64_t
>(
d_array.data() ); }
178 std::shared_ptr<VectorData>
cloneData(
const std::string &name =
"" )
const override;
183#include "AMP/vectors/data/ArrayVectorData.hpp"
Provides C++ wrapper around MPI routines.
Simple class to store the array dimensions.
size_t sizeOfDataBlock(size_t i=0) const override
Number of elements in a data block.
ArrayVectorData(const ArrayVectorData &)=delete
Copy constructor.
ArrayVectorData()=default
Empty constructor.
static std::shared_ptr< ArrayVectorData > create(const size_t localSize, std::shared_ptr< CommunicationList > commList, T *data)
void setValuesByLocalID(size_t num, const size_t *indices, const void *vals, const typeID &id) override
Set values in the vector by their local offset.
void swapData(VectorData &) override
Swap the data with another VectorData object.
const Array< T, FUN, Allocator > & getArray(void) const
return a const reference to the internal data container
const AMP_MPI & getComm() const override
Return the communicator this Vector spans.
void resize(const ArraySize &localDims)
resize the ArrayVector and reset the internal data structures
void putRawData(const void *buf, const typeID &id) override
Copy data into this vector.
void getValuesByLocalID(size_t num, const size_t *indices, void *vals, const typeID &id) const override
Get local values in the vector by their lcoal offset.
static std::shared_ptr< ArrayVectorData > create(const ArraySize &localSize, const ArraySize &blockIndex, AMP_MPI comm)
Create a ArrayVector.
size_t numberOfDataBlocks() const override
Number of blocks of contiguous data in the Vector.
void * getRawDataBlockAsVoid(size_t i) override
Return a pointer to a particular block of memory in the vector.
size_t sizeofDataBlockType(size_t) const override
Return the result of sizeof(TYPE) for the given data block.
static std::shared_ptr< ArrayVectorData > create(const ArraySize &localSize)
Create a ArrayVector.
std::shared_ptr< VectorData > cloneData(const std::string &name="") const override
Clone the data.
std::string VectorDataName() const override
Get the type name.
void getRawData(void *buf, const typeID &id) const override
Copy data out of this vector.
uint64_t getDataID() const override
A unique id for the underlying data allocation.
ArraySize d_globalArraySize
Array< T, FUN, Allocator > & getArray(void)
return a non-const reference to the internal data container
AMP::Array< T, FUN, Allocator > d_array
void addValuesByLocalID(size_t num, const size_t *indices, const void *vals, const typeID &id) override
Add values to vector entities by their local offset.
typeID getType(size_t) const override
Return the typeid of the given block.
const void * getRawDataBlockAsVoid(size_t i) const override
Return a pointer to a particular block of memory in the vector.
virtual ~ArrayVectorData()
Destructor.
A class used to hold vector data.
#define AMP_ASSERT(EXP)
Assert error.
Class to store type info.