
    `iV                       S SK 7  S SK Jr  S SKrS SKrS SKrS SKrS SKJr  \rS r	Sr
 " S S\5      r\rS rSrSrS	rS
rSrSrSr " S S\5      r\rS rSrSrS	rS
r " S S\5      r\rS rSr " S S\5      r \r!S r"Sr#Sr$S	r%S
r& " S S\5      r'\r(S r)Sr*Sr+Sr,S	r-S
r.Sr/Sr0Sr1Sr2 " S S\5      r3\r4S r5Sr6Sr7\r8S r9Sr:Sr; " S S\5      r<\r=S r>Sr?Sr@ " S S\5      rA\rBS rCSrDSrES	rFS
rG " S S\5      rH\rIS rJSrK " S S \5      rL\rMS rNSrOSrPS	rQS
rRSrSSrTSrUSrVS!rWS"rXS#rYS$rZS%r[S&r\S'r]S(r^ " S) S*\5      r_\r`S raSrbSrcS	rd " S+ S,\5      re\rfS rgSrhSriS	rjS
rkSrlSrmSrnSroS!rpS"rqS#rrS$rsS%rtS&ruS'rvS-rwS.rxS/ryS0rzS1r{S2r|S3r}S4r~ " S5 S6\5      r\rS rSr " S7 S8\5      r\rS rSr " S9 S:\5      r\rS rSrSr " S; S<\5      r\rS rSrSr " S= S>\5      r\rS rSrSr " S? S@\5      r\rS rSrSAr " SB SC\5      r\rS rSrSrS	rS
rSr " SD SE\5      r\rS rSrSrS	rS
rSrS"rS#rS$r " SF SG\5      r\rS rSrSrS	rS
rSrSrSr " SH SI\5      r\rS rSrSr " SJ SK\5      r\rS rS"rS1rSLrSMrSNr " SO SP\5      rS rSrS-rSQrSRrSQrSSrSLrS(rS-r\" ST5      r\" ST5      rSq\GR                  " 5       rS q " SU SV\5      rSW r\" 5         SX r\" 5       rSY r " SZ S[\5      rS\ rS] r " S^ S_\5      r\" \5      rS` r " Sa Sb\5      r " Sc Sd\5      r " Se Sf\5      r " Sg Sh\5      r " Si Sj\5      r " Sk Sl\5      r " Sm Sn\5      r\" \5      r " So Sp\5      r " Sq Sr\5      r " Ss St\5      r " Su Sv\5      r " Sw Sx\5      r " Sy Sz\5      r " S{ S|\5      r " S} S~\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r\" \5      rSrSrS
Gr SGrS-GrS GrG\\-  \-  G\ -  G\-  G\-  GrSGrSGrG\GrS
GrSGr	SGr
S GrG\G\-  G\-  G\-  G\	-  G\
-  Gr " S S\5      Gr " S S\5      GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS GrS Gr S Gr!S Gr"S Gr#S Gr$S Gr%S Gr&S Gr'S Gr(S Gr)S Gr*S Gr+S Gr,S Gr-S Gr.S Gr/S Gr0S Gr1S Gr2S Gr3S Gr4S Gr5S Gr6S Gr7S Gr8S Gr9S Gr:S Gr;S Gr<S Gr=S Gr>S Gr?S Gr@S GrAS GrBS GrCS GrDS GrES GrFS GrGS GrHS GrIS GrJS GrKS GrLS GrMS GrNS GrOS GrPS GrQS GrRS GrSS GrTS GrUS GrVS GrWS GrXS GrYS GrZS Gr[S Gr\S Gr]S Gr^S Gr_S Gr`S GraS GrbS GrcS GrdS GreS GrfS GrgS GrhS GriS GrjS GrkS GrlS GrmS GrnS GroS GrpS GrqS GrrS GrsS GrtS GruS GrvS GrwS GrxS GryS GrzS Gr{S Gr|S Gr}S Gr~S GrS GrGS  GrGS GrGS GrGS GrGS GrGS GrGS GrGS GrGS Grg(	      )*)c_uintN)Enum   c                       \ rS rSrSrSrSrg)nvmlEnableState_t-   r   r    N)__name__
__module____qualname____firstlineno__NVML_FEATURE_DISABLEDNVML_FEATURE_ENABLED__static_attributes__r
       N/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/py3nvml/py3nvml.pyr   r   -   s    r   r                     c                   4    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rg)nvmlBrandType_t;   r   r   r   r   r   r   r   r   r
   N)r   r   r   r   NVML_BRAND_UNKNOWNNVML_BRAND_QUADRONVML_BRAND_TESLANVML_BRAND_NVSNVML_BRAND_GRIDNVML_BRAND_GEFORCENVML_BRAND_TITANNVML_BRAND_COUNTr   r
   r   r   r   r   ;   s0    NOr   r   c                   ,    \ rS rSrSrSrSrSrSrSr	Sr
g	)
nvmlTemperatureThresholds_tL   a  
// Temperature at which the GPU will shut down for HW protection
NVML_TEMPERATURE_THRESHOLD_SHUTDOWN = 0,
// Temperature at which the GPU will begin HW slowdown
NVML_TEMPERATURE_THRESHOLD_SLOWDOWN = 1,
// Memory Temperature at which the GPU will begin SW slowdown
NVML_TEMPERATURE_THRESHOLD_MEM_MAX  = 2,
// GPU Temperature at which the GPU can be throttled below base clock
NVML_TEMPERATURE_THRESHOLD_GPU_MAX  = 3,
r   r   r   r   r   r
   N)r   r   r   r   __doc__#NVML_TEMPERATURE_THRESHOLD_SHUTDOWN#NVML_TEMPERATURE_THRESHOLD_SLOWDOWN"NVML_TEMPERATURE_THRESHOLD_MEM_MAX"NVML_TEMPERATURE_THRESHOLD_GPU_MAX NVML_TEMPERATURE_THRESHOLD_COUNTr   r
   r   r   r&   r&   L   s'    	 +,'*+')*&)*&'($r   r&   c                        \ rS rSrSrSrSrSrg)nvmlTemperatureSensors_ta   zK
NVML_TEMPERATURE_GPU      = 0,    //!< Temperature sensor for the GPU die
r   r   r
   N)r   r   r   r   r(   NVML_TEMPERATURE_GPUNVML_TEMPERATURE_COUNTr   r
   r   r   r/   r/   a   s     r   r/   c                   (    \ rS rSrSrSrSrSrSrSr	g)	nvmlComputeMode_tr   r   r   r   r   r   r
   N)
r   r   r   r   NVML_COMPUTEMODE_DEFAULT!NVML_COMPUTEMODE_EXCLUSIVE_THREADNVML_COMPUTEMODE_PROHIBITED"NVML_COMPUTEMODE_EXCLUSIVE_PROCESSNVML_COMPUTEMODE_COUNTr   r
   r   r   r4   r4   r   s      ()%"#)*&r   r4      c                   <    \ rS rSrSrSrSrSrSrSr	Sr
SrS	rS
rSrg)nvmlMemoryLocation_t   r   r   r   r   r   r   r   r   r;   r
   N)r   r   r   r   NVML_MEMORY_LOCATION_L1_CACHENVML_MEMORY_LOCATION_L2_CACHENVML_MEMORY_LOCATION_DRAM"NVML_MEMORY_LOCATION_DEVICE_MEMORY"NVML_MEMORY_LOCATION_REGISTER_FILE#NVML_MEMORY_LOCATION_TEXTURE_MEMORY NVML_MEMORY_LOCATION_TEXTURE_SHMNVML_MEMORY_LOCATION_CBUNVML_MEMORY_LOCATION_SRAMNVML_MEMORY_LOCATION_COUNTr   r
   r   r   r=   r=      s>    $%!$%! !)*&)*&*+''($  !!"r   r=   c                   $    \ rS rSrSrSrSrSrSrg)nvmlEccCounterType_t   z
// Volatile counts are reset each time the driver loads.
NVML_VOLATILE_ECC      = 0,
// Aggregate counts persist across reboots (i.e. for the lifetime of the
// device)
NVML_AGGREGATE_ECC     = 1,
r   r   r   r
   N)	r   r   r   r   r(   NVML_VOLATILE_ECCNVML_AGGREGATE_ECCNVML_ECC_COUNTER_TYPE_COUNTr   r
   r   r   rJ   rJ      s     "#r   rJ   c                   $    \ rS rSrSrSrSrSrSrg)nvmlMemoryErrorType_t   a  
/**
 * A memory error that was corrected
 *
 * For ECC errors, these are single bit errors
 * For Texture memory, these are errors fixed by resend
 */
NVML_MEMORY_ERROR_TYPE_CORRECTED = 0,
/**
 * A memory error that was not corrected
 *
 * For ECC errors, these are double bit errors
 * For Texture memory, these are errors where the resend fails
 */
NVML_MEMORY_ERROR_TYPE_UNCORRECTED = 1,
r   r   r   r
   N)	r   r   r   r   r(    NVML_MEMORY_ERROR_TYPE_CORRECTED"NVML_MEMORY_ERROR_TYPE_UNCORRECTEDNVML_MEMORY_ERROR_TYPE_COUNTr   r
   r   r   rP   rP      s      ()$)*&#$ r   rP   c                   (    \ rS rSrSrSrSrSrSrSr	g)	nvmlClockType_t   r   r   r   r   r   r
   N)
r   r   r   r   NVML_CLOCK_GRAPHICSNVML_CLOCK_SMNVML_CLOCK_MEMNVML_CLOCK_VIDEONVML_CLOCK_COUNTr   r
   r   r   rV   rV      s    MNr   rV   c                        \ rS rSrSrSrSrSrg)nvmlDriverModel_t   z
// WDDM driver model -- GPU treated as a display device
NVML_DRIVER_WDDM      = 0,
// WDM (TCC) model (recommended) -- GPU treated as a generic device
NVML_DRIVER_WDM       = 1
r   r   r
   N)r   r   r   r   r(   NVML_DRIVER_WDDMNVML_DRIVER_WDMr   r
   r   r   r^   r^      s     Or   r^   	   
                      c                   \    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrSrSrSrSrSrSrSrg)nvmlPstates_t   zJ
Performance State 0 is maximum performance and 15 is minimum performance
r   r   r   r   r   r   r   r   r;   rb   rc   rd   re   rf   rg   rh   ri   r
   N)r   r   r   r   r(   NVML_PSTATE_0NVML_PSTATE_1NVML_PSTATE_2NVML_PSTATE_3NVML_PSTATE_4NVML_PSTATE_5NVML_PSTATE_6NVML_PSTATE_7NVML_PSTATE_8NVML_PSTATE_9NVML_PSTATE_10NVML_PSTATE_11NVML_PSTATE_12NVML_PSTATE_13NVML_PSTATE_14NVML_PSTATE_15NVML_PSTATE_UNKNOWNr   r
   r   r   rk   rk      s_     MMMMMMMMMMNNNNNNr   rk   c                   (    \ rS rSrSrSrSrSrSrSr	g)	nvmlInforomObject_ti  z
// An object defined by OEM
NVML_INFOROM_OEM            = 0,
// The ECC object determining the level of ECC support
NVML_INFOROM_ECC            = 1,
// The power management object
NVML_INFOROM_POWER          = 2,
r   r   r   r   r
   N)
r   r   r   r   r(   NVML_INFOROM_OEMNVML_INFOROM_ECCNVML_INFOROM_POWERNVML_INFOROM_COUNTr   r
   r   r   r   r     s!     r   r                          c                   x    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrg)nvmlReturn_ti4  a  
// The operation was successful
NVML_SUCCESS = 0,
// NVML was not first initialized with nvmlInit()
NVML_ERROR_UNINITIALIZED = 1,
// A supplied argument is invalid
NVML_ERROR_INVALID_ARGUMENT = 2,
// The requested operation is not available on target device
NVML_ERROR_NOT_SUPPORTED = 3,
// The current user does not have permission for operation
NVML_ERROR_NO_PERMISSION = 4,
// Deprecated: Multiple initializations are now allowed through ref counting
NVML_ERROR_ALREADY_INITIALIZED = 5,
// A query to find an object was unsuccessful
NVML_ERROR_NOT_FOUND = 6,
// An input argument is not large enough
NVML_ERROR_INSUFFICIENT_SIZE = 7,
//A device's external power cables are not properly attached
NVML_ERROR_INSUFFICIENT_POWER = 8,
// NVIDIA driver is not loaded
NVML_ERROR_DRIVER_NOT_LOADED = 9,
// User provided timeout passed
NVML_ERROR_TIMEOUT = 10,
// NVIDIA Kernel detected an interrupt issue with a GPU
NVML_ERROR_IRQ_ISSUE = 11,
// NVML Shared Library couldn't be found or loaded
NVML_ERROR_LIBRARY_NOT_FOUND = 12,
// Local version of NVML doesn't implement this function
NVML_ERROR_FUNCTION_NOT_FOUND = 13,
// infoROM is corrupted
NVML_ERROR_CORRUPTED_INFOROM = 14,
// The GPU has fallen off the bus or has otherwise become inaccessible
NVML_ERROR_GPU_IS_LOST = 15,
// The GPU requires a reset before it can be used again
NVML_ERROR_RESET_REQUIRED = 16,
// The GPU control device has been blocked by the operating system/cgroups
NVML_ERROR_OPERATING_SYSTEM = 17,
// RM detects a driver/library version mismatch
NVML_ERROR_LIB_RM_VERSION_MISMATCH = 18,
// An operation cannot be performed because the GPU is currently in use
NVML_ERROR_IN_USE = 19,
// Insufficient memory
NVML_ERROR_MEMORY = 20,
// No data
NVML_ERROR_NO_DATA = 21,
// The requested vgpu operation is not available on target device, becasue
// ECC is enabled
NVML_ERROR_VGPU_ECC_NOT_SUPPORTED = 22,
// An internal driver error occurred
NVML_ERROR_UNKNOWN = 999
r   r   r   r   r   r   r   r   r;   rb   rc   rd   re   rf   rg   rh   r   r   r   r   r   r   r   r   r
   N)r   r   r   r   r(   NVML_SUCCESSNVML_ERROR_UNINITIALIZEDNVML_ERROR_INVALID_ARGUMENTNVML_ERROR_NOT_SUPPORTEDNVML_ERROR_NO_PERMISSIONNVML_ERROR_ALREADY_INITIALIZEDNVML_ERROR_NOT_FOUNDNVML_ERROR_INSUFFICIENT_SIZENVML_ERROR_INSUFFICIENT_POWERNVML_ERROR_DRIVER_NOT_LOADEDNVML_ERROR_TIMEOUTNVML_ERROR_IRQ_ISSUENVML_ERROR_LIBRARY_NOT_FOUNDNVML_ERROR_FUNCTION_NOT_FOUNDNVML_ERROR_CORRUPTED_INFOROMNVML_ERROR_GPU_IS_LOSTNVML_ERROR_RESET_REQUIREDNVML_ERROR_OPERATING_SYSTEM"NVML_ERROR_LIB_RM_VERSION_MISMATCHNVML_ERROR_IN_USENVML_ERROR_MEMORYNVML_ERROR_NO_DATA!NVML_ERROR_VGPU_ECC_NOT_SUPPORTEDNVML_ERROR_UNKNOWNr   r
   r   r   r   r   4  s    2f L "#  %&"#$ $%!#$ #% $&!#%  ""$)+&(*%r   r   c                        \ rS rSrSrSrSrSrg)nvmlFanStatei  zp
NVML_FAN_NORMAL       = 0,     //!< Fan is working properly
NVML_FAN_FAILED       = 1      //!< Fan has failed
r   r   r
   N)r   r   r   r   r(   NVML_FAN_NORMALNVML_FAN_FAILEDr   r
   r   r   r   r     s     OOr   r   c                        \ rS rSrSrSrSrSrg)nvmlLedColori  z
NVML_LED_COLOR_GREEN       = 0,     //!< GREEN, indicates good health
NVML_LED_COLOR_AMBER       = 1      //!< AMBER, indicates problem
r   r   r
   N)r   r   r   r   r(   NVML_LED_COLOR_GREENNVML_LED_COLOR_AMBERr   r
   r   r   r   r     s     r   r   c                   $    \ rS rSrSrSrSrSrSrg)nvmlGpuOperationModei  a  
// Everything is enabled and running at full speed
NVML_GOM_ALL_ON = 0
// Designed for running only compute tasks. Graphics operations are not
// allowed
NVML_GOM_COMPUTE = 1
// Designed for running graphics applications that don't require
NVML_GOM_LOW_DP = 2
r   r   r   r
   N)	r   r   r   r   r(   NVML_GOM_ALL_ONNVML_GOM_COMPUTENVML_GOM_LOW_DPr   r
   r   r   r   r     s     OOr   r   c                   $    \ rS rSrSrSrSrSrSrg)nvmlPageRetirementCause_ti  z
// Page was retired due to multiple single bit ECC error
NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS = 0,
// Page was retired due to double bit ECC error
NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR = 1,
r   r   r   r
   N)	r   r   r   r   r(   /NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR9NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS NVML_PAGE_RETIREMENT_CAUSE_COUNTr   r
   r   r   r   r     s     783@A='($r   r   c                   $    \ rS rSrSrSrSrSrSrg)nvmlRestrictedAPI_ti  a;  
// APIs that change application clocks, see
// nvmlDeviceSetApplicationsClocks and see
// nvmlDeviceResetApplicationsClocks
NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS = 0,
// APIs that enable/disable Auto Boosted clocks
// see nvmlDeviceSetAutoBoostedClocksEnabled
NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS = 1,
r   r   r   r
   N)	r   r   r   r   r(   *NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS+NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKSNVML_RESTRICTED_API_COUNTr   r
   r   r   r   r     s     23.23/ !r   r      c                        \ rS rSrSrSrSrSrg)nvmlBridgeChipType_ti  r   r   r   r
   N)r   r   r   r   NVML_BRIDGE_CHIP_PLXNVML_BRIDGE_CHIP_BRO4NVML_MAX_PHYSICAL_BRIDGEr   r
   r   r   r   r     s    "r   r   c                   ,    \ rS rSrSrSrSrSrSrSr	Sr
