hipCUB
Public Types | Public Member Functions | List of all members
BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH > Class Template Reference
Inheritance diagram for BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >:
Inheritance graph
[legend]
Collaboration diagram for BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >:
Collaboration graph
[legend]

Public Types

using TempStorage = typename base_type::storage_type
 

Public Member Functions

HIPCUB_DEVICE BlockShuffle (TempStorage &temp_storage)
 
HIPCUB_DEVICE void Offset (T input, T &output, int distance=1)
 Each threadi obtains the input provided by threadi+distance. More...
 
HIPCUB_DEVICE void Rotate (T input, T &output, unsigned int distance=1)
 Each threadi obtains the input provided by threadi+distance. More...
 
template<int ITEMS_PER_THREAD>
HIPCUB_DEVICE void Up (T(&input)[ITEMS_PER_THREAD], T(&prev)[ITEMS_PER_THREAD])
 The thread block rotates its blocked arrangement of input items, shifting it up by one item. More...
 
template<int ITEMS_PER_THREAD>
HIPCUB_DEVICE void Up (T(&input)[ITEMS_PER_THREAD], T(&prev)[ITEMS_PER_THREAD], T &block_suffix)
 The thread block rotates its blocked arrangement of input items, shifting it up by one item. More...
 
template<int ITEMS_PER_THREAD>
HIPCUB_DEVICE void Down (T(&input)[ITEMS_PER_THREAD], T(&next)[ITEMS_PER_THREAD])
 The thread block rotates its blocked arrangement of input items, shifting it down by one item. More...
 
template<int ITEMS_PER_THREAD>
HIPCUB_DEVICE void Down (T(&input)[ITEMS_PER_THREAD], T(&next)[ITEMS_PER_THREAD], T &block_prefix)
 The thread block rotates its blocked arrangement of input items, shifting it down by one item. More...
 

Constructor & Destructor Documentation

◆ BlockShuffle()

template<typename T , int BLOCK_DIM_X, int BLOCK_DIM_Y = 1, int BLOCK_DIM_Z = 1, int ARCH = HIPCUB_ARCH>
HIPCUB_DEVICE BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >::BlockShuffle ( TempStorage temp_storage)
inline
Parameters
[in]temp_storageReference to memory allocation having layout type TempStorage

Member Function Documentation

◆ Down() [1/2]

template<typename T , int BLOCK_DIM_X, int BLOCK_DIM_Y = 1, int BLOCK_DIM_Z = 1, int ARCH = HIPCUB_ARCH>
template<int ITEMS_PER_THREAD>
HIPCUB_DEVICE void BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >::Down ( T(&)  input[ITEMS_PER_THREAD],
T(&)  next[ITEMS_PER_THREAD] 
)
inline

The thread block rotates its blocked arrangement of input items, shifting it down by one item.

Parameters
[in]inputThe calling thread's input items
[out]nextThe corresponding predecessor items (may be aliased to input). The value next[0] is not updated for threadBLOCK_THREADS-1.

◆ Down() [2/2]

template<typename T , int BLOCK_DIM_X, int BLOCK_DIM_Y = 1, int BLOCK_DIM_Z = 1, int ARCH = HIPCUB_ARCH>
template<int ITEMS_PER_THREAD>
HIPCUB_DEVICE void BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >::Down ( T(&)  input[ITEMS_PER_THREAD],
T(&)  next[ITEMS_PER_THREAD],
T &  block_prefix 
)
inline

The thread block rotates its blocked arrangement of input items, shifting it down by one item.

All threads receive input[0] provided by thread0.

Parameters
[in]inputThe calling thread's input items
[out]nextThe corresponding predecessor items (may be aliased to input). The value next[0] is not updated for threadBLOCK_THREADS-1.
[out]block_prefixThe item input[0] from thread0, provided to all threads

◆ Offset()

template<typename T , int BLOCK_DIM_X, int BLOCK_DIM_Y = 1, int BLOCK_DIM_Z = 1, int ARCH = HIPCUB_ARCH>
HIPCUB_DEVICE void BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >::Offset ( input,
T &  output,
int  distance = 1 
)
inline

Each threadi obtains the input provided by threadi+distance.

The offset distance may be negative.

Parameters
[in]inputThe input item from the calling thread (threadi)
[out]outputThe input item from the successor (or predecessor) thread threadi+distance (may be aliased to input). This value is only updated for for threadi when 0 <= (i + distance) < BLOCK_THREADS-1
[in]distanceOffset distance (may be negative)

◆ Rotate()

template<typename T , int BLOCK_DIM_X, int BLOCK_DIM_Y = 1, int BLOCK_DIM_Z = 1, int ARCH = HIPCUB_ARCH>
HIPCUB_DEVICE void BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >::Rotate ( input,
T &  output,
unsigned int  distance = 1 
)
inline

Each threadi obtains the input provided by threadi+distance.

Parameters
[in]inputThe calling thread's input item
[out]outputThe input item from thread thread(i+distance>)%<BLOCK_THREADS> (may be aliased to input). This value is not updated for threadBLOCK_THREADS-1
[in]distanceOffset distance (0 < distance < BLOCK_THREADS)

◆ Up() [1/2]

template<typename T , int BLOCK_DIM_X, int BLOCK_DIM_Y = 1, int BLOCK_DIM_Z = 1, int ARCH = HIPCUB_ARCH>
template<int ITEMS_PER_THREAD>
HIPCUB_DEVICE void BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >::Up ( T(&)  input[ITEMS_PER_THREAD],
T(&)  prev[ITEMS_PER_THREAD] 
)
inline

The thread block rotates its blocked arrangement of input items, shifting it up by one item.

Parameters
[in]inputThe calling thread's input items
[out]prevThe corresponding predecessor items (may be aliased to input). The item prev[0] is not updated for thread0.

◆ Up() [2/2]

template<typename T , int BLOCK_DIM_X, int BLOCK_DIM_Y = 1, int BLOCK_DIM_Z = 1, int ARCH = HIPCUB_ARCH>
template<int ITEMS_PER_THREAD>
HIPCUB_DEVICE void BlockShuffle< T, BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z, ARCH >::Up ( T(&)  input[ITEMS_PER_THREAD],
T(&)  prev[ITEMS_PER_THREAD],
T &  block_suffix 
)
inline

The thread block rotates its blocked arrangement of input items, shifting it up by one item.

All threads receive the input provided by threadBLOCK_THREADS-1.

Parameters
[in]inputThe calling thread's input items
[out]prevThe corresponding predecessor items (may be aliased to input). The item prev[0] is not updated for thread0.
[out]block_suffixThe item input[ITEMS_PER_THREAD-1] from threadBLOCK_THREADS-1, provided to all threads

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