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.

A compilation error in using vector load instructions

Hello,

I am trying to use _amemd8() to load a double word data from memory to two registers. The _amemd8() is inside of a OpenMP 4.0 target region. So I presume it is running on the DSPs. 

But when I compiled it, it caused a very strange compilation error

INTERNAL ERROR: cbeia6x experienced a segmentation fault
while processing function (unknown or file scope) file (unknown) line 0

I am wondering the _amemd8() must be used with #pragma DATA_ALIGN() ? Although #pragma DATA_ALIGN() caused another error :-)

warning: pragma DATA_ALIGN can only be applied to a file level symbol definition

Thanks

Cheng

  • Cheng,

    Any code in a target region is compiled for both the target and the host. This ensures that the target region can execute on the host if the 'if clause' on the target construct evaluates to false.

    In this particular case, you are getting an error on _amemd8 from the pass that generates host code for the target region. We'll investigate this further. Are you using CGT v7.6.0 and MCSDK HPC GA (3.0.0.19)?

    As a work around, you can structure your code to call a function within the target region and move functionality such as _amemd8 into this function. The function is in a separate file that is compiled using cl6x. The example openmpbench_C_v3 in /usr/share/ti/examples/openmpacc illustrates this approach including setting up the Makefile.

    Ajay

  • Cheng,

    Can you share a snippet of the code where you are using _amemd8() within a target region? Also please share what versions of CGT and MCSDK HPC GA you are using.

    In general, you may compile code for the host that includes intrinsic function calls (such as _amemd8) by using the host instrinsics library. The dot product example in /usr/share/ti/examples/dotprod illustrates how to do this. The Makefile includes instructions for downloading the host intrinsics package.

    Dunni