37 virtual std::shared_ptr<Memory<T> >
makeInstance()
const override;
45 virtual bool isOnHost()
const override;
73 size_t bufferLength)
const override;
82 size_t bufferLength)
override;
140 T&
at(
size_t x,
size_t y = 0,
size_t z = 0);
150 const T&
at(
size_t x,
size_t y = 0,
size_t z = 0)
const;
187 size_t startY,
size_t endY,
188 size_t startZ,
size_t endZ,
189 T* output,
size_t outputSize)
override;
218 double factor)
override;
229 virtual std::shared_ptr<Memory<T> >
getHostMemory()
override;
233 virtual const std::shared_ptr<const Memory<T> >
getHostMemory()
const override;
245 const ivec3& end)
const override;
258 const ivec3& end)
const override;
Definition: HostMemory.hpp:25
virtual T * getPointer() override
Definition: HostMemory.cpp:69
HostMemory(size_t nx, size_t ny=1, size_t nz=1)
Definition: HostMemory.cpp:36
virtual void copyToHost(T *bufferPointer, size_t bufferLength) const override
Definition: HostMemory.cpp:79
virtual std::shared_ptr< Memory< T > > getHostMemory() override
Copies the data to host if it is on GPU, otherwise makes a copy.
Definition: HostMemory.cpp:314
const size_t ny
Definition: Memory.hpp:341
virtual void operator/=(const Memory< T > &other) override
Definition: HostMemory.cpp:159
virtual void copyFrom(const Memory< T > &other) override
Copies the contents of the other memory area into this one.
Definition: HostMemory.cpp:62
virtual void subtractPower(const Memory< T > &other, double power) override
Definition: HostMemory.cpp:304
double real
Definition: types.hpp:65
virtual void operator+=(const Memory< T > &other) override
Definition: HostMemory.cpp:97
virtual void addPower(const Memory< T > &other, double power) override
Definition: HostMemory.cpp:283
T & at(size_t x, size_t y=0, size_t z=0)
at returns the data at the given index
Definition: HostMemory.hpp:266
Definition: Memory.hpp:28
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 cel...
Definition: HostMemory.cpp:239
const size_t nx
Definition: Memory.hpp:340
size_t calculateIndex(size_t x, size_t y, size_t z, size_t nx, size_t ny)
calculateIndex calculates the index for the given coordinates
Definition: index.hpp:100
virtual void operator-=(const Memory< T > &other) override
Definition: HostMemory.cpp:137
virtual void copyFromHost(const T *bufferPointer, size_t bufferLength) override
Definition: HostMemory.cpp:85
virtual void addLinearCombination(T a1, T a2, const Memory< T > &v2, T a3, const Memory< T > &v3, T a4, const Memory< T > &v4, T a5, const Memory< T > &v5) override
Definition: HostMemory.cpp:261
const size_t nz
Definition: Memory.hpp:342
virtual std::shared_ptr< Memory< T > > makeInstance() const override
Clones the memory area, but does not copy the content
Definition: HostMemory.cpp:48
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
float p
Definition: sodshocktube.py:5
T * data()
Definition: Memory.hpp:101
virtual void makeZero() override
makeZero sets every element to zero (0)
Definition: HostMemory.cpp:230
virtual void operator*=(const Memory< T > &other) override
Definition: HostMemory.cpp:115
virtual real getTotalVariation(int p, const ivec3 &start, const ivec3 &end) const override
Definition: HostMemory.cpp:325
virtual bool isOnHost() const override
Definition: HostMemory.cpp:57