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

daisytuner / docc / 28177795453

25 Jun 2026 02:33PM UTC coverage: 61.743% (+0.1%) from 61.644%
28177795453

Pull #802

github

web-flow
Merge 08f22df91 into fe9abd1cb
Pull Request #802: adds reduce as new structured loop type

705 of 985 new or added lines in 34 files covered. (71.57%)

5 existing lines in 4 files now uncovered.

38837 of 62901 relevant lines covered (61.74%)

978.19 hits per line

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

68.97
/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) {
3✔
12
    switch (op) {
3✔
13
        case ReductionOperation::Add:
2✔
14
            return "add";
2✔
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
    }
3✔
NEW
22
    throw InvalidSDFGException("Reduce: unknown reduction operation");
×
23
}
3✔
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, schedule_type),
44✔
50
      reductions_(std::move(reductions)) {};
44✔
51

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

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

56
} // namespace structured_control_flow
57
} // 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