| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "goriacheva_k_reduce//seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <numeric> | ||
| 4 | |||
| 5 | #include "goriacheva_k_reduce//common/include/common.hpp" | ||
| 6 | |||
| 7 | namespace goriacheva_k_reduce { | ||
| 8 | |||
| 9 |
1/2✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
|
40 | GoriachevaKReduceSEQ::GoriachevaKReduceSEQ(const InType &in) { |
| 10 |
1/2✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
|
40 | InType tmp(in); |
| 11 | GetInput().swap(tmp); | ||
| 12 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 13 | 40 | } | |
| 14 | |||
| 15 | 40 | bool GoriachevaKReduceSEQ::ValidationImpl() { | |
| 16 | 40 | return true; | |
| 17 | } | ||
| 18 | |||
| 19 | 40 | bool GoriachevaKReduceSEQ::PreProcessingImpl() { | |
| 20 | 40 | GetOutput().resize(1); | |
| 21 | 40 | return true; | |
| 22 | } | ||
| 23 | |||
| 24 | 40 | bool GoriachevaKReduceSEQ::RunImpl() { | |
| 25 | 40 | const auto input = GetInput(); | |
| 26 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 32 times.
|
40 | if (input.empty()) { |
| 27 | 8 | GetOutput()[0] = 0; | |
| 28 | 8 | return true; | |
| 29 | } | ||
| 30 | 32 | GetOutput()[0] = std::accumulate(GetInput().begin(), GetInput().end(), 0); | |
| 31 | 32 | return true; | |
| 32 | } | ||
| 33 | |||
| 34 | 40 | bool GoriachevaKReduceSEQ::PostProcessingImpl() { | |
| 35 | 40 | return true; | |
| 36 | } | ||
| 37 | |||
| 38 | } // namespace goriacheva_k_reduce | ||
| 39 |