21 #ifndef ROCPRIM_BLOCK_BLOCK_SORT_HPP_    22 #define ROCPRIM_BLOCK_BLOCK_SORT_HPP_    24 #include <type_traits>    26 #include "../config.hpp"    27 #include "../detail/various.hpp"    29 #include "../intrinsics.hpp"    30 #include "../functional.hpp"    32 #include "detail/block_sort_bitonic.hpp"    33 #include "detail/block_sort_merge.hpp"    38 BEGIN_ROCPRIM_NAMESPACE
    58 template<block_sort_algorithm Algorithm>
    65               unsigned int BlockSizeX,
    66               unsigned int BlockSizeY,
    67               unsigned int BlockSizeZ,
    68               unsigned int ItemsPerThread,
    78              unsigned int BlockSizeX,
    79              unsigned int BlockSizeY,
    80              unsigned int BlockSizeZ,
    81              unsigned int ItemsPerThread,
    90              unsigned int BlockSizeX,
    91              unsigned int BlockSizeY,
    92              unsigned int BlockSizeZ,
    93              unsigned int ItemsPerThread,
   144     unsigned int BlockSizeX,
   145     unsigned int ItemsPerThread = 1,
   148     unsigned int BlockSizeY = 1,
   149     unsigned int BlockSizeZ = 1
   152 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   179     template<
class BinaryFunction = ::rocprim::less<Key>>
   180     ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
   182               BinaryFunction compare_function = BinaryFunction())
   184         base_type::sort(thread_key, compare_function);
   189     template <
class BinaryFunction = ::rocprim::less<Key>>
   190     ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
   191     void sort(Key (&thread_keys)[ItemsPerThread],
   192               BinaryFunction compare_function = BinaryFunction())
   194         base_type::sort(thread_keys, compare_function);
   238     template<
class BinaryFunction = ::rocprim::less<Key>>
   239     ROCPRIM_DEVICE ROCPRIM_INLINE
   242               BinaryFunction compare_function = BinaryFunction())
   244         base_type::sort(thread_key, storage, compare_function);
   249     template<
class BinaryFunction = ::rocprim::less<Key>>
   250     ROCPRIM_DEVICE ROCPRIM_INLINE 
void sort(Key (&thread_keys)[ItemsPerThread],
   252                                             BinaryFunction compare_function = BinaryFunction())
   254         base_type::sort(thread_keys, storage, compare_function);
   269     template<
class BinaryFunction = ::rocprim::less<Key>>
   270     ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
   273               BinaryFunction compare_function = BinaryFunction())
   275         base_type::sort(thread_key, thread_value, compare_function);
   280     template<
class BinaryFunction = ::rocprim::less<Key>>
   281     ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE
   282     void sort(Key (&thread_keys)[ItemsPerThread],
   283               Value (&thread_values)[ItemsPerThread],
   284               BinaryFunction compare_function = BinaryFunction())
   286         base_type::sort(thread_keys, thread_values, compare_function);
   331     template<
class BinaryFunction = ::rocprim::less<Key>>
   332     ROCPRIM_DEVICE ROCPRIM_INLINE
   336               BinaryFunction compare_function = BinaryFunction())
   338         base_type::sort(thread_key, thread_value, storage, compare_function);
   343     template<
class BinaryFunction = ::rocprim::less<Key>>
   344     ROCPRIM_DEVICE ROCPRIM_INLINE
   345     void sort(Key (&thread_keys)[ItemsPerThread],
   346               Value (&thread_values)[ItemsPerThread],
   348               BinaryFunction compare_function = BinaryFunction())
   350         base_type::sort(thread_keys, thread_values, storage, compare_function);
   367     template<
class BinaryFunction = ::rocprim::less<Key>>
   368     ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE 
