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

daisytuner / sdfglib / 18318176242

07 Oct 2025 03:42PM UTC coverage: 61.593% (+0.5%) from 61.066%
18318176242

Pull #262

github

web-flow
Merge 98864a558 into 82460a9ec
Pull Request #262: Tasklets, Intrinsics and Library Nodes

84 of 418 new or added lines in 29 files covered. (20.1%)

153 existing lines in 17 files now uncovered.

8979 of 14578 relevant lines covered (61.59%)

103.69 hits per line

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

65.63
/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(
225✔
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) {};
225✔
19

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

23
    // Validate: inputs match arity
24
    if (arity(this->code_) != this->inputs_.size()) {
189✔
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)) {
470✔
33
        types::PrimitiveType input_type = iedge.base_type().primitive_type();
281✔
34
        if (is_integer(this->code_) && !types::is_integer(input_type)) {
281✔
NEW
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)) {
281✔
NEW
38
            throw InvalidSDFGException("Tasklet: Floating point operation with integer input type");
×
39
        }
40
        if (is_unsigned(this->code_) && !(types::is_integer(input_type) && types::is_unsigned(input_type))) {
281✔
NEW
41
            throw InvalidSDFGException("Tasklet: Unsigned integer operation with non-integer input type");
×
42
        }
43
    }
44

45
    // Validate: Graph - No two access nodes for same data
46
    std::unordered_map<std::string, const AccessNode*> input_names;
189✔
47
    for (auto& iedge : graph.in_edges(*this)) {
470✔
48
        auto& src = static_cast<const AccessNode&>(iedge.src());
281✔
49
        if (input_names.find(src.data()) != input_names.end()) {
281✔
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});
278✔
55
        }
56
    }
57
}
189✔
58

59
TaskletCode Tasklet::code() const { return this->code_; };
140✔
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