![]() |
cuLite v0.3.1
A lite CUDA C++ Interface
|
Utility functions for transferring data between host and device memory. More...
Functions | |
| void | culite::memCopyX2X (std::size_t count, const void *src, void *dest, cudaMemcpyKind kind) |
| Copies memory between different memory spaces. | |
| template<typename T_Scalar> | |
| void | culite::memCopyD2D (std::size_t n, const T_Scalar *src, T_Scalar *dest) |
| Copies a vector from device memory to device memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyH2D (std::size_t n, const T_Scalar *src, T_Scalar *dest) |
| Copies a vector from host memory to device memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyD2H (std::size_t n, const T_Scalar *src, T_Scalar *dest) |
| Copies a vector from device memory to host memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyH2H (std::size_t n, const T_Scalar *src, T_Scalar *dest) |
| Copies a vector from host memory to host memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyH2D (std::size_t n, const typename TypeTraits< T_Scalar >::cla3p_type *src, T_Scalar *dest) |
| Copies a vector from host memory (cla3p type) to device memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyD2H (std::size_t n, const T_Scalar *src, typename TypeTraits< T_Scalar >::cla3p_type *dest) |
| Copies a vector from device memory to host memory (cla3p type). | |
| void | culite::memCopyX2X (std::size_t elemSize, std::size_t m, std::size_t n, const void *src, std::size_t lds, void *dest, std::size_t ldd, cudaMemcpyKind kind) |
| Copies a 2D matrix between different memory spaces. | |
| template<typename T_Scalar> | |
| void | culite::memCopyD2D (std::size_t m, std::size_t n, const T_Scalar *src, std::size_t lds, T_Scalar *dest, std::size_t ldd) |
| Copies a 2D matrix from device memory to device memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyH2D (std::size_t m, std::size_t n, const T_Scalar *src, std::size_t lds, T_Scalar *dest, std::size_t ldd) |
| Copies a 2D matrix from host memory to device memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyD2H (std::size_t m, std::size_t n, const T_Scalar *src, std::size_t lds, T_Scalar *dest, std::size_t ldd) |
| Copies a 2D matrix from device memory to host memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyH2H (std::size_t m, std::size_t n, const T_Scalar *src, std::size_t lds, T_Scalar *dest, std::size_t ldd) |
| Copies a 2D matrix from host memory to host memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyH2D (std::size_t m, std::size_t n, const typename TypeTraits< T_Scalar >::cla3p_type *src, std::size_t lds, T_Scalar *dest, std::size_t ldd) |
| Copies a 2D matrix from host memory (cla3p type) to device memory. | |
| template<typename T_Scalar> | |
| void | culite::memCopyD2H (std::size_t m, std::size_t n, const T_Scalar *src, std::size_t lds, typename TypeTraits< T_Scalar >::cla3p_type *dest, std::size_t ldd) |
| Copies a 2D matrix from device memory to host memory (cla3p type). | |
| void | culite::memSetZeroX (std::size_t n, void *x, std::size_t elemSize) |
| Sets a vector in device memory to zero. | |
| template<typename T_Scalar> | |
| void | culite::memSetZero (std::size_t n, T_Scalar *x) |
| Sets a vector in device memory to zero. | |
| void | culite::memSetZeroX (std::size_t m, std::size_t n, void *a, std::size_t lda, std::size_t elemSize) |
| Sets a 2D matrix in device memory to zero. | |
| template<typename T_Scalar> | |
| void | culite::memSetZero (std::size_t m, std::size_t n, T_Scalar *a, std::size_t lda) |
| Sets a 2D matrix in device memory to zero. | |
Utility functions for transferring data between host and device memory.
This module offers a suite of functions and operators to facilitate efficient copying of data between CPU (host) and GPU (device) memory spaces. It supports synchronous and asynchronous transfers, as well as conversions between different data representations.
| void culite::memCopyX2X | ( | std::size_t | count, |
| const void * | src, | ||
| void * | dest, | ||
| cudaMemcpyKind | kind ) |
Copies memory between different memory spaces.
| count | Number of bytes to copy. |
| src | Source memory pointer. |
| dest | Destination memory pointer. |
| kind | Type of memory copy operation (device-to-device, host-to-device, etc.). |
|
inline |
Copies a vector from device memory to device memory.
| T_Scalar | The scalar type of the vector elements. |
| n | Number of elements to copy. |
| src | Source device memory pointer. |
| dest | Destination device memory pointer. |
|
inline |
Copies a vector from host memory to device memory.
| T_Scalar | The scalar type of the vector elements. |
| n | Number of elements to copy. |
| src | Source host memory pointer. |
| dest | Destination device memory pointer. |
|
inline |
Copies a vector from device memory to host memory.
| T_Scalar | The scalar type of the vector elements. |
| n | Number of elements to copy. |
| src | Source device memory pointer. |
| dest | Destination host memory pointer. |
|
inline |
Copies a vector from host memory to host memory.
| T_Scalar | The scalar type of the vector elements. |
| n | Number of elements to copy. |
| src | Source host memory pointer. |
| dest | Destination host memory pointer. |
|
inline |
|
inline |
| void culite::memCopyX2X | ( | std::size_t | elemSize, |
| std::size_t | m, | ||
| std::size_t | n, | ||
| const void * | src, | ||
| std::size_t | lds, | ||
| void * | dest, | ||
| std::size_t | ldd, | ||
| cudaMemcpyKind | kind ) |
Copies a 2D matrix between different memory spaces.
| elemSize | Size of each element in bytes. |
| m | Number of rows to copy. |
| n | Number of columns to copy. |
| src | Source memory pointer. |
| lds | Leading dimension of the source matrix. |
| dest | Destination memory pointer. |
| ldd | Leading dimension of the destination matrix. |
| kind | Type of memory copy operation (device-to-device, host-to-device, etc.). |
|
inline |
Copies a 2D matrix from device memory to device memory.
| T_Scalar | The scalar type of the matrix elements. |
| m | Number of rows to copy. |
| n | Number of columns to copy. |
| src | Source device memory pointer. |
| lds | Leading dimension of the source matrix. |
| dest | Destination device memory pointer. |
| ldd | Leading dimension of the destination matrix. |
|
inline |
Copies a 2D matrix from host memory to device memory.
| T_Scalar | The scalar type of the matrix elements. |
| m | Number of rows to copy. |
| n | Number of columns to copy. |
| src | Source host memory pointer. |
| lds | Leading dimension of the source matrix. |
| dest | Destination device memory pointer. |
| ldd | Leading dimension of the destination matrix. |
|
inline |
Copies a 2D matrix from device memory to host memory.
| T_Scalar | The scalar type of the matrix elements. |
| m | Number of rows to copy. |
| n | Number of columns to copy. |
| src | Source device memory pointer. |
| lds | Leading dimension of the source matrix. |
| dest | Destination host memory pointer. |
| ldd | Leading dimension of the destination matrix. |
|
inline |
Copies a 2D matrix from host memory to host memory.
| T_Scalar | The scalar type of the matrix elements. |
| m | Number of rows to copy. |
| n | Number of columns to copy. |
| src | Source host memory pointer. |
| lds | Leading dimension of the source matrix. |
| dest | Destination host memory pointer. |
| ldd | Leading dimension of the destination matrix. |
|
inline |
Copies a 2D matrix from host memory (cla3p type) to device memory.
| T_Scalar | The scalar type of the matrix elements. |
| m | Number of rows to copy. |
| n | Number of columns to copy. |
| src | Source host memory pointer with cla3p type. |
| lds | Leading dimension of the source matrix. |
| dest | Destination device memory pointer. |
| ldd | Leading dimension of the destination matrix. |
|
inline |
Copies a 2D matrix from device memory to host memory (cla3p type).
| T_Scalar | The scalar type of the matrix elements. |
| m | Number of rows to copy. |
| n | Number of columns to copy. |
| src | Source device memory pointer. |
| lds | Leading dimension of the source matrix. |
| dest | Destination host memory pointer with cla3p type. |
| ldd | Leading dimension of the destination matrix. |
| void culite::memSetZeroX | ( | std::size_t | n, |
| void * | x, | ||
| std::size_t | elemSize ) |
Sets a vector in device memory to zero.
| n | Number of elements to set to zero. |
| x | Pointer to device memory vector. |
| elemSize | Size of each element in bytes. |
| void culite::memSetZero | ( | std::size_t | n, |
| T_Scalar * | x ) |
Sets a vector in device memory to zero.
| T_Scalar | The scalar type of the vector elements. |
| n | Number of elements to set to zero. |
| x | Pointer to device memory vector. |
| void culite::memSetZeroX | ( | std::size_t | m, |
| std::size_t | n, | ||
| void * | a, | ||
| std::size_t | lda, | ||
| std::size_t | elemSize ) |
Sets a 2D matrix in device memory to zero.
| m | Number of rows to set to zero. |
| n | Number of columns to set to zero. |
| a | Pointer to device memory matrix. |
| lda | Leading dimension of the matrix. |
| elemSize | Size of each element in bytes. |
| void culite::memSetZero | ( | std::size_t | m, |
| std::size_t | n, | ||
| T_Scalar * | a, | ||
| std::size_t | lda ) |
Sets a 2D matrix in device memory to zero.
| T_Scalar | The scalar type of the matrix elements. |
| m | Number of rows to set to zero. |
| n | Number of columns to set to zero. |
| a | Pointer to device memory matrix. |
| lda | Leading dimension of the matrix. |