• 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

84.38
/sdfg/src/data_flow/library_nodes/math/tensor/elementwise_ops/sigmoid_node.cpp
1
#include "sdfg/data_flow/library_nodes/math/tensor/elementwise_ops/sigmoid_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
SigmoidNode::SigmoidNode(
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
)
23
    : ElementWiseDataflowTensorNode(
4✔
24
          element_id, debug_info, vertex, parent, LibraryNodeType_Sigmoid, shape, "Y", {"X"}, quantization, impl_type
4✔
25
      ) {}
4✔
26

27
ElementWiseDataflowTensorNode::ElementOutput SigmoidNode::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
33
) {
4✔
34
    auto& input = needed_inputs.at(0);
4✔
35

36
    sdfg::types::Scalar scalar_type(input.required_type);
4✔
37

38
    // -x
39
    auto& first_op = builder.add_tasklet(block, data_flow::TaskletCode::fp_neg, "_out", {"_in"});
4✔
40
    input.consumer = &first_op;
4✔
41
    input.input_conn_index = 0;
4✔
42
    auto& output_node_neg = create_tmp_access_node(builder, block, "tmp_sgmd_ng_", scalar_type);
4✔
43
    builder.add_computational_memlet(block, first_op, "_out", output_node_neg, {}, scalar_type);
4✔
44
    // exp(x)
45
    auto& exp_op = builder.add_library_node<
4✔
46
        math::cmath::CMathNode>(block, block.debug_info(), cmath::CMathFunction::exp, input.required_type);
4✔
47
    builder.add_computational_memlet(block, output_node_neg, exp_op, "_in1", {}, scalar_type);
4✔
48
    auto& output_node_exp = create_tmp_access_node(builder, block, "tmp_sgmd_exp_", scalar_type);
4✔
49
    builder.add_computational_memlet(block, exp_op, "_out", output_node_exp, {}, scalar_type);
4✔
50

51
    // 1 + x
52
    auto& one_node = builder.add_constant(block, "1.0", scalar_type);
4✔
53
    auto& add_op = builder.add_tasklet(block, data_flow::TaskletCode::fp_add, "_out", {"_in1", "_in2"});
4✔
54
    builder.add_computational_memlet(block, one_node, add_op, "_in1", {}, scalar_type);
4✔
55
    builder.add_computational_memlet(block, output_node_exp, add_op, "_in2", {}, scalar_type);
4✔
56
    auto& output_node_add = create_tmp_access_node(builder, block, "tmp_sgmd_add_", scalar_type);
4✔
57
    builder.add_computational_memlet(block, add_op, "_out", output_node_add, {}, scalar_type);
4✔
58
    // 1.0 / x
59
    auto& last_op = builder.add_tasklet(block, data_flow::TaskletCode::fp_div, "_out", {"_in1", "_in2"});
4✔
60
    builder.add_computational_memlet(block, one_node, last_op, "_in1", {}, scalar_type);
4✔
61
    builder.add_computational_memlet(block, output_node_add, last_op, "_in2", {}, scalar_type);
4✔
62
    return {.producer = &last_op, .output_conn_index = 0, .type = input.required_type};
4✔
63
}
4✔
64

65
std::unique_ptr<data_flow::DataFlowNode> SigmoidNode::
66
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
NEW
67
    return std::unique_ptr<data_flow::DataFlowNode>(new SigmoidNode(
×
NEW
68
        element_id, this->debug_info(), vertex, parent, this->shape_, fixed_quantization_, implementation_type_
×
NEW
69
    ));
×
UNCOV
70
}
×
71

72
} // namespace tensor
73
} // namespace math
74
} // 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