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.

fastRTS function call does not pipeline

Hi,

I have a couple of issues with the fastRTS log2sp() function call, but I believe this to be more general and affecting all functions...

I want to replace my manual implementation of log2() with the one in the fastRTS in order to compare performance and precision.

1- the main issue is that the function call does not pipeline (due to function call), whereas my "inline" implementation does. Is this expected?! Measuring the cycles this way does not give a good result, obviously. 

2- The audio flowing through my app is broken. which means the function call does not work correctly. I rebuilt the fastRTS lib using the --target_compatibility_6200 since I needed a 4byte struct alignment for compatibility with my project. could this be the cause??

 Besides, Do I need to put it into a dedicated sample loop to make it match the benchmark results?

here is the snippet:

for (int t = 0; t < buffersize; t++)
{
     float aIn = temp[t];
     float aOut = log2sp(aIn);
     temp[t] = aOut;
}

Let me know.

  • The fastrts libraries are not supplied by the compiler development team.  So we are limited in our ability to answer.

    The fastrts implementation of log2sp is in hand-coded assembly.  There is no way to inline it.

    I do see another implementation named log2sp_i in a file named log2sp_i.h.  The comments say it is an "inlined C implementation".  So, it is reasonable to conclude you should include log2sp_i.h and call log2sp_i instead of log2sp.

    Hope this helps ...

    -George

  • I did discover a readme.txt in the install_root\c6400\C_fastRTS directory.  Here is what it says about inlining functions from the library ...

    1. Include the header file "fastrts_i.h" in your file which performs the floating point operations

    2. To enable Inlining, define the macro "INLINE_C". This can be done by going to
    "Project->Build Options->Preprocessor" and add INLINE_C in the "Pre-define
    Symbol{-d}" tab.
    It is advisible to inline functions in loops. This will enable to loop to pipe-line, thus providing maximum performance. Inlining in control code may disproportionately increase code-size compared to performance gains.

    That bit about Project->Build Options etc applies to older versions of Code Composer.  The main point is you need to define the macro INLINE_C on the compiler command line.

    Hope this helps ...

    -George