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

daisytuner / docc / 30543265435

30 Jul 2026 12:36PM UTC coverage: 64.549% (-0.2%) from 64.738%
30543265435

Pull #913

github

web-flow
Merge 6970d8cbe into 4a519a416
Pull Request #913: delegates instrumentation event type decision to specific node dispat…

17 of 236 new or added lines in 25 files covered. (7.2%)

7 existing lines in 7 files now uncovered.

44347 of 68703 relevant lines covered (64.55%)

714.95 hits per line

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

57.75
/sdfg/src/codegen/dispatchers/while_dispatcher.cpp
1
#include "sdfg/codegen/dispatchers/while_dispatcher.h"
2

3
namespace sdfg {
4
namespace codegen {
5

6
WhileDispatcher::WhileDispatcher(
7
    LanguageExtension& language_extension,
8
    StructuredSDFG& sdfg,
9
    analysis::AnalysisManager& analysis_manager,
10
    structured_control_flow::While& node,
11
    InstrumentationPlan& instrumentation_plan,
12
    ArgCapturePlan& arg_capture_plan
13
)
14
    : NodeDispatcher(language_extension, sdfg, analysis_manager, node, instrumentation_plan, arg_capture_plan),
2✔
15
      node_(node) {
2✔
16

17
      };
2✔
18

19
void WhileDispatcher::dispatch_node(
20
    PrettyPrinter& main_stream, PrettyPrinter& globals_stream, CodeSnippetFactory& library_snippet_factory
21
) {
1✔
22
    main_stream << "while (1)" << std::endl;
1✔
23
    main_stream << "{" << std::endl;
1✔
24

25
    main_stream.setIndent(main_stream.indent() + 4);
1✔
26
    SequenceDispatcher
1✔
27
        dispatcher(language_extension_, sdfg_, analysis_manager_, node_.root(), instrumentation_plan_, arg_capture_plan_);
1✔
28
    dispatcher.dispatch(main_stream, globals_stream, library_snippet_factory);
1✔
29
    main_stream.setIndent(main_stream.indent() - 4);
1✔
30

31
    main_stream << "}" << std::endl;
1✔
32
};
1✔
33

34
InstrumentationInfo WhileDispatcher::instrumentation_info() const {
×
35
    auto& loop_analysis = analysis_manager_.get<analysis::LoopAnalysis>();
×
36
    analysis::LoopInfo loop_info = loop_analysis.loop_info(&node_);
×
37

NEW
38
    return InstrumentationInfo(
×
NEW
39
        node_.element_id(), node_.element_type(), TargetType_SEQUENTIAL, InstrumentationEventType::CPU, loop_info
×
NEW
40
    );
×
UNCOV
41
};
×
42

43
BreakDispatcher::BreakDispatcher(
44
    LanguageExtension& language_extension,
45
    StructuredSDFG& sdfg,
46
    analysis::AnalysisManager& analysis_manager,
47
    structured_control_flow::Break& node,
48
    InstrumentationPlan& instrumentation_plan,
49
    ArgCapturePlan& arg_capture_plan
50
)
51
    : NodeDispatcher(language_extension, sdfg, analysis_manager, node, instrumentation_plan, arg_capture_plan),
2✔
52
      node_(node) {
2✔
53

54
      };
2✔
55

56
void BreakDispatcher::dispatch_node(
57
    PrettyPrinter& main_stream, PrettyPrinter& globals_stream, CodeSnippetFactory& library_snippet_factory
58
) {
1✔
59
    main_stream << "break;" << std::endl;
1✔
60
};
1✔
61

62
ContinueDispatcher::ContinueDispatcher(
63
    LanguageExtension& language_extension,
64
    StructuredSDFG& sdfg,
65
    analysis::AnalysisManager& analysis_manager,
66
    structured_control_flow::Continue& node,
67
    InstrumentationPlan& instrumentation_plan,
68
    ArgCapturePlan& arg_capture_plan
69
)
70
    : NodeDispatcher(language_extension, sdfg, analysis_manager, node, instrumentation_plan, arg_capture_plan),
2✔
71
      node_(node) {
2✔
72

73
      };
2✔
74

75
void ContinueDispatcher::dispatch_node(
76
    PrettyPrinter& main_stream, PrettyPrinter& globals_stream, CodeSnippetFactory& library_snippet_factory
77
) {
1✔
78
    main_stream << "continue;" << std::endl;
1✔
79
};
1✔
80

81
ReturnDispatcher::ReturnDispatcher(
82
    LanguageExtension& language_extension,
83
    StructuredSDFG& sdfg,
84
    analysis::AnalysisManager& analysis_manager,
85
    structured_control_flow::Return& node,
86
    InstrumentationPlan& instrumentation_plan,
87
    ArgCapturePlan& arg_capture_plan
88
)
89
    : NodeDispatcher(language_extension, sdfg, analysis_manager, node, instrumentation_plan, arg_capture_plan),
3✔
90
      node_(node) {
3✔
91

92
      };
3✔
93

94
void ReturnDispatcher::dispatch_node(
95
    PrettyPrinter& main_stream, PrettyPrinter& globals_stream, CodeSnippetFactory& library_snippet_factory
96
) {
2✔
97
    // Emit teardown snippets before return
98
    for (auto& snippet : library_snippet_factory.teardown_snippets()) {
2✔
99
        main_stream << snippet;
×
100
    }
×
101

102
    // Free heap allocations
103
    for (auto& container : sdfg_.containers()) {
2✔
104
        if (sdfg_.is_external(container)) {
1✔
105
            continue;
×
106
        }
×
107
        auto& type = sdfg_.type(container);
1✔
108

109
        // Free if needed
110
        if (type.storage_type().deallocation() == types::StorageType::AllocationType::Managed) {
1✔
111
            if (type.storage_type().is_cpu_heap()) {
×
112
                main_stream << language_extension_.external_prefix() << "free(" << container << ");" << std::endl;
×
113
            } else if (type.storage_type().is_nv_generic()) {
×
114
                main_stream << "cudaSetDevice(0);" << std::endl;
×
115
                main_stream << "cudaFree(" << container << ");" << std::endl;
×
116
            }
×
117
        }
×
118
    }
1✔
119

120
    if (node_.is_data()) {
2✔
121
        std::string return_str = node_.data();
2✔
122
        if (sdfg_.is_external(node_.data())) {
2✔
123
            return_str = "&" + this->language_extension_.external_prefix() + return_str;
×
124
        }
×
125
        main_stream << "return " << return_str << ";" << std::endl;
2✔
126
    } else if (node_.is_constant()) {
2✔
127
        if (symbolic::is_nullptr(symbolic::symbol(node_.data()))) {
×
128
            if (this->language_extension_.language() == "C") {
×
129
                main_stream << "return NULL;" << std::endl;
×
130
            } else {
×
131
                main_stream << "return nullptr;" << std::endl;
×
132
            }
×
133
        } else {
×
134
            main_stream << "return " << node_.data() << ";" << std::endl;
×
135
        }
×
136
    }
×
137
};
2✔
138

139
} // namespace codegen
140
} // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc