Double-buffer storage wrapper for multi-pass stream transformations that require more than one storage array for streaming intermediate results back and forth. More...
Double-buffer storage wrapper for multi-pass stream transformations that require more than one storage array for streaming intermediate results back and forth.
Many multi-pass computations require a pair of "ping-pong" storage buffers (e.g., one for reading from and the other for writing to, and then vice-versa for the subsequent pass). This structure wraps a set of device buffers and a "selector" member to track which is "current".
Definition at line 791 of file util_type.cuh.
Public Member Functions | |
__host__ __device__ __forceinline__ | DoubleBuffer () |
Constructor. | |
__host__ __device__ __forceinline__ | DoubleBuffer (T *d_current, T *d_alternate) |
Constructor. | |
__host__ __device__ __forceinline__ T * | Current () |
Return pointer to the currently valid buffer. | |
__host__ __device__ __forceinline__ T * | Alternate () |
Return pointer to the currently invalid buffer. | |
Data Fields | |
T * | d_buffers [2] |
Pair of device buffer pointers. | |
int | selector |
Selector into d_buffers (i.e., the active/valid buffer) | |
|
inline |
Constructor.
Definition at line 800 of file util_type.cuh.
|
inline |
Constructor.
d_current | The currently valid buffer |
d_alternate | Alternate storage buffer of the same size as d_current |
Definition at line 808 of file util_type.cuh.
|
inline |
Return pointer to the currently invalid buffer.
Definition at line 821 of file util_type.cuh.
|
inline |
Return pointer to the currently valid buffer.
Definition at line 818 of file util_type.cuh.
T* cub::DoubleBuffer< T >::d_buffers[2] |
Pair of device buffer pointers.
Definition at line 794 of file util_type.cuh.
int cub::DoubleBuffer< T >::selector |
Selector into d_buffers
(i.e., the active/valid buffer)
Definition at line 797 of file util_type.cuh.