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

daisytuner / docc / 27956659323

22 Jun 2026 01:34PM UTC coverage: 61.757% (-0.03%) from 61.782%
27956659323

Pull #802

github

web-flow
Merge acd09dfa2 into fe87d162b
Pull Request #802: adds reduce as new structured loop type

284 of 481 new or added lines in 14 files covered. (59.04%)

1 existing line in 1 file now uncovered.

37423 of 60597 relevant lines covered (61.76%)

1006.67 hits per line

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

70.0
/sdfg/src/structured_control_flow/reduce.cpp
1
#include "sdfg/structured_control_flow/reduce.h"
2

3
#include <string>
4

5
#include "sdfg/exceptions.h"
6
#include "sdfg/structured_control_flow/structured_loop.h"
7

8
namespace sdfg {
9
namespace structured_control_flow {
10

11
std::string reduction_operation_to_string(ReductionOperation op) {
2✔
12
    switch (op) {
2✔
13
        case ReductionOperation::Add:
1✔
14
            return "add";
1✔
NEW
15
        case ReductionOperation::Mul:
×
NEW
16
            return "mul";
×
NEW
17
        case ReductionOperation::Min:
×
NEW
18
            return "min";
×
19
        case ReductionOperation::Max:
1✔
20
            return "max";
1✔
21
    }
2✔
NEW
22
    throw InvalidSDFGException("Reduce: unknown reduction operation");
×
23
}
2✔
24

25
ReductionOperation reduction_operation_from_string(const std::string& value) {
1✔
26
    if (value == "add") {
1✔
NEW
27
        return ReductionOperation::Add;
×
28
    } else if (value == "mul") {
1✔
NEW
29
        return ReductionOperation::Mul;
×
30
    } else if (value == "min") {
1✔
NEW
31
        return ReductionOperation::Min;
×
32
    } else if (value == "max") {
1✔
33
        return ReductionOperation::Max;
1✔
34
    }
1✔
NEW
35
    throw InvalidSDFGException("Reduce: unknown reduction operation '" + value + "'");
×
36
}
1✔
37

38
Reduce::Reduce(
39
    size_t element_id,
40
    const DebugInfo& debug_info,
41
    ControlFlowNode* parent,
42
    symbolic::Symbol indvar,
43
    symbolic::Expression init,
44
    symbolic::Expression update,
45
    symbolic::Condition condition,
46
    std::vector<ReductionInfo> reductions,
47
    const ScheduleType& schedule_type
48
)
49
    : StructuredLoop(element_id, debug_info, parent, indvar, init, update, condition),
17✔
50
      reductions_(std::move(reductions)), schedule_type_(schedule_type) {};
17✔
51

52
void Reduce::validate(const Function& function) const { StructuredLoop::validate(function); };
9✔
53

54
const std::vector<ReductionInfo>& Reduce::reductions() const { return this->reductions_; };
23✔
55

56
const ScheduleType& Reduce::schedule_type() const { return this->schedule_type_; };
17✔
57

58
} // namespace structured_control_flow
59
} // 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