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

daisytuner / sdfglib / 16020329222

02 Jul 2025 08:40AM UTC coverage: 64.148% (-0.02%) from 64.171%
16020329222

Pull #127

github

web-flow
Merge 03d5833b6 into 207c3a3b4
Pull Request #127: Fixes capture args for 3 dimensions

20 of 33 new or added lines in 1 file covered. (60.61%)

5 existing lines in 1 file now uncovered.

8728 of 13606 relevant lines covered (64.15%)

178.15 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_analysis.h"
4

5
namespace sdfg {
6
namespace codegen {
7

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

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

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

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

32
    bool has_metadata = sdfg_.metadata().find("source_file") != sdfg_.metadata().end() &&
×
33
                        sdfg_.metadata().find("features_path") != sdfg_.metadata().end();
×
34

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

41
    stream << "\"" << region_name << "\", ";
×
42
    stream << "\"" << node.debug_info().filename() << "\", ";
×
43
    if (sdfg_.metadata().find("function") != sdfg_.metadata().end()) {
×
44
        stream << "\"" << sdfg_.metadata("function") << "\", ";
×
45
    } else {
×
46
        stream << "\"\", ";
×
47
    }
48
    stream << node.debug_info().start_line() << ", ";
×
49
    stream << node.debug_info().end_line() << ", ";
×
50
    stream << node.debug_info().start_column() << ", ";
×
51
    stream << node.debug_info().end_column();
×
52

53
    if (has_metadata) {
×
54
        stream << ", ";
×
55
        stream << "\"" << sdfg_.metadata("source_file") << "\", ";
×
56

57
        std::string features_path = sdfg_.metadata("features_path") + "/" + region_name + ".npz";
×
58
        stream << "\"" << features_path << "\"";
×
59
    }
×
60

61
    stream << ");" << std::endl;
×
62
}
×
63

64
}  // namespace codegen
65
}  // 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