g	)
nvmlValueType_ti  r   r   r   r   r   r   r
   N)r   r   r   r   NVML_VALUE_TYPE_DOUBLENVML_VALUE_TYPE_UNSIGNED_INTNVML_VALUE_TYPE_UNSIGNED_LONG"NVML_VALUE_TYPE_UNSIGNED_LONG_LONG NVML_VALUE_TYPE_SIGNED_LONG_LONGNVML_VALUE_TYPE_COUNTr   r
   r   r   r   r     s&    #$ $%!)*&'($r   r   c                   <    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrg)nvmlPerfPolicyType_ti  a  
// How long did power violations cause the GPU to be below application
// clocks
NVML_PERF_POLICY_POWER = 0,
// How long did thermal violations cause the GPU to be below application
// clocks
NVML_PERF_POLICY_THERMAL = 1,
// How long did sync boost cause the GPU to be below application clocks
NVML_PERF_POLICY_SYNC_BOOST = 2,
// How long did the board limit cause the GPU to be below application clocks
NVML_PERF_POLICY_BOARD_LIMIT = 3,
// How long did low utilization cause the GPU to be below application clocks
NVML_PERF_POLICY_LOW_UTILIZATION = 4,
// How long did the board reliability limit cause the GPU to be below
// application clocks
NVML_PERF_POLICY_RELIABILITY = 5,
// Total time the GPU was held below application clocks by any limiter
// (0 - 5 above)
NVML_PERF_POLICY_TOTAL_APP_CLOCKS = 10,
// Total time the GPU was held below base clocks
NVML_PERF_POLICY_TOTAL_BASE_CLOCKS = 11,
r   r   r   r   r   r   rc   rd   re   r
   N)r   r   r   r   r(   NVML_PERF_POLICY_POWERNVML_PERF_POLICY_THERMALNVML_PERF_POLICY_SYNC_BOOSTNVML_PERF_POLICY_BOARD_LIMIT NVML_PERF_POLICY_LOW_UTILIZATIONNVML_PERF_POLICY_RELIABILITY!NVML_PERF_POLICY_TOTAL_APP_CLOCKS"NVML_PERF_POLICY_TOTAL_BASE_CLOCKSNVML_PERF_POLICY_COUNTr   r
   r   r   r   r     s?    ,  "##$ '($#$ (*%)+&r   r   c                   8    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrg)nvmlSamplingType_ti  a  
// To represent total power drawn by GPU
NVML_TOTAL_POWER_SAMPLES        = 0,
// To represent percent of time during which one or more kernels was
// executing on the GPU
NVML_GPU_UTILIZATION_SAMPLES    = 1,
// To represent percent of time during which global (device) memory was
// being read or written
NVML_MEMORY_UTILIZATION_SAMPLES = 2,
// To represent percent of time during which NVENC remains busy
NVML_ENC_UTILIZATION_SAMPLES    = 3,
// To represent percent of time during which NVDEC remains busy
NVML_DEC_UTILIZATION_SAMPLES    = 4,
// To represent processor clock samples
NVML_PROCESSOR_CLK_SAMPLES      = 5,
// To represent memory clock samples
NVML_MEMORY_CLK_SAMPLES         = 6,
r   r   r   r   r   r   r   r   r
   N)r   r   r   r   r(   NVML_TOTAL_POWER_SAMPLESNVML_GPU_UTILIZATION_SAMPLESNVML_MEMORY_UTILIZATION_SAMPLESNVML_ENC_UTILIZATION_SAMPLESNVML_DEC_UTILIZATION_SAMPLESNVML_PROCESSOR_CLK_SAMPLESNVML_MEMORY_CLK_SAMPLESNVML_SAMPLINGTYPE_COUNTr   r
   r   r   r   r     s9    $  !#$ &'##$ #$ !"r   r   c                   $    \ rS rSrSrSrSrSrSrg)nvmlPcieUtilCouter_ti:  zy
NVML_PCIE_UTIL_TX_BYTES             = 0, // 1KB granularity
NVML_PCIE_UTIL_RX_BYTES             = 1, // 1KB granularity
r   r   r   r
   N)	r   r   r   r   r(   NVML_PCIE_UTIL_TX_BYTESNVML_PCIE_UTIL_RX_BYTESNVML_PCIE_UTIL_COUNTr   r
   r   r   r   r   :  s      r   r      (   2   c                   0    \ rS rSrSrSrSrSrSrSr	Sr
S	rg
)nvmlGpuTopologyLevel_tiJ  a!  
// e.g. Tesla K80
NVML_TOPOLOGY_INTERNAL           = 0,
// all devices that only need traverse a single PCIe switch
NVML_TOPOLOGY_SINGLE             = 10,
// all devices that need not traverse a host bridge
NVML_TOPOLOGY_MULTIPLE           = 20,
// all devices that are connected to the same host bridge
NVML_TOPOLOGY_HOSTBRIDGE         = 30,
// all devices that are connected to the same NUMA node but possibly
// multiple host bridges
NVML_TOPOLOGY_NODE               = 40,
// all devices in the system
NVML_TOPOLOGY_SYSTEM             = 50,
r   rc   r   r   r   r   r
   N)r   r   r   r   r(   NVML_TOPOLOGY_INTERNALNVML_TOPOLOGY_SINGLENVML_TOPOLOGY_MULTIPLENVML_TOPOLOGY_HOSTBRIDGENVML_TOPOLOGY_CPUNVML_TOPOLOGY_SYSTEMr   r
   r   r   r   r   J  s-     !r   r   P   Q   @   c                       \ rS rSr\" 5       r0 \S_\S_\S_\	S_\
S_\S_\S_\S	_\S
_\S_\S_\S_\S_\S_\S_\S_\S_\S\S\S\S\S\S0ErS rS rS r Sr!g)	NVMLErrori{  UninitializedzInvalid ArgumentzNot SupportedzInsufficient PermissionszAlready Initializedz	Not FoundzInsufficient SizezInsufficient External PowerzDriver Not LoadedTimeoutzInterrupt Request IssuezNVML Shared Library Not FoundzFunction Not FoundzCorrupted infoROMzGPU is lostzGPU requires restartz-The operating system has blocked the request.z,RM has detected an NVML/RM version mismatch.zThe GPU is currently in usezInsufficient MemoryzNo dataz7Requested vgpu operation not available with ECC enabledzUnknown Errorc                     U [         :X  a  [         R                  R                  X5      n [        R	                  U 5      nXl        U$ )zi
Maps value to a proper subclass of NVMLError.
See _extractNVMLErrorsAsClasses function for more details
)r   _valClassMappingget	Exception__new__value)typr   objs      r   r   NVMLError.__new__  s<    
 ),,00<C$	
r   c                 *    U R                   [        R                  ;  a9  [        [	        U R                   5      5      [        R                  U R                   '   [        R                  U R                      $ ! [
         a    SU R                   -  s $ f = f)NzNVML Error with code %d)r   r   _errcode_to_stringstrnvmlErrorStringKeyErrorselfs    r   __str__NVMLError.__str__  sn    	:zz!=!==;>tzz?Z;[	,,TZZ8//

;; 	:,tzz99	:s   A3A6 6BBc                 4    U R                   UR                   :H  $ N)r   )r  others     r   __eq__NVMLError.__eq__  s    zzU[[((r   r
   N)"r   r   r   r   dictr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r  r  r   r
   r   r   r   r   {  s   v
 
#(:
 	!
 	!(B	

 	'(=
 	
 	%(;
 	&(E
 	%(;
 		
 	(A
 	%(G
 	&(<
 	%(;
 	
  	"(>!
" 	$(W#
$ 	+,Z(E(=	)+d/
2	:)r   r   c            	         [         R                  [           n [        U 5       Vs/ s H  oR	                  S5      (       d  M  UPM     nnU H  nS[
        R                  " UR                  SS5      S5      R                  SS5      -   n[        X5      nS n[        U[        4SU" U5      05      n[        Ul        [        XU5        U[        R                  U'   M     gs  snf )aU  
Generates a hierarchy of classes on top of NVMLError class.

Each NVML Error gets a new NVMLError subclass. This way try,except blocks
can filter appropriate exceptions more easily.

NVMLError is a parent class. Each NVML_ERROR_* gets it's own subclass.  e.g.
NVML_ERROR_ALREADY_INITIALIZED will be turned into
NVMLError_AlreadyInitialized
NVML_ERROR_
NVMLError_ _c                    ^  U 4S jnU$ )Nc                 4   > [         R                  U T5      nU$ r  )r   r   )r   r   vals     r   new9_extractNVMLErrorsAsClasses.<locals>.gen_new.<locals>.new  s    ''S1
r   r
   )r  r  s   ` r   gen_new,_extractNVMLErrorsAsClasses.<locals>.gen_new  s     Jr   r   N)sysmodulesr   dir
startswithstringcapwordsreplacegetattrtyper   r   setattrr   )this_modulexnvmlErrorsNameserr_name
class_nameerr_valr  new_error_classs           r   _extractNVMLErrorsAsClassesr-    s     ++h'K"%k"2R"2Qll=6Qq"2OR#!FOOH4D4D]TV4WY\$]$e$efikm$nn
+0	
 zI<)WWEU9VW%-"9.=	""7+ $ Ss   C C c                 0    U [         :w  a  [        U 5      eU $ r  )r   r   )rets    r   _nvmlCheckReturnr0    s    |nJr   c                 T   U [         ;   a	  [         U    $ [        R                  5          [        c  [	        [
        5      e [        [        U 5      [         U '   [         U    [        R                  5         $ ! [         a    [	        [        5      ef = f! [        R                  5         f = fr  )
_nvmlGetFunctionPointer_cachelibLoadLockacquirenvmlLibr   r   r#  releaseAttributeErrorr   )names    r   _nvmlGetFunctionPointerr9    s     ,,,T22O455	;29'42H)$/06
 		  	;9::	; 	s   B  A4 4BB B'c                        \ rS rSrS rS rSrg)nvmlFriendlyObjecti  c                 2    U H  n[        XX   5        M     g r  )r%  )r  
dictionaryr'  s      r   __init__nvmlFriendlyObject.__init__  s    ADZ]+ r   c                 6    U R                   R                  5       $ r  )__dict__r  r  s    r   r  nvmlFriendlyObject.__str__  s    }}$$&&r   r
   N)r   r   r   r   r>  r  r   r
   r   r   r;  r;    s    ,'r   r;  c                 n    0 nU R                    H  nUS   n[        X5      nXAU'   M     [        U5      nU$ Nr   )_fields_r#  r;  )structdr'  keyr   r   s         r   nvmlStructToFriendlyObjectrI    s@    
A__d$#  Q
CJr   c                 l    UR                    H#  nUS   nU R                  U   n[        XU5        M%     U$ rD  )rE  rA  r%  )r   modelr'  rH  r   s        r   nvmlFriendlyObjectToStructrL    s8    ^^dS!E"  Lr   c                       \ rS rSrSrg)struct_c_nvmlUnit_ti  r
   Nr   r   r   r   r   r
   r   r   rN  rN        r   rN  c                 z    [        U 5      [        L a   [        U S5      $ U $ ! [         a    [        U 5      s $ f = f)Nzutf-8)r$  bytesr  	TypeError)ss    r   bytes_to_strrU    s@    Aw%	q'?"   	q6M	s   " ::c                   "    \ rS rSrSr0 rS rSrg)_PrintableStructurei  a  
Abstract class that produces nicer __str__ output than ctypes.Structure.
e.g. instead of:
  >>> print str(obj)
  <class_name object at 0x7fdf82fef9e0>
this class will print
  class_name(field_name: formatted_value, field_name: formatted_value)

_fmt_ dictionary of <str _field_ name> -> <str format>
e.g. class that has _field_ 'hex_value', c_uint could be formatted with
  _fmt_ = {"hex_value" : "%08X"}
to produce nicer output.
Default fomratting string for all fields can be set with key "<default>" like:
  _fmt_ = {"<default>" : "%d MHz"} # e.g all values are numbers in MHz.
If not set it's assumed to be just "%s"

Exact format of returned str from this class is subject to change in the future.
c                 X   / nU R                    Hk  nUS   n[        X5      nSnX0R                  ;   a  U R                  U   nOSU R                  ;   a  U R                  S   nUR                  SU-   X44-  5        Mm     U R                  R
                  S-   SR                  U5      -   S-   $ )Nr   z%s	<default>z%s: (z, ))rE  r#  _fmt_append	__class__r   join)r  resultr'  rH  r   fmts         r   r  _PrintableStructure.__str__0  s    AA$CD&ECjj jjo

*jj-MM6C<C<78  ~~&&,tyy/@@3FFr   r
   N)r   r   r   r   r(   r\  r  r   r
   r   r   rW  rW    s    $ EGr   rW  c                   H    \ rS rSrS\S-  4S\S-  4S\S-  4S\S-  4/rSrg)	c_nvmlUnitInfo_ti>  r8  `   idserialfirmwareVersionr
   N)r   r   r   r   c_charrE  r   r
   r   r   rd  rd  >  s9    	"	v{	6B;	FRK(	Hr   rd  c                   *    \ rS rSrS\S-  4S\4/rSrg)c_nvmlLedState_tiG  cause   colorr
   N)r   r   r   r   ri  _nvmlLedColor_trE  r   r
   r   r   rk  rk  G  s    	&3,	/"Hr   rk  c                   6    \ rS rSrS\S-  4S\4S\4S\4/rSrg)	c_nvmlPSUInfo_tiN  staterm  currentvoltagepowerr
   N)r   r   r   r   ri  r   rE  r   r
   r   r   rq  rq  N  s-    	&3,	F	F	&	Hr   rq  c                   $    \ rS rSrS\4S\4/rSrg)c_nvmlUnitFanInfo_tiW  speedrr  r
   N)r   r   r   r   r   _nvmlFanState_trE  r   r
   r   r   rw  rw  W  s    	&	/"Hr   rw  c                   *    \ rS rSrS\S-  4S\4/rSrg)c_nvmlUnitFanSpeeds_ti^  fans   countr
   N)r   r   r   r   rw  r   rE  r   r
   r   r   r{  r{  ^  s    	$r)*	&Hr   r{  c                       \ rS rSrSrg)struct_c_nvmlDevice_tif  r
   NrO  r
   r   r   r  r  f  rP  r   r  c                   j    \ rS rSrS\S-  4S\4S\4S\4S\4S\4S	\4S
\4S\4S\4/
rSSSSSS.rSrg)nvmlPciInfo_tik  busIdr   domainbusdevicepciDeviceIdpciSubSystemId	reserved0	reserved1	reserved2	reserved3z0x%04Xz0x%02X0x%08X)r  r  r  r  r  r
   N)	r   r   r   r   ri  r   rE  r\  r   r
   r   r   r  r  k  sv    	&2+	6		6	 
6"	f	f	f	fH  (''''Er   r  c                   2    \ rS rSrS\4S\4S\4/rSS0rSrg)	c_nvmlMemory_ti  totalfreeusedrY  %d Br
   Nr   r   r   r   c_ulonglongrE  r\  r   r
   r   r   r  r    s-    	+		H
 &!Er   r  c                   2    \ rS rSrS\4S\4S\4/rSS0rSrg)	c_nvmlBAR1Memory_ti  	bar1Totalbar1Freebar1UsedrY  r  r
   Nr  r
   r   r   r  r    s-    	k"	[!	[!H
 &!Er   r  c                   ,    \ rS rSrS\4S\4/rSS0rSrg)c_nvmlProcessInfo_ti  pidusedGpuMemoryr  r
   N)	r   r   r   r   r   r  rE  r\  r   r
   r   r   r  r    s$    		+&H f%Er   r  c                   $    \ rS rSrS\4S\4/rSrg)c_nvmlBridgeChipInfo_ti  r$  	fwVersionr
   N)r   r   r   r   _nvmlBridgeChipType_tr   rE  r   r
   r   r   r  r    s    	&'	fHr   r  c                   *    \ rS rSrS\4S\S-  4/rSrg)c_nvmlBridgeChipHierarchy_ti  bridgeCountbridgeChipInfor   r
   N)r   r   r   r   r   r  rE  r   r
   r   r   r  r    s    		1C78Hr   r  c                   0    \ rS rSrS\4S\4S\4S\4/rSrg)c_nvmlEccErrorCounts_ti  l1Cachel2CachedeviceMemoryregisterFiler
   Nr   r   r   r   r  rE  r   r
   r   r   r  r    s)    	K 	K 	%	%	Hr   r  c                   ,    \ rS rSrS\4S\4/rSS0rSrg)c_nvmlUtilization_ti  gpumemoryrY  z%d %%r
   N)r   r   r   r   r   rE  r\  r   r
   r   r   r  r    s$    		6H '"Er   r  c                   *    \ rS rSrS\4S\S-  4/rSrg)c_nvmlHwbcEntry_ti  hwbcIdrh  ri   r
   N)r   r   r   r   r   ri  rE  r   r
   r   r   r  r    s    	6	FRK(Hr   r  c                   0    \ rS rSrS\4S\4S\4S\4/rSr	g)c_nvmlValue_ti  dValuiValulValullValr
   N)
