• 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

66.67
/include/sdfg/codegen/code_generator.h
1
#pragma once
2

3
#include <filesystem>
4
#include <sstream>
5
#include <string>
6

7
#include "sdfg/codegen/instrumentation/instrumentation_strategy.h"
8
#include "sdfg/codegen/utils.h"
9
#include "sdfg/structured_sdfg.h"
10

11
namespace sdfg {
12
namespace codegen {
13

14
/**
15
 * @brief Base class for code generators
16
 *
17
 * This class provides the basic structure for code generators.
18
 * It contains the streams for the includes, classes, globals, library functions and main code.
19
 */
20
class CodeGenerator {
21
   protected:
22
    /// @brief Reference to the schedule
23
    StructuredSDFG& sdfg_;
24

25
    /// @brief Instrumentation strategy
26
    InstrumentationStrategy instrumentation_strategy_;
27

28
    /// @brief Stream for includes
29
    PrettyPrinter includes_stream_;
30

31
    /// @brief Stream for classes
32
    PrettyPrinter classes_stream_;
33

34
    /// @brief Stream for global variables and functions
35
    PrettyPrinter globals_stream_;
36

37
    /// @brief Stream for library functions
38
    PrettyPrinter library_stream_;
39

40
    /// @brief Main stream
41
    PrettyPrinter main_stream_;
42

43
   public:
44
    CodeGenerator(StructuredSDFG& sdfg, InstrumentationStrategy instrumentation_strategy)
32✔
45
        : sdfg_(sdfg), instrumentation_strategy_(instrumentation_strategy) {};
32✔
46

UNCOV
47
    virtual ~CodeGenerator() = default;
×
48

49
    /**
50
     * @brief Generate the code
51
     *
52
     * @return true if the code was generated successfully
53
     */
54
    virtual bool generate() = 0;
55

56
    /// @brief Generate a function definition for the SDFG
57
    virtual std::string function_definition() = 0;
58

59
    /// @brief Generate the SDFG's code into source files
60
    virtual bool as_source(const std::filesystem::path& header_path,
61
                           const std::filesystem::path& source_path,
62
                           const std::filesystem::path& library_path) = 0;
63

64
    /// @brief Get the includes
65
    const PrettyPrinter& includes() const { return this->includes_stream_; };
66

67
    /// @brief Get the classes
68
    const PrettyPrinter& classes() const { return this->classes_stream_; };
69

70
    /// @brief Get the globals
71
    const PrettyPrinter& globals() const { return this->globals_stream_; };
72

73
    /// @brief Get the library
74
    const PrettyPrinter& library() const { return this->library_stream_; };
75

76
    /// @brief Get the main stream
77
    const PrettyPrinter& main() const { return this->main_stream_; };
78
};
79

80
}  // namespace codegen
81
}  // 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