GCC Code Coverage Report


Directory: ./
File: tasks/tabalaev_a_matrix_mul_strassen/omp/include/ops_omp.hpp
Date: 2026-04-02 17:12:27
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 0 0 -%
Branches: 0 0 -%

Line Branch Exec Source
1 #pragma once
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "tabalaev_a_matrix_mul_strassen/common/include/common.hpp"
7 #include "task/include/task.hpp"
8
9 namespace tabalaev_a_matrix_mul_strassen {
10
11 168 struct StrassenFrameOMP {
12 std::vector<double> mat_a;
13 std::vector<double> mat_b;
14 size_t n;
15 int stage;
16 };
17
18 class TabalaevAMatrixMulStrassenOMP : public BaseTask {
19 public:
20 static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() {
21 return ppc::task::TypeOfTask::kOMP;
22 }
23 explicit TabalaevAMatrixMulStrassenOMP(const InType &in);
24
25 private:
26 bool ValidationImpl() override;
27 bool PreProcessingImpl() override;
28 bool RunImpl() override;
29 bool PostProcessingImpl() override;
30
31 static std::vector<double> StrassenMultiply(const std::vector<double> &mat_a, const std::vector<double> &mat_b,
32 size_t n);
33
34 static std::vector<double> Add(const std::vector<double> &mat_a, const std::vector<double> &mat_b);
35
36 static std::vector<double> Subtract(const std::vector<double> &mat_a, const std::vector<double> &mat_b);
37
38 static std::vector<double> BaseMultiply(const std::vector<double> &mat_a, const std::vector<double> &mat_b, size_t n);
39
40 static void SplitMatrix(const std::vector<double> &src, size_t n, std::vector<double> &c11, std::vector<double> &c12,
41 std::vector<double> &c21, std::vector<double> &c22);
42
43 static std::vector<double> CombineMatrix(const std::vector<double> &c11, const std::vector<double> &c12,
44 const std::vector<double> &c21, const std::vector<double> &c22, size_t n);
45
46 size_t a_rows_ = 0;
47 size_t a_cols_b_rows_ = 0;
48 size_t b_cols_ = 0;
49
50 size_t padded_n_ = 0;
51
52 std::vector<double> padded_a_;
53 std::vector<double> padded_b_;
54 std::vector<double> result_c_;
55 };
56
57 } // namespace tabalaev_a_matrix_mul_strassen
58