Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Fixed sanitizer warnings in RadixSortScanBinsKernel #277

Merged
merged 1 commit into from
Jun 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions cub/device/dispatch/dispatch_radix_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ __global__ void RadixSortScanBinsKernel(
block_scan.template ConsumeTile<false, false>(block_offset, prefix_op);
block_offset += AgentScanT::TILE_ITEMS;
}

// Process the remaining partial tile (if any).
if (block_offset < num_counts)
{
block_scan.template ConsumeTile<false, true>(block_offset, prefix_op,
num_counts - block_offset);
}
}


Expand Down Expand Up @@ -1102,7 +1109,7 @@ struct DispatchRadixSort :
const ValueT *d_values_in,
ValueT *d_values_out,
OffsetT *d_spine,
int spine_length,
int /*spine_length*/,
int &current_bit,
PassConfigT &pass_config)
{
Expand All @@ -1117,6 +1124,9 @@ struct DispatchRadixSort :
pass_config.even_share.grid_size, pass_config.upsweep_config.block_threads, (long long) stream,
pass_config.upsweep_config.items_per_thread, pass_config.upsweep_config.sm_occupancy, current_bit, pass_bits);

// Spine length written by the upsweep kernel in the current pass.
int pass_spine_length = pass_config.even_share.grid_size * pass_config.radix_digits;

// Invoke upsweep_kernel with same grid size as downsweep_kernel
thrust::cuda_cub::launcher::triple_chevron(
pass_config.even_share.grid_size,
Expand Down Expand Up @@ -1144,7 +1154,7 @@ struct DispatchRadixSort :
1, pass_config.scan_config.block_threads, 0, stream
).doit(pass_config.scan_kernel,
d_spine,
spine_length);
pass_spine_length);

// Check for failure to launch
if (CubDebug(error = cudaPeekAtLastError())) break;
Expand Down