discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: volk and alignment


From: Marcus Müller
Subject: Re: volk and alignment
Date: Wed, 8 Jul 2020 19:09:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

Hi Thomas,

hadn't taken the time to respond yet, sorry about that!

> Is there a maximum size that volk_get_alignment could return, a size
> that's reasonable?

I'd go with "realistically, yes, but isn't relying on that a bad idea?".

I'm thinking back and forth about how to address that problem.
Basically, what we'd need is a "worst case of all available machines" alignment, that is present in an integer constant expression, so you can put it into alignas(), right?

Best regards,
Marcus

On 06/07/2020 11.28, Thomas Habets wrote:
While doing https://github.com/gnuradio/gnuradio/pull/3619 it occurred to me that some dynamic volk_malloc (volk::vector<>) should be doable as stack allocations. There's nothing magic about the allocations, they're just aligned.

Is there a maximum size that volk_get_alignment could return, a size that's reasonable?

The reason I ask is that if it's "yes: 64", then calling code would be cleaner when all it needs is a temporary but aligned space.

E.g.
https://github.com/gnuradio/gnuradio/blob/master/gr-filter/lib/fir_filter.cc#L103
could skip the d_output member, and instead just have local variable `alignas(64) float tmp;`.



--
typedef struct me_s {
  char name[]      = { "Thomas Habets" };
  char email[]     = { "thomas@habets.se <mailto:thomas@habets.pp.se>" };
  char kernel[]    = { "Linux" };
  char *pgpKey[]   = { "http://www.habets.pp.se/pubkey.txt"; };
  char pgp[] = { "9907 8698 8A24 F52F 1C2E  87F6 39A4 9EEA 460A 0169" };
  char coolcmd[]   = { "echo '. ./_&. ./_'>_;. ./_" };
} me_t;

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]