Is there any plan to add a custom accelerator device support to OpenCV?

asked 2018-11-12 12:01:39 -0600

kkudryavtsev gravatar image

updated 2018-11-12 12:02:55 -0600

Some operations e.g. matrix multiplication or convolution can be done faster on some custom accelerators. It would be good if such support can be done in general, so that users would be able just to switch a device and get the advantage of acceleration. Is there any plan for that?

edit retag flag offensive close merge delete

Comments

adding an example of a "custom accelerator" might be helpful here ;)

berak gravatar imageberak ( 2018-11-12 12:28:24 -0600 )edit
1

We plan to make an SOC, which will do the job. Another case may be some FPGAs. I suppose we are not the only company working on it :) So that may be beneficial for the community.

kkudryavtsev gravatar imagekkudryavtsev ( 2018-11-12 12:32:32 -0600 )edit
1

There are already some accelerator devices supported in OpenCV: Myriad (Intel Movidius) and GPU in general with OpenCL (the kernels seem to be tuned for Intel iGPU) and Vulkan (first additions have been done very recently).

There is also something call HAL (Hardware Acceleration Layer) in the core module to replace some basic functions. See also.

Probably you should look in these two directions.

Eduardo gravatar imageEduardo ( 2018-11-13 09:59:09 -0600 )edit

Thank you, Eduardo. I was talking about a general solution like a "plug in". Adding a device in the way for example HAL added requires a lot of changes in common code.

kkudryavtsev gravatar imagekkudryavtsev ( 2018-11-13 10:39:49 -0600 )edit
1

I have no experience on this topic but I hardly see how a plug and play solution would work out of the box without either lots of efforts from the OpenCV side or the vendor side, in the code. I mean you probably will need to ship your own version of OpenCV, to ship your own customized OpenCL kernel or something like that.

Maybe try to see how it is done for some vendors:

Eduardo gravatar imageEduardo ( 2018-11-14 08:21:43 -0600 )edit

maybe openVX is far easier to adapt to hardware like yours

berak gravatar imageberak ( 2018-11-14 08:29:47 -0600 )edit

Thank you, guys. I will take a look at OpenVX and custom OpenCV libraries.

kkudryavtsev gravatar imagekkudryavtsev ( 2018-11-14 11:12:04 -0600 )edit

late, but have a look here, too : https://github.com/opencv/opencv/pull...

berak gravatar imageberak ( 2018-11-17 00:46:54 -0600 )edit

thank you for the link!

kkudryavtsev gravatar imagekkudryavtsev ( 2018-11-19 10:38:12 -0600 )edit

things are definitely on the move here ;)

berak gravatar imageberak ( 2018-11-19 10:39:19 -0600 )edit