cudaError_t cudaD3D11SetDirect3DDevice ( ID3D11Device *  pD3D11Device,
int  device = -1 
)

Records pD3D11Device as the Direct3D 11 device to use for Direct3D 11 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 Direct3D 11 interoperability on device may be enabled.

Successfully initializing CUDA interoperability with pD3D11Device will increase the internal reference count on pD3D11Device. This reference count will be decremented when device is reset using cudaDeviceReset().

Parameters:
pD3D11Device - Direct3D device to use for interoperability
device - The CUDA device to use. This device must be among the devices returned when querying cudaD3D11DeviceListAll from cudaD3D11GetDevices, may be set to -1 to automatically select an appropriate CUDA device.
Returns:
cudaSuccess, cudaErrorInitializationError, cudaErrorInvalidValue, cudaErrorSetOnActiveProcess
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cudaD3D11GetDevice, cudaGraphicsD3D11RegisterResource, cudaDeviceReset


Generated by Doxygen for NVIDIA CUDA Library  NVIDIA