Quantcast
Viewing all articles
Browse latest Browse all 77

Using Cilk reducer inside Cilker shared function

Hi I am trying to offload some parallel work to MIC using _Cilk_Shared and _Cilk_offload. 

I declare a Cilk shared function:

_Cilk_shared void somefun(int count)

 

In main I call this function using 

_Cilk_offload somefun(12) ;

inside this function everything is expected to be offloaded to MIC;

I want to declare a Cilk reducer inside somefun, so I can then use cilk_for and append to a cilk reducer list, 

but I get error:

error: illegal to declare an object of a class not marked _Cilk_shared, in a _Cilk_shared context
      cilk::reducer_list_append<int> rw;

 

I know I can do this with offload pragma so I should be able to this with cilk shared as well right?

I can't find concrete example of using _Cilk_shared and _Cilk_offload. 

Thanks in advance


Viewing all articles
Browse latest Browse all 77

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>