Library/ManagedCuda/CudaContext.cs
/// <summary>
/// Returns the Direct3D device against which the CUDA context, bound to the calling thread,
/// was created.
/// </summary>
/// <param name="dXVersion"></param>
/// <returns></returns>
Returns the Direct3D device against which the CUDA context, bound to the calling thread,
was created.
Returns the Direct3D device against which the CUDA context bound to the calling thread was created .
public static IntPtr GetDirect3DDevice(DirectXVersion dXVersion)
		{
			CUResult res;
			IntPtr d3dDevice = new IntPtr();
			switch (dXVersion)
			{
				case DirectXVersion.D3D9:
					res = DirectX9NativeMethods.CUDA3.cuD3D9GetDirect3DDevice(ref d3dDevice);
					break;
				case DirectXVersion.D3D10:
					res = DirectX10NativeMethods.CUDA3.cuD3D10GetDirect3DDevice(ref d3dDevice);
					break;
				case DirectXVersion.D3D11:
					res = DirectX11NativeMethods.cuD3D11GetDirect3DDevice(ref d3dDevice);
					break;
				default:
					throw new ArgumentException("DirectX version not supported.", "dXVersion");
			}
			if (res != CUResult.Success)
				throw new CudaException(res);
			return d3dDevice;
		}
public static IntPtr GetDirect3DDevice ( DirectXVersion dXVersion ) { CUResult res ; IntPtr d3dDevice = new IntPtr ( ) ; switch ( dXVersion ) { case DirectXVersion . D3D9 : res = DirectX9NativeMethods . CUDA3 . cuD3D9GetDirect3DDevice ( ref d3dDevice ) ; break ; case DirectXVersion . D3D10 : res = DirectX10NativeMethods . CUDA3 . cuD3D10GetDirect3DDevice ( ref d3dDevice ) ; break ; case DirectXVersion . D3D11 : res = DirectX11NativeMethods . cuD3D11GetDirect3DDevice ( ref d3dDevice ) ; break ; default : throw new ArgumentException ( " " , " " ) ; } if ( res != CUResult . Success ) throw new CudaException ( res ) ; return d3dDevice ; }
Returns the Direct3D device against which the CUDA context, bound to the calling thread,
was created.
Returns the Direct3D device against which the CUDA context bound to the calling thread was created .
None
dXVersion
DirectXVersion
None