Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation: unify API of compile time block merging vs dynamic block connection #98

Open
wirew0rm opened this issue Jul 13, 2023 · 0 comments

Comments

@wirew0rm
Copy link
Member

wirew0rm commented Jul 13, 2023

At the moment we have different API for the different modes of "combining multiple nodes" with different behaviour and API:

process_one(_simd) process_bulk buffer settings & tags handling
merged_node yes no eliminated* not yet
connect static yes yes yes* yes
connect dyn yes yes yes* yes

* as mege node stores the original blocks and these contain their ports which then contain their buffers, the buffers are at the moment just unused, if i read the code correctly.

** at the moment the ports and buffers are set up when the node is constructed and the connections between the port buffers are set up when the graph is initialized by the scheduler. This means that dynamic nodes always have to pass the data though a buffer, which is not optimal and could be eliminated in a lot of cases

The different APIs look like this:

// merged_node
auto merged = merge<"scaled", "addend1">(scale<int, 2>(), adder<int>());

// dynamically connect_static ports
auto &src = flow_graph.make_node<Source<float>>({ { "n_samples_max", n_samples } });
auto &block1 = flow_graph.make_node<TestBlock<float>>();
flow_graph.connect<"out">(src).to<"in">(block1));

// connect dynamic ports (from prototype implementation, not yet implemented in core)
auto &adder = flow_graph.add_node(std::make_unique<multi_adder<double>>(n));
for (i = 0; i < n; i++) {
    auto &source = flow_graph.make_node<fixed_source<double>>();
    flow_graph.dynamic_connect(source, 0, adder, j);
}
@wirew0rm wirew0rm changed the title [] unify API of compile time block merging vs dynamic block connection documentation: unify API of compile time block merging vs dynamic block connection Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant