This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/BEAGLEBOARD-X15: Embedding OpenCL kernels in executable

Part Number: BEAGLEBOARD-X15

Tool/software: TI C/C++ Compiler

Hi,

As you know, while using OpenCV we can use open OpenCL offloading. Please check the link:

http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components_OpenCV.html#opencl-offload

In the documentation it is defined and as I tested on my side, I see, while we are offloading to OpenCL, the code is compiled on the target side. There are several options like caching to get rid of redundant compilations. I would like to ask if we can embed these in the executable. Please see the link below:

http://downloads.ti.com/mctools/esd/docs/opencl/compilation.html#create-an-opencl-program-from-binary-with-embedded-binary

I am using this technique while programming with OpenCL, I would like to ask if there is similar approach with the OpenCV.

Kind Regards,

Mustafa

  • Hello Mustafa,

    Please give me a day or so to research this. Thank you.

  • Hi Mustafa,

        Yes, you can use embedded header file for pre-compiled binary.  For example, ocl.hpp in OpenCV does offer these bindings:

        explicit ProgramBinary(const char* prog, unsigned int binLen);
    
        Kernel(const char* kname, const ProgramBinary& prog);

        However, you will need to do that on your own (i.e. modifying the OpenCV source code).  I think OpenCV only supports the cached binary approach, at least for version 3.1.   Then, you can build your updated OpenCV pacakge following the yocto build instructions.

    - Yuan