Software Archive
Read-only legacy content
17061 Discussions

Virtual-shared model: granularity

Andrey_Vladimirov
New Contributor III
328 Views

What is the granularity of synchronization between virtual-shared data on the host and on the coprocessor? I.e., does the runtime system synchronize with the coprocessor individual words, virtual memory pages, or whole arrays modified on the host?

0 Kudos
1 Reply
Sumedh_N_Intel
Employee
328 Views

Based on Q&As from Robert Reed (http://software.intel.com/en-us/articles/intelr-xeon-phitm-coprocessor-february-developer-webinar-qa-responses), the virtual shared memory is synchronized with the host at a granularity of a page. Below, I have copied the original Q&A from the post: 

Q: Does offload do memory management (copy to card and copy back to main memory) automatically?
A: Yes, but with conditions. If you use an offload pragma or directive but don't specify modifiers on data transfer, all named arrays and scalars in lexical scope will be automatically copied over and back--the IN, OUT and NOCOPY modifiers can limit the data transfered at each offload. With Virtual Shared Memory, only the data that have been declared Cilk_shared and have been modified by host or target will be marked for copy at the next offload/return, though the Virtual Shared Memory copies on the granularity of a page at a time.

0 Kudos
Reply