<!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: cudaIpcGetMemHandle</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 Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> </div> <div class="contents"> <div class="navpath"><a class="el" href="group__CUDART__DEVICE.html">Device Management</a> </div> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td valign="top"> <div class="navtab"> <table> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g028e5b0474379eaf5f5d54657d48600b.html#g028e5b0474379eaf5f5d54657d48600b">cudaChooseDevice</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_gff8afabcc95d84bbd9411df86c58190c.html#gff8afabcc95d84bbd9411df86c58190c">cudaDeviceGetByPCIBusId</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g8c2ed6232dab29720ed92529bb265373.html#g8c2ed6232dab29720ed92529bb265373">cudaDeviceGetCacheConfig</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g50e098f554dbfca0ef054e7b7d39d06e.html#g50e098f554dbfca0ef054e7b7d39d06e">cudaDeviceGetLimit</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g548a98d8f123f7b0053f3913b733d07c.html#g548a98d8f123f7b0053f3913b733d07c">cudaDeviceGetPCIBusId</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_gdcc2c6f914eb9461565b12648faa5e28.html#gdcc2c6f914eb9461565b12648faa5e28">cudaDeviceReset</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_gac27b566beee1aa9175373bb9e29b8d1.html#gac27b566beee1aa9175373bb9e29b8d1">cudaDeviceSetCacheConfig</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_gb8a22e29cc297634b0702db0b69f59e7.html#gb8a22e29cc297634b0702db0b69f59e7">cudaDeviceSetLimit</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_gb76422145b5425829597ebd1003303fe.html#gb76422145b5425829597ebd1003303fe">cudaDeviceSynchronize</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g1795645d53ca669d84d2aff6f3706917.html#g1795645d53ca669d84d2aff6f3706917">cudaGetDevice</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g665468e8cb33be42434f11bee2684ec9.html#g665468e8cb33be42434f11bee2684ec9">cudaGetDeviceCount</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g5aa4f47938af8276f08074d09b7d520c.html#g5aa4f47938af8276f08074d09b7d520c">cudaGetDeviceProperties</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g96302370e5c325b212378b04a536ac26.html#g96302370e5c325b212378b04a536ac26">cudaIpcCloseMemHandle</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g7d2e89a1b53fc087fafdded0aaf29062.html#g7d2e89a1b53fc087fafdded0aaf29062">cudaIpcGetEventHandle</a></td></tr> <tr><td class="navtab"><a class="qindexHL" href="group__CUDART__DEVICE_ga682d4aea57e8adb6c72330b78900616.html#ga682d4aea57e8adb6c72330b78900616">cudaIpcGetMemHandle</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_ge9e71d935c23a5349e458a3a143925ea.html#ge9e71d935c23a5349e458a3a143925ea">cudaIpcOpenEventHandle</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g12ff06c07a4d4134f0eefbd5cf3ba216.html#g12ff06c07a4d4134f0eefbd5cf3ba216">cudaIpcOpenMemHandle</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g418c299b069c4803bfb7cab4943da383.html#g418c299b069c4803bfb7cab4943da383">cudaSetDevice</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g18074e885b4d89f5a0fe1beab589e0c8.html#g18074e885b4d89f5a0fe1beab589e0c8">cudaSetDeviceFlags</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__DEVICE_g5754b9d4e409b6cc0e252ba240d7468b.html#g5754b9d4e409b6cc0e252ba240d7468b">cudaSetValidDevices</a></td></tr> </table> </div> </td> <td valign="top"> <a class="anchor" name="ga682d4aea57e8adb6c72330b78900616"></a><!-- doxytag: member="cuda_runtime_api.h::cudaIpcGetMemHandle" ref="ga682d4aea57e8adb6c72330b78900616" args="(cudaIpcMemHandle_t *handle, void *devPtr)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CUDART__TYPES_gf599e5b8b829ce7db0f5216928f6ecb6.html#gf599e5b8b829ce7db0f5216928f6ecb6">cudaError_t</a> cudaIpcGetMemHandle </td> <td>(</td> <td class="paramtype">cudaIpcMemHandle_t * </td> <td class="paramname"> <em>handle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>devPtr</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> /brief Gets an interprocess memory handle for an existing device memory allocation<p> Takes a pointer to the base of an existing device memory allocation created with cudaMemAlloc and exports it for use in another process. This is a lightweight operation and may be called multiple times on an allocation without adverse effects.<p> If a region of memory is freed with cudaMemFree and a subsequent call to cudaMemAlloc returns memory with the same device address, <a class="el" href="group__CUDART__DEVICE_ga682d4aea57e8adb6c72330b78900616.html#ga682d4aea57e8adb6c72330b78900616">cudaIpcGetMemHandle</a> will return a unique handle for the new memory.<p> IPC functionality is restricted to devices with support for unified addressing on Linux operating systems.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>handle</em> </td><td>- Pointer to user allocated cudaIpcMemHandle to return the handle in. </td></tr> <tr><td valign="top"></td><td valign="top"><em>devPtr</em> </td><td>- Base pointer to previously allocated device memory</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591">cudaSuccess</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273">cudaErrorInvalidResourceHandle</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038f210f50ae7f17f655e0504929606add9">cudaErrorMemoryAllocation</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038a2625b63c0940c54ed07f2986b12e0f1">cudaErrorMapBufferObjectFailed</a>,</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd>cudaMemAlloc, cudaMemFree, <a class="el" href="group__CUDART__DEVICE_g7d2e89a1b53fc087fafdded0aaf29062.html#g7d2e89a1b53fc087fafdded0aaf29062" title="Gets an interprocess handle for a previously allocated event.">cudaIpcGetEventHandle</a>, <a class="el" href="group__CUDART__DEVICE_ge9e71d935c23a5349e458a3a143925ea.html#ge9e71d935c23a5349e458a3a143925ea" title="Opens an interprocess event handle for use in the current process.">cudaIpcOpenEventHandle</a>, <a class="el" href="group__CUDART__DEVICE_g12ff06c07a4d4134f0eefbd5cf3ba216.html#g12ff06c07a4d4134f0eefbd5cf3ba216">cudaIpcOpenMemHandle</a>, <a class="el" href="group__CUDART__DEVICE_g96302370e5c325b212378b04a536ac26.html#g96302370e5c325b212378b04a536ac26">cudaIpcCloseMemHandle</a> </dd></dl> </div> </div><p> </td> </tr> </table> </div> <hr size="1"><address style="text-align: right;"><small> Generated by Doxygen for NVIDIA CUDA Library <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>