12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

170 Module Documentation3.27 OpenGL InteroperabilityFunctions• CUresult cuGLCtxCreate (CUcontext ∗pCtx, unsigned int Flags, CUdevice device)Create a <strong>CUDA</strong> context for interoperability with OpenGL.• CUresult cuGLInit (void)Initializes OpenGL interoperability.• CUresult cuGLMapBufferObject (CUdeviceptr ∗dptr, unsigned int ∗size, GLuint bufferObj)Maps an OpenGL buffer object.• CUresult cuGLRegisterBufferObject (GLuint bufferObj)Registers an OpenGL buffer object.• CUresult cuGLUnmapBufferObject (GLuint bufferObj)Unmaps an OpenGL buffer object.• CUresult cuGLUnregisterBufferObject (GLuint bufferObj)Unregister an OpenGL buffer object.• CUresult cuWGLGetDevice (CUdevice ∗pDevice, HGPUNV hGpu)Gets the <strong>CUDA</strong> device associated with hGpu.3.27.1 Detailed DescriptionThis section describes the OpenGL interoperability functions of the low-level <strong>CUDA</strong> driver application programminginterface.3.27.2 Function Documentation3.27.2.1 CUresult cuGLCtxCreate (CUcontext ∗ pCtx, unsigned int Flags, CUdevice device)Creates a new <strong>CUDA</strong> context, initializes OpenGL interoperability, and associates the <strong>CUDA</strong> context with the callingthread. It must be called before performing any other OpenGL interoperability operations. It may fail if the neededOpenGL driver facilities are not available. For usage of the Flags parameter, see cuCtxCreate().Parameters:pCtx - Returned <strong>CUDA</strong> contextFlags - Options for <strong>CUDA</strong> context creationdevice - Device on which to create the contextReturns:<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUE, <strong>CUDA</strong>_ERROR_OUT_OF_MEMORYGenerated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!