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

daisytuner / sdfglib / 20764569418

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

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.92
/src/data_flow/library_nodes/math/tensor/elementwise_ops/maximum_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/elementwise_ops/maximum_node.h"
2

3
#include "sdfg/analysis/analysis.h"
4
#include "sdfg/builder/structured_sdfg_builder.h"
5
#include "sdfg/data_flow/library_nodes/math/cmath/cmath_node.h"
6
#include "sdfg/data_flow/library_nodes/math/tensor/tensor_node.h"
7
#include "sdfg/types/type.h"
8

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

13
MaximumNode::MaximumNode(
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_Maximum, shape) {}
7✔
21

22
bool MaximumNode::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
) {
7✔
34
    auto& code_block = builder.add_block(body);
7✔
35
    data_flow::AccessNode* input_node_a;
7✔
36
    if (builder.subject().exists(input_name_a)) {
7✔
37
        input_node_a = &builder.add_access(code_block, input_name_a);
7✔
38
    } else {
7✔
39
        input_node_a = &builder.add_constant(code_block, input_name_a, input_type_a);
×
40
    }
×
41
    data_flow::AccessNode* input_node_b;
7✔
42
    if (builder.subject().exists(input_name_b)) {
7✔
43
        input_node_b = &builder.add_access(code_block, input_name_b);
7✔
44
    } else {
7✔
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);
7✔
48

49
    bool is_int = types::is_integer(input_type_a.primitive_type());
7✔
50

51
    if (is_int) {
7✔
52
        // Use tasklets for integer types - distinguish between signed and unsigned
53
        auto tasklet_code = TensorNode::get_integer_minmax_tasklet(input_type_a.primitive_type(), true);
3✔
54
        auto& tasklet = builder.add_tasklet(code_block, tasklet_code, "_out", {"_in1", "_in2"});
3✔
55

56
        if (input_type_a.type_id() == types::TypeID::Scalar) {
3✔
57
            builder.add_computational_memlet(code_block, *input_node_a, tasklet, "_in1", {}, input_type_a);
×
58
        } else {
3✔
59
            builder.add_computational_memlet(code_block, *input_node_a, tasklet, "_in1", subset, input_type_a);
3✔
60
        }
3✔
61
        if (input_type_b.type_id() == types::TypeID::Scalar) {
3✔
62
            builder.add_computational_memlet(code_block, *input_node_b, tasklet, "_in2", {}, input_type_b);
×
63
        } else {
3✔
64
            builder.add_computational_memlet(code_block, *input_node_b, tasklet, "_in2", subset, input_type_b);
3✔
65
        }
3✔
66
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node, subset, output_type);
3✔
67
    } else {
4✔
68
        // Use intrinsics for floating-point types with correct suffix
69
        auto& node = builder.add_library_node<
4✔
70
            cmath::CMathNode>(code_block, this->debug_info(), cmath::CMathFunction::fmax, input_type_a.primitive_type());
4✔
71

72
        if (input_type_a.type_id() == types::TypeID::Scalar) {
4✔
73
            builder.add_computational_memlet(code_block, *input_node_a, node, "_in1", {}, input_type_a, DebugInfo());
×
74
        } else {
4✔
75
            builder.add_computational_memlet(code_block, *input_node_a, node, "_in1", subset, input_type_a, DebugInfo());
4✔
76
        }
4✔
77
        if (input_type_b.type_id() == types::TypeID::Scalar) {
4✔
78
            builder.add_computational_memlet(code_block, *input_node_b, node, "_in2", {}, input_type_b, DebugInfo());
×
79
        } else {
4✔
80
            builder.add_computational_memlet(code_block, *input_node_b, node, "_in2", subset, input_type_b, DebugInfo());
4✔
81
        }
4✔
82
        builder.add_computational_memlet(code_block, node, "_out", output_node, subset, output_type, DebugInfo());
4✔
83
    }
4✔
84

85
    return true;
7✔
86
}
7✔
87

88
std::unique_ptr<data_flow::DataFlowNode> MaximumNode::
89
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
90
    return std::unique_ptr<
×
91
        data_flow::DataFlowNode>(new MaximumNode(element_id, this->debug_info(), vertex, parent, this->shape_));
×
92
}
×
93

94
} // namespace tensor
95
} // namespace math
96
} // 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