GCC Code Coverage Report


Directory: ./
File: tasks/karpich_i_matrix_elem_sum/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 19 19 100.0%
Functions: 5 5 100.0%
Branches: 7 12 58.3%

Line Branch Exec Source
1 #include "karpich_i_matrix_elem_sum/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <cstdint>
5 #include <vector>
6
7 #include "karpich_i_matrix_elem_sum/common/include/common.hpp"
8
9 namespace karpich_i_matrix_elem_sum {
10
1/2
✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
64 KarpichIMatrixElemSumSEQ::KarpichIMatrixElemSumSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12 GetInput() = in;
13 64 GetOutput() = 0;
14 64 }
15
16 64 bool KarpichIMatrixElemSumSEQ::ValidationImpl() {
17 64 std::size_t n = std::get<0>(GetInput());
18 64 std::size_t m = std::get<1>(GetInput());
19 std::vector<int> &val = std::get<2>(GetInput());
20
21
2/4
✓ Branch 0 taken 64 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 64 times.
64 return (n > 0) && (m > 0) && (val.size() == (n * m));
22 }
23
24 64 bool KarpichIMatrixElemSumSEQ::PreProcessingImpl() {
25 64 return true;
26 }
27
28 64 bool KarpichIMatrixElemSumSEQ::RunImpl() {
29 64 std::size_t n = std::get<0>(GetInput());
30 64 std::size_t m = std::get<1>(GetInput());
31 std::vector<int> &val = std::get<2>(GetInput());
32
2/4
✓ Branch 0 taken 64 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 64 times.
✗ Branch 3 not taken.
64 if (n == 0 || m == 0 || val.size() != (n * m)) {
33 return false;
34 }
35
36 std::int64_t sum = 0;
37
2/2
✓ Branch 0 taken 81992 times.
✓ Branch 1 taken 64 times.
82056 for (int v : val) {
38 81992 sum += v;
39 }
40 64 GetOutput() = sum;
41 64 return true;
42 }
43
44 64 bool KarpichIMatrixElemSumSEQ::PostProcessingImpl() {
45 64 return true;
46 }
47
48 } // namespace karpich_i_matrix_elem_sum
49