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

daisytuner / sdfglib / 15518226219

08 Jun 2025 12:03PM UTC coverage: 61.652% (-0.8%) from 62.447%
15518226219

push

github

web-flow
Merge pull request #65 from daisytuner/lib-nodes-plugins

Adds registry for library node dispatchers

41 of 77 new or added lines in 5 files covered. (53.25%)

124 existing lines in 10 files now uncovered.

7249 of 11758 relevant lines covered (61.65%)

125.57 hits per line

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

43.24
/src/transformations/utils.cpp
1
#include "sdfg/transformations/utils.h"
2

3
#include "sdfg/structured_control_flow/structured_loop.h"
4
#include "sdfg/symbolic/symbolic.h"
5
#include "symengine/logic.h"
6

7
using namespace sdfg;
8

9
symbolic::Integer sdfg::get_iteration_count(sdfg::structured_control_flow::StructuredLoop& loop) {
5✔
10
    auto condition = loop.condition();
5✔
11
    // TODO: extend me to support more complex loop conditions and update expressions
12
    if (SymEngine::is_a<SymEngine::And>(*condition)) {
5✔
UNCOV
13
        auto and_condition = SymEngine::rcp_static_cast<const SymEngine::And>(condition);
×
UNCOV
14
        auto container = and_condition->get_container();
×
UNCOV
15
        for (auto it = container.begin(); it != container.end(); ++it) {
×
UNCOV
16
            if (!SymEngine::is_a<SymEngine::StrictLessThan>(**it)) {
×
17
                return SymEngine::null;
×
18
            }
UNCOV
19
            auto stl = SymEngine::rcp_static_cast<const SymEngine::StrictLessThan>(*it);
×
UNCOV
20
            auto lhs = stl->get_args()[0];
×
UNCOV
21
            auto rhs = stl->get_args()[1];
×
UNCOV
22
            if (!symbolic::eq(lhs, loop.indvar())) {
×
23
                std::swap(lhs, rhs);
×
24
            }
×
UNCOV
25
            if (!symbolic::eq(lhs, loop.indvar())) {
×
26
                continue;
×
27
            }
UNCOV
28
            auto bound = rhs;
×
UNCOV
29
            auto range = symbolic::sub(bound, loop.init());
×
UNCOV
30
            if (SymEngine::is_a<SymEngine::Integer>(*range)) {
×
UNCOV
31
                return SymEngine::rcp_static_cast<const SymEngine::Integer>(range);
×
32
            }
UNCOV
33
        }
×
34
    } else if (SymEngine::is_a<SymEngine::StrictLessThan>(*condition)) {
5✔
35
        auto stl = SymEngine::rcp_static_cast<const SymEngine::StrictLessThan>(condition);
5✔
36
        auto lhs = stl->get_args()[0];
5✔
37
        auto rhs = stl->get_args()[1];
5✔
38
        if (!symbolic::eq(lhs, loop.indvar())) {
5✔
39
            std::swap(lhs, rhs);
×
40
        }
×
41
        if (!symbolic::eq(lhs, loop.indvar())) {
5✔
42
            return SymEngine::null;
×
43
        }
44
        auto bound = rhs;
5✔
45
        auto range = symbolic::sub(bound, loop.init());
5✔
46
        if (SymEngine::is_a<SymEngine::Integer>(*range)) {
5✔
47
            return SymEngine::rcp_static_cast<const SymEngine::Integer>(range);
4✔
48
        }
49
    }
5✔
50
    return SymEngine::null;
1✔
51
};
5✔
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