Forcing NVIDIA GPU programmatically in Optimus laptops

According to http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf starting from 302 drivers it is enough to link statically with one of the following libraries: vcamp110.dll, vcamp110d.dll, nvapi.dll, nvapi64.dll, opencl.dll, nvcuda.dll, cudart*.*, or to export a NvOptimusEnablement variable in your program: extern “C” { _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; }