How to calculate flops from source code ?

Hi,
My boss want to know our programme’s flops number.
Our programme used opencv to develop.
I really have no idea how to get flops.
Pls Help me!~~~

Maybe get in touch with the OpenCV developers (e.g. on a public mailing list). The actual computational complexity depends very much on which of the algorithms in OpenCV you use. It’s first and foremost a question of the algorithm and its particular implementation. Some algorithms may have constant run time only depending on the image size, others may have a run time that depends a lot on the image content. It’s impossible to generalize.

For programs that are already implemented in CUDA, the nvprof profiler tool can extract FLOPS metrics

If you’re using OpenCV algorithms on the CPU, there may be similar tools to collect profile metrics for floating point operations. Which tools are available depends heavily on the operating system. You want to get tools that can report the Intel CPU’s hardware performance counters on a per-process basis.