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

daisytuner / sdfglib / 17651658650

11 Sep 2025 04:58PM UTC coverage: 61.012% (+1.3%) from 59.755%
17651658650

Pull #219

github

web-flow
Merge 742a12367 into f744ac9f5
Pull Request #219: stdlib Library Nodes and ConstantNodes

499 of 1681 new or added lines in 81 files covered. (29.68%)

95 existing lines in 36 files now uncovered.

9718 of 15928 relevant lines covered (61.01%)

108.0 hits per line

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

66.67
/src/data_flow/access_node.cpp
1
#include "sdfg/data_flow/access_node.h"
2

3
#include "sdfg/data_flow/data_flow_graph.h"
4
#include "sdfg/function.h"
5

6
namespace sdfg {
7
namespace data_flow {
8

9
AccessNode::AccessNode(
664✔
10
    size_t element_id,
11
    const DebugInfoRegion& debug_info_region,
12
    const graph::Vertex vertex,
13
    DataFlowGraph& parent,
14
    const std::string& data
15
)
16
    : DataFlowNode(element_id, debug_info_region, vertex, parent), data_(data) {
664✔
17

18
      };
664✔
19

20
void AccessNode::validate(const Function& function) const {
381✔
21
    if (!function.exists(this->data_)) {
381✔
NEW
22
        throw InvalidSDFGException("Access node " + this->data_ + " uses non-existent variable");
×
23
    }
24

25
    auto& graph = this->get_parent();
381✔
26

27
    if (graph.out_degree(*this) > 1) {
381✔
28
        MemletType type = (*graph.out_edges(*this).begin()).type();
1✔
29
        for (auto& oedge : graph.out_edges(*this)) {
3✔
30
            if (oedge.type() != type) {
2✔
31
                throw InvalidSDFGException("Access node " + this->data() + " used with multiple memlet types");
×
32
            }
33
        }
34
    }
1✔
35

36
    if (graph.in_degree(*this) > 1) {
381✔
37
        MemletType type = (*graph.in_edges(*this).begin()).type();
×
38
        for (auto& iedge : graph.in_edges(*this)) {
×
39
            if (iedge.type() != type) {
×
40
                throw InvalidSDFGException("Access node " + this->data() + " used with multiple memlet types");
×
41
            }
42
        }
43
    }
×
44
}
381✔
45

46
const std::string& AccessNode::data() const { return this->data_; };
1,384✔
47

48
std::string& AccessNode::data() { return this->data_; };
1,240✔
49

50
std::unique_ptr<DataFlowNode> AccessNode::clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph& parent)
×
51
    const {
52
    return std::unique_ptr<AccessNode>(new AccessNode(element_id, this->debug_info_, vertex, parent, this->data_));
×
53
};
×
54

55
void AccessNode::replace(const symbolic::Expression& old_expression, const symbolic::Expression& new_expression) {
7✔
56
    if (SymEngine::is_a<SymEngine::Symbol>(*old_expression) && SymEngine::is_a<SymEngine::Symbol>(*new_expression)) {
7✔
57
        auto old_symbol = SymEngine::rcp_static_cast<const SymEngine::Symbol>(old_expression);
7✔
58
        if (this->data_ == old_symbol->get_name()) {
7✔
59
            auto new_symbol = SymEngine::rcp_static_cast<const SymEngine::Symbol>(new_expression);
5✔
60
            this->data_ = new_symbol->get_name();
5✔
61
        }
5✔
62
    }
7✔
63
};
7✔
64

65
ConstantNode::ConstantNode(
53✔
66
    size_t element_id,
67
    const DebugInfoRegion& debug_info,
68
    const graph::Vertex vertex,
69
    DataFlowGraph& parent,
70
    const std::string& data,
71
    const types::IType& type
72
)
73
    : AccessNode(element_id, debug_info, vertex, parent, data), type_(type.clone()) {};
53✔
74

75
void ConstantNode::validate(const Function& function) const {
79✔
76
    if (function.exists(this->data_)) {
79✔
NEW
77
        throw InvalidSDFGException("ConstantNode " + this->data_ + " uses variable");
×
78
    }
79

80
    auto& graph = this->get_parent();
79✔
81
    if (graph.in_degree(*this) > 0) {
79✔
NEW
82
        throw InvalidSDFGException("ConstantNode " + this->data_ + " has incoming edges");
×
83
    }
84
}
79✔
85

86
const types::IType& ConstantNode::type() const { return *this->type_; };
46✔
87

NEW
88
std::unique_ptr<DataFlowNode> ConstantNode::clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph& parent)
×
89
    const {
NEW
90
    return std::unique_ptr<
×
NEW
91
        ConstantNode>(new ConstantNode(element_id, this->debug_info_, vertex, parent, this->data(), *this->type_));
×
NEW
92
};
×
93

94
} // namespace data_flow
95
} // 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