numeric.hpp Source File

numeric.hpp Source File#

Composable Kernel: numeric.hpp Source File
library/utility/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
9namespace ck {
10template <typename T, typename ForwardIterator, typename Size, typename BinaryOperation>
11auto 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:268
auto accumulate_n(ForwardIterator first, Size count, T init, BinaryOperation op) -> decltype(std::accumulate(first, std::next(first, count), init, op))
Definition library/utility/numeric.hpp:11