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

daisytuner / sdfglib / 17589393671

09 Sep 2025 04:35PM UTC coverage: 61.094% (+1.9%) from 59.145%
17589393671

Pull #219

github

web-flow
Merge a2a473c0b into b8fdeb232
Pull Request #219: stdlib Library Nodes and ConstantNodes

424 of 1357 new or added lines in 74 files covered. (31.25%)

90 existing lines in 32 files now uncovered.

9307 of 15234 relevant lines covered (61.09%)

109.01 hits per line

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

0.0
/src/data_flow/library_nodes/math/ml/sigmoid.cpp
1
#include "sdfg/data_flow/library_nodes/math/ml/sigmoid.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
namespace sdfg {
9
namespace math {
10
namespace ml {
11

12
SigmoidNode::SigmoidNode(
×
13
    size_t element_id,
14
    const DebugInfo& debug_info,
15
    const graph::Vertex vertex,
16
    data_flow::DataFlowGraph& parent,
17
    const std::vector<symbolic::Expression>& shape
18
)
NEW
19
    : ElementWiseUnaryNode(element_id, debug_info, vertex, parent, LibraryNodeType_Sigmoid, shape, {}) {}
×
20

21
bool SigmoidNode::expand_operation(
×
22
    builder::StructuredSDFGBuilder& builder,
23
    analysis::AnalysisManager& analysis_manager,
24
    structured_control_flow::Sequence& body,
25
    const std::string& input_name,
26
    const std::string& output_name,
27
    const types::IType& input_type,
28
    const types::IType& output_type,
29
    const data_flow::Subset& subset
30
) {
31
    // Add code
32
    auto& code_block = builder.add_block(body);
×
33
    auto& input_node = builder.add_access(code_block, input_name);
×
34
    auto& output_node_neg = builder.add_access(code_block, output_name);
×
35
    auto& output_node_exp = builder.add_access(code_block, output_name);
×
36
    auto& output_node_add = builder.add_access(code_block, output_name);
×
37
    auto& output_node_div = builder.add_access(code_block, output_name);
×
38

39
    // -x
40
    {
41
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::mul, "_out", {"-1.0f", "_in"});
×
42
        builder.add_computational_memlet(code_block, input_node, tasklet, "_in", subset, input_type);
×
43
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_neg, subset, output_type);
×
44
    }
45
    // exp(x)
46
    {
47
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::expf, "_out", {"_in"});
×
48
        builder.add_computational_memlet(code_block, output_node_neg, tasklet, "_in", subset, output_type);
×
49
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_exp, subset, output_type);
×
50
    }
51

52
    // 1 + x
53
    {
54
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::add, "_out", {"1.0f", "_in"});
×
55
        builder.add_computational_memlet(code_block, output_node_exp, tasklet, "_in", subset, output_type);
×
56
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_add, subset, output_type);
×
57
    }
58
    // 1.0f / x
59
    {
60
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::div, "_out", {"1.0f", "_in"});
×
61
        builder.add_computational_memlet(code_block, output_node_add, tasklet, "_in", subset, output_type);
×
62
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_div, subset, output_type);
×
63
    }
64

65
    return true;
×
66
}
×
67

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

74
} // namespace ml
75
} // namespace math
76
} // 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