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

daisytuner / docc / 21863804378

10 Feb 2026 11:53AM UTC coverage: 66.276% (-0.2%) from 66.496%
21863804378

Pull #513

github

web-flow
Merge 1e171c5b3 into 4576e646b
Pull Request #513: adds tensor type

217 of 404 new or added lines in 18 files covered. (53.71%)

1 existing line in 1 file now uncovered.

23373 of 35266 relevant lines covered (66.28%)

372.08 hits per line

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

86.21
/sdfg/src/passes/dataflow/tensor_to_pointer_conversion.cpp
1
#include "sdfg/passes/dataflow/tensor_to_pointer_conversion.h"
2

3
#include "sdfg/data_flow/data_flow_graph.h"
4
#include "sdfg/data_flow/memlet.h"
5
#include "sdfg/structured_control_flow/block.h"
6
#include "sdfg/symbolic/symbolic.h"
7
#include "sdfg/types/array.h"
8
#include "sdfg/types/pointer.h"
9
#include "sdfg/types/utils.h"
10
#include "sdfg/visitor/structured_sdfg_visitor.h"
11

12
namespace sdfg {
13
namespace passes {
14

15
TensorToPointerConversion::
16
    TensorToPointerConversion(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager)
17
    : visitor::NonStoppingStructuredSDFGVisitor(builder, analysis_manager) {}
2✔
18

19
bool TensorToPointerConversion::accept(structured_control_flow::Block& block) {
2✔
20
    bool applied = false;
2✔
21
    auto& dfg = block.dataflow();
2✔
22

23
    for (auto& memlet : dfg.edges()) {
4✔
24
        if (memlet.subset().empty()) {
4✔
NEW
25
            continue;
×
NEW
26
        }
×
27
        auto& base_type = memlet.base_type();
4✔
28
        if (base_type.type_id() != types::TypeID::Tensor) {
4✔
NEW
29
            continue;
×
NEW
30
        }
×
31
        auto& tensor_type = static_cast<const types::Tensor&>(base_type);
4✔
32

33
        auto& element_type = tensor_type.element_type();
4✔
34

35
        auto& shape = tensor_type.shape();
4✔
36
        auto& strides = tensor_type.strides();
4✔
37

38
        auto& tensor_subset = memlet.subset();
4✔
39
        symbolic::Expression linearized_access = tensor_type.offset();
4✔
40
        for (size_t i = 0; i < shape.size(); ++i) {
8✔
41
            linearized_access = symbolic::add(linearized_access, symbolic::mul(tensor_subset.at(i), strides.at(i)));
4✔
42
        }
4✔
43

44
        data_flow::Subset pointer_subset = {linearized_access};
4✔
45
        memlet.set_subset(pointer_subset);
4✔
46

47
        types::Pointer pointer_type(element_type);
4✔
48
        memlet.set_base_type(pointer_type);
4✔
49

50
        applied = true;
4✔
51
    }
4✔
52

53
    return applied;
2✔
54
}
2✔
55

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