Skip to content

Commit 5c0f1ea

Browse files
Merge pull request #1111 from paulgessinger/clang-format
chore: Update clang-format to v18.1.8
1 parent 891c9bb commit 5c0f1ea

File tree

22 files changed

+134
-134
lines changed

22 files changed

+134
-134
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/mirrors-clang-format
3-
rev: v10.0.1
3+
rev: v18.1.8
44
hooks:
55
- id: clang-format
66
types_or: [file]

core/include/traccc/edm/details/container_base.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ class container_base {
138138
* @brief Constructor from a pair of "view type" objects
139139
*/
140140
template <typename header_vector_tp, typename item_vector_tp>
141-
requires(std::constructible_from<header_vector, const header_vector_tp&>&&
141+
requires(std::constructible_from<header_vector,
142+
const header_vector_tp&> &&
142143
std::constructible_from<item_vector, const item_vector_tp&>)
143-
TRACCC_HOST_DEVICE
144-
container_base(const header_vector_tp& hv, const item_vector_tp& iv)
144+
TRACCC_HOST_DEVICE container_base(const header_vector_tp& hv,
145+
const item_vector_tp& iv)
145146
: m_headers(hv), m_items(iv) {
146147

147148
assert(m_headers.size() == m_items.size());

core/include/traccc/sanity/contiguous_on.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ namespace traccc::host {
3636
* @return false Otherwise.
3737
*/
3838
template <std::semiregular P, typename CONTAINER>
39-
requires std::regular_invocable<P,
40-
decltype(std::declval<CONTAINER>().at(0))> bool
41-
is_contiguous_on(P&& projection, const CONTAINER& in) {
39+
requires std::regular_invocable<P,
40+
decltype(std::declval<CONTAINER>().at(0))>
41+
bool is_contiguous_on(P&& projection, const CONTAINER& in) {
4242

4343
// Grab the number of elements in our container.
4444
typename CONTAINER::size_type n = in.size();

core/include/traccc/sanity/ordered_on.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ namespace traccc::host {
4343
* @return false Otherwise.
4444
*/
4545
template <std::semiregular R, typename CONTAINER>
46-
requires std::regular_invocable<R, decltype(std::declval<CONTAINER>().at(0)),
47-
decltype(std::declval<CONTAINER>().at(0))> bool
48-
is_ordered_on(R&& relation, const CONTAINER& in) {
46+
requires std::regular_invocable<R,
47+
decltype(std::declval<CONTAINER>().at(0)),
48+
decltype(std::declval<CONTAINER>().at(0))>
49+
bool is_ordered_on(R&& relation, const CONTAINER& in) {
4950

5051
// Grab the number of elements in our vector.
5152
typename CONTAINER::size_type n = in.size();

core/include/traccc/utils/array_wrapper.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,12 @@ struct aos {
205205
constexpr std::size_t size() const { return _size; }
206206

207207
constexpr const vecmem::unique_alloc_ptr<pod<Ts...>[]>& pointer()
208-
const { return _ptr; }
208+
const {
209+
return _ptr;
210+
}
209211

210-
private : std::size_t _size;
212+
private:
213+
std::size_t _size;
211214
vecmem::unique_alloc_ptr<pod<Ts...>[]> _ptr;
212215
};
213216

core/include/traccc/utils/projections.hpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@
1515

1616
namespace traccc {
1717

18-
struct [[maybe_unused]] cell_module_projection{
19-
template <typename T> TRACCC_HOST_DEVICE auto operator()(
20-
const edm::silicon_cell<T>& c) const {return c.module_index();
21-
}
22-
}
23-
;
18+
struct [[maybe_unused]] cell_module_projection {
19+
template <typename T>
20+
TRACCC_HOST_DEVICE auto operator()(const edm::silicon_cell<T>& c) const {
21+
return c.module_index();
22+
}
23+
};
2424

25-
struct [[maybe_unused]] measurement_module_projection{
26-
TRACCC_HOST_DEVICE auto operator()(const traccc::measurement& m)
27-
const {return m.surface_link;
28-
}
29-
}
30-
;
25+
struct [[maybe_unused]] measurement_module_projection {
26+
TRACCC_HOST_DEVICE auto operator()(const traccc::measurement& m) const {
27+
return m.surface_link;
28+
}
29+
};
3130
} // namespace traccc

core/include/traccc/utils/relations.hpp

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,19 @@
1313
#include "traccc/edm/silicon_cell_collection.hpp"
1414

1515
namespace traccc {
16-
struct [[maybe_unused]] channel0_major_cell_order_relation{
17-
template <typename T1, typename T2>[[maybe_unused]] TRACCC_HOST_DEVICE bool
18-
operator()(const edm::silicon_cell<T1>& a, const edm::silicon_cell<T2>& b)
19-
const {if (a.module_index() ==
20-
b.module_index()){if (a.channel1() == b.channel1()){
21-
return a.channel0() <= b.channel0();
22-
}
23-
else {
24-
return a.channel1() <= b.channel1();
25-
}
26-
}
27-
else {
28-
return true;
29-
}
30-
}
31-
}
32-
;
16+
struct [[maybe_unused]] channel0_major_cell_order_relation {
17+
template <typename T1, typename T2>
18+
[[maybe_unused]] TRACCC_HOST_DEVICE bool operator()(
19+
const edm::silicon_cell<T1>& a, const edm::silicon_cell<T2>& b) const {
20+
if (a.module_index() == b.module_index()) {
21+
if (a.channel1() == b.channel1()) {
22+
return a.channel0() <= b.channel0();
23+
} else {
24+
return a.channel1() <= b.channel1();
25+
}
26+
} else {
27+
return true;
28+
}
29+
}
30+
};
3331
} // namespace traccc

core/include/traccc/utils/tuple.hpp

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,61 +22,63 @@ struct tuple<T, Ts...> {
2222

2323
TRACCC_HOST_DEVICE constexpr tuple(){};
2424

25-
constexpr tuple(const tuple &o) requires(
26-
std::is_copy_constructible_v<T> &&
27-
(std::is_copy_constructible_v<Ts> && ...)) = default;
25+
constexpr tuple(const tuple &o)
26+
requires(std::is_copy_constructible_v<T> &&
27+
(std::is_copy_constructible_v<Ts> && ...))
28+
= default;
2829

2930
template <typename U, typename... Us>
30-
requires std::is_constructible_v<T, U &&>
31-
&&std::is_constructible_v<tuple<Ts...>, Us &&...>
32-
TRACCC_HOST_DEVICE explicit constexpr tuple(
33-
const tuple<U, Us...> &o)
31+
requires std::is_constructible_v<T, U &&> &&
32+
std::is_constructible_v<tuple<Ts...>, Us &&...>
33+
TRACCC_HOST_DEVICE explicit constexpr tuple(const tuple<U, Us...> &o)
3434
: v(o.v), r(o.r) {}
3535

3636
constexpr tuple(tuple &&o) noexcept
3737
requires(std::is_move_constructible_v<T> &&
38-
(std::is_move_constructible_v<Ts> && ...)) = default;
38+
(std::is_move_constructible_v<Ts> && ...))
39+
= default;
3940

4041
template <typename U, typename... Us>
41-
requires std::is_constructible_v<T, U &&>
42-
&&std::is_constructible_v<tuple<Ts...>, Us &&...>
43-
TRACCC_HOST_DEVICE explicit constexpr tuple(tuple<U, Us...> &&o)
42+
requires std::is_constructible_v<T, U &&> &&
43+
std::is_constructible_v<tuple<Ts...>, Us &&...>
44+
TRACCC_HOST_DEVICE explicit constexpr tuple(tuple<U, Us...> &&o)
4445
: v(std::move(o.v)), r(std::move(o.r)) {}
4546

4647
template <typename U, typename... Us>
47-
requires std::is_constructible_v<T, U &&>
48-
&&std::is_constructible_v<tuple<Ts...>, Us &&...> &&
49-
(!(std::is_same_v<tuple, U> ||
50-
(std::is_same_v<tuple, Us> || ...))) TRACCC_HOST_DEVICE
51-
explicit constexpr tuple(U &&_v, Us &&... _r)
52-
: v(std::forward<U>(_v)),
53-
r(std::forward<Us>(_r)...) {}
48+
requires std::is_constructible_v<T, U &&> &&
49+
std::is_constructible_v<tuple<Ts...>, Us &&...> &&
50+
(!(std::is_same_v<tuple, U> ||
51+
(std::is_same_v<tuple, Us> || ...)))
52+
TRACCC_HOST_DEVICE explicit constexpr tuple(U &&_v, Us &&..._r)
53+
: v(std::forward<U>(_v)), r(std::forward<Us>(_r)...) {}
5454

5555
constexpr ~tuple() noexcept = default;
5656

57-
constexpr tuple &operator=(const tuple &other) requires(
58-
std::is_copy_assignable_v<T> &&
59-
(std::is_copy_assignable_v<Ts> && ...)) = default;
57+
constexpr tuple &operator=(const tuple &other)
58+
requires(std::is_copy_assignable_v<T> &&
59+
(std::is_copy_assignable_v<Ts> && ...))
60+
= default;
6061

6162
template <typename U, typename... Us>
62-
TRACCC_HOST_DEVICE constexpr tuple &
63-
operator=(const tuple<U, Us...> &other) requires(
64-
std::is_assignable_v<T &, const U &> &&
65-
(std::is_assignable_v<Ts &, const Us &> && ...)) {
63+
TRACCC_HOST_DEVICE constexpr tuple &operator=(const tuple<U, Us...> &other)
64+
requires(std::is_assignable_v<T &, const U &> &&
65+
(std::is_assignable_v<Ts &, const Us &> && ...))
66+
{
6667
v = other.v;
6768
r = other.r;
6869
return *this;
6970
}
7071

7172
constexpr tuple &operator=(tuple &&other) noexcept
7273
requires(std::is_move_assignable_v<T> &&
73-
(std::is_move_assignable_v<Ts> && ...)) = default;
74+
(std::is_move_assignable_v<Ts> && ...))
75+
= default;
7476

7577
template <typename U, typename... Us>
76-
TRACCC_HOST_DEVICE constexpr tuple &operator=(
77-
tuple<U, Us...> &&other) requires(std::is_assignable_v<T &, U> &&
78-
(std::is_assignable_v<Ts &, Us> &&
79-
...)) {
78+
TRACCC_HOST_DEVICE constexpr tuple &operator=(tuple<U, Us...> &&other)
79+
requires(std::is_assignable_v<T &, U> &&
80+
(std::is_assignable_v<Ts &, Us> && ...))
81+
{
8082
v = std::move(other.v);
8183
r = std::move(other.r);
8284
return *this;

device/alpaka/src/utils/barrier.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace traccc::alpaka {
1818
template <typename TAcc>
1919
struct barrier {
2020

21-
ALPAKA_FN_INLINE ALPAKA_FN_ACC barrier(const TAcc* acc) : m_acc(acc){};
21+
ALPAKA_FN_INLINE ALPAKA_FN_ACC barrier(const TAcc* acc) : m_acc(acc) {};
2222

2323
ALPAKA_FN_ACC
2424
void blockBarrier() const { ::alpaka::syncBlockThreads(*m_acc); }

device/common/include/traccc/device/concepts/barrier.hpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ concept barrier = requires(T& b) {
2323
* Check for the general, nulary barrier function which simply synchronizes
2424
* threads without return value.
2525
*/
26-
{ b.blockBarrier() }
27-
->std::same_as<void>;
26+
{ b.blockBarrier() } -> std::same_as<void>;
2827

2928
/*
3029
* Check for the unary boolean-argument synchronization functions.
@@ -34,22 +33,19 @@ concept barrier = requires(T& b) {
3433
* `blockOr` should return true iff one or more of the threads in the
3534
* block issues the call with a truthful argument.
3635
*/
37-
{ b.blockOr(p) }
38-
->std::same_as<bool>;
36+
{ b.blockOr(p) } -> std::same_as<bool>;
3937

4038
/*
4139
* `blockAnd` should return true iff all of the threads in the block
4240
* issue the call with a truthful argument.
4341
*/
44-
{ b.blockAnd(p) }
45-
->std::same_as<bool>;
42+
{ b.blockAnd(p) } -> std::same_as<bool>;
4643

4744
/*
4845
* `blockCount` should return the number of threads subject to the
4946
* barrier that issued the call with a truthful argument.
5047
*/
51-
{ b.blockCount(p) }
52-
->std::integral;
48+
{ b.blockCount(p) } -> std::integral;
5349
};
5450
};
5551
} // namespace traccc::device::concepts

0 commit comments

Comments
 (0)