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

daisytuner / sdfglib / 15966836043

30 Jun 2025 07:38AM UTC coverage: 64.811% (+0.009%) from 64.802%
15966836043

push

github

web-flow
Merge pull request #110 from daisytuner/auto-tuner

Skip transformation if not applicable

15 of 21 new or added lines in 2 files covered. (71.43%)

1 existing line in 1 file now uncovered.

8638 of 13328 relevant lines covered (64.81%)

156.04 hits per line

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

71.88
/src/transformations/recorder.cpp
1
#include <sdfg/transformations/loop_distribute.h>
2
#include <sdfg/transformations/loop_interchange.h>
3
#include <sdfg/transformations/loop_slicing.h>
4
#include <sdfg/transformations/loop_tiling.h>
5
#include <sdfg/transformations/out_local_storage.h>
6
#include <sdfg/transformations/recorder.h>
7

8
namespace sdfg {
9
namespace transformations {
10

11
Recorder::Recorder() : history_(nlohmann::json::array()) {}
11✔
12

13
void Recorder::replay(builder::StructuredSDFGBuilder& builder,
4✔
14
                      analysis::AnalysisManager& analysis_manager,
15
                      const nlohmann::json& transformation_data, bool skip_if_not_applicable) {
16
    for (const auto& desc : transformation_data) {
9✔
17
        auto transformation_name = desc["transformation_type"];
6✔
18

19
        if (transformation_name == "LoopTiling") {
6✔
20
            this->apply<transformations::LoopTiling>(builder, analysis_manager, desc,
8✔
21
                                                     skip_if_not_applicable);
4✔
22
        } else if (transformation_name == "LoopDistribute") {
5✔
NEW
23
            this->apply<transformations::LoopDistribute>(builder, analysis_manager, desc,
×
NEW
24
                                                         skip_if_not_applicable);
×
25
        } else if (transformation_name == "LoopInterchange") {
2✔
26
            this->apply<transformations::LoopInterchange>(builder, analysis_manager, desc,
2✔
27
                                                          skip_if_not_applicable);
1✔
28
        } else if (transformation_name == "LoopSlicing") {
2✔
29
            this->apply<transformations::LoopSlicing>(builder, analysis_manager, desc,
2✔
30
                                                      skip_if_not_applicable);
1✔
31
        } else if (transformation_name == "OutLocalStorage") {
1✔
NEW
32
            this->apply<transformations::OutLocalStorage>(builder, analysis_manager, desc,
×
NEW
33
                                                          skip_if_not_applicable);
×
34
        } else {
×
35
            throw transformations::InvalidTransformationDescriptionException(
×
36
                "Unknown transformation: " + transformation_name.get<std::string>());
×
37
        }
38
    }
6✔
39
}
4✔
40

41
void Recorder::save(std::filesystem::path path) const {
3✔
42
    std::ofstream file(path);
3✔
43
    if (!file.is_open()) {
3✔
44
        throw std::runtime_error("Failed to open file for saving transformations: " +
×
45
                                 path.string());
×
46
    }
47
    file << history_.dump(4);  // Pretty print with an indent of 4 spaces
3✔
48
    file.close();
3✔
49
}
3✔
50

51
}  // namespace transformations
52
}  // 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