1#ifndef PSCF_DEVICE_MEMORY_H
2#define PSCF_DEVICE_MEMORY_H
11#include <util/misc/ReferenceCounter.h>
137 {
return (
bool)dataPtr_; }
144 {
return capacity_; }
virtual ~DeviceMemory()
Destructor.
void deallocate()
Dellocate the underlying C array, if any.
void addReference(CountedReference &reference)
Associate a reference with the reference counter.
bool isAllocated() const
Return true if the array has been allocated, false otherwise.
DeviceMemory()
Default constructor.
void * cArray() const
Return pointer to underlying C array.
void allocate(int capacity)
Allocate the underlying C array on the device.
int capacity() const
Return allocated capacity.
void resize(int capacity)
Re-allocate if necessary to increase capacity.
Reference to a shared resource.
PSCF package top-level namespace.
Utility classes for scientific computation.