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

daisytuner / docc / 26831349290

02 Jun 2026 03:50PM UTC coverage: 61.29% (-0.01%) from 61.302%
26831349290

Pull #725

github

web-flow
Merge a7e2175c0 into 887730e20
Pull Request #725: Tensor node backport

932 of 1642 new or added lines in 52 files covered. (56.76%)

92 existing lines in 33 files now uncovered.

35584 of 58058 relevant lines covered (61.29%)

11020.18 hits per line

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

0.0
/sdfg/src/data_flow/library_nodes/math/tensor/elementwise_ops/elu_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/elementwise_ops/elu_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
EluNode::EluNode(
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
    QuantizationType quantization,
21
    const data_flow::ImplementationType& impl_type
22
)
NEW
23
    : ElementWiseDataflowTensorNode(
×
NEW
24
          element_id, debug_info, vertex, parent, LibraryNodeType_Elu, shape, "Y", {"X", "alpha"}, quantization, impl_type
×
NEW
25
      ) {}
×
26

27
ElementWiseDataflowTensorNode::ElementOutput EluNode::expand_operation_dataflow(
28
    builder::StructuredSDFGBuilder& builder,
29
    analysis::AnalysisManager& analysis_manager,
30
    Block& block,
31
    std::vector<ElementInput>& needed_inputs,
32
    types::PrimitiveType expected_type
UNCOV
33
) {
×
NEW
34
    auto& input0 = needed_inputs.at(0);
×
NEW
35
    bool has_alpha_input = needed_inputs.size() > 1;
×
36

NEW
37
    types::Scalar scalar_type(input0.required_type);
×
38

NEW
39
    throw std::runtime_error("Elu: untested expand");
×
40

41
    // 1. exp(x)
NEW
42
    auto& first_op = builder.add_library_node<
×
NEW
43
        math::cmath::CMathNode>(block, debug_info_, cmath::CMathFunction::exp, input0.required_type);
×
NEW
44
    input0.consumer = &first_op;
×
NEW
45
    input0.input_conn_index = 0;
×
NEW
46
    auto& output_node_exp = create_tmp_access_node(builder, block, "tmp_elu_exp_", scalar_type);
×
NEW
47
    builder.add_computational_memlet(block, first_op, "_out", output_node_exp, {}, scalar_type);
×
48
    // 2. x - 1.0f
NEW
49
    auto& one_node = builder.add_constant(block, "1.0", scalar_type);
×
NEW
50
    auto& sub_op = builder.add_tasklet(block, data_flow::TaskletCode::fp_sub, "_out", {"_in1", "_in2"});
×
NEW
51
    builder.add_computational_memlet(block, output_node_exp, sub_op, "_in1", {}, scalar_type);
×
NEW
52
    builder.add_computational_memlet(block, one_node, sub_op, "_in2", {}, scalar_type);
×
NEW
53
    auto& output_node_sub = create_tmp_access_node(builder, block, "tmp_elu_sub_", scalar_type);
×
NEW
54
    builder.add_computational_memlet(block, sub_op, "_out", output_node_sub, {}, scalar_type);
×
55
    // 3. alpha * x
NEW
56
    auto& last_op = builder.add_tasklet(block, data_flow::TaskletCode::fp_mul, "_out", {"_in1", "_in2"});
×
NEW
57
    builder.add_computational_memlet(block, output_node_sub, last_op, "_in1", {}, scalar_type);
×
NEW
58
    if (has_alpha_input) {
×
NEW
59
        auto& alpha_input = needed_inputs.at(1);
×
NEW
60
        alpha_input.consumer = &last_op;
×
NEW
61
        alpha_input.input_conn_index = 1;
×
NEW
62
    } else {
×
NEW
63
        builder.add_computational_memlet(block, one_node, last_op, "_in2", {}, scalar_type);
×
UNCOV
64
    }
×
65

NEW
66
    return {.producer = &last_op, .output_conn_index = 0, .type = input0.required_type};
×
UNCOV
67
}
×
68

69
std::unique_ptr<data_flow::DataFlowNode> EluNode::
70
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
NEW
71
    return std::unique_ptr<data_flow::DataFlowNode>(new EluNode(
×
NEW
72
        element_id, this->debug_info(), vertex, parent, this->shape_, fixed_quantization_, implementation_type_
×
NEW
73
    ));
×
UNCOV
74
}
×
75

76
} // namespace tensor
77
} // namespace math
78
} // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc