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

daisytuner / docc / 25436733018

06 May 2026 12:59PM UTC coverage: 65.227% (+0.004%) from 65.223%
25436733018

Pull #681

github

web-flow
Merge e31167aa2 into 84dc11a09
Pull Request #681: Target specific expand

55 of 59 new or added lines in 3 files covered. (93.22%)

27 existing lines in 2 files now uncovered.

31624 of 48483 relevant lines covered (65.23%)

2351.88 hits per line

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

90.91
/sdfg/src/data_flow/library_nodes/math/tensor/tensor_expansion_utils.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/tensor_expansion_utils.h"
2

3
#include "sdfg/data_flow/data_flow_node.h"
4
#include "sdfg/exceptions.h"
5
#include "sdfg/structured_control_flow/map.h"
6
#include "sdfg/types/scalar.h"
7

8
namespace sdfg::math::tensor {
9

10
InputContainerInfo find_usable_input_access_node(
11
    data_flow::DataFlowGraph& dataflow, data_flow::LibraryNode& node, const std::string& input_conn
12
) {
7✔
13
    auto* edge = dataflow.in_edge_for_connector(node, input_conn);
7✔
14
    if (!edge) {
7✔
NEW
15
        throw InvalidSDFGException(node.toStr() + " requires input on " + input_conn);
×
NEW
16
    }
×
17
    auto* access_node = dynamic_cast<const data_flow::AccessNode*>(&edge->src());
7✔
18
    if (!access_node) {
7✔
NEW
19
        throw InvalidSDFGException(node.toStr() + " requires input on " + input_conn + " to be an access node");
×
NEW
20
    }
×
21

22
    return {
7✔
23
        .name = access_node->data(),
7✔
24
        .is_const = !!dynamic_cast<const data_flow::ConstantNode*>(&edge->src()),
7✔
25
        .memlet = edge,
7✔
26
        .access_to_remove = access_node
7✔
27
    };
7✔
28
}
7✔
29

30
std::string
31
create_temp_var(builder::StructuredSDFGBuilder& builder, const std::string& prefix, int gen, const types::IType& type) {
6✔
32
    std::string n = prefix + "_" + std::to_string(gen);
6✔
33
    auto name = builder.find_new_name(n);
6✔
34
    builder.add_container(name, type);
6✔
35
    return name;
6✔
36
}
6✔
37

38
std::vector<MapDimension> create_maps(
39
    builder::StructuredSDFGBuilder& builder,
40
    const std::vector<symbolic::Expression>& shape,
41
    structured_control_flow::Sequence& parent_seq
42
) {
1✔
43
    std::vector<MapDimension> result;
1✔
44
    result.reserve(shape.size());
1✔
45

46
    types::Scalar indvar_type(types::PrimitiveType::Int64);
1✔
47
    structured_control_flow::Sequence* current_seq = &parent_seq;
1✔
48

49
    for (size_t i = 0; i < shape.size(); ++i) {
5✔
50
        // Create induction variable for this dimension
51
        std::string loop_var_name = builder.find_new_name("i" + std::to_string(i));
4✔
52
        builder.add_container(loop_var_name, indvar_type);
4✔
53
        auto loop_var = symbolic::symbol(loop_var_name);
4✔
54

55
        // Create the map: for (i = 0; i < dim_size; i++)
56
        auto& map = builder.add_map(
4✔
57
            *current_seq,
4✔
58
            loop_var,
4✔
59
            symbolic::Lt(loop_var, shape[i]),
4✔
60
            symbolic::integer(0),
4✔
61
            symbolic::add(loop_var, symbolic::one()),
4✔
62
            structured_control_flow::ScheduleType_Sequential::create()
4✔
63
        );
4✔
64

65
        // Store the map dimension info
66
        result.push_back(MapDimension{.indvar = loop_var, .seq = map.root(), .loop = map});
4✔
67

68
        // Next iteration will add to the sequence inside this map
69
        current_seq = &map.root();
4✔
70
    }
4✔
71

72
    return result;
1✔
73
}
1✔
74

75
} // namespace sdfg::math::tensor
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