Skip to content

Instantly share code, notes, and snippets.

@usagi
Last active April 13, 2016 08:25
Show Gist options
  • Save usagi/a0832081ed596bdbaab9cc23a3cb5c39 to your computer and use it in GitHub Desktop.
Save usagi/a0832081ed596bdbaab9cc23a3cb5c39 to your computer and use it in GitHub Desktop.
Optimus搭載機でハイパフォーマンスGPUを自動的に使用するアプリの作り方 ref: http://qiita.com/usagi/items/e409322eb6d7e96d7e2f
#ifdef _WIN32
#include <windows.h>
#endif
#include <cstdint>
extern "C"
{
#ifdef _WIN32
__declspec( dllexport )
DWORD
#else
std::uint32_t
#endif
NvOptimusEnablement = 0x00000001;
}
$ nm bin/my_app.exe | grep NvOp
00000000007f2210 D NvOptimusEnablement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment