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.


2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


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(...) {


  cilk_for(...) {



} 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

Leave a Comment

Please sign in to add a comment. Not a member? Join today