File: index.rst

package info (click to toggle)
xsimd 14.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 3,256 kB
  • sloc: cpp: 41,584; sh: 547; makefile: 190; python: 117
file content (139 lines) | stat: -rw-r--r-- 4,930 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
.. Copyright (c) 2016, Johan Mabille and Sylvain Corlay

   Distributed under the terms of the BSD 3-Clause License.

   The full license is in the file LICENSE, distributed with this software.

.. image:: xsimd.svg
   :alt: xsimd

C++ wrappers for SIMD intrinsics.

Introduction
------------

`SIMD`_ (Single Instruction, Multiple Data) is a feature of microprocessors that has been available for many years. SIMD instructions perform a single operation
on a batch of values at once, and thus provide a way to significantly accelerate code execution. However, these instructions differ between microprocessor
vendors and compilers.

`xsimd` provides a unified means for using these features for library authors.

The core of the library consist in a parametrized vector type, :ref:`Batch Types`,
and a set of operations to perform :ref:`Arithmetic Operations`,
:ref:`Data Transfer`, and many common mathemtical functions, as for single
values.


There are several ways to use `xsimd` using those :ref:`Batch Types` and
operations:

- one can write a generic, vectorized, algorithm and compile it as part of their
  application build, with the right architecture flag;

- one can write a generic, vectorized, algorithm and compile several version of
  it by just changing the architecture flags, then pick the best version at
  runtime;

- one can write a vectorized algorithm specialized for a given architecture and
  still benefit from the high-level abstraction proposed by `xsimd`.

Of course, nothing prevents the combination of several of those approach, but
more about this in section :ref:`Writing vectorized code`.

You can find out more about this implementation of C++ wrappers for SIMD
intrinsics at the `The C++ Scientist`_. The mathematical functions are a
lightweight implementation of the algorithms also used in `boost.SIMD`_.


Compiler and Architecture Support
---------------------------------

The following SIMD instruction set extensions are supported:

+--------------+---------------------------------------------------------+
| Architecture | Instruction set extensions                              |
+==============+=========================================================+
| x86          | SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, FMA3, AVX2 |
+--------------+---------------------------------------------------------+
| x86          | AVX512 (gcc7 and higher)                                |
+--------------+---------------------------------------------------------+
| x86 AMD      | same as above + FMA4                                    |
+--------------+---------------------------------------------------------+
| ARM          | ARMv7, ARMv8                                            |
+--------------+---------------------------------------------------------+
| WebAssembly  | WASM                                                    |
+--------------+---------------------------------------------------------+
| Risc-V       | Vector ISA                                              |
+--------------+---------------------------------------------------------+
| PowerPC      | VSX                                                     |
+--------------+---------------------------------------------------------+


`xsimd` requires a C++11 compliant compiler. The following C++ compilers are supported:

+-------------------------+-------------------------------+
| Compiler                | Version                       |
+=========================+===============================+
| Microsoft Visual Studio | MSVC 2015 update 2 and above  |
+-------------------------+-------------------------------+
| g++                     | 4.9 and above                 |
+-------------------------+-------------------------------+
| clang                   | 3.7 and above                 |
+-------------------------+-------------------------------+

Licensing
---------

We use a shared copyright model that enables all contributors to maintain the
copyright on their contributions.

This software is licensed under the BSD-3-Clause license. See the LICENSE file for details.


.. toctree::
   :caption: INSTALLATION
   :maxdepth: 2

   installation

.. toctree::
   :caption: USAGE
   :maxdepth: 2

   basic_usage
   vectorized_code
   integration

.. toctree::
   :caption: API REFERENCE
   :maxdepth: 1

   api/instr_macros
   api/batch_index
   api/data_transfer
   api/arithmetic_index
   api/comparison_index
   api/bitwise_operators_index
   api/math_index
   api/reducer_index
   api/cast_index
   api/type_traits
   api/batch_manip
   api/misc_index
   api/aligned_allocator
   api/arch
   api/dispatching


.. toctree::
   :caption: MIGRATION GUIDE
   :maxdepth: 1

   migration_guide



.. _SIMD: https://fr.wikipedia.org/wiki/Single_instruction_multiple_data
.. _The C++ Scientist: http://johanmabille.github.io/blog/archives/
.. _boost.SIMD: https://github.com/NumScale/boost.simd