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

daisytuner / sdfglib / 20555877698

28 Dec 2025 03:34PM UTC coverage: 38.976% (-0.1%) from 39.111%
20555877698

push

github

web-flow
Merge pull request #408 from daisytuner/codegen-malloc

Several fixes for library nodes

13539 of 45102 branches covered (30.02%)

Branch coverage included in aggregate %.

1 of 99 new or added lines in 11 files covered. (1.01%)

14 existing lines in 7 files now uncovered.

11671 of 19578 relevant lines covered (59.61%)

83.78 hits per line

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

0.0
/src/data_flow/library_nodes/math/ml/add.cpp
1
#include "sdfg/data_flow/library_nodes/math/ml/add.h"
2

3
#include "sdfg/analysis/analysis.h"
4
#include "sdfg/builder/structured_sdfg_builder.h"
5

6
#include "sdfg/analysis/scope_analysis.h"
7

8
namespace sdfg {
9
namespace math {
10
namespace ml {
11

12
AddNode::AddNode(
×
13
    size_t element_id,
14
    const DebugInfo& debug_info,
15
    const graph::Vertex vertex,
16
    data_flow::DataFlowGraph& parent,
17
    const std::vector<symbolic::Expression>& shape
18
)
19
    : ElementWiseBinaryNode(element_id, debug_info, vertex, parent, LibraryNodeType_Add, shape) {}
×
20

21
bool AddNode::expand_operation(
×
22
    builder::StructuredSDFGBuilder& builder,
23
    analysis::AnalysisManager& analysis_manager,
24
    structured_control_flow::Sequence& body,
25
    const std::string& input_name_a,
26
    const std::string& input_name_b,
27
    const std::string& output_name,
28
    const types::IType& input_type_a,
29
    const types::IType& input_type_b,
30
    const types::IType& output_type,
31
    const data_flow::Subset& subset
32
) {
33
    // Add code
34
    auto& code_block = builder.add_block(body);
×
35
    data_flow::AccessNode* input_node_a;
NEW
36
    if (builder.subject().exists(input_name_a)) {
×
NEW
37
        input_node_a = &builder.add_access(code_block, input_name_a);
×
NEW
38
    } else {
×
NEW
39
        input_node_a = &builder.add_constant(code_block, input_name_a, input_type_a);
×
40
    }
41
    data_flow::AccessNode* input_node_b;
NEW
42
    if (builder.subject().exists(input_name_b)) {
×
NEW
43
        input_node_b = &builder.add_access(code_block, input_name_b);
×
NEW
44
    } else {
×
NEW
45
        input_node_b = &builder.add_constant(code_block, input_name_b, input_type_b);
×
46
    }
UNCOV
47
    auto& output_node = builder.add_access(code_block, output_name);
×
48

49
    auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::fp_add, "_out", {"_in1", "_in2"});
×
50

NEW
51
    if (input_type_a.type_id() == types::TypeID::Scalar) {
×
NEW
52
        builder.add_computational_memlet(code_block, *input_node_a, tasklet, "_in1", {}, input_type_a);
×
NEW
53
    } else {
×
NEW
54
        builder.add_computational_memlet(code_block, *input_node_a, tasklet, "_in1", subset, input_type_a);
×
55
    }
NEW
56
    if (input_type_b.type_id() == types::TypeID::Scalar) {
×
NEW
57
        builder.add_computational_memlet(code_block, *input_node_b, tasklet, "_in2", {}, input_type_b);
×
NEW
58
    } else {
×
NEW
59
        builder.add_computational_memlet(code_block, *input_node_b, tasklet, "_in2", subset, input_type_b);
×
60
    }
UNCOV
61
    builder.add_computational_memlet(code_block, tasklet, "_out", output_node, subset, output_type);
×
62

63
    return true;
×
64
}
×
65

66
std::unique_ptr<data_flow::DataFlowNode> AddNode::
67
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
68
    return std::unique_ptr<
×
69
        data_flow::DataFlowNode>(new AddNode(element_id, this->debug_info(), vertex, parent, this->shape_));
×
70
}
×
71

72
} // namespace ml
73
} // namespace math
74
} // 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