template<typename AgentSegmentFixupPolicyT, typename PairsInputIteratorT, typename AggregatesOutputIteratorT, typename EqualityOpT, typename ReductionOpT, typename OffsetT>
struct cub::AgentSegmentFixup< AgentSegmentFixupPolicyT, PairsInputIteratorT, AggregatesOutputIteratorT, EqualityOpT, ReductionOpT, OffsetT >
AgentSegmentFixup implements a stateful abstraction of CUDA thread blocks for participating in device-wide reduce-value-by-key.
< Signed integer type for global offsets
Definition at line 95 of file agent_segment_fixup.cuh.
|
enum | {
BLOCK_THREADS = AgentSegmentFixupPolicyT::BLOCK_THREADS,
ITEMS_PER_THREAD = AgentSegmentFixupPolicyT::ITEMS_PER_THREAD,
TILE_ITEMS = BLOCK_THREADS * ITEMS_PER_THREAD,
USE_ATOMIC_FIXUP,
HAS_IDENTITY_ZERO = (Equals<ReductionOpT, cub::Sum>::VALUE) && (Traits<ValueT>::PRIMITIVE)
} |
|
typedef std::iterator_traits< PairsInputIteratorT >::value_type | KeyValuePairT |
|
typedef KeyValuePairT::Value | ValueT |
|
typedef ReduceByKeyScanTileState< ValueT, OffsetT > | ScanTileStateT |
|
typedef If< IsPointer< PairsInputIteratorT >::VALUE, CacheModifiedInputIterator< AgentSegmentFixupPolicyT::LOAD_MODIFIER, KeyValuePairT, OffsetT >, PairsInputIteratorT >::Type | WrappedPairsInputIteratorT |
|
typedef If< IsPointer< AggregatesOutputIteratorT >::VALUE, CacheModifiedInputIterator< AgentSegmentFixupPolicyT::LOAD_MODIFIER, ValueT, OffsetT >, AggregatesOutputIteratorT >::Type | WrappedFixupInputIteratorT |
|
typedef ReduceByKeyOp< cub::Sum > | ReduceBySegmentOpT |
|
typedef BlockLoad< KeyValuePairT, BLOCK_THREADS, ITEMS_PER_THREAD, AgentSegmentFixupPolicyT::LOAD_ALGORITHM > | BlockLoadPairs |
|
typedef BlockScan< KeyValuePairT, BLOCK_THREADS, AgentSegmentFixupPolicyT::SCAN_ALGORITHM > | BlockScanT |
|
typedef TilePrefixCallbackOp< KeyValuePairT, ReduceBySegmentOpT, ScanTileStateT > | TilePrefixCallbackOpT |
|
|
__device__ __forceinline__ | AgentSegmentFixup (TempStorage &temp_storage, PairsInputIteratorT d_pairs_in, AggregatesOutputIteratorT d_aggregates_out, EqualityOpT equality_op, ReductionOpT reduction_op) |
|
template<bool IS_LAST_TILE> |
__device__ __forceinline__ void | ConsumeTile (OffsetT num_remaining, int tile_idx, OffsetT tile_offset, ScanTileStateT &tile_state, Int2Type< true > use_atomic_fixup) |
|
template<bool IS_LAST_TILE> |
__device__ __forceinline__ void | ConsumeTile (OffsetT num_remaining, int tile_idx, OffsetT tile_offset, ScanTileStateT &tile_state, Int2Type< false > use_atomic_fixup) |
|
__device__ __forceinline__ void | ConsumeRange (int num_items, int num_tiles, ScanTileStateT &tile_state) |
|
template<typename AgentSegmentFixupPolicyT , typename PairsInputIteratorT , typename AggregatesOutputIteratorT , typename EqualityOpT , typename ReductionOpT , typename OffsetT >
Scan tiles of items as part of a dynamic chained scan
- Parameters
-
num_items | Total number of input items |
num_tiles | Total number of input tiles |
tile_state | Global tile state descriptor |
Definition at line 348 of file agent_segment_fixup.cuh.
template<typename AgentSegmentFixupPolicyT , typename PairsInputIteratorT , typename AggregatesOutputIteratorT , typename EqualityOpT , typename ReductionOpT , typename OffsetT >
template<bool IS_LAST_TILE>
Process input tile. Specialized for atomic-fixup
- Parameters
-
num_remaining | Number of global input items remaining (including this tile) |
tile_idx | Tile index |
tile_offset | Tile offset |
tile_state | Global tile state descriptor |
use_atomic_fixup | Marker whether to use atomicAdd (instead of reduce-by-key) |
Definition at line 227 of file agent_segment_fixup.cuh.
template<typename AgentSegmentFixupPolicyT , typename PairsInputIteratorT , typename AggregatesOutputIteratorT , typename EqualityOpT , typename ReductionOpT , typename OffsetT >
template<bool IS_LAST_TILE>
Process input tile. Specialized for reduce-by-key fixup
- Parameters
-
num_remaining | Number of global input items remaining (including this tile) |
tile_idx | Tile index |
tile_offset | Tile offset |
tile_state | Global tile state descriptor |
use_atomic_fixup | Marker whether to use atomicAdd (instead of reduce-by-key) |
Definition at line 267 of file agent_segment_fixup.cuh.