Skip to content

Commit 34aa200

Browse files
committed
introduce a constexpr variable "bit_per_iteration" since it's a 8-bit radix sort
Signed-off-by: Chih-Chen Kao <[email protected]>
1 parent 571b423 commit 34aa200

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ParallelPrimitives/RadixSort.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ void RadixSort::sort( const KeyValueSoA& src, const KeyValueSoA& dst, uint32_t n
255255
return;
256256
}
257257

258-
int nIteration = div_round_up64( endBit - startBit, 8 );
258+
constexpr uint64_t bit_per_iteration = 8ULL;
259+
260+
int nIteration = div_round_up64( endBit - startBit, bit_per_iteration);
259261
uint64_t numberOfBlocks = div_round_up64( n, RADIX_SORT_BLOCK_SIZE );
260262

261263
m_lookbackBuffer.resetAsync( stream );
@@ -274,7 +276,7 @@ void RadixSort::sort( const KeyValueSoA& src, const KeyValueSoA& dst, uint32_t n
274276

275277
auto s = src;
276278
auto d = dst;
277-
for( int i = 0; i < nIteration; i++ )
279+
for( int i = 0; i < nIteration; ++i )
278280
{
279281
if( numberOfBlocks < LOOKBACK_TABLE_SIZE * 2 )
280282
{

0 commit comments

Comments
 (0)