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

daisytuner / sdfglib / 15120496827

19 May 2025 06:29PM UTC coverage: 63.542% (-0.07%) from 63.608%
15120496827

push

github

web-flow
Merge pull request #21 from daisytuner/errors

adds invalid sdfg exception

5 of 14 new or added lines in 3 files covered. (35.71%)

7 existing lines in 2 files now uncovered.

8650 of 13613 relevant lines covered (63.54%)

481.54 hits per line

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

60.0
/include/sdfg/function.h
1
#pragma once
2

3
#include <cassert>
4
#include <fstream>
5
#include <functional>
6
#include <list>
7
#include <memory>
8
#include <nlohmann/json.hpp>
9
#include <ranges>
10
#include <string>
11
#include <unordered_map>
12
#include <unordered_set>
13
#include <vector>
14

15
#include "sdfg/element.h"
16
#include "sdfg/helpers/helpers.h"
17
#include "sdfg/symbolic/analysis.h"
18
#include "sdfg/symbolic/assumptions.h"
19
#include "sdfg/symbolic/symbolic.h"
20
#include "sdfg/types/array.h"
21
#include "sdfg/types/function.h"
22
#include "sdfg/types/pointer.h"
23
#include "sdfg/types/scalar.h"
24
#include "sdfg/types/structure.h"
25
#include "sdfg/types/type.h"
26

27
using json = nlohmann::json;
28

29
namespace sdfg {
30

31
class InvalidSDFGException : public std::exception {
32
   private:
33
    std::string message_;
34

35
   public:
NEW
36
    InvalidSDFGException(const std::string& message) : message_(message) {}
×
37

NEW
38
    const char* what() const noexcept override { return message_.c_str(); }
×
39
};
40

41
namespace builder {
42
class FunctionBuilder;
43
}
44

45
static std::string external_suffix = "__daisy__internal__";
46

47
class Function {
48
    friend class sdfg::builder::FunctionBuilder;
49

50
   protected:
51
    // Name
52
    std::string name_;
53

54
    // Data definition
55
    std::unordered_map<std::string, std::unique_ptr<types::IType>> containers_;
56
    std::unordered_map<std::string, std::unique_ptr<types::StructureDefinition>> structures_;
57

58
    // External data
59
    std::vector<std::string> arguments_;
60
    std::vector<std::string> externals_;
61

62
    // Symbolic assumptions
63
    symbolic::Assumptions assumptions_;
64

65
    Function(const std::string& name);
66

67
   public:
68
    Function(const Function& function) = delete;
69

70
    virtual ~Function() = default;
553✔
71

72
    /***** Section: Definition *****/
73

74
    std::string name() const;
75

76
    virtual const DebugInfo debug_info() const = 0;
77

78
    bool exists(const std::string& name) const;
79

80
    auto containers() const { return std::views::keys(this->containers_); };
154✔
81

82
    const types::IType& type(const std::string& name) const;
83

84
    auto structures() const { return std::views::keys(this->structures_); };
34✔
85

86
    const types::StructureDefinition& structure(const std::string& name) const;
87

88
    const std::vector<std::string>& arguments() const;
89

90
    const std::vector<std::string>& externals() const;
91

92
    bool is_argument(const std::string& name) const;
93

94
    bool is_external(const std::string& name) const;
95

96
    bool is_internal(const std::string& name) const;
97

98
    bool is_transient(const std::string& name) const;
99

100
    bool has_assumption(const symbolic::Symbol& symbol) const;
101

102
    const symbolic::Assumption& assumption(const symbolic::Symbol& symbol) const;
103

104
    symbolic::Assumption& assumption(const symbolic::Symbol& symbol);
105

106
    const symbolic::Assumptions& assumptions() const;
107

108
    /***** Section: Serialization *****/
109
};
110
}  // 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