Lock-free ring of values of type T with one producer on the GPU (push()) and one consumer on the host (pop()).
More...
#include <RingQueue_DtoH.hh>
|
| __host__ | RingQueueDtoH (const unsigned capacity) |
| | Allocate the pinned head and tail words and a pinned ring of capacity values, starting empty; asserts that capacity is a power of 2.
|
| |
| __host__ | ~RingQueueDtoH () |
| | Free the pinned ring, tail and head.
|
| |
| __device__ bool | push (const T &value) const |
| | Store value at head and advance when not full.
|
| |
| __host__ bool | pop (T *const __restrict__ value) const |
| | Fetch value at tail and advance when not empty.
|
| |
| __host__ __device__ unsigned | head () const |
| | Return the head, the next slot to be pushed.
|
| |
| __host__ __device__ unsigned | tail () const |
| | Return the tail, the next slot to be popped.
|
| |
| __host__ __device__ unsigned | occupancy () const |
| | Return the number of values queued (head minus tail, modulo the capacity).
|
| |
| __host__ __device__ size_t | size () const |
| | Return the capacity.
|
| |
| __host__ void | reset () |
| | Set the head and tail to 0 (empty); not synchronized with the other side.
|
| |
template<typename T>
class Drp::Gpu::RingQueueDtoH< T >
Lock-free ring of values of type T with one producer on the GPU (push()) and one consumer on the host (pop()).
The values and the head and tail counters are in pinned host memory; one slot always stays empty. Used by Reducer for the per-worker output queues of ReducerTuple results.
◆ RingQueueDtoH()
Allocate the pinned head and tail words and a pinned ring of capacity values, starting empty; asserts that capacity is a power of 2.
◆ ~RingQueueDtoH()
Free the pinned ring, tail and head.
◆ head()
Return the head, the next slot to be pushed.
◆ occupancy()
Return the number of values queued (head minus tail, modulo the capacity).
◆ pop()
Fetch value at tail and advance when not empty.
◆ push()
Store value at head and advance when not full.
◆ reset()
Set the head and tail to 0 (empty); not synchronized with the other side.
◆ size()
◆ tail()
Return the tail, the next slot to be popped.
The documentation for this class was generated from the following files: