mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-03-25 01:27:40 +00:00
* chore(copyright): update copyright header for tile_engine directory * chore(copyright): update copyright header for script directory * chore(copyright): update copyright header for test_data directory * chore(copyright): update copyright header for python directory * chore(copyright): update copyright header for profiler directory * chore(copyright): update copyright header for library directory * chore(copyright): update copyright header for include directory
17 lines
505 B
C++
17 lines
505 B
C++
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
#include <iterator>
|
|
#include <numeric>
|
|
|
|
namespace ck {
|
|
template <typename T, typename ForwardIterator, typename Size, typename BinaryOperation>
|
|
auto accumulate_n(ForwardIterator first, Size count, T init, BinaryOperation op)
|
|
-> decltype(std::accumulate(first, std::next(first, count), init, op))
|
|
{
|
|
return std::accumulate(first, std::next(first, count), init, op);
|
|
}
|
|
} // namespace ck
|