Ask Your Question
0

writing OpenCL parallel for using OpenCV

asked 2016-11-25 12:12:46 -0600

Humam Helfawi gravatar image

As far as I could understand form openCV source code, cv::parallel_for_ can utilize multiple computational units in the CPU using OpenMP, TBB, WinRT Concurrency ... However, there is no OpenCL implementaiton for it.

Is there any parallel_for_-similar function that uses OpenCL?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-11-25 12:21:02 -0600

Tetragramm gravatar image

OpenCL is a much more limited environment. It allows (hardware allowing) a much higher degree of parallelism, but to do that, it restricts what can be done. Many of the things you take for granted simply don't exist in OpenCL. It is unlikely that many of the existing parallel for loops in OpenCV would even compile as OpenCL code.

OpenCV does provide a framework for using OpenCL, but it's far more complicated than just using parallel_for.

edit flag offensive delete link more

Comments

Thanks for your answer... In other context, does OpenCV have CUDA-based parallel for?

Humam Helfawi gravatar imageHumam Helfawi ( 2016-11-25 12:28:39 -0600 )edit

It's the same problem as OpenCL. You have to write lots of special code for CUDA. On the other hand, just like OpenCL, there are lots of pre-written CUDA stuff, and a framework to support it. If you look HERE, there are 11 modules of CUDA functions.

Tetragramm gravatar imageTetragramm ( 2016-11-25 12:46:25 -0600 )edit

Thanks again for the details

Humam Helfawi gravatar imageHumam Helfawi ( 2016-11-25 13:03:15 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-11-25 12:12:46 -0600

Seen: 376 times

Last updated: Nov 25 '16