3 ms·
Supporting BFLOAT16 in ISO_Fortran_env: not recommended
- pklausler 3y agoIt’s in LLVM Flang as real(kind=3).
- zaikunzhang 3y agoIt is great to know that LLVM Flang supports BFLOAT16! I look forward to trying it in my project ( http://www.libprima.net http://www.libprima.net ), although LLVM Flang is not ready to use last time I tried. As a side note, the Classic Flang ( https://github.com/flang-compiler/flang https://github.com/flang-compiler/flang ) does not support kind = 3.
- pklausler 3y agoYour package builds fine for me with flang-new. How does one run its tests?
- zaikunzhang 3y agoHi, @pklausler, here is an example with gcc+gfortran. Thank you. ``` export CC=gcc CFLAGS="-Wall -Wextra -Wpedantic -Werror" export FC=gfortran export FFLAGS='-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination' # Build cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . cmake --build . --target install cmake --build . --target tests # Test ctest --output-on-failure -V -E stress ```
- pklausler 3y ago> 100% tests passed, 0 tests failed out of 20 The flang-new driver doesn't support all of the options that you specified; I used "-pedantic -Werror -fimplicit-none", and observed no warnings.
- zaikunzhang 3y agoGreat! Thank you for trying! I will definitely explore flang-new in PRIMA. I am particularly glad to hear that no flang-new raised no warning when compiling PRIMA. That is exactly what I wanted to achieve. PRIMA does not tolerate any warning. Each warning is regarded as a bug and gets fixed. How should I install flang-new? Isn't compiling from the source the only way? I remember doing it once a few months ago, but the binary I got did not succeed in compiling PRIMA. Not sure what I missed. Maybe I should give it another go, especially for trying BFLOAT16! Many thanks.
- zaikunzhang 3y agoSee discussions at Fortran Discourse: https://fortran-lang.discourse.group/t/supporting-bfloat16-in-fortran-not-recommended/7637?u=zaikunzhang https://fortran-lang.discourse.group/t/supporting-bfloat16-i...