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

daisytuner / docc / 22023884668

14 Feb 2026 08:36PM UTC coverage: 64.903% (-1.4%) from 66.315%
22023884668

Pull #525

github

web-flow
Merge 1d47f8bf2 into 9d01cacd5
Pull Request #525: Step 3 (Native Tensor Support): Refactor Python Frontend

2522 of 3435 new or added lines in 32 files covered. (73.42%)

320 existing lines in 15 files now uncovered.

23204 of 35752 relevant lines covered (64.9%)

370.03 hits per line

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

63.16
/sdfg/src/data_flow/library_nodes/math/tensor/elementwise_ops/add_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/elementwise_ops/add_node.h"
2

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

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

9
namespace sdfg {
10
namespace math {
11
namespace tensor {
12

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

22
bool AddNode::expand_operation(
23
    builder::StructuredSDFGBuilder& builder,
24
    analysis::AnalysisManager& analysis_manager,
25
    structured_control_flow::Sequence& body,
26
    const std::string& input_name_a,
27
    const std::string& input_name_b,
28
    const std::string& output_name,
29
    const types::Tensor& input_type_a,
30
    const types::Tensor& input_type_b,
31
    const types::Tensor& output_type,
32
    const data_flow::Subset& subset
33
) {
6✔
34
    auto& code_block = builder.add_block(body);
6✔
35

36
    bool is_int = types::is_integer(output_type.primitive_type());
6✔
37
    data_flow::TaskletCode opcode = is_int ? data_flow::TaskletCode::int_add : data_flow::TaskletCode::fp_add;
6✔
38
    auto& tasklet = builder.add_tasklet(code_block, opcode, "_out", {"_in1", "_in2"});
6✔
39

40
    auto& output_node = builder.add_access(code_block, output_name);
6✔
41
    builder.add_computational_memlet(code_block, tasklet, "_out", output_node, subset, output_type);
6✔
42

43
    if (builder.subject().exists(input_name_a)) {
6✔
44
        auto& input_node_a = builder.add_access(code_block, input_name_a);
6✔
45
        if (input_type_a.is_scalar()) {
6✔
NEW
46
            builder.add_computational_memlet(code_block, input_node_a, tasklet, "_in1", {}, input_type_a);
×
47
        } else {
6✔
48
            builder.add_computational_memlet(code_block, input_node_a, tasklet, "_in1", subset, input_type_a);
6✔
49
        }
6✔
50
    } else {
6✔
NEW
51
        types::Scalar const_type(input_type_a.primitive_type());
×
NEW
52
        auto& input_node_a = builder.add_constant(code_block, input_name_a, const_type);
×
NEW
53
        builder.add_computational_memlet(code_block, input_node_a, tasklet, "_in1", subset, input_type_a);
×
UNCOV
54
    }
×
55

56
    if (builder.subject().exists(input_name_b)) {
6✔
57
        auto& input_node_b = builder.add_access(code_block, input_name_b);
6✔
58
        if (input_type_b.is_scalar()) {
6✔
NEW
59
            builder.add_computational_memlet(code_block, input_node_b, tasklet, "_in2", {}, input_type_b);
×
60
        } else {
6✔
61
            builder.add_computational_memlet(code_block, input_node_b, tasklet, "_in2", subset, input_type_b);
6✔
62
        }
6✔
63
    } else {
6✔
NEW
64
        types::Scalar const_type(input_type_b.primitive_type());
×
NEW
65
        auto& input_node_b = builder.add_constant(code_block, input_name_b, const_type);
×
NEW
66
        builder.add_computational_memlet(code_block, input_node_b, tasklet, "_in2", subset, input_type_b);
×
UNCOV
67
    }
×
68

69
    return true;
6✔
70
}
6✔
71

72
std::unique_ptr<data_flow::DataFlowNode> AddNode::
73
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
74
    return std::unique_ptr<
×
75
        data_flow::DataFlowNode>(new AddNode(element_id, this->debug_info(), vertex, parent, this->shape_));
×
76
}
×
77

78
} // namespace tensor
79
} // namespace math
80
} // 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