cheshirekow  v0.1.0
mpblocks::cuda::bitonic::Sorter< KeyType, void > Class Template Reference

partial specialization for key-only sort More...

#include <mpblocks/cuda/bitonic/Sorter.h>

Public Types

typedef unsigned int uint_t
 

Public Member Functions

void config ()
 configures the sorter for the current cuda device More...
 
void config (int dev)
 configures the sorter for the specified cuda device More...
 
uint_t sort (KeyType *d_DstKey, KeyType *d_SrcKey, uint_t arrayLength, Direction dir=Ascending)
 actually perform the sort More...
 
 Sorter (KeyType min, KeyType max)
 the constructor queries the current device and calculates relevent parameters to decide how to size the kernels when they're called More...
 

Private Member Functions

void prepare (KeyType *d_SrcKey, uint_t arrayLength, Direction dir)
 used when arrayLength is not a power-of-two, fills the remaining elements with either the min key value of the max key value More...
 

Private Attributes

KeyType m_max
 
KeyType m_min
 
uint_t m_nSM
 number of SMs of the current device More...
 
uint_t m_sharedLength
 the size (in elements) of shared memory buffers in all the kernels (also, 2x the number of threads in a block) More...
 
uint_t m_threadsMerge
 number of threads per block to use in the global merge kernel More...
 
uint_t m_threadsPrepare
 number of threads per block to use in the prepare kernel More...
 

Detailed Description

template<typename KeyType>
class mpblocks::cuda::bitonic::Sorter< KeyType, void >

partial specialization for key-only sort

Definition at line 133 of file Sorter.h.

Member Typedef Documentation

template<typename KeyType >
typedef unsigned int mpblocks::cuda::bitonic::Sorter< KeyType, void >::uint_t

Definition at line 136 of file Sorter.h.

Constructor & Destructor Documentation

template<typename KeyType >
mpblocks::cuda::bitonic::Sorter< KeyType, void >::Sorter ( KeyType  min,
KeyType  max 
)

the constructor queries the current device and calculates relevent parameters to decide how to size the kernels when they're called

Definition at line 285 of file Sorter.cu.hpp.

Member Function Documentation

template<typename KeyType >
void mpblocks::cuda::bitonic::Sorter< KeyType, void >::config ( )

configures the sorter for the current cuda device

Definition at line 295 of file Sorter.cu.hpp.

template<typename KeyType >
void mpblocks::cuda::bitonic::Sorter< KeyType, void >::config ( int  dev)

configures the sorter for the specified cuda device

Definition at line 302 of file Sorter.cu.hpp.

template<typename KeyType >
void mpblocks::cuda::bitonic::Sorter< KeyType, void >::prepare ( KeyType *  d_SrcKey,
uint_t  arrayLength,
Direction  dir 
)
private

used when arrayLength is not a power-of-two, fills the remaining elements with either the min key value of the max key value

Definition at line 419 of file Sorter.cu.hpp.

template<typename KeyType >
uint_t mpblocks::cuda::bitonic::Sorter< KeyType, void >::sort ( KeyType *  d_DstKey,
KeyType *  d_SrcKey,
uint_t  arrayLength,
Direction  dir = Ascending 
)

actually perform the sort

Parameters
[out]*d_DstKeythe output array for sorted keys
[out]*d_DstValthe output array for sorted values
[in]*d_SrcKeypointer to start of intput array for keys
[in]*d_SrcValpointer to start of input array for values
[in]arrayLengththe size of the array to sort
[in]dirwhether to sort ascending or descending)

Definition at line 382 of file Sorter.cu.hpp.

Member Data Documentation

template<typename KeyType >
KeyType mpblocks::cuda::bitonic::Sorter< KeyType, void >::m_max
private

Definition at line 149 of file Sorter.h.

template<typename KeyType >
KeyType mpblocks::cuda::bitonic::Sorter< KeyType, void >::m_min
private

Definition at line 148 of file Sorter.h.

template<typename KeyType >
uint_t mpblocks::cuda::bitonic::Sorter< KeyType, void >::m_nSM
private

number of SMs of the current device

Definition at line 146 of file Sorter.h.

template<typename KeyType >
uint_t mpblocks::cuda::bitonic::Sorter< KeyType, void >::m_sharedLength
private

the size (in elements) of shared memory buffers in all the kernels (also, 2x the number of threads in a block)

Definition at line 139 of file Sorter.h.

template<typename KeyType >
uint_t mpblocks::cuda::bitonic::Sorter< KeyType, void >::m_threadsMerge
private

number of threads per block to use in the global merge kernel

Definition at line 144 of file Sorter.h.

template<typename KeyType >
uint_t mpblocks::cuda::bitonic::Sorter< KeyType, void >::m_threadsPrepare
private

number of threads per block to use in the prepare kernel

Definition at line 142 of file Sorter.h.


The documentation for this class was generated from the following files: