fixed cuda capable checks

This commit is contained in:
matlabbe
2026-06-10 20:07:30 -07:00
parent b9fe30970a
commit e75c31238e
6 changed files with 36 additions and 31 deletions
+2 -2
View File
@@ -134,11 +134,11 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
bool haveCuda = false;
#if CV_MAJOR_VERSION < 3
#ifdef HAVE_OPENCV_GPU
haveCuda = cv::gpu::getCudaEnabledDeviceCount() != 0;
haveCuda = cv::gpu::getCudaEnabledDeviceCount() > 0;
#endif
#else
#ifdef HAVE_OPENCV_CUDAFEATURES2D
haveCuda = cv::cuda::getCudaEnabledDeviceCount() != 0;
haveCuda = cv::cuda::getCudaEnabledDeviceCount() > 0;
#endif
#endif
if(!haveCuda)