From 4e81a1c17dabaf915a36a19b5cc0813574bf03e2 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Mon, 23 Feb 2026 11:41:44 +0100 Subject: [PATCH] Use clang-format 21 --- include/gridtools/common/hymap.hpp | 6 ++-- include/gridtools/common/int_vector.hpp | 8 ++--- .../gridtools/common/integral_constant.hpp | 2 +- include/gridtools/common/tuple_util.hpp | 29 ++++++++++--------- include/gridtools/fn/neighbor_table.hpp | 4 +-- .../gridtools/gcl/high_level/call_generic.hpp | 4 +-- .../high_level/descriptor_generic_manual.hpp | 2 +- .../gridtools/gcl/high_level/descriptors.hpp | 24 +++++++-------- include/gridtools/meta/combine.hpp | 8 ++--- include/gridtools/meta/concat.hpp | 2 +- include/gridtools/meta/debug.hpp | 9 +++--- include/gridtools/meta/filter.hpp | 2 +- include/gridtools/meta/fold.hpp | 14 ++++----- include/gridtools/meta/group.hpp | 15 ++++------ include/gridtools/meta/internal/inherit.hpp | 2 +- include/gridtools/meta/iseq_to_list.hpp | 6 ++-- include/gridtools/meta/macros.hpp | 2 +- include/gridtools/meta/rename.hpp | 2 +- include/gridtools/meta/take.hpp | 3 +- include/gridtools/meta/transform.hpp | 6 ++-- include/gridtools/sid/allocator.hpp | 2 +- include/gridtools/sid/concept.hpp | 6 ++-- include/gridtools/sid/synthetic.hpp | 8 ++--- include/gridtools/stencil/be_api.hpp | 2 +- include/gridtools/stencil/common/caches.hpp | 2 +- include/gridtools/stencil/common/dim.hpp | 2 +- include/gridtools/stencil/core/backend.hpp | 2 +- include/gridtools/stencil/core/cache_info.hpp | 2 +- .../core/compute_extents_metafunctions.hpp | 2 +- .../stencil/core/convert_fe_to_be_spec.hpp | 2 +- include/gridtools/stencil/core/esf.hpp | 2 +- .../stencil/core/esf_metafunctions.hpp | 2 +- .../stencil/core/execution_types.hpp | 2 +- .../stencil/core/functor_metafunctions.hpp | 2 +- include/gridtools/stencil/core/grid.hpp | 2 +- include/gridtools/stencil/core/interval.hpp | 2 +- include/gridtools/stencil/core/is_tmp_arg.hpp | 2 +- include/gridtools/stencil/core/level.hpp | 2 +- include/gridtools/stencil/core/mss.hpp | 2 +- include/gridtools/stencil/core/need_sync.hpp | 2 +- include/gridtools/stencil/core/stage.hpp | 4 +-- .../gridtools/stencil/cpu_ifirst/execinfo.hpp | 2 +- .../gridtools/stencil/cpu_ifirst/loops.hpp | 2 +- include/gridtools/stencil/cpu_ifirst/pos3.hpp | 2 +- .../stencil/cpu_ifirst/tmp_storage_sid.hpp | 2 +- include/gridtools/stencil/dump.hpp | 6 ++-- .../stencil/frontend/cartesian/accessor.hpp | 2 +- .../stencil/frontend/cartesian/dimension.hpp | 2 +- .../cartesian/expressions/expr_base.hpp | 6 ++-- .../cartesian/expressions/expr_divide.hpp | 4 +-- .../cartesian/expressions/expr_minus.hpp | 4 +-- .../cartesian/expressions/expr_plus.hpp | 4 +-- .../cartesian/expressions/expr_pow.hpp | 4 +-- .../cartesian/expressions/expr_times.hpp | 4 +-- .../stencil/frontend/cartesian/stage.hpp | 2 +- .../frontend/cartesian/stencil_functions.hpp | 2 +- .../stencil/frontend/cartesian/tmp_arg.hpp | 10 +++---- .../stencil/frontend/icosahedral/accessor.hpp | 2 +- .../frontend/icosahedral/connectivity.hpp | 2 +- .../frontend/icosahedral/location_type.hpp | 2 +- .../stencil/frontend/icosahedral/stage.hpp | 2 +- .../stencil/frontend/icosahedral/tmp_arg.hpp | 21 +++++++------- include/gridtools/stencil/gpu/entry_point.hpp | 6 ++-- include/gridtools/stencil/gpu/fill_flush.hpp | 4 +-- include/gridtools/stencil/gpu/ij_cache.hpp | 2 +- include/gridtools/stencil/gpu/k_cache.hpp | 2 +- .../gridtools/stencil/gpu/launch_kernel.hpp | 2 +- .../gridtools/stencil/gpu/make_kernel_fun.hpp | 2 +- .../stencil/gpu/shared_allocator.hpp | 2 +- .../gridtools/stencil/gpu/tmp_storage_sid.hpp | 2 +- .../stencil/gpu_horizontal/j_cache.hpp | 2 +- .../stencil/gpu_horizontal/launch_kernel.hpp | 2 +- include/gridtools/storage/traits.hpp | 2 +- tests/include/reduction_select.hpp | 2 +- tests/include/stencil_select.hpp | 2 +- tests/include/test_environment.hpp | 13 ++++----- .../vertical_advection_repository.hpp | 4 ++- tests/unit_tests/common/test_stride_util.cpp | 2 +- .../fn/test_fn_sid_neighbor_table.cu | 3 +- tests/unit_tests/sid/test_sid_synthetic.cpp | 2 +- .../stencil/core/test_esf_metafunctions.cpp | 14 ++++----- .../core/test_functor_metafunctions.cpp | 4 +-- .../cartesian/test_call_interfaces.cpp | 2 +- .../cartesian/test_call_interfaces.hpp | 2 +- .../cartesian/test_call_proc_interfaces.cpp | 4 +-- .../frontend/cartesian/test_expressions.cpp | 4 +-- .../frontend/cartesian/test_expressions.cu | 2 +- .../frontend/cartesian/test_multi_types.cpp | 4 +-- .../cartesian/test_stage_with_extents.cpp | 4 +-- .../frontend/cartesian/test_stencils.cpp | 4 +-- tests/unit_tests/stencil/gpu/test_ij_cache.cu | 2 +- .../stencil/gpu/test_launch_kernel.cu | 2 +- .../stencil/gpu/test_shared_allocator.cu | 4 +-- .../stencil/gpu/test_tmp_storage_sid.cpp | 4 +-- .../stencil/gpu/test_tmp_storage_sid.cu | 2 +- .../stencil/test_global_parameter.cpp | 2 +- tests/unit_tests/stencil/test_positional.cpp | 2 +- .../storage/test_storage_facility.cpp | 3 +- .../unit_tests/storage/test_storage_info.cpp | 2 +- tests/unit_tests/test_defs.cpp | 5 ++-- tools/git_hooks/pre-commit | 4 +-- 101 files changed, 201 insertions(+), 222 deletions(-) diff --git a/include/gridtools/common/hymap.hpp b/include/gridtools/common/hymap.hpp index 6c93c6f46a..58d31f0e91 100644 --- a/include/gridtools/common/hymap.hpp +++ b/include/gridtools/common/hymap.hpp @@ -305,7 +305,7 @@ namespace gridtools { using apply = typename get_from_keys_values>::template apply; }; } // namespace impl_ - } // namespace hymap + } // namespace hymap } // namespace gridtools #define GT_FILENAME @@ -464,11 +464,11 @@ namespace gridtools { template GT_TARGET GT_FORCE_INLINE constexpr decltype(auto) source() const { - return tuple_util::GT_TARGET_NAMESPACE_NAME::get < is_primary_index::value ? 0 : 1 > (base()); + return tuple_util::GT_TARGET_NAMESPACE_NAME::get::value ? 0 : 1>(base()); } template GT_TARGET GT_FORCE_INLINE constexpr decltype(auto) source() { - return tuple_util::GT_TARGET_NAMESPACE_NAME::get < is_primary_index::value ? 0 : 1 > (base()); + return tuple_util::GT_TARGET_NAMESPACE_NAME::get::value ? 0 : 1>(base()); } template diff --git a/include/gridtools/common/int_vector.hpp b/include/gridtools/common/int_vector.hpp index c372380778..ada35aac3b 100644 --- a/include/gridtools/common/int_vector.hpp +++ b/include/gridtools/common/int_vector.hpp @@ -99,7 +99,7 @@ namespace gridtools { * The keys of the resulting `int_vector` are the union of the keys of the operands. */ template - GT_FUNCTION constexpr auto plus(Vecs && ...vecs) { + GT_FUNCTION constexpr auto plus(Vecs &&...vecs) { using merged_meta_map_t = meta::mp_make...>>; using keys_t = meta::transform; using generators = meta::transform; @@ -111,7 +111,7 @@ namespace gridtools { * @brief Returns `int_vector` with elements multiplied by an integral scalar */ template - GT_FUNCTION constexpr auto multiply(Vec && vec, Scalar scalar) { + GT_FUNCTION constexpr auto multiply(Vec &&vec, Scalar scalar) { return tuple_util::host_device::transform([scalar](auto v) { return v * scalar; }, std::forward(vec)); } @@ -119,7 +119,7 @@ namespace gridtools { * @brief Returns `int_vector` with elements removed that are `integral_constant` */ template - GT_FUNCTION constexpr auto prune_zeros(Vec && vec) { + GT_FUNCTION constexpr auto prune_zeros(Vec &&vec) { using filtered_map_t = meta::filter::apply, hymap::to_meta_map>; using keys_t = meta::transform; using generators = meta::transform; @@ -173,5 +173,5 @@ namespace gridtools { } } // namespace arithmetic - } // namespace int_vector + } // namespace int_vector } // namespace gridtools diff --git a/include/gridtools/common/integral_constant.hpp b/include/gridtools/common/integral_constant.hpp index a1a579a4d0..9c2e756a9d 100644 --- a/include/gridtools/common/integral_constant.hpp +++ b/include/gridtools/common/integral_constant.hpp @@ -165,7 +165,7 @@ namespace gridtools { template constexpr GT_FUNCTION integral_constant::value> - operator"" _c() { + operator""_c() { return {}; } } // namespace literals diff --git a/include/gridtools/common/tuple_util.hpp b/include/gridtools/common/tuple_util.hpp index 3863a8e333..099e58be2d 100644 --- a/include/gridtools/common/tuple_util.hpp +++ b/include/gridtools/common/tuple_util.hpp @@ -137,27 +137,27 @@ #define GT_STRUCT_TUPLE_IMPL_DECL_(r, data, elem) GT_PP_TUPLE_ELEM(0, elem) GT_PP_TUPLE_ELEM(1, elem); #define GT_STRUCT_TUPLE_IMPL_TYPE_(s, data, elem) GT_PP_TUPLE_ELEM(0, elem) -#define GT_STRUCT_TUPLE_IMPL_GETS_(s, name, i, elem) \ +#define GT_STRUCT_TUPLE_IMPL_GETS_(s, name, i, elem) \ template <::std::size_t I, ::std::enable_if_t = 0, class T = GT_PP_TUPLE_ELEM(0, elem)> \ - static constexpr GT_FUNCTION T const &get(name const &obj) { \ + static constexpr GT_FUNCTION T const &get(name const &obj) { \ return obj.GT_PP_TUPLE_ELEM(1, elem); \ - } \ + } \ template <::std::size_t I, ::std::enable_if_t = 0, class T = GT_PP_TUPLE_ELEM(0, elem)> \ - static constexpr GT_FUNCTION T &get(name &obj) { \ + static constexpr GT_FUNCTION T &get(name &obj) { \ return obj.GT_PP_TUPLE_ELEM(1, elem); \ - } \ + } \ template <::std::size_t I, ::std::enable_if_t = 0, class T = GT_PP_TUPLE_ELEM(0, elem)> \ - static constexpr GT_FUNCTION T &&get(name &&obj) { \ + static constexpr GT_FUNCTION T &&get(name &&obj) { \ return static_cast(obj.GT_PP_TUPLE_ELEM(1, elem)); \ } -#define GT_STRUCT_TUPLE_IMPL_(name, members) \ - GT_PP_SEQ_FOR_EACH(GT_STRUCT_TUPLE_IMPL_DECL_, _, members) \ - struct gt_##name##_tuple_getter { \ - GT_PP_SEQ_FOR_EACH_I(GT_STRUCT_TUPLE_IMPL_GETS_, name, members) \ - }; \ - friend gt_##name##_tuple_getter tuple_getter(name); \ +#define GT_STRUCT_TUPLE_IMPL_(name, members) \ + GT_PP_SEQ_FOR_EACH(GT_STRUCT_TUPLE_IMPL_DECL_, _, members) \ + struct gt_##name##_tuple_getter { \ + GT_PP_SEQ_FOR_EACH_I(GT_STRUCT_TUPLE_IMPL_GETS_, name, members) \ + }; \ + friend gt_##name##_tuple_getter tuple_getter(name); \ friend ::gridtools::meta::list \ - tuple_to_types(name); \ + tuple_to_types(name); \ friend ::gridtools::meta::always tuple_from_types(name) /* @@ -466,7 +466,8 @@ namespace gridtools { concept tuple_like = is_tuple_like::value; template - concept tuple_like_of = tuple_like && + concept tuple_like_of = + tuple_like && std::is_same_v>, meta::list>; } // namespace concepts #endif diff --git a/include/gridtools/fn/neighbor_table.hpp b/include/gridtools/fn/neighbor_table.hpp index 682505b5ad..da360700f5 100644 --- a/include/gridtools/fn/neighbor_table.hpp +++ b/include/gridtools/fn/neighbor_table.hpp @@ -61,8 +61,8 @@ namespace gridtools::fn::neighbor_table { } template - GT_FUNCTION constexpr auto neighbors( - NeighborTable const &nt, int index) -> decltype(neighbor_table_neighbors(nt, index)) { + GT_FUNCTION constexpr auto neighbors(NeighborTable const &nt, int index) + -> decltype(neighbor_table_neighbors(nt, index)) { return neighbor_table_neighbors(nt, index); } diff --git a/include/gridtools/gcl/high_level/call_generic.hpp b/include/gridtools/gcl/high_level/call_generic.hpp index 6f2ecce04f..30d9a6aceb 100644 --- a/include/gridtools/gcl/high_level/call_generic.hpp +++ b/include/gridtools/gcl/high_level/call_generic.hpp @@ -37,8 +37,8 @@ template void GCL_PACK_F_NAME(GCL_KERNEL_TYPE)( - GT_PP_ENUM_BINARY_PARAMS(GCL_NOI, FOTF_T, const &field), void **d_msgbufTab, const int *d_msgsize) { - // GCL_PRINT_FIELDS(GCL_NOI); + GT_PP_ENUM_BINARY_PARAMS(GCL_NOI, FOTF_T, const &field), void **d_msgbufTab, const int *d_msgsize){ +// GCL_PRINT_FIELDS(GCL_NOI); #define GCL_QUOTE(x) #x #define _GCL_QUOTE(x) GCL_QUOTE(x) diff --git a/include/gridtools/gcl/high_level/descriptor_generic_manual.hpp b/include/gridtools/gcl/high_level/descriptor_generic_manual.hpp index 60113aec0f..2d5c9f88dd 100644 --- a/include/gridtools/gcl/high_level/descriptor_generic_manual.hpp +++ b/include/gridtools/gcl/high_level/descriptor_generic_manual.hpp @@ -794,5 +794,5 @@ namespace gridtools { #include "non_vect_interface.hpp" }; #endif // cudacc - } // namespace gcl + } // namespace gcl } // namespace gridtools diff --git a/include/gridtools/gcl/high_level/descriptors.hpp b/include/gridtools/gcl/high_level/descriptors.hpp index 68bf8f230f..8d7bed86e6 100644 --- a/include/gridtools/gcl/high_level/descriptors.hpp +++ b/include/gridtools/gcl/high_level/descriptors.hpp @@ -60,12 +60,12 @@ namespace gridtools { template void pack(array const &eta, iterator_in const *field_ptr, iterator_out *&it) const { for (int k = halos[2].loop_low_bound_inside(eta[2]); k <= halos[2].loop_high_bound_inside(eta[2]); - ++k) { + ++k) { for (int j = halos[1].loop_low_bound_inside(eta[1]); j <= halos[1].loop_high_bound_inside(eta[1]); - ++j) { + ++j) { for (int i = halos[0].loop_low_bound_inside(eta[0]); - i <= halos[0].loop_high_bound_inside(eta[0]); - ++i) { + i <= halos[0].loop_high_bound_inside(eta[0]); + ++i) { *(reinterpret_cast(it)) = field_ptr[access(i, j, k, halos[0].total_length(), halos[1].total_length())]; reinterpret_cast(it) += sizeof(iterator_in); @@ -77,12 +77,12 @@ namespace gridtools { template void unpack(array const &eta, iterator_in *field_ptr, iterator_out *&it) const { for (int k = halos[2].loop_low_bound_outside(eta[2]); k <= halos[2].loop_high_bound_outside(eta[2]); - ++k) { + ++k) { for (int j = halos[1].loop_low_bound_outside(eta[1]); j <= halos[1].loop_high_bound_outside(eta[1]); - ++j) { + ++j) { for (int i = halos[0].loop_low_bound_outside(eta[0]); - i <= halos[0].loop_high_bound_outside(eta[0]); - ++i) { + i <= halos[0].loop_high_bound_outside(eta[0]); + ++i) { field_ptr[access(i, j, k, halos[0].total_length(), halos[1].total_length())] = *(reinterpret_cast(it)); reinterpret_cast(it) += sizeof(iterator_in); @@ -420,8 +420,8 @@ namespace gridtools { \param[in] _pid Integer identifier of the process calling the constructor */ explicit hndlr_dynamic_ut(typename grid_type::period_type const &c, int _P, int _pid) - : halo(), base_type::m_haloexch(grid_type(c, _P, _pid)), send_buffer{nullptr}, - recv_buffer{nullptr}, send_size{0}, recv_size{0} {} + : halo(), base_type::m_haloexch(grid_type(c, _P, _pid)), send_buffer{nullptr}, recv_buffer{nullptr}, + send_size{0}, recv_size{0} {} /** Constructor @@ -429,8 +429,8 @@ namespace gridtools { \param[in] g A processor grid that will execute the pattern */ explicit hndlr_dynamic_ut(grid_type const &g) - : halo(), base_type::m_haloexch(g), send_buffer{nullptr}, recv_buffer{nullptr}, send_size{0}, recv_size{ - 0} {} + : halo(), base_type::m_haloexch(g), send_buffer{nullptr}, recv_buffer{nullptr}, send_size{0}, + recv_size{0} {} /** Function to setup internal data structures for data exchange and preparing eventual underlying layers diff --git a/include/gridtools/meta/combine.hpp b/include/gridtools/meta/combine.hpp index 9c22c73b25..580a91a6ff 100644 --- a/include/gridtools/meta/combine.hpp +++ b/include/gridtools/meta/combine.hpp @@ -53,8 +53,7 @@ namespace gridtools { using type = F; }; template