For Intel+NVIDIA dual-GPU \"Optimus\" setups, an application can export NvOptimusEnablement
as explained in OptimusRenderingPolicies.pdf. This option allows an
According to https://community.amd.com/thread/169965
extern "C" { __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; }
This will select the high performance GPU as long as no profile exists that assigns the application to another GPU.
Please make sure to use a 13.35 or newer driver. Older drivers do not support this.
This code will be ignored when you compile on non-windows machines:
#ifdef _WIN32
#include <windows.h>
extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001;
#endif