Skip to content

Commit

Permalink
Avoid address overflow (winner_takes_all)
Browse files Browse the repository at this point in the history
  • Loading branch information
atakagi-fixstars committed Aug 21, 2023
1 parent 401f27b commit 99be2de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/winner_takes_all.cu
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ __global__ void winner_takes_all_kernel(
? REDUCTION_PER_THREAD
: ACCUMULATION_INTERVAL;

const unsigned int cost_step = MAX_DISPARITY * width * height;
const size_t cost_step = static_cast<size_t>(MAX_DISPARITY) * width * height;
const unsigned int warp_id = threadIdx.x / WARP_SIZE;
const unsigned int lane_id = threadIdx.x % WARP_SIZE;

Expand Down

0 comments on commit 99be2de

Please sign in to comment.