Intel® Advisor User Guide

ID 766448
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Parallelize Data - Intel® oneAPI Threading Building Blocks (oneTBB) Loops with Complex Iteration Control

Sometimes the loop control is spread across complex control flow. Using Intel® oneAPI Threading Building Blocks (oneTBB) in this situation requires more features than the simple loops. Note that the task body must not access any of the auto variables defined within the annotation site, because they may have been destroyed before or while the task is running. Consider this serial code:

 extern char a[];
 int previousEnd = -1;
  ANNOTATE_SITE_BEGIN(sitename);
    for (int i=0; i<=100; i++) {
       if (&excl