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

daisytuner / sdfglib / 16177762953

09 Jul 2025 06:53PM UTC coverage: 64.705% (-0.005%) from 64.71%
16177762953

push

github

lukastruemper
fixes features path in instrumentation

0 of 8 new or added lines in 1 file covered. (0.0%)

3 existing lines in 1 file now uncovered.

8578 of 13257 relevant lines covered (64.71%)

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

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

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

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

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

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

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

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

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

NEW
55
        std::string source_file = sdfg_.metadata("source_file");
×
NEW
56
        std::string source_file_stem = source_file.substr(0, source_file.find_last_of('.'));
×
NEW
57
        std::string features_file = source_file_stem + "_" + std::to_string(node.element_id()) + ".npz";
×
58

NEW
59
        stream << "\"" << features_file << "\"";
×
UNCOV
60
    }
×
61

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

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