1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00
This commit is contained in:
Anatoly Baksheev
2011-08-06 09:59:51 +00:00
parent 6fdbf15aed
commit 7e2fffb194
+10 -2
View File
@@ -177,8 +177,16 @@ void cv::gpu::DeviceInfo::queryMemory(size_t&, size_t&) const { throw_nogpu(); }
int cv::gpu::getCudaEnabledDeviceCount()
{
int count;
cudaSafeCall( cudaGetDeviceCount( &count ) );
return count;
cudaError_t error = cudaGetDeviceCount( &count );
if (error == cudaErrorInsufficientDriver)
return -1;
if (error == cudaErrorNoDevice)
return 0;
cudaSafeCall(error);
return count;
}