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

daisytuner / sdfglib / 15340968114

30 May 2025 06:47AM UTC coverage: 58.553% (+0.2%) from 58.324%
15340968114

push

github

web-flow
Add parallel Map node

* Introduce Map data structure

* Prepare infrastructure

* implement analysis support

* Add basic infrastructure

* visualizer/serializer

* include fix

* update from main

* remove default

* happens before test + fixes

* builder test

* dispatcher test

* visitor, copy and serializer tests

* for2map structures

* for2map conversion draft

* add tests

* Bug fixes

* small updates from feedback

* Visitor style pass implementation

* cleanup

* fixes linting errors

---------

Co-authored-by: Lukas Truemper <lukas.truemper@outlook.de>

258 of 381 new or added lines in 26 files covered. (67.72%)

17 existing lines in 14 files now uncovered.

8184 of 13977 relevant lines covered (58.55%)

109.83 hits per line

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

82.93
/src/passes/structured_control_flow/sequence_fusion.cpp
1
#include "sdfg/passes/structured_control_flow/sequence_fusion.h"
2

3
namespace sdfg {
4
namespace passes {
5

6
SequenceFusion::SequenceFusion()
7✔
7
    : Pass() {
7✔
8

9
      };
7✔
10

11
std::string SequenceFusion::name() { return "SequenceFusion"; };
×
12

13
bool SequenceFusion::run_pass(builder::StructuredSDFGBuilder& builder,
9✔
14
                              analysis::AnalysisManager& analysis_manager) {
15
    bool applied = false;
9✔
16

17
    // Traverse structured SDFG
18
    std::list<structured_control_flow::ControlFlowNode*> queue = {&builder.subject().root()};
9✔
19
    while (!queue.empty()) {
81✔
20
        auto current = queue.front();
72✔
21
        queue.pop_front();
72✔
22

23
        // If sequence, attempt fusion
24
        if (auto seq = dynamic_cast<structured_control_flow::Sequence*>(current)) {
72✔
25
            size_t i = 0;
32✔
26
            while (i < seq->size()) {
76✔
27
                auto child = seq->at(i);
44✔
28
                auto subseq = dynamic_cast<structured_control_flow::Sequence*>(&child.first);
44✔
29
                if (!subseq) {
44✔
30
                    i++;
40✔
31
                    continue;
40✔
32
                }
33
                builder.insert_children(*seq, *subseq, i + 1);
4✔
34
                builder.remove_child(*seq, i);
4✔
35
                applied = true;
4✔
36
            }
37
        }
32✔
38

39
        // Add children to queue
40
        if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
72✔
41
            for (size_t i = 0; i < sequence_stmt->size(); i++) {
72✔
42
                queue.push_back(&sequence_stmt->at(i).first);
40✔
43
            }
40✔
44
        } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
72✔
45
            for (size_t i = 0; i < if_else_stmt->size(); i++) {
×
46
                queue.push_back(&if_else_stmt->at(i).first);
×
47
            }
×
48
        } else if (auto loop_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
40✔
49
            queue.push_back(&loop_stmt->root());
×
50
        } else if (auto for_stmt = dynamic_cast<structured_control_flow::For*>(current)) {
40✔
51
            queue.push_back(&for_stmt->root());
19✔
52
        } else if (auto kern_stmt = dynamic_cast<const structured_control_flow::Kernel*>(current)) {
40✔
53
            queue.push_back(&kern_stmt->root());
4✔
54
        } else if (auto map_stmt = dynamic_cast<const structured_control_flow::Map*>(current)) {
21✔
NEW
55
            queue.push_back(&map_stmt->root());
×
UNCOV
56
        }
×
57
    }
58

59
    return applied;
9✔
60
};
9✔
61

62
}  // namespace passes
63
}  // 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

© 2025 Coveralls, Inc