Commit 7e2fffb1 authored by Anatoly Baksheev's avatar Anatoly Baksheev

ticket #1280

parent 6fdbf15a
...@@ -177,8 +177,16 @@ void cv::gpu::DeviceInfo::queryMemory(size_t&, size_t&) const { throw_nogpu(); } ...@@ -177,8 +177,16 @@ void cv::gpu::DeviceInfo::queryMemory(size_t&, size_t&) const { throw_nogpu(); }
int cv::gpu::getCudaEnabledDeviceCount() int cv::gpu::getCudaEnabledDeviceCount()
{ {
int count; int count;
cudaSafeCall( cudaGetDeviceCount( &count ) ); cudaError_t error = cudaGetDeviceCount( &count );
return count;
if (error == cudaErrorInsufficientDriver)
return -1;
if (error == cudaErrorNoDevice)
return 0;
cudaSafeCall(error);
return count;
} }
......
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