What do ENABLE_FAST_MATH and CUDA_FAST_MATH do?

I’ve seen some tutorials to compile OpenCV with CUDA support and many of them enable the ENABLE_FAST_MATH and CUDA_FAST_MATH flags. But what exactly those flags do? Is it actually recommended to use them?

CUDA_FAST_MATH sets the --use_fast_math flag which enables certain optimizations

Essentially it can speed up some compute workloads at the expense of accuracy.

Thanks for the reply!
Do you know what is the difference with ENABLE_FAST_MATH?

That’s a CPU flag, see

Thank you so much! I see this is mostly for MSVC.