Skip to content

Commit 8817b35

Browse files
author
Vladimir Serov
authored
Update oneTBB flow_graph example with new API (#405)
Signed-off-by: Serov, Vladimir <[email protected]>
1 parent 0affb6d commit 8817b35

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

source/elements/oneTBB/source/flow_graph/examples/overwrite_node_cls.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ int main() {
1414

1515
oneapi::tbb::flow::overwrite_node< int > overwrite_storage(g);
1616

17-
oneapi::tbb::flow::source_node<int> data_generator(g,
18-
[&]( int& v ) -> bool {
17+
oneapi::tbb::flow::input_node< int > data_generator(g,
18+
[&]( oneapi::tbb::flow_control& fc ) -> int {
1919
if ( count < data_limit ) {
20-
++count;
21-
v = count;
22-
return true;
23-
} else {
24-
return false;
20+
return ++count;
2521
}
22+
fc.stop();
23+
return {};
2624
});
2725

2826
oneapi::tbb::flow::function_node< int > process(g, oneapi::tbb::flow::unlimited,

0 commit comments

Comments
 (0)