sohobta.blogg.se

Cuda driver api
Cuda driver api








cuda driver api

The function cudaDeviceReset() will deinitialize the primary context for the calling thread's current device immediately. Primary contexts will remain active until they are explicitly deinitialized using cudaDeviceReset(). (or if the current device has already been initialized, in the case of cudaSetDeviceFlags()).

cuda driver api

Note that these functions will fail with cudaErrorSetOnActiveProcess if they are called when the primary context for the specified device has already been initialized. The context which the CUDA Runtime API initializes will be initialized using the parameters specified by the CUDA Runtime API functions cudaSetDeviceFlags(), cudaD3D9SetDirect3DDevice(), cudaD3D10SetDirect3DDevice(), cudaD3D11SetDirect3DDevice(), cudaGLSetGLDevice(), and cudaVDPAUSetVDPAUDevice(). If no CUcontext is current to the calling thread when a CUDA Runtime API call which requires an active context is made, then the primary context for a device will be selected, made current to the calling thread, and initialized. The CUDA Runtime API will automatically initialize the primary context for a device at the first CUDA Runtime API call which requires an active context. The function cudaSetDevice() makes the primary context for the specified device current to the calling thread by calling cuCtxSetCurrent(). From the perspective of the CUDA Runtime API, a device and its primary context are synonymous.ĬUDA Runtime API calls operate on the CUDA Driver API CUcontext which is current to to the calling host thread. The specific context which the CUDA Runtime API uses for a device is called the device's primary context. There exists a one to one relationship between CUDA devices in the CUDA Runtime API and CUcontext s in the CUDA Driver API within a process.

cuda driver api

This section describes the interactions between the CUDA Driver API and the CUDA Runtime API Interactions between the CUDA Driver API and the CUDA Runtime API.










Cuda driver api