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

daisytuner / docc / 22151769687

18 Feb 2026 06:09PM UTC coverage: 64.742%. First build
22151769687

push

github

web-flow
Merge pull request #526 from daisytuner/native-ndarray

Python - Native Tensor Support: Update operations to use tensor type

2783 of 4104 new or added lines in 42 files covered. (67.81%)

23724 of 36644 relevant lines covered (64.74%)

368.06 hits per line

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

66.67
/sdfg/src/data_flow/library_nodes/math/tensor/elementwise_ops/pow_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/elementwise_ops/pow_node.h"
2

3
#include "sdfg/analysis/analysis.h"
4
#include "sdfg/builder/structured_sdfg_builder.h"
5

6
#include "sdfg/analysis/scope_analysis.h"
7

8
#include "sdfg/data_flow/library_nodes/math/cmath/cmath_node.h"
9

10
namespace sdfg {
11
namespace math {
12
namespace tensor {
13

14
PowNode::PowNode(
15
    size_t element_id,
16
    const DebugInfo& debug_info,
17
    const graph::Vertex vertex,
18
    data_flow::DataFlowGraph& parent,
19
    const std::vector<symbolic::Expression>& shape
20
)
21
    : ElementWiseBinaryNode(element_id, debug_info, vertex, parent, LibraryNodeType_Pow, shape) {}
4✔
22

23
bool PowNode::expand_operation(
24
    builder::StructuredSDFGBuilder& builder,
25
    analysis::AnalysisManager& analysis_manager,
26
    structured_control_flow::Sequence& body,
27
    const std::string& input_name_a,
28
    const std::string& input_name_b,
29
    const std::string& output_name,
30
    const types::Tensor& input_type_a,
31
    const types::Tensor& input_type_b,
32
    const types::Tensor& output_type,
33
    const data_flow::Subset& subset
34
) {
4✔
35
    auto& code_block = builder.add_block(body);
4✔
36
    data_flow::AccessNode* input_node_a;
4✔
37
    if (builder.subject().exists(input_name_a)) {
4✔
38
        input_node_a = &builder.add_access(code_block, input_name_a);
4✔
39
    } else {
4✔
NEW
40
        types::Scalar const_type(input_type_a.primitive_type());
×
NEW
41
        input_node_a = &builder.add_constant(code_block, input_name_a, const_type);
×
42
    }
×
43
    data_flow::AccessNode* input_node_b;
4✔
44
    if (builder.subject().exists(input_name_b)) {
4✔
45
        input_node_b = &builder.add_access(code_block, input_name_b);
4✔
46
    } else {
4✔
NEW
47
        types::Scalar const_type(input_type_b.primitive_type());
×
NEW
48
        input_node_b = &builder.add_constant(code_block, input_name_b, const_type);
×
49
    }
×
50
    auto& output_node = builder.add_access(code_block, output_name);
4✔
51

52
    auto& tasklet = builder.add_library_node<math::cmath::CMathNode>(
4✔
53
        code_block, code_block.debug_info(), cmath::CMathFunction::pow, input_type_a.primitive_type()
4✔
54
    );
4✔
55

56
    builder.add_computational_memlet(code_block, *input_node_a, tasklet, "_in1", subset, input_type_a);
4✔
57
    builder.add_computational_memlet(code_block, *input_node_b, tasklet, "_in2", subset, input_type_b);
4✔
58
    builder.add_computational_memlet(code_block, tasklet, "_out", output_node, subset, output_type);
4✔
59

60
    return true;
4✔
61
}
4✔
62

63
std::unique_ptr<data_flow::DataFlowNode> PowNode::
64
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
65
    return std::unique_ptr<
×
66
        data_flow::DataFlowNode>(new PowNode(element_id, this->debug_info(), vertex, parent, this->shape_));
×
67
}
×
68

69
} // namespace tensor
70
} // namespace math
71
} // 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