Giter Club home page Giter Club logo

fp16's Introduction

FP16

Header-only library for conversion to/from half-precision floating point formats

Features

  • Supports IEEE and ARM alternative half-precision floating-point format
    • Property converts infinities and NaNs
    • Properly converts denormal numbers, even on systems without denormal support
  • Header-only library, no installation or build required
  • Compatible with C99 and C++11
  • Fully covered with unit tests and microbenchmarks

Acknowledgements

HPC Garage logo Georgia Tech College of Computing logo

The library is developed by Marat Dukhan of Georgia Tech. FP16 is a research project at Richard Vuduc's HPC Garage lab in the Georgia Institute of Technology, College of Computing, School of Computational Science and Engineering.

This material is based upon work supported by the U.S. National Science Foundation (NSF) Award Number 1339745. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of NSF.

fp16's People

Contributors

jameshilliard avatar jerryshih avatar maratyszcza avatar miaobin avatar stefanstojanovic avatar wpoely86 avatar yangqing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fp16's Issues

Request a release

Hi, is it possible to publish release versions regularly? Rather than a git hash 'abcdxxxxxxxxxxxx', a relase version like '0.1' will benefit for tests and integration, making it easier to reproduce results against a specific version.

MSVC errors when using psimd

fp16/psimd.h(14): error C2433: 'psimd_f32': '__forceinline' not permitted on data declarations [C:\projects\hunter-h4uji_testing_builds\vs-14-2015-sdk-8-1\boo.vcxproj]

See: https://ci.appveyor.com/project/xsacha/hunter-h4uji/builds/23144758/job/5x56s69avyxef1m3

Seems to be complaining about the usage of __forceinline when used in PSIMD_INTRINSIC for fp16/psimd.h

From here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/94f27276-62c3-441a-9919-7114e77c67a4/errors-while-executing-vc-code?forum=vclanguage
It suggests including Windows.h will make such an error go away.

Improve docs

Please be more descriptive in the readme in how to install, include, test, benchmark this library.
I figured the benchmarks are *-bench, would be nice if make benchmark ran them all, the same way make test runs tests.

  • Also what are the new type names? half, float16_t, ...
  • Mention if/that it is storage only type, and for CPU computation it needs to be always converted to float32?
  • what are some "good" speeds for an intel CPU? How to obtain better? (PSIMD, ...)

error: exponent has no digits

Fail to build FP16, with the following ERROR messages:

I'm using Ubuntu 18.04, with GCC

$ gcc --version
gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[ 44%] Building CXX object deps/googletest/googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
cd ....../FP16/build/deps/googletest/googlemock/gtest && /usr/bin/c++   -I....../FP16/deps/googletest/googletest/include -I....../FP16/deps/googletest/googletest  -fPIC -O3 -DNDEBUG   -fPIC -Wall -Wshadow -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -o CMakeFiles/gtest_main.dir/src/gtest_main.cc.o -c ....../FP16/deps/googletest/googletest/src/gtest_main.cc
In file included from ....../FP16/include/fp16.h:5:0,
                 from ....../FP16/bench/to-alt-array.cc:3:
....../FP16/include/fp16/fp16.h:155:26: error: exponent has no digits
  const float exp_scale = 0x1.0p-112f;
                          ^~~~~~
....../FP16/include/fp16/fp16.h:210:29: error: exponent has no digits
  const float scale_to_inf = 0x1.0p+112f;
                             ^~~~~~
....../FP16/include/fp16/fp16.h:211:30: error: exponent has no digits
  const float scale_to_zero = 0x1.0p-110f;
                              ^~~~~~
In file included from ....../FP16/bench/to-alt-array.cc:5:0:
....../FP16/include/fp16/psimd.h:21:46: error: exponent has no digits
  const psimd_f32 exp_scale = psimd_splat_f32(0x1.0p-112f);
                                              ^~~~~~
....../FP16/include/fp16/psimd.h:44:46: error: exponent has no digits
  const psimd_f32 exp_scale = psimd_splat_f32(0x1.0p-112f);
                                              ^~~~~~
....../FP16/include/fp16/psimd.h:80:48: error: exponent has no digits
  const psimd_f32 denorm_bias = psimd_splat_f32(0x1.0p-14f);
                                                ^~~~~~
In file included from ....../FP16/include/fp16.h:5:0,
                 from ....../FP16/bench/to-alt-array.cc:3:
....../FP16/include/fp16/fp16.h: In function ‘float fp16_ieee_to_fp32_value(uint16_t)’:
....../FP16/include/fp16/fp16.h:155:33: error: unable to find numeric literal operator ‘operator""f’
  const float exp_scale = 0x1.0p-112f;
                                 ^~~~
....../FP16/include/fp16/fp16.h:155:33: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
....../FP16/include/fp16/fp16.h: In function ‘uint16_t fp16_ieee_from_fp32_value(float)’:
....../FP16/include/fp16/fp16.h:210:36: error: unable to find numeric literal operator ‘operator""f’
  const float scale_to_inf = 0x1.0p+112f;
                                    ^~~~
....../FP16/include/fp16/fp16.h:210:36: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
....../FP16/include/fp16/fp16.h:211:37: error: unable to find numeric literal operator ‘operator""f’
  const float scale_to_zero = 0x1.0p-110f;
                                     ^~~~
....../FP16/include/fp16/fp16.h:211:37: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
In file included from ....../FP16/bench/to-alt-array.cc:5:0:
....../FP16/include/fp16/psimd.h: In function ‘psimd_f32 fp16_ieee_to_fp32_psimd(psimd_u16)’:
....../FP16/include/fp16/psimd.h:21:53: error: unable to find numeric literal operator ‘operator""f’
  const psimd_f32 exp_scale = psimd_splat_f32(0x1.0p-112f);
                                                     ^~~~
....../FP16/include/fp16/psimd.h:21:53: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
....../FP16/include/fp16/psimd.h: In function ‘psimd_f32x2 fp16_ieee_to_fp32x2_psimd(psimd_u16)’:
....../FP16/include/fp16/psimd.h:44:53: error: unable to find numeric literal operator ‘operator""f’
  const psimd_f32 exp_scale = psimd_splat_f32(0x1.0p-112f);
                                                     ^~~~
....../FP16/include/fp16/psimd.h:44:53: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
....../FP16/include/fp16/psimd.h: In function ‘psimd_f32 fp16_alt_to_fp32_psimd(psimd_u16)’:
....../FP16/include/fp16/psimd.h:80:55: error: unable to find numeric literal operator ‘operator""f’
  const psimd_f32 denorm_bias = psimd_splat_f32(0x1.0p-14f);
                                                       ^~~
