12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.9 OpenGL Interoperability 513.9 OpenGL InteroperabilityFunctions• cudaError_t cudaGLMapBufferObject (void ∗∗devPtr, GLuint bufObj)Maps a buffer object for access by <strong>CUDA</strong>.• cudaError_t cudaGLRegisterBufferObject (GLuint bufObj)Registers a buffer object for access by <strong>CUDA</strong>.• cudaError_t cudaGLSetGLDevice (int device)Sets the <strong>CUDA</strong> device for use with OpenGL interoperability.• cudaError_t cudaGLUnmapBufferObject (GLuint bufObj)Unmaps a buffer object for access by <strong>CUDA</strong>.• cudaError_t cudaGLUnregisterBufferObject (GLuint bufObj)Unregisters a buffer object for access by <strong>CUDA</strong>.• cudaError_t cudaWGLGetDevice (int ∗device, HGPUNV hGpu)Gets the <strong>CUDA</strong> device associated with hGpu.3.9.1 Detailed DescriptionThis section describes the OpenGL interoperability functions of the <strong>CUDA</strong> runtime application programming interface.3.9.2 Function Documentation3.9.2.1 cudaError_t cudaGLMapBufferObject (void ∗∗ devPtr, GLuint bufObj)Maps the buffer object of ID bufObj into the address space of <strong>CUDA</strong> and returns in ∗devPtr the base pointer of theresulting mapping. The buffer must have previously been registered by calling cudaGLRegisterBufferObject(). Whilea buffer is mapped by <strong>CUDA</strong>, any OpenGL operation which references the buffer will result in undefined behavior.The OpenGL context used to create the buffer, or another context from the same share group, must be bound to thecurrent thread when this is called.Parameters:devPtr - Returned device pointer to <strong>CUDA</strong> objectbufObj - Buffer object ID to mapReturns:Note:cudaSuccess, cudaErrorMapBufferObjectFailedNote that this function may also return error codes from previous, asynchronous launches.Generated 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!