Quantcast
Channel: Intel® Cilk™ Plus
Viewing all articles
Browse latest Browse all 77

How to transfer reducer_list_append to MIC?

$
0
0

Hi I am new to cilk plus and MIC. I had this topic in MIC forum as well 

I have a problem where I need to offload/parallel process some data, append to a list B , and return to the host. The host will then combine this list to another host std::list<T> A.

I have following approach: 

  1.  Create a cilk::reducer_list_append<T> B on host use cilk_shared , B is empty now. 
  2.  Cilk Plus will automatically transfer B to MIC , MIC does some calculations and append data to B and return B back to host. 
  3. B.get_value() will return a std::list<T> C , use A.splice to combine list A and C. 

I read this https://software.intel.com/en-us/forums/topic/360604  and it seems that in order to cilk share STL or other container like cilk::reducer_list_append, I need to specify the allocator of B to  __offload::shared_allocator<>  

So My concern is

1. do I need to construct my A using allocator  __offload::shared_allocator<>   as well ? Otherwise C will have different allocator with A right?

2. Is there a easy way to solve this problem ? I just need to transfer a list back and forth between host and MIC

Thanks in advance


Viewing all articles
Browse latest Browse all 77

Latest Images

Trending Articles



Latest Images

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