rocPRIM
Public Member Functions | List of all members
double_buffer< T > Class Template Reference

This class provides an convenient way to do double buffering. More...

#include <double_buffer.hpp>

Public Member Functions

ROCPRIM_HOST_DEVICE double_buffer ()
 Constructs an empty double buffer object, initializing the buffer pointers to nullptr. More...
 
ROCPRIM_HOST_DEVICE double_buffer (T *current, T *alternate)
 Contructs a double buffer object using the supplied buffer pointers. More...
 
ROCPRIM_HOST_DEVICE T * current () const
 Returns a pointer to the current buffer.
 
ROCPRIM_HOST_DEVICE T * alternate () const
 Returns a pointer to the alternate buffer.
 
ROCPRIM_HOST_DEVICE void swap ()
 Swaps the current and alternate buffers.
 

Detailed Description

template<class T>
class double_buffer< T >

This class provides an convenient way to do double buffering.

It tracks two versions of the buffer ("current" and "alternate"), which can be accessed with functions of the same name. You can also swap the buffers.

Constructor & Destructor Documentation

◆ double_buffer() [1/2]

template<class T>
ROCPRIM_HOST_DEVICE double_buffer< T >::double_buffer ( )
inline

Constructs an empty double buffer object, initializing the buffer pointers to nullptr.

◆ double_buffer() [2/2]

template<class T>
ROCPRIM_HOST_DEVICE double_buffer< T >::double_buffer ( T *  current,
T *  alternate 
)
inline

Contructs a double buffer object using the supplied buffer pointers.

Parameters
current- Pointer to the buffer to designate as "current" (in use).
alternate- Pointer to the buffer to designate as "alternate" (not in use)

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