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

daisytuner / sdfglib / 16188914472

10 Jul 2025 07:30AM UTC coverage: 64.808% (+0.1%) from 64.705%
16188914472

push

github

web-flow
Merge pull request #138 from daisytuner/tenstorrent/trivial

lib_stream -> lib_snippet_factory in code generation

131 of 243 new or added lines in 18 files covered. (53.91%)

3 existing lines in 3 files now uncovered.

8545 of 13185 relevant lines covered (64.81%)

179.13 hits per line

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

25.0
/include/sdfg/codegen/code_snippet_factory.h
1
#pragma once
2
#include <string>
3

4
#include "utils.h"
5

6
namespace sdfg {
7
namespace codegen {
8

9
inline std::string CODE_SNIPPET_INIT_ONCE = "init_once";
10
inline std::string CODE_SNIPPET_DEINIT_ONCE = "deinit_once";
11

12
class CodeSnippet {
13
protected:
14
    PrettyPrinter stream_;
15
    std::string extension_;
16
    bool as_file_;
17

18
public:
NEW
19
    CodeSnippet(const std::string& extension, bool as_file) : extension_(extension), as_file_(as_file) {};
×
20

21
    PrettyPrinter& stream() { return stream_; }
22

23
    const PrettyPrinter& stream() const { return stream_; }
24

NEW
25
    const std::string& extension() const { return extension_; }
×
26

27
    bool is_as_file() const { return as_file_; }
28
};
29

30
class CodeSnippetFactory {
31
protected:
32
    std::unordered_map<std::string, CodeSnippet> snippets_;
33
    const std::filesystem::path output_path_;
34
    const std::filesystem::path header_path_;
35

36
public:
37
    CodeSnippetFactory(const std::pair<std::filesystem::path, std::filesystem::path>* config = nullptr);
38

39
    virtual ~CodeSnippetFactory() = default;
33✔
NEW
40

×
41
    CodeSnippet& require(const std::string& name, const std::string& extension, bool as_file = true);
42

43
    std::unordered_map<std::string, CodeSnippet>::iterator find(const std::string& name);
44

45
    const std::unordered_map<std::string, CodeSnippet>& snippets() const;
46

47
    const std::filesystem::path& output_path() const { return output_path_; }
48
    const std::filesystem::path& header_path() const { return header_path_; }
49
};
50

51

52
} // namespace codegen
53
} // 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

© 2025 Coveralls, Inc