4 ms·
It does use gpu, you need to compile it with a flag.
by turowicz 8y ago
It does use gpu, you need to compile it with a flag.
- kartickv 8y agoOh, which one? I was under the impression it uses only Nvidia GPUs (CUDA) on desktop.
- Benjamin_Dobell 8y agoThere are a heap of CMake flags that turn on various features e.g. CUDA: https://github.com/opencv/opencv/blob/4.0.0/CMakeLists.txt#L227 https://github.com/opencv/opencv/blob/4.0.0/CMakeLists.txt#L... but also OpenCL: https://github.com/opencv/opencv/blob/4.0.0/CMakeLists.txt#L267 https://github.com/opencv/opencv/blob/4.0.0/CMakeLists.txt#L... and Vulkan (which was only merged around a month ago): https://github.com/opencv/opencv/blob/4.0.0/CMakeLists.txt#L239 https://github.com/opencv/opencv/blob/4.0.0/CMakeLists.txt#L... Perhaps that last one works on mobile, although I wouldn't get your hopes up. I haven't really used OpenCV since 2.4.x, however assuming the same holds true, performance enhancements are on a feature by feature basis. Meaning that if you enable CUDA etc. then it's not going to work for everything. Not GPU, but a common compile time enhancement (at least it used to be) was to compile with Intel TBB (thread building blocks) as a lot of the APIs included optimisations.
- kartickv 8y agoThanks, but iOS supports neither CUDA, OpenCL, Vulkan nor TBB. It's only Metal and higher-level frameworks like Core Image for GPU, and vImage for SIMD image manipulation.
- Benjamin_Dobell 8y agoYou can use MoltenVK to run Vulkan via Metal (https://github.com/KhronosGroup/MoltenVK https://github.com/KhronosGroup/MoltenVK). Apparently performance is quite good for regular 3D rendering, compute support is officially listed, but I'm not at all sure what performance is like.