Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM Neon optimisation does not change performance #34

Open
nicastel opened this issue Nov 18, 2024 · 1 comment
Open

ARM Neon optimisation does not change performance #34

nicastel opened this issue Nov 18, 2024 · 1 comment

Comments

@nicastel
Copy link

In https://github.com/tomojitakasu/PocketSDR/blob/master/src/sdr_func.c the dot_IQ_code function (called by corr_std) contains some NEON/AVX2 optimised code but it does not seems to do anything are the non optimised code is executed anyway at the end of the function. I would have expected a #else

The performance metics obtained via test/sdr_func_test.py are also unaffected by the activation or not of the neon optimisation.

// inner product of IQ data and code -------------------------------------------
static void dot_IQ_code(const sdr_cpx16_t *IQ, const sdr_cpx16_t *code, int N,
    float s, sdr_cpx_t *c)
{
    int i = 0;
    (*c)[0] = (*c)[1] = 0.0f;
#if defined(AVX2)
 ...
#elif defined(NEON)
...
#endif
    for ( ; i < N; i++) {
        (*c)[0] += IQ[i].I * code[i].I;
        (*c)[1] += IQ[i].Q * code[i].Q;
    }
    (*c)[0] *= s * SDR_CSCALE;
    (*c)[1] *= s * SDR_CSCALE;
@tomojitakasu
Copy link
Owner

Use test/utest/sdr_func_c_test to measure the performance. With my Raspi 4 (4GB, Raspi OS 64bit, Debian version 12.5), its test_05 reports:
with -DNEON

        mix_carr corr_std corr_fft
 12000    0.0251   0.0475   0.7805
 16000    0.0329   0.0626   0.8443
 24000    0.0497   0.0934   1.5235
 32000    0.0664   0.1240   2.2704
 32768    0.0681   0.1272   2.5413
 48000    0.1001   0.1858   4.2515
 65536    0.1359   0.2527   6.2994
 96000    0.1990   0.3818  12.1114

without -DNEON

        mix_carr corr_std corr_fft
 12000    0.0247   0.0935   0.7519
 16000    0.0329   0.1233   0.8333
 24000    0.0492   0.1845   1.4773
 32000    0.0655   0.2447   2.2628
 32768    0.0673   0.2506   2.1643
 48000    0.0989   0.3669   4.2197
 65536    0.1343   0.4999   6.5492
 96000    0.1979   0.7353  12.0928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants