|
__HOST__ __DEVICE__ | padded_ptr (pointer ptr=pointer(), size_type pitch=size_type()) |
|
__HOST__ __DEVICE__ | padded_ptr (const padded_ptr &src) |
|
__HOST__ __DEVICE__ padded_ptr & | operator= (const padded_ptr &src) |
|
template<typename T2 , class P2 > |
__HOST__ __DEVICE__ | padded_ptr (const padded_ptr< T2, P2 > &src) |
|
__HOST__ __DEVICE__ size_type | get_pitch () const |
|
__HOST__ __DEVICE__ pointer | get () const |
|
__DEVICE__ reference | operator* () |
|
__DEVICE__ const_reference | operator* () const |
|
__DEVICE__ pointer | operator-> () const |
|
__DEVICE__ reference | operator[] (std::size_t i) |
|
__DEVICE__ const_reference | operator[] (std::size_t i) const |
|
__HOST__ __DEVICE__ | operator bool () const __NOEXCEPT__ |
| Checks if this stores a non-null pointer. More...
|
|
__HOST__ __DEVICE__ padded_ptr & | operator++ () |
|
__HOST__ __DEVICE__ padded_ptr & | operator-- () |
|
__HOST__ __DEVICE__ padded_ptr | operator++ (int) |
|
__HOST__ __DEVICE__ padded_ptr | operator-- (int) |
|
__HOST__ __DEVICE__ padded_ptr & | operator+= (int x) |
|
__HOST__ __DEVICE__ padded_ptr & | operator-= (int x) |
|
__HOST__ __DEVICE__ padded_ptr | operator+ (int x) const |
|
__HOST__ __DEVICE__ padded_ptr | operator- (int x) const |
|
__HOST__ __DEVICE__ padded_ptr | operator+ (std::size_t x) const |
|
__HOST__ __DEVICE__ padded_ptr | operator- (std::size_t x) const |
|
template<typename T2 , typename P2 > |
__HOST__ __DEVICE__ bool | operator== (const padded_ptr< T2, P2 > &other) const |
|
template<typename T2 , typename P2 > |
__HOST__ __DEVICE__ bool | operator!= (const padded_ptr< T2, P2 > &other) const |
|
template<typename T2 , typename P2 > |
__HOST__ __DEVICE__ bool | operator< (const padded_ptr< T2, P2 > &other) const |
|
template<typename T2 , typename P2 > |
__HOST__ __DEVICE__ bool | operator> (const padded_ptr< T2, P2 > &other) const |
|
template<typename T2 , typename P2 > |
__HOST__ __DEVICE__ bool | operator<= (const padded_ptr< T2, P2 > &other) const |
|
template<typename T2 , typename P2 > |
__HOST__ __DEVICE__ bool | operator>= (const padded_ptr< T2, P2 > &other) const |
|
__HOST__ __DEVICE__ void | skip_bytes (difference_type x) |
| Move the pointer some number of bytes. More...
|
|
template<typename T, typename P>
class ecuda::padded_ptr< T, P >
A specialized pointer to padded memory.
A specialized pointer to device memory which is aligned to a certain width. Although this class stores this width it is the responsibility of the user of the class to account for this padding when traversing the data.
The specialization is used to both represent 2D memory allocations using cudaMallocPitch().
Memory use can be conceptualized as:
|- width --|
|---- pitch ----|
+----------+----+
| |xxxx|
| |xxxx| x = allocated but not used
| |xxxx|
| |xxxx|
| |xxxx|
| |xxxx| ... etc. (total size of the allocation is not known internally by
padded_ptr)
+----------+----+
This class stores the pitch, but not the width nor the position within the range that the current pointed to element resides. The caller should store the relative position within the padded region and utilize the get_pitch() and skip_bytes() methods to skip over the padded region when needed.
Definition at line 52 of file iterator.hpp.