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.

Host and target files in the OpenMP accelerator model examples

Hi,


I just started with the OpenMP accelerator model. However, I noticed that in the examples there are two types of files:

HOST_CODE    =
TARGET_CODE  =

Is this file separation really needed for compilation purposes? Is it no just enough to use the target pragmas to offload a code section of a bigger app that is running on the ARM. I got a bit confuse due to this organization of the examples.

I would appreciate if someone could clarify this.


Thanks,

Miguel

  • From build log for a openmpacc example, like vecadd_t:

    ===============  vecadd_t  =================
    make[2]: Warning: File `../make.inc' has modification time 2262 s in the future
    >> DEBUG: Extra host compiler options: -O3 -Wall -Wextra -fopenmp
    >> DEBUG: Extra target compiler options: -O3
    >> DEBUG: Executable binary name: vecadd_t
    >> DEBUG: Input files: vecadd_t_main.o vecadd_t_target.c
    >> DEBUG: ARM object file or archive: vecadd_t_main.o
    >> DEBUG: Source code file: vecadd_t_target.c
    >> DEBUG: Using /usr/bin/arm-linux-gnueabihf-gcc for HOST compilation.
    >> DEBUG: Using /usr/bin/arm-linux-gnueabihf-g++ for HOST compilation.
    >> DEBUG: Using /usr/bin/cl6x for TARGET compilation.
    >> DEBUG: Using /usr/bin/cl6x for S2S compilation.
    >> DEBUG: Using /usr/bin/clocl for TARGET compilation.
    cl6x --openmp:host -pds=1173 -I/usr/include -I/usr/lib/gcc/arm-oe-linux-gnueabi/4.7.2/include -I/usr/lib/gcc/arm-oe-linux-gnueabi/4.7.2/include-fixed -I/usr/include vecadd_t_target.c
    cl6x --openmp:device -mv6600 -I/usr/share/ti/cgt-c6x/include -I/usr/share/ti/openmpacc/dsp/include -O3 vecadd_t_target.c
    clocl -t -v __TI_CLACC_KERNEL.cl vecadd_t_target.obj
    arm-linux-gnueabihf-g++ -O3 -Wall -Wextra -fopenmp -c __TI_CLACC_KERNEL.c
    arm-linux-gnueabihf-gcc -O3 -Wall -Wextra -fopenmp -c vecadd_t_target.int.c
    arm-linux-gnueabihf-g++ -O3 -Wall -Wextra -fopenmp vecadd_t_main.o __TI_CLACC_KERNEL.o vecadd_t_target.int.o -L/usr/lib -lOpenMPAcc -lOpenCL -locl_util -Wl,-rpath-link,/usr/lib -o vecadd_t
    >> DEBUG: Executable binary vecadd_t created successfully.
    make[2]: warning:  Clock skew detected.  Your build may be incomplete.

    The HOST and TARGET are compiled with different tools, I think this is the reason we used HOST_CODE and TARGET_CODE seperation.

    Regards, Eric