Determine if OpenCV was built with support for CUDA

Is there a way to determine if OpenCV was built with support for CUDA, either at compile time or at run-time?

For example, is there a #define I can look for? Or maybe a function I can call that will let me know if certain features like DNN+CUDA are available?

there’s HAVE_CUDA (and more) in cvconfig.h

1 Like

Perfect, thank you. Gold mine in that file.

I also see a series of HAVE_OPENCV_* in opencv.hpp. Between those two files, I think I’ve found everything I need.

1 Like