I'm trying to make a simple Command line program to compare the times for CPU and GPU in matrix multiplication. The CPU part of the program has been done quickly enough, but I'm having serious trouble in getting the first part of the GPU section (Visual C++ 2010 Express):
//Setting up GPU
HRESULT hr;
ID3D11Device *g_pD3DDevice;
ID3D11DeviceContext *g_pD3DContext;
D3D_FEATURE_LEVEL *g_D3DFeatureLevel;
hr = D3D11CreateDevice( NULL, D3D_DRIVER_TYPE_HARDWARE, NULL,D3D11_CREATE_DEVICE_SINGLETHREADED|D3D11_CREATE_DEVICE_DEBUG,NULL, 0, D3D11_SDK_VERSION, &g_pD3DDevice, g_D3DFeatureLevel, &g_pD3DContext);
This does not even compile and I'm getting three errors here (no line number is specified but an object "cpugpu.obj" is specified as the file in the error list window):
Error 2 error LNK2028: unresolved token (0A000024) "extern "C" long __stdcall D3D11CreateDevice(struct IDXGIAdapter *,enum D3D_DRIVER_TYPE,struct HINSTANCE__ *,unsigned int,enum D3D_FEATURE_LEVEL const *,unsigned int,unsigned int,struct ID3D11Device * *,enum D3D_FEATURE_LEVEL *,struct ID3D11DeviceContext * *)" (?D3D11CreateDevice@@$$J240YGJPAUIDXGIAdapter@@W4D3D_DRIVER_TYPE@@PAUHINSTANCE__@@IPBW4D3D_FEATURE_LEVEL@@IIPAPAUID3D11Device@@PAW44@PAPAUID3D11DeviceContext@@@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z) C: \Users\simplyme\documents\visual studio 2010\Projects\cpugpu\cpugpu\cpugpu.obj
The next Error is:
Error 3 error LNK2019: unresolved external symbol "extern "C" long __stdcall D3D11CreateDevice(struct IDXGIAdapter *,enum D3D_DRIVER_TYPE,struct HINSTANCE__ *,unsigned int,enum D3D_FEATURE_LEVEL const *,unsigned int,unsigned int,struct ID3D11Device * *,enum D3D_FEATURE_LEVEL *,struct ID3D11DeviceContext * *)" (?D3D11CreateDevice@@$$J240YGJPAUIDXGIAdapter@@W4D3D_DRIVER_TYPE@@PAUHINSTANCE__@@IPBW4D3D_FEATURE_LEVEL@@IIPAPAUID3D11Device@@PAW44@PAPAUID3D11DeviceContext@@@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z) C: \Users\simplyme\documents\visual studio 2010\Projects\cpugpu\cpugpu\cpugpu.obj
And the last one is:
Error 4 error LNK1120: 2 unresolved externals C: \Users\simplyme\documents\visual studio 2010\Projects\cpugpu\Debug\cpugpu.exe
I installed the DirectX SDK (June 2010) and I have included the Include files and reference directories into the project. I have an NVidia 8600mgt with the latest official driver from the Nvidia website. And I'm using Vista home basic.
I have downloaded other examples from other websites "http://www.codeproject.com/KB/directx/DirectX11ComputeShaders.aspx" and even these come with some syntax or undefined error.
Can someone tell me what I'm missing here? Or is there some place where I can download some working example of matrix multiplication using the GPU and study it? I'm trying to make a presentation on this and I thought it would be useful if I had a demonstration of the possible performance gain.
//Setting up GPU
HRESULT hr;
ID3D11Device *g_pD3DDevice;
ID3D11DeviceContext *g_pD3DContext;
D3D_FEATURE_LEVEL *g_D3DFeatureLevel;
hr = D3D11CreateDevice( NULL, D3D_DRIVER_TYPE_HARDWARE, NULL,D3D11_CREATE_DEVICE_SINGLETHREADED|D3D11_CREATE_DEVICE_DEBUG,NULL, 0, D3D11_SDK_VERSION, &g_pD3DDevice, g_D3DFeatureLevel, &g_pD3DContext);
This does not even compile and I'm getting three errors here (no line number is specified but an object "cpugpu.obj" is specified as the file in the error list window):
Error 2 error LNK2028: unresolved token (0A000024) "extern "C" long __stdcall D3D11CreateDevice(struct IDXGIAdapter *,enum D3D_DRIVER_TYPE,struct HINSTANCE__ *,unsigned int,enum D3D_FEATURE_LEVEL const *,unsigned int,unsigned int,struct ID3D11Device * *,enum D3D_FEATURE_LEVEL *,struct ID3D11DeviceContext * *)" (?D3D11CreateDevice@@$$J240YGJPAUIDXGIAdapter@@W4D3D_DRIVER_TYPE@@PAUHINSTANCE__@@IPBW4D3D_FEATURE_LEVEL@@IIPAPAUID3D11Device@@PAW44@PAPAUID3D11DeviceContext@@@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z) C: \Users\simplyme\documents\visual studio 2010\Projects\cpugpu\cpugpu\cpugpu.obj
The next Error is:
Error 3 error LNK2019: unresolved external symbol "extern "C" long __stdcall D3D11CreateDevice(struct IDXGIAdapter *,enum D3D_DRIVER_TYPE,struct HINSTANCE__ *,unsigned int,enum D3D_FEATURE_LEVEL const *,unsigned int,unsigned int,struct ID3D11Device * *,enum D3D_FEATURE_LEVEL *,struct ID3D11DeviceContext * *)" (?D3D11CreateDevice@@$$J240YGJPAUIDXGIAdapter@@W4D3D_DRIVER_TYPE@@PAUHINSTANCE__@@IPBW4D3D_FEATURE_LEVEL@@IIPAPAUID3D11Device@@PAW44@PAPAUID3D11DeviceContext@@@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z) C: \Users\simplyme\documents\visual studio 2010\Projects\cpugpu\cpugpu\cpugpu.obj
And the last one is:
Error 4 error LNK1120: 2 unresolved externals C: \Users\simplyme\documents\visual studio 2010\Projects\cpugpu\Debug\cpugpu.exe
I installed the DirectX SDK (June 2010) and I have included the Include files and reference directories into the project. I have an NVidia 8600mgt with the latest official driver from the Nvidia website. And I'm using Vista home basic.
I have downloaded other examples from other websites "http://www.codeproject.com/KB/directx/DirectX11ComputeShaders.aspx" and even these come with some syntax or undefined error.
Can someone tell me what I'm missing here? Or is there some place where I can download some working example of matrix multiplication using the GPU and study it? I'm trying to make a presentation on this and I thought it would be useful if I had a demonstration of the possible performance gain.
