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

daisytuner / sdfglib / 18940816623

30 Oct 2025 12:35PM UTC coverage: 62.283% (+0.06%) from 62.228%
18940816623

push

github

web-flow
Merge pull request #316 from daisytuner/self-references

Self references

7 of 7 new or added lines in 2 files covered. (100.0%)

1 existing line in 1 file now uncovered.

10136 of 16274 relevant lines covered (62.28%)

102.33 hits per line

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

68.75
/src/data_flow/tasklet.cpp
1
#include "sdfg/data_flow/tasklet.h"
2

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

6
namespace sdfg {
7
namespace data_flow {
8

9
Tasklet::Tasklet(
261✔
10
    size_t element_id,
11
    const DebugInfo& debug_info,
12
    const graph::Vertex vertex,
13
    DataFlowGraph& parent,
14
    const TaskletCode code,
15
    const std::string& output,
16
    const std::vector<std::string>& inputs
17
)
18
    : CodeNode(element_id, debug_info, vertex, parent, {output}, inputs), code_(code) {};
261✔
19

20
void Tasklet::validate(const Function& function) const {
199✔
21
    auto& graph = this->get_parent();
199✔
22

23
    // Validate: inputs match arity
24
    if (arity(this->code_) != this->inputs_.size()) {
199✔
25
        throw InvalidSDFGException(
×
26
            "Tasklet: Invalid number of inputs for code " + std::to_string(this->code_) + ": expected " +
×
27
            std::to_string(arity(this->code_)) + ", got " + std::to_string(this->inputs_.size())
×
28
        );
29
    }
30

31
    // Validate: inputs match type of operation
32
    for (auto& iedge : graph.in_edges(*this)) {
498✔
33
        auto& input_type = iedge.result_type(function);
299✔
34
        if (is_integer(this->code_) && !types::is_integer(input_type.primitive_type())) {
299✔
UNCOV
35
            throw InvalidSDFGException("Tasklet: Integer operation with non-integer input type");
×
36
        }
37
        if (is_floating_point(this->code_) && !types::is_floating_point(input_type.primitive_type())) {
299✔
38
            throw InvalidSDFGException("Tasklet: Floating point operation with integer input type");
×
39
        }
40
    }
41

42
    // Validate: Graph - No two access nodes for same data
43
    std::unordered_map<std::string, const AccessNode*> input_names;
199✔
44
    for (auto& iedge : graph.in_edges(*this)) {
498✔
45
        if (dynamic_cast<const ConstantNode*>(&iedge.src()) != nullptr) {
299✔
46
            continue;
88✔
47
        }
48
        auto& src = static_cast<const AccessNode&>(iedge.src());
211✔
49
        if (input_names.find(src.data()) != input_names.end()) {
211✔
50
            if (input_names.at(src.data()) != &src) {
3✔
51
                throw InvalidSDFGException("Tasklet: Two access nodes with the same data as iedge: " + src.data());
×
52
            }
53
        } else {
3✔
54
            input_names.insert({src.data(), &src});
208✔
55
        }
56
    }
57
}
199✔
58

59
TaskletCode Tasklet::code() const { return this->code_; };
187✔
60

61
const std::string& Tasklet::output() const { return this->outputs_[0]; };
54✔
62

63
std::unique_ptr<DataFlowNode> Tasklet::clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph& parent)
×
64
    const {
65
    return std::unique_ptr<Tasklet>(
×
66
        new Tasklet(element_id, this->debug_info_, vertex, parent, this->code_, this->outputs_.at(0), this->inputs_)
×
67
    );
68
};
×
69

70
void Tasklet::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {};
2✔
71

72
} // namespace data_flow
73
} // 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