Template Class CudaStorage#
Defined in File cudaStorage.hpp
Class Documentation#
-
template<typename Scalar_>
class CudaStorage# -
Public Functions
-
CudaStorage() = default#
Default constructor — initializes with nullptr.
-
explicit CudaStorage(SizeType size)#
Create a CudaStorage object with
elements
. The data is not initialized.- Parameters
size – Number of elements
-
CudaStorage(SizeType size, ConstReference value)#
Create a CudaStorage object with
elements
. The data is initialized tovalue
.- Parameters
size – Number of elements
value – Value to fill with
-
CudaStorage(const CudaStorage &other)#
Create a new CudaStorage object from an existing one.
- Parameters
other – The CudaStorage to copy
-
CudaStorage(CudaStorage &&other) noexcept#
Create a new CudaStorage object from a temporary one, moving the data
- Parameters
other – The array to move
-
CudaStorage(const std::initializer_list<Scalar> &list)#
Create a CudaStorage object from an std::initializer_list
- Parameters
list – Initializer list of elements
-
explicit CudaStorage(const std::vector<Scalar> &vec)#
Create a CudaStorage object from an std::vector of values
- Parameters
vec – The vector to fill with
-
CudaStorage &operator=(const CudaStorage &other)#
Assignment operator for a CudaStorage object
- Parameters
other – CudaStorage object to copy
- Returns
*this
-
CudaStorage &operator=(CudaStorage &&other) noexcept#
Move assignment operator for a CudaStorage object
- Parameters
other – CudaStorage object to move
- Returns
*this
-
~CudaStorage()#
Free a CudaStorage object.
-
CudaStorage copy() const#
Create a deep copy of this CudaStorage object.
- Returns
Deep copy of this CudaStorage object
-
void resize(SizeType newSize)#
Resize a CudaStorage object to
size
elements. Existing elements are preserved where possible.See also
- Parameters
size – Number of elements
-
void resize(SizeType newSize, int)#
Resize a CudaStorage object to
size
elements. Existing elements are not preserved. This method of resizing is faster and more efficient than the version which preserves the original data, but of course, this has the drawback that data will be lost.- Parameters
size – Number of elements
-
SizeType size() const noexcept#
Return the number of elements in the CudaStorage object.
- Returns
The number of elements
-
Pointer data() const noexcept#
Return the underlying pointer to the data
- Returns
The underlying pointer to the data
-
Pointer begin() const noexcept#
Returns the pointer to the first element of the CudaStorage object
- Returns
Pointer to the first element of the CudaStorage object
-
Pointer end() const noexcept#
Returns the pointer to the last element of the CudaStorage object
- Returns
A pointer to the last element of the CudaStorage
Public Static Functions
-
static CudaStorage fromData(const std::initializer_list<Scalar> &vec)#
-
static CudaStorage fromData(const std::vector<Scalar> &vec)#
-
CudaStorage() = default#