r   r   r   r   c_doubler   c_ulongr  rE  r   r
   r   r   r  r    s)    		&	'	;	Hr   r  c                   $    \ rS rSrS\4S\4/rSrg)c_nvmlSample_ti  	timeStampsampleValuer
   N)r   r   r   r   r  r  rE  r   r
   r   r   r  r    s    	k"	&Hr   r  c                   $    \ rS rSrS\4S\4/rSrg)c_nvmlViolationTime_ti  referenceTimeviolationTimer
   Nr  r
   r   r   r  r    s    	+&	+&Hr   r  c                       \ rS rSrSrg)struct_c_nvmlEventSet_ti  r
   NrO  r
   r   r   r  r    rP  r   r  l            c                   2    \ rS rSrS\4S\4S\4/rSS0rSrg)c_nvmlEventData_ti  r  	eventType	eventDatar  r
   N)	r   r   r   r   c_nvmlDevice_tr  rE  r\  r   r
   r   r   r  r    s-    	>"	k"	k"H
 (#Er   r  c            	       H    \ rS rSrS\4S\4S\4S\4S\4S\4S\S	-  4/rS
rg)c_nvmlAccountingStats_ti  gpuUtilizationmemoryUtilizationmaxMemoryUsagetime	startTime	isRunningreservedr   r
   N)r   r   r   r   r   r  rE  r   r
   r   r   r  r    sE    	6"	f%	;'		k"	f	VaZ Hr   r  c                      [        5         [        S5      n U " 5       n[        U5        [        R	                  5         [
        S-  q[        R                  5         [        $ )a\  
/**
 * Initialize NVML, but don't initialize any GPUs yet.
 *
 * \note nvmlInit_v3 introduces a "flags" argument, that allows passing boolean values
 *       modifying the behaviour of nvmlInit().
 * \note In NVML 5.319 new nvmlInit_v2 has replaced nvmlInit"_v1" (default in NVML 4.304 and older) that
 *       did initialize all GPU devices in the system.
 *
 * This allows NVML to communicate with a GPU
 * when other GPUs in the system are unstable or in a bad state.  When using this API, GPUs are
 * discovered and initialized in nvmlDeviceGetHandleBy* functions instead.
 *
 * \note To contrast nvmlInit_v2 with nvmlInit"_v1", NVML 4.304 nvmlInit"_v1" will fail when any detected GPU is in
 *       a bad or unstable state.
 *
 * For all products.
 *
 * This method, should be called once before invoking any other methods in the library.
 * A reference count of the number of initializations is maintained.  Shutdown only occurs
 * when the reference count reaches zero.
 *
 * @return
 *         - \ref NVML_SUCCESS                   if NVML has been properly initialized
 *         - \ref NVML_ERROR_DRIVER_NOT_LOADED   if NVIDIA driver is not running
 *         - \ref NVML_ERROR_NO_PERMISSION       if NVML does not have permission to talk to the driver
 *         - \ref NVML_ERROR_UNKNOWN             on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlInit
nvmlInit_v2r   )_LoadNvmlLibraryr9  r0  r3  r4  _nvmlLib_refcountr6  r5  fnr/  s     r   nvmlInitr    sO    > 
 
!	/B
$CS Nr   c                     [         Gc  [        R                  5          [         c   [        R                  SS S:X  a  [
        R                  R                  [
        R                  " SS5      S5      [
        R                  R                  [
        R                  " SS5      S	5      /n [        S
 U  5       S5      nUS:X  a  [        [        5        O[        U5      q O[        S5      q  [         S:X  a  [        [        5        [        R                  5         gg! [         a  n[        [        5         SnANMSnAff = f! [        R                  5         f = f)z-
Load the library if it isn't loaded already
Nr   winProgramFileszC:\Program Filesz!NVIDIA Corporation\NVSMI\nvml.dllWinDirz
C:\WindowszSystem32\nvml.dllc              3   r   #    U  H-  n[         R                  R                  U5      (       d  M)  Uv   M/     g 7fr  )ospathisfile).0r'  s     r   	<genexpr>#_LoadNvmlLibrary.<locals>.<genexpr>c  s"     (UKq277>>RSCTKs   (7	7zlibnvidia-ml.so.1)r5  r3  r4  r  platformr  r  r_  getenvnextr0  r   CDLLOSErrorr6  )searchPathsnvmlPathoses      r   r  r  P  s    		"CRa(E1GGLL>CV)WY}~GGLL8])KMab' $((UK(UW[#\$,,-IJ '+8nG #'':"; tO$%AB !9 	,  C$%ABBC !sM   D= B)D D= D D= D 'D= 
D:!D50D= 5D::D= =Ec                      [        S5      n U " 5       n[        U5        [        R                  5         S[        :  a	  [        S-  q[        R                  5         g)a   
/**
 * Shut down NVML by releasing all GPU resources previously allocated with \ref nvmlInit().
 *
 * For all products.
 *
 * This method should be called after NVML work is done, once for each call to \ref nvmlInit()
 * A reference count of the number of initializations is maintained.  Shutdown only occurs
 * when the reference count reaches zero.  For backwards compatibility, no error is reported if
 * nvmlShutdown() is called more times than nvmlInit().
 *
 * @return
 *         - \ref NVML_SUCCESS                 if NVML has been properly shut down
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlShutdown
nvmlShutdownr   r   N)r9  r0  r3  r4  r  r6  r  s     r   r  r  u  sN    , 
!	0B
$CS 	Qr   c                 T    [        S5      n[        Ul        U" U 5      n[        U5      $ )Nr  )r9  c_char_prestyperU  )r`  r  r/  s      r   r  r    s(    	 !2	3BBJ
V*Cr   c                      [        [        5      n [        S5      nU" U [        [        5      5      n[	        U5        [        U R                  5      $ )a  
/**
 * Retrieves the version of the NVML library.
 *
 * For all products.
 *
 * The version identifier is an alphanumeric string.  It will not exceed 80 characters in length
 * (including the NULL terminator).  See \ref nvmlConstants::NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE.
 *
 * @param version                              Reference in which to return the version identifier
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 */
nvmlReturn_t DECLDIR nvmlSystemGetNVMLVersion
nvmlSystemGetNVMLVersion)create_string_buffer$NVML_SYSTEM_NVML_VERSION_BUFFER_SIZEr9  r   r0  rU  r   	c_versionr  r/  s      r   r  r    sC    ( %%IJI	 !;	<B
YCD
ECS	((r   c                     [        S5      n[        S5      nU" [        U 5      U[        S5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Gets name of the process with provided process id
 *
 * For all products.
 *
 * Returned process name is cropped to provided length.
 * name string is encoded in ANSI.
 *
 * @param pid                                  The identifier of the process
 * @param name                                 Reference in which to return the process name
 * @param length                               The maximum allowed length of the string returned in \a name
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a name has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a name is NULL or \a length is 0.
 *         - \ref NVML_ERROR_NOT_FOUND         if process doesn't exists
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlSystemGetProcessName
i   nvmlSystemGetProcessName)r  r9  r   r0  rU  r   )r  c_namer  r/  s       r   r  r    sF    0 "$'F	 !;	<B
VC[&&,
/CS%%r   c                      [        [        5      n [        S5      nU" U [        [        5      5      n[	        U5        [        U R                  5      $ )as  
/**
 * Retrieves the version of the system's graphics driver.
 *
 * For all products.
 *
 * The version identifier is an alphanumeric string.  It will not exceed 80 characters in length
 * (including the NULL terminator).  See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE.
 *
 * @param version                              Reference in which to return the version identifier
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 */
nvmlReturn_t DECLDIR nvmlSystemGetDriverVersion
nvmlSystemGetDriverVersion)r  &NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZEr9  r   r0  rU  r   r  s      r   r  r    sC    * %%KLI	 !=	>B
YEF
GCS	((r   c                  <   [        S5      n Sn[        S5      nU" [        U 5      S5      nU[        :w  a  U[        :w  a  [        U5      eU R                  S:X  a  / $ [        U R                  -  nU" 5       nU" [        U 5      U5      n[        U5        [        U5      $ )a  
/**
 * Retrieves the IDs and firmware versions for any Host Interface Cards (HICs) in the system.
 *
 * For S-class products.
 *
 * The \a hwbcCount argument is expected to be set to the size of the input \a hwbcEntries array.
 * The HIC must be connected to an S-class system for it to be reported by this function.
 *
 * @param hwbcCount                            Size of hwbcEntries array
 * @param hwbcEntries                          Array holding information about hwbc
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a hwbcCount and \a hwbcEntries have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if either \a hwbcCount or \a hwbcEntries is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a hwbcCount indicates that the \a hwbcEntries array is too small
 */
nvmlReturn_t DECLDIR nvmlSystemGetHicVersion
r   NnvmlSystemGetHicVersion)
r   r9  byrefr   r   r   r   r  r0  rU  )c_counthicsr  r/  	hic_arrays        r   r  r    s    * QiGD	 !:	;B U7^T
"C 
		,	,n 		!GMM1I;D
U7^T
"CSr   c                       [        5       n [        S5      nU" [        U 5      5      n[        U5        [	        U R
                  5      $ )a*  
/**
 * Retrieves the number of units in the system.
 *
 * For S-class products.
 *
 * @param unitCount                            Reference in which to return the number of units
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a unitCount has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unitCount is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlUnitGetCount
nvmlUnitGetCountr   r9  r  r0  rU  r   r  r  r/  s      r   r  r  !  s@    " hG	 !3	4B
U7^
CS&&r   c                      [        U 5      n[        5       n[        S5      nU" U[        U5      5      n[	        U5        [        U5      $ )a  
/**
 * Acquire the handle for a particular unit, based on its index.
 *
 * For S-class products.
 *
 * Valid indices are derived from the \a unitCount returned by \ref nvmlUnitGetCount().
 *   For example, if \a unitCount is 2 the valid indices are 0 and 1, corresponding to UNIT 0 and UNIT 1.
 *
 * The order in which NVML enumerates units has no guarantees of consistency between reboots.
 *
 * @param index                                The index of the target unit, >= 0 and < \a unitCount
 * @param unit                                 Reference in which to return the unit handle
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a unit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a index is invalid or \a unit is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlUnitGetHandleByIndex
nvmlUnitGetHandleByIndex)r   c_nvmlUnit_tr9  r  r0  rU  )indexc_indexunitr  r/  s        r   r  r  G  sG    .* UmG>D	 !;	<B
WeDk
"CSr   c                 ~     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )a  
/**
 * Retrieves the static information associated with a unit.
 *
 * For S-class products.
 *
 * See \ref nvmlUnitInfo_t for details on available unit info.
 *
 * @param unit                                 The identifier of the target unit
 * @param info                                 Reference in which to return the unit information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a info has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid or \a info is NULL
 */
nvmlReturn_t DECLDIR nvmlUnitGetUnitInfo
nvmlUnitGetUnitInfo)rd  r9  r  r0  rU  r  c_infor  r/  s       r   r  r  z  s?    &" F	 !6	7B
T5=
!CSr   c                 ~     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )aC  
/**
 * Retrieves the LED state associated with this unit.
 *
 * For S-class products.
 *
 * See \ref nvmlLedState_t for details on allowed states.
 *
 * @param unit                                 The identifier of the target unit
 * @param state                                Reference in which to return the current LED state
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a state has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid or \a state is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlUnitSetLedState()
 */
nvmlReturn_t DECLDIR nvmlUnitGetLedState
nvmlUnitGetLedState)rk  r9  r  r0  rU  )r  c_stater  r/  s       r   r  r    s?    .*  !G	 !6	7B
T5>
"CS  r   c                 ~     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )a  
/**
 * Retrieves the PSU stats for the unit.
 *
 * For S-class products.
 *
 * See \ref nvmlPSUInfo_t for details on available PSU info.
 *
 * @param unit                                 The identifier of the target unit
 * @param psu                                  Reference in which to return the PSU information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a psu has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid or \a psu is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlUnitGetPsuInfo
nvmlUnitGetPsuInfo)rq  r9  r  r0  rU  r  s       r   r  r    s?    *& F	 !5	6B
T5=
!CSr   c                      [        5       n[        S5      nU" U [        U5      [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the temperature readings for the unit, in degrees C.
 *
 * For S-class products.
 *
 * Depending on the product, readings may be available for intake (type=0),
 * exhaust (type=1) and board (type=2).
 *
 * @param unit                                 The identifier of the target unit
 * @param type                                 The type of reading to take
 * @param temp                                 Reference in which to return the intake temperature
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a temp has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit or \a type is invalid or \a temp is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlUnitGetTemperature
nvmlUnitGetTemperaturer  )r  r$  c_tempr  r/  s        r   r  r    sH    .* XF	 !9	:B
T6$<v
/CS%%r   c                 ~     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )aC  
/**
 * Retrieves the fan speed readings for the unit.
 *
 * For S-class products.
 *
 * See \ref nvmlUnitFanSpeeds_t for details on available fan speed info.
 *
 * @param unit                                 The identifier of the target unit
 * @param fanSpeeds                            Reference in which to return the fan speed information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a fanSpeeds has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid or \a fanSpeeds is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlUnitGetFanSpeedInfo
nvmlUnitGetFanSpeedInfo)r{  r9  r  r0  rU  )r  c_speedsr  r/  s       r   r  r  6  s?    *& %&H	 !:	;B
T5?
#CS!!r   c                     [        S5      n[        S5      nU" U [        U5      S5      nU[        :X  a  [        n[        U5        [        UR                  5      $ )z
    r   nvmlUnitGetDevicesN)r   r9  r  r   r   r0  rU  r   )r  r  r  r/  s       r   nvmlUnitGetDeviceCountr!  e  sO     QiG	 !5	6B
T5>4
(C++S&&r   c                      [        [        U 5      5      n[        UR                  -  nU" 5       n[	        S5      nU" U [        U5      U5      n[        U5        [        U5      $ )a  
/**
 * Retrieves the set of GPU devices that are attached to the specified unit.
 *
 * For S-class products.
 *
 * The \a deviceCount argument is expected to be set to the size of the input \a devices array.
 *
 * @param unit                                 The identifier of the target unit
 * @param deviceCount                          Reference in which to provide the \a devices array size, and
 *                                             to return the number of attached GPU devices
 * @param devices                              Reference in which to return the references to the attached GPU devices
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a deviceCount and \a devices have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a deviceCount indicates that the \a devices array is too small
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid, either of \a deviceCount or \a devices is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlUnitGetDevices
r   )r   r!  r  r   r9  r  r0  rU  )r  r  device_array	c_devicesr  r/  s         r   r   r   q  s^    .* +D12G!GMM1LI	 !5	6B
T5>9
-CS	""r   c                       [        5       n [        S5      nU" [        U 5      5      n[        U5        [	        U R
                  5      $ )at  
/**
 * Retrieves the number of compute devices in the system. A compute device is a single GPU.
 *
 * For all products.
 *
 * Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system
 *       even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device.
 *       Update your code to handle this error, or use NVML 4.304 or older nvml header file.
 *       For backward binary compatibility reasons _v1 version of the API is still present in the shared
 *       library.
 *       Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
 *
 * @param deviceCount                          Reference in which to return the number of accessible devices
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a deviceCount has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a deviceCount is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetCount
nvmlDeviceGetCount_v2r  r	  s      r   nvmlDeviceGetCountr'    s@    0, hG	 !8	9B
U7^
CS&&r   c                      [        U 5      n[        5       n[        S5      nU" U[        U5      5      n[	        U5        [        U5      $ )a
  
/**
 * Acquire the handle for a particular device, based on its index.
 *
 * For all products.
 *
 * Valid indices are derived from the \a accessibleDevices count returned by
 *   \ref nvmlDeviceGetCount(). For example, if \a accessibleDevices is 2 the valid indices
 *   are 0 and 1, corresponding to GPU 0 and GPU 1.
 *
 * The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it
 *   is recommended that devices be looked up by their PCI ids or UUID. See
 *   \ref nvmlDeviceGetHandleByUUID() and \ref nvmlDeviceGetHandleByPciBusId().
 *
 * Note: The NVML index may not correlate with other APIs, such as the CUDA device index.
 *
 * Starting from NVML 5, this API causes NVML to initialize the target GPU
 * NVML may initialize additional GPUs if:
 *  - The target GPU is an SLI slave
 *
 * Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system
 *       even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device.
 *       Update your code to handle this error, or use NVML 4.304 or older nvml header file.
 *       For backward binary compatibility reasons _v1 version of the API is still present in the shared
 *       library.
 *       Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
 *
 *       This means that nvmlDeviceGetHandleByIndex_v2 and _v1 can return different devices for the same index.
 *       If you don't touch macros that map old (_v1) versions to _v2 versions at the top of the file you don't
 *       need to worry about that.
 *
 * @param index                                The index of the target GPU, >= 0 and < \a accessibleDevices
 * @param device                               Reference in which to return the device handle
 *
 * @return
 *         - \ref NVML_SUCCESS                  if \a device has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a index is invalid or \a device is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
 *         - \ref NVML_ERROR_NO_PERMISSION      if the user doesn't have permission to talk to this device
 *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 *
 * @see nvmlDeviceGetIndex
 * @see nvmlDeviceGetCount
 */
nvmlReturn_t DECLDIR nvmlDeviceGetHandleByIndex
nvmlDeviceGetHandleByIndex_v2)r   r  r9  r  r0  rU  )r  r  r  r  r/  s        r   nvmlDeviceGetHandleByIndexr*    sJ    d/` UmGF	 !@	AB
WeFm
$CSr   c                      [        U 5      n[        5       n[        S5      nU" U[        U5      5      n[	        U5        [        U5      $ )ad  
/**
 * Acquire the handle for a particular device, based on its board serial number.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * This number corresponds to the value printed directly on the board, and to the value returned by
 *   \ref nvmlDeviceGetSerial().
 *
 * @deprecated Since more than one GPU can exist on a single board this function is deprecated in favor
 *             of \ref nvmlDeviceGetHandleByUUID.
 *             For dual GPU boards this function will return NVML_ERROR_INVALID_ARGUMENT.
 *
 * Starting from NVML 5, this API causes NVML to initialize the target GPU
 * NVML may initialize additional GPUs as it searches for the target GPU
 *
 * @param serial                               The board serial number of the target GPU
 * @param device                               Reference in which to return the device handle
 *
 * @return
 *         - \ref NVML_SUCCESS                  if \a device has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a serial is invalid, \a device is NULL or more than one
 *                                              device has the same serial (dual GPU boards)
 *         - \ref NVML_ERROR_NOT_FOUND          if \a serial does not match a valid device on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
 *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
 *         - \ref NVML_ERROR_GPU_IS_LOST        if any GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 *
 * @see nvmlDeviceGetSerial
 * @see nvmlDeviceGetHandleByUUID
 */
nvmlReturn_t DECLDIR nvmlDeviceGetHandleBySerial
nvmlDeviceGetHandleBySerialr  r  r9  r  r0  rU  )rg  c_serialr  r  r/  s        r   r,  r,  C  sK    H!D HF	 !>	?B
XuV}
%CSr   c                      [        U 5      n[        5       n[        S5      nU" U[        U5      5      n[	        U5        [        U5      $ )aH  
/**
 * Acquire the handle for a particular device, based on its globally unique immutable UUID associated with each device.
 *
 * For all products.
 *
 * @param uuid                                 The UUID of the target GPU
 * @param device                               Reference in which to return the device handle
 *
 * Starting from NVML 5, this API causes NVML to initialize the target GPU
 * NVML may initialize additional GPUs as it searches for the target GPU
 *
 * @return
 *         - \ref NVML_SUCCESS                  if \a device has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a uuid is invalid or \a device is null
 *         - \ref NVML_ERROR_NOT_FOUND          if \a uuid does not match a valid device on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
 *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
 *         - \ref NVML_ERROR_GPU_IS_LOST        if any GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 *
 * @see nvmlDeviceGetUUID
 */
nvmlReturn_t DECLDIR nvmlDeviceGetHandleByUUID
nvmlDeviceGetHandleByUUIDr-  )uuidc_uuidr  r  r/  s        r   r0  r0    sH    62 d^FF	 !<	=B
VU6]
#CSr   c                      [        U 5      n[        5       n[        S5      nU" U[        U5      5      n[	        U5        [        U5      $ )a  
/**
 * Acquire the handle for a particular device, based on its PCI bus id.
 *
 * For all products.
 *
 * This value corresponds to the nvmlPciInfo_t::busId returned by \ref nvmlDeviceGetPciInfo().
 *
 * Starting from NVML 5, this API causes NVML to initialize the target GPU
 * NVML may initialize additional GPUs if:
 *  - The target GPU is an SLI slave
 *
 * \note NVML 4.304 and older version of nvmlDeviceGetHandleByPciBusId"_v1" returns NVML_ERROR_NOT_FOUND
 *       instead of NVML_ERROR_NO_PERMISSION.
 *
 * @param pciBusId                             The PCI bus id of the target GPU
 * @param device                               Reference in which to return the device handle
 *
 * @return
 *         - \ref NVML_SUCCESS                  if \a device has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a pciBusId is invalid or \a device is NULL
 *         - \ref NVML_ERROR_NOT_FOUND          if \a pciBusId does not match a valid device on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_POWER if the attached device has improperly attached external power cables
 *         - \ref NVML_ERROR_NO_PERMISSION      if the user doesn't have permission to talk to this device
 *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetHandleByPciBusId
 nvmlDeviceGetHandleByPciBusId_v2r-  )pciBusIdc_busIdr  r  r/  s        r   nvmlDeviceGetHandleByPciBusIdr7    sJ    @< x GF	 !C	DB
WeFm
$CSr   c                     [        [        5      n[        S5      nU" X[        [        5      5      n[	        U5        [        UR                  5      $ )a  
/**
 * Retrieves the name of this device.
 *
 * For all products.
 *
 * The name is an alphanumeric string that denotes a particular product, e.g. Tesla &tm; C2070. It will not
 * exceed 64 characters in length (including the NULL terminator).  See \ref
 * nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param name                                 Reference in which to return the product name
 * @param length                               The maximum allowed length of the string returned in \a name
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a name has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a name is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetName
nvmlDeviceGetName)r  NVML_DEVICE_NAME_BUFFER_SIZEr9  r   r0  rU  r   )handler  r  r/  s       r   r9  r9    sC    2 "">?F	 !4	5B
VV$@A
BCS%%r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the device boardId from 0-N.
 * Devices with the same boardId indicate GPUs connected to the same PLX.  Use in conjunction with
 *  \ref nvmlDeviceGetMultiGpuBoard() to decide if they are on the same board as well.
 *  The boardId returned is a unique ID for the current configuration.  Uniqueness and ordering across
 *  reboots and system configurations is not guaranteed (i.e. if a Tesla K40c returns 0x100 and
 *  the two GPUs on a Tesla K10 in the same system returns 0x200 it is not guaranteed they will
 *  always return those values but they will always be different from each other).
 *
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param boardId                              Reference in which to return the device's board ID
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a boardId has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a boardId is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetBoardId
nvmlDeviceGetBoardIdr  )r;  c_idr  r/  s       r   r=  r=  /  s=    6 8D	 !7	8B
VU4[
!CS

##r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a]  
/**
 * Retrieves whether the device is on a Multi-GPU Board
 * Devices that are on multi-GPU boards will set \a multiGpuBool to a non-zero value.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param multiGpuBool                         Reference in which to return a zero or non-zero value
 *                                                 to indicate whether the device is on a multi GPU board
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a multiGpuBool has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a multiGpuBool is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetMultiGpuBoard
nvmlDeviceGetMultiGpuBoardr  )r;  
c_multiGpur  r/  s       r   r@  r@  P  s@    , J	 !=	>B
VU:&
'CS
(())r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a;  
/**
 * Retrieves the brand of this device.
 *
 * For all products.
 *
 * The type is a member of \ref nvmlBrandType_t defined above.
 *
 * @param device                               The identifier of the target device
 * @param type                                 Reference in which to return the product brand type
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a name has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a type is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetBrand
nvmlDeviceGetBrand)_nvmlBrandType_tr9  r  r0  rU  r   )r;  c_typer  r/  s       r   rC  rC  l  s>    * F	 !5	6B
VU6]
#CS%%r   c                     [        [        5      n[        S5      nU" X[        [        5      5      n[	        U5        [        UR                  5      $ )ad  
/**
 * Retrieves the globally unique board serial number associated with this device's board.
 *
 * For all products with an inforom.
 *
 * The serial number is an alphanumeric string that will not exceed 30 characters (including the NULL terminator).
 * This number matches the serial number tag that is physically attached to the board.  See \ref
 * nvmlConstants::NVML_DEVICE_SERIAL_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param serial                               Reference in which to return the board/module serial number
 * @param length                               The maximum allowed length of the string returned in \a serial
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a serial has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a serial is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetSerial
nvmlDeviceGetSerial)r  NVML_DEVICE_SERIAL_BUFFER_SIZEr9  r   r0  rU  r   )r;  r.  r  r/  s       r   rG  rG    sC    4 $$BCH	 !6	7B
Vv&DE
FCS''r   c                     [         U-  nU" 5       n[        S5      nU" X[        U5      5      n[        U5        [	        U5      $ )a^  
/**
 * Retrieves an array of unsigned ints (sized to cpuSetSize) of bitmasks with the ideal CPU affinity for the device
 * For example, if processors 0, 1, 32, and 33 are ideal for the device and cpuSetSize == 2,
 *     result[0] = 0x3, result[1] = 0x3
 *
 * For Kepler &tm; or newer fully supported devices.
 * Supported on Linux only.
 *
 * @param device                               The identifier of the target device
 * @param cpuSetSize                           The size of the cpuSet array that is safe to access
 * @param cpuSet                               Array reference in which to return a bitmask of CPUs, 64 CPUs per
 *                                                 unsigned long on 64-bit machines, 32 on 32-bit machines
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a cpuAffinity has been filled
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, cpuSetSize == 0, or cpuSet is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetCpuAffinity
nvmlDeviceGetCpuAffinity)r  r9  r  r0  rU  )r;  
cpuSetSizeaffinity_array
c_affinityr  r/  s         r   rJ  rJ    sE    2 !:-N!J	 !;	<B
Vz!2
3CS
##r   c                     [        S5      n[        S5      n[        S5      nU" U [        U5      [        U5      5      n[        U5        UR                  SUR                  -  -   $ )a  
/**
 * Retrieves the CUDA compute capability of the device.
 *
 * For all products with an inforom.
 *
 * Returns the major and minor compute capability version numbers of the device. 
 * The major and minor versions are equivalent to the CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR
 * and CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR attributes that would be returned by CUDA's cuDeviceGetAttribute().
 *
 * @param device                              The identifier of the target device
 * @param major                               Reference in which to return the major CUDA compute capability
 * @param minor                               Reference in which to return the minor CUDA compute capability
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a serial has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a serial is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetCudaComputeCapability
r   "nvmlDeviceGetCudaComputeCapabilityg?r   r9  r  r0  r   )r;  majorminorr  r/  s        r   rO  rO    sW    0 1IE1IE	 !E	FB
VU5\5<
0CS;;u{{***r   c                 @    [        S5      nU" U 5      n[        U5        g)a.  
/**
 * Sets the ideal affinity for the calling thread and device using the guidelines
 * given in nvmlDeviceGetCpuAffinity().  Note, this is a change as of version 8.0.
 * Older versions set the affinity for a calling process and all children.
 * Currently supports up to 64 processors.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Supported on Linux only.
 *
 * @param device                               The identifier of the target device
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the calling process has been successfully bound
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceSetCpuAffinity
nvmlDeviceSetCpuAffinityNr9  r0  r;  r  r/  s      r   rT  rT    s#    . 
!!;	<B
V*CSr   c                 @    [        S5      nU" U 5      n[        U5        g)a  
/**
 * Clear all affinity bindings for the calling thread.  Note, this is a change as of version
 * 8.0 as older versions cleared the affinity for a calling process and all children.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Supported on Linux only.
 *
 * @param device                               The identifier of the target device
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the calling process has been successfully unbound
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceClearCpuAffinity
nvmlDeviceClearCpuAffinityNrU  rV  s      r   rX  rX  	  s#    & 
!!=	>B
V*CSr   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a%  
/**
 * Retrieves minor number for the device. The minor number for the device is such that the Nvidia device node file for
 * each GPU will have the form /dev/nvidia[minor number].
 *
 * For all products.
 * Supported only for Linux
 *
 * @param device                                The identifier of the target device
 * @param minorNumber                           Reference in which to return the minor number for the device
 * @return
 *         - \ref NVML_SUCCESS                 if the minor number is successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a minorNumber is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetMinorNumber
nvmlDeviceGetMinorNumberr  )r;  c_minor_numberr  r/  s       r   rZ  rZ  	  s@    * XN	 !;	<B
VU>*
+CS,,--r   c                     [        [        5      n[        S5      nU" X[        [        5      5      n[	        U5        [        UR                  5      $ )a  
/**
 * Retrieves the globally unique immutable UUID associated with this device, as a 5 part hexadecimal string,
 * that augments the immutable, board serial identifier.
 *
 * For all products.
 *
 * The UUID is a globally unique identifier. It is the only available identifier for pre-Fermi-architecture products.
 * It does NOT correspond to any identifier printed on the board.  It will not exceed 80 characters in length
 * (including the NULL terminator).  See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param uuid                                 Reference in which to return the GPU UUID
 * @param length                               The maximum allowed length of the string returned in \a uuid
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a uuid has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a uuid is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetUUID
nvmlDeviceGetUUID)r  NVML_DEVICE_UUID_BUFFER_SIZEr9  r   r0  rU  r   )r;  r2  r  r/  s       r   r]  r]  5	  sC    6 "">?F	 !4	5B
VV$@A
BCS%%r   c                     [        [        5      n[        S5      nU" U [        U5      U[	        [        5      5      n[        U5        [        UR                  5      $ )aN  
/**
 * Retrieves the version information for the device's infoROM object.
 *
 * For all products with an inforom.
 *
 * Fermi and higher parts have non-volatile on-board memory for persisting device info, such as aggregate
 * ECC counts. The version of the data structures in this memory may change from time to time. It will not
 * exceed 16 characters in length (including the NULL terminator).
 * See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE.
 *
 * See \ref nvmlInforomObject_t for details on the available infoROM objects.
 *
 * @param device                               The identifier of the target device
 * @param object                               The target infoROM object
 * @param version                              Reference in which to return the infoROM version
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have an infoROM
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetInforomImageVersion
 */
nvmlReturn_t DECLDIR nvmlDeviceGetInforomVersion
nvmlDeviceGetInforomVersion)r  'NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZEr9  _nvmlInforomObject_tr   r0  rU  r   )r;  infoRomObjectr  r  r/  s        r   r`  r`  V	  sR    @ %%LMI	 !>	?B
V)-8
VCDFCS	((r   c                     [        [        5      n[        S5      nU" X[        [        5      5      n[	        U5        [        UR                  5      $ )a  
/**
 * Retrieves the global infoROM image version
 *
 * For all products with an inforom.
 *
 * Image version just like VBIOS version uniquely describes the exact version of the infoROM flashed on the board
 * in contrast to infoROM object version which is only an indicator of supported features.
 * Version string will not exceed 16 characters in length (including the NULL terminator).
 * See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param version                              Reference in which to return the infoROM image version
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have an infoROM
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetInforomVersion
 */
nvmlReturn_t DECLDIR nvmlDeviceGetInforomImageVersion
 nvmlDeviceGetInforomImageVersion)r  ra  r9  r   r0  rU  r   r;  r  r  r/  s       r   re  re  ~	  sC    : %%LMI	 !C	DB
V'N O
PCS	((r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a.  
/**
 * Retrieves the checksum of the configuration stored in the device's infoROM.
 *
 * For all products with an inforom.
 *
 * Can be used to make sure that two GPUs have the exact same configuration.
 * Current checksum takes into account configuration stored in PWR and ECC infoROM objects.
 * Checksum can change between driver releases or when user changes configuration (e.g. disable/enable ECC)
 *
 * @param device                               The identifier of the target device
 * @param checksum                             Reference in which to return the infoROM configuration checksum
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a checksum has been set
 *         - \ref NVML_ERROR_CORRUPTED_INFOROM if the device's checksum couldn't be retrieved due to infoROM corruption
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a checksum is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetInforomConfigurationChecksum
)nvmlDeviceGetInforomConfigurationChecksumr  )r;  
c_checksumr  r/  s       r   rh  rh  	  s@    2 J	 !L	MB
VU:&
'CS
(())r   c                 @    [        S5      nU" U 5      n[        U5        g)a  
/**
 * Reads the infoROM from the flash and verifies the checksums.
 *
 * For all products with an inforom.
 *
 * @param device                               The identifier of the target device
 *
 * @return
 *         - \ref NVML_SUCCESS                 if infoROM is not corrupted
 *         - \ref NVML_ERROR_CORRUPTED_INFOROM if the device's infoROM is corrupted
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceValidateInforom
nvmlDeviceValidateInforomNrU  rV  s      r   rk  rk  	  s#    & 
!!<	=B
V*CSr   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a"  
/**
 * Retrieves the display mode for the device.
 *
 * For all products.
 *
 * This method indicates whether a physical display (e.g. monitor) is currently connected to
 * any of the device's connectors.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param display                              Reference in which to return the display mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a display has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a display is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetDisplayMode
nvmlDeviceGetDisplayMode_nvmlEnableState_tr9  r  r0  rU  r   r;  c_moder  r/  s       r   rm  rm  	  s>    2  !F	 !;	<B
VU6]
#CS%%r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the display active state for the device.
 *
 * For all products.
 *
 * This method indicates whether a display is initialized on the device.
 * For example whether X Server is attached to this device and has allocated memory for the screen.
 *
 * Display can be active even when no monitor is physically attached.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param isActive                             Reference in which to return the display active state
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a isActive has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a isActive is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetDisplayActive
nvmlDeviceGetDisplayActivern  rp  s       r   rs  rs  	  s>    6  !F	 !=	>B
VU6]
#CS%%r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the persistence mode associated with this device.
 *
 * For all products.
 * For Linux only.
 *
 * When driver persistence mode is enabled the driver software state is not torn down when the last
 * client disconnects. By default this feature is disabled.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Reference in which to return the current driver persistence mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetPersistenceMode()
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPersistenceMode
nvmlDeviceGetPersistenceModern  )r;  r  r  r/  s       r   ru  ru  
  s>    8 !"G	 !?	@B
VU7^
$CS&&r   c                 |    [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )aA  
/**
 * Retrieves the PCI attributes of this device.
 *
 * For all products.
 *
 * See \ref nvmlPciInfo_t for details on the available PCI info.
 *
 * @param device                               The identifier of the target device
 * @param pci                                  Reference in which to return the PCI info
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a pci has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a pci is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPciInfo
nvmlDeviceGetPciInfo_v2)r  r9  r  r0  rU  )r;  r  r  r/  s       r   nvmlDeviceGetPciInforx  =
  s9    * _F	 !:	;B
VU6]
#CSr   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        [        UR                  5      $ )a*  
/**
 * Retrieves the current clock speeds for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlClockType_t for details on available clock information.
 *
 * @param device                               The identifier of the target device
 * @param type                                 Identify which clock domain to query
 * @param clock                                Reference in which to return the clock speed in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a clock has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clock is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device cannot report the specified clock
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetClockInfo
nvmlDeviceGetClockInfor   r9  _nvmlClockType_tr  r0  rU  r   r;  r$  c_clockr  r/  s        r   rz  rz  X
  sE    . hG	 !9	:B
V%d+U7^
<CS&&r   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        [        UR                  5      $ )a  
/**
 * Retrieves the maximum clock speeds for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlClockType_t for details on available clock information.
 *
 * \note On GPUs from Fermi family current P0 clocks (reported by \ref nvmlDeviceGetClockInfo) can differ from max clocks
 *       by few MHz.
 *
 * @param device                               The identifier of the target device
 * @param type                                 Identify which clock domain to query
 * @param clock                                Reference in which to return the clock speed in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a clock has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clock is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device cannot report the specified clock
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetMaxClockInfo
nvmlDeviceGetMaxClockInfor{  r}  s        r   r  r  v
  sE    4 hG	 !<	=B
V%d+U7^
<CS&&r   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        [        UR                  5      $ )as  
/**
 * Retrieves the current setting of a clock that applications will use unless an overspec situation occurs.
 * Can be changed using \ref nvmlDeviceSetApplicationsClocks.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param clockType                            Identify which clock domain to query
 * @param clockMHz                             Reference in which to return the clock in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a clockMHz has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetApplicationsClock
nvmlDeviceGetApplicationsClockr{  r}  s        r   r  r  
  sE    , hG	 !A	BB
V%d+U7^
<CS&&r   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        [        UR                  5      $ )a  
/**
 * Retrieves the default applications clock that GPU boots with or
 * defaults to after \ref nvmlDeviceResetApplicationsClocks call.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param clockType                            Identify which clock domain to query
 * @param clockMHz                             Reference in which to return the default clock in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a clockMHz has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * \see nvmlDeviceGetApplicationsClock
 */
nvmlReturn_t DECLDIR nvmlDeviceGetDefaultApplicationsClock
%nvmlDeviceGetDefaultApplicationsClockr{  r}  s        r   r  r  
  sE    0 hG	 !H	IB
V%d+U7^
<CS&&r   c                 l   [        S5      n[        S5      nU" U [        U5      S5      nU[        :X  a  / $ U[        :X  ak  [         UR
                  -  nU" 5       nU" U [        U5      U5      n[        U5        / n[        UR
                  5       H  nUR                  XW   5        M     U$ [        U5      e)a  
/**
 * Retrieves the list of possible memory clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param count                                Reference in which to provide the \a clocksMHz array size, and
 *                                             to return the number of elements
 * @param clocksMHz                            Reference in which to return the clock in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a count and \a clocksMHz have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a count is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to the number of
 *                                                required elements)
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetApplicationsClocks
 * @see nvmlDeviceGetSupportedGraphicsClocks
 */
nvmlReturn_t DECLDIR nvmlDeviceGetSupportedMemoryClocks
r   "nvmlDeviceGetSupportedMemoryClocksN
r   r9  r  r   r   r   r0  ranger]  r   )r;  r  r  r/  clocks_arrayc_clocksprocsis           r   r  r  
  s    8 QiG	 !E	FB
VU7^T
*C|	
-
--> w2w}}%ALL% &  nr   c                    [        S5      n[        S5      nU" U [        U5      [        U5      S5      nU[        :X  a  / $ U[        :X  au  [         UR
                  -  nU" 5       nU" U [        U5      [        U5      U5      n[        U5        / n[        UR
                  5       H  nUR                  Xh   5        M     U$ [        U5      e)a#  
/**
 * Retrieves the list of possible graphics clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param memoryClockMHz                       Memory clock for which to return possible graphics clocks
 * @param count                                Reference in which to provide the \a clocksMHz array size, and
 *                                             to return the number of elements
 * @param clocksMHz                            Reference in which to return the clocks in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a count and \a clocksMHz have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_NOT_FOUND         if the specified \a memoryClockMHz is not a supported frequency
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clock is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetApplicationsClocks
 * @see nvmlDeviceGetSupportedMemoryClocks
 */
nvmlReturn_t DECLDIR nvmlDeviceGetSupportedGraphicsClocks
r   $nvmlDeviceGetSupportedGraphicsClocksNr  )	r;  memoryClockMHzr  r  r/  r  r  r  r  s	            r   r  r  	  s    : QiG	 !G	HB
VVN+U7^T
BC|	
-
--> /wJw}}%ALL% &  nr   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the intended operating speed of the device's fan.
 *
 * Note: The reported speed is the intended fan speed.  If the fan is physically blocked and unable to spin, the
 * output will not match the actual fan speed.
 *
 * For all discrete products with dedicated fans.
 *
 * The fan speed is expressed as a percent of the maximum, i.e. full speed is 100%.
 *
 * @param device                               The identifier of the target device
 * @param speed                                Reference in which to return the fan speed percentage
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a speed has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a speed is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have a fan
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetFanSpeed
nvmlDeviceGetFanSpeedr  )r;  c_speedr  r/  s       r   r  r  ?  s=    2 hG	 !8	9B
VU7^
$CS&&r   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        [        UR                  5      $ )aX  
/**
 * Retrieves the current temperature readings for the device, in degrees C.
 *
 * For all products.
 *
 * See \ref nvmlTemperatureSensors_t for details on available temperature sensors.
 *
 * @param device                               The identifier of the target device
 * @param sensorType                           Flag that indicates which sensor reading to retrieve
 * @param temp                                 Reference in which to return the temperature reading
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a temp has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a sensorType is invalid or \a temp is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have the specified sensor
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetTemperature
nvmlDeviceGetTemperature)r   r9  _nvmlTemperatureSensors_tr  r0  rU  r   )r;  sensorr  r  r/  s        r   r  r  ^  sE    . XF	 !;	<B
V.v6f
FCS%%r   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        [        UR                  5      $ )a  
/**
 * Retrieves the temperature threshold for the GPU with the specified threshold type in degrees C.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * See \ref nvmlTemperatureThresholds_t for details on available temperature thresholds.
 *
 * @param device                               The identifier of the target device
 * @param thresholdType                        The type of threshold value queried
 * @param temp                                 Reference in which to return the temperature reading
 * @return
 *         - \ref NVML_SUCCESS                 if \a temp has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a thresholdType is invalid or \a temp is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have a temperature sensor or is unsupported
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetTemperatureThreshold
!nvmlDeviceGetTemperatureThreshold)r   r9  _nvmlTemperatureThresholds_tr  r0  rU  r   )r;  	thresholdr  r  r/  s        r   r  r  {  sE    , XF	 !D	EB
V1)<eFm
LCS%%r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )aJ  
/**
 * Deprecated: Use \ref nvmlDeviceGetPerformanceState. This function exposes an incorrect generalization.
 *
 * Retrieve the current performance state for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlPstates_t for details on allowed performance states.
 *
 * @param device                               The identifier of the target device
 * @param pState                               Reference in which to return the performance state reading
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a pState has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a pState is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPowerState
nvmlDeviceGetPowerState_nvmlPstates_tr9  r  r0  rU  r   r;  c_pstater  r/  s       r   r  r    s>    0 H	 !:	;B
VU8_
%CS''r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the current performance state for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlPstates_t for details on allowed performance states.
 *
 * @param device                               The identifier of the target device
 * @param pState                               Reference in which to return the performance state reading
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a pState has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a pState is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPerformanceState
nvmlDeviceGetPerformanceStater  r  s       r   r  r    s>    , H	 !@	AB
VU8_
%CS''r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * This API has been deprecated.
 *
 * Retrieves the power management mode associated with this device.
 *
 * For products from the Fermi family.
 *     - Requires \a NVML_INFOROM_POWER version 3.0 or higher.
 *
 * For from the Kepler or newer families.
 *     - Does not require \a NVML_INFOROM_POWER object.
 *
 * This flag indicates whether any power management algorithm is currently active on the device. An
 * enabled state does not necessarily mean the device is being actively throttled -- only that
 * that the driver will do so if the appropriate conditions are met.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Reference in which to return the current power management mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPowerManagementMode
 nvmlDeviceGetPowerManagementModern  )r;  
c_pcapModer  r/  s       r   r  r    sB    @ $%J	 !C	DB
VU:&
'CS
(())r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the power management limit associated with this device.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * The power limit defines the upper boundary for the card's power draw. If
 * the card's total power draw reaches this limit the power management algorithm kicks in.
 *
 * This reading is only available if power management mode is supported.
 * See \ref nvmlDeviceGetPowerManagementMode.
 *
 * @param device                               The identifier of the target device
 * @param limit                                Reference in which to return the power management limit in milliwatts
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a limit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a limit is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPowerManagementLimit
!nvmlDeviceGetPowerManagementLimitr  r;  c_limitr  r/  s       r   r  r    s=    4 hG	 !D	EB
VU7^
$CS&&r   c                     [        5       n[        5       n[        S5      nU" U [        U5      [        U5      5      n[        U5        UR                  UR                  /$ )a  
/**
 * Retrieves information about possible values of power management limits on this device.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param minLimit                             Reference in which to return the minimum power management limit in milliwatts
 * @param maxLimit                             Reference in which to return the maximum power management limit in milliwatts
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a minLimit and \a maxLimit have been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a minLimit or \a maxLimit is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetPowerManagementLimit
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPowerManagementLimitConstraints
,nvmlDeviceGetPowerManagementLimitConstraintsrP  )r;  
c_minLimit
c_maxLimitr  r/  s        r   r  r    sT    . JJ	 !O	PB
VU:&j(9
:CSj..//r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a1  
/**
 * Retrieves default power management limit on this device, in milliwatts.
 * Default power management limit is a power management limit that the device boots with.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param defaultLimit                         Reference in which to return the default power management limit in milliwatts
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a defaultLimit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a defaultLimit is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPowerManagementDefaultLimit
(nvmlDeviceGetPowerManagementDefaultLimitr  r  s       r   r  r  8  s=    * hG	 !K	LB
VU7^
$CS&&r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )al  
/**
 * Get the effective power limit that the driver enforces after taking into account all limiters
 *
 * Note: This can be different from the \ref nvmlDeviceGetPowerManagementLimit if other limits are set elsewhere
 * This includes the out of band power limit interface
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                           The device to communicate with
 * @param limit                            Reference in which to return the power management limit in milliwatts
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a limit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a limit is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetEnforcedPowerLimit
nvmlDeviceGetEnforcedPowerLimitr  r  s       r   r  r  U  s=    . hG	 !B	CB
VU7^
$CS&&r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g. memory)
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * On Fermi and Kepler GPUs the reading is accurate to within +/- 5% of current power draw.
 *
 * It is only available if power management mode is supported. See \ref nvmlDeviceGetPowerManagementMode.
 *
 * @param device                               The identifier of the target device
 * @param power                                Reference in which to return the power usage information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a power has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a power is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support power readings
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPowerUsage
nvmlDeviceGetPowerUsager  )r;  c_wattsr  r/  s       r   r  r  r  s=    0 hG	 !:	;B
VU7^
$CS&&r   c                     [        5       n[        5       n[        S5      nU" U [        U5      [        U5      5      n[        U5        UR                  UR                  /$ )a,  
/**
 * Retrieves the current GOM and pending GOM (the one that GPU will switch to after reboot).
 *
 * For GK110 M-class and X-class Tesla &tm; products from the Kepler family.
 * Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products.
 * Not supported on Quadro &reg; and Tesla &tm; C-class products.
 *
 * @param device                               The identifier of the target device
 * @param current                              Reference in which to return the current GOM
 * @param pending                              Reference in which to return the pending GOM
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a mode has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a current or \a pending is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlGpuOperationMode_t
 * @see nvmlDeviceSetGpuOperationMode
 */
nvmlReturn_t DECLDIR nvmlDeviceGetGpuOperationMode
nvmlDeviceGetGpuOperationMode)_nvmlGpuOperationMode_tr9  r  r0  r   r;  c_currStatec_pendingStater  r/  s        r   r  r    sV    4 *+K,.N	 !@	AB
VU;'~)>
?CS~3344r   c                     [        U 5      S   $ rD  r  r;  s    r   $nvmlDeviceGetCurrentGpuOperationModer        (033r   c                     [        U 5      S   $ Nr   r  r  s    r   $nvmlDeviceGetPendingGpuOperationModer    r  r   c                 |    [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )a  
/**
 * Retrieves the amount of used, free and total memory available on the device, in bytes.
 *
 * For all products.
 *
 * Enabling ECC reduces the amount of total available memory, due to the extra required parity bits.
 * Under WDDM most device memory is allocated and managed on startup by Windows.
 *
 * Under Linux and Windows TCC, the reported amount of used memory is equal to the sum of memory allocated
 * by all active channels on the device.
 *
 * See \ref nvmlMemory_t for details on available memory info.
 *
 * @param device                               The identifier of the target device
 * @param memory                               Reference in which to return the memory information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a memory has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a memory is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetMemoryInfo
nvmlDeviceGetMemoryInfo)r  r9  r  r0  rU  )r;  c_memoryr  r/  s       r   r  r    s:    6 H	 !:	;B
VU8_
%CS!!r   c                 |    [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )as  
/**
 * Gets Total, Available and Used size of BAR1 memory.
 *
 * BAR1 is used to map the FB (device memory) so that it can be directly accessed by the CPU or by 3rd party
 * devices (peer-to-peer on the PCIE bus).
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param bar1Memory                           Reference in which BAR1 memory
 *                                             information is returned.
 *
 * @return
 *         - \ref NVML_SUCCESS                 if BAR1 memory is successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a bar1Memory is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
nvmlReturn_t DECLDIR nvmlDeviceGetBAR1MemoryInfo
nvmlDeviceGetBAR1MemoryInfo)r  r9  r  r0  rU  )r;  c_bar1_memoryr  r/  s       r   r  r    s;    2 '(M	 !>	?B
VU=)
*CS&&r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the current compute mode for the device.
 *
 * For all products.
 *
 * See \ref nvmlComputeMode_t for details on allowed compute modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Reference in which to return the current compute mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetComputeMode()
 */
nvmlReturn_t DECLDIR nvmlDeviceGetComputeMode
nvmlDeviceGetComputeMode)_nvmlComputeMode_tr9  r  r0  rU  r   rp  s       r   r  r    s>    0  !F	 !;	<B
VU6]
#CS%%r   c                     [        5       n[        5       n[        S5      nU" U [        U5      [        U5      5      n[        U5        UR                  UR                  /$ )aQ  
/**
 * Retrieves the current and pending ECC modes for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher.
 *
 * Changing ECC modes requires a reboot. The "pending" ECC mode refers to the target mode following
 * the next reboot.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param current                              Reference in which to return the current ECC mode
 * @param pending                              Reference in which to return the pending ECC mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a current and \a pending have been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or either \a current or \a pending is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetEccMode()
 */
nvmlReturn_t DECLDIR nvmlDeviceGetEccMode
nvmlDeviceGetEccModero  r9  r  r0  r   r  s        r   r  r    sV    < %&K')N	 !7	8B
VU;'~)>
?CS~3344r   c                     [        U 5      S   $ rD  r  r  s    r   nvmlDeviceGetCurrentEccModer  >      '**r   c                     [        U 5      S   $ r  r  r  s    r   nvmlDeviceGetPendingEccModer  B  r  r   c                     [        5       n[        S5      nU" U [        U5      [        U5      [	        U5      5      n[        U5        [        UR                  5      $ )a^  
/**
 * Retrieves the total ECC error counts for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher.
 * Requires ECC Mode to be enabled.
 *
 * The total error count is the sum of errors across each of the separate memory systems, i.e. the total set of
 * errors across the entire device.
 *
 * See \ref nvmlMemoryErrorType_t for a description of available error types.\n
 * See \ref nvmlEccCounterType_t for a description of available counter types.
 *
 * @param device                               The identifier of the target device
 * @param errorType                            Flag that specifies the type of the errors.
 * @param counterType                          Flag that specifies the counter-type of the errors.
 * @param eccCounts                            Reference in which to return the specified ECC errors
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a eccCounts has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceClearEccErrorCounts()
 */
nvmlReturn_t DECLDIR nvmlDeviceGetTotalEccErrors
nvmlDeviceGetTotalEccErrors)r  r9  _nvmlMemoryErrorType_t_nvmlEccCounterType_tr  r0  rU  r   )r;  	errorTypecounterTyper  r  r/  s         r   r  r  E  sP    B mG	 !>	?B
V+I6

,eGn>CS&&r   c                     [        5       n[        S5      nU" U [        U5      [        U5      [	        U5      5      n[        U5        [        U5      $ )aI  
/**
 * Retrieves the detailed ECC error counts for the device.
 *
 * @deprecated   This API supports only a fixed set of ECC error locations
 *               On different GPU architectures different locations are supported
 *               See \ref nvmlDeviceGetMemoryErrorCounter
 *
 * For Fermi &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based ECC counts.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other ECC counts.
 * Requires ECC Mode to be enabled.
 *
 * Detailed errors provide separate ECC counts for specific parts of the memory system.
 *
 * Reports zero for unsupported ECC error counters when a subset of ECC error counters are supported.
 *
 * See \ref nvmlMemoryErrorType_t for a description of available bit types.\n
 * See \ref nvmlEccCounterType_t for a description of available counter types.\n
 * See \ref nvmlEccErrorCounts_t for a description of provided detailed ECC counts.
 *
 * @param device                               The identifier of the target device
 * @param errorType                            Flag that specifies the type of the errors.
 * @param counterType                          Flag that specifies the counter-type of the errors.
 * @param eccCounts                            Reference in which to return the specified ECC errors
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a eccCounts has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceClearEccErrorCounts()
 */
nvmlReturn_t DECLDIR nvmlDeviceGetDetailedEccErrors
nvmlDeviceGetDetailedEccErrors)r  r9  r  r  r  r0  rU  )r;  r  r  c_countsr  r/  s         r   r  r  n  sM    P &'H	 !A	BB
V+I6

,eHo?CS!!r   c           	          [        5       n[        S5      nU" U [        U5      [        U5      [	        U5      [        U5      5      n[        U5        [        UR                  5      $ )aE  
/**
 * Retrieves the requested memory error counter for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based memory error counts.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other memory error counts.
 *
 * Only applicable to devices with ECC.
 *
 * Requires ECC Mode to be enabled.
 *
 * See \ref nvmlMemoryErrorType_t for a description of available memory error types.\n
 * See \ref nvmlEccCounterType_t for a description of available counter types.\n
 * See \ref nvmlMemoryLocation_t for a description of available counter locations.\n
 *
 * @param device                               The identifier of the target device
 * @param errorType                            Flag that specifies the type of error.
 * @param counterType                          Flag that specifies the counter-type of the errors.
 * @param locationType                         Specifies the location of the counter.
 * @param count                                Reference in which to return the ECC counter
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a count has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a bitTyp,e \a counterType or \a locationType is
 *                                             invalid, or \a count is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support ECC error reporting in the specified memory
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetMemoryErrorCounter
nvmlDeviceGetMemoryErrorCounter)	r  r9  r  r  _nvmlMemoryLocation_tr  r0  rU  r   )r;  r  r  locationTyper  r  r/  s          r   r  r    s[    D mG	 !B	CB
V#I.";/"<07^	C
 S&&r   c                 |    [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )a  
/**
 * Retrieves the current utilization rates for the device's major subsystems.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlUtilization_t for details on available utilization rates.
 *
 * \note During driver initialization when ECC is enabled one can see high GPU and Memory Utilization readings.
 *       This is caused by ECC Memory Scrubbing mechanism that is performed during driver initialization.
 *
 * @param device                               The identifier of the target device
 * @param utilization                          Reference in which to return the utilization information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a utilization has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a utilization is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetUtilizationRates
nvmlDeviceGetUtilizationRates)r  r9  r  r0  rU  )r;  c_utilr  r/  s       r   r  r    s:    2 !"F	 !@	AB
VU6]
#CSr   c                     [        5       n[        5       n[        S5      nU" U [        U5      [        U5      5      n[        U5        UR                  UR                  /$ )aR  
/**
 * Retrieves the current utilization and sampling size in microseconds for the Encoder
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param utilization                          Reference to an unsigned int for encoder utilization info
 * @param samplingPeriodUs                     Reference to an unsigned int for the sampling period in US
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a utilization has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetEncoderUtilization
nvmlDeviceGetEncoderUtilizationrP  r;  r  c_samplingPeriodr  r/  s        r   r  r    T    * XFx	 !B	CB
VU6]E*:$;
<CSLL*0011r   c                     [        5       n[        5       n[        S5      nU" U [        U5      [        U5      5      n[        U5        UR                  UR                  /$ )aR  
/**
 * Retrieves the current utilization and sampling size in microseconds for the Decoder
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param utilization                          Reference to an unsigned int for decoder utilization info
 * @param samplingPeriodUs                     Reference to an unsigned int for the sampling period in US
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a utilization has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetDecoderUtilization
nvmlDeviceGetDecoderUtilizationrP  r  s        r   r  r    r  r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a}  
/**
 * Retrieve the PCIe replay counter.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param value                                Reference in which to return the counter's value
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a value has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a value is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPcieReplayCounter
nvmlDeviceGetPcieReplayCounterr  )r;  c_replayr  r/  s       r   r  r  !  s=    ( xH	 !A	BB
VU8_
%CS''r   c                     [        5       n[        5       n[        S5      nU" U [        U5      [        U5      5      n[        U5        UR                  UR                  /$ )au  
/**
 * Retrieves the current and pending driver model for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * For windows only.
 *
 * On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached
 * to the device it must run in WDDM mode. TCC mode is preferred if a display is not attached.
 *
 * See \ref nvmlDriverModel_t for details on available driver models.
 *
 * @param device                               The identifier of the target device
 * @param current                              Reference in which to return the current driver model
 * @param pending                              Reference in which to return the pending driver model
 *
 * @return
 *         - \ref NVML_SUCCESS                 if either \a current and/or \a pending have been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or both \a current and \a pending are NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the platform is not windows
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetDriverModel()
 */
nvmlReturn_t DECLDIR nvmlDeviceGetDriverModel
nvmlDeviceGetDriverModel)_nvmlDriverModel_tr9  r  r0  r   )r;  c_currModelc_pendingModelr  r/  s        r   r  r  ;  sV    : %&K')N	 !;	<B
VU;'~)>
?CS~3344r   c                     [        U 5      S   $ rD  r  r  s    r   nvmlDeviceGetCurrentDriverModelr  `      #F+A..r   c                     [        U 5      S   $ r  r  r  s    r   nvmlDeviceGetPendingDriverModelr  d  r  r   c                     [        [        5      n[        S5      nU" X[        [        5      5      n[	        U5        [        UR                  5      $ )a{  
/**
 * Get VBIOS version of the device.
 *
 * For all products.
 *
 * The VBIOS version may change from time to time. It will not exceed 32 characters in length
 * (including the NULL terminator).  See \ref nvmlConstants::NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param version                              Reference to which to return the VBIOS version
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetVbiosVersion
nvmlDeviceGetVbiosVersion)r  %NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZEr9  r   r0  rU  r   rf  s       r   r  r  h  sC    0 %%JKI	 !<	=B
V'L M
NCS	((r   c                    [        S5      n[        S5      nU" U [        U5      S5      nU[        :X  a  / $ U[        :X  a  UR
                  S-  S-   Ul        [        UR
                  -  nU" 5       nU" U [        U5      U5      n[        U5        / n[        UR
                  5       HF  n[        XW   5      nUR                  [        R
                  :X  a  SUl
        UR                  U5        MH     U$ [        U5      e)a{  
/**
 * Get information about processes with a compute context on a device
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * This function returns information only about compute running processes (e.g. CUDA application which have
 * active context). Any graphics applications (e.g. using OpenGL, DirectX) won't be listed by this function.
 *
 * To query the current number of running compute processes, call this function with *infoCount = 0. The
 * return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call
 * \a infos is allowed to be NULL.
 *
 * The usedGpuMemory field returned is all of the memory used by the application.
 *
 * Keep in mind that information returned by this call is dynamic and the number of elements might change in
 * time. Allocate more space for \a infos table in case new compute processes are spawned.
 *
 * @param device                               The identifier of the target device
 * @param infoCount                            Reference in which to provide the \a infos array size, and
 *                                             to return the number of returned elements
 * @param infos                                Reference in which to return the process information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a infoCount and \a infos have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small
 *                                             \a infoCount will contain minimal amount of space necessary for
 *                                             the call to complete
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, either of \a infoCount or \a infos is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see \ref nvmlSystemGetProcessName
 */
nvmlReturn_t DECLDIR nvmlDeviceGetComputeRunningProcesses
r   $nvmlDeviceGetComputeRunningProcessesNr   r   r   r9  r  r   r   r   r  r0  r  rI  r  "NVML_VALUE_NOT_AVAILABLE_ulonglongr]  r   	r;  r  r  r/  
proc_arrayc_procsr  r  r   s	            r   r  r    s    N QiG	 !G	HB
VU7^T
*C|	
-
-  )A-(7==8
, w1w}}%A,WZ8C!!%G%M%MM$(!LL &  nr   c                    [        S5      n[        S5      nU" U [        U5      S5      nU[        :X  a  / $ U[        :X  a  UR
                  S-  S-   Ul        [        UR
                  -  nU" 5       nU" U [        U5      U5      n[        U5        / n[        UR
                  5       HF  n[        XW   5      nUR                  [        R
                  :X  a  SUl
        UR                  U5        MH     U$ [        U5      e)a  
/**
 * Get information about processes with a graphics context on a device
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * This function returns information only about graphics based processes
 * (eg. applications using OpenGL, DirectX)
 *
 * To query the current number of running graphics processes, call this function with *infoCount = 0. The
 * return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call
 * \a infos is allowed to be NULL.
 *
 * The usedGpuMemory field returned is all of the memory used by the application.
 *
 * Keep in mind that information returned by this call is dynamic and the number of elements might change in
 * time. Allocate more space for \a infos table in case new graphics processes are spawned.
 *
 * @param device                               The identifier of the target device
 * @param infoCount                            Reference in which to provide the \a infos array size, and
 *                                             to return the number of returned elements
 * @param infos                                Reference in which to return the process information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a infoCount and \a infos have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small
 *                                             \a infoCount will contain minimal amount of space necessary for
 *                                             the call to complete
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, either of \a infoCount or \a infos is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see \ref nvmlSystemGetProcessName
 */
nvmlReturn_t DECLDIR nvmlDeviceGetGraphicsRunningProcesses
r   %nvmlDeviceGetGraphicsRunningProcessesNr   r   r  r  s	            r   r  r    s    N QiG	 !H	IB
VU7^T
*C|	
-
-  )A-(7==8
, w1w}}%A,WZ8C!!%G%M%MM$(!LL &  nr   c                     [        5       n[        5       n[        S5      nU" U [        U5      [        U5      5      n[        U5        UR                  UR                  /$ )a  
/**
 * Retrieve the current state of Auto Boosted clocks on a device and store it in \a isEnabled
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
 * to maximize performance as thermal limits allow.
 *
 * On Pascal and newer hardware, Auto Aoosted clocks are controlled through application clocks.
 * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
 * behavior.
 *
 * @param device                               The identifier of the target device
 * @param isEnabled                            Where to store the current state of Auto Boosted clocks of the target device
 * @param defaultIsEnabled                     Where to store the default Auto Boosted clocks behavior of the target device that the device will
 *                                                 revert to when no applications are using the GPU
 *
 * @return
 *         - \ref NVML_SUCCESS                 If \a isEnabled has been been set with the Auto Boosted clocks state of \a device
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a isEnabled is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support Auto Boosted clocks
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
nvmlReturn_t DECLDIR nvmlDeviceGetAutoBoostedClocksEnabled
%nvmlDeviceGetAutoBoostedClocksEnabledr  )r;  c_isEnabledc_defaultIsEnabledr  r/  s        r   r  r    sY    < %&K+-	 !H	IB
VU;'/A)B
CCS17788r   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)a  
/**
 * Set the LED state for the unit. The LED can be either green (0) or amber (1).
 *
 * For S-class products.
 * Requires root/admin permissions.
 *
 * This operation takes effect immediately.
 *
 *
 * <b>Current S-Class products don't provide unique LEDs for each unit. As such, both front
 * and back LEDs will be toggled in unison regardless of which unit is specified with this command.</b>
 *
 * See \ref nvmlLedColor_t for available colors.
 *
 * @param unit                                 The identifier of the target unit
 * @param color                                The target LED color
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the LED color has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit or \a color is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlUnitGetLedState()
 */
nvmlReturn_t DECLDIR nvmlUnitSetLedState
nvmlUnitSetLedStateN)r9  ro  r0  )r  rn  r  r/  s       r   r  r  <  s+    > 
!!6	7B
T?5)
*CSr   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)ab  
/**
 * Set the persistence mode for the device.
 *
 * For all products.
 * For Linux only.
 * Requires root/admin permissions.
 *
 * The persistence mode determines whether the GPU driver software is torn down after the last client
 * exits.
 *
 * This operation takes effect immediately. It is not persistent across reboots. After each reboot the
 * persistence mode is reset to "Disabled".
 *
 * See \ref nvmlEnableState_t for available modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 The target persistence mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the persistence mode was set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetPersistenceMode()
 */
nvmlReturn_t DECLDIR nvmlDeviceSetPersistenceMode
nvmlDeviceSetPersistenceModeNr9  ro  r0  r;  moder  r/  s       r   r  r  `  s-    B 
!!?	@B
V'-
.CSr   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)a  
/**
 * Set the compute mode for the device.
 *
 * For all products.
 * Requires root/admin permissions.
 *
 * The compute mode determines whether a GPU can be used for compute operations and whether it can
 * be shared across contexts.
 *
 * This operation takes effect immediately. Under Linux it is not persistent across reboots and
 * always resets to "Default". Under windows it is persistent.
 *
 * Under windows compute mode may only be set to DEFAULT when running in WDDM
 *
 * See \ref nvmlComputeMode_t for details on available compute modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 The target compute mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the compute mode was set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetComputeMode()
 */
nvmlReturn_t DECLDIR nvmlDeviceSetComputeMode
nvmlDeviceSetComputeModeN)r9  r  r0  r  s       r   r  r    s-    D 
!!;	<B
V'-
.CSr   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)a'  
/**
 * Set the ECC mode for the device.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher.
 * Requires root/admin permissions.
 *
 * The ECC mode determines whether the GPU enables its ECC support.
 *
 * This operation takes effect after the next reboot.
 *
 * See \ref nvmlEnableState_t for details on available modes.
 *
 * @param device                               The identifier of the target device
 * @param ecc                                  The target ECC mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the ECC mode was set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a ecc is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetEccMode()
 */
nvmlReturn_t DECLDIR nvmlDeviceSetEccMode
nvmlDeviceSetEccModeNr  r  s       r   r  r    s-    @ 
!!7	8B
V'-
.CSr   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)a  
/**
 * Clear the ECC error and other memory error counts for the device.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 2.0 or higher to clear aggregate location-based ECC counts.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher to clear all other ECC counts.
 * Requires root/admin permissions.
 * Requires ECC Mode to be enabled.
 *
 * Sets all of the specified ECC counters to 0, including both detailed and total counts.
 *
 * This operation takes effect immediately.
 *
 * See \ref nvmlMemoryErrorType_t for details on available counter types.
 *
 * @param device                               The identifier of the target device
 * @param counterType                          Flag that indicates which type of errors should be cleared.
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the error counts were cleared
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a counterType is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see
 *      - nvmlDeviceGetDetailedEccErrors()
 *      - nvmlDeviceGetTotalEccErrors()
 */
nvmlReturn_t DECLDIR nvmlDeviceClearEccErrorCounts
nvmlDeviceClearEccErrorCountsN)r9  r  r0  )r;  r  r  r/  s       r   r  r    s-    H 
!!@	AB
V*;7
8CSr   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)a  
/**
 * Set the driver model for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * For windows only.
 * Requires root/admin permissions.
 *
 * On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached
 * to the device it must run in WDDM mode.
 *
 * It is possible to force the change to WDM (TCC) while the display is still attached with a force flag (nvmlFlagForce).
 * This should only be done if the host is subsequently powered down and the display is detached from the device
 * before the next reboot.
 *
 * This operation takes effect after the next reboot.
 *
 * Windows driver model may only be set to WDDM when running in DEFAULT compute mode.
 *
 * Change driver model to WDDM is not supported when GPU doesn't support graphics acceleration or
 * will not support it after reboot. See \ref nvmlDeviceSetGpuOperationMode.
 *
 * See \ref nvmlDriverModel_t for details on available driver models.
 * See \ref nvmlFlagDefault and \ref nvmlFlagForce
 *
 * @param device                               The identifier of the target device
 * @param driverModel                          The target driver model
 * @param flags                                Flags that change the default behavior
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the driver model has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a driverModel is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the platform is not windows or the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetDriverModel()
 */
nvmlReturn_t DECLDIR nvmlDeviceSetDriverModel
nvmlDeviceSetDriverModelN)r9  r  r0  )r;  rK  r  r/  s       r   r  r    s-    V 
!!;	<B
V'.
/CSr   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)a  
/**
 * Try to set the current state of Auto Boosted clocks on a device.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
 * to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock
 * rates are desired.
 *
 * Non-root users may use this API by default but can be restricted by root from using this API by calling
 * \ref nvmlDeviceSetAPIRestriction with apiType=NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS.
 * Note: Persistence Mode is required to modify current Auto Boost settings, therefore, it must be enabled.
 *
 * On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks.
 * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
 * behavior.
 *
 * @param device                               The identifier of the target device
 * @param enabled                              What state to try to set Auto Boosted clocks of the target device to
 *
 * @return
 *         - \ref NVML_SUCCESS                 If the Auto Boosted clocks were successfully set to the state specified by \a enabled
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support Auto Boosted clocks
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
nvmlReturn_t DECLDIR nvmlDeviceSetAutoBoostedClocksEnabled
%nvmlDeviceSetAutoBoostedClocksEnabledNr  )r;  enabledr  r/  s       r   r  r  +  s-    B 
!!H	IB
V'0
1CSr   c                 h    [        S5      nU" U [        U5      [        U5      5      n[        U5        g)a  
/**
 * Try to set the default state of Auto Boosted clocks on a device. This is the default state that Auto Boosted clocks will
 * return to when no compute running processes (e.g. CUDA application which have an active context) are running
 *
 * For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
 * Requires root/admin permissions.
 *
 * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
 * to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock
 * rates are desired.
 *
 * On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks.
 * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
 * behavior.
 *
 * @param device                               The identifier of the target device
 * @param enabled                              What state to try to set default Auto Boosted clocks of the target device to
 * @param flags                                Flags that change the default behavior. Currently Unused.
 *
 * @return
 *         - \ref NVML_SUCCESS                 If the Auto Boosted clock's default state was successfully set to the state specified by \a enabled
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_NO_PERMISSION     If the calling user does not have permission to change Auto Boosted clock's default state.
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support Auto Boosted clocks
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
nvmlReturn_t DECLDIR nvmlDeviceSetDefaultAutoBoostedClocksEnabled
,nvmlDeviceSetDefaultAutoBoostedClocksEnabledN)r9  ro  r   r0  )r;  r  flagsr  r/  s        r   r  r  R  s3    B 
!!O	PB
V'0&-
@CSr   c                 h    [        S5      nU" U [        U5      [        U5      5      n[        U5        g)a  
/**
 * Set clocks that applications will lock to.
 *
 * Sets the clocks that compute and graphics applications will be running at.
 * e.g. CUDA driver requests these clocks during context creation which means this property
 * defines clocks at which CUDA applications will be running unless some overspec event
 * occurs (e.g. over power, over thermal or external HW brake).
 *
 * Can be used as a setting to request constant performance.
 *
 * On Pascal and newer hardware, this will automatically disable automatic boosting of clocks.
 *
 * On K80 and newer Kepler and Maxwell GPUs, users desiring fixed performance should also call
 * \ref nvmlDeviceSetAutoBoostedClocksEnabled to prevent clocks from automatically boosting
 * above the clock value being set.
 *
 * For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
 * Requires root/admin permissions.
 *
 * See \ref nvmlDeviceGetSupportedMemoryClocks and \ref nvmlDeviceGetSupportedGraphicsClocks
 * for details on how to list available clocks combinations.
 *
 * After system reboot or driver reload applications clocks go back to their default value.
 * See \ref nvmlDeviceResetApplicationsClocks.
 *
 * @param device                               The identifier of the target device
 * @param memClockMHz                          Requested memory clock in MHz
 * @param graphicsClockMHz                     Requested graphics clock in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if new settings were successfully set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a memClockMHz and \a graphicsClockMHz
 *                                                 is not a valid clock combination
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceSetApplicationsClocks
nvmlDeviceSetApplicationsClocksNr9  r   r0  )r;  maxMemClockMHzmaxGraphicsClockMHzr  r/  s        r   r   r   z  s4    V 
!!B	CB
VVN+V4G-H
ICSr   c                 @    [        S5      nU" U 5      n[        U5        g)ax  
/**
 * Resets the application clock to the default value
 *
 * This is the applications clock that will be used after system reboot or driver reload.
 * Default value is constant, but the current value an be changed using \ref nvmlDeviceSetApplicationsClocks.
 *
 * On Pascal and newer hardware, if clocks were previously locked with \ref nvmlDeviceSetApplicationsClocks,
 * this call will unlock clocks. This returns clocks their default behavior ofautomatically boosting above
 * base clocks as thermal limits allow.
 *
 * @see nvmlDeviceGetApplicationsClock
 * @see nvmlDeviceSetApplicationsClocks
 *
 * For Fermi &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
 *
 * @param device                               The identifier of the target device
 *
 * @return
 *         - \ref NVML_SUCCESS                 if new settings were successfully set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceResetApplicationsClocks
!nvmlDeviceResetApplicationsClocksNrU  rV  s      r   r%  r%    s#    : 
!!D	EB
V*CSr   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)a%  
/**
 * Set new power limit of this device.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Requires root/admin permissions.
 *
 * See \ref nvmlDeviceGetPowerManagementLimitConstraints to check the allowed ranges of values.
 *
 * \note Limit is not persistent across reboots or driver unloads.
 * Enable persistent mode to prevent driver from unloading when no application is using the device.
 *
 * @param device                               The identifier of the target device
 * @param limit                                Power management limit in milliwatts to set
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a limit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a defaultLimit is out of range
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetPowerManagementLimitConstraints
 * @see nvmlDeviceGetPowerManagementDefaultLimit
 */
nvmlReturn_t DECLDIR nvmlDeviceSetPowerManagementLimit
!nvmlDeviceSetPowerManagementLimitNr!  )r;  limitr  r/  s       r   r'  r'    s*    : 
!!D	EB
VVE]
#CSr   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)a/  
/**
 * Sets new GOM. See \a nvmlGpuOperationMode_t for details.
 *
 * For GK110 M-class and X-class Tesla &tm; products from the Kepler family.
 * Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products.
 * Not supported on Quadro &reg; and Tesla &tm; C-class products.
 * Requires root/admin permissions.
 *
 * Changing GOMs requires a reboot.
 * The reboot requirement might be removed in the future.
 *
 * Compute only GOMs don't support graphics acceleration. Under windows switching to these GOMs when
 * pending driver model is WDDM is not supported. See \ref nvmlDeviceSetDriverModel.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Target GOM
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode incorrect
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support GOM or specific mode
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlGpuOperationMode_t
 * @see nvmlDeviceGetGpuOperationMode
 */
nvmlReturn_t DECLDIR nvmlDeviceSetGpuOperationMode
nvmlDeviceSetGpuOperationModeN)r9  r  r0  r  s       r   r*  r*    s-    B 
!!@	AB
V,T2
3CSr   c                  h    [        S5      n [        5       nU " [        U5      5      n[        U5        U$ )a|  
/**
 * Create an empty set of events.
 * Event set should be freed by \ref nvmlEventSetFree
 *
 * For Fermi &tm; or newer fully supported devices.
 * @param set                                  Reference in which to return the event handle
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the event has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a set is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlEventSetFree
 */
nvmlReturn_t DECLDIR nvmlEventSetCreate
nvmlEventSetCreate)r9  c_nvmlEventSet_tr  r0  )r  eventSetr/  s      r   r,  r,    s2    & 
!!5	6B!H
U8_
CSOr   c                 V    [        S5      nU" U [        U5      U5      n[        U5        g)a  
/**
 * Starts recording of events on a specified devices and add the events to specified \ref nvmlEventSet_t
 *
 * For Fermi &tm; or newer fully supported devices.
 * Ecc events are available only on ECC enabled devices (see \ref nvmlDeviceGetTotalEccErrors)
 * Power capping events are available only on Power Management enabled devices (see \ref nvmlDeviceGetPowerManagementMode)
 *
 * For Linux only.
 *
 * \b IMPORTANT: Operations on \a set are not thread safe
 *
 * This call starts recording of events on specific device.
 * All events that occurred before this call are not recorded.
 * Checking if some event occurred can be done with \ref nvmlEventSetWait
 *
 * If function reports NVML_ERROR_UNKNOWN, event set is in undefined state and should be freed.
 * If function reports NVML_ERROR_NOT_SUPPORTED, event set can still be used. None of the requested eventTypes
 *     are registered in that case.
 *
 * @param device                               The identifier of the target device
 * @param eventTypes                           Bitmask of \ref nvmlEventType to record
 * @param set                                  Set to which add new event types
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the event has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a eventTypes is invalid or \a set is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the platform does not support this feature or some of requested event types
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlEventType
 * @see nvmlDeviceGetSupportedEventTypes
 * @see nvmlEventSetWait
 * @see nvmlEventSetFree
 */
nvmlReturn_t DECLDIR nvmlDeviceRegisterEvents
nvmlDeviceRegisterEventsN)r9  r  r0  )r;  
eventTypesr.  r  r/  s        r   r0  r0  2  s.    P 
!!;	<B
V[,h
7CSr   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Returns information about events supported on device
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * Events are not supported on Windows. So this function returns an empty mask in \a eventTypes on Windows.
 *
 * @param device                               The identifier of the target device
 * @param eventTypes                           Reference in which to return bitmask of supported events
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the eventTypes has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a eventType is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlEventType
 * @see nvmlDeviceRegisterEvents
 */
nvmlReturn_t DECLDIR nvmlDeviceGetSupportedEventTypes
 nvmlDeviceGetSupportedEventTypesr  r9  r  r0  rU  r   )r;  c_eventTypesr  r/  s       r   r3  r3  `  s@    0 =L	 !C	DB
VU<(
)CS**++r   c                     [        S5      n[        5       nU" U [        U5      [        U5      5      n[	        U5        [        U5      $ )aV  
/**
 * Waits on events and delivers events
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * If some events are ready to be delivered at the time of the call, function returns immediately.
 * If there are no events ready to be delivered, function sleeps till event arrives
 * but not longer than specified timeout. This function in certain conditions can return before
 * specified timeout passes (e.g. when interrupt arrives)
 *
 * In case of xid error, the function returns the most recent xid error type seen by the system. If there are multiple
 * xid errors generated before nvmlEventSetWait is invoked then the last seen xid error type is returned for all
 * xid error events.
 *
 * @param set                                  Reference to set of events to wait on
 * @param data                                 Reference in which to return event data
 * @param timeoutms                            Maximum amount of wait time in milliseconds for registered event
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the data has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a data is NULL
 *         - \ref NVML_ERROR_TIMEOUT           if no event arrived in specified timeout or interrupt arrived
 *         - \ref NVML_ERROR_GPU_IS_LOST       if a GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlEventType
 * @see nvmlDeviceRegisterEvents
 */
nvmlReturn_t DECLDIR nvmlEventSetWait
nvmlEventSetWait)r9  r  r  r   r0  rU  )r.  	timeoutmsr  datar/  s        r   r7  r7    sB    B 
!!3	4BD
XuT{F9$5
6CSr   c                 @    [        S5      nU" U 5      n[        U5        g)a  
/**
 * Releases events in the set
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param set                                  Reference to events to be released
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the event has been successfully released
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceRegisterEvents
 */
nvmlReturn_t DECLDIR nvmlEventSetFree
nvmlEventSetFreeNrU  )r.  r  r/  s      r   r;  r;    s#    $ 
!!3	4B
X,CSr   c                     [        S5      n[        5       nU" X[        U5      5      n[        U5        UR                  S:g  $ )a*  
/**
 * Check if the GPU devices are on the same physical board.
 *
 * For all fully supported products.
 *
 * @param device1                               The first GPU device
 * @param device2                               The second GPU device
 * @param onSameBoard                           Reference in which to return the status.
 *                                              Non-zero indicates that the GPUs are on the same board.
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a onSameBoard has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a dev1 or \a dev2 are invalid or \a onSameBoard is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this check is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the either GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceOnSameBoard
nvmlDeviceOnSameBoardr   )r9  c_intr  r0  r   )handle1handle2r  onSameBoardr/  s        r   r=  r=    s@    , 
!!8	9B'K
Wu[1
2CS"#r   c                     [        S5      n[        5       nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the current PCIe link generation
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param currLinkGen                          Reference in which to return the current PCIe link generation
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a currLinkGen has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a currLinkGen is null
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if PCIe link information is not available
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetCurrPcieLinkGeneration
#nvmlDeviceGetCurrPcieLinkGenerationr9  r   r  r0  rU  r   r;  r  genr/  s       r   rC  rC    s=    ( 
!!F	GB
(C
VU3Z
 CS		""r   c                     [        S5      n[        5       nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )aX  
/**
 * Retrieves the maximum PCIe link generation possible with this device and system
 *
 * I.E. for a generation 2 PCIe device attached to a generation 1 PCIe bus the max link generation this function will
 * report is generation 1.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param maxLinkGen                           Reference in which to return the max PCIe link generation
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a maxLinkGen has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a maxLinkGen is null
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if PCIe link information is not available
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetMaxPcieLinkGeneration
"nvmlDeviceGetMaxPcieLinkGenerationrD  rE  s       r   rH  rH    s=    . 
!!E	FB
(C
VU3Z
 CS		""r   c                     [        S5      n[        5       nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the current PCIe link width
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param currLinkWidth                        Reference in which to return the current PCIe link generation
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a currLinkWidth has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a currLinkWidth is null
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if PCIe link information is not available
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetCurrPcieLinkWidth
nvmlDeviceGetCurrPcieLinkWidthrD  r;  r  widthr/  s       r   rJ  rJ    s=    ( 
!!A	BBHE
VU5\
"CS$$r   c                     [        S5      n[        5       nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )aE  
/**
 * Retrieves the maximum PCIe link width possible with this device and system
 *
 * I.E. for a device with a 16x PCIe bus width attached to a 8x PCIe system bus this function will report
 * a max link width of 8.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param maxLinkWidth                         Reference in which to return the max PCIe link generation
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a maxLinkWidth has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a maxLinkWidth is null
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if PCIe link information is not available
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetMaxPcieLinkWidth
nvmlDeviceGetMaxPcieLinkWidthrD  rK  s       r   rN  rN  1  s=    . 
!!@	ABHE
VU5\
"CS$$r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves bitmask of supported clocks throttle reasons that can be returned by
 * \ref nvmlDeviceGetCurrentClocksThrottleReasons
 *
 * For all fully supported products.
 *
 * This method is not supported in virtual machines running virtual GPU (vGPU).
 *
 * @param device                               The identifier of the target device
 * @param supportedClocksThrottleReasons       Reference in which to return bitmask of supported
 *                                              clocks throttle reasons
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a supportedClocksThrottleReasons has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a supportedClocksThrottleReasons is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlClocksThrottleReasons
 * @see nvmlDeviceGetCurrentClocksThrottleReasons
 */
nvmlReturn_t DECLDIR nvmlDeviceGetSupportedClocksThrottleReasons
+nvmlDeviceGetSupportedClocksThrottleReasonsr4  r;  	c_reasonsr  r/  s       r   rP  rP  O  s>    4 }I	 !N	OB
VU9%
&CS	((r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves current clocks throttling reasons.
 *
 * For all fully supported products.
 *
 * \note More than one bit can be enabled at the same time. Multiple reasons can be affecting clocks at once.
 *
 * @param device                                The identifier of the target device
 * @param clocksThrottleReasons                 Reference in which to return bitmask of active clocks throttle
 *                                                  reasons
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a clocksThrottleReasons has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clocksThrottleReasons is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlClocksThrottleReasons
 * @see nvmlDeviceGetSupportedClocksThrottleReasons
 */
nvmlReturn_t DECLDIR nvmlDeviceGetCurrentClocksThrottleReasons
)nvmlDeviceGetCurrentClocksThrottleReasonsr4  rQ  s       r   rT  rT  p  s>    4 }I	 !L	MB
VU9%
&CS	((r   c                     [        S5      n[        5       nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Retrieves the NVML index of this device.
 *
 * For all products.
 *
 * Valid indices are derived from the \a accessibleDevices count returned by
 *   \ref nvmlDeviceGetCount(). For example, if \a accessibleDevices is 2 the valid indices
 *   are 0 and 1, corresponding to GPU 0 and GPU 1.
 *
 * The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it
 *   is recommended that devices be looked up by their PCI ids or GPU UUID. See
 *   \ref nvmlDeviceGetHandleByPciBusId() and \ref nvmlDeviceGetHandleByUUID().
 *
 * Note: The NVML index may not correlate with other APIs, such as the CUDA device index.
 *
 * @param device                               The identifier of the target device
 * @param index                                Reference in which to return the NVML index of the device
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a index has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a index is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetHandleByIndex()
 * @see nvmlDeviceGetCount()
 */
nvmlReturn_t DECLDIR nvmlDeviceGetIndex
nvmlDeviceGetIndexrD  )r;  r  r  r/  s       r   rV  rV    s>    @ 
!!5	6BhG
VU7^
$CS&&r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Queries the state of per process accounting mode.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * See \ref nvmlDeviceGetAccountingStats for more details.
 * See \ref nvmlDeviceSetAccountingMode
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Reference in which to return the current accounting mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the mode has been successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode are NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetAccountingMode
nvmlDeviceGetAccountingModern  rp  s       r   rX  rX    s>    ,  !F	 !>	?B
VU6]
#CS%%r   c                 T    [        S5      nU" U [        U5      5      n[        U5        g)aU  
/**
 * Enables or disables per process accounting.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Requires root/admin permissions.
 *
 * @note This setting is not persistent and will default to disabled after driver unloads.
 *       Enable persistence mode to be sure the setting doesn't switch off to disabled.
 *
 * @note Enabling accounting mode has no negative impact on the GPU performance.
 *
 * @note Disabling accounting clears all accounting pids information.
 *
 * See \ref nvmlDeviceGetAccountingMode
 * See \ref nvmlDeviceGetAccountingStats
 * See \ref nvmlDeviceClearAccountingPids
 *
 * @param device                               The identifier of the target device
 * @param mode                                 The target accounting mode
 *
 * @return
 *         - \ref NVML_SUCCESS                 if the new mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device or \a mode are invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceSetAccountingMode
nvmlDeviceSetAccountingModeNr  r  s       r   rZ  rZ    s-    @ 
!!>	?B
V'-
.CSr   c                 @    [        S5      nU" U 5      n[        U5        g)a  
/**
 * Clears accounting information about all processes that have already terminated.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Requires root/admin permissions.
 *
 * See \ref nvmlDeviceGetAccountingMode
 * See \ref nvmlDeviceGetAccountingStats
 * See \ref nvmlDeviceSetAccountingMode
 *
 * @param device                               The identifier of the target device
 *
 * @return
 *         - \ref NVML_SUCCESS                 if accounting information has been cleared
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device are invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceClearAccountingPids
nvmlDeviceClearAccountingPidsNrU  rV  s      r   r\  r\    s#    0 
!!@	AB
V*CSr   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        UR
                  [        R                  :X  a  SUl        [        U5      $ )a  
/**
 * Queries process's accounting stats.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * Accounting stats capture GPU utilization and other statistics across the lifetime of a process.
 * Accounting stats can be queried during life time of the process and after its termination.
 * The time field in \ref nvmlAccountingStats_t is reported as 0 during the lifetime of the process and
 * updated to actual running time after its termination.
 * Accounting stats are kept in a circular buffer, newly created processes overwrite information about old
 * processes.
 *
 * See \ref nvmlAccountingStats_t for description of each returned metric.
 * List of processes that can be queried can be retrieved from \ref nvmlDeviceGetAccountingPids.
 *
 * @note Accounting Mode needs to be on. See \ref nvmlDeviceGetAccountingMode.
 * @note Only compute and graphics applications stats can be queried. Monitoring applications stats can't be
 *         queried since they don't contribute to GPU utilization.
 * @note In case of pid collision stats of only the latest process (that terminated last) will be reported
 *
 * @warning On Kepler devices per process statistics are accurate only if there's one process running on a GPU.
 *
 * @param device                               The identifier of the target device
 * @param pid                                  Process Id of the target process to query stats for
 * @param stats                                Reference in which to return the process's accounting stats
 *
 * @return
 *         - \ref NVML_SUCCESS                 if stats have been successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a stats are NULL
 *         - \ref NVML_ERROR_NOT_FOUND         if process stats were not found
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature or accounting mode is disabled
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetAccountingBufferSize
 */
nvmlReturn_t DECLDIR nvmlDeviceGetAccountingStats
nvmlDeviceGetAccountingStatsN)	r  r9  r   r  r0  r  r   r   rU  )r;  r  statsr  r/  s        r   r^  r^    s^    P $%E	 !?	@B
VVC[%,
/CS B H HH#r   c                     [        [        U 5      5      n[         UR                  -  " 5       n[        S5      nU" U [	        U5      U5      n[        U5        [        [        [        USUR                   5      5      $ )a  
/**
 * Queries list of processes that can be queried for accounting stats. The list of processes returned
 * can be in running or terminated state.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * To just query the number of processes ready to be queried, call this function with *count = 0 and
 * pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty.
 *
 * For more details see \ref nvmlDeviceGetAccountingStats.
 *
 * @note In case of PID collision some processes might not be accessible before the circular buffer is full.
 *
 * @param device                               The identifier of the target device
 * @param count                                Reference in which to provide the \a pids array size, and
 *                                               to return the number of elements ready to be queried
 * @param pids                                 Reference in which to return list of process ids
 *
 * @return
 *         - \ref NVML_SUCCESS                 if pids were successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a count is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature or accounting mode is disabled
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to
 *                                                 expected value)
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetAccountingBufferSize
 */
nvmlReturn_t DECLDIR nvmlDeviceGetAccountingPids
nvmlDeviceGetAccountingPidsr   )	r   !nvmlDeviceGetAccountingBufferSizer   r9  r  r0  listmapint)r;  r~  pidsr  r/  s        r   ra  ra  L  sh    B 4V<=EU[[ #D	 !>	?B
VU5\4
(CSCa,-..r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Returns the number of processes that the circular buffer with accounting pids can hold.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * This is the maximum number of processes that accounting information will be stored for before information
 * about oldest processes will get overwritten by information about new processes.
 *
 * @param device                               The identifier of the target device
 * @param bufferSize                           Reference in which to provide the size (in number of elements)
 *                                               of the circular buffer for accounting stats.
 *
 * @return
 *         - \ref NVML_SUCCESS                 if buffer size was successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a bufferSize is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature or accounting mode is disabled
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetAccountingStats
 * @see nvmlDeviceGetAccountingPids
 */
nvmlReturn_t DECLDIR nvmlDeviceGetAccountingBufferSize
rb  )r   r9  r  r0  re  r   )r;  
bufferSizer  r/  s       r   rb  rb  u  s@    4 J	 !D	EB
VU:&
'CSz  r   c                    [        U5      n[        S5      n[        S5      nU" X[        U5      S5      nU[        :w  a  U[
        :w  a  [        U5      eUR                  S-  S-   Ul        [        UR                  -  nU" 5       nU" X[        U5      U5      n[        U5        [        [        [        USUR                   5      5      $ )a  
/**
 * Returns the list of retired pages by source, including pages that are pending retirement
 * The address information provided from this API is the hardware address of the page that was retired.  Note
 * that this does not match the virtual address used in CUDA, but will match the address information in XID 63
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                            The identifier of the target device
 * @param cause                             Filter page addresses by cause of retirement
 * @param pageCount                         Reference in which to provide the \a addresses buffer size, and
 *                                          to return the number of retired pages that match \a cause
 *                                          Set to 0 to query the size without allocating an \a addresses buffer
 * @param addresses                         Buffer to write the page addresses into
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a pageCount was populated and \a addresses was filled
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the
 *                                             matching page addresses.  \a pageCount is set to the needed size.
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or
 *                                             \a addresses is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetRetiredPages
r   nvmlDeviceGetRetiredPagesNr   r   )_nvmlPageRetirementCause_tr   r9  r  r   r   r   r   r  r0  rc  rd  re  )r  sourceFilterc_sourcer  r  r/  
page_arrayc_pagess           r   rj  rj    s    : *,7HQiG	 !<	=B VuW~t
4C 
		,	,n
 MMA%)GMw}},JlG
VuW~w
7CSC7==1233r   c                     [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        UR
                  5      $ )a  
/**
 * Check if any pages are pending retirement and need a reboot to fully retire.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                            The identifier of the target device
 * @param isPending                         Reference in which to return the pending status
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a isPending was populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a isPending is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetRetiredPagesPendingStatus
&nvmlDeviceGetRetiredPagesPendingStatus)ro  r9  r  r0  re  r   )r  	c_pendingr  r/  s       r   rq  rq    s?    ( #$I	 !I	JB
VU9%
&CSyr   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        [        UR                  5      $ )a  
/**
 * Retrieves the root/admin permissions on the target API. See \a nvmlRestrictedAPI_t for the list of supported APIs.
 * If an API is restricted only root users can call that API. See \a nvmlDeviceSetAPIRestriction to change current permissions.
 *
 * For all fully supported products.
 *
 * @param device                               The identifier of the target device
 * @param apiType                              Target API type for this operation
 * @param isRestricted                         Reference in which to return the current restriction
 *                                             NVML_FEATURE_ENABLED indicates that the API is root-only
 *                                             NVML_FEATURE_DISABLED indicates that the API is accessible to all users
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a isRestricted has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a apiType incorrect or \a isRestricted is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device or the device does not support
 *                                                 the feature that is being queried (E.G. Enabling/disabling Auto Boosted clocks is
 *                                                 not supported by the device)
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlRestrictedAPI_t
 */
nvmlReturn_t DECLDIR nvmlDeviceGetAPIRestriction
nvmlDeviceGetAPIRestriction)ro  r9  _nvmlRestrictedAPI_tr  r0  re  r   )r  apiTypec_permissionr  r/  s        r   rt  rt    sI    8 &'L	 !>	?B
V)'2E,4G
HCS|!!""r   c                 h    [        S5      nU" U [        U5      [        U5      5      n[        U5        g)a  
/**
 * Changes the root/admin restructions on certain APIs. See \a nvmlRestrictedAPI_t for the list of supported APIs.
 * This method can be used by a root/admin user to give non-root/admin access to certain otherwise-restricted APIs.
 * The new setting lasts for the lifetime of the NVIDIA driver; it is not persistent. See \a nvmlDeviceGetAPIRestriction
 * to query the current restriction settings.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Requires root/admin permissions.
 *
 * @param device                               The identifier of the target device
 * @param apiType                              Target API type for this operation
 * @param isRestricted                         The target restriction
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a isRestricted has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a apiType incorrect
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support changing API restrictions or the device does not support
 *                                                 the feature that api restrictions are being set for (E.G. Enabling/disabling auto
 *                                                 boosted clocks is not supported by the device)
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlRestrictedAPI_t
 */
nvmlReturn_t DECLDIR nvmlDeviceSetAPIRestriction
nvmlDeviceSetAPIRestrictionN)r9  ru  ro  r0  )r;  rv  isRestrictedr  r/  s        r   ry  ry    s4    < 
!!>	?B
V)'24F|4T
UCSr   c                 |    [        5       n[        S5      nU" U [        U5      5      n[        U5        [	        U5      $ )a  
/**
 * Get Bridge Chip Information for all the bridge chips on the board.
 *
 * For all fully supported products.
 * Only applicable to multi-GPU products.
 *
 * @param device                                The identifier of the target device
 * @param bridgeHierarchy                       Reference to the returned bridge chip Hierarchy
 *
 * @return
 *         - \ref NVML_SUCCESS                 if bridge chip exists
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a bridgeInfo is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if bridge chip not supported on the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
nvmlReturn_t DECLDIR nvmlDeviceGetBridgeChipInfo
nvmlDeviceGetBridgeChipInfo)r  r9  r  r0  rU  )r;  bridgeHierarchyr  r/  s       r   r|  r|  ,  s;    , 23O	 !>	?B
VU?+
,CS((r   c           	         [        U5      n[        U5      n[        S5      n[        5       n[	        S5      nU" XU[        U5      [        U5      S5      nU[        :w  a  [        U5      eUR                  [        -  n	U	" 5       n
U" XU[        U5      [        U5      U
5      n[        U5        UR                  U
SUR                   4$ )aJ
  
/**
 * Gets recent samples for the GPU.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * Based on type, this method can be used to fetch the power, utilization or clock samples maintained in the buffer by
 * the driver.
 *
 * Power, Utilization and Clock samples are returned as type "unsigned int" for the union nvmlValue_t.
 *
 * To get the size of samples that user needs to allocate, the method is invoked with samples set to NULL.
 * The returned samplesCount will provide the number of samples that can be queried. The user needs to
 * allocate the buffer with size as samplesCount * sizeof(nvmlSample_t).
 *
 * lastSeenTimeStamp represents CPU timestamp in microseconds. Set it to 0 to fetch all the samples maintained by the
 * underlying buffer. Set lastSeenTimeStamp to one of the timeStamps retrieved from the date of the previous query
 * to get more recent samples.
 *
 * This method fetches the number of entries which can be accommodated in the provided samples array, and the
 * reference samplesCount is updated to indicate how many samples were actually retrieved. The advantage of using this
 * method for samples in contrast to polling via existing methods is to get get higher frequency data at lower polling cost.
 *
 * @param device                        The identifier for the target device
 * @param type                          Type of sampling event
 * @param lastSeenTimeStamp             Return only samples with timestamp greater than lastSeenTimeStamp.
 * @param sampleValType                 Output parameter to represent the type of sample value as described in nvmlSampleVal_t
 * @param sampleCount                   Reference to provide the number of elements which can be queried in samples array
 * @param samples                       Reference in which samples are returned

 * @return
 *         - \ref NVML_SUCCESS                 if samples are successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a samplesCount is NULL or
 *                                             reference to \a sampleCount is 0 for non null \a samples
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_NOT_FOUND         if sample entries are not found
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetSamples
r   nvmlDeviceGetSamplesN)_nvmlSamplingType_tr  r   _nvmlValueType_tr9  r  r   r   r   r  r0  )r  sampling_typer  c_sampling_typec_time_stampc_sample_countc_sample_value_typer  r/  sampleArray	c_sampless              r   r  r  I  s    V *-8Oy)LAYN*,	 !7	8B VlE:M4NPUVdPegk
lC 	|n &&7KI
VlU;N5OQVWeQfhq
rCS%%y>3G3G'HIIr   c                     [        U5      n[        5       n[        S5      nU" X[        U5      5      n[	        U5        [        U5      $ )a  
/**
 * Gets the duration of time during which the device was throttled (lower than requested clocks) due to power
 * or thermal constraints.
 *
 * The method is important to users who are tying to understand if their GPUs throttle at any point during their applications. The
 * difference in violation times at two different reference times gives the indication of GPU throttling event.
 *
 * Violation for thermal capping is not supported at this time.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param perfPolicyType                       Represents Performance policy which can trigger GPU throttling
 * @param violTime                             Reference to which violation time related information is returned
 *
 *
 * @return
 *         - \ref NVML_SUCCESS                 if violation time is successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a perfPolicyType is invalid, or \a violTime is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *
 */
nvmlReturn_t DECLDIR nvmlDeviceGetViolationStatus
nvmlDeviceGetViolationStatus)_nvmlPerfPolicyType_tr  r9  r  r0  rU  )r  perfPolicyTypec_perfPolicy_type
c_violTimer  r/  s         r   r  r    sH    8 .n=&(J	 !?	@B Vj(9
:CS
##r   c                     [        5       n[        S5      nU" U [        U5      [        U5      5      n[	        U5        [        UR                  5      $ )a  
/**
 * Retrieve PCIe utilization information.
 * This function is querying a byte counter over a 20ms interval and thus is the
 *   PCIe throughput over that interval.
 *
 * For Maxwell &tm; or newer fully supported devices.
 *
 * This method is not supported in virtual machines running virtual GPU (vGPU).
 *
 * @param device                               The identifier of the target device
 * @param counter                              The specific counter that should be queried \ref nvmlPcieUtilCounter_t
 * @param value                                Reference in which to return throughput in KB/s
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a value has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device or \a counter is invalid, or \a value is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
nvmlReturn_t DECLDIR nvmlDeviceGetPcieThroughput
nvmlDeviceGetPcieThroughput)r   r9  _nvmlPcieUtilCounter_tr  r0  rU  r   )r  counterr  r  r/  s        r   r  r    sE    2 XF	 !>	?B
V+G4eFm
DCS%%r   c                 H   [        S5      n[        S5      nU" U [        U5      S5      nU[        :w  a  [	        U5      e[        UR                  5        [        UR                  -  nU" 5       nU" U [        U5      U5      n[        U5        [        USUR                   5      $ )a~  
/**
 * Retrieve the set of GPUs that have a CPU affinity with the given CPU number
 * For all products.
 * Supported on Linux only.
 *
 * @param cpuNumber                            The CPU number
 * @param count                                When zero, is set to the number of matching GPUs such that \a deviceArray
 *                                             can be malloc'd.  When non-zero, \a deviceArray will be filled with \a count
 *                                             number of device handles.
 * @param deviceArray                          An array of device handles for GPUs found with affinity to \a cpuNumber
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a deviceArray or \a count (if initially zero) has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a cpuNumber, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device or OS does not support this feature
 *         - \ref NVML_ERROR_UNKNOWN           an error has occurred in underlying topology discovery
 */
nvmlReturn_t DECLDIR nvmlSystemGetTopologyGpuSet
r   nvmlSystemGetTopologyGpuSetN)
r   r9  r  r   r   printr   r  r0  rc  )	cpuNumberr  r  r/  r#  r$  s         r   r  r    s    * QiG	 !>	?B Yg
-C
ln	'--!GMM1LI
Yg	
2CS	!GMM*++r   c                    [        S5      n[        S5      nU" X[        U5      S5      nU[        :w  a  [	        U5      e[
        UR                  -  nU" 5       nU" X[        U5      U5      n[        U5        [        USUR                   5      $ )a  
/**
 * Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity level
 * For all products.
 * Supported on Linux only.
 *
 * @param device                               The identifier of the first device
 * @param level                                The \ref nvmlGpuTopologyLevel_t level to search for other GPUs
 * @param count                                When zero, is set to the number of matching GPUs such that \a deviceArray
 *                                             can be malloc'd.  When non-zero, \a deviceArray will be filled with \a count
 *                                             number of device handles.
 * @param deviceArray                          An array of device handles for GPUs found at \a level
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a deviceArray or \a count (if initially zero) has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a level, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device or OS does not support this feature
 *         - \ref NVML_ERROR_UNKNOWN           an error has occurred in underlying topology discovery
 */
nvmlReturn_t DECLDIR nvmlDeviceGetTopologyNearestGpus
r    nvmlDeviceGetTopologyNearestGpusN)	r   r9  r  r   r   r  r   r0  rc  )r  levelr  r  r/  r#  r$  s          r   r  r    s    , QiG	 !C	DB VE'ND
1C
ln "GMM1LI
VE'NI
6CS	!GMM*++r   c                     [        5       n[        S5      nU" X[        U5      5      n[        U5        [	        UR
                  5      $ )a@  
/**
 * Retrieve the common ancestor for two devices
 * For all products.
 * Supported on Linux only.
 *
 * @param device1                              The identifier of the first device
 * @param device2                              The identifier of the second device
 * @param pathInfo                             A \ref nvmlGpuTopologyLevel_t that gives the path type
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a pathInfo has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device1, or \a device2 is invalid, or \a pathInfo is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device or OS does not support this feature
 *         - \ref NVML_ERROR_UNKNOWN           an error has occurred in underlying topology discovery
 */
nvmlReturn_t DECLDIR nvmlDeviceGetTopologyCommonAncestor
#nvmlDeviceGetTopologyCommonAncestor)_nvmlGpuTopologyLevel_tr9  r  r0  rU  r   )device1device2c_levelr  r/  s        r   r  r    s>    & &'G	 !F	GB
WuW~
.CS&&r   (  ctypesr   r  r  	threadingr   enumr   ro  r   r   r   rD  r   r   r   r    r!   r"   r#   r$   r   r  r)   r*   r+   r,   r-   r&   r  r1   r2   r/   r  r6   r7   r8   r9   r:   r4   r  r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   r=   _nvmlEccBitType_tNVML_SINGLE_BIT_ECCNVML_DOUBLE_BIT_ECCNVML_ECC_ERROR_TYPE_COUNTr  rL   rM   rN   rJ   r  rR   rS   rT   rP   r|  rX   rY   rZ   r[   r\   rV   r  r`   ra   r^   r  rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   rk   rb  r   r   r   r   r   _nvmlReturn_tr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ry  r   r   r   ro  r   r   r   r  r   r   r   r   rk  r   r   r   r   ru  r   r   r   r   r  r   r   r   r   r  r   r   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r  r   r   r   r   r  r   r   r   r   r   r   r   nvmlFlagDefaultnvmlFlagForcera  r^  r  r  r:  rH  r  "NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZEr  r   NVML_VALUE_NOT_AVAILABLE_uintr5  Lockr3  r  r   r   r-  r0  r  r2  r9  objectr;  rI  rL  	StructurerN  POINTERr  rU  rW  rd  rk  rq  rw  r{  r  r  r  r  r  r  r  r  r  r  r  Unionr  r  r  r  r-  nvmlEventTypeSingleBitEccErrornvmlEventTypeDoubleBitEccErrornvmlEventTypePStatenvmlEventTypeXidCriticalErrornvmlEventTypeClocknvmlEventTypeNonenvmlEventTypeAllnvmlClocksThrottleReasonGpuIdle1nvmlClocksThrottleReasonApplicationsClocksSetting)nvmlClocksThrottleReasonUserDefinedClocks"nvmlClocksThrottleReasonSwPowerCap"nvmlClocksThrottleReasonHwSlowdownnvmlClocksThrottleReasonUnknownnvmlClocksThrottleReasonNonenvmlClocksThrottleReasonAllr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r   r'  r*  r,  r0  r7  r9  r=  r@  rC  rG  rJ  rO  rT  rX  rZ  r]  r`  re  rh  rk  rm  rs  ru  rx  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r%  r'  r*  r,  r0  r3  r7  r;  r=  rC  rH  rJ  rN  rP  rT  rV  rX  rZ  r\  r^  ra  rb  rj  rq  rt  ry  r|  r  r  r  r  r  r  r
   r   r   <module>r     s
  @   
 	        
        d   & &' #&' #%& "%& "#$  )$ )$ #   t   
  $% ! %& "     !  !  %& "%& "&' ##$     
#4 
#         
$4 
$   #$  %& "  %D %,     d       D .      $      !"     !     !  " !     %' "   $& ! K4 K\ 4    4  !  4  $ 23 /<= 9#$  	) 	)  -. *./ + "$ "     #4 #
      ! %& "#$   d        #$    $& !%' "  4  B     "#           8      4  !       T 2  +- '! )+ &') $! !# (* %%' "%0_ " &r
  nn 0)	 0)f>8   !% 2' '	) 	*+G) GD* * ) - / 	I 	./' 0"( "", "&&- &0 "5 0 #- #+ E ( / 	i 	 23 %7 %7 %7 %7 %7 %7 (9(F)G(F)G )<)< );	);
 )F)F  -? 4F 14e ),> ",> ",> ,> /K/N0O/`0a 0R0R 0R	0R
 0O0O $+ $	1 	.b""J F)6&<)8)Z$'L1f( T0!d, \0&d,"^
'2#j2'hg RK Z9 vC J&>$B*8&6(@$@+>80.6&B%)P!)H*@0&>&D 'D 6'<'B':'>3l4l'>&:&:(<(8$*L'B0>':':'>5D44"B'>&<#5L++&'R-"`*'X >2828(4"5J//)>ENEN#9N"H$L%N#J'R.`$N$P.b F F$N4+\,@%P0$:#6#<%6%<)B)B$'P&:#L</d&/R!B14h 6 #F!H):<J~#$L&@#,L$,N'r   