Ask Your Question
0

How to add custom OpenCL kernel in OpenCV ?

asked 2013-04-26 03:49:46 -0500

Hi,

http://docs.opencv.org/trunk/modules/ocl/doc/introduction.html "As of OpenCV 2.4.4, we introduce interoperability with OpenCL, enabling easy use of custom OpenCL kernels within the OpenCV framework."

As stated in the ocl module introduction, OpenCV should allow to add my own OpenCL kernel to the framework. Is there a tutorial or a code example where I could look after how to do that ?

Note, in 2.4.5 the ocl kernel are not in odules/ocl/src/kernel/ anymore the in modules/ocl/src/opencl as described in this introduction.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2013-08-30 02:56:28 -0500

decision gravatar image

You should parse your cl-File by hand into a char * array, then you can call cv::ocl::openCLExecuteKernelInterop to execute it. Unfortunately, this function isn't described in the docs.

edit flag offensive delete link more
0

answered 2013-07-25 07:35:00 -0500

decision gravatar image

I'm just beginning to learn about OpenCL in general and OpenCV+OpenCV in particular, but I think it means the following:

With help of the utility functions ocl::Info, ocl::getoclContext and others you are able you create programs and compile kernels on your own. After a call to ocl::getDevice, OpenCV should have done all the necessary initialization work, so you are able do enqueue your own kernels.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-04-26 03:49:46 -0500

Seen: 834 times

Last updated: Aug 30 '13