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

daisytuner / sdfglib / 15044057891

15 May 2025 11:42AM UTC coverage: 59.37% (+1.8%) from 57.525%
15044057891

push

github

web-flow
Merge pull request #14 from daisytuner/sanitizers

enables sanitizer on unit tests

63 of 67 new or added lines in 47 files covered. (94.03%)

570 existing lines in 62 files now uncovered.

7356 of 12390 relevant lines covered (59.37%)

505.93 hits per line

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

82.61
/src/passes/normalization/transition_to_tasklet_conversion.cpp
1
#include "sdfg/passes/normalization/transition_to_tasklet_conversion.h"
2

3
namespace sdfg {
4
namespace passes {
5

6
TransitionToTaskletConversion::TransitionToTaskletConversion(
1✔
7
    builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager)
8
    : visitor::StructuredSDFGVisitor(builder, analysis_manager){};
1✔
9

10
bool TransitionToTaskletConversion::can_be_applied(const symbolic::Symbol& lhs,
1✔
11
                                                   const symbolic::Expression& rhs) const {
12
    return true;
1✔
13
};
14

15
void TransitionToTaskletConversion::apply(structured_control_flow::Block& block,
1✔
16
                                          const symbolic::Symbol& lhs,
17
                                          const symbolic::Expression& rhs) {
18
    auto& sdfg = builder_.subject();
1✔
19

20
    auto& input_node = builder_.symbolic_expression_to_dataflow(block, rhs);
1✔
21
    auto& tasklet = builder_.add_tasklet(
2✔
22
        block, data_flow::TaskletCode::assign,
1✔
23
        {"_out", static_cast<const types::Scalar&>(sdfg.type(lhs->get_name()))},
1✔
24
        {{"_in", static_cast<const types::Scalar&>(sdfg.type(input_node.data()))}});
1✔
25
    auto& output_node = builder_.add_access(block, lhs->get_name());
1✔
26
    builder_.add_memlet(block, input_node, "void", tasklet, "_in", {symbolic::integer(0)});
1✔
27
    builder_.add_memlet(block, tasklet, "_out", output_node, "void", {symbolic::integer(0)});
1✔
28
};
1✔
29

30
bool TransitionToTaskletConversion::accept(structured_control_flow::Sequence& parent,
1✔
31
                                           structured_control_flow::Sequence& node) {
32
    bool applied = false;
1✔
33
    for (size_t i = 0; i < node.size();) {
2✔
34
        auto& transition = node.at(i).second;
1✔
35
        if (transition.assignments().empty()) {
1✔
36
            i++;
×
37
            continue;
×
38
        }
39

40
        structured_control_flow::ControlFlowNode* next = nullptr;
1✔
41
        if (i < node.size() - 1) {
1✔
42
            next = &node.at(i + 1).first;
×
UNCOV
43
        }
×
44

45
        std::unordered_set<std::string> erased_symbols;
1✔
46
        for (auto& entry : transition.assignments()) {
2✔
47
            if (this->can_be_applied(entry.first, entry.second)) {
1✔
48
                if (next != nullptr) {
1✔
49
                    auto& new_block = builder_.add_block_before(node, *next, {}).first;
×
50
                    this->apply(new_block, entry.first, entry.second);
×
UNCOV
51
                } else {
×
52
                    auto& new_block = builder_.add_block(node);
1✔
53
                    this->apply(new_block, entry.first, entry.second);
1✔
54
                }
55
                erased_symbols.insert(entry.first->get_name());
1✔
56
            }
1✔
57
        }
58
        for (auto& symbol : erased_symbols) {
2✔
59
            transition.assignments().erase(symbolic::symbol(symbol));
1✔
60
        }
61
        if (!erased_symbols.empty()) {
1✔
62
            applied = true;
1✔
63
        }
1✔
64

65
        i = i + erased_symbols.size() + 1;
1✔
66
    }
1✔
67

68
    return applied;
1✔
UNCOV
69
};
×
70

71
}  // namespace passes
72
}  // 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