1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

ticket 1280

This commit is contained in:
Anatoly Baksheev
2011-08-08 09:23:44 +00:00
parent f278dd782d
commit 7d82a14d1a
+11 -3
View File
@@ -190,9 +190,17 @@ void cv::gpu::setDevice(int device)
int cv::gpu::getDevice()
{
int device;
cudaSafeCall( cudaGetDevice( &device ) );
return device;
int count;
cudaError_t error = cudaGetDeviceCount( &count );
if (error == cudaErrorInsufficientDriver)
return -1;
if (error == cudaErrorNoDevice)
return 0;
cudaSafeCall(error);
return count;
}