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

daisytuner / sdfglib / 15656007340

14 Jun 2025 08:51PM UTC coverage: 13.234% (-49.9%) from 63.144%
15656007340

Pull #76

github

web-flow
Merge 9586c8161 into 413c53212
Pull Request #76: New Loop Dependency Analysis

361 of 465 new or added lines in 7 files covered. (77.63%)

6215 existing lines in 110 files now uncovered.

1612 of 12181 relevant lines covered (13.23%)

13.64 hits per line

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

33.33
/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/exceptions.h"
17
#include "sdfg/helpers/helpers.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
namespace builder {
32
class FunctionBuilder;
33
}
34

35
static std::string external_suffix = "__daisy__internal__";
36

37
typedef StringEnum FunctionType;
38
inline constexpr FunctionType FunctionType_CPU{"CPU"};
39
inline constexpr FunctionType FunctionType_NV_GLOBAL{"NV_GLOBAL"};
40

41
class Function {
42
    friend class sdfg::builder::FunctionBuilder;
43

44
   protected:
45
    // Name
46
    std::string name_;
47
    FunctionType type_;
48

49
    // Data definition
50
    std::unordered_map<std::string, std::unique_ptr<types::IType>> containers_;
51
    std::unordered_map<std::string, std::unique_ptr<types::StructureDefinition>> structures_;
52

53
    // External data
54
    std::vector<std::string> arguments_;
55
    std::vector<std::string> externals_;
56

57
    // Symbolic assumptions
58
    symbolic::Assumptions assumptions_;
59

60
    // Metadata
61
    std::unordered_map<std::string, std::string> metadata_;
62

63
    Function(const std::string& name, FunctionType type);
64

65
   public:
66
    Function(const Function& function) = delete;
67

68
    virtual ~Function() = default;
69

70
    // Static types for reserved symbols
71
    static const std::unique_ptr<types::Scalar> NVPTX_SYMBOL_TYPE;
72
    static const std::unique_ptr<types::Pointer> CONST_POINTER_TYPE;
73

74
    /***** Section: Definition *****/
75

76
    std::string name() const;
77

78
    FunctionType type() const;
79

80
    virtual const DebugInfo debug_info() const = 0;
81

82
    bool exists(const std::string& name) const;
83

UNCOV
84
    auto containers() const { return std::views::keys(this->containers_); };
×
85

86
    const types::IType& type(const std::string& name) const;
87

UNCOV
88
    auto structures() const { return std::views::keys(this->structures_); };
×
89

17✔
90
    const types::StructureDefinition& structure(const std::string& name) const;
91

92
    const std::vector<std::string>& arguments() const;
93

94
    const std::vector<std::string>& externals() const;
95

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

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

100
    bool is_internal(const std::string& name) const;
101

102
    bool is_transient(const std::string& name) const;
103

104
    bool has_assumption(const symbolic::Symbol& symbol) const;
105

106
    const symbolic::Assumption& assumption(const symbolic::Symbol& symbol) const;
107

108
    symbolic::Assumption& assumption(const symbolic::Symbol& symbol);
109

110
    const symbolic::Assumptions& assumptions() const;
111

112
    void add_metadata(const std::string& key, const std::string& value);
113

114
    void remove_metadata(const std::string& key);
115

116
    const std::string& metadata(const std::string& key) const;
117

118
    const std::unordered_map<std::string, std::string>& metadata() const;
119
};
120
}  // 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