diff --git a/include/gridtools/sid/easy_composite.hpp b/include/gridtools/sid/easy_composite.hpp new file mode 100644 index 0000000000..fa13b39b99 --- /dev/null +++ b/include/gridtools/sid/easy_composite.hpp @@ -0,0 +1,261 @@ +/* + * GridTools + * + * Copyright (c) 2014-2019, ETH Zurich + * All rights reserved. + * + * Please, refer to the LICENSE file in the root directory. + * SPDX-License-Identifier: BSD-3-Clause + */ +#pragma once + +/** + * The clone of the sid composite that does not do strides compression. + * The implementation doesn't depend on stride kinds. + */ + +#include +#include +#include + +#include "../common/defs.hpp" +#include "../common/for_each.hpp" +#include "../common/host_device.hpp" +#include "../common/hymap.hpp" +#include "../common/tuple.hpp" +#include "../common/tuple_util.hpp" +#include "../common/utility.hpp" +#include "../meta.hpp" +#include "concept.hpp" + +namespace gridtools { + namespace sid { + namespace easy_composite { + namespace impl_ { + template + GT_FUNCTION void composite_shift_impl(ObjTup &obj_tup, StrideTup &&stride_tup, Offset offset) { + tuple_util::host_device::for_each( + [offset](auto &obj, auto &&stride) + GT_FORCE_INLINE_LAMBDA { shift(obj, wstd::forward(stride), offset); }, + obj_tup, + wstd::forward(stride_tup)); + } + + template , Key>> + using normalized_stride_type = + typename std::conditional_t<(I::value < tuple_util::size::value), + tuple_util::lazy::element, + meta::lazy::id>::type; + + template + struct normalize_strides_f; + + template