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

daisytuner / docc / 23848280014

01 Apr 2026 12:21PM UTC coverage: 64.42% (-0.07%) from 64.49%
23848280014

Pull #624

github

web-flow
Merge 2e8bcfaf8 into 53580ad0f
Pull Request #624: Skip redundant invalidates on perfect loop distribution

43 of 45 new or added lines in 2 files covered. (95.56%)

286 existing lines in 8 files now uncovered.

28812 of 44725 relevant lines covered (64.42%)

435.84 hits per line

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

79.31
/sdfg/src/data_flow/library_nodes/math/tensor/tensor_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/tensor_node.h"
2

3
#include "sdfg/types/tensor.h"
4

5
namespace sdfg {
6
namespace math {
7
namespace tensor {
8

9
TensorNode::TensorNode(
10
    size_t element_id,
11
    const DebugInfo& debug_info,
12
    const graph::Vertex vertex,
13
    data_flow::DataFlowGraph& parent,
14
    const data_flow::LibraryNodeCode& code,
15
    const std::vector<std::string>& outputs,
16
    const std::vector<std::string>& inputs,
17
    data_flow::ImplementationType impl_type
18
)
19
    : MathNode(element_id, debug_info, vertex, parent, code, outputs, inputs, impl_type) {}
615✔
20

21
void TensorNode::validate(const Function& function) const {
334✔
22
    MathNode::validate(function);
334✔
23

24
    auto& graph = this->get_parent();
334✔
25

26
    // Validate that all memlets have the same primitive type
27
    types::PrimitiveType prim_type = primitive_type(graph);
334✔
28

29
    // Check if this operation supports integer types
30
    if (!supports_integer_types() && types::is_integer(prim_type)) {
334✔
31
        throw InvalidSDFGException(
1✔
32
            "TensorNode: This operation does not support integer types. Found type: " +
1✔
33
            std::string(types::primitive_type_to_string(prim_type))
1✔
34
        );
1✔
35
    }
1✔
36
}
334✔
37

38
types::PrimitiveType TensorNode::primitive_type(const data_flow::DataFlowGraph& graph) const {
355✔
39
    types::PrimitiveType result_type = types::PrimitiveType::Void;
355✔
40
    bool first = true;
355✔
41

42
    // Check all input edges
43
    for (auto& iedge : graph.in_edges(*this)) {
623✔
44
        types::PrimitiveType edge_type;
623✔
45
        auto& tensor_type = static_cast<const types::Tensor&>(iedge.base_type());
623✔
46
        edge_type = tensor_type.primitive_type();
623✔
47

48
        if (first) {
623✔
49
            result_type = edge_type;
355✔
50
            first = false;
355✔
51
        } else if (result_type != edge_type) {
355✔
52
            throw InvalidSDFGException(
1✔
53
                "TensorNode: All input memlets must have the same primitive type. Found " +
1✔
54
                std::string(types::primitive_type_to_string(result_type)) + " and " +
1✔
55
                std::string(types::primitive_type_to_string(edge_type))
1✔
56
            );
1✔
57
        }
1✔
58
    }
623✔
59

60
    // Check all output edges
61
    for (auto& oedge : graph.out_edges(*this)) {
354✔
62
        types::PrimitiveType edge_type;
353✔
63
        auto& tensor_type = static_cast<const types::Tensor&>(oedge.base_type());
353✔
64
        edge_type = tensor_type.primitive_type();
353✔
65

66
        if (first) {
353✔
UNCOV
67
            result_type = edge_type;
×
UNCOV
68
            first = false;
×
69
        } else if (result_type != edge_type) {
353✔
UNCOV
70
            throw InvalidSDFGException(
×
UNCOV
71
                "TensorNode: All output memlets must have the same primitive type. Found " +
×
UNCOV
72
                std::string(types::primitive_type_to_string(result_type)) + " and " +
×
UNCOV
73
                std::string(types::primitive_type_to_string(edge_type))
×
UNCOV
74
            );
×
UNCOV
75
        }
×
76
    }
353✔
77

78
    if (first) {
354✔
UNCOV
79
        throw InvalidSDFGException("TensorNode: No edges found to determine primitive type");
×
UNCOV
80
    }
×
81

82
    return result_type;
354✔
83
}
354✔
84

85
data_flow::TaskletCode TensorNode::get_integer_minmax_tasklet(types::PrimitiveType prim_type, bool is_max) {
5✔
86
    bool is_signed = types::is_signed(prim_type);
5✔
87
    if (is_max) {
5✔
88
        return is_signed ? data_flow::TaskletCode::int_smax : data_flow::TaskletCode::int_umax;
5✔
89
    } else {
5✔
90
        return is_signed ? data_flow::TaskletCode::int_smin : data_flow::TaskletCode::int_umin;
×
91
    }
×
92
}
5✔
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