Re: g++13 fixed-width floating point implementations

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

 



On Sun, 6 Aug 2023 at 18:30, Marc Marot-Lassauzaie via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
>
> Hello,
>
>
> my name is Marc Marot-Lassauzaie, I have recently been using g++13 in order to use the 16-bit floating point formats bf16 and fp16 but unfortunately these aren't defined on some of the machines I've been working on and I'd like to know why that is and whether there is any possibility of resolving this.
>
> Specifically, I have three machines that I've been working on: one is my personal work laptop and the other two are HPC-Clusters that I've been accessing for work purposes. On my personal machine as well as one of the clusters I've installed g++13.2 from source, on the other cluster g++13.1 comes installed as a module. On my machine all of the std::floatxx_t formats are defined and available via the "stdfloat"<https://en.cppreference.com/w/cpp/header/stdfloat> header and all of their corresponding predefined macros are defined. On both of the clusters neither of these are true.
>
> The C-language type "_Float16" is available for all three machines, meaning I can make use of fp16 but I couldn't find any way to make bf16 work on either of the clusters.
>
>
> My best guess is that the hardware of the clusters somehow doesn't support these types but all three machines have the same microarchitecture, running the command "uname -m" returns the value "x86_64" for all three. I have found on the changelog of the gcc 13 release series<https://gcc.gnu.org/gcc-13/changes.html> that the __bf16 type is supported only if SSE2 and above are enabled, which I assume is related to this issue.
>
> Could you let me know based on which criteria g++13 activates or deactivates this feature, whether there is any way to make it available anyway (even if this involves emulation) or whether there is any other way of using bf16-floating types for C++?

The type is enabled whenever SSE2 support is enabled and when using
-std=c++23 or -std=gnu++23.


> Please let me know if anything is unclear or if you have any additional questions.

The uname -m output is not useful, nearly all x86 chips produced in
the past 20 years are "x86_64". What does 'gcc -v' show for your GCC
13 on each machine? What does 'gcc -Q --help=target | grep sse2' show
for your GCC 13?

All x86_64 processors should support SSE2, so the only reason I can
think of that bfloat16 wouldn't be enabled is that either you're not
using C++23 mode, or you're compiling for 32-bit mode with -m32 and
not telling GCC to compile for a processor with SSE2 support (e.g. by
using something like -m32 -march=x86-64 or -m32 -msse2).




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux