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:
parent
f9f5313670
commit
b030ac0433
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user