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

daisytuner / sdfglib / 16344863968

17 Jul 2025 12:16PM UTC coverage: 64.865% (-0.3%) from 65.184%
16344863968

Pull #147

github

web-flow
Merge afde7955f into 56ea48e3e
Pull Request #147: Adds metadata library node

98 of 189 new or added lines in 9 files covered. (51.85%)

58 existing lines in 3 files now uncovered.

8712 of 13431 relevant lines covered (64.86%)

176.29 hits per line

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

91.55
/src/codegen/dispatchers/node_dispatcher_registry.cpp
1
#include "sdfg/codegen/dispatchers/node_dispatcher_registry.h"
2

3
#include "sdfg/codegen/dispatchers/block_dispatcher.h"
4
#include "sdfg/codegen/dispatchers/for_dispatcher.h"
5
#include "sdfg/codegen/dispatchers/if_else_dispatcher.h"
6
#include "sdfg/codegen/dispatchers/map_dispatcher.h"
7
#include "sdfg/codegen/dispatchers/sequence_dispatcher.h"
8
#include "sdfg/codegen/dispatchers/while_dispatcher.h"
9

10
#include "sdfg/data_flow/library_nodes/barrier_local_node.h"
11
#include "sdfg/data_flow/library_nodes/metadata_node.h"
12

13
namespace sdfg {
14
namespace codegen {
15

16
std::unique_ptr<NodeDispatcher> create_dispatcher(
24✔
17
    LanguageExtension& language_extension,
18
    StructuredSDFG& sdfg,
19
    structured_control_flow::ControlFlowNode& node,
20
    Instrumentation& instrumentation
21
) {
22
    auto dispatcher = NodeDispatcherRegistry::instance().get_dispatcher(typeid(node));
24✔
23
    if (dispatcher) {
24✔
24
        return dispatcher(language_extension, sdfg, node, instrumentation);
24✔
25
    }
26

UNCOV
27
    throw std::runtime_error("Unsupported control flow node: " + std::string(typeid(node).name()));
×
28
};
24✔
29

30
void register_default_dispatchers() {
2✔
31
    /* Control flow dispatchers */
32
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
33
        typeid(structured_control_flow::Block),
2✔
34
        [](LanguageExtension& language_extension,
6✔
35
           StructuredSDFG& sdfg,
36
           structured_control_flow::ControlFlowNode& node,
37
           Instrumentation& instrumentation) {
38
            return std::make_unique<BlockDispatcher>(
4✔
39
                language_extension, sdfg, static_cast<structured_control_flow::Block&>(node), instrumentation
4✔
40
            );
41
        }
42
    );
43
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
44
        typeid(structured_control_flow::Sequence),
2✔
45
        [](LanguageExtension& language_extension,
16✔
46
           StructuredSDFG& sdfg,
47
           structured_control_flow::ControlFlowNode& node,
48
           Instrumentation& instrumentation) {
49
            return std::make_unique<SequenceDispatcher>(
14✔
50
                language_extension, sdfg, static_cast<structured_control_flow::Sequence&>(node), instrumentation
14✔
51
            );
52
        }
53
    );
54
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
55
        typeid(structured_control_flow::IfElse),
2✔
56
        [](LanguageExtension& language_extension,
3✔
57
           StructuredSDFG& sdfg,
58
           structured_control_flow::ControlFlowNode& node,
59
           Instrumentation& instrumentation) {
60
            return std::make_unique<IfElseDispatcher>(
1✔
61
                language_extension, sdfg, static_cast<structured_control_flow::IfElse&>(node), instrumentation
1✔
62
            );
63
        }
64
    );
65
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
66
        typeid(structured_control_flow::While),
2✔
67
        [](LanguageExtension& language_extension,
3✔
68
           StructuredSDFG& sdfg,
69
           structured_control_flow::ControlFlowNode& node,
70
           Instrumentation& instrumentation) {
71
            return std::make_unique<WhileDispatcher>(
1✔
72
                language_extension, sdfg, static_cast<structured_control_flow::While&>(node), instrumentation
1✔
73
            );
74
        }
75
    );
76
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
77
        typeid(structured_control_flow::For),
2✔
78
        [](LanguageExtension& language_extension,
3✔
79
           StructuredSDFG& sdfg,
80
           structured_control_flow::ControlFlowNode& node,
81
           Instrumentation& instrumentation) {
82
            return std::make_unique<ForDispatcher>(
1✔
83
                language_extension, sdfg, static_cast<structured_control_flow::For&>(node), instrumentation
1✔
84
            );
85
        }
