36#include "../util_namespace.cuh"
37#include "../util_debug.cuh"
81template <
typename OffsetT>
99 __host__ __device__ __forceinline__
124 cudaStream_t stream = 0)
126#if (CUB_PTX_ARCH > 0)
133 counters[FILL] = fill_size;
141 __host__ __device__ __forceinline__ cudaError_t
ResetDrain(cudaStream_t stream = 0)
143#if (CUB_PTX_ARCH > 0)
154 __host__ __device__ __forceinline__ cudaError_t
ResetFill(cudaStream_t stream = 0)
156#if (CUB_PTX_ARCH > 0)
167 __host__ __device__ __forceinline__ cudaError_t
FillSize(
169 cudaStream_t stream = 0)
171#if (CUB_PTX_ARCH > 0)
196#ifndef DOXYGEN_SHOULD_SKIP_THIS
202template <
typename OffsetT>
GridQueue is a descriptor utility for dynamic queue management.
__host__ __device__ __forceinline__ cudaError_t ResetFill(cudaStream_t stream=0)
This operation resets the fill counter. To be called by the host or by a kernel prior to that which w...
__device__ __forceinline__ OffsetT Fill(OffsetT num_items)
Fill num_items into the queue. Returns offset from which to write items. To be called from CUDA kerne...
__host__ __device__ __forceinline__ cudaError_t ResetDrain(cudaStream_t stream=0)
This operation resets the drain so that it may advance to meet the existing fill-size....
__host__ __device__ __forceinline__ cudaError_t FillSize(OffsetT &fill_size, cudaStream_t stream=0)
Returns the fill-size established by the parent or by the previous kernel.
OffsetT * d_counters
Pair of counters.
__host__ __device__ __forceinline__ GridQueue()
Constructs an invalid GridQueue descriptor.
__device__ __forceinline__ OffsetT Drain(OffsetT num_items)
Drain num_items from the queue. Returns offset from which to read items. To be called from CUDA kerne...
__host__ __device__ __forceinline__ cudaError_t FillAndResetDrain(OffsetT fill_size, cudaStream_t stream=0)
This operation sets the fill-size and resets the drain counter, preparing the GridQueue for draining ...
__host__ __device__ __forceinline__ GridQueue(void *d_storage)
Constructs a GridQueue descriptor around the device storage allocation.
__host__ __device__ static __forceinline__ size_t AllocationSize()
Returns the device allocation size in bytes needed to construct a GridQueue instance.
__global__ void FillAndResetDrainKernel(GridQueue< OffsetT > grid_queue, OffsetT num_items)
#define CubDebug(e)
Debug macro.
Optional outer namespace(s)
KeyT const ValueT ValueT OffsetT OffsetT num_items
[in] Total number of input data items
OffsetT OffsetT
[in] Total number of input data items