void sort(Key&               thread_key,
   370                                                   const unsigned int size,
   371                                                   BinaryFunction     compare_function
   374         base_type::sort(thread_key, storage, size, compare_function);
   391     template<
class BinaryFunction = ::rocprim::less<Key>>
   392     ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE 
void sort(Key (&thread_keys)[ItemsPerThread],
   394                                                   const unsigned int size,
   395                                                   BinaryFunction     compare_function
   398         base_type::sort(thread_keys, storage, size, compare_function);
   416     template<
class BinaryFunction = ::rocprim::less<Key>>
   417     ROCPRIM_DEVICE ROCPRIM_INLINE 
void sort(Key&               thread_key,
   420                                             const unsigned int size,
   421                                             BinaryFunction     compare_function = BinaryFunction())
   423         base_type::sort(thread_key, thread_value, storage, size, compare_function);
   441     template<
class BinaryFunction = ::rocprim::less<Key>>
   442     ROCPRIM_DEVICE ROCPRIM_INLINE 
void sort(Key (&thread_keys)[ItemsPerThread],
   443                                             Value (&thread_values)[ItemsPerThread],
   445                                             const unsigned int size,
   446                                             BinaryFunction     compare_function = BinaryFunction())
   448         base_type::sort(thread_keys, thread_values, storage, size, compare_function);
   452 END_ROCPRIM_NAMESPACE
   457 #endif // ROCPRIM_BLOCK_BLOCK_SORT_HPP_ Empty type used as a placeholder, usually used to flag that given template parameter should not be us...
Definition: types.hpp:135
A bitonic sort based algorithm. 
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void sort(Key &thread_key, Value &thread_value, BinaryFunction compare_function=BinaryFunction())
Block sort by key for any data type. 
Definition: block_sort.hpp:271
A merged sort based algorithm which sorts stably. 
ROCPRIM_DEVICE ROCPRIM_INLINE void sort(Key &thread_key, Value &thread_value, storage_type &storage, const unsigned int size, BinaryFunction compare_function=BinaryFunction())
Block sort by key for any data type. 
Definition: block_sort.hpp:417
The block_sort class is a block level parallel primitive which provides methods sorting items (keys o...
Definition: block_sort.hpp:151
Definition: block_sort_merge.hpp:41
Definition: block_sort_bitonic.hpp:47
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void sort(Key &thread_key, BinaryFunction compare_function=BinaryFunction())
Block sort for any data type. 
Definition: block_sort.hpp:181
ROCPRIM_DEVICE ROCPRIM_INLINE void sort(Key(&thread_keys)[ItemsPerThread], Value(&thread_values)[ItemsPerThread], storage_type &storage, BinaryFunction compare_function=BinaryFunction())
This overload allows an array of ItemsPerThread keys and values to be passed in so that each thread c...
Definition: block_sort.hpp:345
ROCPRIM_DEVICE ROCPRIM_INLINE void sort(Key(&thread_keys)[ItemsPerThread], storage_type &storage, BinaryFunction compare_function=BinaryFunction())
This overload allows arrays of ItemsPerThread keys to be passed in so that each thread can process mu...
Definition: block_sort.hpp:250
Deprecated: Configuration of device-level scan primitives. 
Definition: block_histogram.hpp:62
Default block_sort algorithm. 
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void sort(Key(&thread_keys)[ItemsPerThread], Value(&thread_values)[ItemsPerThread], BinaryFunction compare_function=BinaryFunction())
This overload allows an array of ItemsPerThread keys and values to be passed in so that each thread c...
Definition: block_sort.hpp:282
typename base_type::storage_type storage_type
Struct used to allocate a temporary memory that is required for thread communication during operation...
Definition: block_sort.hpp:166
ROCPRIM_DEVICE ROCPRIM_INLINE void sort(Key &thread_key, Value &thread_value, storage_type &storage, BinaryFunction compare_function=BinaryFunction())
Block sort by key for any data type. 
Definition: block_sort.hpp:333
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void sort(Key(&thread_keys)[ItemsPerThread], storage_type &storage, const unsigned int size, BinaryFunction compare_function=BinaryFunction())
Block sort for any data type. 
Definition: block_sort.hpp:392
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void sort(Key &thread_key, storage_type &storage, const unsigned int size, BinaryFunction compare_function=BinaryFunction())
Block sort for any data type. 
Definition: block_sort.hpp:368
Default block_histogram algorithm. 
ROCPRIM_DEVICE ROCPRIM_FORCE_INLINE void sort(Key(&thread_keys)[ItemsPerThread], BinaryFunction compare_function=BinaryFunction())
This overload allows an array of ItemsPerThread keys to be passed in so that each thread can process ...
Definition: block_sort.hpp:191
block_sort_algorithm
Available algorithms for block_sort primitive. 
Definition: block_sort.hpp:41
ROCPRIM_DEVICE ROCPRIM_INLINE void sort(Key &thread_key, storage_type &storage, BinaryFunction compare_function=BinaryFunction())
Block sort for any data type. 
Definition: block_sort.hpp:240
Definition: block_sort.hpp:59
A merge sort based algorithm. 
ROCPRIM_DEVICE ROCPRIM_INLINE void sort(Key(&thread_keys)[ItemsPerThread], Value(&thread_values)[ItemsPerThread], storage_type &storage, const unsigned int size, BinaryFunction compare_function=BinaryFunction())
Block sort by key for any data type. 
Definition: block_sort.hpp:442