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

daisytuner / sdfglib / 17075880734

19 Aug 2025 04:32PM UTC coverage: 63.863% (-1.7%) from 65.547%
17075880734

push

github

web-flow
Merge pull request #202 from daisytuner/ml-nodes

adds element-wise ml nodes

94 of 506 new or added lines in 22 files covered. (18.58%)

2 existing lines in 1 file now uncovered.

9239 of 14467 relevant lines covered (63.86%)

124.6 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

NEW
12
SigmoidNode::SigmoidNode(
×
13
    size_t element_id, const DebugInfo& debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph& parent
14
)
NEW
15
    : ElementWiseUnaryNode(element_id, debug_info, vertex, parent, LibraryNodeType_Sigmoid, {}) {}
×
16

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

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

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

NEW
61
    return true;
×
NEW
62
}
×
63

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

69
} // namespace ml
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