|
| PetscMemory () |
|
void | SetHostValid () const |
|
void | SetDeviceValid () const |
|
void | SetHostInvalid () const |
|
void | SetDeviceInvalid () const |
|
bool | IsAliasForSync () const |
|
void | MakeAliasForSync (const Memory< real_t > &base_, int offset_, int size_, bool usedev_) |
|
void | MakeAliasForSync (Memory< real_t > &base_, int offset_, int size_, bool read_, bool write_, bool usedev_) |
|
void | SyncBase () |
|
void | SyncBaseAndReset () |
|
bool | ReadRequested () const |
|
bool | WriteRequested () const |
|
bool | DeviceRequested () const |
|
const real_t * | GetHostPointer () const |
|
const real_t * | GetDevicePointer () const |
|
| Memory () |
|
| Memory (const Memory &orig)=default |
| Copy constructor: default.
|
|
| Memory (Memory &&orig) |
|
| Memory (int size) |
| Allocate host memory for size entries.
|
|
| Memory (int size, MemoryType mt) |
| Allocate memory for size entries with the given MemoryType mt.
|
|
| Memory (int size, MemoryType h_mt, MemoryType d_mt) |
| Allocate memory for size entries with the given host MemoryType h_mt and device MemoryType d_mt.
|
|
| Memory (real_t *ptr, int size, bool own) |
| Wrap an externally allocated host pointer, ptr with the current host memory type returned by MemoryManager::GetHostMemoryType().
|
|
| Memory (real_t *ptr, int size, MemoryType mt, bool own) |
| Wrap an externally allocated pointer, ptr, of the given MemoryType.
|
|
| Memory (const Memory &base, int offset, int size) |
| Alias constructor. Create a Memory object that points inside the Memory object base.
|
|
Memory & | operator= (const Memory &orig)=default |
| Copy-assignment operator: default.
|
|
Memory & | operator= (Memory &&orig) |
|
| ~Memory ()=default |
| Destructor: default.
|
|
bool | OwnsHostPtr () const |
| Return true if the host pointer is owned. Ownership indicates whether the pointer will be deleted by the method Delete().
|
|
void | SetHostPtrOwner (bool own) const |
| Set/clear the ownership flag for the host pointer. Ownership indicates whether the pointer will be deleted by the method Delete().
|
|
bool | OwnsDevicePtr () const |
| Return true if the device pointer is owned. Ownership indicates whether the pointer will be deleted by the method Delete().
|
|
void | SetDevicePtrOwner (bool own) const |
| Set/clear the ownership flag for the device pointer. Ownership indicates whether the pointer will be deleted by the method Delete().
|
|
void | ClearOwnerFlags () const |
| Clear the ownership flags for the host and device pointers, as well as any internal data allocated by the Memory object.
|
|
bool | UseDevice () const |
| Read the internal device flag.
|
|
void | UseDevice (bool use_dev) const |
| Set the internal device flag.
|
|
int | Capacity () const |
| Return the size of the allocated memory.
|
|
void | Reset () |
| Reset the memory to be empty, ensuring that Delete() will be a no-op.
|
|
void | Reset (MemoryType host_mt) |
| Reset the memory and set the host memory type.
|
|
bool | Empty () const |
| Return true if the Memory object is empty, see Reset().
|
|
void | New (int size) |
| Allocate host memory for size entries with the current host memory type returned by MemoryManager::GetHostMemoryType().
|
|
void | New (int size, MemoryType mt) |
| Allocate memory for size entries with the given MemoryType.
|
|
void | New (int size, MemoryType h_mt, MemoryType d_mt) |
| Allocate memory for size entries with the given host MemoryType h_mt and device MemoryType d_mt.
|
|
void | Wrap (real_t *ptr, int size, bool own) |
| Wrap an externally allocated host pointer, ptr with the current host memory type returned by MemoryManager::GetHostMemoryType().
|
|
void | Wrap (real_t *ptr, int size, MemoryType mt, bool own) |
| Wrap an externally allocated pointer, ptr, of the given MemoryType.
|
|
void | Wrap (real_t *h_ptr, real_t *d_ptr, int size, MemoryType h_mt, bool own, bool valid_host=false, bool valid_device=true) |
|
void | MakeAlias (const Memory &base, int offset, int size) |
| Create a memory object that points inside the memory object base.
|
|
void | SetDeviceMemoryType (MemoryType d_mt) |
| Set the device MemoryType to be used by the Memory object.
|
|
void | Delete () |
| Delete the owned pointers and reset the Memory object.
|
|
void | DeleteDevice (bool copy_to_host=true) |
| Delete the device pointer, if owned. If copy_to_host is true and the data is valid only on device, move it to host before deleting. Invalidates the device memory.
|
|
real_t & | operator[] (int idx) |
| Array subscript operator for host memory.
|
|
const real_t & | operator[] (int idx) const |
| Array subscript operator for host memory, const version.
|
|
| operator real_t * () |
| Direct access to the host memory as T* (implicit conversion).
|
|
| operator const real_t * () const |
| Direct access to the host memory as const T* (implicit conversion).
|
|
| operator U* () |
| Direct access to the host memory via explicit typecast.
|
|
| operator const U * () const |
| Direct access to the host memory via explicit typecast, const version.
|
|
real_t * | ReadWrite (MemoryClass mc, int size) |
| Get read-write access to the memory with the given MemoryClass.
|
|
const real_t * | Read (MemoryClass mc, int size) const |
| Get read-only access to the memory with the given MemoryClass.
|
|
real_t * | Write (MemoryClass mc, int size) |
| Get write-only access to the memory with the given MemoryClass.
|
|
void | Sync (const Memory &other) const |
| Copy the host/device pointer validity flags from other to *this.
|
|
void | SyncAlias (const Memory &base, int alias_size) const |
| Update the alias Memory *this to match the memory location (all valid locations) of its base Memory, base.
|
|
MemoryType | GetMemoryType () const |
| Return a MemoryType that is currently valid. If both the host and the device pointers are currently valid, then the device memory type is returned.
|
|
MemoryType | GetHostMemoryType () const |
| Return the host MemoryType of the Memory object.
|
|
MemoryType | GetDeviceMemoryType () const |
| Return the device MemoryType of the Memory object. If the device MemoryType is not set, return MemoryType::DEFAULT.
|
|
bool | HostIsValid () const |
| Return true if host pointer is valid.
|
|
bool | DeviceIsValid () const |
| Return true if device pointer is valid.
|
|
void | CopyFrom (const Memory &src, int size) |
| Copy size entries from src to *this.
|
|
void | CopyFromHost (const real_t *src, int size) |
| Copy size entries from the host pointer src to *this.
|
|
void | CopyTo (Memory &dest, int size) const |
| Copy size entries from *this to dest.
|
|
void | CopyToHost (real_t *dest, int size) const |
| Copy size entries from *this to the host pointer dest.
|
|
void | PrintFlags () const |
| Print the internal flags.
|
|
int | CompareHostAndDevice (int size) const |
| If both the host and the device data are valid, compare their contents.
|
|
Wrapper for syncing PETSc's vector memory.
Definition at line 87 of file petsc.hpp.