GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Categories
  • Newsletter
  • Submit
  • Login
  • Awesome C++
  • Math

This view

  • Original page
  • New address

GeezerVison is showing cpp.libhunt.com — Vc Alternatives - C++ Math | LibHunt

  • Subscribe
  • Submit
  • Categories
  • About
  • Login

Vc

SIMD Vector Classes for C++

VcDevel logo
Source Code    Changelog
Suggest Changes
Take the C++ Developer Survey - About 6 minutes on the tools, libraries and AI you use with C++. You get the results by email. Take the survey »
Popularity
6.0
Growing
Activity
3.6
-
Stars 1,551
Watchers 58
Forks 152
Last Commit 5 months ago

Code Quality Rank: L1
Programming language: C++
License: BSD 3-clause "New" or "Revised" License
Tags: Math    
Latest version: v1.4.1

Vc alternatives and similar libraries

Based on the "Math" category.
Alternatively, view Vc alternatives based on common mentions on social networks and blogs.

  • GLM

    9.2 7.8 L1 Vc VS GLM
    OpenGL Mathematics (GLM)
    g-truc logo
  • QuantLib

    8.9 9.9 L1 Vc VS QuantLib
    The QuantLib C++ library
    lballabio logo
  • SaaSHub - Software Alternatives and Reviews

    SaaSHub helps you find the best software and product alternatives
    Promo www.saashub.com
    SaaSHub Logo
  • OpenBLAS

    8.7 9.9 Vc VS OpenBLAS
    OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
    OpenMathLib logo
  • CGal

    8.5 9.9 L1 Vc VS CGal
    The public CGAL repository, see the README below
    CGAL logo
  • ceres-solver

    8.2 9.1 L1 Vc VS ceres-solver
    A large scale non-linear optimization library
    ceres-solver logo
  • Eigen

    7.1 - Vc VS Eigen
    A high-level C++ library of template headers for linear algebra, matrix and vector operations, numerical solvers and related algorithms. [MPL2]
  • TinyExpr

    6.6 7.2 L4 Vc VS TinyExpr
    tiny recursive descent expression parser, compiler, and evaluation engine for math expressions
    codeplea logo
  • ExprTK

    5.8 0.0 L1 Vc VS ExprTK
    C++ Mathematical Expression Parsing And Evaluation Library https://www.partow.net/programming/exprtk/index.html
    ArashPartow logo
  • linmath.h

    5.3 0.0 Vc VS linmath.h
    a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions
    datenwolf logo
  • HLSL++

    5.2 7.4 Vc VS HLSL++
    Math library using HLSL syntax with multiplatform SIMD support
    redorav logo
  • MIRACL

    5.2 0.0 L1 Vc VS MIRACL
    MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC).
    miracl logo
  • LibTomMath

    5.2 6.7 L2 Vc VS LibTomMath
    LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.
    libtom logo
  • NT2

    5.0 5.6 Vc VS NT2
    DISCONTINUED. A SIMD-optimized numerical template library that provides an interface with MATLAB-like syntax. [Boost]
  • Klein

    4.6 0.0 Vc VS Klein
    DISCONTINUED. P(R*_{3, 0, 1}) specialized SIMD Geometric Algebra Library
  • muparser

    4.5 6.6 L1 Vc VS muparser
    muparser is a fast math parser library for C/C++ with (optional) OpenMP support.
    beltoforion logo
  • GMTL

    3.8 0.0 L1 Vc VS GMTL
    Generic Math Template Library (forked from http://ggt.sourceforge.net/)
    imvu logo
  • Boost.Multiprecision

    3.8 6.6 L1 Vc VS Boost.Multiprecision
    Boost.Multiprecision
    boostorg logo
  • safe_numerics

    3.4 3.1 Vc VS safe_numerics
    Replacements to standard numeric types which throw exceptions on errors
    boostorg logo
  • Apophenia

    3.2 2.0 L2 Vc VS Apophenia
    A C library for statistical and scientific computing
    b-k logo
  • Wykobi

    3.2 0.0 Vc VS Wykobi
    Wykobi C++ Computational Geometry Library https://www.wykobi.com
    ArashPartow logo
  • blaze

    3.1 - Vc VS blaze
    high-performance C++ math library for dense and sparse arithmetic. [BSD]
  • Versor

    1.8 0.0 Vc VS Versor
    [older version] Versor 1.0 C++ library for conformal geometric algebra draw routines
    wolftype logo
  • SLIMCPP

    1.7 4.9 Vc VS SLIMCPP
    Simple Long Integer Math for C++. Lightweight cross-platform header-only library what implements big integer arithmetic in С++17.
    devatrun logo
  • metamath

    1.7 0.0 Vc VS metamath
    Meta mathematics. Symbolic functions and derivatives.
    egladysh logo
  • Xerus

    1.6 0.0 Vc VS Xerus
    A general purpose library for numerical calculations with higher order tensors, Tensor-Train Decompositions / Matrix Product States and other Tensor Networks
    libxerus logo
  • Mission : Impossible (AutoDiff)

    1.4 0.0 Vc VS Mission : Impossible (AutoDiff)
    A concise C++17 implementation of automatic differentiation (operator overloading)
    vincent-picaud logo
  • ceval

    1.4 0.0 Vc VS ceval
    A C/C++ library for parsing and evaluation of arithmetic expressions.
    erstan logo
  • macadam

    0.9 0.0 Vc VS macadam
    DISCONTINUED. Numerical library. Complete BLAS. Hybrid cpp98/cpp11 c99/c11
  • GMP

    - Vc VS GMP
    A C/C++ library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers. [LGPL3 & GPL2]
  • Armadillo

    - Vc VS Armadillo
    A high quality C++ linear algebra library, aiming towards a good balance between speed and ease of use. The syntax (API) is deliberately similar to Matlab. [MPL2]

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.

Do you think we are missing an alternative of Vc or a related project?

Add another 'Math' Library

Popular Comparisons

  • Vc
    vs
    GLM
  • Vc
    vs
    Eigen
  • Vc
    vs
    blaze
  • Vc
    vs
    MIRACL
  • Vc
    vs
    LibTomMath

README

Vc: portable, zero-overhead C++ types for explicitly data-parallel programming

NOTE: This is the development version, implementing https://wg21.link/p0214. For production use consider the latest release or the 1.3 branch. This implementation requires GCC 7.1 or newer. Support for Clang, ICC, and MSVC is available with the 1.3 branch.

Introduction

Recent generations of CPUs, and GPUs in particular, require data-parallel codes for full efficiency. Data parallelism requires that the same sequence of operations is applied to different input data. CPUs and GPUs can thus reduce the necessary hardware for instruction decoding and scheduling in favor of more arithmetic and logic units, which execute the same instructions synchronously. On CPU architectures this is implemented via SIMD registers and instructions. A single SIMD register can store N values and a single SIMD instruction can execute N operations on those values. On GPU architectures N threads run in perfect sync, fed by a single instruction decoder/scheduler. Each thread has local memory and a given index to calculate the offsets in memory for loads and stores.

Current C++ compilers can do automatic transformation of scalar codes to SIMD instructions (auto-vectorization). However, the compiler must reconstruct an intrinsic property of the algorithm that was lost when the developer wrote a purely scalar implementation in C++. Consequently, C++ compilers cannot vectorize any given code to its most efficient data-parallel variant. Especially larger data-parallel loops, spanning over multiple functions or even translation units, will often not be transformed into efficient SIMD code.

The Vc library provides the missing link. Its types enable explicitly stating data-parallel operations on multiple values. The parallelism is therefore added via the type system. Competing approaches state the parallelism via new control structures and consequently new semantics inside the body of these control structures.

Vc is a free software library to ease explicit vectorization of C++ code. It has an intuitive API and provides portability between different compilers and compiler versions as well as portability between different vector instruction sets. Thus an application written with Vc can be compiled for:

  • AVX and AVX2
  • SSE2 up to SSE4.2 or SSE4a
  • Scalar
  • MIC (only before Vc 2.0)
  • AVX-512 (since Vc 2.0)
  • NEON (in development)
  • NVIDIA GPUs / CUDA (research)

Examples

Scalar Product

Let's start from the code for calculating a 3D scalar product using builtin floats:

using Vec3D = std::array<float, 3>;
float scalar_product(Vec3D a, Vec3D b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}

Using Vc, we can easily vectorize the code using the native_simd<float> type:

using Vc::native_simd;
using Vec3D = std::array<native_simd<float>, 3>;
float_v scalar_product(Vec3D a, Vec3D b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}

The above will scale to 1, 4, 8, 16, etc. scalar products calculated in parallel, depending on the target hardware's capabilities.

For comparison, the same vectorization using Intel SSE intrinsics is more verbose and uses prefix notation (i.e. function calls):

using Vec3D = std::array<__m128, 3>;
__m128 scalar_product(Vec3D a, Vec3D b) {
  return _mm_add_ps(_mm_add_ps(_mm_mul_ps(a[0], b[0]), _mm_mul_ps(a[1], b[1])),
                    _mm_mul_ps(a[2], b[2]));
}

The above will neither scale to AVX, MIC, etc. nor is it portable to other SIMD ISAs.

Build Requirements

cmake >= 3.0

C++17 Compiler:

  • GCC >= 7.1

Building and Installing Vc

  • Create a build directory:
$ mkdir build
$ cd build
  • Call cmake; the following options may be interesting:
    • -DCMAKE_INSTALL_PREFIX=<path>: Select a different install prefix. Note that installing is not required (use -I<path to Vc src>) and currently not supported.
    • -DENABLE_UBSAN=ON: Build tests with the “undefined behavior sanitizer” enabled.
    • -DTARGET_ARCHITECTURE=<target>: Select a target architecture, different from the one you are building on.
    • -DUSE_CCACHE=ON: Use ccache (when found) to speed up recurring builds.
$ cmake <srcdir>
  • Build and run tests:
$ make -j8
$ ctest -j8

Documentation

The documentation of the master branch is currently out of date. Please refer to https://wg21.link/p0214 for the specification.

Documentation for older releases is available at:

  • 1.3.0 release
  • 1.2.0 release
  • 1.1.0 release
  • 0.7 branch

Publications

  • M. Kretz, "Extending C++ for Explicit Data-Parallel Programming via SIMD Vector Types", Goethe University Frankfurt, Dissertation, 2015.
  • M. Kretz and V. Lindenstruth, "Vc: A C++ library for explicit vectorization", Software: Practice and Experience, 2011.
  • M. Kretz, "Efficient Use of Multi- and Many-Core Systems with Vectorization and Multithreading", University of Heidelberg, 2009.

Work on integrating the functionality of Vc in the C++ standard library.

Communication

A channel on the freenode IRC network is reserved for discussions on Vc: [##vc on freenode](irc://chat.freenode.net:6667/##vc) ([via SSL](ircs://chat.freenode.net:6697/##vc))

Feel free to use the GitHub issue tracker for questions. Alternatively, there's a mailinglist for users of Vc

License

Vc is released under the terms of the 3-clause BSD license.


*Note that all licence references and agreements mentioned in the Vc README section above are relevant to that project's source code only.

Do not miss the trending, libraries, news and articles with our weekly report.

Awesome C++ is part of the LibHunt network. Terms. Privacy Policy.

(CC)
BY-SA
Spin The Wheel Of Names for a cryptographically secure random name picker.
Schedule a when to meet poll.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.