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