GCC Code Coverage Report


Directory: ./
File: tasks/sakharov_a_cannon_algorithm/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 21 21 100.0%
Functions: 5 5 100.0%
Branches: 8 10 80.0%

Line Branch Exec Source
1 #include "sakharov_a_cannon_algorithm/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "sakharov_a_cannon_algorithm/common/include/common.hpp"
7
8 namespace sakharov_a_cannon_algorithm {
9
10
1/2
✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
64 SakharovACannonAlgorithmSEQ::SakharovACannonAlgorithmSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12
1/2
✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
64 GetInput() = in;
13 64 }
14
15 64 bool SakharovACannonAlgorithmSEQ::ValidationImpl() {
16 64 return IsValidInput(GetInput());
17 }
18
19 64 bool SakharovACannonAlgorithmSEQ::PreProcessingImpl() {
20 const auto &input = GetInput();
21 64 auto out_size = static_cast<std::size_t>(input.rows_a) * static_cast<std::size_t>(input.cols_b);
22 64 GetOutput().assign(out_size, 0.0);
23 64 return true;
24 }
25
26 64 bool SakharovACannonAlgorithmSEQ::RunImpl() {
27 const auto &input = GetInput();
28 auto &output = GetOutput();
29
30 64 const int m = input.rows_a;
31 64 const int k = input.cols_a;
32 64 const int n = input.cols_b;
33
34
2/2
✓ Branch 0 taken 160 times.
✓ Branch 1 taken 64 times.
224 for (int ii = 0; ii < m; ++ii) {
35
2/2
✓ Branch 0 taken 400 times.
✓ Branch 1 taken 160 times.
560 for (int kk = 0; kk < k; ++kk) {
36 400 double a_val = input.a[Idx(k, ii, kk)];
37
2/2
✓ Branch 0 taken 1248 times.
✓ Branch 1 taken 400 times.
1648 for (int jj = 0; jj < n; ++jj) {
38 1248 output[Idx(n, ii, jj)] += a_val * input.b[Idx(n, kk, jj)];
39 }
40 }
41 }
42
43 64 return true;
44 }
45
46 64 bool SakharovACannonAlgorithmSEQ::PostProcessingImpl() {
47 64 return true;
48 }
49
50 } // namespace sakharov_a_cannon_algorithm
51