<!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: cuGLGetDevices</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__CUDA__GL.html">OpenGL 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__CUDA__GL_g923988b9596911c39bb55fd848015a3d.html#g923988b9596911c39bb55fd848015a3d">cuGLCtxCreate</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDA__GL_g5d423ad540c04558b683661e279e0c58.html#g5d423ad540c04558b683661e279e0c58">CUGLDeviceList</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDA__GL_g3555fe44ce3d83b78a0ea894979d58c2.html#g3555fe44ce3d83b78a0ea894979d58c2">CUGLDeviceList_enum</a></td></tr> <tr><td class="navtab"><a class="qindexHL" href="group__CUDA__GL_g98bb15525b04d2f6a817c21e07d8b7cd.html#g98bb15525b04d2f6a817c21e07d8b7cd">cuGLGetDevices</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDA__GL_gd530f66cc9ab43a31a98527e75f343a0.html#gd530f66cc9ab43a31a98527e75f343a0">cuGraphicsGLRegisterBuffer</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDA__GL_g52c3a36c4c92611b6fcf0662b2f74e40.html#g52c3a36c4c92611b6fcf0662b2f74e40">cuGraphicsGLRegisterImage</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDA__GL_g21ff8296192dc38dff42ba3346078282.html#g21ff8296192dc38dff42ba3346078282">cuWGLGetDevice</a></td></tr> </table> </div> </td> <td valign="top"> <a class="anchor" name="g98bb15525b04d2f6a817c21e07d8b7cd"></a><!-- doxytag: member="cudaGL.h::cuGLGetDevices" ref="g98bb15525b04d2f6a817c21e07d8b7cd" args="(unsigned int *pCudaDeviceCount, CUdevice *pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CUDA__TYPES_g09da14df1a751dcbfeccb9cf0073d64c.html#g09da14df1a751dcbfeccb9cf0073d64c">CUresult</a> cuGLGetDevices </td> <td>(</td> <td class="paramtype">unsigned int * </td> <td class="paramname"> <em>pCudaDeviceCount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__CUDA__TYPES_gcd81b70eb9968392bb5cdf582af8eab4.html#gcd81b70eb9968392bb5cdf582af8eab4">CUdevice</a> * </td> <td class="paramname"> <em>pCudaDevices</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"> <em>cudaDeviceCount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__CUDA__GL_g5d423ad540c04558b683661e279e0c58.html#g5d423ad540c04558b683661e279e0c58">CUGLDeviceList</a> </td> <td class="paramname"> <em>deviceList</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>*pCudaDeviceCount</code> the number of CUDA-compatible devices corresponding to the current OpenGL context. Also returns in <code>*pCudaDevices</code> at most cudaDeviceCount of the CUDA-compatible devices corresponding to the current OpenGL context. If any of the GPUs being used by the current OpenGL context are not CUDA capable then the call will return CUDA_ERROR_NO_DEVICE.<p> The <code>deviceList</code> argument may be any of the following:<ul> <li><a class="el" href="group__CUDA__GL_g3555fe44ce3d83b78a0ea894979d58c2.html#gg3555fe44ce3d83b78a0ea894979d58c243d2b311a54ae5c914c264e8395c3164">CU_GL_DEVICE_LIST_ALL</a>: Query all devices used by the current OpenGL context.</li><li><a class="el" href="group__CUDA__GL_g3555fe44ce3d83b78a0ea894979d58c2.html#gg3555fe44ce3d83b78a0ea894979d58c2dc48f515019afdc0a78cd366871b0fe1">CU_GL_DEVICE_LIST_CURRENT_FRAME</a>: Query the devices used by the current OpenGL context to render the current frame (in SLI).</li><li><a class="el" href="group__CUDA__GL_g3555fe44ce3d83b78a0ea894979d58c2.html#gg3555fe44ce3d83b78a0ea894979d58c29d6d52b3167bd1d144eb08db8b60325a">CU_GL_DEVICE_LIST_NEXT_FRAME</a>: Query the devices used by the current OpenGL context to render the next frame (in SLI). Note that this is a prediction, it can't be guaranteed that this is correct in all cases.</li></ul> <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>pCudaDeviceCount</em> </td><td>- Returned number of CUDA devices. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pCudaDevices</em> </td><td>- Returned CUDA devices. </td></tr> <tr><td valign="top"></td><td valign="top"><em>cudaDeviceCount</em> </td><td>- The size of the output device array pCudaDevices. </td></tr> <tr><td valign="top"></td><td valign="top"><em>deviceList</em> </td><td>- The set of devices to return.</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaaa0eed720f8a87cd1c5fd1c453bc7a03d">CUDA_SUCCESS</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa761bea84083d384d4fb88d51d972aada">CUDA_ERROR_NO_DEVICE</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa90696c86fcee1f536a1ec7d25867feeb">CUDA_ERROR_INVALID_VALUE</a> <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaaa484e9af32c1e9893ff21f0e0191a12d">CUDA_ERROR_INVALID_CONTEXT</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__CUDA__GL_g923988b9596911c39bb55fd848015a3d.html#g923988b9596911c39bb55fd848015a3d" title="Create a CUDA context for interoperability with OpenGL.">cuGLCtxCreate</a>, <a class="el" href="group__CUDA__GL__DEPRECATED_g1eb69794b494f2908664737e3386aec4.html#g1eb69794b494f2908664737e3386aec4" title="Initializes OpenGL interoperability.">cuGLInit</a>, <a class="el" href="group__CUDA__GL_g21ff8296192dc38dff42ba3346078282.html#g21ff8296192dc38dff42ba3346078282" title="Gets the CUDA device associated with hGpu.">cuWGLGetDevice</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>