1 phTexRef)hTexRef)pdptr, \fBCUtexref\fP hTexRef)pAddressMode, \fBCUtexref\fP hTexRef, int Dim)phArray, \fBCUtexref\fP hTexRef)pFilterMode, \fBCUtexref\fP hTexRef)pFlags, \fBCUtexref\fP hTexRef)pFormat, int * pNumPackedComponents, \fBCUtexref\fP hTexRef)pOffset, \fBCUtexref\fP hTexRef, \fBCUdeviceptr\fP dptr, unsigned int bytes)hTexRef, const \fBCUDA_ARRAY_DESCRIPTOR\fP * desc, \fBCUdeviceptr\fP dptr, unsigned int PitchInBytes)hTexRef, int Dim, \fBCUaddress_mode\fP am)hTexRef, \fBCUarray\fP hArray, unsigned int Flags)hTexRef, \fBCUfilter_mode\fP fm)hTexRef, unsigned int Flags)hTexRef, \fBCUarray_format\fP Format, int NumChannels).TH "OpenGL Interoperability" 3 "30 Mar 2009" "Version 2.2" "NVIDIA CUDA Library" \" -*- nroff -*-
5 OpenGL Interoperability \-
10 .RI "\fBCUresult\fP \fBcuGLCtxCreate\fP (\fBCUcontext\fP *pCtx, unsigned int Flags, \fBCUdevice\fP device)"
12 .RI "\fICreate a CUDA context for interoperability with OpenGL. \fP"
14 .RI "\fBCUresult\fP \fBcuGLInit\fP (void)"
16 .RI "\fIInitializes OpenGL interoperability. \fP"
18 .RI "\fBCUresult\fP \fBcuGLMapBufferObject\fP (\fBCUdeviceptr\fP *dptr, unsigned int *size, GLuint bufferObj)"
20 .RI "\fIMaps an OpenGL buffer object. \fP"
22 .RI "\fBCUresult\fP \fBcuGLRegisterBufferObject\fP (GLuint bufferObj)"
24 .RI "\fIRegisters an OpenGL buffer object. \fP"
26 .RI "\fBCUresult\fP \fBcuGLUnmapBufferObject\fP (GLuint bufferObj)"
28 .RI "\fIUnmaps an OpenGL buffer object. \fP"
30 .RI "\fBCUresult\fP \fBcuGLUnregisterBufferObject\fP (GLuint bufferObj)"
32 .RI "\fIUnregister an OpenGL buffer object. \fP"
34 .RI "\fBCUresult\fP \fBcuWGLGetDevice\fP (\fBCUdevice\fP *pDevice, HGPUNV hGpu)"
36 .RI "\fIGets the CUDA device associated with hGpu. \fP"
38 .SH "Detailed Description"
40 This section describes the OpenGL interoperability functions of the low-level CUDA driver application programming interface.
41 .SH "Function Documentation"
43 .SS "\fBCUresult\fP cuGLCtxCreate (\fBCUcontext\fP * pCtx, unsigned int Flags, \fBCUdevice\fP device)"
45 Creates a new CUDA context, initializes OpenGL interoperability, and associates the CUDA context with the calling thread. It must be called before performing any other OpenGL interoperability operations. It may fail if the needed OpenGL driver facilities are not available. For usage of the \fCFlags\fP parameter, see \fBcuCtxCreate()\fP.
49 \fIpCtx\fP - Returned CUDA context
51 \fIFlags\fP - Options for CUDA context creation
53 \fIdevice\fP - Device on which to create the context
58 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_OUT_OF_MEMORY\fP
63 Note that this function may also return error codes from previous, asynchronous launches.
68 \fBcuCtxCreate\fP, \fBcuGLInit\fP, \fBcuGLMapBufferObject\fP, \fBcuGLRegisterBufferObject\fP, \fBcuGLUnmapBufferObject\fP, \fBcuGLUnregisterBufferObject\fP, \fBcuWGLGetDevice\fP
72 .SS "\fBCUresult\fP cuGLInit (void)"
74 Initializes OpenGL interoperability. It must be called before performing any other OpenGL interoperability operations. It may fail if the needed OpenGL driver facilities are not available.
78 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_UNKNOWN\fP
83 Note that this function may also return error codes from previous, asynchronous launches.
88 \fBcuGLCtxCreate\fP, \fBcuGLMapBufferObject\fP, \fBcuGLRegisterBufferObject\fP, \fBcuGLUnmapBufferObject\fP, \fBcuGLUnregisterBufferObject\fP, \fBcuWGLGetDevice\fP
92 .SS "\fBCUresult\fP cuGLMapBufferObject (\fBCUdeviceptr\fP * dptr, unsigned int * size, GLuint bufferObj)"
94 Maps the buffer object of ID \fCbufferObj\fP into the address space of the current CUDA context and returns in \fC*dptr\fP and \fC*size\fP the base pointer and size of the resulting mapping.
98 \fIdptr\fP - Returned mapped base pointer
100 \fIsize\fP - Returned size of mapping
102 \fIbufferObj\fP - Buffer object to map
107 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_MAP_FAILED\fP
112 Note that this function may also return error codes from previous, asynchronous launches.
117 \fBcuGLCtxCreate\fP, \fBcuGLInit\fP, \fBcuGLRegisterBufferObject\fP, \fBcuGLUnmapBufferObject\fP, \fBcuGLUnregisterBufferObject\fP, \fBcuWGLGetDevice\fP
121 .SS "\fBCUresult\fP cuGLRegisterBufferObject (GLuint bufferObj)"
123 Registers the buffer object of ID \fCbufferObj\fP for access by CUDA. This function must be called before CUDA can map the buffer object. While it is registered, the buffer object cannot be used by any OpenGL commands, except as a data source for OpenGL drawing commands.
127 \fIbufferObj\fP - Buffer object to register
132 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_ALREADY_MAPPED\fP
137 Note that this function may also return error codes from previous, asynchronous launches.
142 \fBcuGLCtxCreate\fP, \fBcuGLInit\fP, \fBcuGLMapBufferObject\fP, \fBcuGLUnmapBufferObject\fP, \fBcuGLUnregisterBufferObject\fP, \fBcuWGLGetDevice\fP
146 .SS "\fBCUresult\fP cuGLUnmapBufferObject (GLuint bufferObj)"
148 Unmaps the buffer object of ID \fCbufferObj\fP for access by CUDA.
152 \fIbufferObj\fP - Buffer object to unmap
157 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP
162 Note that this function may also return error codes from previous, asynchronous launches.
167 \fBcuGLCtxCreate\fP, \fBcuGLInit\fP, \fBcuGLMapBufferObject\fP, \fBcuGLRegisterBufferObject\fP, \fBcuGLUnregisterBufferObject\fP, \fBcuWGLGetDevice\fP
171 .SS "\fBCUresult\fP cuGLUnregisterBufferObject (GLuint bufferObj)"
173 Unregisters the buffer object of ID \fCbufferObj\fP for access by CUDA.
177 \fIbufferObj\fP - Buffer object to unmap
182 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP
187 Note that this function may also return error codes from previous, asynchronous launches.
192 \fBcuGLCtxCreate\fP, \fBcuGLInit\fP, \fBcuGLMapBufferObject\fP, \fBcuGLRegisterBufferObject\fP, \fBcuGLUnmapBufferObject\fP, \fBcuWGLGetDevice\fP
196 .SS "\fBCUresult\fP cuWGLGetDevice (\fBCUdevice\fP * pDevice, HGPUNV hGpu)"
198 Returns in \fC*pDevice\fP the CUDA device associated with a \fChGpu\fP, if applicable.
202 \fIpDevice\fP - Device associated with hGpu
204 \fIhGpu\fP - Handle to a GPU, as queried via WGL_NV_gpu_affinity()
209 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP
214 Note that this function may also return error codes from previous, asynchronous launches.
219 \fBcuGLCtxCreate\fP, \fBcuGLInit\fP, \fBcuGLMapBufferObject\fP, \fBcuGLRegisterBufferObject\fP, \fBcuGLUnmapBufferObject\fP, \fBcuGLUnregisterBufferObject\fP
225 Generated automatically by Doxygen for NVIDIA CUDA Library from the source code.