How to implement OpenCL with llvm on EVMK2H

I just bought an EVMK2H board, and I am trying to implement OpenCL with llvm.
I also found there is an external git repos for TI’s OpenCL product source(
I've tried several times on implementing OpenCL with the git repo, but without success.
I wonder if there has some detailed steps or guides to implement OpenCL with llvm on EVMK2H?
  • Hi Chao,

    The standard way that TI OpenCL is built for the Processor SDK is through the Yocto build system. This also allows for customization of individual packages. The build process is documented on the below page (for Processor SDK 3.1, documents for older version are linked from the bottom):

    The "Recipes" 3.4.1 section gives an example of how to build and customize the TI OpenCL package after doing the initial Yocto system setup.

    Let me know if you run into any issues building.
  • In reply to esc:

    Hi esc,

    thanks for your reply.
    I have followed your steps to build the SDK,
    but it seems that what you provided is the way to build ipk or images.

    I am wondering that if there is a way to build opencl and llvm from SCRATCH or source code ?
    since I want to optimize llvm and opencl, I need source code.

    what i can find the source code package is from
    but it has limited information or guides...

  • In reply to Chao Lin Lee:

    Yocto does build from source to create the ipk. The new ipk can then be installed onto the target EVM to get an OpenCL built from your modified source.

    The section "Forced Re-compilation" in the document describes how to get to the OpenCL source to modify it and then rebuild with the modifications. After your first build, the OpenCL source code will be checked out from git in the arago-tmp-[toolchain]/work/am57xx_evm-linux-gnueabi/opencl/git described. Then you can modify the source in that directory as desired, follow the forced recompilation command to build a new package with your changes, and install it on your EVM.
  • In reply to esc:

    thanks for your quick reply,

    when I built the Yocto, I got several warnings:

    1. ti-llvm3.6-3.6-r4.tisdk0 do_package: QA Issue: ti-llvm3.6: Files/directories were installed but not shipped in any package   

    Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
    ti-llvm3.6: 70 installed and not shipped files. [installed-vs-shipped]

    2. WARNING: opencl-monitor- do_package: opencl-monitor: NOT adding alternative provide /lib/firmware/dra7-dsp1-fw.xe66: /lib/firmware/dra7-dsp1-fw.xe66.opencl-monitor does not exist

    3. WARNING: opencl-monitor- do_package: opencl-monitor: NOT adding alternative provide /lib/firmware/dra7-dsp2-fw.xe66: /lib/firmware/dra7-dsp2-fw.xe66.opencl-monitor does not exist

    4. WARNING: opencl- do_package_qa: QA Issue: No GNU_HASH in the elf binary: '/home/user/tisdk/build/arago-tmp-external-linaro-toolchain/work/k2hk_evm-linux-gnueabi/opencl/' [ldflags]

    How can I fix these warnings?


  • In reply to Chao Lin Lee:

    These warnings appear to be a normal part of the build and do not indicate a problem with your build.