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

daisytuner / sdfglib / 19582090818

21 Nov 2025 08:04PM UTC coverage: 62.046% (-0.06%) from 62.105%
19582090818

push

github

web-flow
Merge pull request #356 from daisytuner/dynamic-opt-report

Dynamic opt report

5 of 28 new or added lines in 3 files covered. (17.86%)

3 existing lines in 2 files now uncovered.

11146 of 17964 relevant lines covered (62.05%)

111.89 hits per line

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

29.03
/src/transformations/parallelization.cpp
1
#include "sdfg/transformations/parallelization.h"
2
#include <stdexcept>
3

4
namespace sdfg {
5
namespace transformations {
6

7
Parallelization::Parallelization(structured_control_flow::Map& map) : map_(map) {}
2✔
8

9
std::string Parallelization::name() const { return "Parallelization"; }
×
10

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

14
    if (report_) {
2✔
NEW
15
        if (result) {
×
NEW
16
            report_->transform_possible(this);
×
NEW
17
        } else {
×
NEW
18
            report_->transform_impossible(this, "not sequential");
×
19
        }
NEW
20
    }
×
21
    return result;
2✔
UNCOV
22
}
×
23

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

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

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

42
    auto loop = dynamic_cast<structured_control_flow::Map*>(element);
×
43

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

48
    return Parallelization(*loop);
×
49
}
×
50

51
} // namespace transformations
52
} // 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