예제 #1
0
HRESULT InitCUDA()
{
    printf("InitCUDA() g_pD3DDevice = %p\n", g_pD3DDevice);

    // Now we need to bind a CUDA context to the DX9 device
    // This is the CUDA 2.0 DX9 interface (required for Windows XP and Vista)
    cudaD3D9SetDirect3DDevice(g_pD3DDevice);
    getLastCudaError("cudaD3D9SetDirect3DDevice failed");

    return S_OK;
}
예제 #2
0
	void SimCudaHelper::InitializeD3D9(int cudaDevice, IDirect3DDevice9 *pDxDevice)
	{
		cudaDevice = Init(cudaDevice);
		cudaError res = cudaD3D9SetDirect3DDevice(pDxDevice);
		if(res != cudaSuccess)
		{
			CheckError("cudaGLSetGLDevice failed");
		}
		else 
		{		
			cout << "CUDA: Successful cudaD3D9SetDirect3DDevice\n";
		}
	}