AgentSelectIf implements a stateful abstraction of CUDA thread blocks for participating in device-wide selection. More...
AgentSelectIf implements a stateful abstraction of CUDA thread blocks for participating in device-wide selection.
Performs functor-based selection if SelectOpT functor type != NullType Otherwise performs flag-based selection if FlagsInputIterator's value type != NullType Otherwise performs discontinuity selection (keep unique) < Whether or not we push rejected items to the back of the output
Definition at line 105 of file agent_select_if.cuh.
Data Structures | |
union | _TempStorage |
struct | TempStorage |
Public Types | |
enum | { USE_SELECT_OP , USE_SELECT_FLAGS , USE_DISCONTINUITY , BLOCK_THREADS = AgentSelectIfPolicyT::BLOCK_THREADS , ITEMS_PER_THREAD = AgentSelectIfPolicyT::ITEMS_PER_THREAD , TILE_ITEMS = BLOCK_THREADS * ITEMS_PER_THREAD , TWO_PHASE_SCATTER = (ITEMS_PER_THREAD > 1) , SELECT_METHOD } |
typedef std::iterator_traits< InputIteratorT >::value_type | InputT |
typedef If<(Equals< typenamestd::iterator_traits< SelectedOutputIteratorT >::value_type, void >::VALUE), typenamestd::iterator_traits< InputIteratorT >::value_type, typenamestd::iterator_traits< SelectedOutputIteratorT >::value_type >::Type | OutputT |
typedef std::iterator_traits< FlagsInputIteratorT >::value_type | FlagT |
typedef ScanTileState< OffsetT > | ScanTileStateT |
typedef If< IsPointer< InputIteratorT >::VALUE, CacheModifiedInputIterator< AgentSelectIfPolicyT::LOAD_MODIFIER, InputT, OffsetT >, InputIteratorT >::Type | WrappedInputIteratorT |
typedef If< IsPointer< FlagsInputIteratorT >::VALUE, CacheModifiedInputIterator< AgentSelectIfPolicyT::LOAD_MODIFIER, FlagT, OffsetT >, FlagsInputIteratorT >::Type | WrappedFlagsInputIteratorT |
typedef BlockLoad< OutputT, BLOCK_THREADS, ITEMS_PER_THREAD, AgentSelectIfPolicyT::LOAD_ALGORITHM > | BlockLoadT |
typedef BlockLoad< FlagT, BLOCK_THREADS, ITEMS_PER_THREAD, AgentSelectIfPolicyT::LOAD_ALGORITHM > | BlockLoadFlags |
typedef BlockDiscontinuity< OutputT, BLOCK_THREADS > | BlockDiscontinuityT |
typedef BlockScan< OffsetT, BLOCK_THREADS, AgentSelectIfPolicyT::SCAN_ALGORITHM > | BlockScanT |
typedef TilePrefixCallbackOp< OffsetT, cub::Sum, ScanTileStateT > | TilePrefixCallbackOpT |
typedef OutputT | ItemExchangeT[TILE_ITEMS] |
Public Member Functions | |
__device__ __forceinline__ | AgentSelectIf (TempStorage &temp_storage, InputIteratorT d_in, FlagsInputIteratorT d_flags_in, SelectedOutputIteratorT d_selected_out, SelectOpT select_op, EqualityOpT equality_op, OffsetT num_items) |
template<bool IS_FIRST_TILE, bool IS_LAST_TILE> | |
__device__ __forceinline__ void | InitializeSelections (OffsetT, OffsetT num_tile_items, OutputT(&items)[ITEMS_PER_THREAD], OffsetT(&selection_flags)[ITEMS_PER_THREAD], Int2Type< USE_SELECT_OP >) |
template<bool IS_FIRST_TILE, bool IS_LAST_TILE> | |
__device__ __forceinline__ void | InitializeSelections (OffsetT tile_offset, OffsetT num_tile_items, OutputT(&)[ITEMS_PER_THREAD], OffsetT(&selection_flags)[ITEMS_PER_THREAD], Int2Type< USE_SELECT_FLAGS >) |
template<bool IS_FIRST_TILE, bool IS_LAST_TILE> | |
__device__ __forceinline__ void | InitializeSelections (OffsetT tile_offset, OffsetT num_tile_items, OutputT(&items)[ITEMS_PER_THREAD], OffsetT(&selection_flags)[ITEMS_PER_THREAD], Int2Type< USE_DISCONTINUITY >) |
template<bool IS_LAST_TILE, bool IS_FIRST_TILE> | |
__device__ __forceinline__ void | ScatterDirect (OutputT(&items)[ITEMS_PER_THREAD], OffsetT(&selection_flags)[ITEMS_PER_THREAD], OffsetT(&selection_indices)[ITEMS_PER_THREAD], OffsetT num_selections) |
template<bool IS_LAST_TILE, bool IS_FIRST_TILE> | |
__device__ __forceinline__ void | ScatterTwoPhase (OutputT(&items)[ITEMS_PER_THREAD], OffsetT(&selection_flags)[ITEMS_PER_THREAD], OffsetT(&selection_indices)[ITEMS_PER_THREAD], int, int num_tile_selections, OffsetT num_selections_prefix, OffsetT, Int2Type< false >) |
template<bool IS_LAST_TILE, bool IS_FIRST_TILE> | |
__device__ __forceinline__ void | ScatterTwoPhase (OutputT(&items)[ITEMS_PER_THREAD], OffsetT(&selection_flags)[ITEMS_PER_THREAD], OffsetT(&selection_indices)[ITEMS_PER_THREAD], int num_tile_items, int num_tile_selections, OffsetT num_selections_prefix, OffsetT num_rejected_prefix, Int2Type< true >) |
template<bool IS_LAST_TILE, bool IS_FIRST_TILE> | |
__device__ __forceinline__ void | Scatter (OutputT(&items)[ITEMS_PER_THREAD], OffsetT(&selection_flags)[ITEMS_PER_THREAD], OffsetT(&selection_indices)[ITEMS_PER_THREAD], int num_tile_items, int num_tile_selections, OffsetT num_selections_prefix, OffsetT num_rejected_prefix, OffsetT num_selections) |
template<bool IS_LAST_TILE> | |
__device__ __forceinline__ OffsetT | ConsumeFirstTile (int num_tile_items, OffsetT tile_offset, ScanTileStateT &tile_state) |
template<bool IS_LAST_TILE> | |
__device__ __forceinline__ OffsetT | ConsumeSubsequentTile (int num_tile_items, int tile_idx, OffsetT tile_offset, ScanTileStateT &tile_state) |
template<bool IS_LAST_TILE> | |
__device__ __forceinline__ OffsetT | ConsumeTile (int num_tile_items, int tile_idx, OffsetT tile_offset, ScanTileStateT &tile_state) |
template<typename NumSelectedIteratorT > | |
__device__ __forceinline__ void | ConsumeRange (int num_tiles, ScanTileStateT &tile_state, NumSelectedIteratorT d_num_selected_out) |
< Output iterator type for recording number of items selection_flags | |
Data Fields | |
_TempStorage & | temp_storage |
Reference to temp_storage. | |
WrappedInputIteratorT | d_in |
Input items. | |
SelectedOutputIteratorT | d_selected_out |
Unique output items. | |
WrappedFlagsInputIteratorT | d_flags_in |
Input selection flags (if applicable) | |
InequalityWrapper< EqualityOpT > | inequality_op |
T inequality operator. | |
SelectOpT | select_op |
Selection operator. | |
OffsetT | num_items |
Total number of input items. | |
typedef BlockDiscontinuity< OutputT, BLOCK_THREADS> cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::BlockDiscontinuityT |
Definition at line 176 of file agent_select_if.cuh.
typedef BlockLoad< FlagT, BLOCK_THREADS, ITEMS_PER_THREAD, AgentSelectIfPolicyT::LOAD_ALGORITHM> cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::BlockLoadFlags |
Definition at line 170 of file agent_select_if.cuh.
typedef BlockLoad< OutputT, BLOCK_THREADS, ITEMS_PER_THREAD, AgentSelectIfPolicyT::LOAD_ALGORITHM> cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::BlockLoadT |
Definition at line 162 of file agent_select_if.cuh.
typedef BlockScan< OffsetT, BLOCK_THREADS, AgentSelectIfPolicyT::SCAN_ALGORITHM> cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::BlockScanT |
Definition at line 183 of file agent_select_if.cuh.
typedef std::iterator_traits<FlagsInputIteratorT>::value_type cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::FlagT |
Definition at line 120 of file agent_select_if.cuh.
typedef std::iterator_traits<InputIteratorT>::value_type cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::InputT |
Definition at line 112 of file agent_select_if.cuh.
typedef OutputT cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::ItemExchangeT[TILE_ITEMS] |
Definition at line 193 of file agent_select_if.cuh.
typedef If<(Equals<typenamestd::iterator_traits<SelectedOutputIteratorT>::value_type,void>::VALUE),typenamestd::iterator_traits<InputIteratorT>::value_type,typenamestd::iterator_traits<SelectedOutputIteratorT>::value_type>::Type cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::OutputT |
Definition at line 117 of file agent_select_if.cuh.
typedef ScanTileState<OffsetT> cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::ScanTileStateT |
Definition at line 123 of file agent_select_if.cuh.
typedef TilePrefixCallbackOp< OffsetT, cub::Sum, ScanTileStateT> cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::TilePrefixCallbackOpT |
Definition at line 190 of file agent_select_if.cuh.
typedef If<IsPointer<FlagsInputIteratorT>::VALUE,CacheModifiedInputIterator<AgentSelectIfPolicyT::LOAD_MODIFIER,FlagT,OffsetT>,FlagsInputIteratorT>::Type cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::WrappedFlagsInputIteratorT |
Definition at line 154 of file agent_select_if.cuh.
typedef If<IsPointer<InputIteratorT>::VALUE,CacheModifiedInputIterator<AgentSelectIfPolicyT::LOAD_MODIFIER,InputT,OffsetT>,InputIteratorT>::Type cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::WrappedInputIteratorT |
Definition at line 148 of file agent_select_if.cuh.
anonymous enum |
Definition at line 126 of file agent_select_if.cuh.
|
inline |
temp_storage | Reference to temp_storage |
d_in | Input data |
d_flags_in | Input selection flags (if applicable) |
d_selected_out | Output data |
select_op | Selection operator |
equality_op | Equality operator |
num_items | Total number of input items |
Definition at line 238 of file agent_select_if.cuh.
|
inline |
Process first tile of input (dynamic chained scan). Returns the running count of selections (including this tile)
num_tile_items | Number of input items comprising this tile |
tile_offset | Tile offset |
tile_state | Global tile state descriptor |
Definition at line 524 of file agent_select_if.cuh.
|
inline |
< Output iterator type for recording number of items selection_flags
Scan tiles of items as part of a dynamic chained scan
num_tiles | Total number of input tiles |
tile_state | Global tile state descriptor |
d_num_selected_out | Output total number selection_flags |
Definition at line 669 of file agent_select_if.cuh.
|
inline |
Process subsequent tile of input (dynamic chained scan). Returns the running count of selections (including this tile)
num_tile_items | Number of input items comprising this tile |
tile_idx | Tile index |
tile_offset | Tile offset |
tile_state | Global tile state descriptor |
Definition at line 583 of file agent_select_if.cuh.
|
inline |
Process a tile of input
num_tile_items | Number of input items comprising this tile |
tile_idx | Tile index |
tile_offset | Tile offset |
tile_state | Global tile state descriptor |
Definition at line 645 of file agent_select_if.cuh.
|
inline |
Initialize selections (specialized for valid flags)
Definition at line 288 of file agent_select_if.cuh.
|
inline |
Initialize selections (specialized for discontinuity detection)
Definition at line 322 of file agent_select_if.cuh.
|
inline |
Initialize selections (specialized for selection operator)
Definition at line 265 of file agent_select_if.cuh.
|
inline |
Scatter flagged items
num_tile_items | Number of valid items in this tile |
num_tile_selections | Number of selections in this tile |
num_selections_prefix | Total number of selections prior to this tile |
num_rejected_prefix | Total number of rejections prior to this tile |
num_selections | Total number of selections including this tile |
Definition at line 482 of file agent_select_if.cuh.
|
inline |
Scatter flagged items to output offsets (specialized for direct scattering)
Definition at line 366 of file agent_select_if.cuh.
|
inline |
Scatter flagged items to output offsets (specialized for two-phase scattering)
num_tile_items | Number of valid items in this tile |
num_tile_selections | Number of selections in this tile |
num_selections_prefix | Total number of selections prior to this tile |
num_rejected_prefix | Total number of rejections prior to this tile |
Definition at line 427 of file agent_select_if.cuh.
|
inline |
Scatter flagged items to output offsets (specialized for two-phase scattering)
num_tile_selections | Number of selections in this tile |
num_selections_prefix | Total number of selections prior to this tile |
Definition at line 391 of file agent_select_if.cuh.
WrappedFlagsInputIteratorT cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::d_flags_in |
Input selection flags (if applicable)
Definition at line 226 of file agent_select_if.cuh.
WrappedInputIteratorT cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::d_in |
Input items.
Definition at line 224 of file agent_select_if.cuh.
SelectedOutputIteratorT cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::d_selected_out |
Unique output items.
Definition at line 225 of file agent_select_if.cuh.
InequalityWrapper<EqualityOpT> cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::inequality_op |
T inequality operator.
Definition at line 227 of file agent_select_if.cuh.
OffsetT cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::num_items |
Total number of input items.
Definition at line 229 of file agent_select_if.cuh.
SelectOpT cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::select_op |
Selection operator.
Definition at line 228 of file agent_select_if.cuh.
_TempStorage& cub::AgentSelectIf< AgentSelectIfPolicyT, InputIteratorT, FlagsInputIteratorT, SelectedOutputIteratorT, SelectOpT, EqualityOpT, OffsetT, KEEP_REJECTS >::temp_storage |
Reference to temp_storage.
Definition at line 223 of file agent_select_if.cuh.