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

daisytuner / sdfglib / 17655994367

11 Sep 2025 08:06PM UTC coverage: 60.451% (+1.1%) from 59.335%
17655994367

Pull #219

github

web-flow
Merge 769d2cc0b into 6c1992b40
Pull Request #219: stdlib Library Nodes and ConstantNodes

457 of 1629 new or added lines in 81 files covered. (28.05%)

93 existing lines in 35 files now uncovered.

9382 of 15520 relevant lines covered (60.45%)

107.26 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/leaky_relu.cpp
1
#include "sdfg/data_flow/library_nodes/math/ml/leaky_relu.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
LeakyReLUNode::LeakyReLUNode(
×
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_LeakyReLU, shape, {{"alpha", alpha}}) {
×
NEW
21
}
×
22

23
bool LeakyReLUNode::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_max = builder.add_access(code_block, output_name);
×
37
    auto& output_node_mul = builder.add_access(code_block, output_name);
×
38

39
    // max(x, 0)
40
    {
41
        auto& tasklet = builder.add_tasklet(code_block, data_flow::TaskletCode::fma, "_out", {"0.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_max, subset, output_type);
×
44
    }
45
    // alpha * x
46
    {
47
        auto& tasklet =
×
48
            builder.add_tasklet(code_block, data_flow::TaskletCode::mul, "_out", {this->attributes_.at("alpha"), "_in"});
×
49
        builder.add_computational_memlet(code_block, output_node_max, tasklet, "_in", subset, output_type);
×
50
        builder.add_computational_memlet(code_block, tasklet, "_out", output_node_mul, subset, output_type);
×
51
    }
52

53
    return true;
×
54
}
×
55

56
std::unique_ptr<data_flow::DataFlowNode> LeakyReLUNode::
57
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
58
    return std::unique_ptr<data_flow::DataFlowNode>(
×
NEW
59
        new LeakyReLUNode(element_id, this->debug_info(), vertex, parent, this->shape_, this->attributes_.at("alpha"))
×
60
    );
61
}
×
62

63
} // namespace ml
64
} // namespace math
65
} // 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