![]() |
cuLite v0.3.1
A lite CUDA C++ Interface
|
The general purpose device dense vector class. More...

Public Member Functions | |
| void | clear () |
| Clear the device vector. | |
| void | fill (T_Scalar val) |
| Fill all elements with a value. | |
| XiVector< T_Scalar > | copy () const |
| Create a deep copy of the device vector. | |
| XiVector< T_Scalar > | rcopy () |
| Create a reference copy (shallow copy) of the device vector. | |
| Guard< XiVector< T_Scalar > > | rcopy () const |
| Create a guarded reference copy (shallow copy) of the device vector. | |
| XiVector< T_Scalar > | move () |
| Move the device vector's resources. | |
| std::string | info (const std::string &header="") const |
| Get information about the device vector. | |
| void | copyToHost (::cla3p::dns::XiVector< T_Cla3pScalar > &dest) const |
| Copies the device vector to a host vector. | |
| void | copyFromHost (const ::cla3p::dns::XiVector< T_Cla3pScalar > &src) |
| Copies a host vector to the device vector. | |
Creators/Generators | |
| static Guard< XiVector< T_Scalar > > | view (int_t n, const T_Scalar *vals) |
| Create a view of existing device memory. | |
The general purpose device dense vector class.
Represents a dense vector stored on the GPU device.
| T_Scalar | The scalar type (e.g., float, double, complex). |
| void culite::dns::XiVector< T_Scalar >::clear | ( | ) |
Clear the device vector.
Releases all device memory and resets the vector to an empty state.
| void culite::dns::XiVector< T_Scalar >::fill | ( | T_Scalar | val | ) |
Fill all elements with a value.
Sets all elements in the vector to the specified scalar value.
| [in] | val | The scalar value to fill with. |
| XiVector< T_Scalar > culite::dns::XiVector< T_Scalar >::copy | ( | ) | const |
Create a deep copy of the device vector.
Creates a new device vector with its own device memory allocation and copies all elements from this vector to the new vector.
| XiVector< T_Scalar > culite::dns::XiVector< T_Scalar >::rcopy | ( | ) |
Create a reference copy (shallow copy) of the device vector.
Creates a new device vector object that references the same device memory as this vector. Changes to either vector will affect both.
| Guard< XiVector< T_Scalar > > culite::dns::XiVector< T_Scalar >::rcopy | ( | ) | const |
Create a guarded reference copy (shallow copy) of the device vector.
Creates a guarded device vector object that references the same device memory as this vector. The guard ensures the reference is read-only.
| XiVector< T_Scalar > culite::dns::XiVector< T_Scalar >::move | ( | ) |
Move the device vector's resources.
Transfers ownership of the device memory to a new vector object, leaving this vector in an empty state.
| std::string culite::dns::XiVector< T_Scalar >::info | ( | const std::string & | header = "" | ) | const |
Get information about the device vector.
Returns a string containing information about the vector's size and properties.
| [in] | header | Optional header string to prepend to the information. |
| void culite::dns::XiVector< T_Scalar >::copyToHost | ( | ::cla3p::dns::XiVector< T_Cla3pScalar > & | dest | ) | const |
Copies the device vector to a host vector.
Performs a device-to-host copy operation. If dest is empty, it is resized to match the size of the device vector. Otherwise, dest must be compatible with the device vector.
| [out] | dest | The destination host vector. |
| void culite::dns::XiVector< T_Scalar >::copyFromHost | ( | const ::cla3p::dns::XiVector< T_Cla3pScalar > & | src | ) |
Copies a host vector to the device vector.
Performs a host-to-device copy operation. If the device vector is empty, it is resized to match the size of src. Otherwise, the device vector must be compatible with src.
| [in] | src | The source host vector. |
|
static |
Create a view of existing device memory.
Creates a guarded device vector that references existing device memory without taking ownership. The memory must remain valid for the lifetime of the returned view.
| [in] | n | The number of elements in the vector. |
| [in] | vals | Pointer to the device memory. |