static NVML() { // Indicate to search libraries in // - application directory // - paths set using AddDllDirectory or SetDllDirectory // - %windows%\system32 SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); // Add the directory of the native dll AddDllDirectory(@"C:\Program Files\NVIDIA Corporation\NVSMI"); nvmlInit = CreateDelegate <nvmlInitDelegate>( "nvmlInit"); nvmlInit_v2 = CreateDelegate <nvmlInit_v2Delegate>( "nvmlInit_v2"); NvmlShutdown = CreateDelegate <nvmlShutdownDelegate>( "nvmlShutdown"); NvmlDeviceGetHandleByPciBusId = CreateDelegate <nvmlDeviceGetHandleByPciBusIdDelegate>( "nvmlDeviceGetHandleByPciBusId_v2"); NvmlDeviceGetPowerUsage = CreateDelegate <nvmlDeviceGetPowerUsageDelegate>( "nvmlDeviceGetPowerUsage"); NvmlDeviceGetPcieThroughput = CreateDelegate <nvmlDeviceGetPcieThroughputDelegate>( "nvmlDeviceGetPcieThroughput"); }
static NVML() { nvmlInit = CreateDelegate <nvmlInitDelegate>( "nvmlInit"); nvmlInit_v2 = CreateDelegate <nvmlInit_v2Delegate>( "nvmlInit_v2"); NvmlShutdown = CreateDelegate <nvmlShutdownDelegate>( "nvmlShutdown"); NvmlDeviceGetHandleByPciBusId = CreateDelegate <nvmlDeviceGetHandleByPciBusIdDelegate>( "nvmlDeviceGetHandleByPciBusId_v2"); NvmlDeviceGetPowerUsage = CreateDelegate <nvmlDeviceGetPowerUsageDelegate>( "nvmlDeviceGetPowerUsage"); NvmlDeviceGetPcieThroughput = CreateDelegate <nvmlDeviceGetPcieThroughputDelegate>( "nvmlDeviceGetPcieThroughput"); }