Skip to content

Commit

Permalink
Do not read uninitialized memory for OOB elements. (#2739)
Browse files Browse the repository at this point in the history
When the scan status is `SCAN_TILE_OOB`, uninitialized memory was ready from `d_tile_inclusive`.

This adds a check that the status is actually `SCAN_TILE_INCLUSIVE` before reading from `d_tile_inclusive`.

Fixes #1891.
  • Loading branch information
alliepiper authored Nov 7, 2024
1 parent 3314a26 commit deb9010
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cub/cub/agent/single_pass_scan_operators.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ struct ScanTileState<T, false>
{
value = ThreadLoad<LOAD_CG>(d_tile_partial + TILE_STATUS_PADDING + tile_idx);
}
else
else if (status == StatusWord(SCAN_TILE_INCLUSIVE))
{
value = ThreadLoad<LOAD_CG>(d_tile_inclusive + TILE_STATUS_PADDING + tile_idx);
}
Expand Down

0 comments on commit deb9010

Please sign in to comment.