Ensure the Cuda context is initialized correctly as long as the setDevice is not called in a multi-thread environment.
This commit is contained in:
		| @@ -70,6 +70,7 @@ void cv::cuda::setDevice(int device) | |||||||
|     (void) device; |     (void) device; | ||||||
|     throw_no_cuda(); |     throw_no_cuda(); | ||||||
| #else | #else | ||||||
|  |     cudaFree(0); | ||||||
|     cudaSafeCall( cudaSetDevice(device) ); |     cudaSafeCall( cudaSetDevice(device) ); | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Mathieu Barnachon
					Mathieu Barnachon