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

daisytuner / docc / 28793626242

06 Jul 2026 01:04PM UTC coverage: 62.962% (+0.2%) from 62.801%
28793626242

Pull #740

github

web-flow
Merge b7e03d389 into 23e67a4ab
Pull Request #740: Expand pass

594 of 962 new or added lines in 31 files covered. (61.75%)

36 existing lines in 10 files now uncovered.

40557 of 64415 relevant lines covered (62.96%)

972.09 hits per line

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

0.0
/sdfg/src/data_flow/library_nodes/math/tensor/reduce_ops/min_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/reduce_ops/min_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
MinNode::MinNode(
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_Min, shape, axes, keepdims) {}
×
22

23
bool MinNode::expand_reduction(
24
    passes::LibNodeExpander::AccessNodeExpand& expansion,
25
    builder::StructuredSDFGBuilder& builder,
26
    structured_control_flow::Sequence& body,
27
    const types::Tensor& input_type,
28
    const types::Tensor& output_type,
29
    const data_flow::Subset& input_subset,
30
    const data_flow::Subset& output_subset
31
) {
×
32
    auto& block = builder.add_block(body, {}, this->debug_info());
×
33

NEW
34
    auto& in_access = expansion.add_indirect_read_access(block, X_INPUT_IDX);
×
NEW
35
    auto& out_read_access = expansion.add_indirect_read_access(block, RESULT_PTR_IDX);
×
NEW
36
    auto& out_write_access = expansion.add_indirect_write_access(block, RESULT_PTR_IDX);
×
37

38
    bool is_int = types::is_integer(input_type.primitive_type());
×
39

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

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

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

68
    return true;
×
69
}
×
70

71
std::string MinNode::identity(types::PrimitiveType primitive_type) const {
×
72
    switch (primitive_type) {
×
73
        case types::PrimitiveType::Int8:
×
74
            return "INT8_MAX";
×
75
        case types::PrimitiveType::Int16:
×
76
            return "INT16_MAX";
×
77
        case types::PrimitiveType::Int32:
×
78
            return "INT32_MAX";
×
79
        case types::PrimitiveType::Int64:
×
80
            return "INT64_MAX";
×
81
        case types::PrimitiveType::UInt8:
×
82
            return "UINT8_MAX";
×
83
        case types::PrimitiveType::UInt16:
×
84
            return "UINT16_MAX";
×
85
        case types::PrimitiveType::UInt32:
×
86
            return "UINT32_MAX";
×
87
        case types::PrimitiveType::UInt64:
×
88
            return "UINT64_MAX";
×
89
        default:
×
90
            return "INFINITY";
×
91
    }
×
92
}
×
93

94
std::unique_ptr<data_flow::DataFlowNode> MinNode::
95
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
96
    return std::unique_ptr<data_flow::DataFlowNode>(
×
97
        new MinNode(element_id, this->debug_info(), vertex, parent, this->shape_, this->axes_, this->keepdims_)
×
98
    );
×
99
}
×
100

101
} // namespace tensor
102
} // namespace math
103
} // 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