| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "balchunayte_z_dot_product/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | |||
| 5 | #include "balchunayte_z_dot_product/common/include/common.hpp" | ||
| 6 | |||
| 7 | namespace balchunayte_z_dot_product { | ||
| 8 | |||
| 9 |
1/2✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
|
24 | BalchunayteZDotProductSEQ::BalchunayteZDotProductSEQ(const InType &in) { |
| 10 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 11 | GetInput() = in; | ||
| 12 | 24 | GetOutput() = 0.0; | |
| 13 | 24 | } | |
| 14 | |||
| 15 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | bool BalchunayteZDotProductSEQ::ValidationImpl() { |
| 16 | const auto &in = GetInput(); | ||
| 17 | const auto &a = in.a; | ||
| 18 | const auto &b = in.b; | ||
| 19 | |||
| 20 |
2/4✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
✗ Branch 3 not taken.
|
24 | if (a.empty() || b.empty()) { |
| 21 | return false; | ||
| 22 | } | ||
| 23 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
|
24 | if (a.size() != b.size()) { |
| 24 | ✗ | return false; | |
| 25 | } | ||
| 26 | return true; | ||
| 27 | } | ||
| 28 | |||
| 29 | 24 | bool BalchunayteZDotProductSEQ::PreProcessingImpl() { | |
| 30 | 24 | GetOutput() = 0.0; | |
| 31 | 24 | return true; | |
| 32 | } | ||
| 33 | |||
| 34 | 24 | bool BalchunayteZDotProductSEQ::RunImpl() { | |
| 35 | const auto &in = GetInput(); | ||
| 36 | const auto &a = in.a; | ||
| 37 | const auto &b = in.b; | ||
| 38 | |||
| 39 | double sum = 0.0; | ||
| 40 |
2/2✓ Branch 0 taken 72 times.
✓ Branch 1 taken 24 times.
|
96 | for (std::size_t i = 0; i < a.size(); ++i) { |
| 41 | 72 | sum += a[i] * b[i]; | |
| 42 | } | ||
| 43 | |||
| 44 | 24 | GetOutput() = sum; | |
| 45 | 24 | return true; | |
| 46 | } | ||
| 47 | |||
| 48 | 24 | bool BalchunayteZDotProductSEQ::PostProcessingImpl() { | |
| 49 | 24 | return true; | |
| 50 | } | ||
| 51 | |||
| 52 | } // namespace balchunayte_z_dot_product | ||
| 53 |