• 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/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

NEW
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::string& alpha
18
)
NEW
19
    : ElementWiseUnaryNode(element_id, debug_info, vertex, parent, LibraryNodeType_Elu, {{"alpha", alpha}}) {}
×
20

NEW
21
bool EluNode::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
NEW
32
    auto& code_block = builder.add_block(body);
×
NEW
33
    auto& input_node = builder.add_access(code_block, input_name);
×
NEW
34
    auto& output_node_exp = builder.add_access(code_block, output_name);
×
NEW
35
    auto& output_node_sub = builder.add_access(code_block, output_name);
×
NEW
36
    auto& output_node_mul = builder.add_access(code_block, output_name);
×
37

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

NEW
58
    return true;
×
NEW
59
}
×
60

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

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