GCC Code Coverage Report


Directory: ./
File: tasks/zyazeva_s_matrix_mult_cannon_alg/seq/src/ops_seq.cpp
Date: 2026-04-02 17:12:27
Exec Total Coverage
Lines: 19 19 100.0%
Functions: 5 5 100.0%
Branches: 11 16 68.8%

Line Branch Exec Source
1 #include "zyazeva_s_matrix_mult_cannon_alg/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "zyazeva_s_matrix_mult_cannon_alg/common/include/common.hpp"
7
8 namespace zyazeva_s_matrix_mult_cannon_alg {
9
10
1/2
✓ Branch 1 taken 56 times.
✗ Branch 2 not taken.
56 ZyazevaSMatrixMultCannonAlgSEQ::ZyazevaSMatrixMultCannonAlgSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12 GetInput() = in;
13 GetOutput() = {};
14 56 }
15
16 56 bool ZyazevaSMatrixMultCannonAlgSEQ::ValidationImpl() {
17 56 const size_t sz = std::get<0>(GetInput());
18 const auto &m1 = std::get<1>(GetInput());
19 const auto &m2 = std::get<2>(GetInput());
20
21
3/6
✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 56 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 56 times.
56 return sz > 0 && m1.size() == sz * sz && m2.size() == sz * sz;
22 }
23
24 56 bool ZyazevaSMatrixMultCannonAlgSEQ::PreProcessingImpl() {
25 GetOutput() = {};
26 56 return true;
27 }
28
29 56 bool ZyazevaSMatrixMultCannonAlgSEQ::RunImpl() {
30 56 const auto sz = std::get<0>(GetInput());
31 const auto &m1 = std::get<1>(GetInput());
32 const auto &m2 = std::get<2>(GetInput());
33
34 56 std::vector<double> res_m(sz * sz, 0.0);
35
36
2/2
✓ Branch 0 taken 336 times.
✓ Branch 1 taken 56 times.
392 for (size_t row_idx = 0; row_idx < sz; ++row_idx) {
37
2/2
✓ Branch 0 taken 3232 times.
✓ Branch 1 taken 336 times.
3568 for (size_t col_idx = 0; col_idx < sz; ++col_idx) {
38 double accumulated = 0.0;
39
2/2
✓ Branch 0 taken 38544 times.
✓ Branch 1 taken 3232 times.
41776 for (size_t inner_idx = 0; inner_idx < sz; ++inner_idx) {
40 38544 accumulated += m1[(row_idx * sz) + inner_idx] * m2[(inner_idx * sz) + col_idx];
41 }
42 3232 res_m[(row_idx * sz) + col_idx] = accumulated;
43 }
44 }
45
46
1/2
✓ Branch 1 taken 56 times.
✗ Branch 2 not taken.
56 GetOutput() = res_m;
47 56 return true;
48 }
49
50 56 bool ZyazevaSMatrixMultCannonAlgSEQ::PostProcessingImpl() {
51 56 return true;
52 }
53
54 } // namespace zyazeva_s_matrix_mult_cannon_alg
55