From 99be2decf9c416422bfa11866facbe6c4ed8d4a0 Mon Sep 17 00:00:00 2001 From: "akihiro.takagi" Date: Mon, 21 Aug 2023 11:26:38 +0900 Subject: [PATCH] Avoid address overflow (winner_takes_all) --- src/winner_takes_all.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/winner_takes_all.cu b/src/winner_takes_all.cu index 08c2a37..2c0cc9f 100644 --- a/src/winner_takes_all.cu +++ b/src/winner_takes_all.cu @@ -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(MAX_DISPARITY) * width * height; const unsigned int warp_id = threadIdx.x / WARP_SIZE; const unsigned int lane_id = threadIdx.x % WARP_SIZE;