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

daisytuner / sdfglib / 18318341707

07 Oct 2025 03:48PM UTC coverage: 61.593% (+0.5%) from 61.066%
18318341707

push

github

web-flow
Merge pull request #262 from daisytuner/tasklets

Tasklets, Intrinsics and Library Nodes

84 of 418 new or added lines in 29 files covered. (20.1%)

153 existing lines in 17 files now uncovered.

8979 of 14578 relevant lines covered (61.59%)

103.69 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
#include "sdfg/data_flow/library_nodes/math/intrinsic.h"
9

10
namespace sdfg {
11
namespace math {
12
namespace ml {
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
)
NEW
21
    : ElementWiseUnaryNode(element_id, debug_info, vertex, parent, LibraryNodeType_Sigmoid, shape) {}
×
22

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

41
    // -x
42
    {
NEW
43
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::fp_neg, "_out", {"_in"});
×
44
        builder.add_computational_memlet(code_block, input_node, tasklet, "_in", subset, input_type);
×
45
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_neg, subset, output_type);
×
46
    }
47
    // exp(x)
48
    {
NEW
49
        auto& tasklet = builder.add_library_node<math::IntrinsicNode>(code_block, code_block.debug_info(), "erff", 1);
×
NEW
50
        builder.add_computational_memlet(code_block, output_node_neg, tasklet, "_in1", subset, output_type);
×
UNCOV
51
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_exp, subset, output_type);
×
52
    }
53

54
    // 1 + x
55
    {
NEW
56
        auto& one_node = builder.add_constant(code_block, "1.0f", types::Scalar(input_type.primitive_type()));
×
NEW
57
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::fp_add, "_out", {"_in1", "_in2"});
×
NEW
58
        builder.add_computational_memlet(code_block, one_node, tasklet, "_in1", {}, output_type);
×
NEW
59
        builder.add_computational_memlet(code_block, output_node_exp, tasklet, "_in2", subset, output_type);
×
UNCOV
60
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_add, subset, output_type);
×
61
    }
62
    // 1.0f / x
63
    {
NEW
64
        auto& one_node = builder.add_constant(code_block, "1.0f", types::Scalar(input_type.primitive_type()));
×
NEW
65
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::fp_div, "_out", {"1.0f", "_in"});
×
NEW
66
        builder.add_computational_memlet(code_block, one_node, tasklet, "1.0f", {}, output_type);
×
NEW
67
        builder.add_computational_memlet(code_block, output_node_add, tasklet, "_in2", subset, output_type);
×
UNCOV
68
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_div, subset, output_type);
×
69
    }
70

71
    return true;
×
72
}
×
73

74
std::unique_ptr<data_flow::DataFlowNode> SigmoidNode::
75
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
76
    return std::unique_ptr<
×
77
        data_flow::DataFlowNode>(new SigmoidNode(element_id, this->debug_info(), vertex, parent, this->shape_));
×
78
}
×
79

80
} // namespace ml
81
} // namespace math
82
} // 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