Files
automatic/modules/dml/pdh/defines.py
T
Seunghoon Lee d711880aa9 New option for DirectML: memory stats provider.
1. Performance Counter.
    Get vram size allocated to & used by python.exe from pdh.dll.
    Generation can be slower than atiadlxx.
    Use memory less greedy then atiadlxx.
    Windows only.
2. atiadlxx.
    Get max vram size and available vram size from AMD GPU driver (atiadlxx.dll).
    Use memory more greedy than Performance Counter.
    Windows & WSL are supported.
3. None.
    Assume available vram size is 8GB.
    Use memory regardless of current vram usage.
2023-08-01 01:58:04 +09:00

23 lines
452 B
Python

from ctypes import *
from ctypes.wintypes import *
PDH_FUNCTION = c_int
PDH_OK = 0x00000000
PDH_MORE_DATA = -2147481646#0x800007D2
DWORD_PTR = POINTER(DWORD)
PWSTR = POINTER(WCHAR)
PZZWSTR = POINTER(WCHAR)
PDH_NOEXPANDCOUNTERS = 1
PDH_NOEXPANDINSTANCES = 2
PDH_REFRESHCOUNTERS = 4
PDH_FMT_LONG = 0x00000100
PDH_FMT_DOUBLE = 0x00000200
PDH_FMT_LARGE = 0x00000400
PDH_FMT_NOSCALE = 0x00001000
PDH_FMT_1000 = 0x00002000
PDH_FMT_NOCAP100 = 0x00008000