Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/gridtools/common/hymap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ namespace gridtools {
using apply = typename get_from_keys_values<meta::first<Maps>>::template apply<Keys, Values>;
};
} // namespace impl_
} // namespace hymap
} // namespace hymap
} // namespace gridtools

#define GT_FILENAME <gridtools/common/hymap.hpp>
Expand Down Expand Up @@ -464,11 +464,11 @@ namespace gridtools {

template <size_t I>
GT_TARGET GT_FORCE_INLINE constexpr decltype(auto) source() const {
return tuple_util::GT_TARGET_NAMESPACE_NAME::get < is_primary_index<I>::value ? 0 : 1 > (base());
return tuple_util::GT_TARGET_NAMESPACE_NAME::get<is_primary_index<I>::value ? 0 : 1>(base());
}
template <size_t I>
GT_TARGET GT_FORCE_INLINE constexpr decltype(auto) source() {
return tuple_util::GT_TARGET_NAMESPACE_NAME::get < is_primary_index<I>::value ? 0 : 1 > (base());
return tuple_util::GT_TARGET_NAMESPACE_NAME::get<is_primary_index<I>::value ? 0 : 1>(base());
}

template <size_t I>
Expand Down
8 changes: 4 additions & 4 deletions include/gridtools/common/int_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace gridtools {
* The keys of the resulting `int_vector` are the union of the keys of the operands.
*/
template <class... Vecs>
GT_FUNCTION constexpr auto plus(Vecs && ...vecs) {
GT_FUNCTION constexpr auto plus(Vecs &&...vecs) {
using merged_meta_map_t = meta::mp_make<impl_::merger_t, meta::concat<hymap::to_meta_map<Vecs>...>>;
using keys_t = meta::transform<meta::first, merged_meta_map_t>;
using generators = meta::transform<impl_::add_f, keys_t>;
Expand All @@ -111,15 +111,15 @@ namespace gridtools {
* @brief Returns `int_vector` with elements multiplied by an integral scalar
*/
template <class Vec, class Scalar>
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>(vec));
}

/**
* @brief Returns `int_vector` with elements removed that are `integral_constant<T, 0>`
*/
template <class Vec>
GT_FUNCTION constexpr auto prune_zeros(Vec && vec) {
GT_FUNCTION constexpr auto prune_zeros(Vec &&vec) {
using filtered_map_t = meta::filter<meta::not_<impl_::is_constant_zero>::apply, hymap::to_meta_map<Vec>>;
using keys_t = meta::transform<meta::first, filtered_map_t>;
using generators = meta::transform<impl_::at_key_f, keys_t>;
Expand Down Expand Up @@ -173,5 +173,5 @@ namespace gridtools {
}

} // namespace arithmetic
} // namespace int_vector
} // namespace int_vector
} // namespace gridtools
2 changes: 1 addition & 1 deletion include/gridtools/common/integral_constant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace gridtools {

template <char... Chars>
constexpr GT_FUNCTION integral_constant<literals_impl_::literal_int_t, literals_impl_::parser<Chars...>::value>
operator"" _c() {
operator""_c() {
return {};
}
} // namespace literals
Expand Down
29 changes: 15 additions & 14 deletions include/gridtools/common/tuple_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<I == i, int> = 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<I == i, int> = 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<I == i, int> = 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<T &&>(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<GT_PP_SEQ_ENUM(GT_PP_SEQ_TRANSFORM(GT_STRUCT_TUPLE_IMPL_TYPE_, _, members))> \
tuple_to_types(name); \
tuple_to_types(name); \
friend ::gridtools::meta::always<name> tuple_from_types(name)

/*
Expand Down Expand Up @@ -466,7 +466,8 @@ namespace gridtools {
concept tuple_like = is_tuple_like<T>::value;

template <class T, class... Ts>
concept tuple_like_of = tuple_like<T> &&
concept tuple_like_of =
tuple_like<T> &&
std::is_same_v<meta::rename<meta::list, tuple_util::traits::to_types<T>>, meta::list<Ts...>>;
} // namespace concepts
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/gridtools/fn/neighbor_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ namespace gridtools::fn::neighbor_table {
}

template <class NeighborTable>
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);
}

Expand Down
4 changes: 2 additions & 2 deletions include/gridtools/gcl/high_level/call_generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

template <GT_PP_ENUM_PARAMS(GCL_NOI, typename FOTF_T)>
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,5 +794,5 @@ namespace gridtools {
#include "non_vect_interface.hpp"
};
#endif // cudacc
} // namespace gcl
} // namespace gcl
} // namespace gridtools
24 changes: 12 additions & 12 deletions include/gridtools/gcl/high_level/descriptors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ namespace gridtools {
template <typename iterator_in, typename iterator_out>
void pack(array<int, 3> 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<iterator_in *>(it)) =
field_ptr[access(i, j, k, halos[0].total_length(), halos[1].total_length())];
reinterpret_cast<char *&>(it) += sizeof(iterator_in);
Expand All @@ -77,12 +77,12 @@ namespace gridtools {
template <typename iterator_in, typename iterator_out>
void unpack(array<int, 3> 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<iterator_in *>(it));
reinterpret_cast<char *&>(it) += sizeof(iterator_in);
Expand Down Expand Up @@ -420,17 +420,17 @@ 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

\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
Expand Down
8 changes: 3 additions & 5 deletions include/gridtools/meta/combine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ namespace gridtools {
using type = F<T1, T2>;
};
template <template <class...> class F,
template <class...>
class L,
template <class...> class L,
class T1,
class T2,
class T3,
Expand All @@ -63,8 +62,7 @@ namespace gridtools {
using type = F<T1, F<T2, T3>>;
};
template <template <class...> class F,
template <class...>
class L,
template <class...> class L,
class T1,
class T2,
class T3,
Expand All @@ -80,5 +78,5 @@ namespace gridtools {
template <template <class...> class F, class List>
struct combine<F, List> : combine_impl<F, List, length<List>::value> {};
} // namespace lazy
} // namespace meta
} // namespace meta
} // namespace gridtools
2 changes: 1 addition & 1 deletion include/gridtools/meta/concat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ namespace gridtools {
template <class List, class... Lists>
struct concat<List, Lists...> : foldl<meta::concat, List, list<Lists...>> {};
} // namespace lazy
} // namespace meta
} // namespace meta
} // namespace gridtools
9 changes: 4 additions & 5 deletions include/gridtools/meta/debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
* Works also with parameter packs. I.e you can both `GT_META_PRINT_VALUE(SomeValue)` and
* `GT_META_PRINT_VALUE(SomeValues...)`
*/
#define GT_META_PRINT_VALUE(x) \
static_assert( \
::gridtools::meta::debug::value<decltype(::gridtools::meta::debug::first(GT_PP_REMOVE_PARENS(x))), \
GT_PP_REMOVE_PARENS(x)>::_)
#define GT_META_PRINT_VALUE(x) \
static_assert(::gridtools::meta::debug::value<decltype(::gridtools::meta::debug::first(GT_PP_REMOVE_PARENS(x))), \
GT_PP_REMOVE_PARENS(x)>::_)

namespace gridtools {
namespace meta {
Expand All @@ -43,5 +42,5 @@ namespace gridtools {
template <class T, T...>
struct value {};
} // namespace debug
} // namespace meta
} // namespace meta
} // namespace gridtools
2 changes: 1 addition & 1 deletion include/gridtools/meta/filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ namespace gridtools {
struct filter<Pred, L<Ts...>> : concat<L<>, typename wrap_if_impl<Pred<Ts>::type::value, L, Ts>::type...> {
};
} // namespace lazy
} // namespace meta
} // namespace meta
} // namespace gridtools
14 changes: 5 additions & 9 deletions include/gridtools/meta/fold.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ namespace gridtools {
};
template <template <class...> class F,
class S,
template <class...>
class L,
template <class...> class L,
class T1,
class T2,
class T3,
Expand Down Expand Up @@ -83,8 +82,7 @@ namespace gridtools {
};
template <template <class...> class F,
class S,
template <class...>
class L,
template <class...> class L,
class T1,
class T2,
class T3,
Expand All @@ -111,8 +109,7 @@ namespace gridtools {

template <template <class...> class F,
class S,
template <class...>
class L,
template <class...> class L,
class T1,
class T2,
class T3,
Expand All @@ -126,8 +123,7 @@ namespace gridtools {

template <template <class...> class F,
class S,
template <class...>
class L,
template <class...> class L,
class T1,
class T2,
class T3,
Expand All @@ -145,5 +141,5 @@ namespace gridtools {
T1>;
};
} // namespace lazy
} // namespace meta
} // namespace meta
} // namespace gridtools
15 changes: 5 additions & 10 deletions include/gridtools/meta/group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,24 @@ namespace gridtools {
struct continue_grouping_impl<Pred, L<T, Ts...>, meta::list<Us...>> : Pred<T, Us...> {};

template <template <class...> class Pred,
template <class...>
class F,
template <class...> class F,
class List,
class Group,
bool = continue_grouping_impl<Pred, List, Group>::value>
struct group_helper : push_front<typename group<Pred, F, List>::type, meta::rename<F, Group>> {};

template <template <class...> class Pred,
template <class...>
class F,
template <class...>
class L,
template <class...> class F,
template <class...> class L,
class T,
class... Ts,
class Group>
struct group_helper<Pred, F, L<T, Ts...>, Group, true>
: group_helper<Pred, F, L<Ts...>, typename push_back<Group, T>::type> {};

template <template <class...> class Pred,
template <class...>
class F,
template <class...>
class L,
template <class...> class F,
template <class...> class L,
class T,
class... Ts>
struct group<Pred, F, L<T, Ts...>> : group_helper<Pred, F, L<Ts...>, list<T>> {};
Expand Down
2 changes: 1 addition & 1 deletion include/gridtools/meta/internal/inherit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ namespace gridtools {
template <class... Ts>
struct inherit : Ts... {};
} // namespace internal
} // namespace meta
} // namespace meta
} // namespace gridtools
6 changes: 2 additions & 4 deletions include/gridtools/meta/iseq_to_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ namespace gridtools {
template <template <class T, T...> class ISec,
class Int,
Int... Is,
template <class...>
class L,
template <class T, T>
class C>
template <class...> class L,
template <class T, T> class C>
struct iseq_to_list<ISec<Int, Is...>, L, C> {
using type = L<C<Int, Is>...>;
};
Expand Down
2 changes: 1 addition & 1 deletion include/gridtools/meta/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <gridtools/preprocessor/punctuation/remove_parens.hpp>

#define GT_META_DELEGATE_TO_LAZY(fun, signature, args) \
template <GT_PP_REMOVE_PARENS(signature)> \
template <GT_PP_REMOVE_PARENS(signature)> \
using fun = typename lazy::fun<GT_PP_REMOVE_PARENS(args)>::type

/**
Expand Down
2 changes: 1 addition & 1 deletion include/gridtools/meta/rename.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ namespace gridtools {
using type = curry_fun<meta::rename, To>;
};
} // namespace lazy
} // namespace meta
} // namespace meta
} // namespace gridtools
3 changes: 1 addition & 2 deletions include/gridtools/meta/take.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ namespace gridtools {
};

template <size_t N,
template <class...>
class L,
template <class...> class L,
class T0,
class T1,
class T2,
Expand Down
Loading
Loading