multiple cilk-for in a c function

multiple cilk-for in a c function

it is clear how to use cilkview in a c function. One just places cilkview.h in the include file secton, put __cilk_data_t start in the file defintion section of the c function. Finallly, puting __cilkview_query(strat); in the line above the cilk_for loop and at the end put __cilkview_report(&start,NULL,"title",CV_REPORT_WRITE_TO_RESULTS); at the bottom ogf the file.

NowI attempting to speed up only with cilk_for's, andI have set up each function as I have shown above.

But,I want to check to the contributionof each cilk_for and there may be more than one cilk_for in a function. All,I can do is check the whole function, noteach cilk-for.How do I do the latter.

Thanks in advance.

Newport_j

2 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Hello,

only code executed between __cilkview_query(...) and __cilkview_report(...) will be analyzed.

So, why don't you just enclose one for-loop by those two statements, e.g.:

void foo()

{

  ...
  cilk_for(...) {

  }
  ...
  __cilkview_query(...);

  cilk_for(...) {

  }

  __cilkview_report(...);

}
...to just analyze the second for-loop.

Of course you need to make sure you don't mix the results of multiple invocations of the function (here: foo())! You can do this by either bailing-out early after having the first report or by using different tags.

Best regards,

Georg Zitzlsberger

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui