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

daisytuner / sdfglib / 15725459639

18 Jun 2025 06:22AM UTC coverage: 61.594% (-3.1%) from 64.66%
15725459639

Pull #91

github

web-flow
Merge 30c726319 into 460b720e2
Pull Request #91: Einsum plugin

0 of 73 new or added lines in 6 files covered. (0.0%)

303 existing lines in 20 files now uncovered.

7589 of 12321 relevant lines covered (61.59%)

135.45 hits per line

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

90.91
/include/sdfg/analysis/analysis.h
1
#pragma once
2

3
#include "sdfg/structured_sdfg.h"
4

5
namespace sdfg {
6
namespace analysis {
7

8
class AnalysisManager;
9

10
class Analysis {
11
    friend class AnalysisManager;
12

13
   protected:
14
    StructuredSDFG& sdfg_;
15
    symbolic::Assumptions additional_assumptions_;
16

17
    virtual void run(analysis::AnalysisManager& analysis_manager) = 0;
18

19
   public:
20
    Analysis(StructuredSDFG& sdfg);
21

22
    virtual ~Analysis() = default;
980✔
23

24
    Analysis(const Analysis& a) = delete;
25
    Analysis& operator=(const Analysis&) = delete;
26
};
27

28
class AnalysisManager {
29
   private:
30
    StructuredSDFG& sdfg_;
31
    symbolic::Assumptions additional_assumptions_;
32

33
    std::unordered_map<std::type_index, std::unique_ptr<Analysis>> cache_;
34

35
   public:
36
    AnalysisManager(StructuredSDFG& sdfg);
37
    AnalysisManager(StructuredSDFG& sdfg, const symbolic::Assumptions& additional_assumptions);
38

39
    AnalysisManager(const AnalysisManager& am) = delete;
40
    AnalysisManager& operator=(const AnalysisManager&) = delete;
41

42
    template <class T>
43
    T& get() {
507✔
44
        std::type_index type = std::type_index(typeid(T));
507✔
45

46
        // Check cache
47
        auto it = cache_.find(type);
507✔
48
        if (it != cache_.end()) {
507✔
UNCOV
49
            return *static_cast<T*>(it->second.get());
×
50
        }
51

52
        // Run a new analysis
53
        cache_[type] = std::make_unique<T>(this->sdfg_);
507✔
54
        cache_[type]->additional_assumptions_ = this->additional_assumptions_;
507✔
55
        cache_[type]->run(*this);
507✔
56
        return *static_cast<T*>(cache_[type].get());
507✔
57
    }
507✔
58

59
    template <class T>
60
    void invalidate() {
61
        std::type_index type = std::type_index(typeid(T));
62
        if (cache_.find(type) != cache_.end()) {
63
            cache_.erase(type);
64
        }
65
    }
66

67
    void invalidate_all();
68
};
69

70
}  // namespace analysis
71
}  // 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

© 2026 Coveralls, Inc