GithubHelp home page GithubHelp logo

mfornace / boost.simd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from agenium-scale/boost.simd

0.0 1.0 0.0 8.9 MB

Portable SIMD computation library - To be proposed as a Boost library

License: Boost Software License 1.0

CMake 4.69% C++ 93.73% C 1.17% Python 0.40%

boost.simd's Introduction

Boost.SIMD

Boost.SIMD is a portable SIMD programming library. It's a sensible subset of the features proposed by bSIMD - NumScale's closed-source library for SIMD programming - that we saw fit for open sourcing.

Build Status

Boost.SIMD was developed to simplify the difficult, tedious and often error-prone process of developing SIMD programs. Boost.SIMD is designed to seamlessly integrate into existing projects so that you can quickly and easily start developing high performance, portable and future-proof software.

Important Links :

What is SIMD?

Single instruction, multiple data (SIMD) instructions or multimedia extensions have been available for many years. They are designed to significantly accelerate code execution, however they require expertise to be used correctly and they depend on potentially fragile compiler support and the use of low-level intrinsics, or vendor-specific libraries. The introduction of these instruction sets has allowed developers to exploit the latent data parallelism available in applications by executing a given instruction simultaneously on multiple data stored in dedicated cpu registers. The SIMD unit is built as an independent computation unit in the processor, it comes in addition to the regular computation unit complete with a special register file, dispatching and pipelining unit.

Why use Boost.SIMD?

The use of SIMD instructions requires developers to program into a very verbose manner due to the low-level nature of SIMD instruction sets or to rely on fragile, black-box auto-vectorizating compilers. Furthermore, it can be necessary to re-write code for each revision of each target architecture, accounting for each architecture's vendor provided API as well as architecture dependent implementation details. This greatly complicates the design and maintenance of SIMD code, significantly increasing the time required to develop, test and deploy software as well as increasing the scope for introducing bugs.

Boost.SIMD is designed to be user-friendly and easy to integrate into existing projects. To make life even easier, Boost.SIMD includes a large number of commonly used functions and constants, standardizing the use of common SIMD programming idioms. Boost.SIMD allows you to focus on the important part of your work: the development of new features and functionality.

Boost.SIMD provides the following:

Supported Compilers and Hardware

Architecture Extensions
x86 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2

Boost.SIMD requires a C++11 compliant compiler and Boost 1.61 and is thoroughly tested on the following compilers:

Compiler Version
g++ 4.8 and above
clang++ 3.5 and above
Microsoft Visual Studio 15.0 and above

Getting Started

We start out on the premise you already have a proper installation of Boost 1.61 or superior setup on your machine.

You can retrieve the current status of the library by cloning the repository:

git clone https://github.com/NumScale/boost.simd.git

By default, the develop branch is fetched. You can change that to master if you want to use the stable version instead of the development version.

Once cloned, the library headers are located in the include/ folder and are ready to be used. A very simple example like:

#include <boost/simd/pack.hpp>
#include <iostream>

namespace bs = boost::simd;

int main()
{
   bs::pack<float,4> p{1.f,2.f,3.f,4.f};
   std::cout << p + 10*p << "\n";

   return 0;
}

can then be compiled via:

g++ main.cpp -std=c++11 -O3 -msse4.2 -I<path/to/boost/1.61/include> -I<path/to/boost/simd/include> -o main

and display:

(11, 22, 33, 44)

Now, you can have a look at our documentation to follow one of our tutorials on how to use Boost.SIMD.

boost.simd's People

Watchers

 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.