6.24. VDPAU互操作性

本节介绍CUDA运行时应用程序编程接口中的VDPAU互操作性功能。

Functions

__host__cudaError_t cudaGraphicsVDPAURegisterOutputSurface ( cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int  flags )
Register a VdpOutputSurface object.
__host__cudaError_t cudaGraphicsVDPAURegisterVideoSurface ( cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int  flags )
Register a VdpVideoSurface object.
__host__cudaError_t cudaVDPAUGetDevice ( int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress )
Gets the CUDA device associated with a VdpDevice.
__host__cudaError_t cudaVDPAUSetVDPAUDevice ( int  device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress )
Sets a CUDA device to use VDPAU interoperability.

Functions

__host__cudaError_t cudaGraphicsVDPAURegisterOutputSurface ( cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int  flags )
注册一个VdpOutputSurface对象。
参数
resource
- Pointer to the returned object handle
vdpSurface
- VDPAU object to be registered
flags
- Map flags
描述

将由vdpSurface指定的VdpOutputSurface注册为可供CUDA访问。注册对象的句柄将作为resource返回。该表面的预期用途通过flags参数指定,具体如下:

Note:

请注意,此函数也可能返回之前异步启动的错误代码。

另请参阅:

cudaVDPAUSetVDPAUDevice, cudaGraphicsUnregisterResource, cudaGraphicsSubResourceGetMappedArray, cuGraphicsVDPAURegisterOutputSurface

__host__cudaError_t cudaGraphicsVDPAURegisterVideoSurface ( cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int  flags )
注册一个VdpVideoSurface对象。
参数
resource
- Pointer to the returned object handle
vdpSurface
- VDPAU object to be registered
flags
- Map flags
描述

vdpSurface指定的VdpVideoSurface注册为可由CUDA访问。注册对象的句柄将作为resource返回。该表面的预期用途通过flags指定,如下所示:

Note:

请注意,此函数也可能返回之前异步启动的错误代码。

另请参阅:

cudaVDPAUSetVDPAUDevice, cudaGraphicsUnregisterResource, cudaGraphicsSubResourceGetMappedArray, cuGraphicsVDPAURegisterVideoSurface

__host__cudaError_t cudaVDPAUGetDevice ( int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress )
获取与VdpDevice关联的CUDA设备。
参数
device
- Returns the device associated with vdpDevice, or -1 if the device associated with vdpDevice is not a compute device.
vdpDevice
- A VdpDevice handle
vdpGetProcAddress
- VDPAU's VdpGetProcAddress function pointer
返回

cudaSuccess

描述

返回与VdpDevice关联的CUDA设备(如果适用)。

Note:

请注意,此函数也可能返回之前异步启动的错误代码。

另请参阅:

cudaVDPAUSetVDPAUDevice, cuVDPAUGetDevice

__host__cudaError_t cudaVDPAUSetVDPAUDevice ( int  device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress )
设置一个CUDA设备以使用VDPAU互操作性。
参数
device
- Device to use for VDPAU interoperability
vdpDevice
- The VdpDevice to interoperate with
vdpGetProcAddress
- VDPAU's VdpGetProcAddress function pointer
描述

vdpDevice记录为用于VDPAU与CUDA设备device互操作的VdpDevice,并将device设置为调用主机线程的当前设备。

如果需要,此函数将立即在device上初始化主上下文。

如果device已经初始化,此调用将失败并返回错误cudaErrorSetOnActiveProcess。在这种情况下,必须先使用cudaDeviceReset()重置device,然后才能在device上启用VDPAU互操作性。

Note:

请注意,此函数也可能返回之前异步启动的错误代码。

另请参阅:

cudaGraphicsVDPAURegisterVideoSurface, cudaGraphicsVDPAURegisterOutputSurface, cudaDeviceReset