Git Product home page Git Product logo

dimsum's Introduction

This is not an official Google product.

Background

Dimsum is a portable C++ SIMD library, that is heavily influenced by the C++ standard library proposal P0214. Currently, the library does not implement P0214, but its ultimate state is a standard conforming implementation.

During the implementation, we examined all the differences our our intended interfaces and P0214, and provided a feedback proposal P0820.

Due to prioritization, Dimsum does not currently implement the following list of features from P0214, including but not limited to:

  • simd_mask<>
  • simd_abi::fixed_size<>
  • simd_abi::compatible<>
  • Non-power-of-two sizes
  • SIMD version of <cmath>

Dimsum provides an extra set of opreations, mostly as free functions in the namespace "dimsum" and namespace "dimsum::x86". The extra operations in "dimsum" include many "horizontal" operations like shuffle, zip, and reduce-add; the extra operations in "x86" provides some x86-specific semantics, with native implementations on x86 and emulations on other architectures.

Documentation

Refer to standard proposals for designs and public interfaces.

For the implementation, all the public interfaces should be documented in comments.

Status

The above mentioned proposals are not part of the standard yet, nor is this implementation fully conforming to the proposals. Any part of the API is subject to change, without providing a fixing tool.

Some functionalities are with strawman implementations, with non-optimal performance, due to prioritization.

Requirements

Build system:

  • Bazel

Compiler:

  • Clang 3.8 or newer

The following sub-architectures are planed to be supported:

  • x86 SSE 4.1 or newer
  • x86 AVX2
  • Power v2.07 VSX

We are also interested in supporting the following toolchain and architectures in the future:

  • (WIP) GCC 4.9 or newer
  • (WIP) ARMv8 NEON (64-bit)

Build and Test

The project is header-only, therefore no build is needed.

For testing, use "CC=clang bazel test --copt='...' <>" to run the unit tests.

For example:

  • CC=clang bazel test --copt='-msse4.1' ... # x86 host
  • CC=clang bazel test --copt='-mavx2' ... # x86 host
  • CC=clang bazel test --copt='-maltivec' ... # Power host

Cross compilation is a bit tricky, but we found the following working, as long as the toolchains support cross compilation:

  • CC=clang bazel build --copt='-target' --copt='powerpc64le-linux-gnu' --copt='-maltivec' --linkopt='-target' --linkopt='powerpc64le-linux-gnu' ... # x86 host

Fuzzing

Link dimsum_fuzz against fuzz engines like libFuzzer, then run the result binary.

(TODO) Add it to OSS-Fuzz

dimsum's People

Contributors

maskray avatar timshen91 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

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.