Skip to content

Commit e62b73d

Browse files
committed
Consolidate build options
1 parent 4bc785a commit e62b73d

8 files changed

Lines changed: 74 additions & 21 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ target_compile_features(xsimd INTERFACE cxx_std_14)
4646
# developed or is vendored.
4747
# Otherwise (if an install is performed), this will be handled in the user
4848
# cmake script (xsimdConfig.cmake).
49-
if(ENABLE_XTL_COMPLEX)
49+
if(ENABLE_XTL_COMPLEX OR XSIMD_ENABLE_XTL_COMPLEX)
5050
find_package(xtl 0.8.0 REQUIRED)
5151
target_link_libraries(xsimd INTERFACE $<BUILD_INTERFACE:xtl>)
5252
target_compile_definitions(xsimd INTERFACE

docs/source/api/arch.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
The full license is in the file LICENSE, distributed with this software.
66
7+
.. _arch-manipulation:
78
Architecture Manipulation
89
=========================
910

@@ -12,13 +13,15 @@ The mentioned types are primarily used as template parameters for :ref:`batch
1213
<xsimd-batch-ref>`, and when interacting with :cpp:func:`xsimd::dispatch()`.
1314

1415
The best available architecture is available at compile time through
15-
``xsimd::best_arch`` which also happens to be ``xsimd::default_arch``.
16+
``xsimd::best_arch`` which is what ``xsimd::default_arch`` defaults to unless otherwise
17+
configured.
1618

1719
.. doxygengroup:: architectures
1820
:project: xsimd
1921
:members:
2022

2123

24+
.. _emulated-mode:
2225
Emulated Mode
2326
-------------
2427

docs/source/api/instr_macros.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
}
2727
</style>
2828

29+
.. _instr-set-macros:
2930
Instruction Set Macros
3031
======================
3132

@@ -35,11 +36,3 @@ can be used to filter arch-specific code.
3536
.. doxygengroup:: xsimd_config_macro
3637
:project: xsimd
3738
:content-only:
38-
39-
Changing Default Architecture
40-
*****************************
41-
42-
You can change the default instruction set used by xsimd (when none is provided
43-
explicitely) by setting the ``XSIMD_DEFAULT_ARCH`` macro to, say, ``xsimd::avx2``.
44-
A common usage is to set it to ``xsimd::unsupported`` as a way to detect
45-
instantiation of batches with the default architecture.

docs/source/api/xsimd_batch_complex.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,3 @@ Operations Specific to Batches of Complex Numbers
1717
.. doxygengroup:: batch_complex
1818
:project: xsimd
1919
:content-only:
20-
21-
XTL Complex Support
22-
-------------------
23-
24-
If the preprocessor token ``XSIMD_ENABLE_XTL_COMPLEX`` is defined, ``xsimd``
25-
provides constructors of ``xsimd::batch< std::complex< T >, A >`` from
26-
``xtl::xcomplex``, similar to those for ``std::complex``. This requires `XTL`_
27-
to be installed.
28-
29-
.. _XTL: https://github.com/xtensor-stack/xtl

docs/source/build.rst

Whitespace-only changes.

docs/source/build_options.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.. Copyright (c) 2016, xsimd contributors
2+
3+
Distributed under the terms of the BSD 3-Clause License.
4+
5+
The full license is in the file LICENSE, distributed with this software.
6+
7+
8+
Build Options
9+
=============
10+
11+
Some macros can be set to configure the behaviour of xsimd at compulte time.
12+
13+
Changing Default Architecture
14+
-----------------------------
15+
16+
You can change the default instruction set used by xsimd (when none is provided
17+
explicitly) by setting the ``XSIMD_DEFAULT_ARCH`` macro to, say, ``xsimd::avx2``.
18+
A common usage is to set it to ``xsimd::unsupported`` as a way to detect
19+
instantiation of batches with the default architecture.
20+
21+
This will change the value of ``xsimd::default_arch`` used as default template parameter for
22+
:ref:`batch <xsimd-batch-ref>`.
23+
See :ref:`arch-manipulation` for all available architectures.
24+
25+
In CMake, this can be done with the following.
26+
27+
.. code:: cmake
28+
29+
target_add_compile_definitions(myproject PRIVATE XSIMD_DEFAULT_ARCH=xsimd::avx2)
30+
31+
32+
Enabling emulated architecture
33+
------------------------------
34+
35+
When the compiler macro ``XSIMD_WITH_EMULATED`` is set to ``1``, xsimd also
36+
exhibits an emulated architecture.
37+
38+
See :ref:`emulated-mode` for all available architectures.
39+
40+
In CMake, this can be done with the following.
41+
42+
.. code:: cmake
43+
44+
target_add_compile_definitions(myproject PRIVATE XSIMD_WITH_EMULATED=1)
45+
46+
47+
Enabling complex support with ``xtl``
48+
-------------------------------------
49+
50+
If the preprocessor token ``XSIMD_ENABLE_XTL_COMPLEX`` is defined, ``xsimd``
51+
provides constructors of ``xsimd::batch<std::complex<T>, A>`` from
52+
``xtl::xcomplex``, similar to those for ``std::complex``.
53+
This requires the `xtl <https://github.com/xtensor-stack/xtl>`_ library to be installed
54+
and in the project include directories.
55+
56+
In CMake, this can be done with an option before the package search (xsimd 14.3 onwards).
57+
It will link the ``xtl`` library as well as adding the macro definition to ``xsimd`` interface.
58+
59+
.. code:: cmake
60+
61+
option(XSIMD_ENABLE_XTL_COMPLEX "Enable xtl complex support" ON)
62+
find_package(xsimd REQUIRED)

docs/source/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
html_theme = "sphinx_rtd_theme"
1515
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
16+
html_theme_options = {
17+
'collapse_navigation': False,
18+
'navigation_depth': 4,
19+
}
1620

1721
def setup(app):
1822
app.add_css_file("main_stylesheet.css")

docs/source/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.. image:: xsimd.svg
88
:alt: xsimd
99

10-
C++ wrappers for SIMD intrinsics.
10+
C++14 wrappers for SIMD intrinsics.
1111

1212
Introduction
1313
------------
@@ -95,6 +95,7 @@ This software is licensed under the BSD-3-Clause license. See the LICENSE file f
9595
:maxdepth: 2
9696

9797
installation
98+
build_options
9899

99100
.. toctree::
100101
:caption: USAGE

0 commit comments

Comments
 (0)