Skip to content

Commit f8c1a03

Browse files
Merge pull request #629 from xtensor-stack/feature/clang-format
Feature/clang format
2 parents a3a2b8e + aa1d91a commit f8c1a03

File tree

101 files changed

+13751
-11995
lines changed

Some content is hidden

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

101 files changed

+13751
-11995
lines changed

.clang-format

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
BasedOnStyle: WebKit
3+
AlignAfterOpenBracket: Align
4+
AlignConsecutiveDeclarations: 'false'
5+
BreakBeforeBraces: Allman
6+
NamespaceIndentation: All
7+
8+
...
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: clang-format
2+
on: [push, pull_request]
3+
jobs:
4+
formatting-check:
5+
name: Format check
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Run clang-format style check for C/C++ programs.
10+
uses: jidicula/[email protected]
11+
with:
12+
clang-format-version: '13'

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to xsimd
2+
3+
First, thanks for being there! Welcome on board, we will try to make your
4+
contributing journey as good an experience as it can be.
5+
6+
# Submitting patches
7+
8+
Patches should be submitted through Github PR. We di put some effort to setup a
9+
decent Continuous Integration coverage, please try to make it green ;-)
10+
11+
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to keep
12+
the coding style consistent, a ``.clang-format`` file is shipped within the
13+
source, feel free to use it!
14+
15+
# Extending the API
16+
17+
We are open to extending the API, as long as it has been discussed either in an
18+
Issue or a PR. The only constraint is to add testing for new functions, and make
19+
sure they work on all supported architectures, not only your favorite one!
20+
21+
# Licensing
22+
23+
We use a shared copyright model that enables all contributors to maintain the
24+
copyright on their contributions. Stated otherwise, there's no copyright
25+
assignment.

benchmark/main.cpp

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
/***************************************************************************
2-
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3-
* Martin Renou *
4-
* Copyright (c) QuantStack *
5-
* Copyright (c) Serge Guelton *
6-
* *
7-
* Distributed under the terms of the BSD 3-Clause License. *
8-
* *
9-
* The full license is in the file LICENSE, distributed with this software. *
10-
****************************************************************************/
2+
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3+
* Martin Renou *
4+
* Copyright (c) QuantStack *
5+
* Copyright (c) Serge Guelton *
6+
* *
7+
* Distributed under the terms of the BSD 3-Clause License. *
8+
* *
9+
* The full license is in the file LICENSE, distributed with this software. *
10+
****************************************************************************/
1111

1212
#include "xsimd_benchmark.hpp"
1313
#include <map>
1414

1515
void benchmark_operation()
1616
{
17-
//std::size_t size = 9984;
17+
// std::size_t size = 9984;
1818
std::size_t size = 20000;
1919
xsimd::run_benchmark_2op(xsimd::add_fn(), std::cout, size, 1000);
2020
xsimd::run_benchmark_2op(xsimd::sub_fn(), std::cout, size, 1000);
@@ -111,16 +111,16 @@ void benchmark_basic_math()
111111

112112
int main(int argc, char* argv[])
113113
{
114-
const std::map<std::string, std::pair<std::string, void(*)()>> fn_map = {
115-
{"op", {"arithmetic", benchmark_operation}},
116-
{"exp", {"exponential and logarithm", benchmark_exp_log}},
117-
{"trigo", {"trigonometric", benchmark_trigo}},
118-
{"hyperbolic", {"hyperbolic", benchmark_hyperbolic}},
119-
{"power", {"power", benchmark_power}},
120-
{"basic_math", {"basic math", benchmark_basic_math}},
121-
{"rounding", {"rounding", benchmark_rounding}},
114+
const std::map<std::string, std::pair<std::string, void (*)()>> fn_map = {
115+
{ "op", { "arithmetic", benchmark_operation } },
116+
{ "exp", { "exponential and logarithm", benchmark_exp_log } },
117+
{ "trigo", { "trigonometric", benchmark_trigo } },
118+
{ "hyperbolic", { "hyperbolic", benchmark_hyperbolic } },
119+
{ "power", { "power", benchmark_power } },
120+
{ "basic_math", { "basic math", benchmark_basic_math } },
121+
{ "rounding", { "rounding", benchmark_rounding } },
122122
#ifdef XSIMD_POLY_BENCHMARKS
123-
{"utils", {"polynomial evaluation", benchmark_poly_evaluation}},
123+
{ "utils", { "polynomial evaluation", benchmark_poly_evaluation } },
124124
#endif
125125
};
126126

@@ -129,7 +129,7 @@ int main(int argc, char* argv[])
129129
if (std::string(argv[1]) == "--help" || std::string(argv[1]) == "-h")
130130
{
131131
std::cout << "Available options:" << std::endl;
132-
for(auto const& kv : fn_map)
132+
for (auto const& kv : fn_map)
133133
{
134134
std::cout << kv.first << ": run benchmark on " << kv.second.first << " functions" << std::endl;
135135
}
@@ -144,7 +144,7 @@ int main(int argc, char* argv[])
144144
}
145145
else
146146
{
147-
for(auto const& kv : fn_map)
147+
for (auto const& kv : fn_map)
148148
{
149149
kv.second.second();
150150
}

0 commit comments

Comments
 (0)