21 #ifndef ROCPRIM_TYPES_DOUBLE_BUFFER_HPP_ 22 #define ROCPRIM_TYPES_DOUBLE_BUFFER_HPP_ 24 #include "../config.hpp" 29 BEGIN_ROCPRIM_NAMESPACE
41 unsigned int selector;
47 ROCPRIM_HOST_DEVICE
inline 59 ROCPRIM_HOST_DEVICE
inline 68 ROCPRIM_HOST_DEVICE
inline 71 return buffers[selector];
75 ROCPRIM_HOST_DEVICE
inline 78 return buffers[selector ^ 1];
82 ROCPRIM_HOST_DEVICE
inline 94 #endif // ROCPRIM_TYPES_DOUBLE_BUFFER_HPP_ This class provides an convenient way to do double buffering.
Definition: double_buffer.hpp:37
ROCPRIM_HOST_DEVICE double_buffer(T *current, T *alternate)
Contructs a double buffer object using the supplied buffer pointers.
Definition: double_buffer.hpp:60
ROCPRIM_HOST_DEVICE double_buffer()
Constructs an empty double buffer object, initializing the buffer pointers to nullptr.
Definition: double_buffer.hpp:48
ROCPRIM_HOST_DEVICE T * current() const
Returns a pointer to the current buffer.
Definition: double_buffer.hpp:69
ROCPRIM_HOST_DEVICE T * alternate() const
Returns a pointer to the alternate buffer.
Definition: double_buffer.hpp:76
ROCPRIM_HOST_DEVICE void swap()
Swaps the current and alternate buffers.
Definition: double_buffer.hpp:83