• 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

57.89
/src/data_flow/library_nodes/math/tensor/reduce_ops/max_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/reduce_ops/max_node.h"
2

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

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

12
MaxNode::MaxNode(
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
    const std::vector<int64_t>& axes,
19
    bool keepdims
20
)
21
    : ReduceNode(element_id, debug_info, vertex, parent, LibraryNodeType_Max, shape, axes, keepdims) {}
1✔
22

23
bool MaxNode::expand_reduction(
24
    builder::StructuredSDFGBuilder& builder,
25
    analysis::AnalysisManager& analysis_manager,
26
    structured_control_flow::Sequence& body,
27
    const std::string& input_name,
28
    const std::string& output_name,
29
    const types::IType& input_type,
30
    const types::IType& output_type,
31
    const data_flow::Subset& input_subset,
32
    const data_flow::Subset& output_subset
33
) {
1✔
34
    auto& block = builder.add_block(body, {}, this->debug_info());
1✔
35

36
    auto& in_access = builder.add_access(block, input_name, this->debug_info());
1✔
37
    auto& out_read_access = builder.add_access(block, output_name, this->debug_info());
1✔
38
    auto& out_write_access = builder.add_access(block, output_name, this->debug_info());
1✔
39

40
    bool is_int = types::is_integer(input_type.primitive_type());
1✔
41

42
    if (is_int) {
1✔
43
        // For integers, use tasklet - distinguish between signed and unsigned
44
        auto tasklet_code = TensorNode::get_integer_minmax_tasklet(input_type.primitive_type(), true);
1✔
45
        auto& tasklet = builder.add_tasklet(block, tasklet_code, "_out", {"_in1", "_in2"});
1✔
46

47
        builder
1✔
48
            .add_computational_memlet(block, in_access, tasklet, "_in1", input_subset, input_type, this->debug_info());
1✔
49
        builder.add_computational_memlet(
1✔
50
            block, out_read_access, tasklet, "_in2", output_subset, output_type, this->debug_info()
1✔
51
        );
1✔
52
        builder.add_computational_memlet(
1✔
53
            block, tasklet, "_out", out_write_access, output_subset, output_type, this->debug_info()
1✔
54
        );
1✔
55
    } else {
1✔
56
        // For floating-point, use the correct fmax intrinsic
57
        auto& libnode = builder.add_library_node<
×
58
            math::cmath::CMathNode>(block, this->debug_info(), cmath::CMathFunction::fmax, input_type.primitive_type());
×
59

60
        builder
×
61
            .add_computational_memlet(block, in_access, libnode, "_in1", input_subset, input_type, this->debug_info());
×
62
        builder.add_computational_memlet(
×
63
            block, out_read_access, libnode, "_in2", output_subset, output_type, this->debug_info()
×
64
        );
×
65
        builder.add_computational_memlet(
×
66
            block, libnode, "_out", out_write_access, output_subset, output_type, this->debug_info()
×
67
        );
×
68
    }
×
69

70
    return true;
1✔
71
}
1✔
72

73
std::string MaxNode::identity() const { return "-INFINITY"; }
1✔
74

75
std::unique_ptr<data_flow::DataFlowNode> MaxNode::
76
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
77
    return std::unique_ptr<data_flow::DataFlowNode>(
×
78
        new MaxNode(element_id, this->debug_info(), vertex, parent, this->shape_, this->axes_, this->keepdims_)
×
79
    );
×
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