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

daisytuner / sdfglib / 15262928007

26 May 2025 10:36PM UTC coverage: 58.284% (-2.0%) from 60.304%
15262928007

push

github

web-flow
Merge pull request #36 from daisytuner/sdfg-validation

Introduces new definition of memlets plus sanity checks

104 of 266 new or added lines in 6 files covered. (39.1%)

241 existing lines in 15 files now uncovered.

7908 of 13568 relevant lines covered (58.28%)

96.1 hits per line

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

85.71
/src/structured_control_flow/for.cpp
1
#include "sdfg/structured_control_flow/for.h"
2

3
#include "sdfg/symbolic/symbolic.h"
4

5
namespace sdfg {
6
namespace structured_control_flow {
7

8
For::For(size_t element_id, const DebugInfo& debug_info, symbolic::Symbol indvar,
226✔
9
         symbolic::Expression init, symbolic::Expression update, symbolic::Condition condition)
10
    : ControlFlowNode(element_id, debug_info),
113✔
11
      indvar_(indvar),
113✔
12
      init_(init),
113✔
13
      update_(update),
113✔
14
      condition_(condition) {
226✔
15
    this->root_ = std::unique_ptr<Sequence>(new Sequence(++element_id, debug_info));
113✔
16
};
113✔
17

18
const symbolic::Symbol& For::indvar() const { return this->indvar_; };
74✔
19

20
symbolic::Symbol& For::indvar() { return this->indvar_; };
620✔
21

22
const symbolic::Expression& For::init() const { return this->init_; };
2✔
23

24
symbolic::Expression& For::init() { return this->init_; };
304✔
25

26
const symbolic::Expression& For::update() const { return this->update_; };
72✔
27

28
symbolic::Expression& For::update() { return this->update_; };
368✔
29

30
const symbolic::Condition& For::condition() const { return this->condition_; };
4✔
31

32
symbolic::Condition& For::condition() { return this->condition_; };
304✔
33

34
Sequence& For::root() const { return *this->root_; };
672✔
35

36
void For::replace(const symbolic::Expression& old_expression,
2✔
37
                  const symbolic::Expression& new_expression) {
38
    if (symbolic::eq(this->indvar_, old_expression)) {
2✔
UNCOV
39
        if (!SymEngine::is_a<SymEngine::Symbol>(*new_expression)) {
×
40
            throw InvalidSDFGException("For: New Indvar must be a symbol");
×
41
        }
UNCOV
42
        this->indvar_ = SymEngine::rcp_static_cast<const SymEngine::Symbol>(new_expression);
×
UNCOV
43
    }
×
44
    this->init_ = symbolic::subs(this->init_, old_expression, new_expression);
2✔
45
    this->update_ = symbolic::subs(this->update_, old_expression, new_expression);
2✔
46
    this->condition_ = symbolic::subs(this->condition_, old_expression, new_expression);
2✔
47

48
    this->root_->replace(old_expression, new_expression);
2✔
49
};
2✔
50

51
}  // namespace structured_control_flow
52
}  // 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