[][src]Function opencv::core::set_use_optimized

pub fn set_use_optimized(onoff: bool) -> Result<()>

Enables or disables the optimized code.

The function can be used to dynamically turn on and off optimized dispatched code (code that uses SSE4.2, AVX/AVX2, and other instructions on the platforms that support it). It sets a global flag that is further checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only safe to call the function on the very top level in your application where you can be sure that no other OpenCV function is currently executed.

By default, the optimized code is enabled unless you disable it in CMake. The current status can be retrieved using useOptimized.

Parameters

  • onoff: The boolean flag specifying whether the optimized code should be used (onoff=true) or not (onoff=false).