OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
cub::DoubleBuffer< T > Struct Template Reference

Double-buffer storage wrapper for multi-pass stream transformations that require more than one storage array for streaming intermediate results back and forth. More...

Detailed Description

template<typename T>
struct cub::DoubleBuffer< T >

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. More...
 
__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)
 

Constructor & Destructor Documentation

◆ DoubleBuffer()

template<typename T>
__host__ __device__ __forceinline__ cub::DoubleBuffer< T >::DoubleBuffer ( T *  d_current,
T *  d_alternate 
)
inline

Constructor.

Parameters
d_currentThe currently valid buffer
d_alternateAlternate storage buffer of the same size as d_current

Definition at line 808 of file util_type.cuh.


The documentation for this struct was generated from the following file: