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:
Mathieu Barnachon 2016-02-08 13:17:08 +01:00
parent f9f5313670
commit b030ac0433

View File

@ -70,6 +70,7 @@ void cv::cuda::setDevice(int device)
(void) device;
throw_no_cuda();
#else
cudaFree(0);
cudaSafeCall( cudaSetDevice(device) );
#endif
}