Quantcast
Channel: Intel® Many Integrated Core Architecture
Viewing all articles
Browse latest Browse all 1347

How to properly offload a list, process it and return to host?

$
0
0

Hi I am new to cilk plus and MIC.

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 1347

Trending Articles