86
    );
87
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
88
        typeid(structured_control_flow::Map),
2✔
89
        [](LanguageExtension& language_extension,
2✔
90
           StructuredSDFG& sdfg,
91
           structured_control_flow::ControlFlowNode& node,
92
           Instrumentation& instrumentation) {
NEW
93
            return std::make_unique<MapDispatcher>(
×
NEW
94
                language_extension, sdfg, static_cast<structured_control_flow::Map&>(node), instrumentation
×
95
            );
96
        }
97
    );
98
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
99
        typeid(structured_control_flow::Return),
2✔
100
        [](LanguageExtension& language_extension,
3✔
101
           StructuredSDFG& sdfg,
102
           structured_control_flow::ControlFlowNode& node,
103
           Instrumentation& instrumentation) {
104
            return std::make_unique<ReturnDispatcher>(
1✔
105
                language_extension, sdfg, static_cast<structured_control_flow::Return&>(node), instrumentation
1✔
106
            );
107
        }
108
    );
109
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
110
        typeid(structured_control_flow::Break),
2✔
111
        [](LanguageExtension& language_extension,
3✔
112
           StructuredSDFG& sdfg,
113
           structured_control_flow::ControlFlowNode& node,
114
           Instrumentation& instrumentation) {
115
            return std::make_unique<BreakDispatcher>(
1✔
116
                language_extension, sdfg, static_cast<structured_control_flow::Break&>(node), instrumentation
1✔
117
            );
118
        }
119
    );
120
    NodeDispatcherRegistry::instance().register_dispatcher(
4✔
121
        typeid(structured_control_flow::Continue),
2✔
122
        [](LanguageExtension& language_extension,
3✔
123
           StructuredSDFG& sdfg,
124
           structured_control_flow::ControlFlowNode& node,
125
           Instrumentation& instrumentation) {
126
            return std::make_unique<ContinueDispatcher>(
1✔
127
                language_extension, sdfg, static_cast<structured_control_flow::Continue&>(node), instrumentation
1✔
128
            );
129
        }
130
    );
131

132
    /* Map dispatchers */
133
    MapDispatcherRegistry::instance().register_map_dispatcher(
4✔
134
        structured_control_flow::ScheduleType_Sequential.value(),
2✔
135
        [](LanguageExtension& language_extension,
3✔
136
           StructuredSDFG& sdfg,
137
           structured_control_flow::Map& node,
138
           Instrumentation& instrumentation) {
139
            return std::make_unique<SequentialMapDispatcher>(language_extension, sdfg, node, instrumentation);
1✔
140
        }
141
    );
142
    MapDispatcherRegistry::instance().register_map_dispatcher(
4✔
143
        structured_control_flow::ScheduleType_CPU_Parallel.value(),
2✔
144
        [](LanguageExtension& language_extension,
2✔
145
           StructuredSDFG& sdfg,
146
           structured_control_flow::Map& node,
147
           Instrumentation& instrumentation) {
NEW
148
            return std::make_unique<CPUParallelMapDispatcher>(language_extension, sdfg, node, instrumentation);
×
149
        }
150
    );
151

152
    /* Librarynode dispatchers */
153
    LibraryNodeDispatcherRegistry::instance().register_library_node_dispatcher(
4✔
154
        data_flow::LibraryNodeType_BarrierLocal.value(),
2✔
155
        [](LanguageExtension& language_extension,
3✔
156
           const Function& function,
157
           const data_flow::DataFlowGraph& data_flow_graph,
158
           const data_flow::LibraryNode& node) {
159
            return std::make_unique<data_flow::BarrierLocalNodeDispatcher>(
1✔
160
                language_extension, function, data_flow_graph, dynamic_cast<const data_flow::BarrierLocalNode&>(node)
1✔
161
            );
162
        }
163
    );
164
    LibraryNodeDispatcherRegistry::instance().register_library_node_dispatcher(
4✔
165
        data_flow::LibraryNodeType_Metadata.value(),
2✔
166
        [](LanguageExtension& language_extension,
2✔
167
           const Function& function,
168
           const data_flow::DataFlowGraph& data_flow_graph,
169
           const data_flow::LibraryNode& node) {
NEW
170
            return std::make_unique<data_flow::MetadataDispatcher>(
×
NEW
171
                language_extension, function, data_flow_graph, dynamic_cast<const data_flow::MetadataNode&>(node)
×
172
            );
173
        }
174
    );
175
}
2✔
176

177
} // namespace codegen
178
} // 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