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

daisytuner / docc / 23906044628

02 Apr 2026 02:40PM UTC coverage: 64.553% (+0.08%) from 64.474%
23906044628

Pull #632

github

web-flow
Merge b2698daab into 3125b927b
Pull Request #632: Separate can_be_applied and apply for GPUTilling during Loop Scheduling

282 of 348 new or added lines in 16 files covered. (81.03%)

29 existing lines in 10 files now uncovered.

28998 of 44921 relevant lines covered (64.55%)

453.01 hits per line

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

49.45
/sdfg/src/offloading/data_offloading_node.cpp
1
#include "sdfg/targets/offloading/data_offloading_node.h"
2

3
#include <cstddef>
4
#include <string>
5
#include <vector>
6

7
#include "sdfg/data_flow/data_flow_graph.h"
8
#include "sdfg/data_flow/library_node.h"
9
#include "sdfg/element.h"
10
#include "sdfg/exceptions.h"
11
#include "sdfg/graph/graph.h"
12
#include "sdfg/symbolic/symbolic.h"
13

14
namespace sdfg {
15
namespace offloading {
16

17
DataOffloadingNode::DataOffloadingNode(
18
    size_t element_id,
19
    const DebugInfo& debug_info,
20
    const graph::Vertex vertex,
21
    data_flow::DataFlowGraph& parent,
22
    const data_flow::LibraryNodeCode code,
23
    const std::vector<std::string>& outputs,
24
    const std::vector<std::string>& inputs,
25
    DataTransferDirection transfer_direction,
26
    BufferLifecycle buffer_lifecycle,
27
    symbolic::Expression size
28
)
29
    : data_flow::LibraryNode(
55✔
30
          element_id, debug_info, vertex, parent, code, outputs, inputs, true, data_flow::ImplementationType_NONE
55✔
31
      ),
55✔
32
      transfer_direction_(transfer_direction), buffer_lifecycle_(buffer_lifecycle), size_(std::move(size)) {}
55✔
33

34
DataTransferDirection DataOffloadingNode::transfer_direction() const { return this->transfer_direction_; }
219✔
35

36
BufferLifecycle DataOffloadingNode::buffer_lifecycle() const { return this->buffer_lifecycle_; }
89✔
37

38
const symbolic::Expression DataOffloadingNode::size() const { return this->size_; }
89✔
39

40
const symbolic::Expression DataOffloadingNode::alloc_size() const { return this->size(); }
×
41

42
symbolic::SymbolSet DataOffloadingNode::symbols() const {
22✔
43
    if (this->size().is_null()) {
22✔
44
        return {};
×
45
    } else {
22✔
46
        return symbolic::atoms(this->size());
22✔
47
    }
22✔
48
}
22✔
49

50
void DataOffloadingNode::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
15✔
51
    if (!this->size_.is_null()) {
15✔
52
        this->size_ = symbolic::subs(this->size_, old_expression, new_expression);
15✔
53
    }
15✔
54
}
15✔
55

56
std::string DataOffloadingNode::toStr() const {
×
57
    std::string direction, lifecycle;
×
58
    switch (this->transfer_direction()) {
×
59
        case DataTransferDirection::D2H:
×
60
            direction = " D2H";
×
61
            break;
×
62
        case DataTransferDirection::H2D:
×
63
            direction = " H2D";
×
64
            break;
×
65
        default:
×
66
            direction = " NONE";
×
67
            break;
×
68
    }
×
69
    switch (this->buffer_lifecycle()) {
×
70
        case BufferLifecycle::FREE:
×
71
            lifecycle = " FREE";
×
72
            break;
×
73
        case BufferLifecycle::ALLOC:
×
74
            lifecycle = " ALLOC";
×
75
            break;
×
76
        default:
×
77
            lifecycle = " NO_CHANGE";
×
78
            break;
×
79
    }
×
80
    return std::string(this->code_.value()) + direction + lifecycle;
×
81
}
×
82

UNCOV
83
symbolic::Expression DataOffloadingNode::flop() const { return symbolic::zero(); }
×
84

85
bool DataOffloadingNode::redundant_with(const DataOffloadingNode& other) const {
3✔
86
    if (code() != other.code()) {
3✔
87
        return false;
×
88
    }
×
89
    if ((static_cast<int8_t>(transfer_direction()) + static_cast<int8_t>(other.transfer_direction())) != 0) {
3✔
90
        return false; // not the inverse
×
91
    }
×
92
    if ((static_cast<int8_t>(buffer_lifecycle()) + static_cast<int8_t>(other.buffer_lifecycle())) != 0) {
3✔
93
        return false;
×
94
    }
×
95

96
    if (!symbolic::null_safe_eq(size(), other.size())) {
3✔
97
        return false;
1✔
98
    }
1✔
99

100
    return true; // add more checks in sub-classes
2✔
101
}
3✔
102

103
bool DataOffloadingNode::equal_with(const DataOffloadingNode& other) const {
8✔
104
    if (code() != other.code()) {
8✔
105
        return false;
×
106
    }
×
107
    if (this->transfer_direction() != other.transfer_direction()) {
8✔
108
        return false;
×
109
    }
×
110
    if (this->buffer_lifecycle() != other.buffer_lifecycle()) {
8✔
111
        return false;
×
112
    }
×
113

114
    if (!symbolic::null_safe_eq(size(), other.size())) {
8✔
115
        return false;
×
116
    }
×
117

118
    return true; // add more checks in sub-classes
8✔
119
}
8✔
120

121
bool DataOffloadingNode::is_d2h() const { return is_D2H(this->transfer_direction()); }
102✔
122

123
bool DataOffloadingNode::is_h2d() const { return is_H2D(this->transfer_direction()); }
87✔
124

125
bool DataOffloadingNode::has_transfer() const { return this->is_d2h() || this->is_h2d(); }
17✔
126

127
bool DataOffloadingNode::is_free() const { return is_FREE(this->buffer_lifecycle()); }
30✔
128

129
bool DataOffloadingNode::is_alloc() const { return is_ALLOC(this->buffer_lifecycle()); }
29✔
130

131
void DataOffloadingNode::remove_free() {
1✔
132
    if (this->is_free()) {
1✔
133
        if (!this->has_transfer()) {
1✔
134
            throw InvalidSDFGException("DataOffloadingNode: Tried removing free but no data transfer direction present"
×
135
            );
×
136
        }
×
137
        this->buffer_lifecycle_ = BufferLifecycle::NO_CHANGE;
1✔
138
    }
1✔
139
}
1✔
140

141
} // namespace offloading
142
} // 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