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

daisytuner / sdfglib / 15187766828

22 May 2025 01:23PM UTC coverage: 60.482% (+0.003%) from 60.479%
15187766828

push

github

web-flow
Merge pull request #28 from daisytuner/sdfg-metadata

adds metadata to SDFGs

21 of 37 new or added lines in 6 files covered. (56.76%)

1 existing line in 1 file now uncovered.

8023 of 13265 relevant lines covered (60.48%)

102.83 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) {
×
10
        auto& analysis_manager = schedule.analysis_manager();
×
11
        auto& loop_tree_analysis = analysis_manager.get<analysis::LoopTreeAnalysis>();
×
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(const structured_control_flow::ControlFlowNode& node) const {
×
19
    return this->outermost_loops_.count(&node);
×
20
}
21

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

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

NEW
29
    bool has_metadata = schedule_.sdfg().metadata().find("source_file") != schedule_.sdfg().metadata().end() && schedule_.sdfg().metadata().find("features_path") != schedule_.sdfg().metadata().end();
×
30

NEW
31
    if (has_metadata) {
×
NEW
32
        stream << "__daisy_instrument_exit_with_metadata(";
×
NEW
33
    } else {
×
NEW
34
        stream << "__daisy_instrument_exit(";
×
35
    }
36

NEW
37
    stream << "\"" << region_name << "\", ";
×
38
    stream << "\"" << node.debug_info().filename() << "\", ";
×
39
    stream << node.debug_info().start_line() << ", ";
×
40
    stream << node.debug_info().end_line() << ", ";
×
41
    stream << node.debug_info().start_column() << ", ";
×
NEW
42
    stream << node.debug_info().end_column();
×
43

NEW
44
    if (has_metadata) {
×
NEW
45
        stream << ", ";
×
NEW
46
        stream << "\"" << schedule_.sdfg().metadata("source_file") << "\", ";
×
47

NEW
48
        std::string features_path = schedule_.sdfg().metadata("features_path") + "/" + region_name + ".npz";
×
NEW
49
        stream << "\"" << features_path << "\"";
×
NEW
50
    }
×
51
    
NEW
52
    stream << ");" << std::endl;
×
UNCOV
53
}
×
54

55
}
56
}
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