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

daisytuner / sdfglib / 20770413849

06 Jan 2026 10:50PM UTC coverage: 62.168% (+21.4%) from 40.764%
20770413849

push

github

web-flow
Merge pull request #433 from daisytuner/clang-coverage

updates clang coverage flags

14988 of 24109 relevant lines covered (62.17%)

88.57 hits per line

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

76.19
/src/data_flow/library_nodes/math/tensor/elementwise_ops/div_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/elementwise_ops/div_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
DivNode::DivNode(
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_Div, shape) {}
9✔
21

22
bool DivNode::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::IType& input_type_a,
30
    const types::IType& input_type_b,
31
    const types::IType& output_type,
32
    const data_flow::Subset& subset
33
) {
6✔
34
    auto& code_block = builder.add_block(body);
6✔
35
    data_flow::AccessNode* input_node_a;
6✔
36
    if (builder.subject().exists(input_name_a)) {
6✔
37
        input_node_a = &builder.add_access(code_block, input_name_a);
6✔
38
    } else {
6✔
39
        input_node_a = &builder.add_constant(code_block, input_name_a, input_type_a);
×
40
    }
×
41
    data_flow::AccessNode* input_node_b;
6✔
42
    if (builder.subject().exists(input_name_b)) {
6✔
43
        input_node_b = &builder.add_access(code_block, input_name_b);
6✔
44
    } else {
6✔
45
        input_node_b = &builder.add_constant(code_block, input_name_b, input_type_b);
×
46
    }
×
47
    auto& output_node = builder.add_access(code_block, output_name);
6✔
48

49
    bool is_int = types::is_integer(output_type.primitive_type());
6✔
50
    data_flow::TaskletCode opcode;
6✔
51
    if (is_int) {
6✔
52
        // Distinguish between signed and unsigned division
53
        bool is_signed = types::is_signed(output_type.primitive_type());
2✔
54
        opcode = is_signed ? data_flow::TaskletCode::int_sdiv : data_flow::TaskletCode::int_udiv;
2✔
55
    } else {
4✔
56
        opcode = data_flow::TaskletCode::fp_div;
4✔
57
    }
4✔
58

59
    auto& tasklet = builder.add_tasklet(code_block, opcode, "_out", {"_in1", "_in2"});
6✔
60

61
    if (input_type_a.type_id() == types::TypeID::Scalar) {
6✔
62
        builder.add_computational_memlet(code_block, *input_node_a, tasklet, "_in1", {}, input_type_a);
×
63
    } else {
6✔
64
        builder.add_computational_memlet(code_block, *input_node_a, tasklet, "_in1", subset, input_type_a);
6✔
65
    }
6✔
66
    if (input_type_b.type_id() == types::TypeID::Scalar) {
6✔
67
        builder.add_computational_memlet(code_block, *input_node_b, tasklet, "_in2", {}, input_type_b);
×
68
    } else {
6✔
69
        builder.add_computational_memlet(code_block, *input_node_b, tasklet, "_in2", subset, input_type_b);
6✔
70
    }
6✔
71
    builder.add_computational_memlet(code_block, tasklet, "_out", output_node, subset, output_type);
6✔
72

73
    return true;
6✔
74
}
6✔
75

76
std::unique_ptr<data_flow::DataFlowNode> DivNode::
77
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
78
    return std::unique_ptr<
×
79
        data_flow::DataFlowNode>(new DivNode(element_id, this->debug_info(), vertex, parent, this->shape_));
×
80
}
×
81

82
} // namespace tensor
83
} // namespace math
84
} // 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