Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Function nodes and move

Chouh__Hamza
Beginner
636 Views

Hi everybody,

I'm planning to use flow graphs in an intensive data processing tool. Each node of the graph will be doing in-place computations on a large dataset. For example, a function_node could be taking a potentially large signal as an input and computing the FFT of this signal.

Performance is the main issue here. Therefore, I'd like my function_node input parameters to be movable in order to avoid useless copies of my data. That does not seem to be possible since operator() on a Body takes a const reference as a parameter.

Am I thinking it wrong? Is there a better way to achieve what I want to do?

Thanks.

0 Kudos
1 Reply
Alina_S_Intel
Employee
567 Views

Sorry for the delayed response.


To avoid large copy overheads, you can use pointers to large objects. shared_ptrs are MoveConstructible. Please, refer to 'Flow Graphs: Beyond the Basics' from the TBB Pro book for more information ( https://link.springer.com/chapter/10.1007/978-1-4842-4398-5_17 )


We will no longer respond to this thread.  

If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.

Thanks,



0 Kudos
Reply