• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daisytuner / sdfglib / 20764569418

06 Jan 2026 10:50PM UTC coverage: 62.168% (+21.4%) from 40.764%
20764569418

push

github

web-flow
Merge pull request #433 from daisytuner/clang-coverage

updates clang coverage flags

14988 of 24109 relevant lines covered (62.17%)

88.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.41
/src/transformations/parallelization.cpp
1
#include "sdfg/transformations/parallelization.h"
2

3
#include <stdexcept>
4

5
#include "sdfg/optimization_report/pass_report_consumer.h"
6

7
namespace sdfg {
8
namespace transformations {
9

10
Parallelization::Parallelization(structured_control_flow::Map& map) : map_(map) {}
2✔
11

12
std::string Parallelization::name() const { return "Parallelization"; }
×
13

14
bool Parallelization::can_be_applied(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
2✔
15
    auto result = map_.schedule_type().value() == structured_control_flow::ScheduleType_Sequential::value();
2✔
16

17
    if (report_) {
2✔
18
        if (result) {
×
19
            report_->transform_possible(this);
×
20
        } else {
×
21
            report_->transform_impossible(this, "not sequential");
×
22
        }
×
23
    }
×
24
    return result;
2✔
25
}
2✔
26

27
void Parallelization::apply(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
2✔
28
    builder.update_schedule_type(this->map_, structured_control_flow::ScheduleType_CPU_Parallel::create());
2✔
29
    if (report_) report_->transform_applied(this);
2✔
30
}
2✔
31

32
void Parallelization::to_json(nlohmann::json& j) const {
×
33
    j["transformation_type"] = this->name();
×
34
    j["subgraph"] = {{"0", {{"element_id", this->map_.element_id()}, {"type", "map"}}}};
×
35
    j["transformation_type"] = this->name();
×
36
}
×
37

38
Parallelization Parallelization::from_json(builder::StructuredSDFGBuilder& builder, const nlohmann::json& desc) {
×
39
    auto map_id = desc["subgraph"]["0"]["element_id"].get<size_t>();
×
40
    auto element = builder.find_element_by_id(map_id);
×
41
    if (element == nullptr) {
×
42
        throw std::runtime_error("Element with ID " + std::to_string(map_id) + " not found.");
×
43
    }
×
44

45
    auto loop = dynamic_cast<structured_control_flow::Map*>(element);
×
46

47
    if (loop == nullptr) {
×
48
        throw std::runtime_error("Element with ID " + std::to_string(map_id) + " is not a Map.");
×
49
    }
×
50

51
    return Parallelization(*loop);
×
52
}
×
53

54
} // namespace transformations
55
} // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc