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

daisytuner / sdfglib / 19496232534

19 Nov 2025 09:22AM UTC coverage: 62.105% (-0.08%) from 62.184%
19496232534

push

github

web-flow
Merge pull request #354 from daisytuner/tenstorrent-transform

Tenstorrent transform

52 of 95 new or added lines in 15 files covered. (54.74%)

28 existing lines in 8 files now uncovered.

11141 of 17939 relevant lines covered (62.1%)

112.04 hits per line

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

76.92
/src/types/structure.cpp
1
#include "sdfg/types/structure.h"
2

3
#include "sdfg/types/scalar.h"
4

5
namespace sdfg {
6
namespace types {
7

8
Structure::Structure(const std::string& name) : name_(name) {};
31✔
9

10
Structure::Structure(StorageType storage_type, size_t alignment, const std::string& initializer, const std::string& name)
27✔
11
    : IType(storage_type, alignment, initializer), name_(name) {};
27✔
12

13
PrimitiveType Structure::primitive_type() const { return PrimitiveType::Void; };
1✔
14

15
bool Structure::is_symbol() const { return false; };
4✔
16

17
TypeID Structure::type_id() const { return TypeID::Structure; };
52✔
18

19
const std::string& Structure::name() const { return this->name_; };
36✔
20

21
bool Structure::operator==(const IType& other) const {
13✔
22
    if (auto structure_ = dynamic_cast<const Structure*>(&other)) {
13✔
23
        return this->name_ == structure_->name_;
7✔
24
    } else {
25
        return false;
6✔
26
    }
27
};
13✔
28

29
std::unique_ptr<IType> Structure::clone() const {
24✔
30
    return std::make_unique<Structure>(this->storage_type(), this->alignment(), this->initializer(), this->name_);
24✔
31
};
×
32

NEW
33
std::string Structure::print() const { return "Structure(" + this->name_ + ")"; }
×
34

NEW
35
bool Structure::is_pointer_like() const { return this->name_.starts_with("std::shared_ptr"); }
×
36

37
StructureDefinition::StructureDefinition(const std::string& name, bool is_packed)
24✔
38
    : name_(name), is_packed_(is_packed), members_() {};
24✔
39

40
std::unique_ptr<StructureDefinition> StructureDefinition::clone() const {
1✔
41
    auto def = std::make_unique<StructureDefinition>(this->name_, this->is_packed_);
1✔
42
    for (unsigned i = 0; i < this->num_members(); i++) {
3✔
43
        def->add_member(this->member_type(symbolic::integer(i)));
2✔
44
    }
2✔
45
    return def;
1✔
46
};
1✔
47

48
const std::string& StructureDefinition::name() const { return this->name_; };
8✔
49

50
bool StructureDefinition::is_packed() const { return this->is_packed_; };
18✔
51

52
size_t StructureDefinition::num_members() const { return this->members_.size(); };
74✔
53

54
const IType& StructureDefinition::member_type(symbolic::Integer index) const {
57✔
55
    return *this->members_.at(index->as_uint());
57✔
56
};
57

58
void StructureDefinition::add_member(const IType& member_type) { this->members_.push_back(member_type.clone()); };
30✔
59

60
bool StructureDefinition::is_vector() const {
11✔
61
    if (this->num_members() == 0) {
11✔
62
        return false;
×
63
    }
64
    auto& first_member_type = this->member_type(symbolic::zero());
11✔
65
    if (first_member_type.type_id() != TypeID::Scalar) {
11✔
66
        return false;
×
67
    }
68
    for (size_t i = 1; i < this->num_members(); i++) {
11✔
69
        if (!(this->member_type(symbolic::integer(i)) == first_member_type)) {
1✔
70
            return false;
1✔
71
        }
72
    }
×
73
    return true;
10✔
74
}
11✔
75

76
const Scalar& StructureDefinition::vector_element_type() const {
10✔
77
    return dynamic_cast<const Scalar&>(this->member_type(symbolic::zero()));
10✔
78
}
×
79

80
const size_t StructureDefinition::vector_size() const {
×
81
    if (!this->is_vector()) {
×
82
        return 0;
×
83
    }
84
    return this->num_members();
×
85
}
×
86

87
} // namespace types
88
} // 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