GithubHelp home page GithubHelp logo

timoalho / fixed_point Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johnmcfarlane/fixed_point

0.0 2.0 0.0 1.57 MB

C++ Binary Fixed-Point Arithmetic

License: Boost Software License 1.0

Shell 0.07% CMake 2.35% C++ 97.21% Python 0.37%

fixed_point's Introduction

fixed_point

Build Status Build status

The fixed_point library provides a header-only C++11 API for approximating real numbers using binary fixed-point arithmetic. It forms the reference implementation of a standard library proposal presented in paper, P0037 and is developed as part of study groups, SG14 and SG6.

Installation

The library is hosted on GitHub:

$ git clone https://github.com/johnmcfarlane/fixed_point.git

The API is exposed through headers in the include directory. Add this to your system header list and include, e.g.:

#include <sg14/fixed_point.h>

Tests and Benchmarks

Linux

Tested on Travis (Ubuntu 12.04) using GCC 4.8 and Clang 3.5 and Debian GNU/Linux 8.3 using GCC 4.9.2 and Clang 3.5.0.

Requires:

Optional:

  • Boost - facilitates multiprecision support
  • Doxygen - generates documentation in the doc/gh-pages directory
  • cmark - generates proposal papers

For a list of configuration options:

$ cmake -LH

To build everything:

$ cmake -DCMAKE_BUILD_TYPE=Release
$ make

To disable exception handling, add -DEXCEPTIONS=OFF to the cmake command:

$ cmake -DCMAKE_BUILD_TYPE=Release -DEXCEPTIONS=OFF
$ make

To run tests:

$ cmake -DCMAKE_BUILD_TYPE=Release
$ make fp_test
$ ./fp_test

To run benchmarks:

$ cmake -DCMAKE_BUILD_TYPE=Release
$ make fp_benchmark
$ ./fp_benchmark

To profile benchmarks:

  1. Build with frame pointers included:

    $ cmake -DCMAKE_BUILD_TYPE=Release -DPROFILE=ON
    $ make fp_benchmark
    $ ./fp_benchmark
  2. then run:

    $ perf record -g ./fp_benchmark
    $ perf report -g 'graph,0.5,caller'

Windows

Tested on AppVeyor and on Windows 7 Professional with CMake 3.4.0. Requires:

  • MSBuild 14.0
  • CMake 2.8.11

To build vs/Release/fp_test.exe and vs/Release/fp_benchmark.exe:

cmake .
MSBuild.exe /m fixed_point.sln /p:Configuration=Release

For 64-bit builds, append Win64 to the -G option above:

cmake -G "Visual Studio 14 2015 Win64" .

Note that fp_benchmark is unlikely to produce valid results due to missing escape and clobber functions.

Cleaning

To clean the project files:

git clean -Xdff .

(Use with caution!)

Further Reading

Contact Information

All feedback greatly appreciated.

fixed_point's People

Contributors

johnmcfarlane avatar sethml avatar

Watchers

James Cloos avatar Timo Alho avatar

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.