/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/library/utility/numeric.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/library/utility/numeric.hpp Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/library/utility/numeric.hpp Source File
numeric.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
2 // Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
3 
4 #pragma once
5 
6 #include <iterator>
7 #include <numeric>
8 
9 namespace ck {
10 template <typename T, typename ForwardIterator, typename Size, typename BinaryOperation>
11 auto accumulate_n(ForwardIterator first, Size count, T init, BinaryOperation op)
12  -> decltype(std::accumulate(first, std::next(first, count), init, op))
13 {
14  return std::accumulate(first, std::next(first, count), init, op);
15 }
16 } // namespace ck
Definition: ck.hpp:267
auto accumulate_n(ForwardIterator first, Size count, T init, BinaryOperation op) -> decltype(std::accumulate(first, std::next(first, count), init, op))
Definition: numeric.hpp:11