Skip to content

Commit

Permalink
Silence more maybe-uninitialized warnings in CUB.
Browse files Browse the repository at this point in the history
It seems that we're getting these by trying to instantiate the CUB
templates on other instantiation paths.
  • Loading branch information
griwes committed Feb 12, 2020
1 parent 6340864 commit 5eea3c6
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cub/agent/single_pass_scan_operators.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ struct ScanTileState<T, false>
cudaError_t error = cudaSuccess;
do
{
void* allocations[3] = { NULL, NULL, NULL };
void* allocations[3] = {};
size_t allocation_sizes[3];

allocation_sizes[0] = (num_tiles + TILE_STATUS_PADDING) * sizeof(StatusWord); // bytes needed for tile status descriptors
Expand Down Expand Up @@ -356,7 +356,7 @@ struct ScanTileState<T, false>
allocation_sizes[2] = (num_tiles + TILE_STATUS_PADDING) * sizeof(Uninitialized<T>); // bytes needed for inclusives

// Set the necessary size of the blob
void* allocations[3];
void* allocations[3] = {};
return CubDebug(AliasTemporaries(NULL, temp_storage_bytes, allocations, allocation_sizes));
}

Expand Down
2 changes: 1 addition & 1 deletion cub/device/dispatch/dispatch_histogram.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ struct DipatchHistogram

// Temporary storage allocation requirements
const int NUM_ALLOCATIONS = NUM_ACTIVE_CHANNELS + 1;
void* allocations[NUM_ALLOCATIONS];
void* allocations[NUM_ALLOCATIONS] = {};
size_t allocation_sizes[NUM_ALLOCATIONS];

for (int CHANNEL = 0; CHANNEL < NUM_ACTIVE_CHANNELS; ++CHANNEL)
Expand Down
12 changes: 6 additions & 6 deletions cub/device/dispatch/dispatch_radix_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1140,14 +1140,14 @@ struct DispatchRadixSort :
// Init regular and alternate-digit kernel configurations
PassConfig<UpsweepKernelT, ScanKernelT, DownsweepKernelT> pass_config, alt_pass_config;
if ((error = pass_config.template InitPassConfig<
typename ActivePolicyT::UpsweepPolicy,
typename ActivePolicyT::ScanPolicy,
typename ActivePolicyT::UpsweepPolicy,
typename ActivePolicyT::ScanPolicy,
typename ActivePolicyT::DownsweepPolicy>(
upsweep_kernel, scan_kernel, downsweep_kernel, ptx_version, sm_count, num_items))) break;

if ((error = alt_pass_config.template InitPassConfig<
typename ActivePolicyT::AltUpsweepPolicy,
typename ActivePolicyT::ScanPolicy,
typename ActivePolicyT::AltUpsweepPolicy,
typename ActivePolicyT::ScanPolicy,
typename ActivePolicyT::AltDownsweepPolicy>(
alt_upsweep_kernel, scan_kernel, alt_downsweep_kernel, ptx_version, sm_count, num_items))) break;

Expand All @@ -1156,7 +1156,7 @@ struct DispatchRadixSort :
int spine_length = (max_grid_size * pass_config.radix_digits) + pass_config.scan_config.tile_size;

// Temporary storage allocation requirements
void* allocations[3];
void* allocations[3] = {};
size_t allocation_sizes[3] =
{
spine_length * sizeof(OffsetT), // bytes needed for privatized block digit histograms
Expand Down Expand Up @@ -1488,7 +1488,7 @@ struct DispatchSegmentedRadixSort :
if ((error = alt_pass_config.template InitPassConfig<typename ActivePolicyT::AltSegmentedPolicy>(alt_segmented_kernel))) break;

// Temporary storage allocation requirements
void* allocations[2];
void* allocations[2] = {};
size_t allocation_sizes[2] =
{
(is_overwrite_okay) ? 0 : num_items * sizeof(KeyT), // bytes needed for 3rd keys buffer
Expand Down
2 changes: 1 addition & 1 deletion cub/device/dispatch/dispatch_reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ struct DispatchReduce :
even_share.DispatchInit(num_items, max_blocks, reduce_config.tile_size);

// Temporary storage allocation requirements
void* allocations[1];
void* allocations[1] = {};
size_t allocation_sizes[1] =
{
max_blocks * sizeof(OutputT) // bytes needed for privatized block reductions
Expand Down
2 changes: 1 addition & 1 deletion cub/device/dispatch/dispatch_reduce_by_key.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ struct DispatchReduceByKey
if (CubDebug(error = ScanTileStateT::AllocationSize(num_tiles, allocation_sizes[0]))) break; // bytes needed for tile status descriptors

// Compute allocation pointers into the single storage blob (or compute the necessary size of the blob)
void* allocations[1];
void* allocations[1] = {};
if (CubDebug(error = AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes))) break;
if (d_temp_storage == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion cub/device/dispatch/dispatch_rle.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ struct DeviceRleDispatch
if (CubDebug(error = ScanTileStateT::AllocationSize(num_tiles, allocation_sizes[0]))) break; // bytes needed for tile status descriptors

// Compute allocation pointers into the single storage blob (or compute the necessary size of the blob)
void* allocations[1];
void* allocations[1] = {};
if (CubDebug(error = AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes))) break;
if (d_temp_storage == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion cub/device/dispatch/dispatch_scan.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ struct DispatchScan
if (CubDebug(error = ScanTileStateT::AllocationSize(num_tiles, allocation_sizes[0]))) break; // bytes needed for tile status descriptors

// Compute allocation pointers into the single storage blob (or compute the necessary size of the blob)
void* allocations[1];
void* allocations[1] = {};
if (CubDebug(error = AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes))) break;
if (d_temp_storage == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion cub/device/dispatch/dispatch_select_if.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ struct DispatchSelectIf
if (CubDebug(error = ScanTileStateT::AllocationSize(num_tiles, allocation_sizes[0]))) break; // bytes needed for tile status descriptors

// Compute allocation pointers into the single storage blob (or compute the necessary size of the blob)
void* allocations[1];
void* allocations[1] = {};
if (CubDebug(error = AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes))) break;
if (d_temp_storage == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion cub/device/dispatch/dispatch_spmv_orig.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ struct DispatchSpmv
allocation_sizes[2] = (num_merge_tiles + 1) * sizeof(CoordinateT); // bytes needed for tile starting coordinates

// Alias the temporary allocations from the single storage blob (or compute the necessary size of the blob)
void* allocations[3];
void* allocations[3] = {};
if (CubDebug(error = AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes))) break;
if (d_temp_storage == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion experimental/defunct/test_device_seg_reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ struct DeviceSegReduceDispatch
int num_partition_samples = seg_reduce_region_grid_size + 1;

// Temporary storage allocation requirements
void* allocations[2];
void* allocations[2] = {};
size_t allocation_sizes[2] =
{
num_tuple_partials * sizeof(KeyValuePair), // bytes needed for "fix-up" reduce-by-key tuples
Expand Down

0 comments on commit 5eea3c6

Please sign in to comment.