Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++, OpenCV and "what" for cross-platform GPU programing [closed]

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. 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.

like image 357
Humam Helfawi Avatar asked Nov 07 '25 20:11

Humam Helfawi


1 Answers

For multiplatform, I'm going to argue for keeping it in C/C++ and use the usual threading libraries.

While in iOS you've got only one vendor and the OpenCV team can devote the efforts to tune as required, on Android there is a mix of CPU/GPU vendors so the Google/Android team went with RenderScript (Why did Google choose RenderScript instead of OpenCL) and doesn't officially support OpenCL. Including an non-RenderScript GPU compute options would have to come from the individual vendors like Intel, Qualcomm, and for completeness nVidia's CUDA.

Realize that mobile platforms have been evolving at a much faster rate than PCs, i.e. the type of phone you could have gotten with Intel first released the Core i series (2008) vs what is available now.

Further down the pipeline there are Compute Shaders in OpenGL ES 3.1 and Vulkan. So if you are looking for baseline - you would be better off in C/C++ thread land.

Now if you really had a mobile app that you needed to push the performance then you can figure out what optimizations are required on the mobile platform of your choice.

like image 157
Morrison Chang Avatar answered Nov 09 '25 10:11

Morrison Chang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!