From: Martin Reinecke <martin@MPA-Garching.MPG.DE>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Development <gcc@gcc.gnu.org>, m.kretz@gsi.de
Subject: Re: Determining maximum vector length supported by the CPU?
Date: Wed, 22 May 2019 09:27:00 -0000 [thread overview]
Message-ID: <719f4268-b2a8-e950-8005-7af26e8a1ef3@mpa-garching.mpg.de> (raw)
In-Reply-To: <CAFiYyc1RHxTEuPufRNrUKnNQL6+-Pm10ObFvQ0XDT1cDHH6XwQ@mail.gmail.com>
On 5/22/19 11:17 AM, Richard Biener wrote:
>> Almost ... except that I'd need a platform-agnostic definition. The
>> point is that the code does not care about the underlying hardware at
>> all, only for the vector length supported by it.
>
> And then you run into AVX + SSE vs. AVX2 + SSE cases where the (optimal) length
> depends on the component type...
You mean different vector lengths for float, double, int etc?
I would be fine to have different macros for those, if necessary.
> I wonder if we'd want to have a 'auto' length instead ;)
I know it's weird, but for my code (which is definitely not a synthetic
test case) that would work perfectly :)
If you'd like to have a look:
https://gitlab.mpcdf.mpg.de/mtr/pocketfft/tree/cpp
(the only platform-dependent part is on lines 82-95 of the header file).
Still, I would need a way to determine how long the vectors actually
are. But it would probably be enough to measure this at runtime then.
Cheers,
Martin
next prev parent reply other threads:[~2019-05-22 9:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-22 8:36 Martin Reinecke
2019-05-22 9:18 ` Richard Biener
2019-05-22 9:27 ` Matthias Kretz
2019-05-22 9:27 ` Martin Reinecke [this message]
2019-05-22 9:37 ` Matthias Kretz
-- strict thread matches above, loose matches on Subject: below --
2019-05-22 6:39 Martin Reinecke
2019-05-22 8:09 ` Matthias Kretz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=719f4268-b2a8-e950-8005-7af26e8a1ef3@mpa-garching.mpg.de \
--to=martin@mpa-garching.mpg.de \
--cc=gcc@gcc.gnu.org \
--cc=m.kretz@gsi.de \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).