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

daisytuner / sdfglib / 15656007340

14 Jun 2025 08:51PM UTC coverage: 13.234% (-49.9%) from 63.144%
15656007340

Pull #76

github

web-flow
Merge 9586c8161 into 413c53212
Pull Request #76: New Loop Dependency Analysis

361 of 465 new or added lines in 7 files covered. (77.63%)

6215 existing lines in 110 files now uncovered.

1612 of 12181 relevant lines covered (13.23%)

13.64 hits per line

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

32.26
/src/types/utils.cpp
1
#include "sdfg/types/utils.h"
2

3
namespace sdfg {
4
namespace types {
5

6
const types::IType& infer_type(const sdfg::Function& function, const types::IType& type,
90✔
7
                               const data_flow::Subset& subset) {
8
    if (subset.empty()) {
90✔
9
        return type;
45✔
10
    }
11

12
    if (auto scalar_type = dynamic_cast<const types::Scalar*>(&type)) {
45✔
13
        if (!subset.empty()) {
×
14
            throw InvalidSDFGException("Scalar type must have no subset");
×
15
        }
16
        return *scalar_type;
×
17
    } else if (auto array_type = dynamic_cast<const types::Array*>(&type)) {
45✔
UNCOV
18
        data_flow::Subset element_subset(subset.begin() + 1, subset.end());
×
UNCOV
19
        return infer_type(function, array_type->element_type(), element_subset);
×
20
    } else if (auto pointer_type = dynamic_cast<const types::Pointer*>(&type)) {
45✔
21
        data_flow::Subset element_subset(subset.begin() + 1, subset.end());
45✔
22
        return infer_type(function, pointer_type->pointee_type(), element_subset);
45✔
23
    } else if (auto structure_type = dynamic_cast<const types::Structure*>(&type)) {
45✔
UNCOV
24
        auto& definition = function.structure(structure_type->name());
×
25

UNCOV
26
        data_flow::Subset element_subset(subset.begin() + 1, subset.end());
×
UNCOV
27
        auto member = SymEngine::rcp_dynamic_cast<const SymEngine::Integer>(subset.at(0));
×
UNCOV
28
        return infer_type(function, definition.member_type(member), element_subset);
×
UNCOV
29
    }
×
30

31
    throw InvalidSDFGException("Type inference failed");
×
32
};
90✔
33

UNCOV
34
std::unique_ptr<types::IType> recombine_array_type(const types::IType& type, uint depth,
×
35
                                                   const types::IType& inner_type) {
UNCOV
36
    if (depth == 0) {
×
UNCOV
37
        return inner_type.clone();
×
38
    } else {
UNCOV
39
        if (auto atype = dynamic_cast<const types::Array*>(&type)) {
×
UNCOV
40
            return std::make_unique<types::Array>(
×
UNCOV
41
                atype->storage_type(), atype->alignment(), atype->initializer(),
×
UNCOV
42
                *recombine_array_type(atype->element_type(), depth - 1, inner_type).get(),
×
UNCOV
43
                atype->num_elements());
×
44
        } else {
45
            throw std::runtime_error("construct_type: Non array types are not supported yet!");
×
46
        }
47
    }
UNCOV
48
};
×
49

50
}  // namespace types
51
}  // 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