Direct3D 11 Interoperability
- Provided by: nvidia-cuda-dev (Version: 10.1.243-3)
- Source: nvidia-cuda-toolkit
- Report a bug
cudaError_t cudaD3D11GetDevice (int *device,
IDXGIAdapter *pAdapter)
Gets the device number for an adapter. cudaError_t
cudaD3D11GetDevices (unsigned int *pCudaDeviceCount, int
*pCudaDevices, unsigned int cudaDeviceCount, ID3D11Device *pD3D11Device,
enum cudaD3D11DeviceList deviceList)
Gets the CUDA devices corresponding to a Direct3D 11 device.
cudaError_t cudaGraphicsD3D11RegisterResource (struct
cudaGraphicsResource **resource, ID3D11Resource *pD3DResource, unsigned int
flags)
Register a Direct3D 11 resource for access by CUDA.
This section describes the Direct3D 11 interoperability functions of the CUDA runtime application programming interface. Note that mapping of Direct3D 11 resources is performed with the graphics API agnostic, resource mapping interface described in Graphics Interopability.
CUDA devices corresponding to a D3D11 device
Enumerator:
Returns in *device the CUDA-compatible device corresponding to the adapter pAdapter obtained from IDXGIFactory::EnumAdapters. This call will succeed only if a device on adapter pAdapter is CUDA-compatible.
Parameters:
Returns:
Note:
See also:
Returns in *pCudaDeviceCount the number of CUDA-compatible devices corresponding to the Direct3D 11 device pD3D11Device. Also returns in *pCudaDevices at most cudaDeviceCount of the the CUDA-compatible devices corresponding to the Direct3D 11 device pD3D11Device.
If any of the GPUs being used to render pDevice are not CUDA capable then the call will return cudaErrorNoDevice.
Parameters:
Returns:
Note:
See also:
Registers the Direct3D 11 resource pD3DResource for access by CUDA.
If this call is successful, then the application will be able to map and unmap this resource until it is unregistered through cudaGraphicsUnregisterResource(). Also on success, this call will increase the internal reference count on pD3DResource. This reference count will be decremented when this resource is unregistered through cudaGraphicsUnregisterResource().
This call potentially has a high-overhead and should not be called every frame in interactive applications.
The type of pD3DResource must be one of the following.
The flags argument may be used to specify additional parameters at register time. The valid values for this parameter are
Not all Direct3D resources of the above types may be used for interoperability with CUDA. The following are some limitations.
A complete list of supported DXGI formats is as follows. For compactness the notation A_{B,C,D} represents A_B, A_C, and A_D.
If pD3DResource is of incorrect type or is already registered, then cudaErrorInvalidResourceHandle is returned. If pD3DResource cannot be registered, then cudaErrorUnknown is returned.
Parameters:
Returns:
Note:
See also:
Generated automatically by Doxygen from the source code.