....../FP16/include/fp16/psimd.h:80:55: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
CMakeFiles/to-alt-array-bench.dir/build.make:65: recipe for target 'CMakeFiles/to-alt-array-bench.dir/bench/to-alt-array.cc.o' failed
make[2]: *** [CMakeFiles/to-alt-array-bench.dir/bench/to-alt-array.cc.o] Error 1
make[2]: Leaving directory '....../FP16/build'
CMakeFiles/Makefile2:70: recipe for target 'CMakeFiles/to-alt-array-bench.dir/all' failed
make[1]: *** [CMakeFiles/to-alt-array-bench.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Create a release?

Hi @Maratyszcza ,

would that make sense to create a tag/release?
It is always nice to have a version that can be easily expressed with few numbers instead of a commit hash.
The same is true for FXdiv and psimd as well.

Best regards,

Andrii

Is PSIMD optional?

It only seems to be required for benchmarks/tests but it isn't disabled when I disable benchmarks/tests.

Purpose of fp16.h install

What is the purpose of the fp16.h (https://github.com/Maratyszcza/FP16/blob/master/include/fp16.h) install when it seems to only include fp16/fp16.h and (optionally) fp16/psimd.h?
It isn't in a subfolder and the user could just as easily include fp16/fp16.h themselves.

Should this actually be installed or was it only meant to be used for the benchmark/tests?

I couldn't see PSIMD_H defined anywhere so I assume it only includes it if the upstream header was already included.

Ubuntu 18.04 linux stuck on test 3

hi, I'm first time testing this repo,

just cloned, cmake . , make -j

running make tests gets stuck on test 3:

FP16$ make test
Running tests...
Test project /mnt/store/devel/FP16
Start 1: ieee-to-fp32-bits
1/7 Test #1: ieee-to-fp32-bits ................ Passed 0.01 sec
Start 2: ieee-to-fp32-value
2/7 Test #2: ieee-to-fp32-value ............... Passed 0.01 sec
Start 3: ieee-from-fp32-value
^CMakefile:106: recipe for target 'test' failed
make: *** [test] Přerušení (SIGINT)

Build with VS

Visual studio doesn't support __builtin_clz.
Can something like below be added to fp16.h?

#ifdef _MSC_VER
#define NOMINMAX
#include "windows.h"
#include <intrin.h>
uint32_t __inline clz(uint32_t value) {
DWORD count = 0;
return (_BitScanReverse(&count, value)) ? 31 - count : 32;
}
#define __builtin_clz(x) clz(x)
#endif

Cannot "make install" on M1 Mac

The cmake . step goes well, but the make install step fails due to error: use of undeclared identifier '__builtin_aarch64_set_fpcr'.

➜  ~ sw_vers
ProductName:	macOS
ProductVersion:	12.5.1
BuildVersion:	21G83
➜  ~ arch
arm64
full traceback here
➜  clones git clone [email protected]:Maratyszcza/FP16.git
Cloning into 'FP16'...
remote: Enumerating objects: 293, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 293 (delta 2), reused 3 (delta 0), pack-reused 286
Receiving objects: 100% (293/293), 108.77 KiB | 928.00 KiB/s, done.
Resolving deltas: 100% (161/161), done.
➜  clones cd FP16 
➜  FP16 git:(master) cmake .
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/GNUInstallDirs.cmake:243 (message):
  Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
  target architecture is known.  Please enable at least one language before
  including GNUInstallDirs.
Call Stack (most recent call first):
  CMakeLists.txt:3 (INCLUDE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Downloading PSimd to /Users/singingwolfboy/clones/FP16/psimd-source (define PSIMD_SOURCE_DIR to avoid it)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/singingwolfboy/clones/FP16/psimd-download
[ 11%] Creating directories for 'psimd'
[ 22%] Performing download step (git clone) for 'psimd'
Cloning into 'psimd-source'...
Already on 'master'
Your branch is up to date with 'origin/master'.
[ 33%] Performing update step for 'psimd'
[ 44%] No patch step for 'psimd'
[ 55%] No configure step for 'psimd'
[ 66%] No build step for 'psimd'
[ 77%] No install step for 'psimd'
[ 88%] No test step for 'psimd'
[100%] Completed 'psimd'
[100%] Built target psimd
-- Downloading Google Test to /Users/singingwolfboy/clones/FP16/googletest-source (define GOOGLETEST_SOURCE_DIR to avoid it)
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/ExternalProject.cmake:3071 (message):
The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
not set. The policy's OLD behavior will be used. When using a URL
download, the timestamps of extracted files should preferably be that of
the time of extraction, otherwise code that depends on the extracted
contents might not be rebuilt if the URL changes. The OLD behavior
preserves the timestamps from the archive instead, but this is usually not
what you want. Update your project to the NEW behavior or specify the
DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
robustness issue.
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
CMakeLists.txt:6 (ExternalProject_Add)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/singingwolfboy/clones/FP16/googletest-download
[ 11%] Creating directories for 'googletest'
[ 22%] Performing download step (download, verify and extract) for 'googletest'
-- Downloading...
dst='/Users/singingwolfboy/clones/FP16/googletest-download/googletest-prefix/src/release-1.8.0.zip'
timeout='none'
inactivity timeout='none'
-- Using src='https://github.com/google/googletest/archive/release-1.8.0.zip'
-- [download 0% complete]
-- [download 1% complete]
-- [download 2% complete]
-- [download 3% complete]
-- [download 4% complete]
-- [download 5% complete]
-- [download 6% complete]
-- [download 7% complete]
-- [download 8% complete]
-- [download 9% complete]
-- [download 10% complete]
-- [download 11% complete]
-- [download 12% complete]
-- [download 14% complete]
-- [download 16% complete]
-- [download 17% complete]
-- [download 18% complete]
-- [download 19% complete]
-- [download 20% complete]
-- [download 21% complete]
-- [download 22% complete]
-- [download 23% complete]
-- [download 24% complete]
-- [download 25% complete]
-- [download 26% complete]
-- [download 27% complete]
-- [download 30% complete]
-- [download 32% complete]
-- [download 33% complete]
-- [download 34% complete]
-- [download 35% complete]
-- [download 37% complete]
-- [download 39% complete]
-- [download 40% complete]
-- [download 41% complete]
-- [download 42% complete]
-- [download 43% complete]
-- [download 44% complete]
-- [download 45% complete]
-- [download 46% complete]
-- [download 47% complete]
-- [download 48% complete]
-- [download 49% complete]
-- [download 50% complete]
-- [download 51% complete]
-- [download 52% complete]
-- [download 53% complete]
-- [download 54% complete]
-- [download 55% complete]
-- [download 56% complete]
-- [download 57% complete]
-- [download 58% complete]
-- [download 59% complete]
-- [download 61% complete]
-- [download 62% complete]
-- [download 63% complete]
-- [download 64% complete]
-- [download 65% complete]
-- [download 66% complete]
-- [download 67% complete]
-- [download 68% complete]
-- [download 69% complete]
-- [download 70% complete]
-- [download 71% complete]
-- [download 72% complete]
-- [download 73% complete]
-- [download 74% complete]
-- [download 75% complete]
-- [download 76% complete]
-- [download 77% complete]
-- [download 78% complete]
-- [download 79% complete]
-- [download 80% complete]
-- [download 81% complete]
-- [download 82% complete]
-- [download 83% complete]
-- [download 84% complete]
-- [download 85% complete]
-- [download 86% complete]
-- [download 87% complete]
-- [download 89% complete]
-- [download 90% complete]
-- [download 91% complete]
-- [download 93% complete]
-- [download 94% complete]
-- [download 95% complete]
-- [download 96% complete]
-- [download 97% complete]
-- [download 98% complete]
-- [download 99% complete]
-- [download 100% complete]
-- verifying file...
file='/Users/singingwolfboy/clones/FP16/googletest-download/googletest-prefix/src/release-1.8.0.zip'
-- Downloading... done
-- extracting...
src='/Users/singingwolfboy/clones/FP16/googletest-download/googletest-prefix/src/release-1.8.0.zip'
dst='/Users/singingwolfboy/clones/FP16/googletest-source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No update step for 'googletest'
[ 44%] No patch step for 'googletest'
[ 55%] No configure step for 'googletest'
[ 66%] No build step for 'googletest'
[ 77%] No install step for 'googletest'
[ 88%] No test step for 'googletest'
[100%] Completed 'googletest'
[100%] Built target googletest
-- Downloading Google Benchmark to /Users/singingwolfboy/clones/FP16/googlebenchmark-source (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/ExternalProject.cmake:3071 (message):
The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
not set. The policy's OLD behavior will be used. When using a URL
download, the timestamps of extracted files should preferably be that of
the time of extraction, otherwise code that depends on the extracted
contents might not be rebuilt if the URL changes. The OLD behavior
preserves the timestamps from the archive instead, but this is usually not
what you want. Update your project to the NEW behavior or specify the
DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
robustness issue.
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
CMakeLists.txt:6 (ExternalProject_Add)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/singingwolfboy/clones/FP16/googlebenchmark-download
[ 11%] Creating directories for 'googlebenchmark'
[ 22%] Performing download step (download, verify and extract) for 'googlebenchmark'
-- Downloading...
dst='/Users/singingwolfboy/clones/FP16/googlebenchmark-download/googlebenchmark-prefix/src/v1.2.0.zip'
timeout='none'
inactivity timeout='none'
-- Using src='https://github.com/google/benchmark/archive/v1.2.0.zip'
-- verifying file...
file='/Users/singingwolfboy/clones/FP16/googlebenchmark-download/googlebenchmark-prefix/src/v1.2.0.zip'
-- Downloading... done
-- extracting...
src='/Users/singingwolfboy/clones/FP16/googlebenchmark-download/googlebenchmark-prefix/src/v1.2.0.zip'
dst='/Users/singingwolfboy/clones/FP16/googlebenchmark-source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No update step for 'googlebenchmark'
[ 44%] No patch step for 'googlebenchmark'
[ 55%] No configure step for 'googlebenchmark'
[ 66%] No build step for 'googlebenchmark'
[ 77%] No install step for 'googlebenchmark'
[ 88%] No test step for 'googlebenchmark'
[100%] Completed 'googlebenchmark'
[100%] Built target googlebenchmark
CMake Deprecation Warning at googletest-source/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at googletest-source/googlemock/CMakeLists.txt:41 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at googletest-source/googletest/CMakeLists.txt:48 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Found PythonInterp: /Users/singingwolfboy/.pyenv/shims/python (found version "3.10.3")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Git: /usr/bin/git (found version "2.32.1 (Apple Git-133)")
-- git Version: v0.0.0
-- Version: 0.0.0
-- Performing Test HAVE_CXX_FLAG_STD_CXX11
-- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
-- Performing Test HAVE_CXX_FLAG_WERROR
-- Performing Test HAVE_CXX_FLAG_WERROR - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Success
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WZERO_AS_NULL_POINTER_CONSTANT
-- Performing Test HAVE_CXX_FLAG_WZERO_AS_NULL_POINTER_CONSTANT - Success
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Success
-- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES
-- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- failed to compile
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/singingwolfboy/clones/FP16
➜ FP16 git:(master) ✗ make install
[ 1%] Building CXX object googletest/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 3%] Linking CXX static library libgtest.a
[ 3%] Built target gtest
[ 5%] Building CXX object googletest/googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 6%] Linking CXX static library libgtest_main.a
[ 6%] Built target gtest_main
[ 8%] Building CXX object CMakeFiles/ieee-to-fp32-bits-test.dir/test/ieee-to-fp32-bits.cc.o
[ 10%] Building CXX object CMakeFiles/ieee-to-fp32-bits-test.dir/test/tables.cc.o
[ 12%] Linking CXX executable ieee-to-fp32-bits-test
[ 12%] Built target ieee-to-fp32-bits-test
[ 13%] Building CXX object CMakeFiles/ieee-to-fp32-value-test.dir/test/ieee-to-fp32-value.cc.o
[ 15%] Building CXX object CMakeFiles/ieee-to-fp32-value-test.dir/test/tables.cc.o
[ 17%] Linking CXX executable ieee-to-fp32-value-test
[ 17%] Built target ieee-to-fp32-value-test
[ 18%] Building CXX object CMakeFiles/ieee-from-fp32-value-test.dir/test/ieee-from-fp32-value.cc.o
[ 20%] Building CXX object CMakeFiles/ieee-from-fp32-value-test.dir/test/tables.cc.o
[ 22%] Linking CXX executable ieee-from-fp32-value-test
[ 22%] Built target ieee-from-fp32-value-test
[ 24%] Building CXX object CMakeFiles/alt-to-fp32-bits-test.dir/test/alt-to-fp32-bits.cc.o
[ 25%] Building CXX object CMakeFiles/alt-to-fp32-bits-test.dir/test/tables.cc.o
[ 27%] Linking CXX executable alt-to-fp32-bits-test
[ 27%] Built target alt-to-fp32-bits-test
[ 29%] Building CXX object CMakeFiles/alt-to-fp32-value-test.dir/test/alt-to-fp32-value.cc.o
[ 31%] Building CXX object CMakeFiles/alt-to-fp32-value-test.dir/test/tables.cc.o
[ 32%] Linking CXX executable alt-to-fp32-value-test
[ 32%] Built target alt-to-fp32-value-test
[ 34%] Building CXX object CMakeFiles/alt-from-fp32-value-test.dir/test/alt-from-fp32-value.cc.o
[ 36%] Building CXX object CMakeFiles/alt-from-fp32-value-test.dir/test/tables.cc.o
[ 37%] Linking CXX executable alt-from-fp32-value-test
[ 37%] Built target alt-from-fp32-value-test
[ 39%] Building CXX object CMakeFiles/bitcasts-test.dir/test/bitcasts.cc.o
[ 41%] Linking CXX executable bitcasts-test
[ 41%] Built target bitcasts-test
[ 43%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/benchmark.cc.o
[ 44%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o
[ 46%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/colorprint.cc.o
[ 48%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/commandlineflags.cc.o
[ 50%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/complexity.cc.o
/Users/singingwolfboy/clones/FP16/googlebenchmark-source/src/complexity.cc:80:10: warning: variable 'sigma_gn' set but not used [-Wunused-but-set-variable]
double sigma_gn = 0.0;
^
1 warning generated.
[ 51%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/console_reporter.cc.o
[ 53%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/counter.cc.o
[ 55%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/csv_reporter.cc.o
[ 56%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/json_reporter.cc.o
[ 58%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/reporter.cc.o
[ 60%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/sleep.cc.o
[ 62%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/string_util.cc.o
[ 63%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/sysinfo.cc.o
[ 65%] Building CXX object googlebenchmark/src/CMakeFiles/benchmark.dir/timers.cc.o
[ 67%] Linking CXX static library libbenchmark.a
[ 67%] Built target benchmark
[ 68%] Building CXX object CMakeFiles/ieee-element-bench.dir/bench/ieee-element.cc.o
/Users/singingwolfboy/clones/FP16/bench/ieee-element.cc:74:29: warning: passing 4-byte aligned argument to 16-byte aligned parameter 1 of 'DoNotOptimize<attribute((vector_size(4 * sizeof(float)))) float>' may result in an unaligned pointer access [-Walign-mismatch]
benchmark::DoNotOptimize(fp32);
^
1 warning generated.
[ 70%] Linking CXX executable ieee-element-bench
[ 70%] Built target ieee-element-bench
[ 72%] Building CXX object CMakeFiles/alt-element-bench.dir/bench/alt-element.cc.o
/Users/singingwolfboy/clones/FP16/bench/alt-element.cc:60:29: warning: passing 4-byte aligned argument to 16-byte aligned parameter 1 of 'DoNotOptimize<attribute((vector_size(4 * sizeof(float)))) float>' may result in an unaligned pointer access [-Walign-mismatch]
benchmark::DoNotOptimize(fp32);
^
1 warning generated.
[ 74%] Linking CXX executable alt-element-bench
[ 74%] Built target alt-element-bench
[ 75%] Building CXX object CMakeFiles/from-ieee-array-bench.dir/bench/from-ieee-array.cc.o
/Users/singingwolfboy/clones/FP16/bench/from-ieee-array.cc:215:31: error: use of undeclared identifier '__builtin_aarch64_get_fpcr'
const unsigned int fpcr = __builtin_aarch64_get_fpcr();
^
/Users/singingwolfboy/clones/FP16/bench/from-ieee-array.cc:217:5: error: use of undeclared identifier '__builtin_aarch64_set_fpcr'
__builtin_aarch64_set_fpcr(fpcr & 0xF6FFFFFFu);
^
/Users/singingwolfboy/clones/FP16/bench/from-ieee-array.cc:231:5: error: use of undeclared identifier '__builtin_aarch64_set_fpcr'
__builtin_aarch64_set_fpcr(fpcr);
^
3 errors generated.
make[2]: *** [CMakeFiles/from-ieee-array-bench.dir/bench/from-ieee-array.cc.o] Error 1
make[1]: *** [CMakeFiles/from-ieee-array-bench.dir/all] Error 2
make: *** [all] Error 2

Build error: 'uint32_t' does not name a type

I'm encountering the following build error on Cray CNL5 with GCC 5.3.0:

/opt/gcc/5.3.0/snos/include/g++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
In file included from /scratch/sciteam/stewart1/spack-stage-fp16-master-a4ipfk3ac7yo6kgg6mkx2yireigufok4/spack-src/test/tables.cc:3:0:
/scratch/sciteam/stewart1/spack-stage-fp16-master-a4ipfk3ac7yo6kgg6mkx2yireigufok4/spack-src/test/tables.h:6:15: error: 'uint32_t' does not name a type
  extern const uint32_t normalizedValues[1024];
               ^
...
/scratch/sciteam/stewart1/spack-stage-fp16-master-a4ipfk3ac7yo6kgg6mkx2yireigufok4/spack-src/include/fp16/fp16.h:45:47: error: 'UINT32_C' was not declared in this scope
...

The build log is attached:

According to https://stackoverflow.com/questions/11069108/uint32-t-does-not-name-a-type it seems like a missing include statement.

patch for fixing i686 build

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996702

Let me quote the message:

Dear Maintainer,

the function fp16_ieee_from_fp32_value() fails to pass tests on i386 arch,
resulting in missing packages https://buildd.debian.org/status/package.php?p=fp16

I think the problem here is implicit usage of double type at include/fp16/fp16.h:231.
The patch should fix that.

And the patch is available here: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=996702;filename=ia32.patch;msg=5

Install config

Is it possible for a config to be installed in the CMake so we can link to it from other projects?

Unit test failures under Emscripten

fp16_alt_to_fp32_value and fp16_ieee_to_fp32_value fail the unit test under Emcripten/Asm.js:

[  FAILED  ] 1 test, listed below:
[  FAILED  ] FP16_ALT_TO_FP32_VALUE.negative_denormalized_values
[  FAILED  ] FP16_IEEE_TO_FP32_VALUE.negative_normalized_values
[  FAILED  ] FP16_IEEE_TO_FP32_VALUE.negative_denormalized_values

As a workaround, fp16_alt_to_fp32_bits and fp16_ieee_to_fp32_bits can be used instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.