gpufilter
GPU-Efficient Recursive Filtering and Summed-Area Tables
|
#include <dvector.h>
Public Member Functions | |
dvector (const std::vector< T > &that) | |
dvector (const T *data, const size_t &size) | |
dvector (const T *data, const size_t &w_data, const size_t &h_data, const size_t &w, const size_t &h) | |
dvector (const dvector< T > &that) | |
dvector (const size_t &size=0) | |
~dvector () | |
void | resize (const size_t &size) |
Resize this vector. | |
void | clear () |
Clear this vector. | |
T | operator[] (const int &idx) const |
Read/write operator. | |
dvector & | operator= (const dvector< T > &that) |
Assign operator. | |
dvector & | operator= (const std::vector< T > &that) |
Assign operator. | |
void | copy_to (T *data, const size_t &s) const |
Copy values from this vector to a host (CPU) vector. | |
void | copy_to (T *data, const size_t &w, const size_t &h, const size_t &w_data, const size_t &h_data) const |
Copy values from this vector in 2D to a host (CPU) vector. | |
void | copy_from (const T *data, const size_t &size) |
Copy values from a host (CPU) vector to this vector. | |
void | copy_from (const T *data, const size_t &w_data, const size_t &h_data, const size_t &w, const size_t &h) |
Copy values from a 2D host (CPU) vector to this vector. | |
void | fill_zero () |
Fill this vector with zeroes. | |
bool | empty () const |
Check if this vector is empty. | |
size_t | size () const |
Size of this vector. | |
T * | data () |
Data in this vector. | |
const T * | data () const |
T | back () const |
Get last element of the vector. | |
operator T * () | |
Address access operator. | |
operator const T * () const | |
Address access operator. | |
Private Attributes | |
T * | m_data |
Vector data. | |
size_t | m_size |
Vector size. | |
size_t | m_capacity |
Vector capacity. | |
Friends | |
void | swap (dvector< T > &a, dvector< T > &b) |
Swap vector values. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
std::vector< T > | to_cpu (const T *d_vec, unsigned len) |
Copy to the CPU a vector in the GPU. | |
template<class T > | |
std::vector< T > | to_cpu (const dvector< T > &v) |
Device Vector class.
Device vector is a STL-based vector in the GPU memory.
T | Device vector values type |
gpufilter::dvector< T >::dvector | ( | const std::vector< T > & | that | ) | [inline, explicit] |
Constructor
[in] | that | Host (STL) Vector data (non-converted) to be copied into this object |
gpufilter::dvector< T >::dvector | ( | const T * | data, |
const size_t & | size | ||
) | [inline] |
gpufilter::dvector< T >::dvector | ( | const T * | data, |
const size_t & | w_data, | ||
const size_t & | h_data, | ||
const size_t & | w, | ||
const size_t & | h | ||
) | [inline] |
Constructor
[in] | data | Vector data in 2D to be copied into this object |
[in] | w_data | Width of the vector data |
[in] | h_data | Height of the vector data |
[in] | w | Width of the vector data in device memory |
[in] | h | Height of the vector data in device memory |
gpufilter::dvector< T >::dvector | ( | const dvector< T > & | that | ) | [inline] |
Copy Constructor
[in] | that | Copy that object to this object |
gpufilter::dvector< T >::dvector | ( | const size_t & | size = 0 | ) | [inline] |
Default Constructor
[in] | size | Vector data size |
gpufilter::dvector< T >::~dvector | ( | ) | [inline] |
Destructor
T gpufilter::dvector< T >::back | ( | ) | const [inline] |
Get last element of the vector.
void gpufilter::dvector< T >::copy_from | ( | const T * | data, |
const size_t & | size | ||
) | [inline] |
void gpufilter::dvector< T >::copy_from | ( | const T * | data, |
const size_t & | w_data, | ||
const size_t & | h_data, | ||
const size_t & | w, | ||
const size_t & | h | ||
) | [inline] |
Copy values from a 2D host (CPU) vector to this vector.
[in] | data | Vector data in 2D to be copied into this object |
[in] | w_data | Width of the vector data |
[in] | h_data | Height of the vector data |
[in] | w | Width of the vector data in device memory |
[in] | h | Height of the vector data in device memory |
void gpufilter::dvector< T >::copy_to | ( | T * | data, |
const size_t & | s | ||
) | const [inline] |
Copy values from this vector to a host (CPU) vector.
[out] | data | Host Vector to copy values to |
[in] | s | Maximum number of elements to copy |
void gpufilter::dvector< T >::copy_to | ( | T * | data, |
const size_t & | w, | ||
const size_t & | h, | ||
const size_t & | w_data, | ||
const size_t & | h_data | ||
) | const [inline] |
Copy values from this vector in 2D to a host (CPU) vector.
[out] | data | Host Vector to copy values to |
[in] | w | Width of the vector data in device memory |
[in] | h | Height of the vector data in device memory |
[in] | w_data | Width of the vector data to copy values to |
[in] | h_data | Height of the vector data to copy values to |
T* gpufilter::dvector< T >::data | ( | ) | [inline] |
Data in this vector.
const T* gpufilter::dvector< T >::data | ( | ) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool gpufilter::dvector< T >::empty | ( | ) | const [inline] |
Check if this vector is empty.
gpufilter::dvector< T >::operator const T * | ( | ) | const [inline] |
Address access operator.
gpufilter::dvector< T >::operator T * | ( | ) | [inline] |
Address access operator.
dvector& gpufilter::dvector< T >::operator= | ( | const dvector< T > & | that | ) | [inline] |
Assign operator.
[in] | that | Device vector to copy from |
dvector& gpufilter::dvector< T >::operator= | ( | const std::vector< T > & | that | ) | [inline] |
Assign operator.
[in] | that | Host (STL) Vector to copy from |
T gpufilter::dvector< T >::operator[] | ( | const int & | idx | ) | const [inline] |
void gpufilter::dvector< T >::resize | ( | const size_t & | size | ) | [inline] |
Resize this vector.
[in] | size | The new vector size |
size_t gpufilter::dvector< T >::size | ( | ) | const [inline] |
Size of this vector.
std::vector< T > to_cpu | ( | const T * | d_vec, |
unsigned | len | ||
) | [related] |
Copy to the CPU a vector in the GPU.
This function copies a device vector (GPU) to a host vector (CPU).
[in] | d_vec | Pointer to the device vector (in the GPU memory) |
[in] | len | Length of the device vector |
T | Vector values type |
std::vector< T > to_cpu | ( | const dvector< T > & | v | ) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | v | Device vector (in the GPU memory) |
T | Vector values type |