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

daisytuner / docc / 21873449786

10 Feb 2026 04:31PM UTC coverage: 66.315% (-0.2%) from 66.496%
21873449786

Pull #513

github

web-flow
Merge 55ce04c5d into 5750a460e
Pull Request #513: adds tensor type

244 of 431 new or added lines in 18 files covered. (56.61%)

186 existing lines in 15 files now uncovered.

23488 of 35419 relevant lines covered (66.31%)

372.32 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) {}
4✔
18

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

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

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

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

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

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

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

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

53
    return applied;
4✔
54
}
4✔
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