Skip to content

Commit d99ad2a

Browse files
authored
Merge pull request #4052 from gagicb:4.x
Stream waits in corners.cu before textures destruction
2 parents fbdb8b2 + a7f4971 commit d99ad2a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/cudaimgproc/src/cuda/corners.cu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ namespace cv { namespace cuda { namespace device
154154
cudaSafeCall( cudaGetLastError() );
155155

156156
if (stream == 0)
157-
cudaSafeCall( cudaDeviceSynchronize() );
157+
cudaSafeCall(cudaDeviceSynchronize());
158+
else
159+
cudaSafeCall(cudaStreamSynchronize(stream));
158160
}
159161

160162
/////////////////////////////////////////// Corner Min Eigen Val /////////////////////////////////////////////////
@@ -262,6 +264,8 @@ namespace cv { namespace cuda { namespace device
262264

263265
if (stream == 0)
264266
cudaSafeCall(cudaDeviceSynchronize());
267+
else
268+
cudaSafeCall(cudaStreamSynchronize(stream));
265269
}
266270
}
267271
}}}

0 commit comments

Comments
 (0)