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 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

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

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen