Skip to content

Commit 365b353

Browse files
authored
Uniform header inclusion and clang-format tooling (#1343)
1 parent a903944 commit 365b353

72 files changed

Lines changed: 230 additions & 210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,24 @@ AlignAfterOpenBracket: Align
44
AlignConsecutiveDeclarations: 'false'
55
BreakBeforeBraces: Allman
66
NamespaceIndentation: All
7+
IncludeBlocks: Regroup
8+
# First regex to match classifies the header into a group.
9+
# Group are ordered in the source code by increasing priority.
10+
IncludeCategories:
11+
# Standard headers
12+
- Regex: <[^\.]+>
13+
Priority: 4
14+
# Third party dependencies (prefer angle bracket over quotes)
15+
- Regex: <.+\..+>
16+
Priority: 3
17+
# xsimd absolute headers (e.g. in tests)
18+
- Regex: '["<]xsimd/.+[">]'
19+
Priority: 2
20+
# Relative header from project
21+
- Regex: '"\.+.*"'
22+
Priority: 1
23+
# Not quoted header (anything else, avoid)
24+
- Regex: '".*"'
25+
Priority: 0
726

827
...

benchmark/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
* The full license is in the file LICENSE, distributed with this software. *
1010
****************************************************************************/
1111

12+
#include "xsimd_benchmark.hpp"
13+
1214
#include <iostream>
1315
#include <map>
1416
#include <string>
1517

16-
#include "xsimd_benchmark.hpp"
17-
1818
void benchmark_operation()
1919
{
2020
// std::size_t size = 9984;

benchmark/xsimd_benchmark.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "xsimd/arch/xsimd_scalar.hpp"
1616
#include "xsimd/xsimd.hpp"
17+
1718
#include <chrono>
1819
#include <string>
1920
#include <vector>

examples/mandelbrot.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
// https://github.com/ospray/tsimd/blob/master/benchmarks/mandelbrot.cpp
1414
// Author Jefferson Amstutz / intel
1515

16+
#include "pico_bench.hpp"
17+
18+
#include <xsimd/xsimd.hpp>
19+
1620
#include <cstdio>
1721
#include <iostream>
1822
#include <string>
1923
#include <vector>
2024

21-
#include "pico_bench.hpp"
22-
23-
#include <xsimd/xsimd.hpp>
24-
2525
// helper function to write the rendered image as PPM file
2626
inline void writePPM(const std::string& fileName,
2727
const int sizeX,

include/xsimd/arch/common/xsimd_common_arithmetic.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
#ifndef XSIMD_COMMON_ARITHMETIC_HPP
1313
#define XSIMD_COMMON_ARITHMETIC_HPP
1414

15+
#include "../../types/xsimd_batch_constant.hpp"
16+
#include "./xsimd_common_details.hpp"
17+
1518
#include <complex>
1619
#include <limits>
1720
#include <type_traits>
1821

19-
#include "../../types/xsimd_batch_constant.hpp"
20-
#include "./xsimd_common_details.hpp"
21-
2222
namespace xsimd
2323
{
2424

include/xsimd/arch/common/xsimd_common_cast.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
#ifndef XSIMD_COMMON_CAST_HPP
1313
#define XSIMD_COMMON_CAST_HPP
1414

15-
#include <array>
16-
1715
#include "../../config/xsimd_macros.hpp"
1816
#include "../../utils/xsimd_type_traits.hpp"
1917

18+
#include <array>
19+
2020
namespace xsimd
2121
{
2222
namespace kernel

include/xsimd/arch/common/xsimd_common_complex.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
#ifndef XSIMD_COMMON_COMPLEX_HPP
1313
#define XSIMD_COMMON_COMPLEX_HPP
1414

15-
#include <complex>
16-
1715
#include "./xsimd_common_details.hpp"
1816

17+
#include <complex>
18+
1919
namespace xsimd
2020
{
2121

include/xsimd/arch/common/xsimd_common_details.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
#ifndef XSIMD_COMMON_DETAILS_HPP
1313
#define XSIMD_COMMON_DETAILS_HPP
1414

15-
#include <complex>
16-
1715
#include "../../math/xsimd_rem_pio2.hpp"
1816
#include "../../types/xsimd_common_arch.hpp"
1917
#include "../../types/xsimd_utils.hpp"
2018
#include "../xsimd_constants.hpp"
2119

20+
#include <complex>
21+
2222
namespace xsimd
2323
{
2424
// Forward declaration. Should we put them in a separate file?

include/xsimd/arch/common/xsimd_common_memory.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
#ifndef XSIMD_COMMON_MEMORY_HPP
1313
#define XSIMD_COMMON_MEMORY_HPP
1414

15+
#include "../../types/xsimd_batch_constant.hpp"
16+
#include "./xsimd_common_details.hpp"
17+
1518
#include <algorithm>
1619
#include <array>
1720
#include <complex>
1821

19-
#include "../../types/xsimd_batch_constant.hpp"
20-
#include "./xsimd_common_details.hpp"
21-
2222
namespace xsimd
2323
{
2424
template <typename T, class A, T... Values>

include/xsimd/arch/common/xsimd_common_swizzle.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
#ifndef XSIMD_COMMON_SWIZZLE_HPP
1313
#define XSIMD_COMMON_SWIZZLE_HPP
1414

15+
#include "../../config/xsimd_macros.hpp"
16+
1517
#include <cstddef>
1618
#include <cstdint>
1719
#include <type_traits>
1820

19-
#include "../../config/xsimd_macros.hpp"
20-
2121
namespace xsimd
2222
{
2323
template <typename T, class A, T... Values>

0 commit comments

Comments
 (0)