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

daisytuner / sdfglib / 16069945621

04 Jul 2025 08:56AM UTC coverage: 64.375% (-0.2%) from 64.606%
16069945621

push

github

web-flow
Merge pull request #137 from daisytuner/clang-format

runs clang-format on codebase

609 of 827 new or added lines in 63 files covered. (73.64%)

46 existing lines in 30 files now uncovered.

8578 of 13325 relevant lines covered (64.38%)

177.24 hits per line

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

76.92
/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(
4✔
14
    builder::StructuredSDFGBuilder& builder,
15
    analysis::AnalysisManager& analysis_manager,
16
    const nlohmann::json& transformation_data,
17
    bool skip_if_not_applicable
18
) {
19
    for (const auto& desc : transformation_data) {
9✔
20
        auto transformation_name = desc["transformation_type"];
6✔
21

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

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

49
} // namespace transformations
50
} // 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