Skip to content

Commit

Permalink
Fix DeviceHistogram bug: non-native input iterators take the correct …
Browse files Browse the repository at this point in the history
…code path.

Previously, when passing in an, e.g. CountingInputIterator, the kernel
would fail with the error:

======== Invalid __global__ read of size 4
=========     by thread (0,0,0) in block (0,0,0)
=========     Address 0x00000000 is out of bounds

because the wrong branch tried to read from d_native_samples (which is null).
  • Loading branch information
ebrevdo committed Aug 25, 2017
1 parent f558c6d commit 525970f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cub/agent/agent_histogram.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ struct AgentHistogram
((row_bytes & pixel_mask) == 0); // number of row-samples is a multiple of the alignment of the pixel

// Whether rows are aligned and can be vectorized
if (quad_aligned_rows || pixel_aligned_rows)
if ((d_native_samples != nullptr) && (quad_aligned_rows || pixel_aligned_rows))
ConsumeTiles<true>(num_row_pixels, num_rows, row_stride_samples, tiles_per_row, tile_queue, Int2Type<IS_WORK_STEALING>());
else
ConsumeTiles<false>(num_row_pixels, num_rows, row_stride_samples, tiles_per_row, tile_queue, Int2Type<IS_WORK_STEALING>());
Expand Down

0 comments on commit 525970f

Please sign in to comment.