问题描述
我想编写一个计算机视觉问题的跨平台代码。此代码应该在具有GPU(nVidia)的PC上运行,具有GPU的iPhone和一些可能包含GPU的基于Android的设备可能不运行。我想获得现有硬件的最大可能利用率。我的编程语言是C ++ 11,我的计算机视觉库是OpenCV。什么是最好的框架,层,技术等等,以便编写一个可以利用GPU的孤立的高级代码,如果它可用的话。
I want to write a cross-platform code for computer vision issue. This code should be run on PC with GPU (nVidia), iPhone with GPU and Some Android-Based device that may contain GPU and may not. I want to get the max possible utilization of the exist hardware. My programing language is C++ 11 and my computer vision library is OpenCV. What is the best framework, Layer, technique... etc to use in order to write an isolated high-level code that can utilize from the GPU if it is available.
P.S。这可能会被视为要求推荐的偏离主题。但实际上我并没有在许多可用选项之间提出要求。我只是问这个通常是如何完成的,或者这个领域的现状是什么。
P.S. this could be shown as off-topic as asking for recommendation. But really here I am not asking between many available options. I am just asking about how this usually is done or what is the state of art in this field.
推荐答案
我认为以下技术堆栈对您的要求非常有意义:
I think the following technology stack makes very much sense for your requirements:
-
OpenCL
适用于配备 nVidia GPU或任何其他供应商的各种桌面工作站,适用于GPU在 Android 上进行编程。 -
Metal
用于 iOS 上的GPU编程,因为它很少用于移植你的OpenCL
实现:
OpenCL
for all kinds of desktop stations equipped with nVidia GPUs or of any other vendor and for GPU programming on Android.Metal
for GPU programming on iOS, because its little effort to port yourOpenCL
implementation:
(,上次访问时间为07.12.2015)
(http://streamcomputing.eu/blog/2015-05-09/apples-dragging-opencl-compiler-problem/, Last accessed at 07.12.2015)
OpenCV
部分支持 OpenCL
(,最后访问于07.12。 2015),但是afaik没有办法 OpenCV
确实利用了 iOS 下的GPU()。
OpenCV
partially supports OpenCL
(http://docs.opencv.org/2.4/modules/ocl/doc/introduction.html, Last accessed at 07.12.2015), however afaik there is no way OpenCV
does utilize the GPU under iOS (OpenCV on iOS - GPU usage?).
所以 OpenCV ba时,iOS 将是一个棘手的部分sed算法到该平台,如果你想让它加速GPU。
So iOS will be the tricky part in terms of porting your OpenCV
based algorithm to that platform, if you want it to be GPU accelerated.
这篇关于C ++,OpenCV和“what”用于跨平台GPU编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!