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.

[TDA4M] Floating calculation has different results a little bit in debug mode and release mode.

Hi

I made a kernel for my APP. It has a lot of floating calculations and runs on A72.

I needed to check if the result was different in debug mode and release mode. But it was different.

I wonder why floating calculation has different results a little bit in debug mode and release mode.

For example, When I printed a floating value using %e, the result as below.

      >> debug   : 3.274594e-01

      >> release : 3.274422e-01

If there are some settings to optimize floating calculation in release mode, could I turn off the settings?

Best regards

Yongsig.

  • Hi Yongsig Do,

    I believe you are using the latest: ti-processor-sdk-linux-automotive-j7-evm-06_02_00
    release to build the Linux kernel.

    I generated the release and debug configs using the following steps:

    ./ti_config_fragments/defconfig_builder.sh
    1. v7 ARM Architecture
    2. v8 ARM Architecture
    Please choose an architecture to build for or 'q' to exit: 2
    1. SDK_Debug_Defconfigs
    2. SDK_Release_Defconfigs

    Please choose a defconfig type to build for or 'q' to exit: 2
    Available SDK_Release_Defconfigs defconfig build options:

    1. ti_sdk_arm64_release

    Please enter the number of the defconfig to build or 'q' to exit: 1
    Creating defconfig file /home/a0393675/work/psdkla/ti-processor-sdk-linux-automotive-j7-evm-06_02_00/board-support/linux-4.19.94+gitAUTOINC+5a23bc00e0-g5a23bc00e0/arch/arm64/configs/ti_sdk_arm64_release_defconfig

    ./ti_config_fragments/defconfig_builder.sh
    1. v7 ARM Architecture
    2. v8 ARM Architecture
    Please choose an architecture to build for or 'q' to exit: 2
    1. SDK_Debug_Defconfigs
    2. SDK_Release_Defconfigs

    Please choose a defconfig type to build for or 'q' to exit: 1

    *Please be advised that the Debug Option defconfigs may
    impact performance and should only be used for debugging.

    Available SDK_Debug_Defconfigs defconfig build options:

    1. ti_sdk_arm64_debug

    Please enter the number of the defconfig to build or 'q' to exit: 1
    Creating defconfig file /home/a0393675/work/psdkla/ti-processor-sdk-linux-automotive-j7-evm-06_02_00/board-support/linux-4.19.94+gitAUTOINC+5a23bc00e0-g5a23bc00e0/arch/arm64/configs/ti_sdk_arm64_debug_defconfig

    I see the defconfigs generated and compared:

    I do not see any floating point related config option difference.

    Could you please let me know if you are following the same steps to generate release & debug defconfigs or you are following
    different steps.

    Regards,
    Keerthy

  • Hi, Keerthy

    First of all, thank you for your reply.

    Actually,  I could match debug and release using an option, -ffp-contract=off

    This option is meaning as below.

    -ffp-contract=off disables floating-point expression contraction. -ffp-contract=fast enables floating-point expression contraction such as forming of fused multiply-add operations if the target has native support for them. -ffp-contract=on enables floating-point expression contraction if allowed by the language standard. This is currently not implemented and treated equal to -ffp-contract=off. 
    The default is -ffp-contract=fast. 

    I'll try your guide also.

    Best regards

    Yongsig.