cudaError_t cudaGLSetGLDevice ( int  device  ) 

Records the calling thread's current OpenGL context as the OpenGL context to use for OpenGL interoperability with the CUDA device device and sets device as the current device for the calling host thread.

If device has already been initialized then this call will fail with the error cudaErrorSetOnActiveProcess. In this case it is necessary to reset device using cudaDeviceReset() before OpenGL interoperability on device may be enabled.

Parameters:
device - Device to use for OpenGL interoperability
Returns:
cudaSuccess, cudaErrorInvalidDevice, cudaErrorSetOnActiveProcess
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cudaGLRegisterBufferObject, cudaGLMapBufferObject, cudaGLUnmapBufferObject, cudaGLUnregisterBufferObject, cudaGLMapBufferObjectAsync, cudaGLUnmapBufferObjectAsync, cudaDeviceReset


Generated by Doxygen for NVIDIA CUDA Library  NVIDIA