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

daisytuner / docc / 28218915263

25 Jun 2026 06:08PM UTC coverage: 61.743% (+0.1%) from 61.644%
28218915263

push

github

web-flow
adds reduce as new structured loop type (#802)

* adds Reduce loop to structured loops

* extends For2Map into a general detection of reduce and map

* makes serialization of reduce backward compatible

* counts reduce as fors in loop analysis

* renames serializer for structured loops

* updates verifier

* adds support for FMA

* updates loop report to count map, reduce, for separately

* updates verifier after merge

* removes non-existent api function in tests after merge

* updates transformations to handle reduce

* adds vectorize dispatcher for reduce

* updates xfail for incorrect output

* updates go fast

* updates llvm verifier

* removes torchaudio dependency

705 of 985 new or added lines in 34 files covered. (71.57%)

5 existing lines in 4 files now uncovered.

38837 of 62901 relevant lines covered (61.74%)

977.93 hits per line

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

70.45
/opt/src/transformations/vectorize_transform.cpp
1
#include "sdfg/transformations/vectorize_transform.h"
2

3
#include "sdfg/optimization_report/pass_report_consumer.h"
4

5
namespace sdfg {
6
namespace transformations {
7

8
VectorizeTransform::VectorizeTransform(structured_control_flow::StructuredLoop& loop) : loop_(loop) {}
4✔
9

10
std::string VectorizeTransform::name() const { return "VectorizeTransform"; }
2✔
11

12
bool VectorizeTransform::
13
    can_be_applied(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
2✔
14
    if (dynamic_cast<structured_control_flow::Map*>(&loop_) == nullptr &&
2✔
15
        dynamic_cast<structured_control_flow::Reduce*>(&loop_) == nullptr) {
2✔
NEW
16
        if (report_) report_->transform_impossible(this, "not a Map or Reduce");
×
NEW
17
        return false;
×
NEW
18
    }
×
19

20
    auto result = loop_.schedule_type().value() == structured_control_flow::ScheduleType_Sequential::value();
2✔
21

22
    if (report_) {
2✔
23
        if (result) {
×
24
            report_->transform_possible(this);
×
25
        } else {
×
26
            report_->transform_impossible(this, "not sequential");
×
27
        }
×
28
    }
×
29

30
    return result;
2✔
31
}
2✔
32

33
void VectorizeTransform::apply(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
1✔
34
    builder.update_schedule_type(this->loop_, vectorize::ScheduleType_Vectorize::create());
1✔
35
    if (report_) report_->transform_applied(this);
1✔
36
}
1✔
37

38
void VectorizeTransform::to_json(nlohmann::json& j) const {
1✔
39
    j["transformation_type"] = this->name();
1✔
40
    j["parameters"] = nlohmann::json::object();
1✔
41

42
    serializer::JSONSerializer ser_flat(false);
1✔
43
    j["subgraph"] = nlohmann::json::object();
1✔
44
    j["subgraph"]["0"] = nlohmann::json::object();
1✔
45
    ser_flat.serialize_node(j["subgraph"]["0"], loop_);
1✔
46
}
1✔
47

48
VectorizeTransform VectorizeTransform::from_json(builder::StructuredSDFGBuilder& builder, const nlohmann::json& desc) {
2✔
49
    auto loop_id = desc["subgraph"]["0"]["element_id"].get<size_t>();
2✔
50
    auto element = builder.find_element_by_id(loop_id);
2✔
51
    if (element == nullptr) {
2✔
52
        throw InvalidTransformationDescriptionException("Element with ID " + std::to_string(loop_id) + " not found.");
1✔
53
    }
1✔
54

55
    auto loop = dynamic_cast<structured_control_flow::StructuredLoop*>(element);
1✔
56
    if (loop == nullptr) {
1✔
NEW
57
        throw InvalidTransformationDescriptionException(
×
NEW
58
            "Element with ID " + std::to_string(loop_id) + " is not a StructuredLoop."
×
NEW
59
        );
×
UNCOV
60
    }
×
61

62
    return VectorizeTransform(*loop);
1✔
63
}
1✔
64

65
} // namespace transformations
66
} // 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