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

daisytuner / docc / 29936384397

22 Jul 2026 04:04PM UTC coverage: 64.072% (+0.3%) from 63.782%
29936384397

Pull #868

github

web-flow
Merge 67eee0fe8 into d833d292d
Pull Request #868: Add tensor concatenation to PyTorch frontend (and MLIR frontend)

352 of 454 new or added lines in 19 files covered. (77.53%)

4 existing lines in 2 files now uncovered.

42634 of 66541 relevant lines covered (64.07%)

739.99 hits per line

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

74.0
/sdfg/src/codegen/utils.cpp
1
#include "sdfg/codegen/utils.h"
2

3
namespace sdfg {
4
namespace codegen {
5

6
// Constructor
7
PrettyPrinter::PrettyPrinter(int indent, bool frozen)
8
    : owned_stream(std::make_unique<std::stringstream>()), stream(*owned_stream.get()), indentSize(indent),
227✔
9
      frozen_(frozen) {}
227✔
10

11
PrettyPrinter::PrettyPrinter(std::ostream& stream, int indent, bool frozen)
12
    : stream(stream), indentSize(indent), frozen_(frozen) {}
×
13

14
// Set the indentation level
15
void PrettyPrinter::setIndent(int indent) { indentSize = indent; };
524✔
16

17
int PrettyPrinter::indent() const { return indentSize; };
356✔
18

19
int PrettyPrinter::changeIndent(int delta) { return indentSize += delta; };
×
20

21
// Get the underlying string
22
std::string PrettyPrinter::str() const { return owned_stream->str(); };
119✔
23

24
// Clear the stringstream content
25
void PrettyPrinter::clear() {
14✔
26
    owned_stream->str("");
14✔
27
    owned_stream->clear();
14✔
28
}
14✔
29

30
// Overload for manipulators (like std::endl)
31
PrettyPrinter& PrettyPrinter::operator<<(std::ostream& (*manip)(std::ostream&) ) {
1,607✔
32
    if (frozen_) {
1,607✔
33
        throw std::runtime_error("PrettyPrinter is frozen");
×
34
    }
×
35
    stream << manip;
1,607✔
36
    // Reset indent application on new lines
37
    if (manip == static_cast<std::ostream& (*) (std::ostream&)>(std::endl)) {
1,607✔
38
        isNewLine = true;
1,607✔
39
    }
1,607✔
40
    return *this;
1,607✔
41
};
1,607✔
42

43
// Apply indentation only at the beginning of a new line
44
void PrettyPrinter::applyIndent() {
4,793✔
45
    if (isNewLine && indentSize > 0) {
4,793✔
46
        stream << std::setw(indentSize) << "";
1,114✔
47
        isNewLine = false;
1,114✔
48
    }
1,114✔
49
};
4,793✔
50

51
Reference::Reference(const types::IType& reference_) : reference_(reference_.clone()) {};
16✔
52

53
Reference::Reference(
54
    types::StorageType storage_type, size_t alignment, const std::string& initializer, const types::IType& reference_
55
)
56
    : IType(storage_type, alignment, initializer), reference_(reference_.clone()) {};
6✔
57

58
std::unique_ptr<types::IType> Reference::clone() const {
5✔
59
    return std::make_unique<Reference>(this->storage_type(), this->alignment(), this->initializer(), *this->reference_);
5✔
60
};
5✔
61

62
types::TypeID Reference::type_id() const { return types::TypeID::Reference; };
30✔
63

64
types::PrimitiveType Reference::primitive_type() const { return this->reference_->primitive_type(); };
×
65

66
bool Reference::is_symbol() const { return false; };
1✔
67

68
const types::IType& Reference::reference_type() const { return *this->reference_; };
22✔
69

70
bool Reference::operator==(const types::IType& other) const {
4✔
71
    if (auto reference = dynamic_cast<const Reference*>(&other)) {
4✔
72
        return *(this->reference_) == *reference->reference_ && this->alignment_ == reference->alignment_;
4✔
73
    } else {
4✔
74
        return false;
×
75
    }
×
76
};
4✔
77

78
std::string Reference::print() const { return "Reference(" + this->reference_->print() + ")"; };
1✔
79

NEW
80
void Reference::replace_symbols(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
×
NEW
81
    this->reference_->replace_symbols(old_expression, new_expression);
×
NEW
82
}
×
83

NEW
84
void Reference::replace_symbols(const symbolic::ExpressionMapping& replacements) {
×
NEW
85
    this->reference_->replace_symbols(replacements);
×
NEW
86
}
×
87

88

89
} // namespace codegen
90
} // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc