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

daisytuner / docc / 28158800507

25 Jun 2026 08:57AM UTC coverage: 61.644% (+0.06%) from 61.582%
28158800507

push

github

web-flow
MapFusionByDomain (#771)

 + New Map fusion caches data about iteration domain and map candidates
 + only matches up iteration domain exactly, per loop level.
 + Can support fusing non-leaf stacks of loops (stack ends where the shallower stack stops being perfectly nested & parallel)
 + new Element::replace for bulk replacements
 + New PatternMatcher visitor supports descending into replaced or modified nodes to allow for single-pass nested loop fusings
 + LoopAnalysis can now be kept up-to-date with changes done by Map-fusion
 + unit tests for the updating of LoopAnalysis
 * updated LoopAnalysis to be easier to keep up-to-date with changes. LoopTree is no longer ordered, if you want to iterate in pre-order, use the specific method for that
 + convenience StructuredSDFGBuilder.remove_from_parent()
 + RedundantLoadElim pass to skip reading from memory locations that have just been written (same block). Fusing no longer needs to do this
     RedundantLoadElimination does a simple check for other writes to the same structure. Can skip writes if redundant or not modify, if their are writes to different indices
* Updated verifiers to match new fusion
~ moved verifier checks behind correctness checks in npbench harness. Its more critical if we do not even get the expected results
* Added MapFusionByDomain also to loop-norm stage (currently inactive, causes more kernels that currently cannot be safely offloaded to CUDA.
---------

Co-authored-by: Lukas Truemper <lukas.truemper@outlook.de>

771 of 1186 new or added lines in 55 files covered. (65.01%)

6 existing lines in 6 files now uncovered.

38302 of 62134 relevant lines covered (61.64%)

987.24 hits per line

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

0.0
/sdfg/src/data_flow/library_nodes/metadata_node.cpp
1
#include "sdfg/data_flow/library_nodes/metadata_node.h"
2

3
namespace sdfg {
4
namespace data_flow {
5

6
MetadataNode::MetadataNode(
7
    size_t element_id,
8
    const DebugInfo& debug_info,
9
    const graph::Vertex vertex,
10
    DataFlowGraph& parent,
11
    const std::vector<std::string>& outputs,
12
    const std::vector<std::string>& inputs,
13
    std::unordered_map<std::string, std::string> metadata
14
)
15
    : LibraryNode(
×
16
          element_id, debug_info, vertex, parent, LibraryNodeType_Metadata, outputs, inputs, false, ImplementationType_NONE
×
17
      ),
×
18
      metadata_(metadata) {}
×
19

20
void MetadataNode::validate(const Function& function) const {
×
21
    LibraryNode::validate(function);
×
22
    // No specific validation for metadata
23
}
×
24

25
const std::unordered_map<std::string, std::string>& MetadataNode::metadata() const { return metadata_; }
×
26

27
symbolic::SymbolSet MetadataNode::symbols() const { return symbolic::SymbolSet(); }
×
28

29
std::unique_ptr<DataFlowNode> MetadataNode::clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph& parent)
30
    const {
×
31
    return std::make_unique<MetadataNode>(element_id, debug_info_, vertex, parent, outputs_, inputs_, metadata_);
×
32
}
×
33

34
void MetadataNode::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
×
35
    // Do nothing
36
    return;
×
37
}
×
38

NEW
39
void MetadataNode::replace(const symbolic::ExpressionMapping& replacements) {
×
40
    // Do nothing
NEW
41
    return;
×
NEW
42
}
×
43

44
nlohmann::json MetadataNodeSerializer::serialize(const LibraryNode& library_node) {
×
45
    const MetadataNode& metadata_node = static_cast<const MetadataNode&>(library_node);
×
46
    nlohmann::json j;
×
47

48
    j["code"] = metadata_node.code().value();
×
49
    j["outputs"] = metadata_node.outputs();
×
50
    j["inputs"] = metadata_node.inputs();
×
51
    j["side_effect"] = metadata_node.side_effect();
×
52
    j["metadata"] = metadata_node.metadata();
×
53

54
    return j;
×
55
}
×
56

57
LibraryNode& MetadataNodeSerializer::deserialize(
58
    const nlohmann::json& j, builder::StructuredSDFGBuilder& builder, structured_control_flow::Block& parent
59
) {
×
60
    // Assertions for required fields
61
    assert(j.contains("element_id"));
×
62
    assert(j.contains("code"));
×
63
    assert(j.contains("outputs"));
×
64
    assert(j.contains("inputs"));
×
65
    assert(j.contains("debug_info"));
×
66
    assert(j.contains("metadata"));
×
67

68
    auto code = j["code"].get<std::string>();
×
69
    if (code != LibraryNodeType_Metadata.value()) {
×
70
        throw std::runtime_error("Invalid library node code");
×
71
    }
×
72

73
    // Extract debug info using JSONSerializer
74
    sdfg::serializer::JSONSerializer serializer;
×
75
    DebugInfo debug_info = serializer.json_to_debug_info(j["debug_info"]);
×
76

77
    // Extract properties
78
    auto outputs = j.at("outputs").get<std::vector<std::string>>();
×
79
    auto inputs = j.at("inputs").get<std::vector<std::string>>();
×
80
    auto metadata = j.at("metadata").get<std::unordered_map<std::string, std::string>>();
×
81

82
    return builder.add_library_node<MetadataNode>(parent, debug_info, outputs, inputs, metadata);
×
83
}
×
84

85
MetadataDispatcher::MetadataDispatcher(
86
    codegen::LanguageExtension& language_extension,
87
    const Function& function,
88
    const DataFlowGraph& data_flow_graph,
89
    const MetadataNode& node
90
)
91
    : codegen::LibraryNodeDispatcher(language_extension, function, data_flow_graph, node) {}
×
92

93
void MetadataDispatcher::dispatch(
94
    codegen::PrettyPrinter& stream,
95
    codegen::PrettyPrinter& globals_stream,
96
    codegen::CodeSnippetFactory& library_snippet_factory
97
) {
×
98
    throw std::runtime_error("MetadataNode is not supported");
×
99
}
×
100

101
} // namespace data_flow
102
} // 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