Commit b030ac04 authored by Mathieu Barnachon's avatar Mathieu Barnachon

Ensure the Cuda context is initialized correctly as long as the setDevice is not…

Ensure the Cuda context is initialized correctly as long as the setDevice is not called in a multi-thread environment.
parent f9f53136
......@@ -70,6 +70,7 @@ void cv::cuda::setDevice(int device)
(void) device;
throw_no_cuda();
#else
cudaFree(0);
cudaSafeCall( cudaSetDevice(device) );
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment