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

daisytuner / sdfglib / 17656823807

11 Sep 2025 08:42PM UTC coverage: 60.447% (+1.1%) from 59.335%
17656823807

Pull #219

github

web-flow
Merge d5416236f into 6c1992b40
Pull Request #219: stdlib Library Nodes and ConstantNodes

460 of 1635 new or added lines in 81 files covered. (28.13%)

93 existing lines in 35 files now uncovered.

9385 of 15526 relevant lines covered (60.45%)

107.21 hits per line

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

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

3
#include <symengine/printers/codegen.h>
4

5
#include <string>
6

7
#include "sdfg/codegen/language_extension.h"
8
#include "sdfg/symbolic/symbolic.h"
9
#include "sdfg/types/type.h"
10

11
namespace sdfg {
12
namespace codegen {
13

14
class CPPLanguageExtension : public LanguageExtension {
15
public:
16
    CPPLanguageExtension() : LanguageExtension() {}
29✔
17

18
    CPPLanguageExtension(const std::vector<std::string>& external_variables) : LanguageExtension(external_variables) {}
19

NEW
20
    const std::string language() const override { return "C++"; }
×
21

5✔
22
    std::string primitive_type(const types::PrimitiveType prim_type) override;
23

24
    std::string declaration(
25
        const std::string& name, const types::IType& type, bool use_initializer = false, bool use_alignment = false
26
    ) override;
27

28
    std::string type_cast(const std::string& name, const types::IType& type) override;
29

30
    std::string subset(const Function& function, const types::IType& type, const data_flow::Subset& subset) override;
31

32
    std::string expression(const symbolic::Expression& expr) override;
33

34
    std::string access_node(const data_flow::AccessNode& node) override;
35

36
    std::string tasklet(const data_flow::Tasklet& tasklet) override;
37

38
    std::string zero(const types::PrimitiveType prim_type) override;
39
};
40

41
class CPPSymbolicPrinter : public SymEngine::BaseVisitor<CPPSymbolicPrinter, SymEngine::CodePrinter> {
42
public:
43
    using SymEngine::CodePrinter::apply;
44
    using SymEngine::CodePrinter::bvisit;
45
    using SymEngine::CodePrinter::str_;
46

47
    // Special values
48
    void bvisit(const SymEngine::Infty& x);
49
    void bvisit(const SymEngine::BooleanAtom& x);
50
    void bvisit(const SymEngine::Symbol& x);
51

52
    // Logical expressions
53
    void bvisit(const SymEngine::And& x);
54
    void bvisit(const SymEngine::Or& x);
55
    void bvisit(const SymEngine::Not& x);
56
    void bvisit(const SymEngine::Equality& x);
57
    void bvisit(const SymEngine::Unequality& x);
58

59
    // Functions
60
    void bvisit(const SymEngine::Min& x);
61
    void bvisit(const SymEngine::Max& x);
62
    void bvisit(const SymEngine::FunctionSymbol& x);
63

64
    void _print_pow(
65
        std::ostringstream& o,
66
        const SymEngine::RCP<const SymEngine::Basic>& a,
67
        const SymEngine::RCP<const SymEngine::Basic>& b
68
    ) override;
69
};
70

71
} // namespace codegen
72
} // 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