<!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: cudaGraphicsSubResourceGetMappedArray</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__INTEROP.html">Graphics Interoperability</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__INTEROP_gb7064fb72e54d89d0666e192b45d35cc.html#gb7064fb72e54d89d0666e192b45d35cc">cudaGraphicsMapResources</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__INTEROP_ge7f893864a3d38a630e71a99f5a4e17f.html#ge7f893864a3d38a630e71a99f5a4e17f">cudaGraphicsResourceGetMappedPointer</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__INTEROP_g4b7e5e82663df019a4bcf03d50835465.html#g4b7e5e82663df019a4bcf03d50835465">cudaGraphicsResourceSetMapFlags</a></td></tr> <tr><td class="navtab"><a class="qindexHL" href="group__CUDART__INTEROP_g09f772ed8c6e8e03f396a8895fc42050.html#g09f772ed8c6e8e03f396a8895fc42050">cudaGraphicsSubResourceGetMappedArray</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__INTEROP_gc4dcf300df27f8cf51a89f0287b07861.html#gc4dcf300df27f8cf51a89f0287b07861">cudaGraphicsUnmapResources</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__INTEROP_g1d45ac44d1affe17fb356e0b7a0b0560.html#g1d45ac44d1affe17fb356e0b7a0b0560">cudaGraphicsUnregisterResource</a></td></tr> </table> </div> </td> <td valign="top"> <a class="anchor" name="g09f772ed8c6e8e03f396a8895fc42050"></a><!-- doxytag: member="cuda_runtime_api.h::cudaGraphicsSubResourceGetMappedArray" ref="g09f772ed8c6e8e03f396a8895fc42050" args="(struct cudaArray **array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel)" --> <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> cudaGraphicsSubResourceGetMappedArray </td> <td>(</td> <td class="paramtype">struct cudaArray ** </td> <td class="paramname"> <em>array</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__CUDART__TYPES_gf58dd8d3c7a65714ff7f5459adbf7e6f.html#gf58dd8d3c7a65714ff7f5459adbf7e6f">cudaGraphicsResource_t</a> </td> <td class="paramname"> <em>resource</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"> <em>arrayIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"> <em>mipLevel</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Returns in <code>*array</code> an array through which the subresource of the mapped graphics resource <code>resource</code> which corresponds to array index <code>arrayIndex</code> and mipmap level <code>mipLevel</code> may be accessed. The value set in <code>array</code> may change every time that <code>resource</code> is mapped.<p> If <code>resource</code> is not a texture then it cannot be accessed via an array and <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c">cudaErrorUnknown</a> is returned. If <code>arrayIndex</code> is not a valid array index for <code>resource</code> then <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c">cudaErrorInvalidValue</a> is returned. If <code>mipLevel</code> is not a valid mipmap level for <code>resource</code> then <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c">cudaErrorInvalidValue</a> is returned. If <code>resource</code> is not mapped then <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c">cudaErrorUnknown</a> is returned.<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>array</em> </td><td>- Returned array through which a subresource of <code>resource</code> may be accessed </td></tr> <tr><td valign="top"></td><td valign="top"><em>resource</em> </td><td>- Mapped resource to access </td></tr> <tr><td valign="top"></td><td valign="top"><em>arrayIndex</em> </td><td>- Array index for array textures or cubemap face index as defined by <a class="el" href="group__CUDART__TYPES_gbf3ce16a621826a09263b8a58902fee8.html#gbf3ce16a621826a09263b8a58902fee8">cudaGraphicsCubeFace</a> for cubemap textures for the subresource to access </td></tr> <tr><td valign="top"></td><td valign="top"><em>mipLevel</em> </td><td>- Mipmap level for the subresource to access</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#gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c">cudaErrorInvalidValue</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273">cudaErrorInvalidResourceHandle</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c">cudaErrorUnknown</a> </dd></dl> <dl class="note" compact><dt><b>Note:</b></dt><dd>Note that this function may also return error codes from previous, asynchronous launches.</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__CUDART__INTEROP_ge7f893864a3d38a630e71a99f5a4e17f.html#ge7f893864a3d38a630e71a99f5a4e17f" title="Get an device pointer through which to access a mapped graphics resource.">cudaGraphicsResourceGetMappedPointer</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>