• 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/elu.cpp
1
#include "sdfg/data_flow/library_nodes/math/ml/elu.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
EluNode::EluNode(
×
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
    const std::string& alpha
19
)
NEW
20
    : ElementWiseUnaryNode(element_id, debug_info, vertex, parent, LibraryNodeType_Elu, shape, {{"alpha", alpha}}) {}
×
21

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

39
    // 1. exp(x)
40
    {
41
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::exp, "_out", {"_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_exp, subset, output_type);
×
44
    }
45
    // 2. x - 1.0f
46
    {
47
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::sub, "_out", {"_in", "1.0f"});
×
48
        builder.add_computational_memlet(code_block, output_node_exp, tasklet, "_in", subset, output_type);
×
49
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_sub, subset, output_type);
×
50
    }
51
    // 3. alpha * x
52
    {
53
        auto& tasklet =
×
54
            builder.add_tasklet(code_block, data_flow::TaskletCode::mul, "_out", {this->attributes_.at("alpha"), "_in"});
×
55
        builder.add_computational_memlet(code_block, output_node_sub, tasklet, "_in", subset, output_type);
×
56
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_mul, subset, output_type);
×
57
    }
58

59
    return true;
×
60
}
×
61

62
std::unique_ptr<data_flow::DataFlowNode> EluNode::
63
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
NEW
64
    return std::unique_ptr<data_flow::DataFlowNode>(
×
NEW
65
        new EluNode(element_id, this->debug_info(), vertex, parent, this->shape_, this->attributes_.at("alpha"))
×
66
    );
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