mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 19:50:38 +08:00
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 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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user