cudaMemset2D fix: Correct buffer height parameter

Changed the height parameter in the cudaMemset2D function call to use
minSSD_buf.rows instead of disp.rows. This enures the correct buffer
height is used for memory initialization.
pull/24574/head
ajithvallabai 1 year ago
parent 52c33f4af3
commit 258b062295
  1. 2
      modules/cudastereo/src/cuda/stereobm.cu

@ -391,7 +391,7 @@ namespace cv { namespace cuda { namespace device
//cudaSafeCall( cudaFuncSetCacheConfig(&stereoKernel, cudaFuncCachePreferShared) );
cudaSafeCall( cudaMemset2D(disp.data, disp.step, 0, disp.cols, disp.rows) );
cudaSafeCall( cudaMemset2D(minSSD_buf.data, minSSD_buf.step, 0xFF, minSSD_buf.cols * minSSD_buf.elemSize(), disp.rows) );
cudaSafeCall( cudaMemset2D(minSSD_buf.data, minSSD_buf.step, 0xFF, minSSD_buf.cols * minSSD_buf.elemSize(), minSSD_buf.rows) );
cudaSafeCall( cudaMemcpyToSymbol( cwidth, &left.cols, sizeof(left.cols) ) );
cudaSafeCall( cudaMemcpyToSymbol( cheight, &left.rows, sizeof(left.rows) ) );

Loading…
Cancel
Save