getCudaEnabledDeviceCount should return 0 instead of throwing an exception (Feature #1280)
Description
getCudaEnabledDeviceCount should return 0 instead of throwing an exception when no device are found, just like "#if !defined (HAVE_CUDA)".
And maybe getCudaEnabledDeviceCount should return -1 if drivers are too old.
cv::gpu::getCudaEnabledDeviceCount() in OpenCV\modules\gpu\src\initialization.cpp
int cv::gpu::getCudaEnabledDeviceCount() { int count; cudaError_t error = cudaGetDeviceCount( &count ); if (error == cudaErrorNoDevice) { count = 0; } else if (error == cudaErrorInsufficientDriver) { count = -1; } else //should never happen { cudaSafeCall(error); } return count; }
History
Updated by Anatoly Baksheev over 13 years ago
fixed in r6349
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Yvonnic MM over 13 years ago
thanks !
maybe it should be passed on OpenCV23 branche
Updated by Anatoly Baksheev over 13 years ago
done