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

daisytuner / sdfglib / 15725654018

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

push

github

web-flow
Changes in order for the Einsum plugin to work correctly (#70)

* Copy include dir to build and install dir

* Also copy include dir of symengine

* Remove warning that inputs to library must be scalars

* Extended add_library_node to be variadic

* Added toStr() to LibraryNode for visualizer

* Added zero element to language extensions

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

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
    size_t element_counter_;
46

47
    // Name
48
    std::string name_;
49
    FunctionType type_;
50

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

55
    // External data
56
    std::vector<std::string> arguments_;
57
    std::vector<std::string> externals_;
58

59
    // Symbolic assumptions
60
    symbolic::Assumptions assumptions_;
61

62
    // Metadata
63
    std::unordered_map<std::string, std::string> metadata_;
64

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

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

70
    virtual ~Function() = default;
71

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

76
    /***** Section: Definition *****/
77

78
    std::string name() const;
79

80
    FunctionType type() const;
81

82
    virtual const DebugInfo debug_info() const = 0;
83

84
    bool exists(const std::string& name) const;
85

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

88
    const types::IType& type(const std::string& name) const;
89

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

518✔
92
    const types::StructureDefinition& structure(const std::string& name) const;
93

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

96
    const std::vector<std::string>& externals() const;
97

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

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

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

104
    bool is_transient(const std::string& name) const;
105

106
    bool has_assumption(const symbolic::Symbol& symbol) const;
107

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

110
    symbolic::Assumption& assumption(const symbolic::Symbol& symbol);
111

112
    const symbolic::Assumptions& assumptions() const;
113

114
    void add_metadata(const std::string& key, const std::string& value);
115

116
    void remove_metadata(const std::string& key);
117

118
    const std::string& metadata(const std::string& key) const;
119

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