Building the Intel® Threading Building Blocks Version

To build the Intel® Threading Building Blocks (Intel® TBB) version, you will modify the sample application to use Intel® TBB and then compile the modified code. You will then run the application and then compare the time with the baseline performance time.

  1. Remove all of the files that were created when you build the serial version by running the following command:

    %make clean

  2. Open the source file src/build_with_tbb/build_with_tbb.cpp in your favorite code editor.

  3. Remove the comment marks for the Intel® TBB headers to declare the Intel® TBB functions that will be used in the sample application.

    #include "tbb/tbb.h"

  4. Remove comment marks to the parallel_thread() function related to Intel® TBB implementation

    • The Intel® TBB parallel_for function. This function is where the parallelization call happens. The first two arguments in this function define the iteration space the loop executes along from starty to stopy. The third parameter is a C++11 lambda expression that lets the compiler do the tedious work of creating a function object.

  5. Add comment marks to the serial parallel_thread() function since the Intel® TBB version of parallel_thread() replaces this function.

  6. Build the sample by running the following command:

    %make tbb

The makefile automatically runs the sample after it is built.

Compare the time to render the image to the baseline performance time.