Sophie

Sophie

distrib > Mageia > 2 > i586 > media > nonfree-release > by-pkgid > f86555c654b1f4a4c7ccf47789979868 > files > 2037

nvidia-cuda-toolkit-devel-4.2.9-2.mga2.nonfree.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>NVIDIA CUDA Library: API synchronization behavior</title>
<link href="customdoxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1><a class="anchor" name="sync_async">API synchronization behavior </a></h1><h2><a class="anchor" name="memcpy_sync_async_behavior">
Memcpy</a></h2>
The API provides memcpy/memset functions in both synchronous and asynchronous forms, the latter having an <em>"Async"</em> suffix. This is a misnomer as each function may exhibit synchronous or asynchronous behavior depending on the arguments passed to the function. In the reference documentation, each memcpy function is categorized as <em>synchronous</em> or <em>asynchronous</em>, corresponding to the definitions below.<h3><a class="anchor" name="MemcpySynchronousBehavior">
Synchronous</a></h3>
<ol>
<li>
For transfers from pageable host memory to device memory, a stream sync is performed before the copy is initiated. The function will return once the pageable buffer has been copied to the staging memory for DMA transfer to device memory, but the DMA to final destination may not have completed.<p>
</li>
<li>
For transfers from pinned host memory to device memory, the function is synchronous with respect to the host.<p>
</li>
<li>
For transfers from device to either pageable or pinned host memory, the function returns only once the copy has completed.<p>
</li>
<li>
For transfers from device memory to device memory, no host-side synchronization is performed.<p>
</li>
<li>
For transfers from any host memory to any host memory, the function is fully synchronous with respect to the host. </li>
</ol>
<h3><a class="anchor" name="MemcpyAsynchronousBehavior">
Asynchronous</a></h3>
<ol>
<li>
For transfers from pageable host memory to device memory, host memory is copied to a staging buffer immediately (no device synchronization is performed). The function will return once the pageable buffer has been copied to the staging memory. The DMA transfer to final destination may not have completed.<p>
</li>
<li>
For transfers between pinned host memory and device memory, the function is fully asynchronous.<p>
</li>
<li>
For transfers from device memory to pageable host memory, the function will return only once the copy has completed.<p>
</li>
<li>
For all other transfers, the function is fully asynchronous. If pageable memory must first be staged to pinned memory, this will be handled asynchronously with a worker thread.<p>
</li>
<li>
For transfers from any host memory to any host memory, the function is fully synchronous with respect to the host. </li>
</ol>
<h2><a class="anchor" name="memset_sync_async_behavior">
Memset</a></h2>
The cudaMemset functions are asynchronous with respect to the host except when the target memory is pinned host memory. The <em>Async</em> versions are always asynchronous with respect to the host.<h2><a class="anchor" name="kernel_launch_details">
Kernel Launches</a></h2>
Kernel launches are asynchronous with respect to the host. Details of concurrent kernel execution and data transfers can be found in the CUDA Programmers Guide. </div>
<hr size="1"><address style="text-align: right;"><small>
Generated by Doxygen for NVIDIA CUDA Library &nbsp;<a
href="http://www.nvidia.com/cuda"><img src="nvidia_logo.jpg" alt="NVIDIA" align="middle" border="0" height="80"></a></small></address>
</body>
</html>