Dynamically choose best instruction set for hardware
Is it possible to let OpenCV dynamically choose which instruction set to use for the hardware it is running on?
We build OpenCV via Visual Studio in Win32, afterwards we changed the Solution and Project files to also support our own Platform.
We are running OpenCV on an embedded device which does not support SSE3 calls. When we run our program, OpenCV runs the hardware check and then decides to quit. Is there a solution that checks the hardware without quitting and then decides which instruction set it can use?
If this is not the case, is there a way to make these instruction set Platform dependent at compile time? So, both Win32 and our own Platform uses the same source files but via a define, or via an other way, decides which instruction set it can use.
What do you mean by:
Look at CPU optimization dispatching. You choose a baseline instruction set, e.g.
SSE2
and then you can dispatch some other instruction sets.But normally if you want to target a specific CPU architecture, it should be enough to add the corresponding CPU flags in Visual Studio. If you want to produce a binary that "some kind of fit all", see CPU code dispatching.