ticket #1280
This commit is contained in:
parent
6fdbf15aed
commit
7e2fffb194
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user