Alsvinn
0.5.3
The fast FVM simulator with UQ support
|
#include <alsfvm/cuda/CudaMemory.hpp>
Public Member Functions | |
CudaMemory (size_t nx, size_t ny=1, size_t nz=1) | |
virtual std::shared_ptr< memory::Memory< T > > | makeInstance () const override |
Clones the memory area, but does not copy the content More... | |
virtual | ~CudaMemory () |
virtual void | copyFrom (const memory::Memory< T > &other) override |
Copies the contents of the other memory area into this one. More... | |
virtual bool | isOnHost () const |
virtual T * | getPointer () override |
virtual const T * | getPointer () const override |
virtual void | copyToHost (T *bufferPointer, size_t bufferLength) const override |
virtual void | copyFromHost (const T *bufferPointer, size_t bufferLength) override |
virtual void | operator+= (const memory::Memory< T > &other) override |
virtual void | operator*= (const memory::Memory< T > &other) override |
virtual void | operator-= (const memory::Memory< T > &other) override |
virtual void | operator/= (const memory::Memory< T > &other) override |
virtual void | operator+= (real scalar) override |
virtual void | operator*= (real scalar) override |
virtual void | operator-= (real scalar) override |
virtual void | operator/= (real scalar) override |
virtual void | makeZero () override |
virtual void | copyInternalCells (size_t startX, size_t endX, size_t startY, size_t endY, size_t startZ, size_t endZ, T *output, size_t outputSize) override |
copyInternalCells copies the internal cells into the memory area This is ideal for removing ghost cells before outputing the solution. More... | |
virtual void | addLinearCombination (T a1, T a2, const memory::Memory< T > &v2, T a3, const memory::Memory< T > &v3, T a4, const memory::Memory< T > &v4, T a5, const memory::Memory< T > &v5) override |
virtual void | addPower (const memory::Memory< T > &other, double power) override |
virtual void | addPower (const memory::Memory< T > &other, double power, double factor) override |
virtual void | subtractPower (const memory::Memory< T > &other, double power) override |
std::shared_ptr< memory::Memory< T > > | getHostMemory () override |
Copies the data to host if it is on GPU, otherwise makes a copy. More... | |
const std::shared_ptr< const memory::Memory< T > > | getHostMemory () const override |
virtual real | getTotalVariation (int p, const ivec3 &start, const ivec3 &end) const override |
virtual real | getTotalVariation (int direction, int p, const ivec3 &start, const ivec3 &end) const override |
![]() | |
Memory (size_t nx, size_t ny, size_t nz) | |
Memory constructs new memory. More... | |
virtual | ~Memory () |
virtual size_t | getSize () const |
virtual size_t | getSizeX () const |
virtual size_t | getSizeY () const |
virtual size_t | getSizeZ () const |
virtual size_t | getExtentXInBytes () const |
virtual size_t | getExtentYInBytes () const |
T * | data () |
const T * | data () const |
T & | operator[] (size_t i) |
T | operator[] (size_t i) const |
T | operator() (int x, int y, int z) const |
T & | operator() (int x, int y, int z) |
View< T > | getView () |
getView gets the view to the memory More... | |
View< const T > | getView () const |
getView gets the view to the memory (const version) More... | |
![]() | |
MemoryBase () | |
virtual | ~MemoryBase () |
Additional Inherited Members | |
![]() | |
const size_t | nx |
const size_t | ny |
const size_t | nz |
alsfvm::cuda::CudaMemory< T >::CudaMemory | ( | size_t | nx, |
size_t | ny = 1 , |
||
size_t | nz = 1 |
||
) |
nx | the number of cells in x direction |
ny | the number of cells in y direction |
nz | the number of cells in z direction |
|
virtual |
|
overridevirtual |
Adds the memory with coefficients to this memory area Here we compute the sum
where is the volume being operated on.
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Adds a power of the other memory area to this memory area, ie
other | the other memory area to the the power of |
power | the power to use |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Adds a power of the other memory area to this memory area, ie
other | the other memory area to the the power of |
power | the power to use |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Copies the contents of the other memory area into this one.
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Copies the memory from the buffer (assumed to be on Host/CPU)
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
copyInternalCells copies the internal cells into the memory area This is ideal for removing ghost cells before outputing the solution.
startX | start index (inclusive) for x direction |
endX | end index (exclusive) for x direction |
startY | start index (inclusive) for y direction |
endY | end index (exclusive) for y direction |
startZ | start index (inclusive) for z direction |
endZ | end index (exclusive) for z direction |
output | the output buffer |
outputSize | must be at least the size of the written memory |
This calls cudaMemcpy3d behind the scenes.
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Copies the memory to the given buffer
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Copies the data to host if it is on GPU, otherwise makes a copy.
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Copies the data to host if it is on GPU, otherwise makes a copy Const version
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Gets the pointer to the data (need not be on the host!)
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Gets the pointer to the data (need not be on the host!)
Gets the pointer to the data (need not be on the host!)
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Computes the total variation, given here as
p | the exponent p |
start | the index to start at (inclusive) |
end | the maximum index (exclusive) |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
$
p | the exponent p |
direction | the direction (between 0 and 2 inclusive) |
start | the index to start at (inclusive) |
end | the maximum index (exclusive) |
Implements alsfvm::memory::Memory< T >.
|
virtual |
Checks if the memory area is on the host (CPU) or on some device, if the latter, one needs to copy to host before reading it.
Checks if the memory area is on the host (CPU) or on some device, if the latter, one needs to copy to host before reading it.
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Clones the memory area, but does not copy the content
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Sets every component to zero
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Mutliplies the other memory area to this one
other | the memory area to multiply from |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Multiplies the scalar to each component
scalar | the scalar to multiply |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Adds the other memory area to this one
other | the memory area to add from |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Adds the scalar to each component
scalar | the scalar to add |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Subtracts the other memory area to this one
other | the memory area to subtract from |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Subtracts the scalar from each component
scalar | the scalar to subtract |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Divides the other memory area to this one
other | the memory area to divide from |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Divides the each component by the scalar
scalar | the scalar to divide |
Implements alsfvm::memory::Memory< T >.
|
overridevirtual |
Subtract a power of the other memory area to this memory area, ie
other | the other memory area to the the power of |
power | the power to use |
Implements alsfvm::memory::Memory< T >.