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

daisytuner / sdfglib / 15453311876

04 Jun 2025 09:38PM UTC coverage: 58.159% (-0.3%) from 58.435%
15453311876

push

github

web-flow
Merge pull request #53 from daisytuner/element-ids

uses uuid as element id

206 of 236 new or added lines in 26 files covered. (87.29%)

6 existing lines in 6 files now uncovered.

8105 of 13936 relevant lines covered (58.16%)

107.66 hits per line

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

0.0
/src/codegen/instrumentation/outermost_loops_instrumentation.cpp
1
#include "sdfg/codegen/instrumentation/outermost_loops_instrumentation.h"
2

3
#include "sdfg/analysis/loop_tree_analysis.h"
4

5
namespace sdfg {
6
namespace codegen {
7

8
OutermostLoopsInstrumentation::OutermostLoopsInstrumentation(Schedule& schedule)
×
9
    : Instrumentation(schedule) {
×
NEW
10
    auto& analysis_manager = schedule.analysis_manager();
×
NEW
11
    auto& loop_tree_analysis = analysis_manager.get<analysis::LoopTreeAnalysis>();
×
NEW
12
    auto ols = loop_tree_analysis.outermost_loops();
×
NEW
13
    for (auto loop : ols) {
×
NEW
14
        this->outermost_loops_.insert(loop);
×
15
    }
NEW
16
}
×
17

NEW
18
bool OutermostLoopsInstrumentation::should_instrument(
×
19
    const structured_control_flow::ControlFlowNode& node) const {
UNCOV
20
    return this->outermost_loops_.count(&node);
×
21
}
22

NEW
23
void OutermostLoopsInstrumentation::begin_instrumentation(
×
24
    const structured_control_flow::ControlFlowNode& node, PrettyPrinter& stream) const {
25
    stream << "__daisy_instrument_enter();" << std::endl;
×
26
}
×
27

NEW
28
void OutermostLoopsInstrumentation::end_instrumentation(
×
29
    const structured_control_flow::ControlFlowNode& node, PrettyPrinter& stream) const {
NEW
30
    std::string region_name = schedule_.sdfg().name() + "_" + node.element_id();
×
31

NEW
32
    bool has_metadata =
×
NEW
33
        schedule_.sdfg().metadata().find("source_file") != schedule_.sdfg().metadata().end() &&
×
NEW
34
        schedule_.sdfg().metadata().find("features_path") != schedule_.sdfg().metadata().end();
×
35

36
    if (has_metadata) {
×
37
        stream << "__daisy_instrument_exit_with_metadata(";
×
38
    } else {
×
39
        stream << "__daisy_instrument_exit(";
×
40
    }
41

42
    stream << "\"" << region_name << "\", ";
×
43
    stream << "\"" << node.debug_info().filename() << "\", ";
×
44
    stream << node.debug_info().start_line() << ", ";
×
45
    stream << node.debug_info().end_line() << ", ";
×
46
    stream << node.debug_info().start_column() << ", ";
×
47
    stream << node.debug_info().end_column();
×
48

49
    if (has_metadata) {
×
50
        stream << ", ";
×
51
        stream << "\"" << schedule_.sdfg().metadata("source_file") << "\", ";
×
52

53
        std::string features_path =
NEW
54
            schedule_.sdfg().metadata("features_path") + "/" + region_name + ".npz";
×
55
        stream << "\"" << features_path << "\"";
×
56
    }
×
57

58
    stream << ");" << std::endl;
×
59
}
×
60

61
}  // namespace codegen
62
}  // 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

© 2025 Coveralls, Inc