21 #ifndef ROCPRIM_BLOCK_BLOCK_RADIX_RANK_HPP_ 22 #define ROCPRIM_BLOCK_BLOCK_RADIX_RANK_HPP_ 24 #include "../config.hpp" 25 #include "../functional.hpp" 27 #include "../detail/radix_sort.hpp" 29 #include "block_scan.hpp" 31 #include "detail/block_radix_rank_basic.hpp" 32 #include "detail/block_radix_rank_match.hpp" 37 BEGIN_ROCPRIM_NAMESPACE
56 template<block_radix_rank_algorithm Algorithm>
62 template<
unsigned int BlockSizeX,
63 unsigned int RadixBits,
64 unsigned int BlockSizeY,
65 unsigned int BlockSizeZ>
72 template<
unsigned int BlockSizeX,
73 unsigned int RadixBits,
74 unsigned int BlockSizeY,
75 unsigned int BlockSizeZ>
82 template<
unsigned int BlockSizeX,
83 unsigned int RadixBits,
84 unsigned int BlockSizeY,
85 unsigned int BlockSizeZ>
138 template<
unsigned int BlockSizeX,
139 unsigned int RadixBits,
141 unsigned int BlockSizeY = 1,
142 unsigned int BlockSizeZ = 1>
144 #ifndef DOXYGEN_SHOULD_SKIP_THIS
146 Algorithm>::template type<BlockSizeX, RadixBits, BlockSizeY, BlockSizeZ>
150 Algorithm>::template type<BlockSizeX, RadixBits, BlockSizeY, BlockSizeZ>;
154 static constexpr
unsigned int digits_per_thread = base_type::digits_per_thread;
208 template<
typename Key,
unsigned ItemsPerThread>
209 ROCPRIM_DEVICE
void rank_keys(
const Key (&keys)[ItemsPerThread],
210 unsigned int (&ranks)[ItemsPerThread],
212 unsigned int begin_bit = 0,
213 unsigned int pass_bits = RadixBits)
215 base_type::rank_keys(keys, ranks, storage, begin_bit, pass_bits);
231 template<
typename Key,
unsigned ItemsPerThread>
232 ROCPRIM_DEVICE
void rank_keys(
const Key (&keys)[ItemsPerThread],
233 unsigned int (&ranks)[ItemsPerThread],
234 unsigned int begin_bit = 0,
235 unsigned int pass_bits = RadixBits)
238 base_type::rank_keys(keys, ranks, storage, begin_bit, pass_bits);
283 template<
typename Key,
unsigned ItemsPerThread>
285 unsigned int (&ranks)[ItemsPerThread],
287 unsigned int begin_bit = 0,
288 unsigned int pass_bits = RadixBits)
290 base_type::rank_keys_desc(keys, ranks, storage, begin_bit, pass_bits);
306 template<
typename Key,
unsigned ItemsPerThread>
308 unsigned int (&ranks)[ItemsPerThread],
309 unsigned int begin_bit = 0,
310 unsigned int pass_bits = RadixBits)
313 base_type::rank_keys_desc(keys, ranks, storage, begin_bit, pass_bits);
366 template<
typename Key,
unsigned ItemsPerThread,
typename DigitExtractor>
367 ROCPRIM_DEVICE
void rank_keys(
const Key (&keys)[ItemsPerThread],
368 unsigned int (&ranks)[ItemsPerThread],
370 DigitExtractor digit_extractor)
372 base_type::rank_keys(keys, ranks, storage, digit_extractor);
393 template<
typename Key,
unsigned ItemsPerThread,
typename DigitExtractor>
394 ROCPRIM_DEVICE
void rank_keys(
const Key (&keys)[ItemsPerThread],
395 unsigned int (&ranks)[ItemsPerThread],
396 DigitExtractor digit_extractor)
399 base_type::rank_keys(keys, ranks, storage, digit_extractor);
452 template<
typename Key,
unsigned ItemsPerThread,
typename DigitExtractor>
454 unsigned int (&ranks)[ItemsPerThread],
456 DigitExtractor digit_extractor)
458 base_type::rank_keys_desc(keys, ranks, storage, digit_extractor);
479 template<
typename Key,
unsigned ItemsPerThread,
typename DigitExtractor>
481 unsigned int (&ranks)[ItemsPerThread],
482 DigitExtractor digit_extractor)
485 base_type::rank_keys_desc(keys, ranks, storage, digit_extractor);
540 template<
typename Key,
unsigned ItemsPerThread,
typename DigitExtractor>
541 ROCPRIM_DEVICE
void rank_keys(
const Key (&keys)[ItemsPerThread],
542 unsigned int (&ranks)[ItemsPerThread],
544 DigitExtractor digit_extractor,
545 unsigned int (&prefix)[digits_per_thread],
546 unsigned int (&counts)[digits_per_thread])
548 base_type::rank_keys(keys, ranks, storage, digit_extractor, prefix, counts);
552 END_ROCPRIM_NAMESPACE
557 #endif // ROCPRIM_BLOCK_BLOCK_RADIX_RANK_HPP_ block_radix_rank_algorithm
Available algorithms for the block_radix_rank primitive.
Definition: block_radix_rank.hpp:40
The basic block radix rank algorithm, configured to memoize intermediate values.
ROCPRIM_DEVICE void rank_keys_desc(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], DigitExtractor digit_extractor)
Perform descending radix rank over bit keys partitioned across threads in a block.
Definition: block_radix_rank.hpp:480
Definition: block_radix_rank.hpp:57
ROCPRIM_DEVICE void rank_keys_desc(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], storage_type &storage, unsigned int begin_bit=0, unsigned int pass_bits=RadixBits)
Perform ascending radix rank over bit keys partitioned across threads in a block. ...
Definition: block_radix_rank.hpp:284
Definition: block_radix_rank_match.hpp:42
ROCPRIM_DEVICE void rank_keys(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], storage_type &storage, unsigned int begin_bit=0, unsigned int pass_bits=RadixBits)
Perform ascending radix rank over keys partitioned across threads in a block.
Definition: block_radix_rank.hpp:209
Definition: block_radix_rank_basic.hpp:42
The block_radix_rank class is a block level parallel primitive that provides methods for ranking item...
Definition: block_radix_rank.hpp:143
The default radix ranking algorithm.
ROCPRIM_DEVICE void rank_keys(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], storage_type &storage, DigitExtractor digit_extractor, unsigned int(&prefix)[digits_per_thread], unsigned int(&counts)[digits_per_thread])
Perform ascending radix rank over bit keys partitioned across threads in a block. ...
Definition: block_radix_rank.hpp:541
Deprecated: Configuration of device-level scan primitives.
Definition: block_histogram.hpp:62
typename base_type::storage_type storage_type
Struct used to allocate a temporary memory that is required for thread communication during operation...
Definition: block_radix_rank.hpp:164
ROCPRIM_DEVICE void rank_keys(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], DigitExtractor digit_extractor)
Perform ascending radix rank over bit keys partitioned across threads in a block. ...
Definition: block_radix_rank.hpp:394
The basic block radix rank algorithm. Keys and ranks are assumed in blocked order.
ROCPRIM_DEVICE void rank_keys(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], unsigned int begin_bit=0, unsigned int pass_bits=RadixBits)
Perform ascending radix rank over keys partitioned across threads in a block.
Definition: block_radix_rank.hpp:232
ROCPRIM_DEVICE void rank_keys_desc(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], storage_type &storage, DigitExtractor digit_extractor)
Perform descending radix rank over bit keys partitioned across threads in a block.
Definition: block_radix_rank.hpp:453
ROCPRIM_DEVICE void rank_keys(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], storage_type &storage, DigitExtractor digit_extractor)
Perform ascending radix rank over bit keys partitioned across threads in a block. ...
Definition: block_radix_rank.hpp:367
Warp-based radix ranking algorithm. Keys and ranks are assumed in warp-striped order for this algorit...
Default block_histogram algorithm.
ROCPRIM_DEVICE void rank_keys_desc(const Key(&keys)[ItemsPerThread], unsigned int(&ranks)[ItemsPerThread], unsigned int begin_bit=0, unsigned int pass_bits=RadixBits)
Perform descending radix rank over keys partitioned across threads in a block.
Definition: block_radix_rank.hpp:307