diff --git a/go.mod b/go.mod index 111ddf58..18e05384 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.2 require ( github.com/NVIDIA/go-nvlib v0.2.0 - github.com/NVIDIA/go-nvml v0.12.0-3 + github.com/NVIDIA/go-nvml v0.12.0-4 github.com/google/uuid v1.6.0 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index fb828028..6f606a8b 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/NVIDIA/go-nvlib v0.2.0 h1:roq+SDstbP1fcy2XVH7wB2Gz2/Ud7Q+NGQYOcVITVrA= github.com/NVIDIA/go-nvlib v0.2.0/go.mod h1:kFuLNTyD1tF6FbRFlk+/EdUW5BrkE+v1Y3A3/9zKSjA= -github.com/NVIDIA/go-nvml v0.12.0-3 h1:QwfjYxEqIQVRhl8327g2Y3ZvKResPydpGSKtCIIK9jE= -github.com/NVIDIA/go-nvml v0.12.0-3/go.mod h1:SOufGc5Wql+cxrIZ8RyJwVKDYxfbs4WPkHXqadcbfvA= +github.com/NVIDIA/go-nvml v0.12.0-4 h1:BvPjnjJr6qje0zov57Md7TwEA8i/12kZeUQIpyWzTEE= +github.com/NVIDIA/go-nvml v0.12.0-4/go.mod h1:8Llmj+1Rr+9VGGwZuRer5N/aCjxGuR5nPb/9ebBiIEQ= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go index 4885e8e9..fdf27bda 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go @@ -16,22 +16,41 @@ package nvml -// Library defines a set of functions defined on the underlying dynamic library. -type Library interface { - Lookup(string) error +// ExtendedInterface defines a set of extensions to the core NVML API. +// +// TODO: For now the list of methods in this interface need to be kept in sync +// with the list of excluded methods for the Interface type in +// gen/nvml/generateapi.go. In the future we should automate this. +// +//go:generate moq -out mock/extendedinterface.go -pkg mock . ExtendedInterface:ExtendedInterface +type ExtendedInterface interface { + LookupSymbol(string) error } -// dynamicLibrary is an interface for abstacting the underlying library. -// This also allows for mocking and testing. +// libraryOptions hold the paramaters than can be set by a LibraryOption +type libraryOptions struct { + path string + flags int +} + +// LibraryOption represents a functional option to configure the underlying NVML library +type LibraryOption func(*libraryOptions) -//go:generate moq -stub -out dynamicLibrary_mock.go . dynamicLibrary -type dynamicLibrary interface { - Lookup(string) error - Open() error - Close() error +// WithLibraryPath provides an option to set the library name to be used by the NVML library. +func WithLibraryPath(path string) LibraryOption { + return func(o *libraryOptions) { + o.path = path + } } -// Interface represents the interface for the NVML library. -type Interface interface { - GetLibrary() Library +// SetLibraryOptions applies the specified options to the NVML library. +// If this is called when a library is already loaded, an error is raised. +func SetLibraryOptions(opts ...LibraryOption) error { + libnvml.Lock() + defer libnvml.Unlock() + if libnvml.refcount != 0 { + return errLibraryAlreadyLoaded + } + libnvml.init(opts...) + return nil } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers_static.go similarity index 89% rename from vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers.go rename to vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers_static.go index b04f3663..1f30eaae 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers_static.go @@ -44,6 +44,17 @@ func uint32SliceToIntSlice(s []uint32) []int { return ret } +func convertSlice[T any, I any](input []T) []I { + output := make([]I, len(input)) + for i, obj := range input { + switch v := any(obj).(type) { + case I: + output[i] = v + } + } + return output +} + // packPCharString creates a Go string backed by *C.char and avoids copying. func packPCharString(p *C.char) (raw string) { if p != nil && *p != 0 { diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const_gen.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const_static.go similarity index 100% rename from vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const_gen.go rename to vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const_static.go diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go index 91a7baa9..7ee5e551 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go @@ -21,2632 +21,2705 @@ import ( // EccBitType type EccBitType = MemoryErrorType +// GpuInstanceInfo includes an interface type for Device instead of nvmlDevice +type GpuInstanceInfo struct { + Device Device + Id uint32 + ProfileId uint32 + Placement GpuInstancePlacement +} + +func (g GpuInstanceInfo) convert() nvmlGpuInstanceInfo { + out := nvmlGpuInstanceInfo{ + Device: g.Device.(nvmlDevice), + Id: g.Id, + ProfileId: g.ProfileId, + Placement: g.Placement, + } + return out +} + +func (g nvmlGpuInstanceInfo) convert() GpuInstanceInfo { + out := GpuInstanceInfo{ + Device: g.Device, + Id: g.Id, + ProfileId: g.ProfileId, + Placement: g.Placement, + } + return out +} + +// ComputeInstanceInfo includes an interface type for Device instead of nvmlDevice +type ComputeInstanceInfo struct { + Device Device + GpuInstance GpuInstance + Id uint32 + ProfileId uint32 + Placement ComputeInstancePlacement +} + +func (c ComputeInstanceInfo) convert() nvmlComputeInstanceInfo { + out := nvmlComputeInstanceInfo{ + Device: c.Device.(nvmlDevice), + GpuInstance: c.GpuInstance.(nvmlGpuInstance), + Id: c.Id, + ProfileId: c.ProfileId, + Placement: c.Placement, + } + return out +} + +func (c nvmlComputeInstanceInfo) convert() ComputeInstanceInfo { + out := ComputeInstanceInfo{ + Device: c.Device, + GpuInstance: c.GpuInstance, + Id: c.Id, + ProfileId: c.ProfileId, + Placement: c.Placement, + } + return out +} + // nvml.DeviceGetCount() -func DeviceGetCount() (int, Return) { - var DeviceCount uint32 - ret := nvmlDeviceGetCount(&DeviceCount) - return int(DeviceCount), ret +func (l *library) DeviceGetCount() (int, Return) { + var deviceCount uint32 + ret := nvmlDeviceGetCount(&deviceCount) + return int(deviceCount), ret } // nvml.DeviceGetHandleByIndex() -func DeviceGetHandleByIndex(Index int) (Device, Return) { - var Device Device - ret := nvmlDeviceGetHandleByIndex(uint32(Index), &Device) - return Device, ret +func (l *library) DeviceGetHandleByIndex(index int) (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetHandleByIndex(uint32(index), &device) + return device, ret } // nvml.DeviceGetHandleBySerial() -func DeviceGetHandleBySerial(Serial string) (Device, Return) { - var Device Device - ret := nvmlDeviceGetHandleBySerial(Serial+string(rune(0)), &Device) - return Device, ret +func (l *library) DeviceGetHandleBySerial(serial string) (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetHandleBySerial(serial+string(rune(0)), &device) + return device, ret } // nvml.DeviceGetHandleByUUID() -func DeviceGetHandleByUUID(Uuid string) (Device, Return) { - var Device Device - ret := nvmlDeviceGetHandleByUUID(Uuid+string(rune(0)), &Device) - return Device, ret +func (l *library) DeviceGetHandleByUUID(uuid string) (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetHandleByUUID(uuid+string(rune(0)), &device) + return device, ret } // nvml.DeviceGetHandleByPciBusId() -func DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) { - var Device Device - ret := nvmlDeviceGetHandleByPciBusId(PciBusId+string(rune(0)), &Device) - return Device, ret +func (l *library) DeviceGetHandleByPciBusId(pciBusId string) (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetHandleByPciBusId(pciBusId+string(rune(0)), &device) + return device, ret } // nvml.DeviceGetName() -func DeviceGetName(Device Device) (string, Return) { - Name := make([]byte, DEVICE_NAME_V2_BUFFER_SIZE) - ret := nvmlDeviceGetName(Device, &Name[0], DEVICE_NAME_V2_BUFFER_SIZE) - return string(Name[:clen(Name)]), ret +func (l *library) DeviceGetName(device Device) (string, Return) { + return device.GetName() } -func (Device Device) GetName() (string, Return) { - return DeviceGetName(Device) +func (device nvmlDevice) GetName() (string, Return) { + name := make([]byte, DEVICE_NAME_V2_BUFFER_SIZE) + ret := nvmlDeviceGetName(device, &name[0], DEVICE_NAME_V2_BUFFER_SIZE) + return string(name[:clen(name)]), ret } // nvml.DeviceGetBrand() -func DeviceGetBrand(Device Device) (BrandType, Return) { - var _type BrandType - ret := nvmlDeviceGetBrand(Device, &_type) - return _type, ret +func (l *library) DeviceGetBrand(device Device) (BrandType, Return) { + return device.GetBrand() } -func (Device Device) GetBrand() (BrandType, Return) { - return DeviceGetBrand(Device) +func (device nvmlDevice) GetBrand() (BrandType, Return) { + var brandType BrandType + ret := nvmlDeviceGetBrand(device, &brandType) + return brandType, ret } // nvml.DeviceGetIndex() -func DeviceGetIndex(Device Device) (int, Return) { - var Index uint32 - ret := nvmlDeviceGetIndex(Device, &Index) - return int(Index), ret +func (l *library) DeviceGetIndex(device Device) (int, Return) { + return device.GetIndex() } -func (Device Device) GetIndex() (int, Return) { - return DeviceGetIndex(Device) +func (device nvmlDevice) GetIndex() (int, Return) { + var index uint32 + ret := nvmlDeviceGetIndex(device, &index) + return int(index), ret } // nvml.DeviceGetSerial() -func DeviceGetSerial(Device Device) (string, Return) { - Serial := make([]byte, DEVICE_SERIAL_BUFFER_SIZE) - ret := nvmlDeviceGetSerial(Device, &Serial[0], DEVICE_SERIAL_BUFFER_SIZE) - return string(Serial[:clen(Serial)]), ret +func (l *library) DeviceGetSerial(device Device) (string, Return) { + return device.GetSerial() } -func (Device Device) GetSerial() (string, Return) { - return DeviceGetSerial(Device) +func (device nvmlDevice) GetSerial() (string, Return) { + serial := make([]byte, DEVICE_SERIAL_BUFFER_SIZE) + ret := nvmlDeviceGetSerial(device, &serial[0], DEVICE_SERIAL_BUFFER_SIZE) + return string(serial[:clen(serial)]), ret } // nvml.DeviceGetCpuAffinity() -func DeviceGetCpuAffinity(Device Device, NumCPUs int) ([]uint, Return) { - CpuSetSize := uint32((NumCPUs-1)/int(unsafe.Sizeof(uint(0))) + 1) - CpuSet := make([]uint, CpuSetSize) - ret := nvmlDeviceGetCpuAffinity(Device, CpuSetSize, &CpuSet[0]) - return CpuSet, ret +func (l *library) DeviceGetCpuAffinity(device Device, numCPUs int) ([]uint, Return) { + return device.GetCpuAffinity(numCPUs) } -func (Device Device) GetCpuAffinity(NumCPUs int) ([]uint, Return) { - return DeviceGetCpuAffinity(Device, NumCPUs) +func (device nvmlDevice) GetCpuAffinity(numCPUs int) ([]uint, Return) { + cpuSetSize := uint32((numCPUs-1)/int(unsafe.Sizeof(uint(0))) + 1) + cpuSet := make([]uint, cpuSetSize) + ret := nvmlDeviceGetCpuAffinity(device, cpuSetSize, &cpuSet[0]) + return cpuSet, ret } // nvml.DeviceSetCpuAffinity() -func DeviceSetCpuAffinity(Device Device) Return { - return nvmlDeviceSetCpuAffinity(Device) +func (l *library) DeviceSetCpuAffinity(device Device) Return { + return device.SetCpuAffinity() } -func (Device Device) SetCpuAffinity() Return { - return DeviceSetCpuAffinity(Device) +func (device nvmlDevice) SetCpuAffinity() Return { + return nvmlDeviceSetCpuAffinity(device) } // nvml.DeviceClearCpuAffinity() -func DeviceClearCpuAffinity(Device Device) Return { - return nvmlDeviceClearCpuAffinity(Device) +func (l *library) DeviceClearCpuAffinity(device Device) Return { + return device.ClearCpuAffinity() } -func (Device Device) ClearCpuAffinity() Return { - return DeviceClearCpuAffinity(Device) +func (device nvmlDevice) ClearCpuAffinity() Return { + return nvmlDeviceClearCpuAffinity(device) } // nvml.DeviceGetMemoryAffinity() -func DeviceGetMemoryAffinity(Device Device, NumNodes int, Scope AffinityScope) ([]uint, Return) { - NodeSetSize := uint32((NumNodes-1)/int(unsafe.Sizeof(uint(0))) + 1) - NodeSet := make([]uint, NodeSetSize) - ret := nvmlDeviceGetMemoryAffinity(Device, NodeSetSize, &NodeSet[0], Scope) - return NodeSet, ret +func (l *library) DeviceGetMemoryAffinity(device Device, numNodes int, scope AffinityScope) ([]uint, Return) { + return device.GetMemoryAffinity(numNodes, scope) } -func (Device Device) GetMemoryAffinity(NumNodes int, Scope AffinityScope) ([]uint, Return) { - return DeviceGetMemoryAffinity(Device, NumNodes, Scope) +func (device nvmlDevice) GetMemoryAffinity(numNodes int, scope AffinityScope) ([]uint, Return) { + nodeSetSize := uint32((numNodes-1)/int(unsafe.Sizeof(uint(0))) + 1) + nodeSet := make([]uint, nodeSetSize) + ret := nvmlDeviceGetMemoryAffinity(device, nodeSetSize, &nodeSet[0], scope) + return nodeSet, ret } // nvml.DeviceGetCpuAffinityWithinScope() -func DeviceGetCpuAffinityWithinScope(Device Device, NumCPUs int, Scope AffinityScope) ([]uint, Return) { - CpuSetSize := uint32((NumCPUs-1)/int(unsafe.Sizeof(uint(0))) + 1) - CpuSet := make([]uint, CpuSetSize) - ret := nvmlDeviceGetCpuAffinityWithinScope(Device, CpuSetSize, &CpuSet[0], Scope) - return CpuSet, ret +func (l *library) DeviceGetCpuAffinityWithinScope(device Device, numCPUs int, scope AffinityScope) ([]uint, Return) { + return device.GetCpuAffinityWithinScope(numCPUs, scope) } -func (Device Device) GetCpuAffinityWithinScope(NumCPUs int, Scope AffinityScope) ([]uint, Return) { - return DeviceGetCpuAffinityWithinScope(Device, NumCPUs, Scope) +func (device nvmlDevice) GetCpuAffinityWithinScope(numCPUs int, scope AffinityScope) ([]uint, Return) { + cpuSetSize := uint32((numCPUs-1)/int(unsafe.Sizeof(uint(0))) + 1) + cpuSet := make([]uint, cpuSetSize) + ret := nvmlDeviceGetCpuAffinityWithinScope(device, cpuSetSize, &cpuSet[0], scope) + return cpuSet, ret } // nvml.DeviceGetTopologyCommonAncestor() -func DeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device) (GpuTopologyLevel, Return) { - var PathInfo GpuTopologyLevel - ret := nvmlDeviceGetTopologyCommonAncestor(Device1, Device2, &PathInfo) - return PathInfo, ret +func (l *library) DeviceGetTopologyCommonAncestor(device1 Device, device2 Device) (GpuTopologyLevel, Return) { + return device1.GetTopologyCommonAncestor(device2) } -func (Device1 Device) GetTopologyCommonAncestor(Device2 Device) (GpuTopologyLevel, Return) { - return DeviceGetTopologyCommonAncestor(Device1, Device2) +func (device1 nvmlDevice) GetTopologyCommonAncestor(device2 Device) (GpuTopologyLevel, Return) { + var pathInfo GpuTopologyLevel + ret := nvmlDeviceGetTopologyCommonAncestor(device1, device2.(nvmlDevice), &pathInfo) + return pathInfo, ret } // nvml.DeviceGetTopologyNearestGpus() -func DeviceGetTopologyNearestGpus(device Device, Level GpuTopologyLevel) ([]Device, Return) { - var Count uint32 - ret := nvmlDeviceGetTopologyNearestGpus(device, Level, &Count, nil) +func (l *library) DeviceGetTopologyNearestGpus(device Device, level GpuTopologyLevel) ([]Device, Return) { + return device.GetTopologyNearestGpus(level) +} + +func (device nvmlDevice) GetTopologyNearestGpus(level GpuTopologyLevel) ([]Device, Return) { + var count uint32 + ret := nvmlDeviceGetTopologyNearestGpus(device, level, &count, nil) if ret != SUCCESS { return nil, ret } - if Count == 0 { + if count == 0 { return []Device{}, ret } - DeviceArray := make([]Device, Count) - ret = nvmlDeviceGetTopologyNearestGpus(device, Level, &Count, &DeviceArray[0]) - return DeviceArray, ret -} - -func (Device Device) GetTopologyNearestGpus(Level GpuTopologyLevel) ([]Device, Return) { - return DeviceGetTopologyNearestGpus(Device, Level) + deviceArray := make([]nvmlDevice, count) + ret = nvmlDeviceGetTopologyNearestGpus(device, level, &count, &deviceArray[0]) + return convertSlice[nvmlDevice, Device](deviceArray), ret } // nvml.DeviceGetP2PStatus() -func DeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { - var P2pStatus GpuP2PStatus - ret := nvmlDeviceGetP2PStatus(Device1, Device2, P2pIndex, &P2pStatus) - return P2pStatus, ret +func (l *library) DeviceGetP2PStatus(device1 Device, device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { + return device1.GetP2PStatus(device2, p2pIndex) } -func (Device1 Device) GetP2PStatus(Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { - return DeviceGetP2PStatus(Device1, Device2, P2pIndex) +func (device1 nvmlDevice) GetP2PStatus(device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { + var p2pStatus GpuP2PStatus + ret := nvmlDeviceGetP2PStatus(device1, device2.(nvmlDevice), p2pIndex, &p2pStatus) + return p2pStatus, ret } // nvml.DeviceGetUUID() -func DeviceGetUUID(Device Device) (string, Return) { - Uuid := make([]byte, DEVICE_UUID_V2_BUFFER_SIZE) - ret := nvmlDeviceGetUUID(Device, &Uuid[0], DEVICE_UUID_V2_BUFFER_SIZE) - return string(Uuid[:clen(Uuid)]), ret +func (l *library) DeviceGetUUID(device Device) (string, Return) { + return device.GetUUID() } -func (Device Device) GetUUID() (string, Return) { - return DeviceGetUUID(Device) +func (device nvmlDevice) GetUUID() (string, Return) { + uuid := make([]byte, DEVICE_UUID_V2_BUFFER_SIZE) + ret := nvmlDeviceGetUUID(device, &uuid[0], DEVICE_UUID_V2_BUFFER_SIZE) + return string(uuid[:clen(uuid)]), ret } // nvml.DeviceGetMinorNumber() -func DeviceGetMinorNumber(Device Device) (int, Return) { - var MinorNumber uint32 - ret := nvmlDeviceGetMinorNumber(Device, &MinorNumber) - return int(MinorNumber), ret +func (l *library) DeviceGetMinorNumber(device Device) (int, Return) { + return device.GetMinorNumber() } -func (Device Device) GetMinorNumber() (int, Return) { - return DeviceGetMinorNumber(Device) +func (device nvmlDevice) GetMinorNumber() (int, Return) { + var minorNumber uint32 + ret := nvmlDeviceGetMinorNumber(device, &minorNumber) + return int(minorNumber), ret } // nvml.DeviceGetBoardPartNumber() -func DeviceGetBoardPartNumber(Device Device) (string, Return) { - PartNumber := make([]byte, DEVICE_PART_NUMBER_BUFFER_SIZE) - ret := nvmlDeviceGetBoardPartNumber(Device, &PartNumber[0], DEVICE_PART_NUMBER_BUFFER_SIZE) - return string(PartNumber[:clen(PartNumber)]), ret +func (l *library) DeviceGetBoardPartNumber(device Device) (string, Return) { + return device.GetBoardPartNumber() } -func (Device Device) GetBoardPartNumber() (string, Return) { - return DeviceGetBoardPartNumber(Device) +func (device nvmlDevice) GetBoardPartNumber() (string, Return) { + partNumber := make([]byte, DEVICE_PART_NUMBER_BUFFER_SIZE) + ret := nvmlDeviceGetBoardPartNumber(device, &partNumber[0], DEVICE_PART_NUMBER_BUFFER_SIZE) + return string(partNumber[:clen(partNumber)]), ret } // nvml.DeviceGetInforomVersion() -func DeviceGetInforomVersion(Device Device, Object InforomObject) (string, Return) { - Version := make([]byte, DEVICE_INFOROM_VERSION_BUFFER_SIZE) - ret := nvmlDeviceGetInforomVersion(Device, Object, &Version[0], DEVICE_INFOROM_VERSION_BUFFER_SIZE) - return string(Version[:clen(Version)]), ret +func (l *library) DeviceGetInforomVersion(device Device, object InforomObject) (string, Return) { + return device.GetInforomVersion(object) } -func (Device Device) GetInforomVersion(Object InforomObject) (string, Return) { - return DeviceGetInforomVersion(Device, Object) +func (device nvmlDevice) GetInforomVersion(object InforomObject) (string, Return) { + version := make([]byte, DEVICE_INFOROM_VERSION_BUFFER_SIZE) + ret := nvmlDeviceGetInforomVersion(device, object, &version[0], DEVICE_INFOROM_VERSION_BUFFER_SIZE) + return string(version[:clen(version)]), ret } // nvml.DeviceGetInforomImageVersion() -func DeviceGetInforomImageVersion(Device Device) (string, Return) { - Version := make([]byte, DEVICE_INFOROM_VERSION_BUFFER_SIZE) - ret := nvmlDeviceGetInforomImageVersion(Device, &Version[0], DEVICE_INFOROM_VERSION_BUFFER_SIZE) - return string(Version[:clen(Version)]), ret +func (l *library) DeviceGetInforomImageVersion(device Device) (string, Return) { + return device.GetInforomImageVersion() } -func (Device Device) GetInforomImageVersion() (string, Return) { - return DeviceGetInforomImageVersion(Device) +func (device nvmlDevice) GetInforomImageVersion() (string, Return) { + version := make([]byte, DEVICE_INFOROM_VERSION_BUFFER_SIZE) + ret := nvmlDeviceGetInforomImageVersion(device, &version[0], DEVICE_INFOROM_VERSION_BUFFER_SIZE) + return string(version[:clen(version)]), ret } // nvml.DeviceGetInforomConfigurationChecksum() -func DeviceGetInforomConfigurationChecksum(Device Device) (uint32, Return) { - var Checksum uint32 - ret := nvmlDeviceGetInforomConfigurationChecksum(Device, &Checksum) - return Checksum, ret +func (l *library) DeviceGetInforomConfigurationChecksum(device Device) (uint32, Return) { + return device.GetInforomConfigurationChecksum() } -func (Device Device) GetInforomConfigurationChecksum() (uint32, Return) { - return DeviceGetInforomConfigurationChecksum(Device) +func (device nvmlDevice) GetInforomConfigurationChecksum() (uint32, Return) { + var checksum uint32 + ret := nvmlDeviceGetInforomConfigurationChecksum(device, &checksum) + return checksum, ret } // nvml.DeviceValidateInforom() -func DeviceValidateInforom(Device Device) Return { - return nvmlDeviceValidateInforom(Device) +func (l *library) DeviceValidateInforom(device Device) Return { + return device.ValidateInforom() } -func (Device Device) ValidateInforom() Return { - return DeviceValidateInforom(Device) +func (device nvmlDevice) ValidateInforom() Return { + return nvmlDeviceValidateInforom(device) } // nvml.DeviceGetDisplayMode() -func DeviceGetDisplayMode(Device Device) (EnableState, Return) { - var Display EnableState - ret := nvmlDeviceGetDisplayMode(Device, &Display) - return Display, ret +func (l *library) DeviceGetDisplayMode(device Device) (EnableState, Return) { + return device.GetDisplayMode() } -func (Device Device) GetDisplayMode() (EnableState, Return) { - return DeviceGetDisplayMode(Device) +func (device nvmlDevice) GetDisplayMode() (EnableState, Return) { + var display EnableState + ret := nvmlDeviceGetDisplayMode(device, &display) + return display, ret } // nvml.DeviceGetDisplayActive() -func DeviceGetDisplayActive(Device Device) (EnableState, Return) { - var IsActive EnableState - ret := nvmlDeviceGetDisplayActive(Device, &IsActive) - return IsActive, ret +func (l *library) DeviceGetDisplayActive(device Device) (EnableState, Return) { + return device.GetDisplayActive() } -func (Device Device) GetDisplayActive() (EnableState, Return) { - return DeviceGetDisplayActive(Device) +func (device nvmlDevice) GetDisplayActive() (EnableState, Return) { + var isActive EnableState + ret := nvmlDeviceGetDisplayActive(device, &isActive) + return isActive, ret } // nvml.DeviceGetPersistenceMode() -func DeviceGetPersistenceMode(Device Device) (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetPersistenceMode(Device, &Mode) - return Mode, ret +func (l *library) DeviceGetPersistenceMode(device Device) (EnableState, Return) { + return device.GetPersistenceMode() } -func (Device Device) GetPersistenceMode() (EnableState, Return) { - return DeviceGetPersistenceMode(Device) +func (device nvmlDevice) GetPersistenceMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetPersistenceMode(device, &mode) + return mode, ret } // nvml.DeviceGetPciInfo() -func DeviceGetPciInfo(Device Device) (PciInfo, Return) { - var Pci PciInfo - ret := nvmlDeviceGetPciInfo(Device, &Pci) - return Pci, ret +func (l *library) DeviceGetPciInfo(device Device) (PciInfo, Return) { + return device.GetPciInfo() } -func (Device Device) GetPciInfo() (PciInfo, Return) { - return DeviceGetPciInfo(Device) +func (device nvmlDevice) GetPciInfo() (PciInfo, Return) { + var pci PciInfo + ret := nvmlDeviceGetPciInfo(device, &pci) + return pci, ret } // nvml.DeviceGetMaxPcieLinkGeneration() -func DeviceGetMaxPcieLinkGeneration(Device Device) (int, Return) { - var MaxLinkGen uint32 - ret := nvmlDeviceGetMaxPcieLinkGeneration(Device, &MaxLinkGen) - return int(MaxLinkGen), ret +func (l *library) DeviceGetMaxPcieLinkGeneration(device Device) (int, Return) { + return device.GetMaxPcieLinkGeneration() } -func (Device Device) GetMaxPcieLinkGeneration() (int, Return) { - return DeviceGetMaxPcieLinkGeneration(Device) +func (device nvmlDevice) GetMaxPcieLinkGeneration() (int, Return) { + var maxLinkGen uint32 + ret := nvmlDeviceGetMaxPcieLinkGeneration(device, &maxLinkGen) + return int(maxLinkGen), ret } // nvml.DeviceGetMaxPcieLinkWidth() -func DeviceGetMaxPcieLinkWidth(Device Device) (int, Return) { - var MaxLinkWidth uint32 - ret := nvmlDeviceGetMaxPcieLinkWidth(Device, &MaxLinkWidth) - return int(MaxLinkWidth), ret +func (l *library) DeviceGetMaxPcieLinkWidth(device Device) (int, Return) { + return device.GetMaxPcieLinkWidth() } -func (Device Device) GetMaxPcieLinkWidth() (int, Return) { - return DeviceGetMaxPcieLinkWidth(Device) +func (device nvmlDevice) GetMaxPcieLinkWidth() (int, Return) { + var maxLinkWidth uint32 + ret := nvmlDeviceGetMaxPcieLinkWidth(device, &maxLinkWidth) + return int(maxLinkWidth), ret } // nvml.DeviceGetCurrPcieLinkGeneration() -func DeviceGetCurrPcieLinkGeneration(Device Device) (int, Return) { - var CurrLinkGen uint32 - ret := nvmlDeviceGetCurrPcieLinkGeneration(Device, &CurrLinkGen) - return int(CurrLinkGen), ret +func (l *library) DeviceGetCurrPcieLinkGeneration(device Device) (int, Return) { + return device.GetCurrPcieLinkGeneration() } -func (Device Device) GetCurrPcieLinkGeneration() (int, Return) { - return DeviceGetCurrPcieLinkGeneration(Device) +func (device nvmlDevice) GetCurrPcieLinkGeneration() (int, Return) { + var currLinkGen uint32 + ret := nvmlDeviceGetCurrPcieLinkGeneration(device, &currLinkGen) + return int(currLinkGen), ret } // nvml.DeviceGetCurrPcieLinkWidth() -func DeviceGetCurrPcieLinkWidth(Device Device) (int, Return) { - var CurrLinkWidth uint32 - ret := nvmlDeviceGetCurrPcieLinkWidth(Device, &CurrLinkWidth) - return int(CurrLinkWidth), ret +func (l *library) DeviceGetCurrPcieLinkWidth(device Device) (int, Return) { + return device.GetCurrPcieLinkWidth() } -func (Device Device) GetCurrPcieLinkWidth() (int, Return) { - return DeviceGetCurrPcieLinkWidth(Device) +func (device nvmlDevice) GetCurrPcieLinkWidth() (int, Return) { + var currLinkWidth uint32 + ret := nvmlDeviceGetCurrPcieLinkWidth(device, &currLinkWidth) + return int(currLinkWidth), ret } // nvml.DeviceGetPcieThroughput() -func DeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter) (uint32, Return) { - var Value uint32 - ret := nvmlDeviceGetPcieThroughput(Device, Counter, &Value) - return Value, ret +func (l *library) DeviceGetPcieThroughput(device Device, counter PcieUtilCounter) (uint32, Return) { + return device.GetPcieThroughput(counter) } -func (Device Device) GetPcieThroughput(Counter PcieUtilCounter) (uint32, Return) { - return DeviceGetPcieThroughput(Device, Counter) +func (device nvmlDevice) GetPcieThroughput(counter PcieUtilCounter) (uint32, Return) { + var value uint32 + ret := nvmlDeviceGetPcieThroughput(device, counter, &value) + return value, ret } // nvml.DeviceGetPcieReplayCounter() -func DeviceGetPcieReplayCounter(Device Device) (int, Return) { - var Value uint32 - ret := nvmlDeviceGetPcieReplayCounter(Device, &Value) - return int(Value), ret +func (l *library) DeviceGetPcieReplayCounter(device Device) (int, Return) { + return device.GetPcieReplayCounter() } -func (Device Device) GetPcieReplayCounter() (int, Return) { - return DeviceGetPcieReplayCounter(Device) +func (device nvmlDevice) GetPcieReplayCounter() (int, Return) { + var value uint32 + ret := nvmlDeviceGetPcieReplayCounter(device, &value) + return int(value), ret } // nvml.nvmlDeviceGetClockInfo() -func DeviceGetClockInfo(Device Device, _type ClockType) (uint32, Return) { - var Clock uint32 - ret := nvmlDeviceGetClockInfo(Device, _type, &Clock) - return Clock, ret +func (l *library) DeviceGetClockInfo(device Device, clockType ClockType) (uint32, Return) { + return device.GetClockInfo(clockType) } -func (Device Device) GetClockInfo(_type ClockType) (uint32, Return) { - return DeviceGetClockInfo(Device, _type) +func (device nvmlDevice) GetClockInfo(clockType ClockType) (uint32, Return) { + var clock uint32 + ret := nvmlDeviceGetClockInfo(device, clockType, &clock) + return clock, ret } // nvml.DeviceGetMaxClockInfo() -func DeviceGetMaxClockInfo(Device Device, _type ClockType) (uint32, Return) { - var Clock uint32 - ret := nvmlDeviceGetMaxClockInfo(Device, _type, &Clock) - return Clock, ret +func (l *library) DeviceGetMaxClockInfo(device Device, clockType ClockType) (uint32, Return) { + return device.GetMaxClockInfo(clockType) } -func (Device Device) GetMaxClockInfo(_type ClockType) (uint32, Return) { - return DeviceGetMaxClockInfo(Device, _type) +func (device nvmlDevice) GetMaxClockInfo(clockType ClockType) (uint32, Return) { + var clock uint32 + ret := nvmlDeviceGetMaxClockInfo(device, clockType, &clock) + return clock, ret } // nvml.DeviceGetApplicationsClock() -func DeviceGetApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetApplicationsClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (l *library) DeviceGetApplicationsClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetApplicationsClock(clockType) } -func (Device Device) GetApplicationsClock(ClockType ClockType) (uint32, Return) { - return DeviceGetApplicationsClock(Device, ClockType) +func (device nvmlDevice) GetApplicationsClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetApplicationsClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceGetDefaultApplicationsClock() -func DeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetDefaultApplicationsClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (l *library) DeviceGetDefaultApplicationsClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetDefaultApplicationsClock(clockType) } -func (Device Device) GetDefaultApplicationsClock(ClockType ClockType) (uint32, Return) { - return DeviceGetDefaultApplicationsClock(Device, ClockType) +func (device nvmlDevice) GetDefaultApplicationsClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetDefaultApplicationsClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceResetApplicationsClocks() -func DeviceResetApplicationsClocks(Device Device) Return { - return nvmlDeviceResetApplicationsClocks(Device) +func (l *library) DeviceResetApplicationsClocks(device Device) Return { + return device.ResetApplicationsClocks() } -func (Device Device) ResetApplicationsClocks() Return { - return DeviceResetApplicationsClocks(Device) +func (device nvmlDevice) ResetApplicationsClocks() Return { + return nvmlDeviceResetApplicationsClocks(device) } // nvml.DeviceGetClock() -func DeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetClock(Device, ClockType, ClockId, &ClockMHz) - return ClockMHz, ret +func (l *library) DeviceGetClock(device Device, clockType ClockType, clockId ClockId) (uint32, Return) { + return device.GetClock(clockType, clockId) } -func (Device Device) GetClock(ClockType ClockType, ClockId ClockId) (uint32, Return) { - return DeviceGetClock(Device, ClockType, ClockId) +func (device nvmlDevice) GetClock(clockType ClockType, clockId ClockId) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetClock(device, clockType, clockId, &clockMHz) + return clockMHz, ret } // nvml.DeviceGetMaxCustomerBoostClock() -func DeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetMaxCustomerBoostClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (l *library) DeviceGetMaxCustomerBoostClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetMaxCustomerBoostClock(clockType) } -func (Device Device) GetMaxCustomerBoostClock(ClockType ClockType) (uint32, Return) { - return DeviceGetMaxCustomerBoostClock(Device, ClockType) +func (device nvmlDevice) GetMaxCustomerBoostClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetMaxCustomerBoostClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceGetSupportedMemoryClocks() -func DeviceGetSupportedMemoryClocks(Device Device) (int, uint32, Return) { - var Count, ClocksMHz uint32 - ret := nvmlDeviceGetSupportedMemoryClocks(Device, &Count, &ClocksMHz) - return int(Count), ClocksMHz, ret +func (l *library) DeviceGetSupportedMemoryClocks(device Device) (int, uint32, Return) { + return device.GetSupportedMemoryClocks() } -func (Device Device) GetSupportedMemoryClocks() (int, uint32, Return) { - return DeviceGetSupportedMemoryClocks(Device) +func (device nvmlDevice) GetSupportedMemoryClocks() (int, uint32, Return) { + var count, clocksMHz uint32 + ret := nvmlDeviceGetSupportedMemoryClocks(device, &count, &clocksMHz) + return int(count), clocksMHz, ret } // nvml.DeviceGetSupportedGraphicsClocks() -func DeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz int) (int, uint32, Return) { - var Count, ClocksMHz uint32 - ret := nvmlDeviceGetSupportedGraphicsClocks(Device, uint32(MemoryClockMHz), &Count, &ClocksMHz) - return int(Count), ClocksMHz, ret +func (l *library) DeviceGetSupportedGraphicsClocks(device Device, memoryClockMHz int) (int, uint32, Return) { + return device.GetSupportedGraphicsClocks(memoryClockMHz) } -func (Device Device) GetSupportedGraphicsClocks(MemoryClockMHz int) (int, uint32, Return) { - return DeviceGetSupportedGraphicsClocks(Device, MemoryClockMHz) +func (device nvmlDevice) GetSupportedGraphicsClocks(memoryClockMHz int) (int, uint32, Return) { + var count, clocksMHz uint32 + ret := nvmlDeviceGetSupportedGraphicsClocks(device, uint32(memoryClockMHz), &count, &clocksMHz) + return int(count), clocksMHz, ret } // nvml.DeviceGetAutoBoostedClocksEnabled() -func DeviceGetAutoBoostedClocksEnabled(Device Device) (EnableState, EnableState, Return) { - var IsEnabled, DefaultIsEnabled EnableState - ret := nvmlDeviceGetAutoBoostedClocksEnabled(Device, &IsEnabled, &DefaultIsEnabled) - return IsEnabled, DefaultIsEnabled, ret +func (l *library) DeviceGetAutoBoostedClocksEnabled(device Device) (EnableState, EnableState, Return) { + return device.GetAutoBoostedClocksEnabled() } -func (Device Device) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) { - return DeviceGetAutoBoostedClocksEnabled(Device) +func (device nvmlDevice) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) { + var isEnabled, defaultIsEnabled EnableState + ret := nvmlDeviceGetAutoBoostedClocksEnabled(device, &isEnabled, &defaultIsEnabled) + return isEnabled, defaultIsEnabled, ret } // nvml.DeviceSetAutoBoostedClocksEnabled() -func DeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return { - return nvmlDeviceSetAutoBoostedClocksEnabled(Device, Enabled) +func (l *library) DeviceSetAutoBoostedClocksEnabled(device Device, enabled EnableState) Return { + return device.SetAutoBoostedClocksEnabled(enabled) } -func (Device Device) SetAutoBoostedClocksEnabled(Enabled EnableState) Return { - return DeviceSetAutoBoostedClocksEnabled(Device, Enabled) +func (device nvmlDevice) SetAutoBoostedClocksEnabled(enabled EnableState) Return { + return nvmlDeviceSetAutoBoostedClocksEnabled(device, enabled) } // nvml.DeviceSetDefaultAutoBoostedClocksEnabled() -func DeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return { - return nvmlDeviceSetDefaultAutoBoostedClocksEnabled(Device, Enabled, Flags) +func (l *library) DeviceSetDefaultAutoBoostedClocksEnabled(device Device, enabled EnableState, flags uint32) Return { + return device.SetDefaultAutoBoostedClocksEnabled(enabled, flags) } -func (Device Device) SetDefaultAutoBoostedClocksEnabled(Enabled EnableState, Flags uint32) Return { - return DeviceSetDefaultAutoBoostedClocksEnabled(Device, Enabled, Flags) +func (device nvmlDevice) SetDefaultAutoBoostedClocksEnabled(enabled EnableState, flags uint32) Return { + return nvmlDeviceSetDefaultAutoBoostedClocksEnabled(device, enabled, flags) } // nvml.DeviceGetFanSpeed() -func DeviceGetFanSpeed(Device Device) (uint32, Return) { - var Speed uint32 - ret := nvmlDeviceGetFanSpeed(Device, &Speed) - return Speed, ret +func (l *library) DeviceGetFanSpeed(device Device) (uint32, Return) { + return device.GetFanSpeed() } -func (Device Device) GetFanSpeed() (uint32, Return) { - return DeviceGetFanSpeed(Device) +func (device nvmlDevice) GetFanSpeed() (uint32, Return) { + var speed uint32 + ret := nvmlDeviceGetFanSpeed(device, &speed) + return speed, ret } // nvml.DeviceGetFanSpeed_v2() -func DeviceGetFanSpeed_v2(Device Device, Fan int) (uint32, Return) { - var Speed uint32 - ret := nvmlDeviceGetFanSpeed_v2(Device, uint32(Fan), &Speed) - return Speed, ret +func (l *library) DeviceGetFanSpeed_v2(device Device, fan int) (uint32, Return) { + return device.GetFanSpeed_v2(fan) } -func (Device Device) GetFanSpeed_v2(Fan int) (uint32, Return) { - return DeviceGetFanSpeed_v2(Device, Fan) +func (device nvmlDevice) GetFanSpeed_v2(fan int) (uint32, Return) { + var speed uint32 + ret := nvmlDeviceGetFanSpeed_v2(device, uint32(fan), &speed) + return speed, ret } // nvml.DeviceGetNumFans() -func DeviceGetNumFans(Device Device) (int, Return) { - var NumFans uint32 - ret := nvmlDeviceGetNumFans(Device, &NumFans) - return int(NumFans), ret +func (l *library) DeviceGetNumFans(device Device) (int, Return) { + return device.GetNumFans() } -func (Device Device) GetNumFans() (int, Return) { - return DeviceGetNumFans(Device) +func (device nvmlDevice) GetNumFans() (int, Return) { + var numFans uint32 + ret := nvmlDeviceGetNumFans(device, &numFans) + return int(numFans), ret } // nvml.DeviceGetTemperature() -func DeviceGetTemperature(Device Device, SensorType TemperatureSensors) (uint32, Return) { - var Temp uint32 - ret := nvmlDeviceGetTemperature(Device, SensorType, &Temp) - return Temp, ret +func (l *library) DeviceGetTemperature(device Device, sensorType TemperatureSensors) (uint32, Return) { + return device.GetTemperature(sensorType) } -func (Device Device) GetTemperature(SensorType TemperatureSensors) (uint32, Return) { - return DeviceGetTemperature(Device, SensorType) +func (device nvmlDevice) GetTemperature(sensorType TemperatureSensors) (uint32, Return) { + var temp uint32 + ret := nvmlDeviceGetTemperature(device, sensorType, &temp) + return temp, ret } // nvml.DeviceGetTemperatureThreshold() -func DeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds) (uint32, Return) { - var Temp uint32 - ret := nvmlDeviceGetTemperatureThreshold(Device, ThresholdType, &Temp) - return Temp, ret +func (l *library) DeviceGetTemperatureThreshold(device Device, thresholdType TemperatureThresholds) (uint32, Return) { + return device.GetTemperatureThreshold(thresholdType) } -func (Device Device) GetTemperatureThreshold(ThresholdType TemperatureThresholds) (uint32, Return) { - return DeviceGetTemperatureThreshold(Device, ThresholdType) +func (device nvmlDevice) GetTemperatureThreshold(thresholdType TemperatureThresholds) (uint32, Return) { + var temp uint32 + ret := nvmlDeviceGetTemperatureThreshold(device, thresholdType, &temp) + return temp, ret } // nvml.DeviceSetTemperatureThreshold() -func DeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp int) Return { - t := int32(Temp) - ret := nvmlDeviceSetTemperatureThreshold(Device, ThresholdType, &t) - return ret +func (l *library) DeviceSetTemperatureThreshold(device Device, thresholdType TemperatureThresholds, temp int) Return { + return device.SetTemperatureThreshold(thresholdType, temp) } -func (Device Device) SetTemperatureThreshold(ThresholdType TemperatureThresholds, Temp int) Return { - return DeviceSetTemperatureThreshold(Device, ThresholdType, Temp) +func (device nvmlDevice) SetTemperatureThreshold(thresholdType TemperatureThresholds, temp int) Return { + t := int32(temp) + ret := nvmlDeviceSetTemperatureThreshold(device, thresholdType, &t) + return ret } // nvml.DeviceGetPerformanceState() -func DeviceGetPerformanceState(Device Device) (Pstates, Return) { - var PState Pstates - ret := nvmlDeviceGetPerformanceState(Device, &PState) - return PState, ret +func (l *library) DeviceGetPerformanceState(device Device) (Pstates, Return) { + return device.GetPerformanceState() } -func (Device Device) GetPerformanceState() (Pstates, Return) { - return DeviceGetPerformanceState(Device) +func (device nvmlDevice) GetPerformanceState() (Pstates, Return) { + var pState Pstates + ret := nvmlDeviceGetPerformanceState(device, &pState) + return pState, ret } // nvml.DeviceGetCurrentClocksThrottleReasons() -func DeviceGetCurrentClocksThrottleReasons(Device Device) (uint64, Return) { - var ClocksThrottleReasons uint64 - ret := nvmlDeviceGetCurrentClocksThrottleReasons(Device, &ClocksThrottleReasons) - return ClocksThrottleReasons, ret +func (l *library) DeviceGetCurrentClocksThrottleReasons(device Device) (uint64, Return) { + return device.GetCurrentClocksThrottleReasons() } -func (Device Device) GetCurrentClocksThrottleReasons() (uint64, Return) { - return DeviceGetCurrentClocksThrottleReasons(Device) +func (device nvmlDevice) GetCurrentClocksThrottleReasons() (uint64, Return) { + var clocksThrottleReasons uint64 + ret := nvmlDeviceGetCurrentClocksThrottleReasons(device, &clocksThrottleReasons) + return clocksThrottleReasons, ret } // nvml.DeviceGetSupportedClocksThrottleReasons() -func DeviceGetSupportedClocksThrottleReasons(Device Device) (uint64, Return) { - var SupportedClocksThrottleReasons uint64 - ret := nvmlDeviceGetSupportedClocksThrottleReasons(Device, &SupportedClocksThrottleReasons) - return SupportedClocksThrottleReasons, ret +func (l *library) DeviceGetSupportedClocksThrottleReasons(device Device) (uint64, Return) { + return device.GetSupportedClocksThrottleReasons() } -func (Device Device) GetSupportedClocksThrottleReasons() (uint64, Return) { - return DeviceGetSupportedClocksThrottleReasons(Device) +func (device nvmlDevice) GetSupportedClocksThrottleReasons() (uint64, Return) { + var supportedClocksThrottleReasons uint64 + ret := nvmlDeviceGetSupportedClocksThrottleReasons(device, &supportedClocksThrottleReasons) + return supportedClocksThrottleReasons, ret } // nvml.DeviceGetPowerState() -func DeviceGetPowerState(Device Device) (Pstates, Return) { - var PState Pstates - ret := nvmlDeviceGetPowerState(Device, &PState) - return PState, ret +func (l *library) DeviceGetPowerState(device Device) (Pstates, Return) { + return device.GetPowerState() } -func (Device Device) GetPowerState() (Pstates, Return) { - return DeviceGetPowerState(Device) +func (device nvmlDevice) GetPowerState() (Pstates, Return) { + var pState Pstates + ret := nvmlDeviceGetPowerState(device, &pState) + return pState, ret } // nvml.DeviceGetPowerManagementMode() -func DeviceGetPowerManagementMode(Device Device) (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetPowerManagementMode(Device, &Mode) - return Mode, ret +func (l *library) DeviceGetPowerManagementMode(device Device) (EnableState, Return) { + return device.GetPowerManagementMode() } -func (Device Device) GetPowerManagementMode() (EnableState, Return) { - return DeviceGetPowerManagementMode(Device) +func (device nvmlDevice) GetPowerManagementMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetPowerManagementMode(device, &mode) + return mode, ret } // nvml.DeviceGetPowerManagementLimit() -func DeviceGetPowerManagementLimit(Device Device) (uint32, Return) { - var Limit uint32 - ret := nvmlDeviceGetPowerManagementLimit(Device, &Limit) - return Limit, ret +func (l *library) DeviceGetPowerManagementLimit(device Device) (uint32, Return) { + return device.GetPowerManagementLimit() } -func (Device Device) GetPowerManagementLimit() (uint32, Return) { - return DeviceGetPowerManagementLimit(Device) +func (device nvmlDevice) GetPowerManagementLimit() (uint32, Return) { + var limit uint32 + ret := nvmlDeviceGetPowerManagementLimit(device, &limit) + return limit, ret } // nvml.DeviceGetPowerManagementLimitConstraints() -func DeviceGetPowerManagementLimitConstraints(Device Device) (uint32, uint32, Return) { - var MinLimit, MaxLimit uint32 - ret := nvmlDeviceGetPowerManagementLimitConstraints(Device, &MinLimit, &MaxLimit) - return MinLimit, MaxLimit, ret +func (l *library) DeviceGetPowerManagementLimitConstraints(device Device) (uint32, uint32, Return) { + return device.GetPowerManagementLimitConstraints() } -func (Device Device) GetPowerManagementLimitConstraints() (uint32, uint32, Return) { - return DeviceGetPowerManagementLimitConstraints(Device) +func (device nvmlDevice) GetPowerManagementLimitConstraints() (uint32, uint32, Return) { + var minLimit, maxLimit uint32 + ret := nvmlDeviceGetPowerManagementLimitConstraints(device, &minLimit, &maxLimit) + return minLimit, maxLimit, ret } // nvml.DeviceGetPowerManagementDefaultLimit() -func DeviceGetPowerManagementDefaultLimit(Device Device) (uint32, Return) { - var DefaultLimit uint32 - ret := nvmlDeviceGetPowerManagementDefaultLimit(Device, &DefaultLimit) - return DefaultLimit, ret +func (l *library) DeviceGetPowerManagementDefaultLimit(device Device) (uint32, Return) { + return device.GetPowerManagementDefaultLimit() } -func (Device Device) GetPowerManagementDefaultLimit() (uint32, Return) { - return DeviceGetPowerManagementDefaultLimit(Device) +func (device nvmlDevice) GetPowerManagementDefaultLimit() (uint32, Return) { + var defaultLimit uint32 + ret := nvmlDeviceGetPowerManagementDefaultLimit(device, &defaultLimit) + return defaultLimit, ret } // nvml.DeviceGetPowerUsage() -func DeviceGetPowerUsage(Device Device) (uint32, Return) { - var Power uint32 - ret := nvmlDeviceGetPowerUsage(Device, &Power) - return Power, ret +func (l *library) DeviceGetPowerUsage(device Device) (uint32, Return) { + return device.GetPowerUsage() } -func (Device Device) GetPowerUsage() (uint32, Return) { - return DeviceGetPowerUsage(Device) +func (device nvmlDevice) GetPowerUsage() (uint32, Return) { + var power uint32 + ret := nvmlDeviceGetPowerUsage(device, &power) + return power, ret } // nvml.DeviceGetTotalEnergyConsumption() -func DeviceGetTotalEnergyConsumption(Device Device) (uint64, Return) { - var Energy uint64 - ret := nvmlDeviceGetTotalEnergyConsumption(Device, &Energy) - return Energy, ret +func (l *library) DeviceGetTotalEnergyConsumption(device Device) (uint64, Return) { + return device.GetTotalEnergyConsumption() } -func (Device Device) GetTotalEnergyConsumption() (uint64, Return) { - return DeviceGetTotalEnergyConsumption(Device) +func (device nvmlDevice) GetTotalEnergyConsumption() (uint64, Return) { + var energy uint64 + ret := nvmlDeviceGetTotalEnergyConsumption(device, &energy) + return energy, ret } // nvml.DeviceGetEnforcedPowerLimit() -func DeviceGetEnforcedPowerLimit(Device Device) (uint32, Return) { - var Limit uint32 - ret := nvmlDeviceGetEnforcedPowerLimit(Device, &Limit) - return Limit, ret +func (l *library) DeviceGetEnforcedPowerLimit(device Device) (uint32, Return) { + return device.GetEnforcedPowerLimit() } -func (Device Device) GetEnforcedPowerLimit() (uint32, Return) { - return DeviceGetEnforcedPowerLimit(Device) +func (device nvmlDevice) GetEnforcedPowerLimit() (uint32, Return) { + var limit uint32 + ret := nvmlDeviceGetEnforcedPowerLimit(device, &limit) + return limit, ret } // nvml.DeviceGetGpuOperationMode() -func DeviceGetGpuOperationMode(Device Device) (GpuOperationMode, GpuOperationMode, Return) { - var Current, Pending GpuOperationMode - ret := nvmlDeviceGetGpuOperationMode(Device, &Current, &Pending) - return Current, Pending, ret +func (l *library) DeviceGetGpuOperationMode(device Device) (GpuOperationMode, GpuOperationMode, Return) { + return device.GetGpuOperationMode() } -func (Device Device) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) { - return DeviceGetGpuOperationMode(Device) +func (device nvmlDevice) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) { + var current, pending GpuOperationMode + ret := nvmlDeviceGetGpuOperationMode(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetMemoryInfo() -func DeviceGetMemoryInfo(Device Device) (Memory, Return) { - var Memory Memory - ret := nvmlDeviceGetMemoryInfo(Device, &Memory) - return Memory, ret +func (l *library) DeviceGetMemoryInfo(device Device) (Memory, Return) { + return device.GetMemoryInfo() } -func (Device Device) GetMemoryInfo() (Memory, Return) { - return DeviceGetMemoryInfo(Device) +func (device nvmlDevice) GetMemoryInfo() (Memory, Return) { + var memory Memory + ret := nvmlDeviceGetMemoryInfo(device, &memory) + return memory, ret } // nvml.DeviceGetMemoryInfo_v2() -func DeviceGetMemoryInfo_v2(Device Device) (Memory_v2, Return) { - var Memory Memory_v2 - Memory.Version = STRUCT_VERSION(Memory, 2) - ret := nvmlDeviceGetMemoryInfo_v2(Device, &Memory) - return Memory, ret +func (l *library) DeviceGetMemoryInfo_v2(device Device) (Memory_v2, Return) { + return device.GetMemoryInfo_v2() } -func (Device Device) GetMemoryInfo_v2() (Memory_v2, Return) { - return DeviceGetMemoryInfo_v2(Device) +func (device nvmlDevice) GetMemoryInfo_v2() (Memory_v2, Return) { + var memory Memory_v2 + memory.Version = STRUCT_VERSION(memory, 2) + ret := nvmlDeviceGetMemoryInfo_v2(device, &memory) + return memory, ret } // nvml.DeviceGetComputeMode() -func DeviceGetComputeMode(Device Device) (ComputeMode, Return) { - var Mode ComputeMode - ret := nvmlDeviceGetComputeMode(Device, &Mode) - return Mode, ret +func (l *library) DeviceGetComputeMode(device Device) (ComputeMode, Return) { + return device.GetComputeMode() } -func (Device Device) GetComputeMode() (ComputeMode, Return) { - return DeviceGetComputeMode(Device) +func (device nvmlDevice) GetComputeMode() (ComputeMode, Return) { + var mode ComputeMode + ret := nvmlDeviceGetComputeMode(device, &mode) + return mode, ret } // nvml.DeviceGetCudaComputeCapability() -func DeviceGetCudaComputeCapability(Device Device) (int, int, Return) { - var Major, Minor int32 - ret := nvmlDeviceGetCudaComputeCapability(Device, &Major, &Minor) - return int(Major), int(Minor), ret +func (l *library) DeviceGetCudaComputeCapability(device Device) (int, int, Return) { + return device.GetCudaComputeCapability() } -func (Device Device) GetCudaComputeCapability() (int, int, Return) { - return DeviceGetCudaComputeCapability(Device) +func (device nvmlDevice) GetCudaComputeCapability() (int, int, Return) { + var major, minor int32 + ret := nvmlDeviceGetCudaComputeCapability(device, &major, &minor) + return int(major), int(minor), ret } // nvml.DeviceGetEccMode() -func DeviceGetEccMode(Device Device) (EnableState, EnableState, Return) { - var Current, Pending EnableState - ret := nvmlDeviceGetEccMode(Device, &Current, &Pending) - return Current, Pending, ret +func (l *library) DeviceGetEccMode(device Device) (EnableState, EnableState, Return) { + return device.GetEccMode() } -func (Device Device) GetEccMode() (EnableState, EnableState, Return) { - return DeviceGetEccMode(Device) +func (device nvmlDevice) GetEccMode() (EnableState, EnableState, Return) { + var current, pending EnableState + ret := nvmlDeviceGetEccMode(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetBoardId() -func DeviceGetBoardId(Device Device) (uint32, Return) { - var BoardId uint32 - ret := nvmlDeviceGetBoardId(Device, &BoardId) - return BoardId, ret +func (l *library) DeviceGetBoardId(device Device) (uint32, Return) { + return device.GetBoardId() } -func (Device Device) GetBoardId() (uint32, Return) { - return DeviceGetBoardId(Device) +func (device nvmlDevice) GetBoardId() (uint32, Return) { + var boardId uint32 + ret := nvmlDeviceGetBoardId(device, &boardId) + return boardId, ret } // nvml.DeviceGetMultiGpuBoard() -func DeviceGetMultiGpuBoard(Device Device) (int, Return) { - var MultiGpuBool uint32 - ret := nvmlDeviceGetMultiGpuBoard(Device, &MultiGpuBool) - return int(MultiGpuBool), ret +func (l *library) DeviceGetMultiGpuBoard(device Device) (int, Return) { + return device.GetMultiGpuBoard() } -func (Device Device) GetMultiGpuBoard() (int, Return) { - return DeviceGetMultiGpuBoard(Device) +func (device nvmlDevice) GetMultiGpuBoard() (int, Return) { + var multiGpuBool uint32 + ret := nvmlDeviceGetMultiGpuBoard(device, &multiGpuBool) + return int(multiGpuBool), ret } // nvml.DeviceGetTotalEccErrors() -func DeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { - var EccCounts uint64 - ret := nvmlDeviceGetTotalEccErrors(Device, ErrorType, CounterType, &EccCounts) - return EccCounts, ret +func (l *library) DeviceGetTotalEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) { + return device.GetTotalEccErrors(errorType, counterType) } -func (Device Device) GetTotalEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { - return DeviceGetTotalEccErrors(Device, ErrorType, CounterType) +func (device nvmlDevice) GetTotalEccErrors(errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) { + var eccCounts uint64 + ret := nvmlDeviceGetTotalEccErrors(device, errorType, counterType, &eccCounts) + return eccCounts, ret } // nvml.DeviceGetDetailedEccErrors() -func DeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { - var EccCounts EccErrorCounts - ret := nvmlDeviceGetDetailedEccErrors(Device, ErrorType, CounterType, &EccCounts) - return EccCounts, ret +func (l *library) DeviceGetDetailedEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) { + return device.GetDetailedEccErrors(errorType, counterType) } -func (Device Device) GetDetailedEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { - return DeviceGetDetailedEccErrors(Device, ErrorType, CounterType) +func (device nvmlDevice) GetDetailedEccErrors(errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) { + var eccCounts EccErrorCounts + ret := nvmlDeviceGetDetailedEccErrors(device, errorType, counterType, &eccCounts) + return eccCounts, ret } // nvml.DeviceGetMemoryErrorCounter() -func DeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { - var Count uint64 - ret := nvmlDeviceGetMemoryErrorCounter(Device, ErrorType, CounterType, LocationType, &Count) - return Count, ret +func (l *library) DeviceGetMemoryErrorCounter(device Device, errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) { + return device.GetMemoryErrorCounter(errorType, counterType, locationType) } -func (Device Device) GetMemoryErrorCounter(ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { - return DeviceGetMemoryErrorCounter(Device, ErrorType, CounterType, LocationType) +func (device nvmlDevice) GetMemoryErrorCounter(errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) { + var count uint64 + ret := nvmlDeviceGetMemoryErrorCounter(device, errorType, counterType, locationType, &count) + return count, ret } // nvml.DeviceGetUtilizationRates() -func DeviceGetUtilizationRates(Device Device) (Utilization, Return) { - var Utilization Utilization - ret := nvmlDeviceGetUtilizationRates(Device, &Utilization) - return Utilization, ret +func (l *library) DeviceGetUtilizationRates(device Device) (Utilization, Return) { + return device.GetUtilizationRates() } -func (Device Device) GetUtilizationRates() (Utilization, Return) { - return DeviceGetUtilizationRates(Device) +func (device nvmlDevice) GetUtilizationRates() (Utilization, Return) { + var utilization Utilization + ret := nvmlDeviceGetUtilizationRates(device, &utilization) + return utilization, ret } // nvml.DeviceGetEncoderUtilization() -func DeviceGetEncoderUtilization(Device Device) (uint32, uint32, Return) { - var Utilization, SamplingPeriodUs uint32 - ret := nvmlDeviceGetEncoderUtilization(Device, &Utilization, &SamplingPeriodUs) - return Utilization, SamplingPeriodUs, ret +func (l *library) DeviceGetEncoderUtilization(device Device) (uint32, uint32, Return) { + return device.GetEncoderUtilization() } -func (Device Device) GetEncoderUtilization() (uint32, uint32, Return) { - return DeviceGetEncoderUtilization(Device) +func (device nvmlDevice) GetEncoderUtilization() (uint32, uint32, Return) { + var utilization, samplingPeriodUs uint32 + ret := nvmlDeviceGetEncoderUtilization(device, &utilization, &samplingPeriodUs) + return utilization, samplingPeriodUs, ret } // nvml.DeviceGetEncoderCapacity() -func DeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType) (int, Return) { - var EncoderCapacity uint32 - ret := nvmlDeviceGetEncoderCapacity(Device, EncoderQueryType, &EncoderCapacity) - return int(EncoderCapacity), ret +func (l *library) DeviceGetEncoderCapacity(device Device, encoderQueryType EncoderType) (int, Return) { + return device.GetEncoderCapacity(encoderQueryType) } -func (Device Device) GetEncoderCapacity(EncoderQueryType EncoderType) (int, Return) { - return DeviceGetEncoderCapacity(Device, EncoderQueryType) +func (device nvmlDevice) GetEncoderCapacity(encoderQueryType EncoderType) (int, Return) { + var encoderCapacity uint32 + ret := nvmlDeviceGetEncoderCapacity(device, encoderQueryType, &encoderCapacity) + return int(encoderCapacity), ret } // nvml.DeviceGetEncoderStats() -func DeviceGetEncoderStats(Device Device) (int, uint32, uint32, Return) { - var SessionCount, AverageFps, AverageLatency uint32 - ret := nvmlDeviceGetEncoderStats(Device, &SessionCount, &AverageFps, &AverageLatency) - return int(SessionCount), AverageFps, AverageLatency, ret +func (l *library) DeviceGetEncoderStats(device Device) (int, uint32, uint32, Return) { + return device.GetEncoderStats() } -func (Device Device) GetEncoderStats() (int, uint32, uint32, Return) { - return DeviceGetEncoderStats(Device) +func (device nvmlDevice) GetEncoderStats() (int, uint32, uint32, Return) { + var sessionCount, averageFps, averageLatency uint32 + ret := nvmlDeviceGetEncoderStats(device, &sessionCount, &averageFps, &averageLatency) + return int(sessionCount), averageFps, averageLatency, ret } // nvml.DeviceGetEncoderSessions() -func DeviceGetEncoderSessions(Device Device) ([]EncoderSessionInfo, Return) { - var SessionCount uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetEncoderSessions(device Device) ([]EncoderSessionInfo, Return) { + return device.GetEncoderSessions() +} + +func (device nvmlDevice) GetEncoderSessions() ([]EncoderSessionInfo, Return) { + var sessionCount uint32 = 1 // Will be reduced upon returning for { - SessionInfos := make([]EncoderSessionInfo, SessionCount) - ret := nvmlDeviceGetEncoderSessions(Device, &SessionCount, &SessionInfos[0]) + sessionInfos := make([]EncoderSessionInfo, sessionCount) + ret := nvmlDeviceGetEncoderSessions(device, &sessionCount, &sessionInfos[0]) if ret == SUCCESS { - return SessionInfos[:SessionCount], ret + return sessionInfos[:sessionCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - SessionCount *= 2 + sessionCount *= 2 } } -func (Device Device) GetEncoderSessions() ([]EncoderSessionInfo, Return) { - return DeviceGetEncoderSessions(Device) -} - // nvml.DeviceGetDecoderUtilization() -func DeviceGetDecoderUtilization(Device Device) (uint32, uint32, Return) { - var Utilization, SamplingPeriodUs uint32 - ret := nvmlDeviceGetDecoderUtilization(Device, &Utilization, &SamplingPeriodUs) - return Utilization, SamplingPeriodUs, ret +func (l *library) DeviceGetDecoderUtilization(device Device) (uint32, uint32, Return) { + return device.GetDecoderUtilization() } -func (Device Device) GetDecoderUtilization() (uint32, uint32, Return) { - return DeviceGetDecoderUtilization(Device) +func (device nvmlDevice) GetDecoderUtilization() (uint32, uint32, Return) { + var utilization, samplingPeriodUs uint32 + ret := nvmlDeviceGetDecoderUtilization(device, &utilization, &samplingPeriodUs) + return utilization, samplingPeriodUs, ret } // nvml.DeviceGetFBCStats() -func DeviceGetFBCStats(Device Device) (FBCStats, Return) { - var FbcStats FBCStats - ret := nvmlDeviceGetFBCStats(Device, &FbcStats) - return FbcStats, ret +func (l *library) DeviceGetFBCStats(device Device) (FBCStats, Return) { + return device.GetFBCStats() } -func (Device Device) GetFBCStats() (FBCStats, Return) { - return DeviceGetFBCStats(Device) +func (device nvmlDevice) GetFBCStats() (FBCStats, Return) { + var fbcStats FBCStats + ret := nvmlDeviceGetFBCStats(device, &fbcStats) + return fbcStats, ret } // nvml.DeviceGetFBCSessions() -func DeviceGetFBCSessions(Device Device) ([]FBCSessionInfo, Return) { - var SessionCount uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetFBCSessions(device Device) ([]FBCSessionInfo, Return) { + return device.GetFBCSessions() +} + +func (device nvmlDevice) GetFBCSessions() ([]FBCSessionInfo, Return) { + var sessionCount uint32 = 1 // Will be reduced upon returning for { - SessionInfo := make([]FBCSessionInfo, SessionCount) - ret := nvmlDeviceGetFBCSessions(Device, &SessionCount, &SessionInfo[0]) + sessionInfo := make([]FBCSessionInfo, sessionCount) + ret := nvmlDeviceGetFBCSessions(device, &sessionCount, &sessionInfo[0]) if ret == SUCCESS { - return SessionInfo[:SessionCount], ret + return sessionInfo[:sessionCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - SessionCount *= 2 + sessionCount *= 2 } } -func (Device Device) GetFBCSessions() ([]FBCSessionInfo, Return) { - return DeviceGetFBCSessions(Device) -} - // nvml.DeviceGetDriverModel() -func DeviceGetDriverModel(Device Device) (DriverModel, DriverModel, Return) { - var Current, Pending DriverModel - ret := nvmlDeviceGetDriverModel(Device, &Current, &Pending) - return Current, Pending, ret +func (l *library) DeviceGetDriverModel(device Device) (DriverModel, DriverModel, Return) { + return device.GetDriverModel() } -func (Device Device) GetDriverModel() (DriverModel, DriverModel, Return) { - return DeviceGetDriverModel(Device) +func (device nvmlDevice) GetDriverModel() (DriverModel, DriverModel, Return) { + var current, pending DriverModel + ret := nvmlDeviceGetDriverModel(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetVbiosVersion() -func DeviceGetVbiosVersion(Device Device) (string, Return) { - Version := make([]byte, DEVICE_VBIOS_VERSION_BUFFER_SIZE) - ret := nvmlDeviceGetVbiosVersion(Device, &Version[0], DEVICE_VBIOS_VERSION_BUFFER_SIZE) - return string(Version[:clen(Version)]), ret +func (l *library) DeviceGetVbiosVersion(device Device) (string, Return) { + return device.GetVbiosVersion() } -func (Device Device) GetVbiosVersion() (string, Return) { - return DeviceGetVbiosVersion(Device) +func (device nvmlDevice) GetVbiosVersion() (string, Return) { + version := make([]byte, DEVICE_VBIOS_VERSION_BUFFER_SIZE) + ret := nvmlDeviceGetVbiosVersion(device, &version[0], DEVICE_VBIOS_VERSION_BUFFER_SIZE) + return string(version[:clen(version)]), ret } // nvml.DeviceGetBridgeChipInfo() -func DeviceGetBridgeChipInfo(Device Device) (BridgeChipHierarchy, Return) { - var BridgeHierarchy BridgeChipHierarchy - ret := nvmlDeviceGetBridgeChipInfo(Device, &BridgeHierarchy) - return BridgeHierarchy, ret +func (l *library) DeviceGetBridgeChipInfo(device Device) (BridgeChipHierarchy, Return) { + return device.GetBridgeChipInfo() } -func (Device Device) GetBridgeChipInfo() (BridgeChipHierarchy, Return) { - return DeviceGetBridgeChipInfo(Device) +func (device nvmlDevice) GetBridgeChipInfo() (BridgeChipHierarchy, Return) { + var bridgeHierarchy BridgeChipHierarchy + ret := nvmlDeviceGetBridgeChipInfo(device, &bridgeHierarchy) + return bridgeHierarchy, ret } // nvml.DeviceGetComputeRunningProcesses() -func deviceGetComputeRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetComputeRunningProcesses_v1(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v1, InfoCount) - ret := nvmlDeviceGetComputeRunningProcesses_v1(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v1, infoCount) + ret := nvmlDeviceGetComputeRunningProcesses_v1(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v1Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v1Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetComputeRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetComputeRunningProcesses_v2(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v2, InfoCount) - ret := nvmlDeviceGetComputeRunningProcesses_v2(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v2, infoCount) + ret := nvmlDeviceGetComputeRunningProcesses_v2(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v2Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v2Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetComputeRunningProcesses_v3(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo, InfoCount) - ret := nvmlDeviceGetComputeRunningProcesses_v3(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo, infoCount) + ret := nvmlDeviceGetComputeRunningProcesses_v3(device, &infoCount, &infos[0]) if ret == SUCCESS { - return Infos[:InfoCount], ret + return infos[:infoCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func (Device Device) GetComputeRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetComputeRunningProcesses(Device) +func (l *library) DeviceGetComputeRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetComputeRunningProcesses() +} + +func (device nvmlDevice) GetComputeRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetComputeRunningProcesses(device) } // nvml.DeviceGetGraphicsRunningProcesses() -func deviceGetGraphicsRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetGraphicsRunningProcesses_v1(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v1, InfoCount) - ret := nvmlDeviceGetGraphicsRunningProcesses_v1(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v1, infoCount) + ret := nvmlDeviceGetGraphicsRunningProcesses_v1(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v1Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v1Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetGraphicsRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetGraphicsRunningProcesses_v2(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v2, InfoCount) - ret := nvmlDeviceGetGraphicsRunningProcesses_v2(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v2, infoCount) + ret := nvmlDeviceGetGraphicsRunningProcesses_v2(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v2Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v2Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetGraphicsRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetGraphicsRunningProcesses_v3(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo, InfoCount) - ret := nvmlDeviceGetGraphicsRunningProcesses_v3(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo, infoCount) + ret := nvmlDeviceGetGraphicsRunningProcesses_v3(device, &infoCount, &infos[0]) if ret == SUCCESS { - return Infos[:InfoCount], ret + return infos[:infoCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func (Device Device) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetGraphicsRunningProcesses(Device) +func (l *library) DeviceGetGraphicsRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetGraphicsRunningProcesses() +} + +func (device nvmlDevice) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetGraphicsRunningProcesses(device) } // nvml.DeviceGetMPSComputeRunningProcesses() -func deviceGetMPSComputeRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetMPSComputeRunningProcesses_v1(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v1, InfoCount) - ret := nvmlDeviceGetMPSComputeRunningProcesses_v1(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v1, infoCount) + ret := nvmlDeviceGetMPSComputeRunningProcesses_v1(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v1Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v1Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetMPSComputeRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetMPSComputeRunningProcesses_v2(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v2, InfoCount) - ret := nvmlDeviceGetMPSComputeRunningProcesses_v2(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v2, infoCount) + ret := nvmlDeviceGetMPSComputeRunningProcesses_v2(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v2Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v2Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetMPSComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetMPSComputeRunningProcesses_v3(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo, InfoCount) - ret := nvmlDeviceGetMPSComputeRunningProcesses_v3(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo, infoCount) + ret := nvmlDeviceGetMPSComputeRunningProcesses_v3(device, &infoCount, &infos[0]) if ret == SUCCESS { - return Infos[:InfoCount], ret + return infos[:infoCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func (Device Device) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetMPSComputeRunningProcesses(Device) +func (l *library) DeviceGetMPSComputeRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetMPSComputeRunningProcesses() +} + +func (device nvmlDevice) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetMPSComputeRunningProcesses(device) } // nvml.DeviceOnSameBoard() -func DeviceOnSameBoard(Device1 Device, Device2 Device) (int, Return) { - var OnSameBoard int32 - ret := nvmlDeviceOnSameBoard(Device1, Device2, &OnSameBoard) - return int(OnSameBoard), ret +func (l *library) DeviceOnSameBoard(device1 Device, device2 Device) (int, Return) { + return device1.OnSameBoard(device2) } -func (Device1 Device) OnSameBoard(Device2 Device) (int, Return) { - return DeviceOnSameBoard(Device1, Device2) +func (device1 nvmlDevice) OnSameBoard(device2 Device) (int, Return) { + var onSameBoard int32 + ret := nvmlDeviceOnSameBoard(device1, device2.(nvmlDevice), &onSameBoard) + return int(onSameBoard), ret } // nvml.DeviceGetAPIRestriction() -func DeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI) (EnableState, Return) { - var IsRestricted EnableState - ret := nvmlDeviceGetAPIRestriction(Device, ApiType, &IsRestricted) - return IsRestricted, ret +func (l *library) DeviceGetAPIRestriction(device Device, apiType RestrictedAPI) (EnableState, Return) { + return device.GetAPIRestriction(apiType) } -func (Device Device) GetAPIRestriction(ApiType RestrictedAPI) (EnableState, Return) { - return DeviceGetAPIRestriction(Device, ApiType) +func (device nvmlDevice) GetAPIRestriction(apiType RestrictedAPI) (EnableState, Return) { + var isRestricted EnableState + ret := nvmlDeviceGetAPIRestriction(device, apiType, &isRestricted) + return isRestricted, ret } // nvml.DeviceGetSamples() -func DeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { - var SampleValType ValueType - var SampleCount uint32 - ret := nvmlDeviceGetSamples(Device, _type, LastSeenTimeStamp, &SampleValType, &SampleCount, nil) +func (l *library) DeviceGetSamples(device Device, samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) { + return device.GetSamples(samplingType, lastSeenTimestamp) +} + +func (device nvmlDevice) GetSamples(samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) { + var sampleValType ValueType + var sampleCount uint32 + ret := nvmlDeviceGetSamples(device, samplingType, lastSeenTimestamp, &sampleValType, &sampleCount, nil) if ret != SUCCESS { - return SampleValType, nil, ret + return sampleValType, nil, ret } - if SampleCount == 0 { - return SampleValType, []Sample{}, ret + if sampleCount == 0 { + return sampleValType, []Sample{}, ret } - Samples := make([]Sample, SampleCount) - ret = nvmlDeviceGetSamples(Device, _type, LastSeenTimeStamp, &SampleValType, &SampleCount, &Samples[0]) - return SampleValType, Samples, ret -} - -func (Device Device) GetSamples(_type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { - return DeviceGetSamples(Device, _type, LastSeenTimeStamp) + samples := make([]Sample, sampleCount) + ret = nvmlDeviceGetSamples(device, samplingType, lastSeenTimestamp, &sampleValType, &sampleCount, &samples[0]) + return sampleValType, samples, ret } // nvml.DeviceGetBAR1MemoryInfo() -func DeviceGetBAR1MemoryInfo(Device Device) (BAR1Memory, Return) { - var Bar1Memory BAR1Memory - ret := nvmlDeviceGetBAR1MemoryInfo(Device, &Bar1Memory) - return Bar1Memory, ret +func (l *library) DeviceGetBAR1MemoryInfo(device Device) (BAR1Memory, Return) { + return device.GetBAR1MemoryInfo() } -func (Device Device) GetBAR1MemoryInfo() (BAR1Memory, Return) { - return DeviceGetBAR1MemoryInfo(Device) +func (device nvmlDevice) GetBAR1MemoryInfo() (BAR1Memory, Return) { + var bar1Memory BAR1Memory + ret := nvmlDeviceGetBAR1MemoryInfo(device, &bar1Memory) + return bar1Memory, ret } // nvml.DeviceGetViolationStatus() -func DeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType) (ViolationTime, Return) { - var ViolTime ViolationTime - ret := nvmlDeviceGetViolationStatus(Device, PerfPolicyType, &ViolTime) - return ViolTime, ret +func (l *library) DeviceGetViolationStatus(device Device, perfPolicyType PerfPolicyType) (ViolationTime, Return) { + return device.GetViolationStatus(perfPolicyType) } -func (Device Device) GetViolationStatus(PerfPolicyType PerfPolicyType) (ViolationTime, Return) { - return DeviceGetViolationStatus(Device, PerfPolicyType) +func (device nvmlDevice) GetViolationStatus(perfPolicyType PerfPolicyType) (ViolationTime, Return) { + var violTime ViolationTime + ret := nvmlDeviceGetViolationStatus(device, perfPolicyType, &violTime) + return violTime, ret } // nvml.DeviceGetIrqNum() -func DeviceGetIrqNum(Device Device) (int, Return) { - var IrqNum uint32 - ret := nvmlDeviceGetIrqNum(Device, &IrqNum) - return int(IrqNum), ret +func (l *library) DeviceGetIrqNum(device Device) (int, Return) { + return device.GetIrqNum() } -func (Device Device) GetIrqNum() (int, Return) { - return DeviceGetIrqNum(Device) +func (device nvmlDevice) GetIrqNum() (int, Return) { + var irqNum uint32 + ret := nvmlDeviceGetIrqNum(device, &irqNum) + return int(irqNum), ret } // nvml.DeviceGetNumGpuCores() -func DeviceGetNumGpuCores(Device Device) (int, Return) { - var NumCores uint32 - ret := nvmlDeviceGetNumGpuCores(Device, &NumCores) - return int(NumCores), ret +func (l *library) DeviceGetNumGpuCores(device Device) (int, Return) { + return device.GetNumGpuCores() } -func (Device Device) GetNumGpuCores() (int, Return) { - return DeviceGetNumGpuCores(Device) +func (device nvmlDevice) GetNumGpuCores() (int, Return) { + var numCores uint32 + ret := nvmlDeviceGetNumGpuCores(device, &numCores) + return int(numCores), ret } // nvml.DeviceGetPowerSource() -func DeviceGetPowerSource(Device Device) (PowerSource, Return) { - var PowerSource PowerSource - ret := nvmlDeviceGetPowerSource(Device, &PowerSource) - return PowerSource, ret +func (l *library) DeviceGetPowerSource(device Device) (PowerSource, Return) { + return device.GetPowerSource() } -func (Device Device) GetPowerSource() (PowerSource, Return) { - return DeviceGetPowerSource(Device) +func (device nvmlDevice) GetPowerSource() (PowerSource, Return) { + var powerSource PowerSource + ret := nvmlDeviceGetPowerSource(device, &powerSource) + return powerSource, ret } // nvml.DeviceGetMemoryBusWidth() -func DeviceGetMemoryBusWidth(Device Device) (uint32, Return) { - var BusWidth uint32 - ret := nvmlDeviceGetMemoryBusWidth(Device, &BusWidth) - return BusWidth, ret +func (l *library) DeviceGetMemoryBusWidth(device Device) (uint32, Return) { + return device.GetMemoryBusWidth() } -func (Device Device) GetMemoryBusWidth() (uint32, Return) { - return DeviceGetMemoryBusWidth(Device) +func (device nvmlDevice) GetMemoryBusWidth() (uint32, Return) { + var busWidth uint32 + ret := nvmlDeviceGetMemoryBusWidth(device, &busWidth) + return busWidth, ret } // nvml.DeviceGetPcieLinkMaxSpeed() -func DeviceGetPcieLinkMaxSpeed(Device Device) (uint32, Return) { - var MaxSpeed uint32 - ret := nvmlDeviceGetPcieLinkMaxSpeed(Device, &MaxSpeed) - return MaxSpeed, ret +func (l *library) DeviceGetPcieLinkMaxSpeed(device Device) (uint32, Return) { + return device.GetPcieLinkMaxSpeed() } -func (Device Device) GetPcieLinkMaxSpeed() (uint32, Return) { - return DeviceGetPcieLinkMaxSpeed(Device) +func (device nvmlDevice) GetPcieLinkMaxSpeed() (uint32, Return) { + var maxSpeed uint32 + ret := nvmlDeviceGetPcieLinkMaxSpeed(device, &maxSpeed) + return maxSpeed, ret } // nvml.DeviceGetAdaptiveClockInfoStatus() -func DeviceGetAdaptiveClockInfoStatus(Device Device) (uint32, Return) { - var AdaptiveClockStatus uint32 - ret := nvmlDeviceGetAdaptiveClockInfoStatus(Device, &AdaptiveClockStatus) - return AdaptiveClockStatus, ret +func (l *library) DeviceGetAdaptiveClockInfoStatus(device Device) (uint32, Return) { + return device.GetAdaptiveClockInfoStatus() } -func (Device Device) GetAdaptiveClockInfoStatus() (uint32, Return) { - return DeviceGetAdaptiveClockInfoStatus(Device) +func (device nvmlDevice) GetAdaptiveClockInfoStatus() (uint32, Return) { + var adaptiveClockStatus uint32 + ret := nvmlDeviceGetAdaptiveClockInfoStatus(device, &adaptiveClockStatus) + return adaptiveClockStatus, ret } // nvml.DeviceGetAccountingMode() -func DeviceGetAccountingMode(Device Device) (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetAccountingMode(Device, &Mode) - return Mode, ret +func (l *library) DeviceGetAccountingMode(device Device) (EnableState, Return) { + return device.GetAccountingMode() } -func (Device Device) GetAccountingMode() (EnableState, Return) { - return DeviceGetAccountingMode(Device) +func (device nvmlDevice) GetAccountingMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetAccountingMode(device, &mode) + return mode, ret } // nvml.DeviceGetAccountingStats() -func DeviceGetAccountingStats(Device Device, Pid uint32) (AccountingStats, Return) { - var Stats AccountingStats - ret := nvmlDeviceGetAccountingStats(Device, Pid, &Stats) - return Stats, ret +func (l *library) DeviceGetAccountingStats(device Device, pid uint32) (AccountingStats, Return) { + return device.GetAccountingStats(pid) } -func (Device Device) GetAccountingStats(Pid uint32) (AccountingStats, Return) { - return DeviceGetAccountingStats(Device, Pid) +func (device nvmlDevice) GetAccountingStats(pid uint32) (AccountingStats, Return) { + var stats AccountingStats + ret := nvmlDeviceGetAccountingStats(device, pid, &stats) + return stats, ret } // nvml.DeviceGetAccountingPids() -func DeviceGetAccountingPids(Device Device) ([]int, Return) { - var Count uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetAccountingPids(device Device) ([]int, Return) { + return device.GetAccountingPids() +} + +func (device nvmlDevice) GetAccountingPids() ([]int, Return) { + var count uint32 = 1 // Will be reduced upon returning for { - Pids := make([]uint32, Count) - ret := nvmlDeviceGetAccountingPids(Device, &Count, &Pids[0]) + pids := make([]uint32, count) + ret := nvmlDeviceGetAccountingPids(device, &count, &pids[0]) if ret == SUCCESS { - return uint32SliceToIntSlice(Pids[:Count]), ret + return uint32SliceToIntSlice(pids[:count]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - Count *= 2 + count *= 2 } } -func (Device Device) GetAccountingPids() ([]int, Return) { - return DeviceGetAccountingPids(Device) -} - // nvml.DeviceGetAccountingBufferSize() -func DeviceGetAccountingBufferSize(Device Device) (int, Return) { - var BufferSize uint32 - ret := nvmlDeviceGetAccountingBufferSize(Device, &BufferSize) - return int(BufferSize), ret +func (l *library) DeviceGetAccountingBufferSize(device Device) (int, Return) { + return device.GetAccountingBufferSize() } -func (Device Device) GetAccountingBufferSize() (int, Return) { - return DeviceGetAccountingBufferSize(Device) +func (device nvmlDevice) GetAccountingBufferSize() (int, Return) { + var bufferSize uint32 + ret := nvmlDeviceGetAccountingBufferSize(device, &bufferSize) + return int(bufferSize), ret } // nvml.DeviceGetRetiredPages() -func DeviceGetRetiredPages(Device Device, Cause PageRetirementCause) ([]uint64, Return) { - var PageCount uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetRetiredPages(device Device, cause PageRetirementCause) ([]uint64, Return) { + return device.GetRetiredPages(cause) +} + +func (device nvmlDevice) GetRetiredPages(cause PageRetirementCause) ([]uint64, Return) { + var pageCount uint32 = 1 // Will be reduced upon returning for { - Addresses := make([]uint64, PageCount) - ret := nvmlDeviceGetRetiredPages(Device, Cause, &PageCount, &Addresses[0]) + addresses := make([]uint64, pageCount) + ret := nvmlDeviceGetRetiredPages(device, cause, &pageCount, &addresses[0]) if ret == SUCCESS { - return Addresses[:PageCount], ret + return addresses[:pageCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - PageCount *= 2 + pageCount *= 2 } } -func (Device Device) GetRetiredPages(Cause PageRetirementCause) ([]uint64, Return) { - return DeviceGetRetiredPages(Device, Cause) +// nvml.DeviceGetRetiredPages_v2() +func (l *library) DeviceGetRetiredPages_v2(device Device, cause PageRetirementCause) ([]uint64, []uint64, Return) { + return device.GetRetiredPages_v2(cause) } -// nvml.DeviceGetRetiredPages_v2() -func DeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause) ([]uint64, []uint64, Return) { - var PageCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetRetiredPages_v2(cause PageRetirementCause) ([]uint64, []uint64, Return) { + var pageCount uint32 = 1 // Will be reduced upon returning for { - Addresses := make([]uint64, PageCount) - Timestamps := make([]uint64, PageCount) - ret := nvmlDeviceGetRetiredPages_v2(Device, Cause, &PageCount, &Addresses[0], &Timestamps[0]) + addresses := make([]uint64, pageCount) + timestamps := make([]uint64, pageCount) + ret := nvmlDeviceGetRetiredPages_v2(device, cause, &pageCount, &addresses[0], ×tamps[0]) if ret == SUCCESS { - return Addresses[:PageCount], Timestamps[:PageCount], ret + return addresses[:pageCount], timestamps[:pageCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, nil, ret } - PageCount *= 2 + pageCount *= 2 } } -func (Device Device) GetRetiredPages_v2(Cause PageRetirementCause) ([]uint64, []uint64, Return) { - return DeviceGetRetiredPages_v2(Device, Cause) -} - // nvml.DeviceGetRetiredPagesPendingStatus() -func DeviceGetRetiredPagesPendingStatus(Device Device) (EnableState, Return) { - var IsPending EnableState - ret := nvmlDeviceGetRetiredPagesPendingStatus(Device, &IsPending) - return IsPending, ret +func (l *library) DeviceGetRetiredPagesPendingStatus(device Device) (EnableState, Return) { + return device.GetRetiredPagesPendingStatus() } -func (Device Device) GetRetiredPagesPendingStatus() (EnableState, Return) { - return DeviceGetRetiredPagesPendingStatus(Device) +func (device nvmlDevice) GetRetiredPagesPendingStatus() (EnableState, Return) { + var isPending EnableState + ret := nvmlDeviceGetRetiredPagesPendingStatus(device, &isPending) + return isPending, ret } // nvml.DeviceSetPersistenceMode() -func DeviceSetPersistenceMode(Device Device, Mode EnableState) Return { - return nvmlDeviceSetPersistenceMode(Device, Mode) +func (l *library) DeviceSetPersistenceMode(device Device, mode EnableState) Return { + return device.SetPersistenceMode(mode) } -func (Device Device) SetPersistenceMode(Mode EnableState) Return { - return DeviceSetPersistenceMode(Device, Mode) +func (device nvmlDevice) SetPersistenceMode(mode EnableState) Return { + return nvmlDeviceSetPersistenceMode(device, mode) } // nvml.DeviceSetComputeMode() -func DeviceSetComputeMode(Device Device, Mode ComputeMode) Return { - return nvmlDeviceSetComputeMode(Device, Mode) +func (l *library) DeviceSetComputeMode(device Device, mode ComputeMode) Return { + return device.SetComputeMode(mode) } -func (Device Device) SetComputeMode(Mode ComputeMode) Return { - return DeviceSetComputeMode(Device, Mode) +func (device nvmlDevice) SetComputeMode(mode ComputeMode) Return { + return nvmlDeviceSetComputeMode(device, mode) } // nvml.DeviceSetEccMode() -func DeviceSetEccMode(Device Device, Ecc EnableState) Return { - return nvmlDeviceSetEccMode(Device, Ecc) +func (l *library) DeviceSetEccMode(device Device, ecc EnableState) Return { + return device.SetEccMode(ecc) } -func (Device Device) SetEccMode(Ecc EnableState) Return { - return DeviceSetEccMode(Device, Ecc) +func (device nvmlDevice) SetEccMode(ecc EnableState) Return { + return nvmlDeviceSetEccMode(device, ecc) } // nvml.DeviceClearEccErrorCounts() -func DeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return { - return nvmlDeviceClearEccErrorCounts(Device, CounterType) +func (l *library) DeviceClearEccErrorCounts(device Device, counterType EccCounterType) Return { + return device.ClearEccErrorCounts(counterType) } -func (Device Device) ClearEccErrorCounts(CounterType EccCounterType) Return { - return DeviceClearEccErrorCounts(Device, CounterType) +func (device nvmlDevice) ClearEccErrorCounts(counterType EccCounterType) Return { + return nvmlDeviceClearEccErrorCounts(device, counterType) } // nvml.DeviceSetDriverModel() -func DeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return { - return nvmlDeviceSetDriverModel(Device, DriverModel, Flags) +func (l *library) DeviceSetDriverModel(device Device, driverModel DriverModel, flags uint32) Return { + return device.SetDriverModel(driverModel, flags) } -func (Device Device) SetDriverModel(DriverModel DriverModel, Flags uint32) Return { - return DeviceSetDriverModel(Device, DriverModel, Flags) +func (device nvmlDevice) SetDriverModel(driverModel DriverModel, flags uint32) Return { + return nvmlDeviceSetDriverModel(device, driverModel, flags) } // nvml.DeviceSetGpuLockedClocks() -func DeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - return nvmlDeviceSetGpuLockedClocks(Device, MinGpuClockMHz, MaxGpuClockMHz) +func (l *library) DeviceSetGpuLockedClocks(device Device, minGpuClockMHz uint32, maxGpuClockMHz uint32) Return { + return device.SetGpuLockedClocks(minGpuClockMHz, maxGpuClockMHz) } -func (Device Device) SetGpuLockedClocks(MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - return DeviceSetGpuLockedClocks(Device, MinGpuClockMHz, MaxGpuClockMHz) +func (device nvmlDevice) SetGpuLockedClocks(minGpuClockMHz uint32, maxGpuClockMHz uint32) Return { + return nvmlDeviceSetGpuLockedClocks(device, minGpuClockMHz, maxGpuClockMHz) } // nvml.DeviceResetGpuLockedClocks() -func DeviceResetGpuLockedClocks(Device Device) Return { - return nvmlDeviceResetGpuLockedClocks(Device) +func (l *library) DeviceResetGpuLockedClocks(device Device) Return { + return device.ResetGpuLockedClocks() } -func (Device Device) ResetGpuLockedClocks() Return { - return DeviceResetGpuLockedClocks(Device) +func (device nvmlDevice) ResetGpuLockedClocks() Return { + return nvmlDeviceResetGpuLockedClocks(device) } // nvmlDeviceSetMemoryLockedClocks() -func DeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - return nvmlDeviceSetMemoryLockedClocks(Device, MinMemClockMHz, MaxMemClockMHz) +func (l *library) DeviceSetMemoryLockedClocks(device Device, minMemClockMHz uint32, maxMemClockMHz uint32) Return { + return device.SetMemoryLockedClocks(minMemClockMHz, maxMemClockMHz) } -func (Device Device) SetMemoryLockedClocks(NinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - return DeviceSetMemoryLockedClocks(Device, NinMemClockMHz, MaxMemClockMHz) +func (device nvmlDevice) SetMemoryLockedClocks(minMemClockMHz uint32, maxMemClockMHz uint32) Return { + return nvmlDeviceSetMemoryLockedClocks(device, minMemClockMHz, maxMemClockMHz) } // nvmlDeviceResetMemoryLockedClocks() -func DeviceResetMemoryLockedClocks(Device Device) Return { - return nvmlDeviceResetMemoryLockedClocks(Device) +func (l *library) DeviceResetMemoryLockedClocks(device Device) Return { + return device.ResetMemoryLockedClocks() } -func (Device Device) ResetMemoryLockedClocks() Return { - return DeviceResetMemoryLockedClocks(Device) +func (device nvmlDevice) ResetMemoryLockedClocks() Return { + return nvmlDeviceResetMemoryLockedClocks(device) } // nvml.DeviceGetClkMonStatus() -func DeviceGetClkMonStatus(Device Device) (ClkMonStatus, Return) { - var Status ClkMonStatus - ret := nvmlDeviceGetClkMonStatus(Device, &Status) - return Status, ret +func (l *library) DeviceGetClkMonStatus(device Device) (ClkMonStatus, Return) { + return device.GetClkMonStatus() } -func (Device Device) GetClkMonStatus() (ClkMonStatus, Return) { - return DeviceGetClkMonStatus(Device) +func (device nvmlDevice) GetClkMonStatus() (ClkMonStatus, Return) { + var status ClkMonStatus + ret := nvmlDeviceGetClkMonStatus(device, &status) + return status, ret } // nvml.DeviceSetApplicationsClocks() -func DeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return { - return nvmlDeviceSetApplicationsClocks(Device, MemClockMHz, GraphicsClockMHz) +func (l *library) DeviceSetApplicationsClocks(device Device, memClockMHz uint32, graphicsClockMHz uint32) Return { + return device.SetApplicationsClocks(memClockMHz, graphicsClockMHz) } -func (Device Device) SetApplicationsClocks(MemClockMHz uint32, GraphicsClockMHz uint32) Return { - return DeviceSetApplicationsClocks(Device, MemClockMHz, GraphicsClockMHz) +func (device nvmlDevice) SetApplicationsClocks(memClockMHz uint32, graphicsClockMHz uint32) Return { + return nvmlDeviceSetApplicationsClocks(device, memClockMHz, graphicsClockMHz) } // nvml.DeviceSetPowerManagementLimit() -func DeviceSetPowerManagementLimit(Device Device, Limit uint32) Return { - return nvmlDeviceSetPowerManagementLimit(Device, Limit) +func (l *library) DeviceSetPowerManagementLimit(device Device, limit uint32) Return { + return device.SetPowerManagementLimit(limit) } -func (Device Device) SetPowerManagementLimit(Limit uint32) Return { - return DeviceSetPowerManagementLimit(Device, Limit) +func (device nvmlDevice) SetPowerManagementLimit(limit uint32) Return { + return nvmlDeviceSetPowerManagementLimit(device, limit) } // nvml.DeviceSetGpuOperationMode() -func DeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return { - return nvmlDeviceSetGpuOperationMode(Device, Mode) +func (l *library) DeviceSetGpuOperationMode(device Device, mode GpuOperationMode) Return { + return device.SetGpuOperationMode(mode) } -func (Device Device) SetGpuOperationMode(Mode GpuOperationMode) Return { - return DeviceSetGpuOperationMode(Device, Mode) +func (device nvmlDevice) SetGpuOperationMode(mode GpuOperationMode) Return { + return nvmlDeviceSetGpuOperationMode(device, mode) } // nvml.DeviceSetAPIRestriction() -func DeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return { - return nvmlDeviceSetAPIRestriction(Device, ApiType, IsRestricted) +func (l *library) DeviceSetAPIRestriction(device Device, apiType RestrictedAPI, isRestricted EnableState) Return { + return device.SetAPIRestriction(apiType, isRestricted) } -func (Device Device) SetAPIRestriction(ApiType RestrictedAPI, IsRestricted EnableState) Return { - return DeviceSetAPIRestriction(Device, ApiType, IsRestricted) +func (device nvmlDevice) SetAPIRestriction(apiType RestrictedAPI, isRestricted EnableState) Return { + return nvmlDeviceSetAPIRestriction(device, apiType, isRestricted) } // nvml.DeviceSetAccountingMode() -func DeviceSetAccountingMode(Device Device, Mode EnableState) Return { - return nvmlDeviceSetAccountingMode(Device, Mode) +func (l *library) DeviceSetAccountingMode(device Device, mode EnableState) Return { + return device.SetAccountingMode(mode) } -func (Device Device) SetAccountingMode(Mode EnableState) Return { - return DeviceSetAccountingMode(Device, Mode) +func (device nvmlDevice) SetAccountingMode(mode EnableState) Return { + return nvmlDeviceSetAccountingMode(device, mode) } // nvml.DeviceClearAccountingPids() -func DeviceClearAccountingPids(Device Device) Return { - return nvmlDeviceClearAccountingPids(Device) +func (l *library) DeviceClearAccountingPids(device Device) Return { + return device.ClearAccountingPids() } -func (Device Device) ClearAccountingPids() Return { - return DeviceClearAccountingPids(Device) +func (device nvmlDevice) ClearAccountingPids() Return { + return nvmlDeviceClearAccountingPids(device) } // nvml.DeviceGetNvLinkState() -func DeviceGetNvLinkState(Device Device, Link int) (EnableState, Return) { - var IsActive EnableState - ret := nvmlDeviceGetNvLinkState(Device, uint32(Link), &IsActive) - return IsActive, ret +func (l *library) DeviceGetNvLinkState(device Device, link int) (EnableState, Return) { + return device.GetNvLinkState(link) } -func (Device Device) GetNvLinkState(Link int) (EnableState, Return) { - return DeviceGetNvLinkState(Device, Link) +func (device nvmlDevice) GetNvLinkState(link int) (EnableState, Return) { + var isActive EnableState + ret := nvmlDeviceGetNvLinkState(device, uint32(link), &isActive) + return isActive, ret } // nvml.DeviceGetNvLinkVersion() -func DeviceGetNvLinkVersion(Device Device, Link int) (uint32, Return) { - var Version uint32 - ret := nvmlDeviceGetNvLinkVersion(Device, uint32(Link), &Version) - return Version, ret +func (l *library) DeviceGetNvLinkVersion(device Device, link int) (uint32, Return) { + return device.GetNvLinkVersion(link) } -func (Device Device) GetNvLinkVersion(Link int) (uint32, Return) { - return DeviceGetNvLinkVersion(Device, Link) +func (device nvmlDevice) GetNvLinkVersion(link int) (uint32, Return) { + var version uint32 + ret := nvmlDeviceGetNvLinkVersion(device, uint32(link), &version) + return version, ret } // nvml.DeviceGetNvLinkCapability() -func DeviceGetNvLinkCapability(Device Device, Link int, Capability NvLinkCapability) (uint32, Return) { - var CapResult uint32 - ret := nvmlDeviceGetNvLinkCapability(Device, uint32(Link), Capability, &CapResult) - return CapResult, ret +func (l *library) DeviceGetNvLinkCapability(device Device, link int, capability NvLinkCapability) (uint32, Return) { + return device.GetNvLinkCapability(link, capability) } -func (Device Device) GetNvLinkCapability(Link int, Capability NvLinkCapability) (uint32, Return) { - return DeviceGetNvLinkCapability(Device, Link, Capability) +func (device nvmlDevice) GetNvLinkCapability(link int, capability NvLinkCapability) (uint32, Return) { + var capResult uint32 + ret := nvmlDeviceGetNvLinkCapability(device, uint32(link), capability, &capResult) + return capResult, ret } // nvml.DeviceGetNvLinkRemotePciInfo() -func DeviceGetNvLinkRemotePciInfo(Device Device, Link int) (PciInfo, Return) { - var Pci PciInfo - ret := nvmlDeviceGetNvLinkRemotePciInfo(Device, uint32(Link), &Pci) - return Pci, ret +func (l *library) DeviceGetNvLinkRemotePciInfo(device Device, link int) (PciInfo, Return) { + return device.GetNvLinkRemotePciInfo(link) } -func (Device Device) GetNvLinkRemotePciInfo(Link int) (PciInfo, Return) { - return DeviceGetNvLinkRemotePciInfo(Device, Link) +func (device nvmlDevice) GetNvLinkRemotePciInfo(link int) (PciInfo, Return) { + var pci PciInfo + ret := nvmlDeviceGetNvLinkRemotePciInfo(device, uint32(link), &pci) + return pci, ret } // nvml.DeviceGetNvLinkErrorCounter() -func DeviceGetNvLinkErrorCounter(Device Device, Link int, Counter NvLinkErrorCounter) (uint64, Return) { - var CounterValue uint64 - ret := nvmlDeviceGetNvLinkErrorCounter(Device, uint32(Link), Counter, &CounterValue) - return CounterValue, ret +func (l *library) DeviceGetNvLinkErrorCounter(device Device, link int, counter NvLinkErrorCounter) (uint64, Return) { + return device.GetNvLinkErrorCounter(link, counter) } -func (Device Device) GetNvLinkErrorCounter(Link int, Counter NvLinkErrorCounter) (uint64, Return) { - return DeviceGetNvLinkErrorCounter(Device, Link, Counter) +func (device nvmlDevice) GetNvLinkErrorCounter(link int, counter NvLinkErrorCounter) (uint64, Return) { + var counterValue uint64 + ret := nvmlDeviceGetNvLinkErrorCounter(device, uint32(link), counter, &counterValue) + return counterValue, ret } // nvml.DeviceResetNvLinkErrorCounters() -func DeviceResetNvLinkErrorCounters(Device Device, Link int) Return { - return nvmlDeviceResetNvLinkErrorCounters(Device, uint32(Link)) +func (l *library) DeviceResetNvLinkErrorCounters(device Device, link int) Return { + return device.ResetNvLinkErrorCounters(link) } -func (Device Device) ResetNvLinkErrorCounters(Link int) Return { - return DeviceResetNvLinkErrorCounters(Device, Link) +func (device nvmlDevice) ResetNvLinkErrorCounters(link int) Return { + return nvmlDeviceResetNvLinkErrorCounters(device, uint32(link)) } // nvml.DeviceSetNvLinkUtilizationControl() -func DeviceSetNvLinkUtilizationControl(Device Device, Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { - reset := uint32(0) - if Reset { - reset = 1 - } - return nvmlDeviceSetNvLinkUtilizationControl(Device, uint32(Link), uint32(Counter), Control, reset) +func (l *library) DeviceSetNvLinkUtilizationControl(device Device, link int, counter int, control *NvLinkUtilizationControl, reset bool) Return { + return device.SetNvLinkUtilizationControl(link, counter, control, reset) } -func (Device Device) SetNvLinkUtilizationControl(Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { - return DeviceSetNvLinkUtilizationControl(Device, Link, Counter, Control, Reset) +func (device nvmlDevice) SetNvLinkUtilizationControl(link int, counter int, control *NvLinkUtilizationControl, reset bool) Return { + resetValue := uint32(0) + if reset { + resetValue = 1 + } + return nvmlDeviceSetNvLinkUtilizationControl(device, uint32(link), uint32(counter), control, resetValue) } // nvml.DeviceGetNvLinkUtilizationControl() -func DeviceGetNvLinkUtilizationControl(Device Device, Link int, Counter int) (NvLinkUtilizationControl, Return) { - var Control NvLinkUtilizationControl - ret := nvmlDeviceGetNvLinkUtilizationControl(Device, uint32(Link), uint32(Counter), &Control) - return Control, ret +func (l *library) DeviceGetNvLinkUtilizationControl(device Device, link int, counter int) (NvLinkUtilizationControl, Return) { + return device.GetNvLinkUtilizationControl(link, counter) } -func (Device Device) GetNvLinkUtilizationControl(Link int, Counter int) (NvLinkUtilizationControl, Return) { - return DeviceGetNvLinkUtilizationControl(Device, Link, Counter) +func (device nvmlDevice) GetNvLinkUtilizationControl(link int, counter int) (NvLinkUtilizationControl, Return) { + var control NvLinkUtilizationControl + ret := nvmlDeviceGetNvLinkUtilizationControl(device, uint32(link), uint32(counter), &control) + return control, ret } // nvml.DeviceGetNvLinkUtilizationCounter() -func DeviceGetNvLinkUtilizationCounter(Device Device, Link int, Counter int) (uint64, uint64, Return) { - var Rxcounter, Txcounter uint64 - ret := nvmlDeviceGetNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter), &Rxcounter, &Txcounter) - return Rxcounter, Txcounter, ret +func (l *library) DeviceGetNvLinkUtilizationCounter(device Device, link int, counter int) (uint64, uint64, Return) { + return device.GetNvLinkUtilizationCounter(link, counter) } -func (Device Device) GetNvLinkUtilizationCounter(Link int, Counter int) (uint64, uint64, Return) { - return DeviceGetNvLinkUtilizationCounter(Device, Link, Counter) +func (device nvmlDevice) GetNvLinkUtilizationCounter(link int, counter int) (uint64, uint64, Return) { + var rxCounter, txCounter uint64 + ret := nvmlDeviceGetNvLinkUtilizationCounter(device, uint32(link), uint32(counter), &rxCounter, &txCounter) + return rxCounter, txCounter, ret } // nvml.DeviceFreezeNvLinkUtilizationCounter() -func DeviceFreezeNvLinkUtilizationCounter(Device Device, Link int, Counter int, Freeze EnableState) Return { - return nvmlDeviceFreezeNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter), Freeze) +func (l *library) DeviceFreezeNvLinkUtilizationCounter(device Device, link int, counter int, freeze EnableState) Return { + return device.FreezeNvLinkUtilizationCounter(link, counter, freeze) } -func (Device Device) FreezeNvLinkUtilizationCounter(Link int, Counter int, Freeze EnableState) Return { - return DeviceFreezeNvLinkUtilizationCounter(Device, Link, Counter, Freeze) +func (device nvmlDevice) FreezeNvLinkUtilizationCounter(link int, counter int, freeze EnableState) Return { + return nvmlDeviceFreezeNvLinkUtilizationCounter(device, uint32(link), uint32(counter), freeze) } // nvml.DeviceResetNvLinkUtilizationCounter() -func DeviceResetNvLinkUtilizationCounter(Device Device, Link int, Counter int) Return { - return nvmlDeviceResetNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter)) +func (l *library) DeviceResetNvLinkUtilizationCounter(device Device, link int, counter int) Return { + return device.ResetNvLinkUtilizationCounter(link, counter) } -func (Device Device) ResetNvLinkUtilizationCounter(Link int, Counter int) Return { - return DeviceResetNvLinkUtilizationCounter(Device, Link, Counter) +func (device nvmlDevice) ResetNvLinkUtilizationCounter(link int, counter int) Return { + return nvmlDeviceResetNvLinkUtilizationCounter(device, uint32(link), uint32(counter)) } // nvml.DeviceGetNvLinkRemoteDeviceType() -func DeviceGetNvLinkRemoteDeviceType(Device Device, Link int) (IntNvLinkDeviceType, Return) { - var NvLinkDeviceType IntNvLinkDeviceType - ret := nvmlDeviceGetNvLinkRemoteDeviceType(Device, uint32(Link), &NvLinkDeviceType) - return NvLinkDeviceType, ret +func (l *library) DeviceGetNvLinkRemoteDeviceType(device Device, link int) (IntNvLinkDeviceType, Return) { + return device.GetNvLinkRemoteDeviceType(link) } -func (Device Device) GetNvLinkRemoteDeviceType(Link int) (IntNvLinkDeviceType, Return) { - return DeviceGetNvLinkRemoteDeviceType(Device, Link) +func (device nvmlDevice) GetNvLinkRemoteDeviceType(link int) (IntNvLinkDeviceType, Return) { + var nvLinkDeviceType IntNvLinkDeviceType + ret := nvmlDeviceGetNvLinkRemoteDeviceType(device, uint32(link), &nvLinkDeviceType) + return nvLinkDeviceType, ret } // nvml.DeviceRegisterEvents() -func DeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return { - return nvmlDeviceRegisterEvents(Device, EventTypes, Set) +func (l *library) DeviceRegisterEvents(device Device, eventTypes uint64, set EventSet) Return { + return device.RegisterEvents(eventTypes, set) } -func (Device Device) RegisterEvents(EventTypes uint64, Set EventSet) Return { - return DeviceRegisterEvents(Device, EventTypes, Set) +func (device nvmlDevice) RegisterEvents(eventTypes uint64, set EventSet) Return { + return nvmlDeviceRegisterEvents(device, eventTypes, set.(nvmlEventSet)) } // nvmlDeviceGetSupportedEventTypes() -func DeviceGetSupportedEventTypes(Device Device) (uint64, Return) { - var EventTypes uint64 - ret := nvmlDeviceGetSupportedEventTypes(Device, &EventTypes) - return EventTypes, ret +func (l *library) DeviceGetSupportedEventTypes(device Device) (uint64, Return) { + return device.GetSupportedEventTypes() } -func (Device Device) GetSupportedEventTypes() (uint64, Return) { - return DeviceGetSupportedEventTypes(Device) +func (device nvmlDevice) GetSupportedEventTypes() (uint64, Return) { + var eventTypes uint64 + ret := nvmlDeviceGetSupportedEventTypes(device, &eventTypes) + return eventTypes, ret } // nvml.DeviceModifyDrainState() -func DeviceModifyDrainState(PciInfo *PciInfo, NewState EnableState) Return { - return nvmlDeviceModifyDrainState(PciInfo, NewState) +func (l *library) DeviceModifyDrainState(pciInfo *PciInfo, newState EnableState) Return { + return nvmlDeviceModifyDrainState(pciInfo, newState) } // nvml.DeviceQueryDrainState() -func DeviceQueryDrainState(PciInfo *PciInfo) (EnableState, Return) { - var CurrentState EnableState - ret := nvmlDeviceQueryDrainState(PciInfo, &CurrentState) - return CurrentState, ret +func (l *library) DeviceQueryDrainState(pciInfo *PciInfo) (EnableState, Return) { + var currentState EnableState + ret := nvmlDeviceQueryDrainState(pciInfo, ¤tState) + return currentState, ret } // nvml.DeviceRemoveGpu() -func DeviceRemoveGpu(PciInfo *PciInfo) Return { - return nvmlDeviceRemoveGpu(PciInfo) +func (l *library) DeviceRemoveGpu(pciInfo *PciInfo) Return { + return nvmlDeviceRemoveGpu(pciInfo) } // nvml.DeviceRemoveGpu_v2() -func DeviceRemoveGpu_v2(PciInfo *PciInfo, GpuState DetachGpuState, LinkState PcieLinkState) Return { - return nvmlDeviceRemoveGpu_v2(PciInfo, GpuState, LinkState) +func (l *library) DeviceRemoveGpu_v2(pciInfo *PciInfo, gpuState DetachGpuState, linkState PcieLinkState) Return { + return nvmlDeviceRemoveGpu_v2(pciInfo, gpuState, linkState) } // nvml.DeviceDiscoverGpus() -func DeviceDiscoverGpus() (PciInfo, Return) { - var PciInfo PciInfo - ret := nvmlDeviceDiscoverGpus(&PciInfo) - return PciInfo, ret +func (l *library) DeviceDiscoverGpus() (PciInfo, Return) { + var pciInfo PciInfo + ret := nvmlDeviceDiscoverGpus(&pciInfo) + return pciInfo, ret } // nvml.DeviceGetFieldValues() -func DeviceGetFieldValues(Device Device, Values []FieldValue) Return { - ValuesCount := len(Values) - return nvmlDeviceGetFieldValues(Device, int32(ValuesCount), &Values[0]) +func (l *library) DeviceGetFieldValues(device Device, values []FieldValue) Return { + return device.GetFieldValues(values) } -func (Device Device) GetFieldValues(Values []FieldValue) Return { - return DeviceGetFieldValues(Device, Values) +func (device nvmlDevice) GetFieldValues(values []FieldValue) Return { + valuesCount := len(values) + return nvmlDeviceGetFieldValues(device, int32(valuesCount), &values[0]) } // nvml.DeviceGetVirtualizationMode() -func DeviceGetVirtualizationMode(Device Device) (GpuVirtualizationMode, Return) { - var PVirtualMode GpuVirtualizationMode - ret := nvmlDeviceGetVirtualizationMode(Device, &PVirtualMode) - return PVirtualMode, ret +func (l *library) DeviceGetVirtualizationMode(device Device) (GpuVirtualizationMode, Return) { + return device.GetVirtualizationMode() } -func (Device Device) GetVirtualizationMode() (GpuVirtualizationMode, Return) { - return DeviceGetVirtualizationMode(Device) +func (device nvmlDevice) GetVirtualizationMode() (GpuVirtualizationMode, Return) { + var pVirtualMode GpuVirtualizationMode + ret := nvmlDeviceGetVirtualizationMode(device, &pVirtualMode) + return pVirtualMode, ret } // nvml.DeviceGetHostVgpuMode() -func DeviceGetHostVgpuMode(Device Device) (HostVgpuMode, Return) { - var PHostVgpuMode HostVgpuMode - ret := nvmlDeviceGetHostVgpuMode(Device, &PHostVgpuMode) - return PHostVgpuMode, ret +func (l *library) DeviceGetHostVgpuMode(device Device) (HostVgpuMode, Return) { + return device.GetHostVgpuMode() } -func (Device Device) GetHostVgpuMode() (HostVgpuMode, Return) { - return DeviceGetHostVgpuMode(Device) +func (device nvmlDevice) GetHostVgpuMode() (HostVgpuMode, Return) { + var pHostVgpuMode HostVgpuMode + ret := nvmlDeviceGetHostVgpuMode(device, &pHostVgpuMode) + return pHostVgpuMode, ret } // nvml.DeviceSetVirtualizationMode() -func DeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return { - return nvmlDeviceSetVirtualizationMode(Device, VirtualMode) +func (l *library) DeviceSetVirtualizationMode(device Device, virtualMode GpuVirtualizationMode) Return { + return device.SetVirtualizationMode(virtualMode) } -func (Device Device) SetVirtualizationMode(VirtualMode GpuVirtualizationMode) Return { - return DeviceSetVirtualizationMode(Device, VirtualMode) +func (device nvmlDevice) SetVirtualizationMode(virtualMode GpuVirtualizationMode) Return { + return nvmlDeviceSetVirtualizationMode(device, virtualMode) } // nvml.DeviceGetGridLicensableFeatures() -func DeviceGetGridLicensableFeatures(Device Device) (GridLicensableFeatures, Return) { - var PGridLicensableFeatures GridLicensableFeatures - ret := nvmlDeviceGetGridLicensableFeatures(Device, &PGridLicensableFeatures) - return PGridLicensableFeatures, ret +func (l *library) DeviceGetGridLicensableFeatures(device Device) (GridLicensableFeatures, Return) { + return device.GetGridLicensableFeatures() } -func (Device Device) GetGridLicensableFeatures() (GridLicensableFeatures, Return) { - return DeviceGetGridLicensableFeatures(Device) +func (device nvmlDevice) GetGridLicensableFeatures() (GridLicensableFeatures, Return) { + var pGridLicensableFeatures GridLicensableFeatures + ret := nvmlDeviceGetGridLicensableFeatures(device, &pGridLicensableFeatures) + return pGridLicensableFeatures, ret } // nvml.DeviceGetProcessUtilization() -func DeviceGetProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) { - var ProcessSamplesCount uint32 - ret := nvmlDeviceGetProcessUtilization(Device, nil, &ProcessSamplesCount, LastSeenTimeStamp) +func (l *library) DeviceGetProcessUtilization(device Device, lastSeenTimestamp uint64) ([]ProcessUtilizationSample, Return) { + return device.GetProcessUtilization(lastSeenTimestamp) +} + +func (device nvmlDevice) GetProcessUtilization(lastSeenTimestamp uint64) ([]ProcessUtilizationSample, Return) { + var processSamplesCount uint32 + ret := nvmlDeviceGetProcessUtilization(device, nil, &processSamplesCount, lastSeenTimestamp) if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - if ProcessSamplesCount == 0 { + if processSamplesCount == 0 { return []ProcessUtilizationSample{}, ret } - Utilization := make([]ProcessUtilizationSample, ProcessSamplesCount) - ret = nvmlDeviceGetProcessUtilization(Device, &Utilization[0], &ProcessSamplesCount, LastSeenTimeStamp) - return Utilization[:ProcessSamplesCount], ret + utilization := make([]ProcessUtilizationSample, processSamplesCount) + ret = nvmlDeviceGetProcessUtilization(device, &utilization[0], &processSamplesCount, lastSeenTimestamp) + return utilization[:processSamplesCount], ret } -func (Device Device) GetProcessUtilization(LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) { - return DeviceGetProcessUtilization(Device, LastSeenTimeStamp) +// nvml.DeviceGetSupportedVgpus() +func (l *library) DeviceGetSupportedVgpus(device Device) ([]VgpuTypeId, Return) { + return device.GetSupportedVgpus() } -// nvml.DeviceGetSupportedVgpus() -func DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) { - var VgpuCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetSupportedVgpus() ([]VgpuTypeId, Return) { + var vgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuTypeIds := make([]VgpuTypeId, VgpuCount) - ret := nvmlDeviceGetSupportedVgpus(Device, &VgpuCount, &VgpuTypeIds[0]) + vgpuTypeIds := make([]nvmlVgpuTypeId, vgpuCount) + ret := nvmlDeviceGetSupportedVgpus(device, &vgpuCount, &vgpuTypeIds[0]) if ret == SUCCESS { - return VgpuTypeIds[:VgpuCount], ret + return convertSlice[nvmlVgpuTypeId, VgpuTypeId](vgpuTypeIds[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } -func (Device Device) GetSupportedVgpus() ([]VgpuTypeId, Return) { - return DeviceGetSupportedVgpus(Device) +// nvml.DeviceGetCreatableVgpus() +func (l *library) DeviceGetCreatableVgpus(device Device) ([]VgpuTypeId, Return) { + return device.GetCreatableVgpus() } -// nvml.DeviceGetCreatableVgpus() -func DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) { - var VgpuCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetCreatableVgpus() ([]VgpuTypeId, Return) { + var vgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuTypeIds := make([]VgpuTypeId, VgpuCount) - ret := nvmlDeviceGetCreatableVgpus(Device, &VgpuCount, &VgpuTypeIds[0]) + vgpuTypeIds := make([]nvmlVgpuTypeId, vgpuCount) + ret := nvmlDeviceGetCreatableVgpus(device, &vgpuCount, &vgpuTypeIds[0]) if ret == SUCCESS { - return VgpuTypeIds[:VgpuCount], ret + return convertSlice[nvmlVgpuTypeId, VgpuTypeId](vgpuTypeIds[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } -func (Device Device) GetCreatableVgpus() ([]VgpuTypeId, Return) { - return DeviceGetCreatableVgpus(Device) +// nvml.DeviceGetActiveVgpus() +func (l *library) DeviceGetActiveVgpus(device Device) ([]VgpuInstance, Return) { + return device.GetActiveVgpus() } -// nvml.DeviceGetActiveVgpus() -func DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) { - var VgpuCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetActiveVgpus() ([]VgpuInstance, Return) { + var vgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuInstances := make([]VgpuInstance, VgpuCount) - ret := nvmlDeviceGetActiveVgpus(Device, &VgpuCount, &VgpuInstances[0]) + vgpuInstances := make([]nvmlVgpuInstance, vgpuCount) + ret := nvmlDeviceGetActiveVgpus(device, &vgpuCount, &vgpuInstances[0]) if ret == SUCCESS { - return VgpuInstances[:VgpuCount], ret + return convertSlice[nvmlVgpuInstance, VgpuInstance](vgpuInstances[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } -func (Device Device) GetActiveVgpus() ([]VgpuInstance, Return) { - return DeviceGetActiveVgpus(Device) +// nvml.DeviceGetVgpuMetadata() +func (l *library) DeviceGetVgpuMetadata(device Device) (VgpuPgpuMetadata, Return) { + return device.GetVgpuMetadata() } -// nvml.DeviceGetVgpuMetadata() -func DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return) { - var VgpuPgpuMetadata VgpuPgpuMetadata - OpaqueDataSize := unsafe.Sizeof(VgpuPgpuMetadata.nvmlVgpuPgpuMetadata.OpaqueData) - VgpuPgpuMetadataSize := unsafe.Sizeof(VgpuPgpuMetadata.nvmlVgpuPgpuMetadata) - OpaqueDataSize +func (device nvmlDevice) GetVgpuMetadata() (VgpuPgpuMetadata, Return) { + var vgpuPgpuMetadata VgpuPgpuMetadata + opaqueDataSize := unsafe.Sizeof(vgpuPgpuMetadata.nvmlVgpuPgpuMetadata.OpaqueData) + vgpuPgpuMetadataSize := unsafe.Sizeof(vgpuPgpuMetadata.nvmlVgpuPgpuMetadata) - opaqueDataSize for { - BufferSize := uint32(VgpuPgpuMetadataSize + OpaqueDataSize) - Buffer := make([]byte, BufferSize) - nvmlVgpuPgpuMetadataPtr := (*nvmlVgpuPgpuMetadata)(unsafe.Pointer(&Buffer[0])) - ret := nvmlDeviceGetVgpuMetadata(Device, nvmlVgpuPgpuMetadataPtr, &BufferSize) + bufferSize := uint32(vgpuPgpuMetadataSize + opaqueDataSize) + buffer := make([]byte, bufferSize) + nvmlVgpuPgpuMetadataPtr := (*nvmlVgpuPgpuMetadata)(unsafe.Pointer(&buffer[0])) + ret := nvmlDeviceGetVgpuMetadata(device, nvmlVgpuPgpuMetadataPtr, &bufferSize) if ret == SUCCESS { - VgpuPgpuMetadata.nvmlVgpuPgpuMetadata = *nvmlVgpuPgpuMetadataPtr - VgpuPgpuMetadata.OpaqueData = Buffer[VgpuPgpuMetadataSize:BufferSize] - return VgpuPgpuMetadata, ret + vgpuPgpuMetadata.nvmlVgpuPgpuMetadata = *nvmlVgpuPgpuMetadataPtr + vgpuPgpuMetadata.OpaqueData = buffer[vgpuPgpuMetadataSize:bufferSize] + return vgpuPgpuMetadata, ret } if ret != ERROR_INSUFFICIENT_SIZE { - return VgpuPgpuMetadata, ret + return vgpuPgpuMetadata, ret } - OpaqueDataSize = 2 * OpaqueDataSize + opaqueDataSize = 2 * opaqueDataSize } } -func (Device Device) GetVgpuMetadata() (VgpuPgpuMetadata, Return) { - return DeviceGetVgpuMetadata(Device) +// nvml.DeviceGetPgpuMetadataString() +func (l *library) DeviceGetPgpuMetadataString(device Device) (string, Return) { + return device.GetPgpuMetadataString() } -// nvml.DeviceGetPgpuMetadataString() -func DeviceGetPgpuMetadataString(Device Device) (string, Return) { - var BufferSize uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetPgpuMetadataString() (string, Return) { + var bufferSize uint32 = 1 // Will be reduced upon returning for { - PgpuMetadata := make([]byte, BufferSize) - ret := nvmlDeviceGetPgpuMetadataString(Device, &PgpuMetadata[0], &BufferSize) + pgpuMetadata := make([]byte, bufferSize) + ret := nvmlDeviceGetPgpuMetadataString(device, &pgpuMetadata[0], &bufferSize) if ret == SUCCESS { - return string(PgpuMetadata[:clen(PgpuMetadata)]), ret + return string(pgpuMetadata[:clen(pgpuMetadata)]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return "", ret } - BufferSize *= 2 + bufferSize *= 2 } } -func (Device Device) GetPgpuMetadataString() (string, Return) { - return DeviceGetPgpuMetadataString(Device) +// nvml.DeviceGetVgpuUtilization() +func (l *library) DeviceGetVgpuUtilization(device Device, lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { + return device.GetVgpuUtilization(lastSeenTimestamp) } -// nvml.DeviceGetVgpuUtilization() -func DeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { - var SampleValType ValueType - var VgpuInstanceSamplesCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetVgpuUtilization(lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { + var sampleValType ValueType + var vgpuInstanceSamplesCount uint32 = 1 // Will be reduced upon returning for { - UtilizationSamples := make([]VgpuInstanceUtilizationSample, VgpuInstanceSamplesCount) - ret := nvmlDeviceGetVgpuUtilization(Device, LastSeenTimeStamp, &SampleValType, &VgpuInstanceSamplesCount, &UtilizationSamples[0]) + utilizationSamples := make([]VgpuInstanceUtilizationSample, vgpuInstanceSamplesCount) + ret := nvmlDeviceGetVgpuUtilization(device, lastSeenTimestamp, &sampleValType, &vgpuInstanceSamplesCount, &utilizationSamples[0]) if ret == SUCCESS { - return SampleValType, UtilizationSamples[:VgpuInstanceSamplesCount], ret + return sampleValType, utilizationSamples[:vgpuInstanceSamplesCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { - return SampleValType, nil, ret + return sampleValType, nil, ret } - VgpuInstanceSamplesCount *= 2 + vgpuInstanceSamplesCount *= 2 } } -func (Device Device) GetVgpuUtilization(LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { - return DeviceGetVgpuUtilization(Device, LastSeenTimeStamp) -} - // nvml.DeviceGetAttributes() -func DeviceGetAttributes(Device Device) (DeviceAttributes, Return) { - var Attributes DeviceAttributes - ret := nvmlDeviceGetAttributes(Device, &Attributes) - return Attributes, ret +func (l *library) DeviceGetAttributes(device Device) (DeviceAttributes, Return) { + return device.GetAttributes() } -func (Device Device) GetAttributes() (DeviceAttributes, Return) { - return DeviceGetAttributes(Device) +func (device nvmlDevice) GetAttributes() (DeviceAttributes, Return) { + var attributes DeviceAttributes + ret := nvmlDeviceGetAttributes(device, &attributes) + return attributes, ret } // nvml.DeviceGetRemappedRows() -func DeviceGetRemappedRows(Device Device) (int, int, bool, bool, Return) { - var CorrRows, UncRows, IsPending, FailureOccured uint32 - ret := nvmlDeviceGetRemappedRows(Device, &CorrRows, &UncRows, &IsPending, &FailureOccured) - return int(CorrRows), int(UncRows), (IsPending != 0), (FailureOccured != 0), ret +func (l *library) DeviceGetRemappedRows(device Device) (int, int, bool, bool, Return) { + return device.GetRemappedRows() } -func (Device Device) GetRemappedRows() (int, int, bool, bool, Return) { - return DeviceGetRemappedRows(Device) +func (device nvmlDevice) GetRemappedRows() (int, int, bool, bool, Return) { + var corrRows, uncRows, isPending, failureOccured uint32 + ret := nvmlDeviceGetRemappedRows(device, &corrRows, &uncRows, &isPending, &failureOccured) + return int(corrRows), int(uncRows), (isPending != 0), (failureOccured != 0), ret } // nvml.DeviceGetRowRemapperHistogram() -func DeviceGetRowRemapperHistogram(Device Device) (RowRemapperHistogramValues, Return) { - var Values RowRemapperHistogramValues - ret := nvmlDeviceGetRowRemapperHistogram(Device, &Values) - return Values, ret +func (l *library) DeviceGetRowRemapperHistogram(device Device) (RowRemapperHistogramValues, Return) { + return device.GetRowRemapperHistogram() } -func (Device Device) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) { - return DeviceGetRowRemapperHistogram(Device) +func (device nvmlDevice) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) { + var values RowRemapperHistogramValues + ret := nvmlDeviceGetRowRemapperHistogram(device, &values) + return values, ret } // nvml.DeviceGetArchitecture() -func DeviceGetArchitecture(Device Device) (DeviceArchitecture, Return) { - var Arch DeviceArchitecture - ret := nvmlDeviceGetArchitecture(Device, &Arch) - return Arch, ret +func (l *library) DeviceGetArchitecture(device Device) (DeviceArchitecture, Return) { + return device.GetArchitecture() } -func (Device Device) GetArchitecture() (DeviceArchitecture, Return) { - return DeviceGetArchitecture(Device) +func (device nvmlDevice) GetArchitecture() (DeviceArchitecture, Return) { + var arch DeviceArchitecture + ret := nvmlDeviceGetArchitecture(device, &arch) + return arch, ret } // nvml.DeviceGetVgpuProcessUtilization() -func DeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) { - var VgpuProcessSamplesCount uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetVgpuProcessUtilization(device Device, lastSeenTimestamp uint64) ([]VgpuProcessUtilizationSample, Return) { + return device.GetVgpuProcessUtilization(lastSeenTimestamp) +} + +func (device nvmlDevice) GetVgpuProcessUtilization(lastSeenTimestamp uint64) ([]VgpuProcessUtilizationSample, Return) { + var vgpuProcessSamplesCount uint32 = 1 // Will be reduced upon returning for { - UtilizationSamples := make([]VgpuProcessUtilizationSample, VgpuProcessSamplesCount) - ret := nvmlDeviceGetVgpuProcessUtilization(Device, LastSeenTimeStamp, &VgpuProcessSamplesCount, &UtilizationSamples[0]) + utilizationSamples := make([]VgpuProcessUtilizationSample, vgpuProcessSamplesCount) + ret := nvmlDeviceGetVgpuProcessUtilization(device, lastSeenTimestamp, &vgpuProcessSamplesCount, &utilizationSamples[0]) if ret == SUCCESS { - return UtilizationSamples[:VgpuProcessSamplesCount], ret + return utilizationSamples[:vgpuProcessSamplesCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuProcessSamplesCount *= 2 + vgpuProcessSamplesCount *= 2 } } -func (Device Device) GetVgpuProcessUtilization(LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) { - return DeviceGetVgpuProcessUtilization(Device, LastSeenTimeStamp) -} - // nvml.GetExcludedDeviceCount() -func GetExcludedDeviceCount() (int, Return) { - var DeviceCount uint32 - ret := nvmlGetExcludedDeviceCount(&DeviceCount) - return int(DeviceCount), ret +func (l *library) GetExcludedDeviceCount() (int, Return) { + var deviceCount uint32 + ret := nvmlGetExcludedDeviceCount(&deviceCount) + return int(deviceCount), ret } // nvml.GetExcludedDeviceInfoByIndex() -func GetExcludedDeviceInfoByIndex(Index int) (ExcludedDeviceInfo, Return) { - var Info ExcludedDeviceInfo - ret := nvmlGetExcludedDeviceInfoByIndex(uint32(Index), &Info) - return Info, ret +func (l *library) GetExcludedDeviceInfoByIndex(index int) (ExcludedDeviceInfo, Return) { + var info ExcludedDeviceInfo + ret := nvmlGetExcludedDeviceInfoByIndex(uint32(index), &info) + return info, ret } // nvml.DeviceSetMigMode() -func DeviceSetMigMode(Device Device, Mode int) (Return, Return) { - var ActivationStatus Return - ret := nvmlDeviceSetMigMode(Device, uint32(Mode), &ActivationStatus) - return ActivationStatus, ret +func (l *library) DeviceSetMigMode(device Device, mode int) (Return, Return) { + return device.SetMigMode(mode) } -func (Device Device) SetMigMode(Mode int) (Return, Return) { - return DeviceSetMigMode(Device, Mode) +func (device nvmlDevice) SetMigMode(mode int) (Return, Return) { + var activationStatus Return + ret := nvmlDeviceSetMigMode(device, uint32(mode), &activationStatus) + return activationStatus, ret } // nvml.DeviceGetMigMode() -func DeviceGetMigMode(Device Device) (int, int, Return) { - var CurrentMode, PendingMode uint32 - ret := nvmlDeviceGetMigMode(Device, &CurrentMode, &PendingMode) - return int(CurrentMode), int(PendingMode), ret +func (l *library) DeviceGetMigMode(device Device) (int, int, Return) { + return device.GetMigMode() } -func (Device Device) GetMigMode() (int, int, Return) { - return DeviceGetMigMode(Device) +func (device nvmlDevice) GetMigMode() (int, int, Return) { + var currentMode, pendingMode uint32 + ret := nvmlDeviceGetMigMode(device, ¤tMode, &pendingMode) + return int(currentMode), int(pendingMode), ret } // nvml.DeviceGetGpuInstanceProfileInfo() -func DeviceGetGpuInstanceProfileInfo(Device Device, Profile int) (GpuInstanceProfileInfo, Return) { - var Info GpuInstanceProfileInfo - ret := nvmlDeviceGetGpuInstanceProfileInfo(Device, uint32(Profile), &Info) - return Info, ret +func (l *library) DeviceGetGpuInstanceProfileInfo(device Device, profile int) (GpuInstanceProfileInfo, Return) { + return device.GetGpuInstanceProfileInfo(profile) } -func (Device Device) GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) { - return DeviceGetGpuInstanceProfileInfo(Device, Profile) +func (device nvmlDevice) GetGpuInstanceProfileInfo(profile int) (GpuInstanceProfileInfo, Return) { + var info GpuInstanceProfileInfo + ret := nvmlDeviceGetGpuInstanceProfileInfo(device, uint32(profile), &info) + return info, ret } // nvml.DeviceGetGpuInstanceProfileInfoV() type GpuInstanceProfileInfoV struct { - device Device + device nvmlDevice profile int } -func (InfoV GpuInstanceProfileInfoV) V1() (GpuInstanceProfileInfo, Return) { - return DeviceGetGpuInstanceProfileInfo(InfoV.device, InfoV.profile) +func (infoV GpuInstanceProfileInfoV) V1() (GpuInstanceProfileInfo, Return) { + return DeviceGetGpuInstanceProfileInfo(infoV.device, infoV.profile) } -func (InfoV GpuInstanceProfileInfoV) V2() (GpuInstanceProfileInfo_v2, Return) { - var Info GpuInstanceProfileInfo_v2 - Info.Version = STRUCT_VERSION(Info, 2) - ret := nvmlDeviceGetGpuInstanceProfileInfoV(InfoV.device, uint32(InfoV.profile), &Info) - return Info, ret +func (infoV GpuInstanceProfileInfoV) V2() (GpuInstanceProfileInfo_v2, Return) { + var info GpuInstanceProfileInfo_v2 + info.Version = STRUCT_VERSION(info, 2) + ret := nvmlDeviceGetGpuInstanceProfileInfoV(infoV.device, uint32(infoV.profile), &info) + return info, ret } -func DeviceGetGpuInstanceProfileInfoV(Device Device, Profile int) GpuInstanceProfileInfoV { - return GpuInstanceProfileInfoV{Device, Profile} +func (l *library) DeviceGetGpuInstanceProfileInfoV(device Device, profile int) GpuInstanceProfileInfoV { + return device.GetGpuInstanceProfileInfoV(profile) } -func (Device Device) GetGpuInstanceProfileInfoV(Profile int) GpuInstanceProfileInfoV { - return DeviceGetGpuInstanceProfileInfoV(Device, Profile) +func (device nvmlDevice) GetGpuInstanceProfileInfoV(profile int) GpuInstanceProfileInfoV { + return GpuInstanceProfileInfoV{device, profile} } // nvml.DeviceGetGpuInstancePossiblePlacements() -func DeviceGetGpuInstancePossiblePlacements(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { - if Info == nil { +func (l *library) DeviceGetGpuInstancePossiblePlacements(device Device, info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { + return device.GetGpuInstancePossiblePlacements(info) +} + +func (device nvmlDevice) GetGpuInstancePossiblePlacements(info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { + if info == nil { return nil, ERROR_INVALID_ARGUMENT } - var Count uint32 - ret := nvmlDeviceGetGpuInstancePossiblePlacements(Device, Info.Id, nil, &Count) + var count uint32 + ret := nvmlDeviceGetGpuInstancePossiblePlacements(device, info.Id, nil, &count) if ret != SUCCESS { return nil, ret } - if Count == 0 { + if count == 0 { return []GpuInstancePlacement{}, ret } - Placements := make([]GpuInstancePlacement, Count) - ret = nvmlDeviceGetGpuInstancePossiblePlacements(Device, Info.Id, &Placements[0], &Count) - return Placements[:Count], ret + placements := make([]GpuInstancePlacement, count) + ret = nvmlDeviceGetGpuInstancePossiblePlacements(device, info.Id, &placements[0], &count) + return placements[:count], ret } -func (Device Device) GetGpuInstancePossiblePlacements(Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { - return DeviceGetGpuInstancePossiblePlacements(Device, Info) +// nvml.DeviceGetGpuInstanceRemainingCapacity() +func (l *library) DeviceGetGpuInstanceRemainingCapacity(device Device, info *GpuInstanceProfileInfo) (int, Return) { + return device.GetGpuInstanceRemainingCapacity(info) } -// nvml.DeviceGetGpuInstanceRemainingCapacity() -func DeviceGetGpuInstanceRemainingCapacity(Device Device, Info *GpuInstanceProfileInfo) (int, Return) { - if Info == nil { +func (device nvmlDevice) GetGpuInstanceRemainingCapacity(info *GpuInstanceProfileInfo) (int, Return) { + if info == nil { return 0, ERROR_INVALID_ARGUMENT } - var Count uint32 - ret := nvmlDeviceGetGpuInstanceRemainingCapacity(Device, Info.Id, &Count) - return int(Count), ret -} - -func (Device Device) GetGpuInstanceRemainingCapacity(Info *GpuInstanceProfileInfo) (int, Return) { - return DeviceGetGpuInstanceRemainingCapacity(Device, Info) + var count uint32 + ret := nvmlDeviceGetGpuInstanceRemainingCapacity(device, info.Id, &count) + return int(count), ret } // nvml.DeviceCreateGpuInstance() -func DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfileInfo) (GpuInstance, Return) { - if Info == nil { - return GpuInstance{}, ERROR_INVALID_ARGUMENT - } - var GpuInstance GpuInstance - ret := nvmlDeviceCreateGpuInstance(Device, Info.Id, &GpuInstance) - return GpuInstance, ret +func (l *library) DeviceCreateGpuInstance(device Device, info *GpuInstanceProfileInfo) (GpuInstance, Return) { + return device.CreateGpuInstance(info) } -func (Device Device) CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) { - return DeviceCreateGpuInstance(Device, Info) +func (device nvmlDevice) CreateGpuInstance(info *GpuInstanceProfileInfo) (GpuInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceCreateGpuInstance(device, info.Id, &gpuInstance) + return gpuInstance, ret } // nvml.DeviceCreateGpuInstanceWithPlacement() -func DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { - if Info == nil { - return GpuInstance{}, ERROR_INVALID_ARGUMENT - } - var GpuInstance GpuInstance - ret := nvmlDeviceCreateGpuInstanceWithPlacement(Device, Info.Id, Placement, &GpuInstance) - return GpuInstance, ret +func (l *library) DeviceCreateGpuInstanceWithPlacement(device Device, info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) { + return device.CreateGpuInstanceWithPlacement(info, placement) } -func (Device Device) CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { - return DeviceCreateGpuInstanceWithPlacement(Device, Info, Placement) +func (device nvmlDevice) CreateGpuInstanceWithPlacement(info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceCreateGpuInstanceWithPlacement(device, info.Id, placement, &gpuInstance) + return gpuInstance, ret } // nvml.GpuInstanceDestroy() -func GpuInstanceDestroy(GpuInstance GpuInstance) Return { - return nvmlGpuInstanceDestroy(GpuInstance) +func (l *library) GpuInstanceDestroy(gpuInstance GpuInstance) Return { + return gpuInstance.Destroy() } -func (GpuInstance GpuInstance) Destroy() Return { - return GpuInstanceDestroy(GpuInstance) +func (gpuInstance nvmlGpuInstance) Destroy() Return { + return nvmlGpuInstanceDestroy(gpuInstance) } // nvml.DeviceGetGpuInstances() -func DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - if Info == nil { - return nil, ERROR_INVALID_ARGUMENT - } - var Count uint32 = Info.InstanceCount - GpuInstances := make([]GpuInstance, Count) - ret := nvmlDeviceGetGpuInstances(Device, Info.Id, &GpuInstances[0], &Count) - return GpuInstances[:Count], ret +func (l *library) DeviceGetGpuInstances(device Device, info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { + return device.GetGpuInstances(info) } -func (Device Device) GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - return DeviceGetGpuInstances(Device, Info) +func (device nvmlDevice) GetGpuInstances(info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var count uint32 = info.InstanceCount + gpuInstances := make([]nvmlGpuInstance, count) + ret := nvmlDeviceGetGpuInstances(device, info.Id, &gpuInstances[0], &count) + return convertSlice[nvmlGpuInstance, GpuInstance](gpuInstances[:count]), ret } // nvml.DeviceGetGpuInstanceById() -func DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, Return) { - var GpuInstance GpuInstance - ret := nvmlDeviceGetGpuInstanceById(Device, uint32(Id), &GpuInstance) - return GpuInstance, ret +func (l *library) DeviceGetGpuInstanceById(device Device, id int) (GpuInstance, Return) { + return device.GetGpuInstanceById(id) } -func (Device Device) GetGpuInstanceById(Id int) (GpuInstance, Return) { - return DeviceGetGpuInstanceById(Device, Id) +func (device nvmlDevice) GetGpuInstanceById(id int) (GpuInstance, Return) { + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceGetGpuInstanceById(device, uint32(id), &gpuInstance) + return gpuInstance, ret } // nvml.GpuInstanceGetInfo() -func GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) { - var Info GpuInstanceInfo - ret := nvmlGpuInstanceGetInfo(GpuInstance, &Info) - return Info, ret +func (l *library) GpuInstanceGetInfo(gpuInstance GpuInstance) (GpuInstanceInfo, Return) { + return gpuInstance.GetInfo() } -func (GpuInstance GpuInstance) GetInfo() (GpuInstanceInfo, Return) { - return GpuInstanceGetInfo(GpuInstance) +func (gpuInstance nvmlGpuInstance) GetInfo() (GpuInstanceInfo, Return) { + var info nvmlGpuInstanceInfo + ret := nvmlGpuInstanceGetInfo(gpuInstance, &info) + return info.convert(), ret } // nvml.GpuInstanceGetComputeInstanceProfileInfo() -func GpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { - var Info ComputeInstanceProfileInfo - ret := nvmlGpuInstanceGetComputeInstanceProfileInfo(GpuInstance, uint32(Profile), uint32(EngProfile), &Info) - return Info, ret +func (l *library) GpuInstanceGetComputeInstanceProfileInfo(gpuInstance GpuInstance, profile int, engProfile int) (ComputeInstanceProfileInfo, Return) { + return gpuInstance.GetComputeInstanceProfileInfo(profile, engProfile) } -func (GpuInstance GpuInstance) GetComputeInstanceProfileInfo(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { - return GpuInstanceGetComputeInstanceProfileInfo(GpuInstance, Profile, EngProfile) +func (gpuInstance nvmlGpuInstance) GetComputeInstanceProfileInfo(profile int, engProfile int) (ComputeInstanceProfileInfo, Return) { + var info ComputeInstanceProfileInfo + ret := nvmlGpuInstanceGetComputeInstanceProfileInfo(gpuInstance, uint32(profile), uint32(engProfile), &info) + return info, ret } // nvml.GpuInstanceGetComputeInstanceProfileInfoV() type ComputeInstanceProfileInfoV struct { - gpuInstance GpuInstance + gpuInstance nvmlGpuInstance profile int engProfile int } -func (InfoV ComputeInstanceProfileInfoV) V1() (ComputeInstanceProfileInfo, Return) { - return GpuInstanceGetComputeInstanceProfileInfo(InfoV.gpuInstance, InfoV.profile, InfoV.engProfile) +func (infoV ComputeInstanceProfileInfoV) V1() (ComputeInstanceProfileInfo, Return) { + return GpuInstanceGetComputeInstanceProfileInfo(infoV.gpuInstance, infoV.profile, infoV.engProfile) } -func (InfoV ComputeInstanceProfileInfoV) V2() (ComputeInstanceProfileInfo_v2, Return) { - var Info ComputeInstanceProfileInfo_v2 - Info.Version = STRUCT_VERSION(Info, 2) - ret := nvmlGpuInstanceGetComputeInstanceProfileInfoV(InfoV.gpuInstance, uint32(InfoV.profile), uint32(InfoV.engProfile), &Info) - return Info, ret +func (infoV ComputeInstanceProfileInfoV) V2() (ComputeInstanceProfileInfo_v2, Return) { + var info ComputeInstanceProfileInfo_v2 + info.Version = STRUCT_VERSION(info, 2) + ret := nvmlGpuInstanceGetComputeInstanceProfileInfoV(infoV.gpuInstance, uint32(infoV.profile), uint32(infoV.engProfile), &info) + return info, ret } -func GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile int, EngProfile int) ComputeInstanceProfileInfoV { - return ComputeInstanceProfileInfoV{GpuInstance, Profile, EngProfile} +func (l *library) GpuInstanceGetComputeInstanceProfileInfoV(gpuInstance GpuInstance, profile int, engProfile int) ComputeInstanceProfileInfoV { + return gpuInstance.GetComputeInstanceProfileInfoV(profile, engProfile) } -func (GpuInstance GpuInstance) GetComputeInstanceProfileInfoV(Profile int, EngProfile int) ComputeInstanceProfileInfoV { - return GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance, Profile, EngProfile) +func (gpuInstance nvmlGpuInstance) GetComputeInstanceProfileInfoV(profile int, engProfile int) ComputeInstanceProfileInfoV { + return ComputeInstanceProfileInfoV{gpuInstance, profile, engProfile} } // nvml.GpuInstanceGetComputeInstanceRemainingCapacity() -func GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (int, Return) { - if Info == nil { - return 0, ERROR_INVALID_ARGUMENT - } - var Count uint32 - ret := nvmlGpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance, Info.Id, &Count) - return int(Count), ret +func (l *library) GpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (int, Return) { + return gpuInstance.GetComputeInstanceRemainingCapacity(info) } -func (GpuInstance GpuInstance) GetComputeInstanceRemainingCapacity(Info *ComputeInstanceProfileInfo) (int, Return) { - return GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance, Info) +func (gpuInstance nvmlGpuInstance) GetComputeInstanceRemainingCapacity(info *ComputeInstanceProfileInfo) (int, Return) { + if info == nil { + return 0, ERROR_INVALID_ARGUMENT + } + var count uint32 + ret := nvmlGpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance, info.Id, &count) + return int(count), ret } // nvml.GpuInstanceCreateComputeInstance() -func GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - if Info == nil { - return ComputeInstance{}, ERROR_INVALID_ARGUMENT - } - var ComputeInstance ComputeInstance - ret := nvmlGpuInstanceCreateComputeInstance(GpuInstance, Info.Id, &ComputeInstance) - return ComputeInstance, ret +func (l *library) GpuInstanceCreateComputeInstance(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { + return gpuInstance.CreateComputeInstance(info) } -func (GpuInstance GpuInstance) CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - return GpuInstanceCreateComputeInstance(GpuInstance, Info) +func (gpuInstance nvmlGpuInstance) CreateComputeInstance(info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var computeInstance nvmlComputeInstance + ret := nvmlGpuInstanceCreateComputeInstance(gpuInstance, info.Id, &computeInstance) + return computeInstance, ret } // nvml.ComputeInstanceDestroy() -func ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { - return nvmlComputeInstanceDestroy(ComputeInstance) +func (l *library) ComputeInstanceDestroy(computeInstance ComputeInstance) Return { + return computeInstance.Destroy() } -func (ComputeInstance ComputeInstance) Destroy() Return { - return ComputeInstanceDestroy(ComputeInstance) +func (computeInstance nvmlComputeInstance) Destroy() Return { + return nvmlComputeInstanceDestroy(computeInstance) } // nvml.GpuInstanceGetComputeInstances() -func GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - if Info == nil { - return nil, ERROR_INVALID_ARGUMENT - } - var Count uint32 = Info.InstanceCount - ComputeInstances := make([]ComputeInstance, Count) - ret := nvmlGpuInstanceGetComputeInstances(GpuInstance, Info.Id, &ComputeInstances[0], &Count) - return ComputeInstances[:Count], ret +func (l *library) GpuInstanceGetComputeInstances(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { + return gpuInstance.GetComputeInstances(info) } -func (GpuInstance GpuInstance) GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - return GpuInstanceGetComputeInstances(GpuInstance, Info) +func (gpuInstance nvmlGpuInstance) GetComputeInstances(info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var count uint32 = info.InstanceCount + computeInstances := make([]nvmlComputeInstance, count) + ret := nvmlGpuInstanceGetComputeInstances(gpuInstance, info.Id, &computeInstances[0], &count) + return convertSlice[nvmlComputeInstance, ComputeInstance](computeInstances[:count]), ret } // nvml.GpuInstanceGetComputeInstanceById() -func GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id int) (ComputeInstance, Return) { - var ComputeInstance ComputeInstance - ret := nvmlGpuInstanceGetComputeInstanceById(GpuInstance, uint32(Id), &ComputeInstance) - return ComputeInstance, ret +func (l *library) GpuInstanceGetComputeInstanceById(gpuInstance GpuInstance, id int) (ComputeInstance, Return) { + return gpuInstance.GetComputeInstanceById(id) } -func (GpuInstance GpuInstance) GetComputeInstanceById(Id int) (ComputeInstance, Return) { - return GpuInstanceGetComputeInstanceById(GpuInstance, Id) +func (gpuInstance nvmlGpuInstance) GetComputeInstanceById(id int) (ComputeInstance, Return) { + var computeInstance nvmlComputeInstance + ret := nvmlGpuInstanceGetComputeInstanceById(gpuInstance, uint32(id), &computeInstance) + return computeInstance, ret } // nvml.ComputeInstanceGetInfo() -func ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) { - var Info ComputeInstanceInfo - ret := nvmlComputeInstanceGetInfo(ComputeInstance, &Info) - return Info, ret +func (l *library) ComputeInstanceGetInfo(computeInstance ComputeInstance) (ComputeInstanceInfo, Return) { + return computeInstance.GetInfo() } -func (ComputeInstance ComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { - return ComputeInstanceGetInfo(ComputeInstance) +func (computeInstance nvmlComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { + var info nvmlComputeInstanceInfo + ret := nvmlComputeInstanceGetInfo(computeInstance, &info) + return info.convert(), ret } // nvml.DeviceIsMigDeviceHandle() -func DeviceIsMigDeviceHandle(Device Device) (bool, Return) { - var IsMigDevice uint32 - ret := nvmlDeviceIsMigDeviceHandle(Device, &IsMigDevice) - return (IsMigDevice != 0), ret +func (l *library) DeviceIsMigDeviceHandle(device Device) (bool, Return) { + return device.IsMigDeviceHandle() } -func (Device Device) IsMigDeviceHandle() (bool, Return) { - return DeviceIsMigDeviceHandle(Device) +func (device nvmlDevice) IsMigDeviceHandle() (bool, Return) { + var isMigDevice uint32 + ret := nvmlDeviceIsMigDeviceHandle(device, &isMigDevice) + return (isMigDevice != 0), ret } // nvml DeviceGetGpuInstanceId() -func DeviceGetGpuInstanceId(Device Device) (int, Return) { - var Id uint32 - ret := nvmlDeviceGetGpuInstanceId(Device, &Id) - return int(Id), ret +func (l *library) DeviceGetGpuInstanceId(device Device) (int, Return) { + return device.GetGpuInstanceId() } -func (Device Device) GetGpuInstanceId() (int, Return) { - return DeviceGetGpuInstanceId(Device) +func (device nvmlDevice) GetGpuInstanceId() (int, Return) { + var id uint32 + ret := nvmlDeviceGetGpuInstanceId(device, &id) + return int(id), ret } // nvml.DeviceGetComputeInstanceId() -func DeviceGetComputeInstanceId(Device Device) (int, Return) { - var Id uint32 - ret := nvmlDeviceGetComputeInstanceId(Device, &Id) - return int(Id), ret +func (l *library) DeviceGetComputeInstanceId(device Device) (int, Return) { + return device.GetComputeInstanceId() } -func (Device Device) GetComputeInstanceId() (int, Return) { - return DeviceGetComputeInstanceId(Device) +func (device nvmlDevice) GetComputeInstanceId() (int, Return) { + var id uint32 + ret := nvmlDeviceGetComputeInstanceId(device, &id) + return int(id), ret } // nvml.DeviceGetMaxMigDeviceCount() -func DeviceGetMaxMigDeviceCount(Device Device) (int, Return) { - var Count uint32 - ret := nvmlDeviceGetMaxMigDeviceCount(Device, &Count) - return int(Count), ret +func (l *library) DeviceGetMaxMigDeviceCount(device Device) (int, Return) { + return device.GetMaxMigDeviceCount() } -func (Device Device) GetMaxMigDeviceCount() (int, Return) { - return DeviceGetMaxMigDeviceCount(Device) +func (device nvmlDevice) GetMaxMigDeviceCount() (int, Return) { + var count uint32 + ret := nvmlDeviceGetMaxMigDeviceCount(device, &count) + return int(count), ret } // nvml.DeviceGetMigDeviceHandleByIndex() -func DeviceGetMigDeviceHandleByIndex(device Device, Index int) (Device, Return) { - var MigDevice Device - ret := nvmlDeviceGetMigDeviceHandleByIndex(device, uint32(Index), &MigDevice) - return MigDevice, ret +func (l *library) DeviceGetMigDeviceHandleByIndex(device Device, index int) (Device, Return) { + return device.GetMigDeviceHandleByIndex(index) } -func (Device Device) GetMigDeviceHandleByIndex(Index int) (Device, Return) { - return DeviceGetMigDeviceHandleByIndex(Device, Index) +func (device nvmlDevice) GetMigDeviceHandleByIndex(index int) (Device, Return) { + var migDevice nvmlDevice + ret := nvmlDeviceGetMigDeviceHandleByIndex(device, uint32(index), &migDevice) + return migDevice, ret } // nvml.DeviceGetDeviceHandleFromMigDeviceHandle() -func DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device) (Device, Return) { - var Device Device - ret := nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice, &Device) - return Device, ret +func (l *library) DeviceGetDeviceHandleFromMigDeviceHandle(migdevice Device) (Device, Return) { + return migdevice.GetDeviceHandleFromMigDeviceHandle() } -func (MigDevice Device) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { - return DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice) +func (migDevice nvmlDevice) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetDeviceHandleFromMigDeviceHandle(migDevice, &device) + return device, ret } // nvml.DeviceGetBusType() -func DeviceGetBusType(Device Device) (BusType, Return) { - var Type BusType - ret := nvmlDeviceGetBusType(Device, &Type) - return Type, ret +func (l *library) DeviceGetBusType(device Device) (BusType, Return) { + return device.GetBusType() } -func (Device Device) GetBusType() (BusType, Return) { - return DeviceGetBusType(Device) +func (device nvmlDevice) GetBusType() (BusType, Return) { + var busType BusType + ret := nvmlDeviceGetBusType(device, &busType) + return busType, ret } // nvml.DeviceSetDefaultFanSpeed_v2() -func DeviceSetDefaultFanSpeed_v2(Device Device, Fan int) Return { - return nvmlDeviceSetDefaultFanSpeed_v2(Device, uint32(Fan)) +func (l *library) DeviceSetDefaultFanSpeed_v2(device Device, fan int) Return { + return device.SetDefaultFanSpeed_v2(fan) } -func (Device Device) SetDefaultFanSpeed_v2(Fan int) Return { - return DeviceSetDefaultFanSpeed_v2(Device, Fan) +func (device nvmlDevice) SetDefaultFanSpeed_v2(fan int) Return { + return nvmlDeviceSetDefaultFanSpeed_v2(device, uint32(fan)) } // nvml.DeviceGetMinMaxFanSpeed() -func DeviceGetMinMaxFanSpeed(Device Device) (int, int, Return) { - var MinSpeed, MaxSpeed uint32 - ret := nvmlDeviceGetMinMaxFanSpeed(Device, &MinSpeed, &MaxSpeed) - return int(MinSpeed), int(MaxSpeed), ret +func (l *library) DeviceGetMinMaxFanSpeed(device Device) (int, int, Return) { + return device.GetMinMaxFanSpeed() } -func (Device Device) GetMinMaxFanSpeed() (int, int, Return) { - return DeviceGetMinMaxFanSpeed(Device) +func (device nvmlDevice) GetMinMaxFanSpeed() (int, int, Return) { + var minSpeed, maxSpeed uint32 + ret := nvmlDeviceGetMinMaxFanSpeed(device, &minSpeed, &maxSpeed) + return int(minSpeed), int(maxSpeed), ret } // nvml.DeviceGetThermalSettings() -func DeviceGetThermalSettings(Device Device, SensorIndex uint32) (GpuThermalSettings, Return) { - var PThermalSettings GpuThermalSettings - ret := nvmlDeviceGetThermalSettings(Device, SensorIndex, &PThermalSettings) - return PThermalSettings, ret +func (l *library) DeviceGetThermalSettings(device Device, sensorIndex uint32) (GpuThermalSettings, Return) { + return device.GetThermalSettings(sensorIndex) } -func (Device Device) GetThermalSettings(SensorIndex uint32) (GpuThermalSettings, Return) { - return DeviceGetThermalSettings(Device, SensorIndex) +func (device nvmlDevice) GetThermalSettings(sensorIndex uint32) (GpuThermalSettings, Return) { + var pThermalSettings GpuThermalSettings + ret := nvmlDeviceGetThermalSettings(device, sensorIndex, &pThermalSettings) + return pThermalSettings, ret } // nvml.DeviceGetDefaultEccMode() -func DeviceGetDefaultEccMode(Device Device) (EnableState, Return) { - var DefaultMode EnableState - ret := nvmlDeviceGetDefaultEccMode(Device, &DefaultMode) - return DefaultMode, ret +func (l *library) DeviceGetDefaultEccMode(device Device) (EnableState, Return) { + return device.GetDefaultEccMode() } -func (Device Device) GetDefaultEccMode() (EnableState, Return) { - return DeviceGetDefaultEccMode(Device) +func (device nvmlDevice) GetDefaultEccMode() (EnableState, Return) { + var defaultMode EnableState + ret := nvmlDeviceGetDefaultEccMode(device, &defaultMode) + return defaultMode, ret } // nvml.DeviceGetPcieSpeed() -func DeviceGetPcieSpeed(Device Device) (int, Return) { - var PcieSpeed uint32 - ret := nvmlDeviceGetPcieSpeed(Device, &PcieSpeed) - return int(PcieSpeed), ret +func (l *library) DeviceGetPcieSpeed(device Device) (int, Return) { + return device.GetPcieSpeed() } -func (Device Device) GetPcieSpeed() (int, Return) { - return DeviceGetPcieSpeed(Device) +func (device nvmlDevice) GetPcieSpeed() (int, Return) { + var pcieSpeed uint32 + ret := nvmlDeviceGetPcieSpeed(device, &pcieSpeed) + return int(pcieSpeed), ret } // nvml.DeviceGetGspFirmwareVersion() -func DeviceGetGspFirmwareVersion(Device Device) (string, Return) { - Version := make([]byte, GSP_FIRMWARE_VERSION_BUF_SIZE) - ret := nvmlDeviceGetGspFirmwareVersion(Device, &Version[0]) - return string(Version[:clen(Version)]), ret +func (l *library) DeviceGetGspFirmwareVersion(device Device) (string, Return) { + return device.GetGspFirmwareVersion() } -func (Device Device) GetGspFirmwareVersion() (string, Return) { - return DeviceGetGspFirmwareVersion(Device) +func (device nvmlDevice) GetGspFirmwareVersion() (string, Return) { + version := make([]byte, GSP_FIRMWARE_VERSION_BUF_SIZE) + ret := nvmlDeviceGetGspFirmwareVersion(device, &version[0]) + return string(version[:clen(version)]), ret } // nvml.DeviceGetGspFirmwareMode() -func DeviceGetGspFirmwareMode(Device Device) (bool, bool, Return) { - var IsEnabled, DefaultMode uint32 - ret := nvmlDeviceGetGspFirmwareMode(Device, &IsEnabled, &DefaultMode) - return (IsEnabled != 0), (DefaultMode != 0), ret +func (l *library) DeviceGetGspFirmwareMode(device Device) (bool, bool, Return) { + return device.GetGspFirmwareMode() } -func (Device Device) GetGspFirmwareMode() (bool, bool, Return) { - return DeviceGetGspFirmwareMode(Device) +func (device nvmlDevice) GetGspFirmwareMode() (bool, bool, Return) { + var isEnabled, defaultMode uint32 + ret := nvmlDeviceGetGspFirmwareMode(device, &isEnabled, &defaultMode) + return (isEnabled != 0), (defaultMode != 0), ret } // nvml.DeviceGetDynamicPstatesInfo() -func DeviceGetDynamicPstatesInfo(Device Device) (GpuDynamicPstatesInfo, Return) { - var PDynamicPstatesInfo GpuDynamicPstatesInfo - ret := nvmlDeviceGetDynamicPstatesInfo(Device, &PDynamicPstatesInfo) - return PDynamicPstatesInfo, ret +func (l *library) DeviceGetDynamicPstatesInfo(device Device) (GpuDynamicPstatesInfo, Return) { + return device.GetDynamicPstatesInfo() } -func (Device Device) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { - return DeviceGetDynamicPstatesInfo(Device) +func (device nvmlDevice) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { + var pDynamicPstatesInfo GpuDynamicPstatesInfo + ret := nvmlDeviceGetDynamicPstatesInfo(device, &pDynamicPstatesInfo) + return pDynamicPstatesInfo, ret } // nvml.DeviceSetFanSpeed_v2() -func DeviceSetFanSpeed_v2(Device Device, Fan int, Speed int) Return { - return nvmlDeviceSetFanSpeed_v2(Device, uint32(Fan), uint32(Speed)) +func (l *library) DeviceSetFanSpeed_v2(device Device, fan int, speed int) Return { + return device.SetFanSpeed_v2(fan, speed) } -func (Device Device) SetFanSpeed_v2(Fan int, Speed int) Return { - return DeviceSetFanSpeed_v2(Device, Fan, Speed) +func (device nvmlDevice) SetFanSpeed_v2(fan int, speed int) Return { + return nvmlDeviceSetFanSpeed_v2(device, uint32(fan), uint32(speed)) } // nvml.DeviceGetGpcClkVfOffset() -func DeviceGetGpcClkVfOffset(Device Device) (int, Return) { - var Offset int32 - ret := nvmlDeviceGetGpcClkVfOffset(Device, &Offset) - return int(Offset), ret +func (l *library) DeviceGetGpcClkVfOffset(device Device) (int, Return) { + return device.GetGpcClkVfOffset() } -func (Device Device) GetGpcClkVfOffset() (int, Return) { - return DeviceGetGpcClkVfOffset(Device) +func (device nvmlDevice) GetGpcClkVfOffset() (int, Return) { + var offset int32 + ret := nvmlDeviceGetGpcClkVfOffset(device, &offset) + return int(offset), ret } // nvml.DeviceSetGpcClkVfOffset() -func DeviceSetGpcClkVfOffset(Device Device, Offset int) Return { - return nvmlDeviceSetGpcClkVfOffset(Device, int32(Offset)) +func (l *library) DeviceSetGpcClkVfOffset(device Device, offset int) Return { + return device.SetGpcClkVfOffset(offset) } -func (Device Device) SetGpcClkVfOffset(Offset int) Return { - return DeviceSetGpcClkVfOffset(Device, Offset) +func (device nvmlDevice) SetGpcClkVfOffset(offset int) Return { + return nvmlDeviceSetGpcClkVfOffset(device, int32(offset)) } // nvml.DeviceGetMinMaxClockOfPState() -func DeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates) (uint32, uint32, Return) { - var MinClockMHz, MaxClockMHz uint32 - ret := nvmlDeviceGetMinMaxClockOfPState(Device, _type, Pstate, &MinClockMHz, &MaxClockMHz) - return MinClockMHz, MaxClockMHz, ret +func (l *library) DeviceGetMinMaxClockOfPState(device Device, clockType ClockType, pstate Pstates) (uint32, uint32, Return) { + return device.GetMinMaxClockOfPState(clockType, pstate) } -func (Device Device) GetMinMaxClockOfPState(_type ClockType, Pstate Pstates) (uint32, uint32, Return) { - return DeviceGetMinMaxClockOfPState(Device, _type, Pstate) +func (device nvmlDevice) GetMinMaxClockOfPState(clockType ClockType, pstate Pstates) (uint32, uint32, Return) { + var minClockMHz, maxClockMHz uint32 + ret := nvmlDeviceGetMinMaxClockOfPState(device, clockType, pstate, &minClockMHz, &maxClockMHz) + return minClockMHz, maxClockMHz, ret } // nvml.DeviceGetSupportedPerformanceStates() -func DeviceGetSupportedPerformanceStates(Device Device) ([]Pstates, Return) { - Pstates := make([]Pstates, MAX_GPU_PERF_PSTATES) - ret := nvmlDeviceGetSupportedPerformanceStates(Device, &Pstates[0], MAX_GPU_PERF_PSTATES) +func (l *library) DeviceGetSupportedPerformanceStates(device Device) ([]Pstates, Return) { + return device.GetSupportedPerformanceStates() +} + +func (device nvmlDevice) GetSupportedPerformanceStates() ([]Pstates, Return) { + pstates := make([]Pstates, MAX_GPU_PERF_PSTATES) + ret := nvmlDeviceGetSupportedPerformanceStates(device, &pstates[0], MAX_GPU_PERF_PSTATES) for i := 0; i < MAX_GPU_PERF_PSTATES; i++ { - if Pstates[i] == PSTATE_UNKNOWN { - return Pstates[0:i], ret + if pstates[i] == PSTATE_UNKNOWN { + return pstates[0:i], ret } } - return Pstates, ret -} - -func (Device Device) GetSupportedPerformanceStates() ([]Pstates, Return) { - return DeviceGetSupportedPerformanceStates(Device) + return pstates, ret } // nvml.DeviceGetTargetFanSpeed() -func DeviceGetTargetFanSpeed(Device Device, Fan int) (int, Return) { - var TargetSpeed uint32 - ret := nvmlDeviceGetTargetFanSpeed(Device, uint32(Fan), &TargetSpeed) - return int(TargetSpeed), ret +func (l *library) DeviceGetTargetFanSpeed(device Device, fan int) (int, Return) { + return device.GetTargetFanSpeed(fan) } -func (Device Device) GetTargetFanSpeed(Fan int) (int, Return) { - return DeviceGetTargetFanSpeed(Device, Fan) +func (device nvmlDevice) GetTargetFanSpeed(fan int) (int, Return) { + var targetSpeed uint32 + ret := nvmlDeviceGetTargetFanSpeed(device, uint32(fan), &targetSpeed) + return int(targetSpeed), ret } // nvml.DeviceGetMemClkVfOffset() -func DeviceGetMemClkVfOffset(Device Device) (int, Return) { - var Offset int32 - ret := nvmlDeviceGetMemClkVfOffset(Device, &Offset) - return int(Offset), ret +func (l *library) DeviceGetMemClkVfOffset(device Device) (int, Return) { + return device.GetMemClkVfOffset() } -func (Device Device) GetMemClkVfOffset() (int, Return) { - return DeviceGetMemClkVfOffset(Device) +func (device nvmlDevice) GetMemClkVfOffset() (int, Return) { + var offset int32 + ret := nvmlDeviceGetMemClkVfOffset(device, &offset) + return int(offset), ret } // nvml.DeviceSetMemClkVfOffset() -func DeviceSetMemClkVfOffset(Device Device, Offset int) Return { - return nvmlDeviceSetMemClkVfOffset(Device, int32(Offset)) +func (l *library) DeviceSetMemClkVfOffset(device Device, offset int) Return { + return device.SetMemClkVfOffset(offset) } -func (Device Device) SetMemClkVfOffset(Offset int) Return { - return DeviceSetMemClkVfOffset(Device, Offset) +func (device nvmlDevice) SetMemClkVfOffset(offset int) Return { + return nvmlDeviceSetMemClkVfOffset(device, int32(offset)) } // nvml.DeviceGetGpcClkMinMaxVfOffset() -func DeviceGetGpcClkMinMaxVfOffset(Device Device) (int, int, Return) { - var MinOffset, MaxOffset int32 - ret := nvmlDeviceGetGpcClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) - return int(MinOffset), int(MaxOffset), ret +func (l *library) DeviceGetGpcClkMinMaxVfOffset(device Device) (int, int, Return) { + return device.GetGpcClkMinMaxVfOffset() } -func (Device Device) GetGpcClkMinMaxVfOffset() (int, int, Return) { - return DeviceGetGpcClkMinMaxVfOffset(Device) +func (device nvmlDevice) GetGpcClkMinMaxVfOffset() (int, int, Return) { + var minOffset, maxOffset int32 + ret := nvmlDeviceGetGpcClkMinMaxVfOffset(device, &minOffset, &maxOffset) + return int(minOffset), int(maxOffset), ret } // nvml.DeviceGetMemClkMinMaxVfOffset() -func DeviceGetMemClkMinMaxVfOffset(Device Device) (int, int, Return) { - var MinOffset, MaxOffset int32 - ret := nvmlDeviceGetMemClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) - return int(MinOffset), int(MaxOffset), ret +func (l *library) DeviceGetMemClkMinMaxVfOffset(device Device) (int, int, Return) { + return device.GetMemClkMinMaxVfOffset() } -func (Device Device) GetMemClkMinMaxVfOffset() (int, int, Return) { - return DeviceGetMemClkMinMaxVfOffset(Device) +func (device nvmlDevice) GetMemClkMinMaxVfOffset() (int, int, Return) { + var minOffset, maxOffset int32 + ret := nvmlDeviceGetMemClkMinMaxVfOffset(device, &minOffset, &maxOffset) + return int(minOffset), int(maxOffset), ret } // nvml.DeviceGetGpuMaxPcieLinkGeneration() -func DeviceGetGpuMaxPcieLinkGeneration(Device Device) (int, Return) { - var MaxLinkGenDevice uint32 - ret := nvmlDeviceGetGpuMaxPcieLinkGeneration(Device, &MaxLinkGenDevice) - return int(MaxLinkGenDevice), ret +func (l *library) DeviceGetGpuMaxPcieLinkGeneration(device Device) (int, Return) { + return device.GetGpuMaxPcieLinkGeneration() } -func (Device Device) GetGpuMaxPcieLinkGeneration() (int, Return) { - return DeviceGetGpuMaxPcieLinkGeneration(Device) +func (device nvmlDevice) GetGpuMaxPcieLinkGeneration() (int, Return) { + var maxLinkGenDevice uint32 + ret := nvmlDeviceGetGpuMaxPcieLinkGeneration(device, &maxLinkGenDevice) + return int(maxLinkGenDevice), ret } // nvml.DeviceGetFanControlPolicy_v2() -func DeviceGetFanControlPolicy_v2(Device Device, Fan int) (FanControlPolicy, Return) { - var Policy FanControlPolicy - ret := nvmlDeviceGetFanControlPolicy_v2(Device, uint32(Fan), &Policy) - return Policy, ret +func (l *library) DeviceGetFanControlPolicy_v2(device Device, fan int) (FanControlPolicy, Return) { + return device.GetFanControlPolicy_v2(fan) } -func (Device Device) GetFanControlPolicy_v2(Fan int) (FanControlPolicy, Return) { - return DeviceGetFanControlPolicy_v2(Device, Fan) +func (device nvmlDevice) GetFanControlPolicy_v2(fan int) (FanControlPolicy, Return) { + var policy FanControlPolicy + ret := nvmlDeviceGetFanControlPolicy_v2(device, uint32(fan), &policy) + return policy, ret } // nvml.DeviceSetFanControlPolicy() -func DeviceSetFanControlPolicy(Device Device, Fan int, Policy FanControlPolicy) Return { - return nvmlDeviceSetFanControlPolicy(Device, uint32(Fan), Policy) +func (l *library) DeviceSetFanControlPolicy(device Device, fan int, policy FanControlPolicy) Return { + return device.SetFanControlPolicy(fan, policy) } -func (Device Device) SetFanControlPolicy(Fan int, Policy FanControlPolicy) Return { - return DeviceSetFanControlPolicy(Device, Fan, Policy) +func (device nvmlDevice) SetFanControlPolicy(fan int, policy FanControlPolicy) Return { + return nvmlDeviceSetFanControlPolicy(device, uint32(fan), policy) } // nvml.DeviceClearFieldValues() -func DeviceClearFieldValues(Device Device, Values []FieldValue) Return { - ValuesCount := len(Values) - return nvmlDeviceClearFieldValues(Device, int32(ValuesCount), &Values[0]) +func (l *library) DeviceClearFieldValues(device Device, values []FieldValue) Return { + return device.ClearFieldValues(values) } -func (Device Device) ClearFieldValues(Values []FieldValue) Return { - return DeviceClearFieldValues(Device, Values) +func (device nvmlDevice) ClearFieldValues(values []FieldValue) Return { + valuesCount := len(values) + return nvmlDeviceClearFieldValues(device, int32(valuesCount), &values[0]) } // nvml.DeviceGetVgpuCapabilities() -func DeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability) (bool, Return) { - var CapResult uint32 - ret := nvmlDeviceGetVgpuCapabilities(Device, Capability, &CapResult) - return (CapResult != 0), ret +func (l *library) DeviceGetVgpuCapabilities(device Device, capability DeviceVgpuCapability) (bool, Return) { + return device.GetVgpuCapabilities(capability) } -func (Device Device) GetVgpuCapabilities(Capability DeviceVgpuCapability) (bool, Return) { - return DeviceGetVgpuCapabilities(Device, Capability) +func (device nvmlDevice) GetVgpuCapabilities(capability DeviceVgpuCapability) (bool, Return) { + var capResult uint32 + ret := nvmlDeviceGetVgpuCapabilities(device, capability, &capResult) + return (capResult != 0), ret } // nvml.DeviceGetVgpuSchedulerLog() -func DeviceGetVgpuSchedulerLog(Device Device) (VgpuSchedulerLog, Return) { - var PSchedulerLog VgpuSchedulerLog - ret := nvmlDeviceGetVgpuSchedulerLog(Device, &PSchedulerLog) - return PSchedulerLog, ret +func (l *library) DeviceGetVgpuSchedulerLog(device Device) (VgpuSchedulerLog, Return) { + return device.GetVgpuSchedulerLog() } -func (Device Device) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { - return DeviceGetVgpuSchedulerLog(Device) +func (device nvmlDevice) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { + var pSchedulerLog VgpuSchedulerLog + ret := nvmlDeviceGetVgpuSchedulerLog(device, &pSchedulerLog) + return pSchedulerLog, ret } // nvml.DeviceGetVgpuSchedulerState() -func DeviceGetVgpuSchedulerState(Device Device) (VgpuSchedulerGetState, Return) { - var PSchedulerState VgpuSchedulerGetState - ret := nvmlDeviceGetVgpuSchedulerState(Device, &PSchedulerState) - return PSchedulerState, ret +func (l *library) DeviceGetVgpuSchedulerState(device Device) (VgpuSchedulerGetState, Return) { + return device.GetVgpuSchedulerState() } -func (Device Device) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { - return DeviceGetVgpuSchedulerState(Device) +func (device nvmlDevice) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { + var pSchedulerState VgpuSchedulerGetState + ret := nvmlDeviceGetVgpuSchedulerState(device, &pSchedulerState) + return pSchedulerState, ret } // nvml.DeviceSetVgpuSchedulerState() -func DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return { - return nvmlDeviceSetVgpuSchedulerState(Device, PSchedulerState) +func (l *library) DeviceSetVgpuSchedulerState(device Device, pSchedulerState *VgpuSchedulerSetState) Return { + return device.SetVgpuSchedulerState(pSchedulerState) } -func (Device Device) SetVgpuSchedulerState(PSchedulerState *VgpuSchedulerSetState) Return { - return DeviceSetVgpuSchedulerState(Device, PSchedulerState) +func (device nvmlDevice) SetVgpuSchedulerState(pSchedulerState *VgpuSchedulerSetState) Return { + return nvmlDeviceSetVgpuSchedulerState(device, pSchedulerState) } // nvml.DeviceGetVgpuSchedulerCapabilities() -func DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) { - var PCapabilities VgpuSchedulerCapabilities - ret := nvmlDeviceGetVgpuSchedulerCapabilities(Device, &PCapabilities) - return PCapabilities, ret +func (l *library) DeviceGetVgpuSchedulerCapabilities(device Device) (VgpuSchedulerCapabilities, Return) { + return device.GetVgpuSchedulerCapabilities() } -func (Device Device) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) { - return DeviceGetVgpuSchedulerCapabilities(Device) +func (device nvmlDevice) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) { + var pCapabilities VgpuSchedulerCapabilities + ret := nvmlDeviceGetVgpuSchedulerCapabilities(device, &pCapabilities) + return pCapabilities, ret } // nvml.GpuInstanceGetComputeInstancePossiblePlacements() -func GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { - var Count uint32 - ret := nvmlGpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, Info.Id, nil, &Count) +func (l *library) GpuInstanceGetComputeInstancePossiblePlacements(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { + return gpuInstance.GetComputeInstancePossiblePlacements(info) +} + +func (gpuInstance nvmlGpuInstance) GetComputeInstancePossiblePlacements(info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { + var count uint32 + ret := nvmlGpuInstanceGetComputeInstancePossiblePlacements(gpuInstance, info.Id, nil, &count) if ret != SUCCESS { return nil, ret } - if Count == 0 { + if count == 0 { return []ComputeInstancePlacement{}, ret } - PlacementArray := make([]ComputeInstancePlacement, Count) - ret = nvmlGpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, Info.Id, &PlacementArray[0], &Count) - return PlacementArray, ret -} - -func (GpuInstance GpuInstance) GetComputeInstancePossiblePlacements(Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { - return GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, Info) + placementArray := make([]ComputeInstancePlacement, count) + ret = nvmlGpuInstanceGetComputeInstancePossiblePlacements(gpuInstance, info.Id, &placementArray[0], &count) + return placementArray, ret } // nvml.GpuInstanceCreateComputeInstanceWithPlacement() -func GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - return nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, ComputeInstance) +func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) { + return gpuInstance.CreateComputeInstanceWithPlacement(info, placement) } -func (GpuInstance GpuInstance) CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - return GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info, Placement, ComputeInstance) +func (gpuInstance nvmlGpuInstance) CreateComputeInstanceWithPlacement(info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) { + var computeInstance nvmlComputeInstance + ret := nvmlGpuInstanceCreateComputeInstanceWithPlacement(gpuInstance, info.Id, placement, &computeInstance) + return computeInstance, ret } // nvml.DeviceGetGpuFabricInfo() -func DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) { - var GpuFabricInfo GpuFabricInfo - ret := nvmlDeviceGetGpuFabricInfo(Device, &GpuFabricInfo) - return GpuFabricInfo, ret +func (l *library) DeviceGetGpuFabricInfo(device Device) (GpuFabricInfo, Return) { + return device.GetGpuFabricInfo() } -func (Device Device) GetGpuFabricInfo() (GpuFabricInfo, Return) { - return DeviceGetGpuFabricInfo(Device) +func (device nvmlDevice) GetGpuFabricInfo() (GpuFabricInfo, Return) { + var gpuFabricInfo GpuFabricInfo + ret := nvmlDeviceGetGpuFabricInfo(device, &gpuFabricInfo) + return gpuFabricInfo, ret } // nvml.DeviceCcuGetStreamState() -func DeviceCcuGetStreamState(Device Device) (int, Return) { - var State uint32 - ret := nvmlDeviceCcuGetStreamState(Device, &State) - return int(State), ret +func (l *library) DeviceCcuGetStreamState(device Device) (int, Return) { + return device.CcuGetStreamState() } -func (Device Device) CcuGetStreamState() (int, Return) { - return DeviceCcuGetStreamState(Device) +func (device nvmlDevice) CcuGetStreamState() (int, Return) { + var state uint32 + ret := nvmlDeviceCcuGetStreamState(device, &state) + return int(state), ret } // nvml.DeviceCcuSetStreamState() -func DeviceCcuSetStreamState(Device Device, State int) Return { - return nvmlDeviceCcuSetStreamState(Device, uint32(State)) +func (l *library) DeviceCcuSetStreamState(device Device, state int) Return { + return device.CcuSetStreamState(state) } -func (Device Device) CcuSetStreamState(State int) Return { - return DeviceCcuSetStreamState(Device, State) +func (device nvmlDevice) CcuSetStreamState(state int) Return { + return nvmlDeviceCcuSetStreamState(device, uint32(state)) } // nvml.DeviceSetNvLinkDeviceLowPowerThreshold() -func DeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return { - return nvmlDeviceSetNvLinkDeviceLowPowerThreshold(Device, Info) +func (l *library) DeviceSetNvLinkDeviceLowPowerThreshold(device Device, info *NvLinkPowerThres) Return { + return device.SetNvLinkDeviceLowPowerThreshold(info) } -func (Device Device) SetNvLinkDeviceLowPowerThreshold(Info *NvLinkPowerThres) Return { - return DeviceSetNvLinkDeviceLowPowerThreshold(Device, Info) +func (device nvmlDevice) SetNvLinkDeviceLowPowerThreshold(info *NvLinkPowerThres) Return { + return nvmlDeviceSetNvLinkDeviceLowPowerThreshold(device, info) } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go index c6315f5e..933b4dea 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go @@ -14,29 +14,60 @@ package nvml +// EventData includes an interface type for Device instead of nvmlDevice +type EventData struct { + Device Device + EventType uint64 + EventData uint64 + GpuInstanceId uint32 + ComputeInstanceId uint32 +} + +func (e EventData) convert() nvmlEventData { + out := nvmlEventData{ + Device: e.Device.(nvmlDevice), + EventType: e.EventType, + EventData: e.EventData, + GpuInstanceId: e.GpuInstanceId, + ComputeInstanceId: e.ComputeInstanceId, + } + return out +} + +func (e nvmlEventData) convert() EventData { + out := EventData{ + Device: e.Device, + EventType: e.EventType, + EventData: e.EventData, + GpuInstanceId: e.GpuInstanceId, + ComputeInstanceId: e.ComputeInstanceId, + } + return out +} + // nvml.EventSetCreate() -func EventSetCreate() (EventSet, Return) { - var Set EventSet +func (l *library) EventSetCreate() (EventSet, Return) { + var Set nvmlEventSet ret := nvmlEventSetCreate(&Set) return Set, ret } // nvml.EventSetWait() -func EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) { - var Data EventData - ret := nvmlEventSetWait(Set, &Data, Timeoutms) - return Data, ret +func (l *library) EventSetWait(set EventSet, timeoutms uint32) (EventData, Return) { + return set.Wait(timeoutms) } -func (Set EventSet) Wait(Timeoutms uint32) (EventData, Return) { - return EventSetWait(Set, Timeoutms) +func (set nvmlEventSet) Wait(timeoutms uint32) (EventData, Return) { + var data nvmlEventData + ret := nvmlEventSetWait(set, &data, timeoutms) + return data.convert(), ret } // nvml.EventSetFree() -func EventSetFree(Set EventSet) Return { - return nvmlEventSetFree(Set) +func (l *library) EventSetFree(set EventSet) Return { + return set.Free() } -func (Set EventSet) Free() Return { - return EventSetFree(Set) +func (set nvmlEventSet) Free() Return { + return nvmlEventSetFree(set) } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go index c46c5d78..783514b1 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go @@ -14,80 +14,128 @@ package nvml +// GpmMetricsGetType includes interface types for GpmSample instead of nvmlGpmSample +type GpmMetricsGetType struct { + Version uint32 + NumMetrics uint32 + Sample1 GpmSample + Sample2 GpmSample + Metrics [98]GpmMetric +} + +func (g *GpmMetricsGetType) convert() *nvmlGpmMetricsGetType { + out := &nvmlGpmMetricsGetType{ + Version: g.Version, + NumMetrics: g.NumMetrics, + Sample1: g.Sample1.(nvmlGpmSample), + Sample2: g.Sample2.(nvmlGpmSample), + } + for i := range g.Metrics { + out.Metrics[i] = g.Metrics[i] + } + return out +} + +func (g *nvmlGpmMetricsGetType) convert() *GpmMetricsGetType { + out := &GpmMetricsGetType{ + Version: g.Version, + NumMetrics: g.NumMetrics, + Sample1: g.Sample1, + Sample2: g.Sample2, + } + for i := range g.Metrics { + out.Metrics[i] = g.Metrics[i] + } + return out +} + // nvml.GpmMetricsGet() type GpmMetricsGetVType struct { - metricsGet *GpmMetricsGetType + metricsGet *nvmlGpmMetricsGetType } -func GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType { - return GpmMetricsGetVType{MetricsGet} +func (l *library) GpmMetricsGetV(metricsGet *GpmMetricsGetType) GpmMetricsGetVType { + return GpmMetricsGetVType{metricsGet.convert()} } - -func (MetricsGetV GpmMetricsGetVType) V1() Return { - MetricsGetV.metricsGet.Version = 1 - return nvmlGpmMetricsGet(MetricsGetV.metricsGet) +func (metricsGetV GpmMetricsGetVType) V1() Return { + metricsGetV.metricsGet.Version = 1 + return nvmlGpmMetricsGet(metricsGetV.metricsGet) } -func GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { - MetricsGet.Version = GPM_METRICS_GET_VERSION - return nvmlGpmMetricsGet(MetricsGet) +func (l *library) GpmMetricsGet(metricsGet *GpmMetricsGetType) Return { + metricsGet.Version = GPM_METRICS_GET_VERSION + return nvmlGpmMetricsGet(metricsGet.convert()) } // nvml.GpmSampleFree() -func GpmSampleFree(GpmSample GpmSample) Return { - return nvmlGpmSampleFree(GpmSample) +func (l *library) GpmSampleFree(gpmSample GpmSample) Return { + return gpmSample.Free() +} + +func (gpmSample nvmlGpmSample) Free() Return { + return nvmlGpmSampleFree(gpmSample) } // nvml.GpmSampleAlloc() -func GpmSampleAlloc(GpmSample *GpmSample) Return { - return nvmlGpmSampleAlloc(GpmSample) +func (l *library) GpmSampleAlloc() (GpmSample, Return) { + var gpmSample nvmlGpmSample + ret := nvmlGpmSampleAlloc(&gpmSample) + return gpmSample, ret } // nvml.GpmSampleGet() -func GpmSampleGet(Device Device, GpmSample GpmSample) Return { - return nvmlGpmSampleGet(Device, GpmSample) +func (l *library) GpmSampleGet(device Device, gpmSample GpmSample) Return { + return gpmSample.Get(device) } -func (Device Device) GpmSampleGet(GpmSample GpmSample) Return { - return GpmSampleGet(Device, GpmSample) +func (device nvmlDevice) GpmSampleGet(gpmSample GpmSample) Return { + return gpmSample.Get(device) +} + +func (gpmSample nvmlGpmSample) Get(device Device) Return { + return nvmlGpmSampleGet(device.(nvmlDevice), gpmSample) } // nvml.GpmQueryDeviceSupport() type GpmSupportV struct { - device Device + device nvmlDevice } -func GpmQueryDeviceSupportV(Device Device) GpmSupportV { - return GpmSupportV{Device} +func (l *library) GpmQueryDeviceSupportV(device Device) GpmSupportV { + return device.GpmQueryDeviceSupportV() } -func (Device Device) GpmQueryDeviceSupportV() GpmSupportV { - return GpmSupportV{Device} +func (device nvmlDevice) GpmQueryDeviceSupportV() GpmSupportV { + return GpmSupportV{device} } -func (GpmSupportV GpmSupportV) V1() (GpmSupport, Return) { - var GpmSupport GpmSupport - GpmSupport.Version = 1 - ret := nvmlGpmQueryDeviceSupport(GpmSupportV.device, &GpmSupport) - return GpmSupport, ret +func (gpmSupportV GpmSupportV) V1() (GpmSupport, Return) { + var gpmSupport GpmSupport + gpmSupport.Version = 1 + ret := nvmlGpmQueryDeviceSupport(gpmSupportV.device, &gpmSupport) + return gpmSupport, ret } -func GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) { - var GpmSupport GpmSupport - GpmSupport.Version = GPM_SUPPORT_VERSION - ret := nvmlGpmQueryDeviceSupport(Device, &GpmSupport) - return GpmSupport, ret +func (l *library) GpmQueryDeviceSupport(device Device) (GpmSupport, Return) { + return device.GpmQueryDeviceSupport() } -func (Device Device) GpmQueryDeviceSupport() (GpmSupport, Return) { - return GpmQueryDeviceSupport(Device) +func (device nvmlDevice) GpmQueryDeviceSupport() (GpmSupport, Return) { + var gpmSupport GpmSupport + gpmSupport.Version = GPM_SUPPORT_VERSION + ret := nvmlGpmQueryDeviceSupport(device, &gpmSupport) + return gpmSupport, ret } // nvml.GpmMigSampleGet() -func GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return { - return nvmlGpmMigSampleGet(Device, uint32(GpuInstanceId), GpmSample) +func (l *library) GpmMigSampleGet(device Device, gpuInstanceId int, gpmSample GpmSample) Return { + return gpmSample.MigGet(device, gpuInstanceId) +} + +func (device nvmlDevice) GpmMigSampleGet(gpuInstanceId int, gpmSample GpmSample) Return { + return gpmSample.MigGet(device, gpuInstanceId) } -func (Device Device) GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) Return { - return GpmMigSampleGet(Device, GpuInstanceId, GpmSample) +func (gpmSample nvmlGpmSample) MigGet(device Device, gpuInstanceId int) Return { + return nvmlGpmMigSampleGet(device.(nvmlDevice), uint32(gpuInstanceId), gpmSample) } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go index e2bc943b..6c4bd58f 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go @@ -17,7 +17,7 @@ package nvml import "C" // nvml.Init() -func Init() Return { +func (l *library) Init() Return { if err := libnvml.load(); err != nil { return ERROR_LIBRARY_NOT_FOUND } @@ -25,15 +25,15 @@ func Init() Return { } // nvml.InitWithFlags() -func InitWithFlags(Flags uint32) Return { +func (l *library) InitWithFlags(flags uint32) Return { if err := libnvml.load(); err != nil { return ERROR_LIBRARY_NOT_FOUND } - return nvmlInitWithFlags(Flags) + return nvmlInitWithFlags(flags) } // nvml.Shutdown() -func Shutdown() Return { +func (l *library) Shutdown() Return { ret := nvmlShutdown() if ret != SUCCESS { return ret @@ -41,7 +41,7 @@ func Shutdown() Return { err := libnvml.close() if err != nil { - panic(err) + return ERROR_UNKNOWN } return ret diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go index be4b3fb7..4d265318 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go @@ -34,48 +34,70 @@ const ( var errLibraryNotLoaded = errors.New("library not loaded") var errLibraryAlreadyLoaded = errors.New("library already loaded") +// dynamicLibrary is an interface for abstacting the underlying library. +// This also allows for mocking and testing. + +//go:generate moq -stub -out dynamicLibrary_mock.go . dynamicLibrary +type dynamicLibrary interface { + Lookup(string) error + Open() error + Close() error +} + // library represents an nvml library. // This includes a reference to the underlying DynamicLibrary type library struct { sync.Mutex path string - flags int refcount refcount dl dynamicLibrary } +var _ Interface = (*library)(nil) + // libnvml is a global instance of the nvml library. -var libnvml = library{ - path: defaultNvmlLibraryName, - flags: defaultNvmlLibraryLoadFlags, -} +var libnvml = newLibrary() -var _ Interface = (*library)(nil) +func New(opts ...LibraryOption) Interface { + return newLibrary(opts...) +} -// GetLibrary returns a the library as a Library interface. -func (l *library) GetLibrary() Library { +func newLibrary(opts ...LibraryOption) *library { + l := &library{} + l.init(opts...) return l } -// GetLibrary returns a representation of the underlying library that implements the Library interface. -func GetLibrary() Library { - return libnvml.GetLibrary() +func (l *library) init(opts ...LibraryOption) { + o := libraryOptions{} + for _, opt := range opts { + opt(&o) + } + + if o.path == "" { + o.path = defaultNvmlLibraryName + } + if o.flags == 0 { + o.flags = defaultNvmlLibraryLoadFlags + } + + l.path = o.path + l.dl = dl.New(o.path, o.flags) } -// Lookup checks whether the specified library symbol exists in the library. +func (l *library) Extensions() ExtendedInterface { + return l +} + +// LookupSymbol checks whether the specified library symbol exists in the library. // Note that this requires that the library be loaded. -func (l *library) Lookup(name string) error { - if l == nil || l.dl == nil { +func (l *library) LookupSymbol(name string) error { + if l == nil || l.refcount == 0 { return fmt.Errorf("error looking up %s: %w", name, errLibraryNotLoaded) } return l.dl.Lookup(name) } -// newDynamicLibrary is a function variable that can be overridden for testing. -var newDynamicLibrary = func(path string, flags int) dynamicLibrary { - return dl.New(path, flags) -} - // load initializes the library and updates the versioned symbols. // Multiple calls to an already loaded library will return without error. func (l *library) load() (rerr error) { @@ -87,12 +109,14 @@ func (l *library) load() (rerr error) { return nil } - dl := newDynamicLibrary(l.path, l.flags) - if err := dl.Open(); err != nil { + if err := l.dl.Open(); err != nil { return fmt.Errorf("error opening %s: %w", l.path, err) } - l.dl = dl + // Update the errorStringFunc to point to nvml.ErrorString + errorStringFunc = nvmlErrorString + + // Update all versioned symbols l.updateVersionedSymbols() return nil @@ -114,7 +138,8 @@ func (l *library) close() (rerr error) { return fmt.Errorf("error closing %s: %w", l.path, err) } - l.dl = nil + // Update the errorStringFunc to point to defaultErrorStringFunc + errorStringFunc = defaultErrorStringFunc return nil } @@ -131,9 +156,9 @@ var nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v1 var nvmlEventSetWait = nvmlEventSetWait_v1 var nvmlDeviceGetAttributes = nvmlDeviceGetAttributes_v1 var nvmlComputeInstanceGetInfo = nvmlComputeInstanceGetInfo_v1 -var DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v1 -var DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v1 -var DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v1 +var deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v1 +var deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v1 +var deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v1 var GetBlacklistDeviceCount = GetExcludedDeviceCount var GetBlacklistDeviceInfoByIndex = GetExcludedDeviceInfoByIndex var nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v1 @@ -173,127 +198,94 @@ func (pis ProcessInfo_v2Slice) ToProcessInfoSlice() []ProcessInfo { // When new versioned symbols are added, these would have to be initialized above and have // corresponding checks and subsequent assignments added below. func (l *library) updateVersionedSymbols() { - err := l.Lookup("nvmlInit_v2") + err := l.LookupSymbol("nvmlInit_v2") if err == nil { nvmlInit = nvmlInit_v2 } - err = l.Lookup("nvmlDeviceGetPciInfo_v2") + err = l.LookupSymbol("nvmlDeviceGetPciInfo_v2") if err == nil { nvmlDeviceGetPciInfo = nvmlDeviceGetPciInfo_v2 } - err = l.Lookup("nvmlDeviceGetPciInfo_v3") + err = l.LookupSymbol("nvmlDeviceGetPciInfo_v3") if err == nil { nvmlDeviceGetPciInfo = nvmlDeviceGetPciInfo_v3 } - err = l.Lookup("nvmlDeviceGetCount_v2") + err = l.LookupSymbol("nvmlDeviceGetCount_v2") if err == nil { nvmlDeviceGetCount = nvmlDeviceGetCount_v2 } - err = l.Lookup("nvmlDeviceGetHandleByIndex_v2") + err = l.LookupSymbol("nvmlDeviceGetHandleByIndex_v2") if err == nil { nvmlDeviceGetHandleByIndex = nvmlDeviceGetHandleByIndex_v2 } - err = l.Lookup("nvmlDeviceGetHandleByPciBusId_v2") + err = l.LookupSymbol("nvmlDeviceGetHandleByPciBusId_v2") if err == nil { nvmlDeviceGetHandleByPciBusId = nvmlDeviceGetHandleByPciBusId_v2 } - err = l.Lookup("nvmlDeviceGetNvLinkRemotePciInfo_v2") + err = l.LookupSymbol("nvmlDeviceGetNvLinkRemotePciInfo_v2") if err == nil { nvmlDeviceGetNvLinkRemotePciInfo = nvmlDeviceGetNvLinkRemotePciInfo_v2 } // Unable to overwrite nvmlDeviceRemoveGpu() because the v2 function takes // a different set of parameters than the v1 function. - //err = l.Lookup("nvmlDeviceRemoveGpu_v2") + //err = l.LookupSymbol("nvmlDeviceRemoveGpu_v2") //if err == nil { // nvmlDeviceRemoveGpu = nvmlDeviceRemoveGpu_v2 //} - err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v2") + err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v2") if err == nil { nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v2 } - err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v3") + err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v3") if err == nil { nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v3 } - err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v4") + err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v4") if err == nil { nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v4 } - err = l.Lookup("nvmlEventSetWait_v2") + err = l.LookupSymbol("nvmlEventSetWait_v2") if err == nil { nvmlEventSetWait = nvmlEventSetWait_v2 } - err = l.Lookup("nvmlDeviceGetAttributes_v2") + err = l.LookupSymbol("nvmlDeviceGetAttributes_v2") if err == nil { nvmlDeviceGetAttributes = nvmlDeviceGetAttributes_v2 } - err = l.Lookup("nvmlComputeInstanceGetInfo_v2") + err = l.LookupSymbol("nvmlComputeInstanceGetInfo_v2") if err == nil { nvmlComputeInstanceGetInfo = nvmlComputeInstanceGetInfo_v2 } - err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v2") + err = l.LookupSymbol("nvmlDeviceGetComputeRunningProcesses_v2") if err == nil { - DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v2 + deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v2 } - err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetComputeRunningProcesses_v3") if err == nil { - DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3 + deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3 } - err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v2") + err = l.LookupSymbol("nvmlDeviceGetGraphicsRunningProcesses_v2") if err == nil { - DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2 + deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2 } - err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetGraphicsRunningProcesses_v3") if err == nil { - DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3 + deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3 } - err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v2") + err = l.LookupSymbol("nvmlDeviceGetMPSComputeRunningProcesses_v2") if err == nil { - DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2 + deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2 } - err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetMPSComputeRunningProcesses_v3") if err == nil { - DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v3 + deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v3 } - err = l.Lookup("nvmlDeviceGetGpuInstancePossiblePlacements_v2") + err = l.LookupSymbol("nvmlDeviceGetGpuInstancePossiblePlacements_v2") if err == nil { nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v2 } - err = l.Lookup("nvmlVgpuInstanceGetLicenseInfo_v2") + err = l.LookupSymbol("nvmlVgpuInstanceGetLicenseInfo_v2") if err == nil { nvmlVgpuInstanceGetLicenseInfo = nvmlVgpuInstanceGetLicenseInfo_v2 } } - -// LibraryOption represents a functional option to configure the underlying NVML library -type LibraryOption func(*library) - -// WithLibraryPath provides an option to set the library name to be used by the NVML library. -func WithLibraryPath(path string) LibraryOption { - return func(l *library) { - l.path = path - } -} - -// SetLibraryOptions applies the specified options to the NVML library. -// If this is called when a library is already loaded, and error is raised. -func SetLibraryOptions(opts ...LibraryOption) error { - libnvml.Lock() - defer libnvml.Unlock() - if libnvml.dl != nil { - return errLibraryAlreadyLoaded - } - - for _, opt := range opts { - opt(&libnvml) - } - - if libnvml.path == "" { - libnvml.path = defaultNvmlLibraryName - } - if libnvml.flags == 0 { - libnvml.flags = defaultNvmlLibraryLoadFlags - } - - return nil -} diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go index 9bd6965d..65fcffac 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go @@ -111,66 +111,66 @@ func nvmlUnitGetCount(UnitCount *uint32) Return { } // nvmlUnitGetHandleByIndex function as declared in nvml/nvml.h -func nvmlUnitGetHandleByIndex(Index uint32, Unit *Unit) Return { +func nvmlUnitGetHandleByIndex(Index uint32, nvmlUnit *nvmlUnit) Return { cIndex, _ := (C.uint)(Index), cgoAllocsUnknown - cUnit, _ := (*C.nvmlUnit_t)(unsafe.Pointer(Unit)), cgoAllocsUnknown - __ret := C.nvmlUnitGetHandleByIndex(cIndex, cUnit) + cnvmlUnit, _ := (*C.nvmlUnit_t)(unsafe.Pointer(nvmlUnit)), cgoAllocsUnknown + __ret := C.nvmlUnitGetHandleByIndex(cIndex, cnvmlUnit) __v := (Return)(__ret) return __v } // nvmlUnitGetUnitInfo function as declared in nvml/nvml.h -func nvmlUnitGetUnitInfo(Unit Unit, Info *UnitInfo) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetUnitInfo(nvmlUnit nvmlUnit, Info *UnitInfo) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cInfo, _ := (*C.nvmlUnitInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlUnitGetUnitInfo(cUnit, cInfo) + __ret := C.nvmlUnitGetUnitInfo(cnvmlUnit, cInfo) __v := (Return)(__ret) return __v } // nvmlUnitGetLedState function as declared in nvml/nvml.h -func nvmlUnitGetLedState(Unit Unit, State *LedState) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetLedState(nvmlUnit nvmlUnit, State *LedState) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cState, _ := (*C.nvmlLedState_t)(unsafe.Pointer(State)), cgoAllocsUnknown - __ret := C.nvmlUnitGetLedState(cUnit, cState) + __ret := C.nvmlUnitGetLedState(cnvmlUnit, cState) __v := (Return)(__ret) return __v } // nvmlUnitGetPsuInfo function as declared in nvml/nvml.h -func nvmlUnitGetPsuInfo(Unit Unit, Psu *PSUInfo) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetPsuInfo(nvmlUnit nvmlUnit, Psu *PSUInfo) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cPsu, _ := (*C.nvmlPSUInfo_t)(unsafe.Pointer(Psu)), cgoAllocsUnknown - __ret := C.nvmlUnitGetPsuInfo(cUnit, cPsu) + __ret := C.nvmlUnitGetPsuInfo(cnvmlUnit, cPsu) __v := (Return)(__ret) return __v } // nvmlUnitGetTemperature function as declared in nvml/nvml.h -func nvmlUnitGetTemperature(Unit Unit, _type uint32, Temp *uint32) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetTemperature(nvmlUnit nvmlUnit, _type uint32, Temp *uint32) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown c_type, _ := (C.uint)(_type), cgoAllocsUnknown cTemp, _ := (*C.uint)(unsafe.Pointer(Temp)), cgoAllocsUnknown - __ret := C.nvmlUnitGetTemperature(cUnit, c_type, cTemp) + __ret := C.nvmlUnitGetTemperature(cnvmlUnit, c_type, cTemp) __v := (Return)(__ret) return __v } // nvmlUnitGetFanSpeedInfo function as declared in nvml/nvml.h -func nvmlUnitGetFanSpeedInfo(Unit Unit, FanSpeeds *UnitFanSpeeds) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetFanSpeedInfo(nvmlUnit nvmlUnit, FanSpeeds *UnitFanSpeeds) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cFanSpeeds, _ := (*C.nvmlUnitFanSpeeds_t)(unsafe.Pointer(FanSpeeds)), cgoAllocsUnknown - __ret := C.nvmlUnitGetFanSpeedInfo(cUnit, cFanSpeeds) + __ret := C.nvmlUnitGetFanSpeedInfo(cnvmlUnit, cFanSpeeds) __v := (Return)(__ret) return __v } // nvmlUnitGetDevices function as declared in nvml/nvml.h -func nvmlUnitGetDevices(Unit Unit, DeviceCount *uint32, Devices *Device) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetDevices(nvmlUnit nvmlUnit, DeviceCount *uint32, Devices *nvmlDevice) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cDeviceCount, _ := (*C.uint)(unsafe.Pointer(DeviceCount)), cgoAllocsUnknown cDevices, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Devices)), cgoAllocsUnknown - __ret := C.nvmlUnitGetDevices(cUnit, cDeviceCount, cDevices) + __ret := C.nvmlUnitGetDevices(cnvmlUnit, cDeviceCount, cDevices) __v := (Return)(__ret) return __v } @@ -193,138 +193,138 @@ func nvmlDeviceGetCount_v2(DeviceCount *uint32) Return { } // nvmlDeviceGetAttributes_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetAttributes_v2(Device Device, Attributes *DeviceAttributes) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAttributes_v2(nvmlDevice nvmlDevice, Attributes *DeviceAttributes) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cAttributes, _ := (*C.nvmlDeviceAttributes_t)(unsafe.Pointer(Attributes)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAttributes_v2(cDevice, cAttributes) + __ret := C.nvmlDeviceGetAttributes_v2(cnvmlDevice, cAttributes) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleByIndex_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByIndex_v2(Index uint32, Device *Device) Return { +func nvmlDeviceGetHandleByIndex_v2(Index uint32, nvmlDevice *nvmlDevice) Return { cIndex, _ := (C.uint)(Index), cgoAllocsUnknown - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByIndex_v2(cIndex, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByIndex_v2(cIndex, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleBySerial function as declared in nvml/nvml.h -func nvmlDeviceGetHandleBySerial(Serial string, Device *Device) Return { +func nvmlDeviceGetHandleBySerial(Serial string, nvmlDevice *nvmlDevice) Return { cSerial, _ := unpackPCharString(Serial) - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleBySerial(cSerial, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleBySerial(cSerial, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleByUUID function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByUUID(Uuid string, Device *Device) Return { +func nvmlDeviceGetHandleByUUID(Uuid string, nvmlDevice *nvmlDevice) Return { cUuid, _ := unpackPCharString(Uuid) - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByUUID(cUuid, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByUUID(cUuid, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleByPciBusId_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByPciBusId_v2(PciBusId string, Device *Device) Return { +func nvmlDeviceGetHandleByPciBusId_v2(PciBusId string, nvmlDevice *nvmlDevice) Return { cPciBusId, _ := unpackPCharString(PciBusId) - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByPciBusId_v2(cPciBusId, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByPciBusId_v2(cPciBusId, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetName function as declared in nvml/nvml.h -func nvmlDeviceGetName(Device Device, Name *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetName(nvmlDevice nvmlDevice, Name *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cName, _ := (*C.char)(unsafe.Pointer(Name)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetName(cDevice, cName, cLength) + __ret := C.nvmlDeviceGetName(cnvmlDevice, cName, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetBrand function as declared in nvml/nvml.h -func nvmlDeviceGetBrand(Device Device, _type *BrandType) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBrand(nvmlDevice nvmlDevice, _type *BrandType) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (*C.nvmlBrandType_t)(unsafe.Pointer(_type)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBrand(cDevice, c_type) + __ret := C.nvmlDeviceGetBrand(cnvmlDevice, c_type) __v := (Return)(__ret) return __v } // nvmlDeviceGetIndex function as declared in nvml/nvml.h -func nvmlDeviceGetIndex(Device Device, Index *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetIndex(nvmlDevice nvmlDevice, Index *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIndex, _ := (*C.uint)(unsafe.Pointer(Index)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetIndex(cDevice, cIndex) + __ret := C.nvmlDeviceGetIndex(cnvmlDevice, cIndex) __v := (Return)(__ret) return __v } // nvmlDeviceGetSerial function as declared in nvml/nvml.h -func nvmlDeviceGetSerial(Device Device, Serial *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSerial(nvmlDevice nvmlDevice, Serial *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSerial, _ := (*C.char)(unsafe.Pointer(Serial)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSerial(cDevice, cSerial, cLength) + __ret := C.nvmlDeviceGetSerial(cnvmlDevice, cSerial, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryAffinity function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryAffinity(Device Device, NodeSetSize uint32, NodeSet *uint, Scope AffinityScope) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryAffinity(nvmlDevice nvmlDevice, NodeSetSize uint32, NodeSet *uint, Scope AffinityScope) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cNodeSetSize, _ := (C.uint)(NodeSetSize), cgoAllocsUnknown cNodeSet, _ := (*C.ulong)(unsafe.Pointer(NodeSet)), cgoAllocsUnknown cScope, _ := (C.nvmlAffinityScope_t)(Scope), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryAffinity(cDevice, cNodeSetSize, cNodeSet, cScope) + __ret := C.nvmlDeviceGetMemoryAffinity(cnvmlDevice, cNodeSetSize, cNodeSet, cScope) __v := (Return)(__ret) return __v } // nvmlDeviceGetCpuAffinityWithinScope function as declared in nvml/nvml.h -func nvmlDeviceGetCpuAffinityWithinScope(Device Device, CpuSetSize uint32, CpuSet *uint, Scope AffinityScope) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice nvmlDevice, CpuSetSize uint32, CpuSet *uint, Scope AffinityScope) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCpuSetSize, _ := (C.uint)(CpuSetSize), cgoAllocsUnknown cCpuSet, _ := (*C.ulong)(unsafe.Pointer(CpuSet)), cgoAllocsUnknown cScope, _ := (C.nvmlAffinityScope_t)(Scope), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCpuAffinityWithinScope(cDevice, cCpuSetSize, cCpuSet, cScope) + __ret := C.nvmlDeviceGetCpuAffinityWithinScope(cnvmlDevice, cCpuSetSize, cCpuSet, cScope) __v := (Return)(__ret) return __v } // nvmlDeviceGetCpuAffinity function as declared in nvml/nvml.h -func nvmlDeviceGetCpuAffinity(Device Device, CpuSetSize uint32, CpuSet *uint) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCpuAffinity(nvmlDevice nvmlDevice, CpuSetSize uint32, CpuSet *uint) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCpuSetSize, _ := (C.uint)(CpuSetSize), cgoAllocsUnknown cCpuSet, _ := (*C.ulong)(unsafe.Pointer(CpuSet)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCpuAffinity(cDevice, cCpuSetSize, cCpuSet) + __ret := C.nvmlDeviceGetCpuAffinity(cnvmlDevice, cCpuSetSize, cCpuSet) __v := (Return)(__ret) return __v } // nvmlDeviceSetCpuAffinity function as declared in nvml/nvml.h -func nvmlDeviceSetCpuAffinity(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetCpuAffinity(cDevice) +func nvmlDeviceSetCpuAffinity(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceSetCpuAffinity(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceClearCpuAffinity function as declared in nvml/nvml.h -func nvmlDeviceClearCpuAffinity(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceClearCpuAffinity(cDevice) +func nvmlDeviceClearCpuAffinity(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceClearCpuAffinity(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetTopologyCommonAncestor function as declared in nvml/nvml.h -func nvmlDeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device, PathInfo *GpuTopologyLevel) Return { +func nvmlDeviceGetTopologyCommonAncestor(Device1 nvmlDevice, Device2 nvmlDevice, PathInfo *GpuTopologyLevel) Return { cDevice1, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device1)), cgoAllocsUnknown cDevice2, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device2)), cgoAllocsUnknown cPathInfo, _ := (*C.nvmlGpuTopologyLevel_t)(unsafe.Pointer(PathInfo)), cgoAllocsUnknown @@ -334,18 +334,18 @@ func nvmlDeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device, PathInf } // nvmlDeviceGetTopologyNearestGpus function as declared in nvml/nvml.h -func nvmlDeviceGetTopologyNearestGpus(Device Device, Level GpuTopologyLevel, Count *uint32, DeviceArray *Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTopologyNearestGpus(nvmlDevice nvmlDevice, Level GpuTopologyLevel, Count *uint32, DeviceArray *nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLevel, _ := (C.nvmlGpuTopologyLevel_t)(Level), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cDeviceArray, _ := (*C.nvmlDevice_t)(unsafe.Pointer(DeviceArray)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTopologyNearestGpus(cDevice, cLevel, cCount, cDeviceArray) + __ret := C.nvmlDeviceGetTopologyNearestGpus(cnvmlDevice, cLevel, cCount, cDeviceArray) __v := (Return)(__ret) return __v } // nvmlSystemGetTopologyGpuSet function as declared in nvml/nvml.h -func nvmlSystemGetTopologyGpuSet(CpuNumber uint32, Count *uint32, DeviceArray *Device) Return { +func nvmlSystemGetTopologyGpuSet(CpuNumber uint32, Count *uint32, DeviceArray *nvmlDevice) Return { cCpuNumber, _ := (C.uint)(CpuNumber), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cDeviceArray, _ := (*C.nvmlDevice_t)(unsafe.Pointer(DeviceArray)), cgoAllocsUnknown @@ -355,7 +355,7 @@ func nvmlSystemGetTopologyGpuSet(CpuNumber uint32, Count *uint32, DeviceArray *D } // nvmlDeviceGetP2PStatus function as declared in nvml/nvml.h -func nvmlDeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex, P2pStatus *GpuP2PStatus) Return { +func nvmlDeviceGetP2PStatus(Device1 nvmlDevice, Device2 nvmlDevice, P2pIndex GpuP2PCapsIndex, P2pStatus *GpuP2PStatus) Return { cDevice1, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device1)), cgoAllocsUnknown cDevice2, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device2)), cgoAllocsUnknown cP2pIndex, _ := (C.nvmlGpuP2PCapsIndex_t)(P2pIndex), cgoAllocsUnknown @@ -366,776 +366,776 @@ func nvmlDeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsI } // nvmlDeviceGetUUID function as declared in nvml/nvml.h -func nvmlDeviceGetUUID(Device Device, Uuid *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetUUID(nvmlDevice nvmlDevice, Uuid *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUuid, _ := (*C.char)(unsafe.Pointer(Uuid)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetUUID(cDevice, cUuid, cLength) + __ret := C.nvmlDeviceGetUUID(cnvmlDevice, cUuid, cLength) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetMdevUUID function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance, MdevUuid *byte, Size uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance nvmlVgpuInstance, MdevUuid *byte, Size uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cMdevUuid, _ := (*C.char)(unsafe.Pointer(MdevUuid)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetMdevUUID(cVgpuInstance, cMdevUuid, cSize) + __ret := C.nvmlVgpuInstanceGetMdevUUID(cnvmlVgpuInstance, cMdevUuid, cSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetMinorNumber function as declared in nvml/nvml.h -func nvmlDeviceGetMinorNumber(Device Device, MinorNumber *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMinorNumber(nvmlDevice nvmlDevice, MinorNumber *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinorNumber, _ := (*C.uint)(unsafe.Pointer(MinorNumber)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMinorNumber(cDevice, cMinorNumber) + __ret := C.nvmlDeviceGetMinorNumber(cnvmlDevice, cMinorNumber) __v := (Return)(__ret) return __v } // nvmlDeviceGetBoardPartNumber function as declared in nvml/nvml.h -func nvmlDeviceGetBoardPartNumber(Device Device, PartNumber *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBoardPartNumber(nvmlDevice nvmlDevice, PartNumber *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPartNumber, _ := (*C.char)(unsafe.Pointer(PartNumber)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBoardPartNumber(cDevice, cPartNumber, cLength) + __ret := C.nvmlDeviceGetBoardPartNumber(cnvmlDevice, cPartNumber, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetInforomVersion function as declared in nvml/nvml.h -func nvmlDeviceGetInforomVersion(Device Device, Object InforomObject, Version *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetInforomVersion(nvmlDevice nvmlDevice, Object InforomObject, Version *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cObject, _ := (C.nvmlInforomObject_t)(Object), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetInforomVersion(cDevice, cObject, cVersion, cLength) + __ret := C.nvmlDeviceGetInforomVersion(cnvmlDevice, cObject, cVersion, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetInforomImageVersion function as declared in nvml/nvml.h -func nvmlDeviceGetInforomImageVersion(Device Device, Version *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetInforomImageVersion(nvmlDevice nvmlDevice, Version *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetInforomImageVersion(cDevice, cVersion, cLength) + __ret := C.nvmlDeviceGetInforomImageVersion(cnvmlDevice, cVersion, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetInforomConfigurationChecksum function as declared in nvml/nvml.h -func nvmlDeviceGetInforomConfigurationChecksum(Device Device, Checksum *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice nvmlDevice, Checksum *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cChecksum, _ := (*C.uint)(unsafe.Pointer(Checksum)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetInforomConfigurationChecksum(cDevice, cChecksum) + __ret := C.nvmlDeviceGetInforomConfigurationChecksum(cnvmlDevice, cChecksum) __v := (Return)(__ret) return __v } // nvmlDeviceValidateInforom function as declared in nvml/nvml.h -func nvmlDeviceValidateInforom(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceValidateInforom(cDevice) +func nvmlDeviceValidateInforom(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceValidateInforom(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetDisplayMode function as declared in nvml/nvml.h -func nvmlDeviceGetDisplayMode(Device Device, Display *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDisplayMode(nvmlDevice nvmlDevice, Display *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cDisplay, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Display)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDisplayMode(cDevice, cDisplay) + __ret := C.nvmlDeviceGetDisplayMode(cnvmlDevice, cDisplay) __v := (Return)(__ret) return __v } // nvmlDeviceGetDisplayActive function as declared in nvml/nvml.h -func nvmlDeviceGetDisplayActive(Device Device, IsActive *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDisplayActive(nvmlDevice nvmlDevice, IsActive *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsActive, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsActive)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDisplayActive(cDevice, cIsActive) + __ret := C.nvmlDeviceGetDisplayActive(cnvmlDevice, cIsActive) __v := (Return)(__ret) return __v } // nvmlDeviceGetPersistenceMode function as declared in nvml/nvml.h -func nvmlDeviceGetPersistenceMode(Device Device, Mode *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPersistenceMode(nvmlDevice nvmlDevice, Mode *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPersistenceMode(cDevice, cMode) + __ret := C.nvmlDeviceGetPersistenceMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetPciInfo_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetPciInfo_v3(Device Device, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPciInfo_v3(nvmlDevice nvmlDevice, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPciInfo_v3(cDevice, cPci) + __ret := C.nvmlDeviceGetPciInfo_v3(cnvmlDevice, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxPcieLinkGeneration function as declared in nvml/nvml.h -func nvmlDeviceGetMaxPcieLinkGeneration(Device Device, MaxLinkGen *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice nvmlDevice, MaxLinkGen *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMaxLinkGen, _ := (*C.uint)(unsafe.Pointer(MaxLinkGen)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxPcieLinkGeneration(cDevice, cMaxLinkGen) + __ret := C.nvmlDeviceGetMaxPcieLinkGeneration(cnvmlDevice, cMaxLinkGen) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuMaxPcieLinkGeneration function as declared in nvml/nvml.h -func nvmlDeviceGetGpuMaxPcieLinkGeneration(Device Device, MaxLinkGenDevice *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice nvmlDevice, MaxLinkGenDevice *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMaxLinkGenDevice, _ := (*C.uint)(unsafe.Pointer(MaxLinkGenDevice)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuMaxPcieLinkGeneration(cDevice, cMaxLinkGenDevice) + __ret := C.nvmlDeviceGetGpuMaxPcieLinkGeneration(cnvmlDevice, cMaxLinkGenDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxPcieLinkWidth function as declared in nvml/nvml.h -func nvmlDeviceGetMaxPcieLinkWidth(Device Device, MaxLinkWidth *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice nvmlDevice, MaxLinkWidth *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMaxLinkWidth, _ := (*C.uint)(unsafe.Pointer(MaxLinkWidth)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxPcieLinkWidth(cDevice, cMaxLinkWidth) + __ret := C.nvmlDeviceGetMaxPcieLinkWidth(cnvmlDevice, cMaxLinkWidth) __v := (Return)(__ret) return __v } // nvmlDeviceGetCurrPcieLinkGeneration function as declared in nvml/nvml.h -func nvmlDeviceGetCurrPcieLinkGeneration(Device Device, CurrLinkGen *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice nvmlDevice, CurrLinkGen *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrLinkGen, _ := (*C.uint)(unsafe.Pointer(CurrLinkGen)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCurrPcieLinkGeneration(cDevice, cCurrLinkGen) + __ret := C.nvmlDeviceGetCurrPcieLinkGeneration(cnvmlDevice, cCurrLinkGen) __v := (Return)(__ret) return __v } // nvmlDeviceGetCurrPcieLinkWidth function as declared in nvml/nvml.h -func nvmlDeviceGetCurrPcieLinkWidth(Device Device, CurrLinkWidth *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice nvmlDevice, CurrLinkWidth *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrLinkWidth, _ := (*C.uint)(unsafe.Pointer(CurrLinkWidth)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCurrPcieLinkWidth(cDevice, cCurrLinkWidth) + __ret := C.nvmlDeviceGetCurrPcieLinkWidth(cnvmlDevice, cCurrLinkWidth) __v := (Return)(__ret) return __v } // nvmlDeviceGetPcieThroughput function as declared in nvml/nvml.h -func nvmlDeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter, Value *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPcieThroughput(nvmlDevice nvmlDevice, Counter PcieUtilCounter, Value *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCounter, _ := (C.nvmlPcieUtilCounter_t)(Counter), cgoAllocsUnknown cValue, _ := (*C.uint)(unsafe.Pointer(Value)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPcieThroughput(cDevice, cCounter, cValue) + __ret := C.nvmlDeviceGetPcieThroughput(cnvmlDevice, cCounter, cValue) __v := (Return)(__ret) return __v } // nvmlDeviceGetPcieReplayCounter function as declared in nvml/nvml.h -func nvmlDeviceGetPcieReplayCounter(Device Device, Value *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPcieReplayCounter(nvmlDevice nvmlDevice, Value *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cValue, _ := (*C.uint)(unsafe.Pointer(Value)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPcieReplayCounter(cDevice, cValue) + __ret := C.nvmlDeviceGetPcieReplayCounter(cnvmlDevice, cValue) __v := (Return)(__ret) return __v } // nvmlDeviceGetClockInfo function as declared in nvml/nvml.h -func nvmlDeviceGetClockInfo(Device Device, _type ClockType, Clock *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetClockInfo(nvmlDevice nvmlDevice, _type ClockType, Clock *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (C.nvmlClockType_t)(_type), cgoAllocsUnknown cClock, _ := (*C.uint)(unsafe.Pointer(Clock)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetClockInfo(cDevice, c_type, cClock) + __ret := C.nvmlDeviceGetClockInfo(cnvmlDevice, c_type, cClock) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxClockInfo function as declared in nvml/nvml.h -func nvmlDeviceGetMaxClockInfo(Device Device, _type ClockType, Clock *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxClockInfo(nvmlDevice nvmlDevice, _type ClockType, Clock *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (C.nvmlClockType_t)(_type), cgoAllocsUnknown cClock, _ := (*C.uint)(unsafe.Pointer(Clock)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxClockInfo(cDevice, c_type, cClock) + __ret := C.nvmlDeviceGetMaxClockInfo(cnvmlDevice, c_type, cClock) __v := (Return)(__ret) return __v } // nvmlDeviceGetApplicationsClock function as declared in nvml/nvml.h -func nvmlDeviceGetApplicationsClock(Device Device, ClockType ClockType, ClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetApplicationsClock(nvmlDevice nvmlDevice, ClockType ClockType, ClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClockType, _ := (C.nvmlClockType_t)(ClockType), cgoAllocsUnknown cClockMHz, _ := (*C.uint)(unsafe.Pointer(ClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetApplicationsClock(cDevice, cClockType, cClockMHz) + __ret := C.nvmlDeviceGetApplicationsClock(cnvmlDevice, cClockType, cClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetDefaultApplicationsClock function as declared in nvml/nvml.h -func nvmlDeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType, ClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDefaultApplicationsClock(nvmlDevice nvmlDevice, ClockType ClockType, ClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClockType, _ := (C.nvmlClockType_t)(ClockType), cgoAllocsUnknown cClockMHz, _ := (*C.uint)(unsafe.Pointer(ClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDefaultApplicationsClock(cDevice, cClockType, cClockMHz) + __ret := C.nvmlDeviceGetDefaultApplicationsClock(cnvmlDevice, cClockType, cClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceResetApplicationsClocks function as declared in nvml/nvml.h -func nvmlDeviceResetApplicationsClocks(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceResetApplicationsClocks(cDevice) +func nvmlDeviceResetApplicationsClocks(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceResetApplicationsClocks(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetClock function as declared in nvml/nvml.h -func nvmlDeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId, ClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetClock(nvmlDevice nvmlDevice, ClockType ClockType, ClockId ClockId, ClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClockType, _ := (C.nvmlClockType_t)(ClockType), cgoAllocsUnknown cClockId, _ := (C.nvmlClockId_t)(ClockId), cgoAllocsUnknown cClockMHz, _ := (*C.uint)(unsafe.Pointer(ClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetClock(cDevice, cClockType, cClockId, cClockMHz) + __ret := C.nvmlDeviceGetClock(cnvmlDevice, cClockType, cClockId, cClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxCustomerBoostClock function as declared in nvml/nvml.h -func nvmlDeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType, ClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice nvmlDevice, ClockType ClockType, ClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClockType, _ := (C.nvmlClockType_t)(ClockType), cgoAllocsUnknown cClockMHz, _ := (*C.uint)(unsafe.Pointer(ClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxCustomerBoostClock(cDevice, cClockType, cClockMHz) + __ret := C.nvmlDeviceGetMaxCustomerBoostClock(cnvmlDevice, cClockType, cClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedMemoryClocks function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedMemoryClocks(Device Device, Count *uint32, ClocksMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedMemoryClocks(nvmlDevice nvmlDevice, Count *uint32, ClocksMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cClocksMHz, _ := (*C.uint)(unsafe.Pointer(ClocksMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedMemoryClocks(cDevice, cCount, cClocksMHz) + __ret := C.nvmlDeviceGetSupportedMemoryClocks(cnvmlDevice, cCount, cClocksMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedGraphicsClocks function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz uint32, Count *uint32, ClocksMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice nvmlDevice, MemoryClockMHz uint32, Count *uint32, ClocksMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMemoryClockMHz, _ := (C.uint)(MemoryClockMHz), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cClocksMHz, _ := (*C.uint)(unsafe.Pointer(ClocksMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedGraphicsClocks(cDevice, cMemoryClockMHz, cCount, cClocksMHz) + __ret := C.nvmlDeviceGetSupportedGraphicsClocks(cnvmlDevice, cMemoryClockMHz, cCount, cClocksMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetAutoBoostedClocksEnabled function as declared in nvml/nvml.h -func nvmlDeviceGetAutoBoostedClocksEnabled(Device Device, IsEnabled *EnableState, DefaultIsEnabled *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice nvmlDevice, IsEnabled *EnableState, DefaultIsEnabled *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsEnabled, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsEnabled)), cgoAllocsUnknown cDefaultIsEnabled, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(DefaultIsEnabled)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAutoBoostedClocksEnabled(cDevice, cIsEnabled, cDefaultIsEnabled) + __ret := C.nvmlDeviceGetAutoBoostedClocksEnabled(cnvmlDevice, cIsEnabled, cDefaultIsEnabled) __v := (Return)(__ret) return __v } // nvmlDeviceSetAutoBoostedClocksEnabled function as declared in nvml/nvml.h -func nvmlDeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice nvmlDevice, Enabled EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEnabled, _ := (C.nvmlEnableState_t)(Enabled), cgoAllocsUnknown - __ret := C.nvmlDeviceSetAutoBoostedClocksEnabled(cDevice, cEnabled) + __ret := C.nvmlDeviceSetAutoBoostedClocksEnabled(cnvmlDevice, cEnabled) __v := (Return)(__ret) return __v } // nvmlDeviceSetDefaultAutoBoostedClocksEnabled function as declared in nvml/nvml.h -func nvmlDeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice nvmlDevice, Enabled EnableState, Flags uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEnabled, _ := (C.nvmlEnableState_t)(Enabled), cgoAllocsUnknown cFlags, _ := (C.uint)(Flags), cgoAllocsUnknown - __ret := C.nvmlDeviceSetDefaultAutoBoostedClocksEnabled(cDevice, cEnabled, cFlags) + __ret := C.nvmlDeviceSetDefaultAutoBoostedClocksEnabled(cnvmlDevice, cEnabled, cFlags) __v := (Return)(__ret) return __v } // nvmlDeviceGetFanSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetFanSpeed(Device Device, Speed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFanSpeed(nvmlDevice nvmlDevice, Speed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSpeed, _ := (*C.uint)(unsafe.Pointer(Speed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFanSpeed(cDevice, cSpeed) + __ret := C.nvmlDeviceGetFanSpeed(cnvmlDevice, cSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetFanSpeed_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetFanSpeed_v2(Device Device, Fan uint32, Speed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFanSpeed_v2(nvmlDevice nvmlDevice, Fan uint32, Speed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cSpeed, _ := (*C.uint)(unsafe.Pointer(Speed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFanSpeed_v2(cDevice, cFan, cSpeed) + __ret := C.nvmlDeviceGetFanSpeed_v2(cnvmlDevice, cFan, cSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetTargetFanSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetTargetFanSpeed(Device Device, Fan uint32, TargetSpeed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTargetFanSpeed(nvmlDevice nvmlDevice, Fan uint32, TargetSpeed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cTargetSpeed, _ := (*C.uint)(unsafe.Pointer(TargetSpeed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTargetFanSpeed(cDevice, cFan, cTargetSpeed) + __ret := C.nvmlDeviceGetTargetFanSpeed(cnvmlDevice, cFan, cTargetSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceSetDefaultFanSpeed_v2 function as declared in nvml/nvml.h -func nvmlDeviceSetDefaultFanSpeed_v2(Device Device, Fan uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice nvmlDevice, Fan uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown - __ret := C.nvmlDeviceSetDefaultFanSpeed_v2(cDevice, cFan) + __ret := C.nvmlDeviceSetDefaultFanSpeed_v2(cnvmlDevice, cFan) __v := (Return)(__ret) return __v } // nvmlDeviceGetMinMaxFanSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetMinMaxFanSpeed(Device Device, MinSpeed *uint32, MaxSpeed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMinMaxFanSpeed(nvmlDevice nvmlDevice, MinSpeed *uint32, MaxSpeed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinSpeed, _ := (*C.uint)(unsafe.Pointer(MinSpeed)), cgoAllocsUnknown cMaxSpeed, _ := (*C.uint)(unsafe.Pointer(MaxSpeed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMinMaxFanSpeed(cDevice, cMinSpeed, cMaxSpeed) + __ret := C.nvmlDeviceGetMinMaxFanSpeed(cnvmlDevice, cMinSpeed, cMaxSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetFanControlPolicy_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetFanControlPolicy_v2(Device Device, Fan uint32, Policy *FanControlPolicy) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFanControlPolicy_v2(nvmlDevice nvmlDevice, Fan uint32, Policy *FanControlPolicy) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cPolicy, _ := (*C.nvmlFanControlPolicy_t)(unsafe.Pointer(Policy)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFanControlPolicy_v2(cDevice, cFan, cPolicy) + __ret := C.nvmlDeviceGetFanControlPolicy_v2(cnvmlDevice, cFan, cPolicy) __v := (Return)(__ret) return __v } // nvmlDeviceSetFanControlPolicy function as declared in nvml/nvml.h -func nvmlDeviceSetFanControlPolicy(Device Device, Fan uint32, Policy FanControlPolicy) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetFanControlPolicy(nvmlDevice nvmlDevice, Fan uint32, Policy FanControlPolicy) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cPolicy, _ := (C.nvmlFanControlPolicy_t)(Policy), cgoAllocsUnknown - __ret := C.nvmlDeviceSetFanControlPolicy(cDevice, cFan, cPolicy) + __ret := C.nvmlDeviceSetFanControlPolicy(cnvmlDevice, cFan, cPolicy) __v := (Return)(__ret) return __v } // nvmlDeviceGetNumFans function as declared in nvml/nvml.h -func nvmlDeviceGetNumFans(Device Device, NumFans *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNumFans(nvmlDevice nvmlDevice, NumFans *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cNumFans, _ := (*C.uint)(unsafe.Pointer(NumFans)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNumFans(cDevice, cNumFans) + __ret := C.nvmlDeviceGetNumFans(cnvmlDevice, cNumFans) __v := (Return)(__ret) return __v } // nvmlDeviceGetTemperature function as declared in nvml/nvml.h -func nvmlDeviceGetTemperature(Device Device, SensorType TemperatureSensors, Temp *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTemperature(nvmlDevice nvmlDevice, SensorType TemperatureSensors, Temp *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSensorType, _ := (C.nvmlTemperatureSensors_t)(SensorType), cgoAllocsUnknown cTemp, _ := (*C.uint)(unsafe.Pointer(Temp)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTemperature(cDevice, cSensorType, cTemp) + __ret := C.nvmlDeviceGetTemperature(cnvmlDevice, cSensorType, cTemp) __v := (Return)(__ret) return __v } // nvmlDeviceGetTemperatureThreshold function as declared in nvml/nvml.h -func nvmlDeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTemperatureThreshold(nvmlDevice nvmlDevice, ThresholdType TemperatureThresholds, Temp *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cThresholdType, _ := (C.nvmlTemperatureThresholds_t)(ThresholdType), cgoAllocsUnknown cTemp, _ := (*C.uint)(unsafe.Pointer(Temp)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTemperatureThreshold(cDevice, cThresholdType, cTemp) + __ret := C.nvmlDeviceGetTemperatureThreshold(cnvmlDevice, cThresholdType, cTemp) __v := (Return)(__ret) return __v } // nvmlDeviceSetTemperatureThreshold function as declared in nvml/nvml.h -func nvmlDeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetTemperatureThreshold(nvmlDevice nvmlDevice, ThresholdType TemperatureThresholds, Temp *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cThresholdType, _ := (C.nvmlTemperatureThresholds_t)(ThresholdType), cgoAllocsUnknown cTemp, _ := (*C.int)(unsafe.Pointer(Temp)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetTemperatureThreshold(cDevice, cThresholdType, cTemp) + __ret := C.nvmlDeviceSetTemperatureThreshold(cnvmlDevice, cThresholdType, cTemp) __v := (Return)(__ret) return __v } // nvmlDeviceGetThermalSettings function as declared in nvml/nvml.h -func nvmlDeviceGetThermalSettings(Device Device, SensorIndex uint32, PThermalSettings *GpuThermalSettings) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetThermalSettings(nvmlDevice nvmlDevice, SensorIndex uint32, PThermalSettings *GpuThermalSettings) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSensorIndex, _ := (C.uint)(SensorIndex), cgoAllocsUnknown cPThermalSettings, _ := (*C.nvmlGpuThermalSettings_t)(unsafe.Pointer(PThermalSettings)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetThermalSettings(cDevice, cSensorIndex, cPThermalSettings) + __ret := C.nvmlDeviceGetThermalSettings(cnvmlDevice, cSensorIndex, cPThermalSettings) __v := (Return)(__ret) return __v } // nvmlDeviceGetPerformanceState function as declared in nvml/nvml.h -func nvmlDeviceGetPerformanceState(Device Device, PState *Pstates) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPerformanceState(nvmlDevice nvmlDevice, PState *Pstates) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPState, _ := (*C.nvmlPstates_t)(unsafe.Pointer(PState)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPerformanceState(cDevice, cPState) + __ret := C.nvmlDeviceGetPerformanceState(cnvmlDevice, cPState) __v := (Return)(__ret) return __v } // nvmlDeviceGetCurrentClocksThrottleReasons function as declared in nvml/nvml.h -func nvmlDeviceGetCurrentClocksThrottleReasons(Device Device, ClocksThrottleReasons *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCurrentClocksThrottleReasons(nvmlDevice nvmlDevice, ClocksThrottleReasons *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClocksThrottleReasons, _ := (*C.ulonglong)(unsafe.Pointer(ClocksThrottleReasons)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCurrentClocksThrottleReasons(cDevice, cClocksThrottleReasons) + __ret := C.nvmlDeviceGetCurrentClocksThrottleReasons(cnvmlDevice, cClocksThrottleReasons) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedClocksThrottleReasons function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedClocksThrottleReasons(Device Device, SupportedClocksThrottleReasons *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedClocksThrottleReasons(nvmlDevice nvmlDevice, SupportedClocksThrottleReasons *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSupportedClocksThrottleReasons, _ := (*C.ulonglong)(unsafe.Pointer(SupportedClocksThrottleReasons)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedClocksThrottleReasons(cDevice, cSupportedClocksThrottleReasons) + __ret := C.nvmlDeviceGetSupportedClocksThrottleReasons(cnvmlDevice, cSupportedClocksThrottleReasons) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerState function as declared in nvml/nvml.h -func nvmlDeviceGetPowerState(Device Device, PState *Pstates) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerState(nvmlDevice nvmlDevice, PState *Pstates) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPState, _ := (*C.nvmlPstates_t)(unsafe.Pointer(PState)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerState(cDevice, cPState) + __ret := C.nvmlDeviceGetPowerState(cnvmlDevice, cPState) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerManagementMode function as declared in nvml/nvml.h -func nvmlDeviceGetPowerManagementMode(Device Device, Mode *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerManagementMode(nvmlDevice nvmlDevice, Mode *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerManagementMode(cDevice, cMode) + __ret := C.nvmlDeviceGetPowerManagementMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerManagementLimit function as declared in nvml/nvml.h -func nvmlDeviceGetPowerManagementLimit(Device Device, Limit *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerManagementLimit(nvmlDevice nvmlDevice, Limit *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLimit, _ := (*C.uint)(unsafe.Pointer(Limit)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerManagementLimit(cDevice, cLimit) + __ret := C.nvmlDeviceGetPowerManagementLimit(cnvmlDevice, cLimit) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerManagementLimitConstraints function as declared in nvml/nvml.h -func nvmlDeviceGetPowerManagementLimitConstraints(Device Device, MinLimit *uint32, MaxLimit *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice nvmlDevice, MinLimit *uint32, MaxLimit *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinLimit, _ := (*C.uint)(unsafe.Pointer(MinLimit)), cgoAllocsUnknown cMaxLimit, _ := (*C.uint)(unsafe.Pointer(MaxLimit)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerManagementLimitConstraints(cDevice, cMinLimit, cMaxLimit) + __ret := C.nvmlDeviceGetPowerManagementLimitConstraints(cnvmlDevice, cMinLimit, cMaxLimit) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerManagementDefaultLimit function as declared in nvml/nvml.h -func nvmlDeviceGetPowerManagementDefaultLimit(Device Device, DefaultLimit *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice nvmlDevice, DefaultLimit *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cDefaultLimit, _ := (*C.uint)(unsafe.Pointer(DefaultLimit)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerManagementDefaultLimit(cDevice, cDefaultLimit) + __ret := C.nvmlDeviceGetPowerManagementDefaultLimit(cnvmlDevice, cDefaultLimit) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerUsage function as declared in nvml/nvml.h -func nvmlDeviceGetPowerUsage(Device Device, Power *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerUsage(nvmlDevice nvmlDevice, Power *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPower, _ := (*C.uint)(unsafe.Pointer(Power)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerUsage(cDevice, cPower) + __ret := C.nvmlDeviceGetPowerUsage(cnvmlDevice, cPower) __v := (Return)(__ret) return __v } // nvmlDeviceGetTotalEnergyConsumption function as declared in nvml/nvml.h -func nvmlDeviceGetTotalEnergyConsumption(Device Device, Energy *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTotalEnergyConsumption(nvmlDevice nvmlDevice, Energy *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEnergy, _ := (*C.ulonglong)(unsafe.Pointer(Energy)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTotalEnergyConsumption(cDevice, cEnergy) + __ret := C.nvmlDeviceGetTotalEnergyConsumption(cnvmlDevice, cEnergy) __v := (Return)(__ret) return __v } // nvmlDeviceGetEnforcedPowerLimit function as declared in nvml/nvml.h -func nvmlDeviceGetEnforcedPowerLimit(Device Device, Limit *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEnforcedPowerLimit(nvmlDevice nvmlDevice, Limit *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLimit, _ := (*C.uint)(unsafe.Pointer(Limit)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEnforcedPowerLimit(cDevice, cLimit) + __ret := C.nvmlDeviceGetEnforcedPowerLimit(cnvmlDevice, cLimit) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuOperationMode function as declared in nvml/nvml.h -func nvmlDeviceGetGpuOperationMode(Device Device, Current *GpuOperationMode, Pending *GpuOperationMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuOperationMode(nvmlDevice nvmlDevice, Current *GpuOperationMode, Pending *GpuOperationMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrent, _ := (*C.nvmlGpuOperationMode_t)(unsafe.Pointer(Current)), cgoAllocsUnknown cPending, _ := (*C.nvmlGpuOperationMode_t)(unsafe.Pointer(Pending)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuOperationMode(cDevice, cCurrent, cPending) + __ret := C.nvmlDeviceGetGpuOperationMode(cnvmlDevice, cCurrent, cPending) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryInfo function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryInfo(Device Device, Memory *Memory) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryInfo(nvmlDevice nvmlDevice, Memory *Memory) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMemory, _ := (*C.nvmlMemory_t)(unsafe.Pointer(Memory)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryInfo(cDevice, cMemory) + __ret := C.nvmlDeviceGetMemoryInfo(cnvmlDevice, cMemory) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryInfo_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryInfo_v2(Device Device, Memory *Memory_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryInfo_v2(nvmlDevice nvmlDevice, Memory *Memory_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMemory, _ := (*C.nvmlMemory_v2_t)(unsafe.Pointer(Memory)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryInfo_v2(cDevice, cMemory) + __ret := C.nvmlDeviceGetMemoryInfo_v2(cnvmlDevice, cMemory) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeMode function as declared in nvml/nvml.h -func nvmlDeviceGetComputeMode(Device Device, Mode *ComputeMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeMode(nvmlDevice nvmlDevice, Mode *ComputeMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (*C.nvmlComputeMode_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeMode(cDevice, cMode) + __ret := C.nvmlDeviceGetComputeMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetCudaComputeCapability function as declared in nvml/nvml.h -func nvmlDeviceGetCudaComputeCapability(Device Device, Major *int32, Minor *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCudaComputeCapability(nvmlDevice nvmlDevice, Major *int32, Minor *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMajor, _ := (*C.int)(unsafe.Pointer(Major)), cgoAllocsUnknown cMinor, _ := (*C.int)(unsafe.Pointer(Minor)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCudaComputeCapability(cDevice, cMajor, cMinor) + __ret := C.nvmlDeviceGetCudaComputeCapability(cnvmlDevice, cMajor, cMinor) __v := (Return)(__ret) return __v } // nvmlDeviceGetEccMode function as declared in nvml/nvml.h -func nvmlDeviceGetEccMode(Device Device, Current *EnableState, Pending *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEccMode(nvmlDevice nvmlDevice, Current *EnableState, Pending *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrent, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Current)), cgoAllocsUnknown cPending, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Pending)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEccMode(cDevice, cCurrent, cPending) + __ret := C.nvmlDeviceGetEccMode(cnvmlDevice, cCurrent, cPending) __v := (Return)(__ret) return __v } // nvmlDeviceGetDefaultEccMode function as declared in nvml/nvml.h -func nvmlDeviceGetDefaultEccMode(Device Device, DefaultMode *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDefaultEccMode(nvmlDevice nvmlDevice, DefaultMode *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cDefaultMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(DefaultMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDefaultEccMode(cDevice, cDefaultMode) + __ret := C.nvmlDeviceGetDefaultEccMode(cnvmlDevice, cDefaultMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetBoardId function as declared in nvml/nvml.h -func nvmlDeviceGetBoardId(Device Device, BoardId *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBoardId(nvmlDevice nvmlDevice, BoardId *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBoardId, _ := (*C.uint)(unsafe.Pointer(BoardId)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBoardId(cDevice, cBoardId) + __ret := C.nvmlDeviceGetBoardId(cnvmlDevice, cBoardId) __v := (Return)(__ret) return __v } // nvmlDeviceGetMultiGpuBoard function as declared in nvml/nvml.h -func nvmlDeviceGetMultiGpuBoard(Device Device, MultiGpuBool *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMultiGpuBoard(nvmlDevice nvmlDevice, MultiGpuBool *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMultiGpuBool, _ := (*C.uint)(unsafe.Pointer(MultiGpuBool)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMultiGpuBoard(cDevice, cMultiGpuBool) + __ret := C.nvmlDeviceGetMultiGpuBoard(cnvmlDevice, cMultiGpuBool) __v := (Return)(__ret) return __v } // nvmlDeviceGetTotalEccErrors function as declared in nvml/nvml.h -func nvmlDeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, EccCounts *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTotalEccErrors(nvmlDevice nvmlDevice, ErrorType MemoryErrorType, CounterType EccCounterType, EccCounts *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cErrorType, _ := (C.nvmlMemoryErrorType_t)(ErrorType), cgoAllocsUnknown cCounterType, _ := (C.nvmlEccCounterType_t)(CounterType), cgoAllocsUnknown cEccCounts, _ := (*C.ulonglong)(unsafe.Pointer(EccCounts)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTotalEccErrors(cDevice, cErrorType, cCounterType, cEccCounts) + __ret := C.nvmlDeviceGetTotalEccErrors(cnvmlDevice, cErrorType, cCounterType, cEccCounts) __v := (Return)(__ret) return __v } // nvmlDeviceGetDetailedEccErrors function as declared in nvml/nvml.h -func nvmlDeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, EccCounts *EccErrorCounts) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDetailedEccErrors(nvmlDevice nvmlDevice, ErrorType MemoryErrorType, CounterType EccCounterType, EccCounts *EccErrorCounts) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cErrorType, _ := (C.nvmlMemoryErrorType_t)(ErrorType), cgoAllocsUnknown cCounterType, _ := (C.nvmlEccCounterType_t)(CounterType), cgoAllocsUnknown cEccCounts, _ := (*C.nvmlEccErrorCounts_t)(unsafe.Pointer(EccCounts)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDetailedEccErrors(cDevice, cErrorType, cCounterType, cEccCounts) + __ret := C.nvmlDeviceGetDetailedEccErrors(cnvmlDevice, cErrorType, cCounterType, cEccCounts) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryErrorCounter function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation, Count *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryErrorCounter(nvmlDevice nvmlDevice, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation, Count *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cErrorType, _ := (C.nvmlMemoryErrorType_t)(ErrorType), cgoAllocsUnknown cCounterType, _ := (C.nvmlEccCounterType_t)(CounterType), cgoAllocsUnknown cLocationType, _ := (C.nvmlMemoryLocation_t)(LocationType), cgoAllocsUnknown cCount, _ := (*C.ulonglong)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryErrorCounter(cDevice, cErrorType, cCounterType, cLocationType, cCount) + __ret := C.nvmlDeviceGetMemoryErrorCounter(cnvmlDevice, cErrorType, cCounterType, cLocationType, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceGetUtilizationRates function as declared in nvml/nvml.h -func nvmlDeviceGetUtilizationRates(Device Device, Utilization *Utilization) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetUtilizationRates(nvmlDevice nvmlDevice, Utilization *Utilization) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUtilization, _ := (*C.nvmlUtilization_t)(unsafe.Pointer(Utilization)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetUtilizationRates(cDevice, cUtilization) + __ret := C.nvmlDeviceGetUtilizationRates(cnvmlDevice, cUtilization) __v := (Return)(__ret) return __v } // nvmlDeviceGetEncoderUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetEncoderUtilization(Device Device, Utilization *uint32, SamplingPeriodUs *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEncoderUtilization(nvmlDevice nvmlDevice, Utilization *uint32, SamplingPeriodUs *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUtilization, _ := (*C.uint)(unsafe.Pointer(Utilization)), cgoAllocsUnknown cSamplingPeriodUs, _ := (*C.uint)(unsafe.Pointer(SamplingPeriodUs)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEncoderUtilization(cDevice, cUtilization, cSamplingPeriodUs) + __ret := C.nvmlDeviceGetEncoderUtilization(cnvmlDevice, cUtilization, cSamplingPeriodUs) __v := (Return)(__ret) return __v } // nvmlDeviceGetEncoderCapacity function as declared in nvml/nvml.h -func nvmlDeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType, EncoderCapacity *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEncoderCapacity(nvmlDevice nvmlDevice, EncoderQueryType EncoderType, EncoderCapacity *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEncoderQueryType, _ := (C.nvmlEncoderType_t)(EncoderQueryType), cgoAllocsUnknown cEncoderCapacity, _ := (*C.uint)(unsafe.Pointer(EncoderCapacity)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEncoderCapacity(cDevice, cEncoderQueryType, cEncoderCapacity) + __ret := C.nvmlDeviceGetEncoderCapacity(cnvmlDevice, cEncoderQueryType, cEncoderCapacity) __v := (Return)(__ret) return __v } // nvmlDeviceGetEncoderStats function as declared in nvml/nvml.h -func nvmlDeviceGetEncoderStats(Device Device, SessionCount *uint32, AverageFps *uint32, AverageLatency *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEncoderStats(nvmlDevice nvmlDevice, SessionCount *uint32, AverageFps *uint32, AverageLatency *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cAverageFps, _ := (*C.uint)(unsafe.Pointer(AverageFps)), cgoAllocsUnknown cAverageLatency, _ := (*C.uint)(unsafe.Pointer(AverageLatency)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEncoderStats(cDevice, cSessionCount, cAverageFps, cAverageLatency) + __ret := C.nvmlDeviceGetEncoderStats(cnvmlDevice, cSessionCount, cAverageFps, cAverageLatency) __v := (Return)(__ret) return __v } // nvmlDeviceGetEncoderSessions function as declared in nvml/nvml.h -func nvmlDeviceGetEncoderSessions(Device Device, SessionCount *uint32, SessionInfos *EncoderSessionInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEncoderSessions(nvmlDevice nvmlDevice, SessionCount *uint32, SessionInfos *EncoderSessionInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cSessionInfos, _ := (*C.nvmlEncoderSessionInfo_t)(unsafe.Pointer(SessionInfos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEncoderSessions(cDevice, cSessionCount, cSessionInfos) + __ret := C.nvmlDeviceGetEncoderSessions(cnvmlDevice, cSessionCount, cSessionInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetDecoderUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetDecoderUtilization(Device Device, Utilization *uint32, SamplingPeriodUs *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDecoderUtilization(nvmlDevice nvmlDevice, Utilization *uint32, SamplingPeriodUs *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUtilization, _ := (*C.uint)(unsafe.Pointer(Utilization)), cgoAllocsUnknown cSamplingPeriodUs, _ := (*C.uint)(unsafe.Pointer(SamplingPeriodUs)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDecoderUtilization(cDevice, cUtilization, cSamplingPeriodUs) + __ret := C.nvmlDeviceGetDecoderUtilization(cnvmlDevice, cUtilization, cSamplingPeriodUs) __v := (Return)(__ret) return __v } // nvmlDeviceGetFBCStats function as declared in nvml/nvml.h -func nvmlDeviceGetFBCStats(Device Device, FbcStats *FBCStats) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFBCStats(nvmlDevice nvmlDevice, FbcStats *FBCStats) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFbcStats, _ := (*C.nvmlFBCStats_t)(unsafe.Pointer(FbcStats)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFBCStats(cDevice, cFbcStats) + __ret := C.nvmlDeviceGetFBCStats(cnvmlDevice, cFbcStats) __v := (Return)(__ret) return __v } // nvmlDeviceGetFBCSessions function as declared in nvml/nvml.h -func nvmlDeviceGetFBCSessions(Device Device, SessionCount *uint32, SessionInfo *FBCSessionInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFBCSessions(nvmlDevice nvmlDevice, SessionCount *uint32, SessionInfo *FBCSessionInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cSessionInfo, _ := (*C.nvmlFBCSessionInfo_t)(unsafe.Pointer(SessionInfo)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFBCSessions(cDevice, cSessionCount, cSessionInfo) + __ret := C.nvmlDeviceGetFBCSessions(cnvmlDevice, cSessionCount, cSessionInfo) __v := (Return)(__ret) return __v } // nvmlDeviceGetDriverModel function as declared in nvml/nvml.h -func nvmlDeviceGetDriverModel(Device Device, Current *DriverModel, Pending *DriverModel) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDriverModel(nvmlDevice nvmlDevice, Current *DriverModel, Pending *DriverModel) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrent, _ := (*C.nvmlDriverModel_t)(unsafe.Pointer(Current)), cgoAllocsUnknown cPending, _ := (*C.nvmlDriverModel_t)(unsafe.Pointer(Pending)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDriverModel(cDevice, cCurrent, cPending) + __ret := C.nvmlDeviceGetDriverModel(cnvmlDevice, cCurrent, cPending) __v := (Return)(__ret) return __v } // nvmlDeviceGetVbiosVersion function as declared in nvml/nvml.h -func nvmlDeviceGetVbiosVersion(Device Device, Version *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVbiosVersion(nvmlDevice nvmlDevice, Version *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVbiosVersion(cDevice, cVersion, cLength) + __ret := C.nvmlDeviceGetVbiosVersion(cnvmlDevice, cVersion, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetBridgeChipInfo function as declared in nvml/nvml.h -func nvmlDeviceGetBridgeChipInfo(Device Device, BridgeHierarchy *BridgeChipHierarchy) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBridgeChipInfo(nvmlDevice nvmlDevice, BridgeHierarchy *BridgeChipHierarchy) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBridgeHierarchy, _ := (*C.nvmlBridgeChipHierarchy_t)(unsafe.Pointer(BridgeHierarchy)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBridgeChipInfo(cDevice, cBridgeHierarchy) + __ret := C.nvmlDeviceGetBridgeChipInfo(cnvmlDevice, cBridgeHierarchy) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeRunningProcesses_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetComputeRunningProcesses_v3(Device Device, InfoCount *uint32, Infos *ProcessInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeRunningProcesses_v3(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetComputeRunningProcesses_v3(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetGraphicsRunningProcesses_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetGraphicsRunningProcesses_v3(Device Device, InfoCount *uint32, Infos *ProcessInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGraphicsRunningProcesses_v3(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetGraphicsRunningProcesses_v3(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetMPSComputeRunningProcesses_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetMPSComputeRunningProcesses_v3(Device Device, InfoCount *uint32, Infos *ProcessInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMPSComputeRunningProcesses_v3(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetMPSComputeRunningProcesses_v3(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceOnSameBoard function as declared in nvml/nvml.h -func nvmlDeviceOnSameBoard(Device1 Device, Device2 Device, OnSameBoard *int32) Return { +func nvmlDeviceOnSameBoard(Device1 nvmlDevice, Device2 nvmlDevice, OnSameBoard *int32) Return { cDevice1, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device1)), cgoAllocsUnknown cDevice2, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device2)), cgoAllocsUnknown cOnSameBoard, _ := (*C.int)(unsafe.Pointer(OnSameBoard)), cgoAllocsUnknown @@ -1145,494 +1145,494 @@ func nvmlDeviceOnSameBoard(Device1 Device, Device2 Device, OnSameBoard *int32) R } // nvmlDeviceGetAPIRestriction function as declared in nvml/nvml.h -func nvmlDeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAPIRestriction(nvmlDevice nvmlDevice, ApiType RestrictedAPI, IsRestricted *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cApiType, _ := (C.nvmlRestrictedAPI_t)(ApiType), cgoAllocsUnknown cIsRestricted, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsRestricted)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAPIRestriction(cDevice, cApiType, cIsRestricted) + __ret := C.nvmlDeviceGetAPIRestriction(cnvmlDevice, cApiType, cIsRestricted) __v := (Return)(__ret) return __v } // nvmlDeviceGetSamples function as declared in nvml/nvml.h -func nvmlDeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64, SampleValType *ValueType, SampleCount *uint32, Samples *Sample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSamples(nvmlDevice nvmlDevice, _type SamplingType, LastSeenTimeStamp uint64, SampleValType *ValueType, SampleCount *uint32, Samples *Sample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (C.nvmlSamplingType_t)(_type), cgoAllocsUnknown cLastSeenTimeStamp, _ := (C.ulonglong)(LastSeenTimeStamp), cgoAllocsUnknown cSampleValType, _ := (*C.nvmlValueType_t)(unsafe.Pointer(SampleValType)), cgoAllocsUnknown cSampleCount, _ := (*C.uint)(unsafe.Pointer(SampleCount)), cgoAllocsUnknown cSamples, _ := (*C.nvmlSample_t)(unsafe.Pointer(Samples)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSamples(cDevice, c_type, cLastSeenTimeStamp, cSampleValType, cSampleCount, cSamples) + __ret := C.nvmlDeviceGetSamples(cnvmlDevice, c_type, cLastSeenTimeStamp, cSampleValType, cSampleCount, cSamples) __v := (Return)(__ret) return __v } // nvmlDeviceGetBAR1MemoryInfo function as declared in nvml/nvml.h -func nvmlDeviceGetBAR1MemoryInfo(Device Device, Bar1Memory *BAR1Memory) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBAR1MemoryInfo(nvmlDevice nvmlDevice, Bar1Memory *BAR1Memory) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBar1Memory, _ := (*C.nvmlBAR1Memory_t)(unsafe.Pointer(Bar1Memory)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBAR1MemoryInfo(cDevice, cBar1Memory) + __ret := C.nvmlDeviceGetBAR1MemoryInfo(cnvmlDevice, cBar1Memory) __v := (Return)(__ret) return __v } // nvmlDeviceGetViolationStatus function as declared in nvml/nvml.h -func nvmlDeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType, ViolTime *ViolationTime) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetViolationStatus(nvmlDevice nvmlDevice, PerfPolicyType PerfPolicyType, ViolTime *ViolationTime) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPerfPolicyType, _ := (C.nvmlPerfPolicyType_t)(PerfPolicyType), cgoAllocsUnknown cViolTime, _ := (*C.nvmlViolationTime_t)(unsafe.Pointer(ViolTime)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetViolationStatus(cDevice, cPerfPolicyType, cViolTime) + __ret := C.nvmlDeviceGetViolationStatus(cnvmlDevice, cPerfPolicyType, cViolTime) __v := (Return)(__ret) return __v } // nvmlDeviceGetIrqNum function as declared in nvml/nvml.h -func nvmlDeviceGetIrqNum(Device Device, IrqNum *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetIrqNum(nvmlDevice nvmlDevice, IrqNum *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIrqNum, _ := (*C.uint)(unsafe.Pointer(IrqNum)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetIrqNum(cDevice, cIrqNum) + __ret := C.nvmlDeviceGetIrqNum(cnvmlDevice, cIrqNum) __v := (Return)(__ret) return __v } // nvmlDeviceGetNumGpuCores function as declared in nvml/nvml.h -func nvmlDeviceGetNumGpuCores(Device Device, NumCores *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNumGpuCores(nvmlDevice nvmlDevice, NumCores *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cNumCores, _ := (*C.uint)(unsafe.Pointer(NumCores)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNumGpuCores(cDevice, cNumCores) + __ret := C.nvmlDeviceGetNumGpuCores(cnvmlDevice, cNumCores) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerSource function as declared in nvml/nvml.h -func nvmlDeviceGetPowerSource(Device Device, PowerSource *PowerSource) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerSource(nvmlDevice nvmlDevice, PowerSource *PowerSource) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPowerSource, _ := (*C.nvmlPowerSource_t)(unsafe.Pointer(PowerSource)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerSource(cDevice, cPowerSource) + __ret := C.nvmlDeviceGetPowerSource(cnvmlDevice, cPowerSource) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryBusWidth function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryBusWidth(Device Device, BusWidth *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryBusWidth(nvmlDevice nvmlDevice, BusWidth *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBusWidth, _ := (*C.uint)(unsafe.Pointer(BusWidth)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryBusWidth(cDevice, cBusWidth) + __ret := C.nvmlDeviceGetMemoryBusWidth(cnvmlDevice, cBusWidth) __v := (Return)(__ret) return __v } // nvmlDeviceGetPcieLinkMaxSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetPcieLinkMaxSpeed(Device Device, MaxSpeed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice nvmlDevice, MaxSpeed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMaxSpeed, _ := (*C.uint)(unsafe.Pointer(MaxSpeed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPcieLinkMaxSpeed(cDevice, cMaxSpeed) + __ret := C.nvmlDeviceGetPcieLinkMaxSpeed(cnvmlDevice, cMaxSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetPcieSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetPcieSpeed(Device Device, PcieSpeed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPcieSpeed(nvmlDevice nvmlDevice, PcieSpeed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPcieSpeed, _ := (*C.uint)(unsafe.Pointer(PcieSpeed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPcieSpeed(cDevice, cPcieSpeed) + __ret := C.nvmlDeviceGetPcieSpeed(cnvmlDevice, cPcieSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetAdaptiveClockInfoStatus function as declared in nvml/nvml.h -func nvmlDeviceGetAdaptiveClockInfoStatus(Device Device, AdaptiveClockStatus *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice nvmlDevice, AdaptiveClockStatus *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cAdaptiveClockStatus, _ := (*C.uint)(unsafe.Pointer(AdaptiveClockStatus)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAdaptiveClockInfoStatus(cDevice, cAdaptiveClockStatus) + __ret := C.nvmlDeviceGetAdaptiveClockInfoStatus(cnvmlDevice, cAdaptiveClockStatus) __v := (Return)(__ret) return __v } // nvmlDeviceGetAccountingMode function as declared in nvml/nvml.h -func nvmlDeviceGetAccountingMode(Device Device, Mode *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAccountingMode(nvmlDevice nvmlDevice, Mode *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAccountingMode(cDevice, cMode) + __ret := C.nvmlDeviceGetAccountingMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetAccountingStats function as declared in nvml/nvml.h -func nvmlDeviceGetAccountingStats(Device Device, Pid uint32, Stats *AccountingStats) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAccountingStats(nvmlDevice nvmlDevice, Pid uint32, Stats *AccountingStats) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPid, _ := (C.uint)(Pid), cgoAllocsUnknown cStats, _ := (*C.nvmlAccountingStats_t)(unsafe.Pointer(Stats)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAccountingStats(cDevice, cPid, cStats) + __ret := C.nvmlDeviceGetAccountingStats(cnvmlDevice, cPid, cStats) __v := (Return)(__ret) return __v } // nvmlDeviceGetAccountingPids function as declared in nvml/nvml.h -func nvmlDeviceGetAccountingPids(Device Device, Count *uint32, Pids *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAccountingPids(nvmlDevice nvmlDevice, Count *uint32, Pids *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cPids, _ := (*C.uint)(unsafe.Pointer(Pids)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAccountingPids(cDevice, cCount, cPids) + __ret := C.nvmlDeviceGetAccountingPids(cnvmlDevice, cCount, cPids) __v := (Return)(__ret) return __v } // nvmlDeviceGetAccountingBufferSize function as declared in nvml/nvml.h -func nvmlDeviceGetAccountingBufferSize(Device Device, BufferSize *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAccountingBufferSize(nvmlDevice nvmlDevice, BufferSize *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBufferSize, _ := (*C.uint)(unsafe.Pointer(BufferSize)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAccountingBufferSize(cDevice, cBufferSize) + __ret := C.nvmlDeviceGetAccountingBufferSize(cnvmlDevice, cBufferSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetRetiredPages function as declared in nvml/nvml.h -func nvmlDeviceGetRetiredPages(Device Device, Cause PageRetirementCause, PageCount *uint32, Addresses *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRetiredPages(nvmlDevice nvmlDevice, Cause PageRetirementCause, PageCount *uint32, Addresses *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCause, _ := (C.nvmlPageRetirementCause_t)(Cause), cgoAllocsUnknown cPageCount, _ := (*C.uint)(unsafe.Pointer(PageCount)), cgoAllocsUnknown cAddresses, _ := (*C.ulonglong)(unsafe.Pointer(Addresses)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRetiredPages(cDevice, cCause, cPageCount, cAddresses) + __ret := C.nvmlDeviceGetRetiredPages(cnvmlDevice, cCause, cPageCount, cAddresses) __v := (Return)(__ret) return __v } // nvmlDeviceGetRetiredPages_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause, PageCount *uint32, Addresses *uint64, Timestamps *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRetiredPages_v2(nvmlDevice nvmlDevice, Cause PageRetirementCause, PageCount *uint32, Addresses *uint64, Timestamps *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCause, _ := (C.nvmlPageRetirementCause_t)(Cause), cgoAllocsUnknown cPageCount, _ := (*C.uint)(unsafe.Pointer(PageCount)), cgoAllocsUnknown cAddresses, _ := (*C.ulonglong)(unsafe.Pointer(Addresses)), cgoAllocsUnknown cTimestamps, _ := (*C.ulonglong)(unsafe.Pointer(Timestamps)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRetiredPages_v2(cDevice, cCause, cPageCount, cAddresses, cTimestamps) + __ret := C.nvmlDeviceGetRetiredPages_v2(cnvmlDevice, cCause, cPageCount, cAddresses, cTimestamps) __v := (Return)(__ret) return __v } // nvmlDeviceGetRetiredPagesPendingStatus function as declared in nvml/nvml.h -func nvmlDeviceGetRetiredPagesPendingStatus(Device Device, IsPending *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice nvmlDevice, IsPending *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsPending, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsPending)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRetiredPagesPendingStatus(cDevice, cIsPending) + __ret := C.nvmlDeviceGetRetiredPagesPendingStatus(cnvmlDevice, cIsPending) __v := (Return)(__ret) return __v } // nvmlDeviceGetRemappedRows function as declared in nvml/nvml.h -func nvmlDeviceGetRemappedRows(Device Device, CorrRows *uint32, UncRows *uint32, IsPending *uint32, FailureOccurred *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRemappedRows(nvmlDevice nvmlDevice, CorrRows *uint32, UncRows *uint32, IsPending *uint32, FailureOccurred *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCorrRows, _ := (*C.uint)(unsafe.Pointer(CorrRows)), cgoAllocsUnknown cUncRows, _ := (*C.uint)(unsafe.Pointer(UncRows)), cgoAllocsUnknown cIsPending, _ := (*C.uint)(unsafe.Pointer(IsPending)), cgoAllocsUnknown cFailureOccurred, _ := (*C.uint)(unsafe.Pointer(FailureOccurred)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRemappedRows(cDevice, cCorrRows, cUncRows, cIsPending, cFailureOccurred) + __ret := C.nvmlDeviceGetRemappedRows(cnvmlDevice, cCorrRows, cUncRows, cIsPending, cFailureOccurred) __v := (Return)(__ret) return __v } // nvmlDeviceGetRowRemapperHistogram function as declared in nvml/nvml.h -func nvmlDeviceGetRowRemapperHistogram(Device Device, Values *RowRemapperHistogramValues) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRowRemapperHistogram(nvmlDevice nvmlDevice, Values *RowRemapperHistogramValues) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cValues, _ := (*C.nvmlRowRemapperHistogramValues_t)(unsafe.Pointer(Values)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRowRemapperHistogram(cDevice, cValues) + __ret := C.nvmlDeviceGetRowRemapperHistogram(cnvmlDevice, cValues) __v := (Return)(__ret) return __v } // nvmlDeviceGetArchitecture function as declared in nvml/nvml.h -func nvmlDeviceGetArchitecture(Device Device, Arch *DeviceArchitecture) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetArchitecture(nvmlDevice nvmlDevice, Arch *DeviceArchitecture) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cArch, _ := (*C.nvmlDeviceArchitecture_t)(unsafe.Pointer(Arch)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetArchitecture(cDevice, cArch) + __ret := C.nvmlDeviceGetArchitecture(cnvmlDevice, cArch) __v := (Return)(__ret) return __v } // nvmlUnitSetLedState function as declared in nvml/nvml.h -func nvmlUnitSetLedState(Unit Unit, Color LedColor) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitSetLedState(nvmlUnit nvmlUnit, Color LedColor) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cColor, _ := (C.nvmlLedColor_t)(Color), cgoAllocsUnknown - __ret := C.nvmlUnitSetLedState(cUnit, cColor) + __ret := C.nvmlUnitSetLedState(cnvmlUnit, cColor) __v := (Return)(__ret) return __v } // nvmlDeviceSetPersistenceMode function as declared in nvml/nvml.h -func nvmlDeviceSetPersistenceMode(Device Device, Mode EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetPersistenceMode(nvmlDevice nvmlDevice, Mode EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.nvmlEnableState_t)(Mode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetPersistenceMode(cDevice, cMode) + __ret := C.nvmlDeviceSetPersistenceMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceSetComputeMode function as declared in nvml/nvml.h -func nvmlDeviceSetComputeMode(Device Device, Mode ComputeMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetComputeMode(nvmlDevice nvmlDevice, Mode ComputeMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.nvmlComputeMode_t)(Mode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetComputeMode(cDevice, cMode) + __ret := C.nvmlDeviceSetComputeMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceSetEccMode function as declared in nvml/nvml.h -func nvmlDeviceSetEccMode(Device Device, Ecc EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetEccMode(nvmlDevice nvmlDevice, Ecc EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEcc, _ := (C.nvmlEnableState_t)(Ecc), cgoAllocsUnknown - __ret := C.nvmlDeviceSetEccMode(cDevice, cEcc) + __ret := C.nvmlDeviceSetEccMode(cnvmlDevice, cEcc) __v := (Return)(__ret) return __v } // nvmlDeviceClearEccErrorCounts function as declared in nvml/nvml.h -func nvmlDeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceClearEccErrorCounts(nvmlDevice nvmlDevice, CounterType EccCounterType) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCounterType, _ := (C.nvmlEccCounterType_t)(CounterType), cgoAllocsUnknown - __ret := C.nvmlDeviceClearEccErrorCounts(cDevice, cCounterType) + __ret := C.nvmlDeviceClearEccErrorCounts(cnvmlDevice, cCounterType) __v := (Return)(__ret) return __v } // nvmlDeviceSetDriverModel function as declared in nvml/nvml.h -func nvmlDeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetDriverModel(nvmlDevice nvmlDevice, DriverModel DriverModel, Flags uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cDriverModel, _ := (C.nvmlDriverModel_t)(DriverModel), cgoAllocsUnknown cFlags, _ := (C.uint)(Flags), cgoAllocsUnknown - __ret := C.nvmlDeviceSetDriverModel(cDevice, cDriverModel, cFlags) + __ret := C.nvmlDeviceSetDriverModel(cnvmlDevice, cDriverModel, cFlags) __v := (Return)(__ret) return __v } // nvmlDeviceSetGpuLockedClocks function as declared in nvml/nvml.h -func nvmlDeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetGpuLockedClocks(nvmlDevice nvmlDevice, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinGpuClockMHz, _ := (C.uint)(MinGpuClockMHz), cgoAllocsUnknown cMaxGpuClockMHz, _ := (C.uint)(MaxGpuClockMHz), cgoAllocsUnknown - __ret := C.nvmlDeviceSetGpuLockedClocks(cDevice, cMinGpuClockMHz, cMaxGpuClockMHz) + __ret := C.nvmlDeviceSetGpuLockedClocks(cnvmlDevice, cMinGpuClockMHz, cMaxGpuClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceResetGpuLockedClocks function as declared in nvml/nvml.h -func nvmlDeviceResetGpuLockedClocks(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceResetGpuLockedClocks(cDevice) +func nvmlDeviceResetGpuLockedClocks(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceResetGpuLockedClocks(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceSetMemoryLockedClocks function as declared in nvml/nvml.h -func nvmlDeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetMemoryLockedClocks(nvmlDevice nvmlDevice, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinMemClockMHz, _ := (C.uint)(MinMemClockMHz), cgoAllocsUnknown cMaxMemClockMHz, _ := (C.uint)(MaxMemClockMHz), cgoAllocsUnknown - __ret := C.nvmlDeviceSetMemoryLockedClocks(cDevice, cMinMemClockMHz, cMaxMemClockMHz) + __ret := C.nvmlDeviceSetMemoryLockedClocks(cnvmlDevice, cMinMemClockMHz, cMaxMemClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceResetMemoryLockedClocks function as declared in nvml/nvml.h -func nvmlDeviceResetMemoryLockedClocks(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceResetMemoryLockedClocks(cDevice) +func nvmlDeviceResetMemoryLockedClocks(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceResetMemoryLockedClocks(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceSetApplicationsClocks function as declared in nvml/nvml.h -func nvmlDeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetApplicationsClocks(nvmlDevice nvmlDevice, MemClockMHz uint32, GraphicsClockMHz uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMemClockMHz, _ := (C.uint)(MemClockMHz), cgoAllocsUnknown cGraphicsClockMHz, _ := (C.uint)(GraphicsClockMHz), cgoAllocsUnknown - __ret := C.nvmlDeviceSetApplicationsClocks(cDevice, cMemClockMHz, cGraphicsClockMHz) + __ret := C.nvmlDeviceSetApplicationsClocks(cnvmlDevice, cMemClockMHz, cGraphicsClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetClkMonStatus function as declared in nvml/nvml.h -func nvmlDeviceGetClkMonStatus(Device Device, Status *ClkMonStatus) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetClkMonStatus(nvmlDevice nvmlDevice, Status *ClkMonStatus) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cStatus, _ := (*C.nvmlClkMonStatus_t)(unsafe.Pointer(Status)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetClkMonStatus(cDevice, cStatus) + __ret := C.nvmlDeviceGetClkMonStatus(cnvmlDevice, cStatus) __v := (Return)(__ret) return __v } // nvmlDeviceSetPowerManagementLimit function as declared in nvml/nvml.h -func nvmlDeviceSetPowerManagementLimit(Device Device, Limit uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetPowerManagementLimit(nvmlDevice nvmlDevice, Limit uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLimit, _ := (C.uint)(Limit), cgoAllocsUnknown - __ret := C.nvmlDeviceSetPowerManagementLimit(cDevice, cLimit) + __ret := C.nvmlDeviceSetPowerManagementLimit(cnvmlDevice, cLimit) __v := (Return)(__ret) return __v } // nvmlDeviceSetGpuOperationMode function as declared in nvml/nvml.h -func nvmlDeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetGpuOperationMode(nvmlDevice nvmlDevice, Mode GpuOperationMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.nvmlGpuOperationMode_t)(Mode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetGpuOperationMode(cDevice, cMode) + __ret := C.nvmlDeviceSetGpuOperationMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceSetAPIRestriction function as declared in nvml/nvml.h -func nvmlDeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetAPIRestriction(nvmlDevice nvmlDevice, ApiType RestrictedAPI, IsRestricted EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cApiType, _ := (C.nvmlRestrictedAPI_t)(ApiType), cgoAllocsUnknown cIsRestricted, _ := (C.nvmlEnableState_t)(IsRestricted), cgoAllocsUnknown - __ret := C.nvmlDeviceSetAPIRestriction(cDevice, cApiType, cIsRestricted) + __ret := C.nvmlDeviceSetAPIRestriction(cnvmlDevice, cApiType, cIsRestricted) __v := (Return)(__ret) return __v } // nvmlDeviceSetAccountingMode function as declared in nvml/nvml.h -func nvmlDeviceSetAccountingMode(Device Device, Mode EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetAccountingMode(nvmlDevice nvmlDevice, Mode EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.nvmlEnableState_t)(Mode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetAccountingMode(cDevice, cMode) + __ret := C.nvmlDeviceSetAccountingMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceClearAccountingPids function as declared in nvml/nvml.h -func nvmlDeviceClearAccountingPids(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceClearAccountingPids(cDevice) +func nvmlDeviceClearAccountingPids(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceClearAccountingPids(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkState function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkState(Device Device, Link uint32, IsActive *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkState(nvmlDevice nvmlDevice, Link uint32, IsActive *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cIsActive, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsActive)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkState(cDevice, cLink, cIsActive) + __ret := C.nvmlDeviceGetNvLinkState(cnvmlDevice, cLink, cIsActive) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkVersion function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkVersion(Device Device, Link uint32, Version *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkVersion(nvmlDevice nvmlDevice, Link uint32, Version *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cVersion, _ := (*C.uint)(unsafe.Pointer(Version)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkVersion(cDevice, cLink, cVersion) + __ret := C.nvmlDeviceGetNvLinkVersion(cnvmlDevice, cLink, cVersion) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkCapability function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkCapability(Device Device, Link uint32, Capability NvLinkCapability, CapResult *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkCapability(nvmlDevice nvmlDevice, Link uint32, Capability NvLinkCapability, CapResult *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCapability, _ := (C.nvmlNvLinkCapability_t)(Capability), cgoAllocsUnknown cCapResult, _ := (*C.uint)(unsafe.Pointer(CapResult)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkCapability(cDevice, cLink, cCapability, cCapResult) + __ret := C.nvmlDeviceGetNvLinkCapability(cnvmlDevice, cLink, cCapability, cCapResult) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkRemotePciInfo_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkRemotePciInfo_v2(Device Device, Link uint32, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice nvmlDevice, Link uint32, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkRemotePciInfo_v2(cDevice, cLink, cPci) + __ret := C.nvmlDeviceGetNvLinkRemotePciInfo_v2(cnvmlDevice, cLink, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkErrorCounter function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkErrorCounter(Device Device, Link uint32, Counter NvLinkErrorCounter, CounterValue *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkErrorCounter(nvmlDevice nvmlDevice, Link uint32, Counter NvLinkErrorCounter, CounterValue *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.nvmlNvLinkErrorCounter_t)(Counter), cgoAllocsUnknown cCounterValue, _ := (*C.ulonglong)(unsafe.Pointer(CounterValue)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkErrorCounter(cDevice, cLink, cCounter, cCounterValue) + __ret := C.nvmlDeviceGetNvLinkErrorCounter(cnvmlDevice, cLink, cCounter, cCounterValue) __v := (Return)(__ret) return __v } // nvmlDeviceResetNvLinkErrorCounters function as declared in nvml/nvml.h -func nvmlDeviceResetNvLinkErrorCounters(Device Device, Link uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceResetNvLinkErrorCounters(nvmlDevice nvmlDevice, Link uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown - __ret := C.nvmlDeviceResetNvLinkErrorCounters(cDevice, cLink) + __ret := C.nvmlDeviceResetNvLinkErrorCounters(cnvmlDevice, cLink) __v := (Return)(__ret) return __v } // nvmlDeviceSetNvLinkUtilizationControl function as declared in nvml/nvml.h -func nvmlDeviceSetNvLinkUtilizationControl(Device Device, Link uint32, Counter uint32, Control *NvLinkUtilizationControl, Reset uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetNvLinkUtilizationControl(nvmlDevice nvmlDevice, Link uint32, Counter uint32, Control *NvLinkUtilizationControl, Reset uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown cControl, _ := (*C.nvmlNvLinkUtilizationControl_t)(unsafe.Pointer(Control)), cgoAllocsUnknown cReset, _ := (C.uint)(Reset), cgoAllocsUnknown - __ret := C.nvmlDeviceSetNvLinkUtilizationControl(cDevice, cLink, cCounter, cControl, cReset) + __ret := C.nvmlDeviceSetNvLinkUtilizationControl(cnvmlDevice, cLink, cCounter, cControl, cReset) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkUtilizationControl function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkUtilizationControl(Device Device, Link uint32, Counter uint32, Control *NvLinkUtilizationControl) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkUtilizationControl(nvmlDevice nvmlDevice, Link uint32, Counter uint32, Control *NvLinkUtilizationControl) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown cControl, _ := (*C.nvmlNvLinkUtilizationControl_t)(unsafe.Pointer(Control)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkUtilizationControl(cDevice, cLink, cCounter, cControl) + __ret := C.nvmlDeviceGetNvLinkUtilizationControl(cnvmlDevice, cLink, cCounter, cControl) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkUtilizationCounter function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkUtilizationCounter(Device Device, Link uint32, Counter uint32, Rxcounter *uint64, Txcounter *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkUtilizationCounter(nvmlDevice nvmlDevice, Link uint32, Counter uint32, Rxcounter *uint64, Txcounter *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown cRxcounter, _ := (*C.ulonglong)(unsafe.Pointer(Rxcounter)), cgoAllocsUnknown cTxcounter, _ := (*C.ulonglong)(unsafe.Pointer(Txcounter)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkUtilizationCounter(cDevice, cLink, cCounter, cRxcounter, cTxcounter) + __ret := C.nvmlDeviceGetNvLinkUtilizationCounter(cnvmlDevice, cLink, cCounter, cRxcounter, cTxcounter) __v := (Return)(__ret) return __v } // nvmlDeviceFreezeNvLinkUtilizationCounter function as declared in nvml/nvml.h -func nvmlDeviceFreezeNvLinkUtilizationCounter(Device Device, Link uint32, Counter uint32, Freeze EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceFreezeNvLinkUtilizationCounter(nvmlDevice nvmlDevice, Link uint32, Counter uint32, Freeze EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown cFreeze, _ := (C.nvmlEnableState_t)(Freeze), cgoAllocsUnknown - __ret := C.nvmlDeviceFreezeNvLinkUtilizationCounter(cDevice, cLink, cCounter, cFreeze) + __ret := C.nvmlDeviceFreezeNvLinkUtilizationCounter(cnvmlDevice, cLink, cCounter, cFreeze) __v := (Return)(__ret) return __v } // nvmlDeviceResetNvLinkUtilizationCounter function as declared in nvml/nvml.h -func nvmlDeviceResetNvLinkUtilizationCounter(Device Device, Link uint32, Counter uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceResetNvLinkUtilizationCounter(nvmlDevice nvmlDevice, Link uint32, Counter uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown - __ret := C.nvmlDeviceResetNvLinkUtilizationCounter(cDevice, cLink, cCounter) + __ret := C.nvmlDeviceResetNvLinkUtilizationCounter(cnvmlDevice, cLink, cCounter) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkRemoteDeviceType function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkRemoteDeviceType(Device Device, Link uint32, PNvLinkDeviceType *IntNvLinkDeviceType) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice nvmlDevice, Link uint32, PNvLinkDeviceType *IntNvLinkDeviceType) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cPNvLinkDeviceType, _ := (*C.nvmlIntNvLinkDeviceType_t)(unsafe.Pointer(PNvLinkDeviceType)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkRemoteDeviceType(cDevice, cLink, cPNvLinkDeviceType) + __ret := C.nvmlDeviceGetNvLinkRemoteDeviceType(cnvmlDevice, cLink, cPNvLinkDeviceType) __v := (Return)(__ret) return __v } // nvmlEventSetCreate function as declared in nvml/nvml.h -func nvmlEventSetCreate(Set *EventSet) Return { +func nvmlEventSetCreate(Set *nvmlEventSet) Return { cSet, _ := (*C.nvmlEventSet_t)(unsafe.Pointer(Set)), cgoAllocsUnknown __ret := C.nvmlEventSetCreate(cSet) __v := (Return)(__ret) @@ -1640,26 +1640,26 @@ func nvmlEventSetCreate(Set *EventSet) Return { } // nvmlDeviceRegisterEvents function as declared in nvml/nvml.h -func nvmlDeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceRegisterEvents(nvmlDevice nvmlDevice, EventTypes uint64, Set nvmlEventSet) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEventTypes, _ := (C.ulonglong)(EventTypes), cgoAllocsUnknown cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown - __ret := C.nvmlDeviceRegisterEvents(cDevice, cEventTypes, cSet) + __ret := C.nvmlDeviceRegisterEvents(cnvmlDevice, cEventTypes, cSet) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedEventTypes function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedEventTypes(Device Device, EventTypes *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedEventTypes(nvmlDevice nvmlDevice, EventTypes *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEventTypes, _ := (*C.ulonglong)(unsafe.Pointer(EventTypes)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedEventTypes(cDevice, cEventTypes) + __ret := C.nvmlDeviceGetSupportedEventTypes(cnvmlDevice, cEventTypes) __v := (Return)(__ret) return __v } // nvmlEventSetWait_v2 function as declared in nvml/nvml.h -func nvmlEventSetWait_v2(Set EventSet, Data *EventData, Timeoutms uint32) Return { +func nvmlEventSetWait_v2(Set nvmlEventSet, Data *nvmlEventData, Timeoutms uint32) Return { cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown cData, _ := (*C.nvmlEventData_t)(unsafe.Pointer(Data)), cgoAllocsUnknown cTimeoutms, _ := (C.uint)(Timeoutms), cgoAllocsUnknown @@ -1669,7 +1669,7 @@ func nvmlEventSetWait_v2(Set EventSet, Data *EventData, Timeoutms uint32) Return } // nvmlEventSetFree function as declared in nvml/nvml.h -func nvmlEventSetFree(Set EventSet) Return { +func nvmlEventSetFree(Set nvmlEventSet) Return { cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown __ret := C.nvmlEventSetFree(cSet) __v := (Return)(__ret) @@ -1713,87 +1713,87 @@ func nvmlDeviceDiscoverGpus(PciInfo *PciInfo) Return { } // nvmlDeviceGetFieldValues function as declared in nvml/nvml.h -func nvmlDeviceGetFieldValues(Device Device, ValuesCount int32, Values *FieldValue) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFieldValues(nvmlDevice nvmlDevice, ValuesCount int32, Values *FieldValue) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cValuesCount, _ := (C.int)(ValuesCount), cgoAllocsUnknown cValues, _ := (*C.nvmlFieldValue_t)(unsafe.Pointer(Values)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFieldValues(cDevice, cValuesCount, cValues) + __ret := C.nvmlDeviceGetFieldValues(cnvmlDevice, cValuesCount, cValues) __v := (Return)(__ret) return __v } // nvmlDeviceClearFieldValues function as declared in nvml/nvml.h -func nvmlDeviceClearFieldValues(Device Device, ValuesCount int32, Values *FieldValue) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceClearFieldValues(nvmlDevice nvmlDevice, ValuesCount int32, Values *FieldValue) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cValuesCount, _ := (C.int)(ValuesCount), cgoAllocsUnknown cValues, _ := (*C.nvmlFieldValue_t)(unsafe.Pointer(Values)), cgoAllocsUnknown - __ret := C.nvmlDeviceClearFieldValues(cDevice, cValuesCount, cValues) + __ret := C.nvmlDeviceClearFieldValues(cnvmlDevice, cValuesCount, cValues) __v := (Return)(__ret) return __v } // nvmlDeviceGetVirtualizationMode function as declared in nvml/nvml.h -func nvmlDeviceGetVirtualizationMode(Device Device, PVirtualMode *GpuVirtualizationMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVirtualizationMode(nvmlDevice nvmlDevice, PVirtualMode *GpuVirtualizationMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPVirtualMode, _ := (*C.nvmlGpuVirtualizationMode_t)(unsafe.Pointer(PVirtualMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVirtualizationMode(cDevice, cPVirtualMode) + __ret := C.nvmlDeviceGetVirtualizationMode(cnvmlDevice, cPVirtualMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetHostVgpuMode function as declared in nvml/nvml.h -func nvmlDeviceGetHostVgpuMode(Device Device, PHostVgpuMode *HostVgpuMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetHostVgpuMode(nvmlDevice nvmlDevice, PHostVgpuMode *HostVgpuMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPHostVgpuMode, _ := (*C.nvmlHostVgpuMode_t)(unsafe.Pointer(PHostVgpuMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHostVgpuMode(cDevice, cPHostVgpuMode) + __ret := C.nvmlDeviceGetHostVgpuMode(cnvmlDevice, cPHostVgpuMode) __v := (Return)(__ret) return __v } // nvmlDeviceSetVirtualizationMode function as declared in nvml/nvml.h -func nvmlDeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetVirtualizationMode(nvmlDevice nvmlDevice, VirtualMode GpuVirtualizationMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVirtualMode, _ := (C.nvmlGpuVirtualizationMode_t)(VirtualMode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetVirtualizationMode(cDevice, cVirtualMode) + __ret := C.nvmlDeviceSetVirtualizationMode(cnvmlDevice, cVirtualMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetGridLicensableFeatures_v4 function as declared in nvml/nvml.h -func nvmlDeviceGetGridLicensableFeatures_v4(Device Device, PGridLicensableFeatures *GridLicensableFeatures) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice nvmlDevice, PGridLicensableFeatures *GridLicensableFeatures) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPGridLicensableFeatures, _ := (*C.nvmlGridLicensableFeatures_t)(unsafe.Pointer(PGridLicensableFeatures)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGridLicensableFeatures_v4(cDevice, cPGridLicensableFeatures) + __ret := C.nvmlDeviceGetGridLicensableFeatures_v4(cnvmlDevice, cPGridLicensableFeatures) __v := (Return)(__ret) return __v } // nvmlDeviceGetProcessUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetProcessUtilization(Device Device, Utilization *ProcessUtilizationSample, ProcessSamplesCount *uint32, LastSeenTimeStamp uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetProcessUtilization(nvmlDevice nvmlDevice, Utilization *ProcessUtilizationSample, ProcessSamplesCount *uint32, LastSeenTimeStamp uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUtilization, _ := (*C.nvmlProcessUtilizationSample_t)(unsafe.Pointer(Utilization)), cgoAllocsUnknown cProcessSamplesCount, _ := (*C.uint)(unsafe.Pointer(ProcessSamplesCount)), cgoAllocsUnknown cLastSeenTimeStamp, _ := (C.ulonglong)(LastSeenTimeStamp), cgoAllocsUnknown - __ret := C.nvmlDeviceGetProcessUtilization(cDevice, cUtilization, cProcessSamplesCount, cLastSeenTimeStamp) + __ret := C.nvmlDeviceGetProcessUtilization(cnvmlDevice, cUtilization, cProcessSamplesCount, cLastSeenTimeStamp) __v := (Return)(__ret) return __v } // nvmlDeviceGetGspFirmwareVersion function as declared in nvml/nvml.h -func nvmlDeviceGetGspFirmwareVersion(Device Device, Version *byte) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGspFirmwareVersion(nvmlDevice nvmlDevice, Version *byte) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGspFirmwareVersion(cDevice, cVersion) + __ret := C.nvmlDeviceGetGspFirmwareVersion(cnvmlDevice, cVersion) __v := (Return)(__ret) return __v } // nvmlDeviceGetGspFirmwareMode function as declared in nvml/nvml.h -func nvmlDeviceGetGspFirmwareMode(Device Device, IsEnabled *uint32, DefaultMode *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGspFirmwareMode(nvmlDevice nvmlDevice, IsEnabled *uint32, DefaultMode *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsEnabled, _ := (*C.uint)(unsafe.Pointer(IsEnabled)), cgoAllocsUnknown cDefaultMode, _ := (*C.uint)(unsafe.Pointer(DefaultMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGspFirmwareMode(cDevice, cIsEnabled, cDefaultMode) + __ret := C.nvmlDeviceGetGspFirmwareMode(cnvmlDevice, cIsEnabled, cDefaultMode) __v := (Return)(__ret) return __v } @@ -1808,330 +1808,330 @@ func nvmlGetVgpuDriverCapabilities(Capability VgpuDriverCapability, CapResult *u } // nvmlDeviceGetVgpuCapabilities function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability, CapResult *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuCapabilities(nvmlDevice nvmlDevice, Capability DeviceVgpuCapability, CapResult *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCapability, _ := (C.nvmlDeviceVgpuCapability_t)(Capability), cgoAllocsUnknown cCapResult, _ := (*C.uint)(unsafe.Pointer(CapResult)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuCapabilities(cDevice, cCapability, cCapResult) + __ret := C.nvmlDeviceGetVgpuCapabilities(cnvmlDevice, cCapability, cCapResult) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedVgpus(Device Device, VgpuCount *uint32, VgpuTypeIds *VgpuTypeId) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuTypeIds *nvmlVgpuTypeId) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVgpuCount, _ := (*C.uint)(unsafe.Pointer(VgpuCount)), cgoAllocsUnknown cVgpuTypeIds, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(VgpuTypeIds)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedVgpus(cDevice, cVgpuCount, cVgpuTypeIds) + __ret := C.nvmlDeviceGetSupportedVgpus(cnvmlDevice, cVgpuCount, cVgpuTypeIds) __v := (Return)(__ret) return __v } // nvmlDeviceGetCreatableVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetCreatableVgpus(Device Device, VgpuCount *uint32, VgpuTypeIds *VgpuTypeId) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCreatableVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuTypeIds *nvmlVgpuTypeId) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVgpuCount, _ := (*C.uint)(unsafe.Pointer(VgpuCount)), cgoAllocsUnknown cVgpuTypeIds, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(VgpuTypeIds)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCreatableVgpus(cDevice, cVgpuCount, cVgpuTypeIds) + __ret := C.nvmlDeviceGetCreatableVgpus(cnvmlDevice, cVgpuCount, cVgpuTypeIds) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetClass function as declared in nvml/nvml.h -func nvmlVgpuTypeGetClass(VgpuTypeId VgpuTypeId, VgpuTypeClass *byte, Size *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetClass(nvmlVgpuTypeId nvmlVgpuTypeId, VgpuTypeClass *byte, Size *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuTypeClass, _ := (*C.char)(unsafe.Pointer(VgpuTypeClass)), cgoAllocsUnknown cSize, _ := (*C.uint)(unsafe.Pointer(Size)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetClass(cVgpuTypeId, cVgpuTypeClass, cSize) + __ret := C.nvmlVgpuTypeGetClass(cnvmlVgpuTypeId, cVgpuTypeClass, cSize) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetName function as declared in nvml/nvml.h -func nvmlVgpuTypeGetName(VgpuTypeId VgpuTypeId, VgpuTypeName *byte, Size *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetName(nvmlVgpuTypeId nvmlVgpuTypeId, VgpuTypeName *byte, Size *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuTypeName, _ := (*C.char)(unsafe.Pointer(VgpuTypeName)), cgoAllocsUnknown cSize, _ := (*C.uint)(unsafe.Pointer(Size)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetName(cVgpuTypeId, cVgpuTypeName, cSize) + __ret := C.nvmlVgpuTypeGetName(cnvmlVgpuTypeId, cVgpuTypeName, cSize) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetGpuInstanceProfileId function as declared in nvml/nvml.h -func nvmlVgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId, GpuInstanceProfileId *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId nvmlVgpuTypeId, GpuInstanceProfileId *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cGpuInstanceProfileId, _ := (*C.uint)(unsafe.Pointer(GpuInstanceProfileId)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetGpuInstanceProfileId(cVgpuTypeId, cGpuInstanceProfileId) + __ret := C.nvmlVgpuTypeGetGpuInstanceProfileId(cnvmlVgpuTypeId, cGpuInstanceProfileId) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetDeviceID function as declared in nvml/nvml.h -func nvmlVgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId, DeviceID *uint64, SubsystemID *uint64) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId nvmlVgpuTypeId, DeviceID *uint64, SubsystemID *uint64) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cDeviceID, _ := (*C.ulonglong)(unsafe.Pointer(DeviceID)), cgoAllocsUnknown cSubsystemID, _ := (*C.ulonglong)(unsafe.Pointer(SubsystemID)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetDeviceID(cVgpuTypeId, cDeviceID, cSubsystemID) + __ret := C.nvmlVgpuTypeGetDeviceID(cnvmlVgpuTypeId, cDeviceID, cSubsystemID) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetFramebufferSize function as declared in nvml/nvml.h -func nvmlVgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId, FbSize *uint64) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId nvmlVgpuTypeId, FbSize *uint64) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cFbSize, _ := (*C.ulonglong)(unsafe.Pointer(FbSize)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetFramebufferSize(cVgpuTypeId, cFbSize) + __ret := C.nvmlVgpuTypeGetFramebufferSize(cnvmlVgpuTypeId, cFbSize) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetNumDisplayHeads function as declared in nvml/nvml.h -func nvmlVgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId, NumDisplayHeads *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId nvmlVgpuTypeId, NumDisplayHeads *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cNumDisplayHeads, _ := (*C.uint)(unsafe.Pointer(NumDisplayHeads)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetNumDisplayHeads(cVgpuTypeId, cNumDisplayHeads) + __ret := C.nvmlVgpuTypeGetNumDisplayHeads(cnvmlVgpuTypeId, cNumDisplayHeads) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetResolution function as declared in nvml/nvml.h -func nvmlVgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex uint32, Xdim *uint32, Ydim *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetResolution(nvmlVgpuTypeId nvmlVgpuTypeId, DisplayIndex uint32, Xdim *uint32, Ydim *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cDisplayIndex, _ := (C.uint)(DisplayIndex), cgoAllocsUnknown cXdim, _ := (*C.uint)(unsafe.Pointer(Xdim)), cgoAllocsUnknown cYdim, _ := (*C.uint)(unsafe.Pointer(Ydim)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetResolution(cVgpuTypeId, cDisplayIndex, cXdim, cYdim) + __ret := C.nvmlVgpuTypeGetResolution(cnvmlVgpuTypeId, cDisplayIndex, cXdim, cYdim) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetLicense function as declared in nvml/nvml.h -func nvmlVgpuTypeGetLicense(VgpuTypeId VgpuTypeId, VgpuTypeLicenseString *byte, Size uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetLicense(nvmlVgpuTypeId nvmlVgpuTypeId, VgpuTypeLicenseString *byte, Size uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuTypeLicenseString, _ := (*C.char)(unsafe.Pointer(VgpuTypeLicenseString)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetLicense(cVgpuTypeId, cVgpuTypeLicenseString, cSize) + __ret := C.nvmlVgpuTypeGetLicense(cnvmlVgpuTypeId, cVgpuTypeLicenseString, cSize) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetFrameRateLimit function as declared in nvml/nvml.h -func nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId, FrameRateLimit *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId nvmlVgpuTypeId, FrameRateLimit *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cFrameRateLimit, _ := (*C.uint)(unsafe.Pointer(FrameRateLimit)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetFrameRateLimit(cVgpuTypeId, cFrameRateLimit) + __ret := C.nvmlVgpuTypeGetFrameRateLimit(cnvmlVgpuTypeId, cFrameRateLimit) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetMaxInstances function as declared in nvml/nvml.h -func nvmlVgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId, VgpuInstanceCount *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetMaxInstances(nvmlDevice nvmlDevice, nvmlVgpuTypeId nvmlVgpuTypeId, VgpuInstanceCount *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuInstanceCount, _ := (*C.uint)(unsafe.Pointer(VgpuInstanceCount)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetMaxInstances(cDevice, cVgpuTypeId, cVgpuInstanceCount) + __ret := C.nvmlVgpuTypeGetMaxInstances(cnvmlDevice, cnvmlVgpuTypeId, cVgpuInstanceCount) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetMaxInstancesPerVm function as declared in nvml/nvml.h -func nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId, VgpuInstanceCountPerVm *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId nvmlVgpuTypeId, VgpuInstanceCountPerVm *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuInstanceCountPerVm, _ := (*C.uint)(unsafe.Pointer(VgpuInstanceCountPerVm)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetMaxInstancesPerVm(cVgpuTypeId, cVgpuInstanceCountPerVm) + __ret := C.nvmlVgpuTypeGetMaxInstancesPerVm(cnvmlVgpuTypeId, cVgpuInstanceCountPerVm) __v := (Return)(__ret) return __v } // nvmlDeviceGetActiveVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetActiveVgpus(Device Device, VgpuCount *uint32, VgpuInstances *VgpuInstance) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetActiveVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuInstances *nvmlVgpuInstance) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVgpuCount, _ := (*C.uint)(unsafe.Pointer(VgpuCount)), cgoAllocsUnknown cVgpuInstances, _ := (*C.nvmlVgpuInstance_t)(unsafe.Pointer(VgpuInstances)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetActiveVgpus(cDevice, cVgpuCount, cVgpuInstances) + __ret := C.nvmlDeviceGetActiveVgpus(cnvmlDevice, cVgpuCount, cVgpuInstances) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetVmID function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetVmID(VgpuInstance VgpuInstance, VmId *byte, Size uint32, VmIdType *VgpuVmIdType) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetVmID(nvmlVgpuInstance nvmlVgpuInstance, VmId *byte, Size uint32, VmIdType *VgpuVmIdType) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cVmId, _ := (*C.char)(unsafe.Pointer(VmId)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown cVmIdType, _ := (*C.nvmlVgpuVmIdType_t)(unsafe.Pointer(VmIdType)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetVmID(cVgpuInstance, cVmId, cSize, cVmIdType) + __ret := C.nvmlVgpuInstanceGetVmID(cnvmlVgpuInstance, cVmId, cSize, cVmIdType) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetUUID function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetUUID(VgpuInstance VgpuInstance, Uuid *byte, Size uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetUUID(nvmlVgpuInstance nvmlVgpuInstance, Uuid *byte, Size uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cUuid, _ := (*C.char)(unsafe.Pointer(Uuid)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetUUID(cVgpuInstance, cUuid, cSize) + __ret := C.nvmlVgpuInstanceGetUUID(cnvmlVgpuInstance, cUuid, cSize) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetVmDriverVersion function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance, Version *byte, Length uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance nvmlVgpuInstance, Version *byte, Length uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetVmDriverVersion(cVgpuInstance, cVersion, cLength) + __ret := C.nvmlVgpuInstanceGetVmDriverVersion(cnvmlVgpuInstance, cVersion, cLength) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetFbUsage function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetFbUsage(VgpuInstance VgpuInstance, FbUsage *uint64) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance nvmlVgpuInstance, FbUsage *uint64) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cFbUsage, _ := (*C.ulonglong)(unsafe.Pointer(FbUsage)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetFbUsage(cVgpuInstance, cFbUsage) + __ret := C.nvmlVgpuInstanceGetFbUsage(cnvmlVgpuInstance, cFbUsage) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetLicenseStatus function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance, Licensed *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance nvmlVgpuInstance, Licensed *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cLicensed, _ := (*C.uint)(unsafe.Pointer(Licensed)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetLicenseStatus(cVgpuInstance, cLicensed) + __ret := C.nvmlVgpuInstanceGetLicenseStatus(cnvmlVgpuInstance, cLicensed) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetType function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetType(VgpuInstance VgpuInstance, VgpuTypeId *VgpuTypeId) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown - cVgpuTypeId, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(VgpuTypeId)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetType(cVgpuInstance, cVgpuTypeId) +func nvmlVgpuInstanceGetType(nvmlVgpuInstance nvmlVgpuInstance, nvmlVgpuTypeId *nvmlVgpuTypeId) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown + cnvmlVgpuTypeId, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(nvmlVgpuTypeId)), cgoAllocsUnknown + __ret := C.nvmlVgpuInstanceGetType(cnvmlVgpuInstance, cnvmlVgpuTypeId) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetFrameRateLimit function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance, FrameRateLimit *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance nvmlVgpuInstance, FrameRateLimit *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cFrameRateLimit, _ := (*C.uint)(unsafe.Pointer(FrameRateLimit)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetFrameRateLimit(cVgpuInstance, cFrameRateLimit) + __ret := C.nvmlVgpuInstanceGetFrameRateLimit(cnvmlVgpuInstance, cFrameRateLimit) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetEccMode function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetEccMode(VgpuInstance VgpuInstance, EccMode *EnableState) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance nvmlVgpuInstance, EccMode *EnableState) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cEccMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(EccMode)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetEccMode(cVgpuInstance, cEccMode) + __ret := C.nvmlVgpuInstanceGetEccMode(cnvmlVgpuInstance, cEccMode) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetEncoderCapacity function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance nvmlVgpuInstance, EncoderCapacity *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cEncoderCapacity, _ := (*C.uint)(unsafe.Pointer(EncoderCapacity)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetEncoderCapacity(cVgpuInstance, cEncoderCapacity) + __ret := C.nvmlVgpuInstanceGetEncoderCapacity(cnvmlVgpuInstance, cEncoderCapacity) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceSetEncoderCapacity function as declared in nvml/nvml.h -func nvmlVgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance nvmlVgpuInstance, EncoderCapacity uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cEncoderCapacity, _ := (C.uint)(EncoderCapacity), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceSetEncoderCapacity(cVgpuInstance, cEncoderCapacity) + __ret := C.nvmlVgpuInstanceSetEncoderCapacity(cnvmlVgpuInstance, cEncoderCapacity) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetEncoderStats function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance, SessionCount *uint32, AverageFps *uint32, AverageLatency *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance nvmlVgpuInstance, SessionCount *uint32, AverageFps *uint32, AverageLatency *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cAverageFps, _ := (*C.uint)(unsafe.Pointer(AverageFps)), cgoAllocsUnknown cAverageLatency, _ := (*C.uint)(unsafe.Pointer(AverageLatency)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetEncoderStats(cVgpuInstance, cSessionCount, cAverageFps, cAverageLatency) + __ret := C.nvmlVgpuInstanceGetEncoderStats(cnvmlVgpuInstance, cSessionCount, cAverageFps, cAverageLatency) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetEncoderSessions function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance, SessionCount *uint32, SessionInfo *EncoderSessionInfo) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance nvmlVgpuInstance, SessionCount *uint32, SessionInfo *EncoderSessionInfo) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cSessionInfo, _ := (*C.nvmlEncoderSessionInfo_t)(unsafe.Pointer(SessionInfo)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetEncoderSessions(cVgpuInstance, cSessionCount, cSessionInfo) + __ret := C.nvmlVgpuInstanceGetEncoderSessions(cnvmlVgpuInstance, cSessionCount, cSessionInfo) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetFBCStats function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetFBCStats(VgpuInstance VgpuInstance, FbcStats *FBCStats) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance nvmlVgpuInstance, FbcStats *FBCStats) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cFbcStats, _ := (*C.nvmlFBCStats_t)(unsafe.Pointer(FbcStats)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetFBCStats(cVgpuInstance, cFbcStats) + __ret := C.nvmlVgpuInstanceGetFBCStats(cnvmlVgpuInstance, cFbcStats) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetFBCSessions function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance, SessionCount *uint32, SessionInfo *FBCSessionInfo) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance nvmlVgpuInstance, SessionCount *uint32, SessionInfo *FBCSessionInfo) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cSessionInfo, _ := (*C.nvmlFBCSessionInfo_t)(unsafe.Pointer(SessionInfo)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetFBCSessions(cVgpuInstance, cSessionCount, cSessionInfo) + __ret := C.nvmlVgpuInstanceGetFBCSessions(cnvmlVgpuInstance, cSessionCount, cSessionInfo) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetGpuInstanceId function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance, GpuInstanceId *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance nvmlVgpuInstance, GpuInstanceId *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cGpuInstanceId, _ := (*C.uint)(unsafe.Pointer(GpuInstanceId)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetGpuInstanceId(cVgpuInstance, cGpuInstanceId) + __ret := C.nvmlVgpuInstanceGetGpuInstanceId(cnvmlVgpuInstance, cGpuInstanceId) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetGpuPciId function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance, VgpuPciId *byte, Length *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance nvmlVgpuInstance, VgpuPciId *byte, Length *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cVgpuPciId, _ := (*C.char)(unsafe.Pointer(VgpuPciId)), cgoAllocsUnknown cLength, _ := (*C.uint)(unsafe.Pointer(Length)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetGpuPciId(cVgpuInstance, cVgpuPciId, cLength) + __ret := C.nvmlVgpuInstanceGetGpuPciId(cnvmlVgpuInstance, cVgpuPciId, cLength) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetCapabilities function as declared in nvml/nvml.h -func nvmlVgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability, CapResult *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId nvmlVgpuTypeId, Capability VgpuCapability, CapResult *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cCapability, _ := (C.nvmlVgpuCapability_t)(Capability), cgoAllocsUnknown cCapResult, _ := (*C.uint)(unsafe.Pointer(CapResult)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetCapabilities(cVgpuTypeId, cCapability, cCapResult) + __ret := C.nvmlVgpuTypeGetCapabilities(cnvmlVgpuTypeId, cCapability, cCapResult) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetMetadata function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetMetadata(VgpuInstance VgpuInstance, nvmlVgpuMetadata *nvmlVgpuMetadata, BufferSize *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance nvmlVgpuInstance, nvmlVgpuMetadata *nvmlVgpuMetadata, BufferSize *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cnvmlVgpuMetadata, _ := (*C.nvmlVgpuMetadata_t)(unsafe.Pointer(nvmlVgpuMetadata)), cgoAllocsUnknown cBufferSize, _ := (*C.uint)(unsafe.Pointer(BufferSize)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetMetadata(cVgpuInstance, cnvmlVgpuMetadata, cBufferSize) + __ret := C.nvmlVgpuInstanceGetMetadata(cnvmlVgpuInstance, cnvmlVgpuMetadata, cBufferSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuMetadata function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuMetadata(Device Device, PgpuMetadata *nvmlVgpuPgpuMetadata, BufferSize *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuMetadata(nvmlDevice nvmlDevice, PgpuMetadata *nvmlVgpuPgpuMetadata, BufferSize *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPgpuMetadata, _ := (*C.nvmlVgpuPgpuMetadata_t)(unsafe.Pointer(PgpuMetadata)), cgoAllocsUnknown cBufferSize, _ := (*C.uint)(unsafe.Pointer(BufferSize)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuMetadata(cDevice, cPgpuMetadata, cBufferSize) + __ret := C.nvmlDeviceGetVgpuMetadata(cnvmlDevice, cPgpuMetadata, cBufferSize) __v := (Return)(__ret) return __v } @@ -2147,47 +2147,47 @@ func nvmlGetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata * } // nvmlDeviceGetPgpuMetadataString function as declared in nvml/nvml.h -func nvmlDeviceGetPgpuMetadataString(Device Device, PgpuMetadata *byte, BufferSize *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPgpuMetadataString(nvmlDevice nvmlDevice, PgpuMetadata *byte, BufferSize *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPgpuMetadata, _ := (*C.char)(unsafe.Pointer(PgpuMetadata)), cgoAllocsUnknown cBufferSize, _ := (*C.uint)(unsafe.Pointer(BufferSize)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPgpuMetadataString(cDevice, cPgpuMetadata, cBufferSize) + __ret := C.nvmlDeviceGetPgpuMetadataString(cnvmlDevice, cPgpuMetadata, cBufferSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuSchedulerLog function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuSchedulerLog(Device Device, PSchedulerLog *VgpuSchedulerLog) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuSchedulerLog(nvmlDevice nvmlDevice, PSchedulerLog *VgpuSchedulerLog) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPSchedulerLog, _ := (*C.nvmlVgpuSchedulerLog_t)(unsafe.Pointer(PSchedulerLog)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuSchedulerLog(cDevice, cPSchedulerLog) + __ret := C.nvmlDeviceGetVgpuSchedulerLog(cnvmlDevice, cPSchedulerLog) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuSchedulerState function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerGetState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuSchedulerState(nvmlDevice nvmlDevice, PSchedulerState *VgpuSchedulerGetState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPSchedulerState, _ := (*C.nvmlVgpuSchedulerGetState_t)(unsafe.Pointer(PSchedulerState)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuSchedulerState(cDevice, cPSchedulerState) + __ret := C.nvmlDeviceGetVgpuSchedulerState(cnvmlDevice, cPSchedulerState) __v := (Return)(__ret) return __v } // nvmlDeviceSetVgpuSchedulerState function as declared in nvml/nvml.h -func nvmlDeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetVgpuSchedulerState(nvmlDevice nvmlDevice, PSchedulerState *VgpuSchedulerSetState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPSchedulerState, _ := (*C.nvmlVgpuSchedulerSetState_t)(unsafe.Pointer(PSchedulerState)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetVgpuSchedulerState(cDevice, cPSchedulerState) + __ret := C.nvmlDeviceSetVgpuSchedulerState(cnvmlDevice, cPSchedulerState) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuSchedulerCapabilities function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuSchedulerCapabilities(Device Device, PCapabilities *VgpuSchedulerCapabilities) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice nvmlDevice, PCapabilities *VgpuSchedulerCapabilities) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPCapabilities, _ := (*C.nvmlVgpuSchedulerCapabilities_t)(unsafe.Pointer(PCapabilities)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuSchedulerCapabilities(cDevice, cPCapabilities) + __ret := C.nvmlDeviceGetVgpuSchedulerCapabilities(cnvmlDevice, cPCapabilities) __v := (Return)(__ret) return __v } @@ -2210,70 +2210,70 @@ func nvmlSetVgpuVersion(VgpuVersion *VgpuVersion) Return { } // nvmlDeviceGetVgpuUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64, SampleValType *ValueType, VgpuInstanceSamplesCount *uint32, UtilizationSamples *VgpuInstanceUtilizationSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuUtilization(nvmlDevice nvmlDevice, LastSeenTimeStamp uint64, SampleValType *ValueType, VgpuInstanceSamplesCount *uint32, UtilizationSamples *VgpuInstanceUtilizationSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLastSeenTimeStamp, _ := (C.ulonglong)(LastSeenTimeStamp), cgoAllocsUnknown cSampleValType, _ := (*C.nvmlValueType_t)(unsafe.Pointer(SampleValType)), cgoAllocsUnknown cVgpuInstanceSamplesCount, _ := (*C.uint)(unsafe.Pointer(VgpuInstanceSamplesCount)), cgoAllocsUnknown cUtilizationSamples, _ := (*C.nvmlVgpuInstanceUtilizationSample_t)(unsafe.Pointer(UtilizationSamples)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuUtilization(cDevice, cLastSeenTimeStamp, cSampleValType, cVgpuInstanceSamplesCount, cUtilizationSamples) + __ret := C.nvmlDeviceGetVgpuUtilization(cnvmlDevice, cLastSeenTimeStamp, cSampleValType, cVgpuInstanceSamplesCount, cUtilizationSamples) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuProcessUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64, VgpuProcessSamplesCount *uint32, UtilizationSamples *VgpuProcessUtilizationSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuProcessUtilization(nvmlDevice nvmlDevice, LastSeenTimeStamp uint64, VgpuProcessSamplesCount *uint32, UtilizationSamples *VgpuProcessUtilizationSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLastSeenTimeStamp, _ := (C.ulonglong)(LastSeenTimeStamp), cgoAllocsUnknown cVgpuProcessSamplesCount, _ := (*C.uint)(unsafe.Pointer(VgpuProcessSamplesCount)), cgoAllocsUnknown cUtilizationSamples, _ := (*C.nvmlVgpuProcessUtilizationSample_t)(unsafe.Pointer(UtilizationSamples)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuProcessUtilization(cDevice, cLastSeenTimeStamp, cVgpuProcessSamplesCount, cUtilizationSamples) + __ret := C.nvmlDeviceGetVgpuProcessUtilization(cnvmlDevice, cLastSeenTimeStamp, cVgpuProcessSamplesCount, cUtilizationSamples) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetAccountingMode function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance, Mode *EnableState) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance nvmlVgpuInstance, Mode *EnableState) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetAccountingMode(cVgpuInstance, cMode) + __ret := C.nvmlVgpuInstanceGetAccountingMode(cnvmlVgpuInstance, cMode) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetAccountingPids function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance, Count *uint32, Pids *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance nvmlVgpuInstance, Count *uint32, Pids *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cPids, _ := (*C.uint)(unsafe.Pointer(Pids)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetAccountingPids(cVgpuInstance, cCount, cPids) + __ret := C.nvmlVgpuInstanceGetAccountingPids(cnvmlVgpuInstance, cCount, cPids) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetAccountingStats function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid uint32, Stats *AccountingStats) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance nvmlVgpuInstance, Pid uint32, Stats *AccountingStats) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cPid, _ := (C.uint)(Pid), cgoAllocsUnknown cStats, _ := (*C.nvmlAccountingStats_t)(unsafe.Pointer(Stats)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetAccountingStats(cVgpuInstance, cPid, cStats) + __ret := C.nvmlVgpuInstanceGetAccountingStats(cnvmlVgpuInstance, cPid, cStats) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceClearAccountingPids function as declared in nvml/nvml.h -func nvmlVgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceClearAccountingPids(cVgpuInstance) +func nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance nvmlVgpuInstance) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown + __ret := C.nvmlVgpuInstanceClearAccountingPids(cnvmlVgpuInstance) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetLicenseInfo_v2 function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetLicenseInfo_v2(VgpuInstance VgpuInstance, LicenseInfo *VgpuLicenseInfo) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance nvmlVgpuInstance, LicenseInfo *VgpuLicenseInfo) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cLicenseInfo, _ := (*C.nvmlVgpuLicenseInfo_t)(unsafe.Pointer(LicenseInfo)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetLicenseInfo_v2(cVgpuInstance, cLicenseInfo) + __ret := C.nvmlVgpuInstanceGetLicenseInfo_v2(cnvmlVgpuInstance, cLicenseInfo) __v := (Return)(__ret) return __v } @@ -2296,399 +2296,399 @@ func nvmlGetExcludedDeviceInfoByIndex(Index uint32, Info *ExcludedDeviceInfo) Re } // nvmlDeviceSetMigMode function as declared in nvml/nvml.h -func nvmlDeviceSetMigMode(Device Device, Mode uint32, ActivationStatus *Return) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetMigMode(nvmlDevice nvmlDevice, Mode uint32, ActivationStatus *Return) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.uint)(Mode), cgoAllocsUnknown cActivationStatus, _ := (*C.nvmlReturn_t)(unsafe.Pointer(ActivationStatus)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetMigMode(cDevice, cMode, cActivationStatus) + __ret := C.nvmlDeviceSetMigMode(cnvmlDevice, cMode, cActivationStatus) __v := (Return)(__ret) return __v } // nvmlDeviceGetMigMode function as declared in nvml/nvml.h -func nvmlDeviceGetMigMode(Device Device, CurrentMode *uint32, PendingMode *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMigMode(nvmlDevice nvmlDevice, CurrentMode *uint32, PendingMode *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrentMode, _ := (*C.uint)(unsafe.Pointer(CurrentMode)), cgoAllocsUnknown cPendingMode, _ := (*C.uint)(unsafe.Pointer(PendingMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMigMode(cDevice, cCurrentMode, cPendingMode) + __ret := C.nvmlDeviceGetMigMode(cnvmlDevice, cCurrentMode, cPendingMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceProfileInfo function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceProfileInfo(Device Device, Profile uint32, Info *GpuInstanceProfileInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceProfileInfo(nvmlDevice nvmlDevice, Profile uint32, Info *GpuInstanceProfileInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfile, _ := (C.uint)(Profile), cgoAllocsUnknown cInfo, _ := (*C.nvmlGpuInstanceProfileInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceProfileInfo(cDevice, cProfile, cInfo) + __ret := C.nvmlDeviceGetGpuInstanceProfileInfo(cnvmlDevice, cProfile, cInfo) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceProfileInfoV function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceProfileInfoV(Device Device, Profile uint32, Info *GpuInstanceProfileInfo_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice nvmlDevice, Profile uint32, Info *GpuInstanceProfileInfo_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfile, _ := (C.uint)(Profile), cgoAllocsUnknown cInfo, _ := (*C.nvmlGpuInstanceProfileInfo_v2_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceProfileInfoV(cDevice, cProfile, cInfo) + __ret := C.nvmlDeviceGetGpuInstanceProfileInfoV(cnvmlDevice, cProfile, cInfo) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstancePossiblePlacements_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstancePossiblePlacements_v2(Device Device, ProfileId uint32, Placements *GpuInstancePlacement, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice nvmlDevice, ProfileId uint32, Placements *GpuInstancePlacement, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacements, _ := (*C.nvmlGpuInstancePlacement_t)(unsafe.Pointer(Placements)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstancePossiblePlacements_v2(cDevice, cProfileId, cPlacements, cCount) + __ret := C.nvmlDeviceGetGpuInstancePossiblePlacements_v2(cnvmlDevice, cProfileId, cPlacements, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceRemainingCapacity function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceRemainingCapacity(Device Device, ProfileId uint32, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice nvmlDevice, ProfileId uint32, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceRemainingCapacity(cDevice, cProfileId, cCount) + __ret := C.nvmlDeviceGetGpuInstanceRemainingCapacity(cnvmlDevice, cProfileId, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceCreateGpuInstance function as declared in nvml/nvml.h -func nvmlDeviceCreateGpuInstance(Device Device, ProfileId uint32, GpuInstance *GpuInstance) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceCreateGpuInstance(nvmlDevice nvmlDevice, ProfileId uint32, nvmlGpuInstance *nvmlGpuInstance) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown - cGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(GpuInstance)), cgoAllocsUnknown - __ret := C.nvmlDeviceCreateGpuInstance(cDevice, cProfileId, cGpuInstance) + cnvmlGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(nvmlGpuInstance)), cgoAllocsUnknown + __ret := C.nvmlDeviceCreateGpuInstance(cnvmlDevice, cProfileId, cnvmlGpuInstance) __v := (Return)(__ret) return __v } // nvmlDeviceCreateGpuInstanceWithPlacement function as declared in nvml/nvml.h -func nvmlDeviceCreateGpuInstanceWithPlacement(Device Device, ProfileId uint32, Placement *GpuInstancePlacement, GpuInstance *GpuInstance) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice nvmlDevice, ProfileId uint32, Placement *GpuInstancePlacement, nvmlGpuInstance *nvmlGpuInstance) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacement, _ := (*C.nvmlGpuInstancePlacement_t)(unsafe.Pointer(Placement)), cgoAllocsUnknown - cGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(GpuInstance)), cgoAllocsUnknown - __ret := C.nvmlDeviceCreateGpuInstanceWithPlacement(cDevice, cProfileId, cPlacement, cGpuInstance) + cnvmlGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(nvmlGpuInstance)), cgoAllocsUnknown + __ret := C.nvmlDeviceCreateGpuInstanceWithPlacement(cnvmlDevice, cProfileId, cPlacement, cnvmlGpuInstance) __v := (Return)(__ret) return __v } // nvmlGpuInstanceDestroy function as declared in nvml/nvml.h -func nvmlGpuInstanceDestroy(GpuInstance GpuInstance) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceDestroy(cGpuInstance) +func nvmlGpuInstanceDestroy(nvmlGpuInstance nvmlGpuInstance) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown + __ret := C.nvmlGpuInstanceDestroy(cnvmlGpuInstance) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstances function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstances(Device Device, ProfileId uint32, GpuInstances *GpuInstance, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstances(nvmlDevice nvmlDevice, ProfileId uint32, GpuInstances *nvmlGpuInstance, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cGpuInstances, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(GpuInstances)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstances(cDevice, cProfileId, cGpuInstances, cCount) + __ret := C.nvmlDeviceGetGpuInstances(cnvmlDevice, cProfileId, cGpuInstances, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceById function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceById(Device Device, Id uint32, GpuInstance *GpuInstance) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceById(nvmlDevice nvmlDevice, Id uint32, nvmlGpuInstance *nvmlGpuInstance) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cId, _ := (C.uint)(Id), cgoAllocsUnknown - cGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(GpuInstance)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceById(cDevice, cId, cGpuInstance) + cnvmlGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(nvmlGpuInstance)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetGpuInstanceById(cnvmlDevice, cId, cnvmlGpuInstance) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetInfo function as declared in nvml/nvml.h -func nvmlGpuInstanceGetInfo(GpuInstance GpuInstance, Info *GpuInstanceInfo) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetInfo(nvmlGpuInstance nvmlGpuInstance, Info *nvmlGpuInstanceInfo) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cInfo, _ := (*C.nvmlGpuInstanceInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetInfo(cGpuInstance, cInfo) + __ret := C.nvmlGpuInstanceGetInfo(cnvmlGpuInstance, cInfo) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstanceProfileInfo function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile uint32, EngProfile uint32, Info *ComputeInstanceProfileInfo) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstanceProfileInfo(nvmlGpuInstance nvmlGpuInstance, Profile uint32, EngProfile uint32, Info *ComputeInstanceProfileInfo) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfile, _ := (C.uint)(Profile), cgoAllocsUnknown cEngProfile, _ := (C.uint)(EngProfile), cgoAllocsUnknown cInfo, _ := (*C.nvmlComputeInstanceProfileInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstanceProfileInfo(cGpuInstance, cProfile, cEngProfile, cInfo) + __ret := C.nvmlGpuInstanceGetComputeInstanceProfileInfo(cnvmlGpuInstance, cProfile, cEngProfile, cInfo) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstanceProfileInfoV function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile uint32, EngProfile uint32, Info *ComputeInstanceProfileInfo_v2) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance nvmlGpuInstance, Profile uint32, EngProfile uint32, Info *ComputeInstanceProfileInfo_v2) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfile, _ := (C.uint)(Profile), cgoAllocsUnknown cEngProfile, _ := (C.uint)(EngProfile), cgoAllocsUnknown cInfo, _ := (*C.nvmlComputeInstanceProfileInfo_v2_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstanceProfileInfoV(cGpuInstance, cProfile, cEngProfile, cInfo) + __ret := C.nvmlGpuInstanceGetComputeInstanceProfileInfoV(cnvmlGpuInstance, cProfile, cEngProfile, cInfo) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstanceRemainingCapacity function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, ProfileId uint32, Count *uint32) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, Count *uint32) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstanceRemainingCapacity(cGpuInstance, cProfileId, cCount) + __ret := C.nvmlGpuInstanceGetComputeInstanceRemainingCapacity(cnvmlGpuInstance, cProfileId, cCount) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstancePossiblePlacements function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, ProfileId uint32, Placements *ComputeInstancePlacement, Count *uint32) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, Placements *ComputeInstancePlacement, Count *uint32) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacements, _ := (*C.nvmlComputeInstancePlacement_t)(unsafe.Pointer(Placements)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstancePossiblePlacements(cGpuInstance, cProfileId, cPlacements, cCount) + __ret := C.nvmlGpuInstanceGetComputeInstancePossiblePlacements(cnvmlGpuInstance, cProfileId, cPlacements, cCount) __v := (Return)(__ret) return __v } // nvmlGpuInstanceCreateComputeInstance function as declared in nvml/nvml.h -func nvmlGpuInstanceCreateComputeInstance(GpuInstance GpuInstance, ProfileId uint32, ComputeInstance *ComputeInstance) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, nvmlComputeInstance *nvmlComputeInstance) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown - cComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(ComputeInstance)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceCreateComputeInstance(cGpuInstance, cProfileId, cComputeInstance) + cnvmlComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(nvmlComputeInstance)), cgoAllocsUnknown + __ret := C.nvmlGpuInstanceCreateComputeInstance(cnvmlGpuInstance, cProfileId, cnvmlComputeInstance) __v := (Return)(__ret) return __v } // nvmlGpuInstanceCreateComputeInstanceWithPlacement function as declared in nvml/nvml.h -func nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, ProfileId uint32, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, Placement *ComputeInstancePlacement, nvmlComputeInstance *nvmlComputeInstance) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacement, _ := (*C.nvmlComputeInstancePlacement_t)(unsafe.Pointer(Placement)), cgoAllocsUnknown - cComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(ComputeInstance)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceCreateComputeInstanceWithPlacement(cGpuInstance, cProfileId, cPlacement, cComputeInstance) + cnvmlComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(nvmlComputeInstance)), cgoAllocsUnknown + __ret := C.nvmlGpuInstanceCreateComputeInstanceWithPlacement(cnvmlGpuInstance, cProfileId, cPlacement, cnvmlComputeInstance) __v := (Return)(__ret) return __v } // nvmlComputeInstanceDestroy function as declared in nvml/nvml.h -func nvmlComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { - cComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&ComputeInstance)), cgoAllocsUnknown - __ret := C.nvmlComputeInstanceDestroy(cComputeInstance) +func nvmlComputeInstanceDestroy(nvmlComputeInstance nvmlComputeInstance) Return { + cnvmlComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&nvmlComputeInstance)), cgoAllocsUnknown + __ret := C.nvmlComputeInstanceDestroy(cnvmlComputeInstance) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstances function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstances(GpuInstance GpuInstance, ProfileId uint32, ComputeInstances *ComputeInstance, Count *uint32) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, ComputeInstances *nvmlComputeInstance, Count *uint32) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cComputeInstances, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(ComputeInstances)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstances(cGpuInstance, cProfileId, cComputeInstances, cCount) + __ret := C.nvmlGpuInstanceGetComputeInstances(cnvmlGpuInstance, cProfileId, cComputeInstances, cCount) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstanceById function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id uint32, ComputeInstance *ComputeInstance) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance nvmlGpuInstance, Id uint32, nvmlComputeInstance *nvmlComputeInstance) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cId, _ := (C.uint)(Id), cgoAllocsUnknown - cComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(ComputeInstance)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstanceById(cGpuInstance, cId, cComputeInstance) + cnvmlComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(nvmlComputeInstance)), cgoAllocsUnknown + __ret := C.nvmlGpuInstanceGetComputeInstanceById(cnvmlGpuInstance, cId, cnvmlComputeInstance) __v := (Return)(__ret) return __v } // nvmlComputeInstanceGetInfo_v2 function as declared in nvml/nvml.h -func nvmlComputeInstanceGetInfo_v2(ComputeInstance ComputeInstance, Info *ComputeInstanceInfo) Return { - cComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&ComputeInstance)), cgoAllocsUnknown +func nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance nvmlComputeInstance, Info *nvmlComputeInstanceInfo) Return { + cnvmlComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&nvmlComputeInstance)), cgoAllocsUnknown cInfo, _ := (*C.nvmlComputeInstanceInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlComputeInstanceGetInfo_v2(cComputeInstance, cInfo) + __ret := C.nvmlComputeInstanceGetInfo_v2(cnvmlComputeInstance, cInfo) __v := (Return)(__ret) return __v } // nvmlDeviceIsMigDeviceHandle function as declared in nvml/nvml.h -func nvmlDeviceIsMigDeviceHandle(Device Device, IsMigDevice *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceIsMigDeviceHandle(nvmlDevice nvmlDevice, IsMigDevice *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsMigDevice, _ := (*C.uint)(unsafe.Pointer(IsMigDevice)), cgoAllocsUnknown - __ret := C.nvmlDeviceIsMigDeviceHandle(cDevice, cIsMigDevice) + __ret := C.nvmlDeviceIsMigDeviceHandle(cnvmlDevice, cIsMigDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceId function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceId(Device Device, Id *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceId(nvmlDevice nvmlDevice, Id *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cId, _ := (*C.uint)(unsafe.Pointer(Id)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceId(cDevice, cId) + __ret := C.nvmlDeviceGetGpuInstanceId(cnvmlDevice, cId) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeInstanceId function as declared in nvml/nvml.h -func nvmlDeviceGetComputeInstanceId(Device Device, Id *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeInstanceId(nvmlDevice nvmlDevice, Id *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cId, _ := (*C.uint)(unsafe.Pointer(Id)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeInstanceId(cDevice, cId) + __ret := C.nvmlDeviceGetComputeInstanceId(cnvmlDevice, cId) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxMigDeviceCount function as declared in nvml/nvml.h -func nvmlDeviceGetMaxMigDeviceCount(Device Device, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxMigDeviceCount(nvmlDevice nvmlDevice, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxMigDeviceCount(cDevice, cCount) + __ret := C.nvmlDeviceGetMaxMigDeviceCount(cnvmlDevice, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceGetMigDeviceHandleByIndex function as declared in nvml/nvml.h -func nvmlDeviceGetMigDeviceHandleByIndex(Device Device, Index uint32, MigDevice *Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice nvmlDevice, Index uint32, MigDevice *nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIndex, _ := (C.uint)(Index), cgoAllocsUnknown cMigDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(MigDevice)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMigDeviceHandleByIndex(cDevice, cIndex, cMigDevice) + __ret := C.nvmlDeviceGetMigDeviceHandleByIndex(cnvmlDevice, cIndex, cMigDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetDeviceHandleFromMigDeviceHandle function as declared in nvml/nvml.h -func nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device, Device *Device) Return { +func nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice nvmlDevice, nvmlDevice *nvmlDevice) Return { cMigDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&MigDevice)), cgoAllocsUnknown - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDeviceHandleFromMigDeviceHandle(cMigDevice, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetDeviceHandleFromMigDeviceHandle(cMigDevice, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetBusType function as declared in nvml/nvml.h -func nvmlDeviceGetBusType(Device Device, _type *BusType) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBusType(nvmlDevice nvmlDevice, _type *BusType) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (*C.nvmlBusType_t)(unsafe.Pointer(_type)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBusType(cDevice, c_type) + __ret := C.nvmlDeviceGetBusType(cnvmlDevice, c_type) __v := (Return)(__ret) return __v } // nvmlDeviceGetDynamicPstatesInfo function as declared in nvml/nvml.h -func nvmlDeviceGetDynamicPstatesInfo(Device Device, PDynamicPstatesInfo *GpuDynamicPstatesInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDynamicPstatesInfo(nvmlDevice nvmlDevice, PDynamicPstatesInfo *GpuDynamicPstatesInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPDynamicPstatesInfo, _ := (*C.nvmlGpuDynamicPstatesInfo_t)(unsafe.Pointer(PDynamicPstatesInfo)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDynamicPstatesInfo(cDevice, cPDynamicPstatesInfo) + __ret := C.nvmlDeviceGetDynamicPstatesInfo(cnvmlDevice, cPDynamicPstatesInfo) __v := (Return)(__ret) return __v } // nvmlDeviceSetFanSpeed_v2 function as declared in nvml/nvml.h -func nvmlDeviceSetFanSpeed_v2(Device Device, Fan uint32, Speed uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetFanSpeed_v2(nvmlDevice nvmlDevice, Fan uint32, Speed uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cSpeed, _ := (C.uint)(Speed), cgoAllocsUnknown - __ret := C.nvmlDeviceSetFanSpeed_v2(cDevice, cFan, cSpeed) + __ret := C.nvmlDeviceSetFanSpeed_v2(cnvmlDevice, cFan, cSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpcClkVfOffset function as declared in nvml/nvml.h -func nvmlDeviceGetGpcClkVfOffset(Device Device, Offset *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpcClkVfOffset(nvmlDevice nvmlDevice, Offset *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cOffset, _ := (*C.int)(unsafe.Pointer(Offset)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpcClkVfOffset(cDevice, cOffset) + __ret := C.nvmlDeviceGetGpcClkVfOffset(cnvmlDevice, cOffset) __v := (Return)(__ret) return __v } // nvmlDeviceSetGpcClkVfOffset function as declared in nvml/nvml.h -func nvmlDeviceSetGpcClkVfOffset(Device Device, Offset int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetGpcClkVfOffset(nvmlDevice nvmlDevice, Offset int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cOffset, _ := (C.int)(Offset), cgoAllocsUnknown - __ret := C.nvmlDeviceSetGpcClkVfOffset(cDevice, cOffset) + __ret := C.nvmlDeviceSetGpcClkVfOffset(cnvmlDevice, cOffset) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemClkVfOffset function as declared in nvml/nvml.h -func nvmlDeviceGetMemClkVfOffset(Device Device, Offset *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemClkVfOffset(nvmlDevice nvmlDevice, Offset *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cOffset, _ := (*C.int)(unsafe.Pointer(Offset)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemClkVfOffset(cDevice, cOffset) + __ret := C.nvmlDeviceGetMemClkVfOffset(cnvmlDevice, cOffset) __v := (Return)(__ret) return __v } // nvmlDeviceSetMemClkVfOffset function as declared in nvml/nvml.h -func nvmlDeviceSetMemClkVfOffset(Device Device, Offset int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetMemClkVfOffset(nvmlDevice nvmlDevice, Offset int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cOffset, _ := (C.int)(Offset), cgoAllocsUnknown - __ret := C.nvmlDeviceSetMemClkVfOffset(cDevice, cOffset) + __ret := C.nvmlDeviceSetMemClkVfOffset(cnvmlDevice, cOffset) __v := (Return)(__ret) return __v } // nvmlDeviceGetMinMaxClockOfPState function as declared in nvml/nvml.h -func nvmlDeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates, MinClockMHz *uint32, MaxClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMinMaxClockOfPState(nvmlDevice nvmlDevice, _type ClockType, Pstate Pstates, MinClockMHz *uint32, MaxClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (C.nvmlClockType_t)(_type), cgoAllocsUnknown cPstate, _ := (C.nvmlPstates_t)(Pstate), cgoAllocsUnknown cMinClockMHz, _ := (*C.uint)(unsafe.Pointer(MinClockMHz)), cgoAllocsUnknown cMaxClockMHz, _ := (*C.uint)(unsafe.Pointer(MaxClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMinMaxClockOfPState(cDevice, c_type, cPstate, cMinClockMHz, cMaxClockMHz) + __ret := C.nvmlDeviceGetMinMaxClockOfPState(cnvmlDevice, c_type, cPstate, cMinClockMHz, cMaxClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedPerformanceStates function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedPerformanceStates(Device Device, Pstates *Pstates, Size uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedPerformanceStates(nvmlDevice nvmlDevice, Pstates *Pstates, Size uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPstates, _ := (*C.nvmlPstates_t)(unsafe.Pointer(Pstates)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedPerformanceStates(cDevice, cPstates, cSize) + __ret := C.nvmlDeviceGetSupportedPerformanceStates(cnvmlDevice, cPstates, cSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpcClkMinMaxVfOffset function as declared in nvml/nvml.h -func nvmlDeviceGetGpcClkMinMaxVfOffset(Device Device, MinOffset *int32, MaxOffset *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice nvmlDevice, MinOffset *int32, MaxOffset *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinOffset, _ := (*C.int)(unsafe.Pointer(MinOffset)), cgoAllocsUnknown cMaxOffset, _ := (*C.int)(unsafe.Pointer(MaxOffset)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpcClkMinMaxVfOffset(cDevice, cMinOffset, cMaxOffset) + __ret := C.nvmlDeviceGetGpcClkMinMaxVfOffset(cnvmlDevice, cMinOffset, cMaxOffset) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemClkMinMaxVfOffset function as declared in nvml/nvml.h -func nvmlDeviceGetMemClkMinMaxVfOffset(Device Device, MinOffset *int32, MaxOffset *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice nvmlDevice, MinOffset *int32, MaxOffset *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinOffset, _ := (*C.int)(unsafe.Pointer(MinOffset)), cgoAllocsUnknown cMaxOffset, _ := (*C.int)(unsafe.Pointer(MaxOffset)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemClkMinMaxVfOffset(cDevice, cMinOffset, cMaxOffset) + __ret := C.nvmlDeviceGetMemClkMinMaxVfOffset(cnvmlDevice, cMinOffset, cMaxOffset) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuFabricInfo function as declared in nvml/nvml.h -func nvmlDeviceGetGpuFabricInfo(Device Device, GpuFabricInfo *GpuFabricInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuFabricInfo(nvmlDevice nvmlDevice, GpuFabricInfo *GpuFabricInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cGpuFabricInfo, _ := (*C.nvmlGpuFabricInfo_t)(unsafe.Pointer(GpuFabricInfo)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuFabricInfo(cDevice, cGpuFabricInfo) + __ret := C.nvmlDeviceGetGpuFabricInfo(cnvmlDevice, cGpuFabricInfo) __v := (Return)(__ret) return __v } // nvmlGpmMetricsGet function as declared in nvml/nvml.h -func nvmlGpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { +func nvmlGpmMetricsGet(MetricsGet *nvmlGpmMetricsGetType) Return { cMetricsGet, _ := (*C.nvmlGpmMetricsGet_t)(unsafe.Pointer(MetricsGet)), cgoAllocsUnknown __ret := C.nvmlGpmMetricsGet(cMetricsGet) __v := (Return)(__ret) @@ -2696,72 +2696,72 @@ func nvmlGpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { } // nvmlGpmSampleFree function as declared in nvml/nvml.h -func nvmlGpmSampleFree(GpmSample GpmSample) Return { - cGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmSampleFree(cGpmSample) +func nvmlGpmSampleFree(nvmlGpmSample nvmlGpmSample) Return { + cnvmlGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmSampleFree(cnvmlGpmSample) __v := (Return)(__ret) return __v } // nvmlGpmSampleAlloc function as declared in nvml/nvml.h -func nvmlGpmSampleAlloc(GpmSample *GpmSample) Return { - cGpmSample, _ := (*C.nvmlGpmSample_t)(unsafe.Pointer(GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmSampleAlloc(cGpmSample) +func nvmlGpmSampleAlloc(nvmlGpmSample *nvmlGpmSample) Return { + cnvmlGpmSample, _ := (*C.nvmlGpmSample_t)(unsafe.Pointer(nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmSampleAlloc(cnvmlGpmSample) __v := (Return)(__ret) return __v } // nvmlGpmSampleGet function as declared in nvml/nvml.h -func nvmlGpmSampleGet(Device Device, GpmSample GpmSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - cGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmSampleGet(cDevice, cGpmSample) +func nvmlGpmSampleGet(nvmlDevice nvmlDevice, nvmlGpmSample nvmlGpmSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + cnvmlGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmSampleGet(cnvmlDevice, cnvmlGpmSample) __v := (Return)(__ret) return __v } // nvmlGpmMigSampleGet function as declared in nvml/nvml.h -func nvmlGpmMigSampleGet(Device Device, GpuInstanceId uint32, GpmSample GpmSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlGpmMigSampleGet(nvmlDevice nvmlDevice, GpuInstanceId uint32, nvmlGpmSample nvmlGpmSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cGpuInstanceId, _ := (C.uint)(GpuInstanceId), cgoAllocsUnknown - cGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmMigSampleGet(cDevice, cGpuInstanceId, cGpmSample) + cnvmlGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmMigSampleGet(cnvmlDevice, cGpuInstanceId, cnvmlGpmSample) __v := (Return)(__ret) return __v } // nvmlGpmQueryDeviceSupport function as declared in nvml/nvml.h -func nvmlGpmQueryDeviceSupport(Device Device, GpmSupport *GpmSupport) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlGpmQueryDeviceSupport(nvmlDevice nvmlDevice, GpmSupport *GpmSupport) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cGpmSupport, _ := (*C.nvmlGpmSupport_t)(unsafe.Pointer(GpmSupport)), cgoAllocsUnknown - __ret := C.nvmlGpmQueryDeviceSupport(cDevice, cGpmSupport) + __ret := C.nvmlGpmQueryDeviceSupport(cnvmlDevice, cGpmSupport) __v := (Return)(__ret) return __v } // nvmlDeviceCcuGetStreamState function as declared in nvml/nvml.h -func nvmlDeviceCcuGetStreamState(Device Device, State *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceCcuGetStreamState(nvmlDevice nvmlDevice, State *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cState, _ := (*C.uint)(unsafe.Pointer(State)), cgoAllocsUnknown - __ret := C.nvmlDeviceCcuGetStreamState(cDevice, cState) + __ret := C.nvmlDeviceCcuGetStreamState(cnvmlDevice, cState) __v := (Return)(__ret) return __v } // nvmlDeviceCcuSetStreamState function as declared in nvml/nvml.h -func nvmlDeviceCcuSetStreamState(Device Device, State uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceCcuSetStreamState(nvmlDevice nvmlDevice, State uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cState, _ := (C.uint)(State), cgoAllocsUnknown - __ret := C.nvmlDeviceCcuSetStreamState(cDevice, cState) + __ret := C.nvmlDeviceCcuSetStreamState(cnvmlDevice, cState) __v := (Return)(__ret) return __v } // nvmlDeviceSetNvLinkDeviceLowPowerThreshold function as declared in nvml/nvml.h -func nvmlDeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice nvmlDevice, Info *NvLinkPowerThres) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfo, _ := (*C.nvmlNvLinkPowerThres_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetNvLinkDeviceLowPowerThreshold(cDevice, cInfo) + __ret := C.nvmlDeviceSetNvLinkDeviceLowPowerThreshold(cnvmlDevice, cInfo) __v := (Return)(__ret) return __v } @@ -2782,74 +2782,74 @@ func nvmlDeviceGetCount_v1(DeviceCount *uint32) Return { } // nvmlDeviceGetHandleByIndex_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByIndex_v1(Index uint32, Device *Device) Return { +func nvmlDeviceGetHandleByIndex_v1(Index uint32, nvmlDevice *nvmlDevice) Return { cIndex, _ := (C.uint)(Index), cgoAllocsUnknown - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByIndex(cIndex, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByIndex(cIndex, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleByPciBusId_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByPciBusId_v1(PciBusId string, Device *Device) Return { +func nvmlDeviceGetHandleByPciBusId_v1(PciBusId string, nvmlDevice *nvmlDevice) Return { cPciBusId, _ := unpackPCharString(PciBusId) - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByPciBusId(cPciBusId, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByPciBusId(cPciBusId, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetPciInfo_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetPciInfo_v1(Device Device, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPciInfo_v1(nvmlDevice nvmlDevice, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPciInfo(cDevice, cPci) + __ret := C.nvmlDeviceGetPciInfo(cnvmlDevice, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetPciInfo_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetPciInfo_v2(Device Device, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPciInfo_v2(nvmlDevice nvmlDevice, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPciInfo_v2(cDevice, cPci) + __ret := C.nvmlDeviceGetPciInfo_v2(cnvmlDevice, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkRemotePciInfo_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkRemotePciInfo_v1(Device Device, Link uint32, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkRemotePciInfo_v1(nvmlDevice nvmlDevice, Link uint32, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkRemotePciInfo(cDevice, cLink, cPci) + __ret := C.nvmlDeviceGetNvLinkRemotePciInfo(cnvmlDevice, cLink, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetGridLicensableFeatures_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetGridLicensableFeatures_v1(Device Device, PGridLicensableFeatures *GridLicensableFeatures) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGridLicensableFeatures_v1(nvmlDevice nvmlDevice, PGridLicensableFeatures *GridLicensableFeatures) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPGridLicensableFeatures, _ := (*C.nvmlGridLicensableFeatures_t)(unsafe.Pointer(PGridLicensableFeatures)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGridLicensableFeatures(cDevice, cPGridLicensableFeatures) + __ret := C.nvmlDeviceGetGridLicensableFeatures(cnvmlDevice, cPGridLicensableFeatures) __v := (Return)(__ret) return __v } // nvmlDeviceGetGridLicensableFeatures_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetGridLicensableFeatures_v2(Device Device, PGridLicensableFeatures *GridLicensableFeatures) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGridLicensableFeatures_v2(nvmlDevice nvmlDevice, PGridLicensableFeatures *GridLicensableFeatures) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPGridLicensableFeatures, _ := (*C.nvmlGridLicensableFeatures_t)(unsafe.Pointer(PGridLicensableFeatures)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGridLicensableFeatures_v2(cDevice, cPGridLicensableFeatures) + __ret := C.nvmlDeviceGetGridLicensableFeatures_v2(cnvmlDevice, cPGridLicensableFeatures) __v := (Return)(__ret) return __v } // nvmlDeviceGetGridLicensableFeatures_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetGridLicensableFeatures_v3(Device Device, PGridLicensableFeatures *GridLicensableFeatures) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGridLicensableFeatures_v3(nvmlDevice nvmlDevice, PGridLicensableFeatures *GridLicensableFeatures) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPGridLicensableFeatures, _ := (*C.nvmlGridLicensableFeatures_t)(unsafe.Pointer(PGridLicensableFeatures)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGridLicensableFeatures_v3(cDevice, cPGridLicensableFeatures) + __ret := C.nvmlDeviceGetGridLicensableFeatures_v3(cnvmlDevice, cPGridLicensableFeatures) __v := (Return)(__ret) return __v } @@ -2863,7 +2863,7 @@ func nvmlDeviceRemoveGpu_v1(PciInfo *PciInfo) Return { } // nvmlEventSetWait_v1 function as declared in nvml/nvml.h -func nvmlEventSetWait_v1(Set EventSet, Data *EventData, Timeoutms uint32) Return { +func nvmlEventSetWait_v1(Set nvmlEventSet, Data *nvmlEventData, Timeoutms uint32) Return { cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown cData, _ := (*C.nvmlEventData_t)(unsafe.Pointer(Data)), cgoAllocsUnknown cTimeoutms, _ := (C.uint)(Timeoutms), cgoAllocsUnknown @@ -2873,99 +2873,99 @@ func nvmlEventSetWait_v1(Set EventSet, Data *EventData, Timeoutms uint32) Return } // nvmlDeviceGetAttributes_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetAttributes_v1(Device Device, Attributes *DeviceAttributes) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAttributes_v1(nvmlDevice nvmlDevice, Attributes *DeviceAttributes) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cAttributes, _ := (*C.nvmlDeviceAttributes_t)(unsafe.Pointer(Attributes)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAttributes(cDevice, cAttributes) + __ret := C.nvmlDeviceGetAttributes(cnvmlDevice, cAttributes) __v := (Return)(__ret) return __v } // nvmlComputeInstanceGetInfo_v1 function as declared in nvml/nvml.h -func nvmlComputeInstanceGetInfo_v1(ComputeInstance ComputeInstance, Info *ComputeInstanceInfo) Return { - cComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&ComputeInstance)), cgoAllocsUnknown +func nvmlComputeInstanceGetInfo_v1(nvmlComputeInstance nvmlComputeInstance, Info *nvmlComputeInstanceInfo) Return { + cnvmlComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&nvmlComputeInstance)), cgoAllocsUnknown cInfo, _ := (*C.nvmlComputeInstanceInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlComputeInstanceGetInfo(cComputeInstance, cInfo) + __ret := C.nvmlComputeInstanceGetInfo(cnvmlComputeInstance, cInfo) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeRunningProcesses_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetComputeRunningProcesses_v1(Device Device, InfoCount *uint32, Infos *ProcessInfo_v1) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeRunningProcesses_v1(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v1) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v1_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeRunningProcesses(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetComputeRunningProcesses(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeRunningProcesses_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetComputeRunningProcesses_v2(Device Device, InfoCount *uint32, Infos *ProcessInfo_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeRunningProcesses_v2(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v2_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeRunningProcesses_v2(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetComputeRunningProcesses_v2(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetGraphicsRunningProcesses_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetGraphicsRunningProcesses_v1(Device Device, InfoCount *uint32, Infos *ProcessInfo_v1) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGraphicsRunningProcesses_v1(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v1) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v1_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGraphicsRunningProcesses(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetGraphicsRunningProcesses(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetGraphicsRunningProcesses_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetGraphicsRunningProcesses_v2(Device Device, InfoCount *uint32, Infos *ProcessInfo_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGraphicsRunningProcesses_v2(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v2_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGraphicsRunningProcesses_v2(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetGraphicsRunningProcesses_v2(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetMPSComputeRunningProcesses_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetMPSComputeRunningProcesses_v1(Device Device, InfoCount *uint32, Infos *ProcessInfo_v1) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMPSComputeRunningProcesses_v1(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v1) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v1_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMPSComputeRunningProcesses(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetMPSComputeRunningProcesses(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetMPSComputeRunningProcesses_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetMPSComputeRunningProcesses_v2(Device Device, InfoCount *uint32, Infos *ProcessInfo_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMPSComputeRunningProcesses_v2(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v2_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMPSComputeRunningProcesses_v2(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetMPSComputeRunningProcesses_v2(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstancePossiblePlacements_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstancePossiblePlacements_v1(Device Device, ProfileId uint32, Placements *GpuInstancePlacement, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstancePossiblePlacements_v1(nvmlDevice nvmlDevice, ProfileId uint32, Placements *GpuInstancePlacement, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacements, _ := (*C.nvmlGpuInstancePlacement_t)(unsafe.Pointer(Placements)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstancePossiblePlacements(cDevice, cProfileId, cPlacements, cCount) + __ret := C.nvmlDeviceGetGpuInstancePossiblePlacements(cnvmlDevice, cProfileId, cPlacements, cCount) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetLicenseInfo_v1 function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetLicenseInfo_v1(VgpuInstance VgpuInstance, LicenseInfo *VgpuLicenseInfo) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetLicenseInfo_v1(nvmlVgpuInstance nvmlVgpuInstance, LicenseInfo *VgpuLicenseInfo) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cLicenseInfo, _ := (*C.nvmlVgpuLicenseInfo_t)(unsafe.Pointer(LicenseInfo)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetLicenseInfo(cVgpuInstance, cLicenseInfo) + __ret := C.nvmlVgpuInstanceGetLicenseInfo(cnvmlVgpuInstance, cLicenseInfo) __v := (Return)(__ret) return __v } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go index 0a0cceee..1aec3ecc 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go @@ -19,17 +19,27 @@ import ( ) // nvml.ErrorString() -func ErrorString(r Return) string { - if err := GetLibrary().Lookup("nvmlErrorString"); err != nil { - return fallbackErrorStringFunc(r) - } - return nvmlErrorString(r) +func (l *library) ErrorString(r Return) string { + return r.Error() +} + +// String returns the string representation of a Return. +func (r Return) String() string { + return r.Error() } -// fallbackErrorStringFunc provides a basic nvmlErrorString implementation. +// Error returns the string representation of a Return. +func (r Return) Error() string { + return errorStringFunc(r) +} + +// Assigned to nvml.ErrorString if the system nvml library is in use. +var errorStringFunc = defaultErrorStringFunc + +// defaultErrorStringFunc provides a basic nvmlErrorString implementation. // This allows the nvml.ErrorString function to be used even if the NVML library // is not loaded. -var fallbackErrorStringFunc = func(r Return) string { +var defaultErrorStringFunc = func(r Return) string { switch r { case SUCCESS: return "SUCCESS" diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go index 424f99bd..03145b28 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go @@ -15,67 +15,67 @@ package nvml // nvml.SystemGetDriverVersion() -func SystemGetDriverVersion() (string, Return) { +func (l *library) SystemGetDriverVersion() (string, Return) { Version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE) ret := nvmlSystemGetDriverVersion(&Version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE) return string(Version[:clen(Version)]), ret } // nvml.SystemGetNVMLVersion() -func SystemGetNVMLVersion() (string, Return) { +func (l *library) SystemGetNVMLVersion() (string, Return) { Version := make([]byte, SYSTEM_NVML_VERSION_BUFFER_SIZE) ret := nvmlSystemGetNVMLVersion(&Version[0], SYSTEM_NVML_VERSION_BUFFER_SIZE) return string(Version[:clen(Version)]), ret } // nvml.SystemGetCudaDriverVersion() -func SystemGetCudaDriverVersion() (int, Return) { +func (l *library) SystemGetCudaDriverVersion() (int, Return) { var CudaDriverVersion int32 ret := nvmlSystemGetCudaDriverVersion(&CudaDriverVersion) return int(CudaDriverVersion), ret } // nvml.SystemGetCudaDriverVersion_v2() -func SystemGetCudaDriverVersion_v2() (int, Return) { +func (l *library) SystemGetCudaDriverVersion_v2() (int, Return) { var CudaDriverVersion int32 ret := nvmlSystemGetCudaDriverVersion_v2(&CudaDriverVersion) return int(CudaDriverVersion), ret } // nvml.SystemGetProcessName() -func SystemGetProcessName(Pid int) (string, Return) { - Name := make([]byte, SYSTEM_PROCESS_NAME_BUFFER_SIZE) - ret := nvmlSystemGetProcessName(uint32(Pid), &Name[0], SYSTEM_PROCESS_NAME_BUFFER_SIZE) - return string(Name[:clen(Name)]), ret +func (l *library) SystemGetProcessName(pid int) (string, Return) { + name := make([]byte, SYSTEM_PROCESS_NAME_BUFFER_SIZE) + ret := nvmlSystemGetProcessName(uint32(pid), &name[0], SYSTEM_PROCESS_NAME_BUFFER_SIZE) + return string(name[:clen(name)]), ret } // nvml.SystemGetHicVersion() -func SystemGetHicVersion() ([]HwbcEntry, Return) { - var HwbcCount uint32 = 1 // Will be reduced upon returning +func (l *library) SystemGetHicVersion() ([]HwbcEntry, Return) { + var hwbcCount uint32 = 1 // Will be reduced upon returning for { - HwbcEntries := make([]HwbcEntry, HwbcCount) - ret := nvmlSystemGetHicVersion(&HwbcCount, &HwbcEntries[0]) + hwbcEntries := make([]HwbcEntry, hwbcCount) + ret := nvmlSystemGetHicVersion(&hwbcCount, &hwbcEntries[0]) if ret == SUCCESS { - return HwbcEntries[:HwbcCount], ret + return hwbcEntries[:hwbcCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - HwbcCount *= 2 + hwbcCount *= 2 } } // nvml.SystemGetTopologyGpuSet() -func SystemGetTopologyGpuSet(CpuNumber int) ([]Device, Return) { - var Count uint32 - ret := nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, nil) +func (l *library) SystemGetTopologyGpuSet(cpuNumber int) ([]Device, Return) { + var count uint32 + ret := nvmlSystemGetTopologyGpuSet(uint32(cpuNumber), &count, nil) if ret != SUCCESS { return nil, ret } - if Count == 0 { + if count == 0 { return []Device{}, ret } - DeviceArray := make([]Device, Count) - ret = nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, &DeviceArray[0]) - return DeviceArray, ret + deviceArray := make([]nvmlDevice, count) + ret = nvmlSystemGetTopologyGpuSet(uint32(cpuNumber), &count, &deviceArray[0]) + return convertSlice[nvmlDevice, Device](deviceArray), ret } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go index 396886d6..6a57bab3 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go @@ -5,7 +5,7 @@ package nvml import "unsafe" -type Device struct { +type nvmlDevice struct { Handle *_Ctype_struct_nvmlDevice_st } @@ -143,9 +143,9 @@ type ClkMonStatus struct { ClkMonList [32]ClkMonFaultInfo } -type VgpuTypeId uint32 +type nvmlVgpuTypeId uint32 -type VgpuInstance uint32 +type nvmlVgpuInstance uint32 type VgpuInstanceUtilizationSample struct { VgpuInstance uint32 @@ -316,7 +316,7 @@ type FieldValue struct { Value [8]byte } -type Unit struct { +type nvmlUnit struct { Handle *_Ctype_struct_nvmlUnit_st } @@ -354,12 +354,12 @@ type UnitFanSpeeds struct { Count uint32 } -type EventSet struct { +type nvmlEventSet struct { Handle *_Ctype_struct_nvmlEventSet_st } -type EventData struct { - Device Device +type nvmlEventData struct { + Device nvmlDevice EventType uint64 EventData uint64 GpuInstanceId uint32 @@ -494,14 +494,14 @@ type GpuInstanceProfileInfo_v2 struct { Name [96]int8 } -type GpuInstanceInfo struct { - Device Device +type nvmlGpuInstanceInfo struct { + Device nvmlDevice Id uint32 ProfileId uint32 Placement GpuInstancePlacement } -type GpuInstance struct { +type nvmlGpuInstance struct { Handle *_Ctype_struct_nvmlGpuInstance_st } @@ -536,19 +536,19 @@ type ComputeInstanceProfileInfo_v2 struct { Name [96]int8 } -type ComputeInstanceInfo struct { - Device Device - GpuInstance GpuInstance +type nvmlComputeInstanceInfo struct { + Device nvmlDevice + GpuInstance nvmlGpuInstance Id uint32 ProfileId uint32 Placement ComputeInstancePlacement } -type ComputeInstance struct { +type nvmlComputeInstance struct { Handle *_Ctype_struct_nvmlComputeInstance_st } -type GpmSample struct { +type nvmlGpmSample struct { Handle *_Ctype_struct_nvmlGpmSample_st } @@ -565,11 +565,11 @@ type GpmMetric struct { MetricInfo GpmMetricMetricInfo } -type GpmMetricsGetType struct { +type nvmlGpmMetricsGetType struct { Version uint32 NumMetrics uint32 - Sample1 GpmSample - Sample2 GpmSample + Sample1 nvmlGpmSample + Sample2 nvmlGpmSample Metrics [98]GpmMetric } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go index aba916ae..617ad546 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go @@ -15,99 +15,99 @@ package nvml // nvml.UnitGetCount() -func UnitGetCount() (int, Return) { +func (l *library) UnitGetCount() (int, Return) { var UnitCount uint32 ret := nvmlUnitGetCount(&UnitCount) return int(UnitCount), ret } // nvml.UnitGetHandleByIndex() -func UnitGetHandleByIndex(Index int) (Unit, Return) { - var Unit Unit - ret := nvmlUnitGetHandleByIndex(uint32(Index), &Unit) - return Unit, ret +func (l *library) UnitGetHandleByIndex(index int) (Unit, Return) { + var unit nvmlUnit + ret := nvmlUnitGetHandleByIndex(uint32(index), &unit) + return unit, ret } // nvml.UnitGetUnitInfo() -func UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) { - var Info UnitInfo - ret := nvmlUnitGetUnitInfo(Unit, &Info) - return Info, ret +func (l *library) UnitGetUnitInfo(unit Unit) (UnitInfo, Return) { + return unit.GetUnitInfo() } -func (Unit Unit) GetUnitInfo() (UnitInfo, Return) { - return UnitGetUnitInfo(Unit) +func (unit nvmlUnit) GetUnitInfo() (UnitInfo, Return) { + var info UnitInfo + ret := nvmlUnitGetUnitInfo(unit, &info) + return info, ret } // nvml.UnitGetLedState() -func UnitGetLedState(Unit Unit) (LedState, Return) { - var State LedState - ret := nvmlUnitGetLedState(Unit, &State) - return State, ret +func (l *library) UnitGetLedState(unit Unit) (LedState, Return) { + return unit.GetLedState() } -func (Unit Unit) GetLedState() (LedState, Return) { - return UnitGetLedState(Unit) +func (unit nvmlUnit) GetLedState() (LedState, Return) { + var state LedState + ret := nvmlUnitGetLedState(unit, &state) + return state, ret } // nvml.UnitGetPsuInfo() -func UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) { - var Psu PSUInfo - ret := nvmlUnitGetPsuInfo(Unit, &Psu) - return Psu, ret +func (l *library) UnitGetPsuInfo(unit Unit) (PSUInfo, Return) { + return unit.GetPsuInfo() } -func (Unit Unit) GetPsuInfo() (PSUInfo, Return) { - return UnitGetPsuInfo(Unit) +func (unit nvmlUnit) GetPsuInfo() (PSUInfo, Return) { + var psu PSUInfo + ret := nvmlUnitGetPsuInfo(unit, &psu) + return psu, ret } // nvml.UnitGetTemperature() -func UnitGetTemperature(Unit Unit, Type int) (uint32, Return) { - var Temp uint32 - ret := nvmlUnitGetTemperature(Unit, uint32(Type), &Temp) - return Temp, ret +func (l *library) UnitGetTemperature(unit Unit, ttype int) (uint32, Return) { + return unit.GetTemperature(ttype) } -func (Unit Unit) GetTemperature(Type int) (uint32, Return) { - return UnitGetTemperature(Unit, Type) +func (unit nvmlUnit) GetTemperature(ttype int) (uint32, Return) { + var temp uint32 + ret := nvmlUnitGetTemperature(unit, uint32(ttype), &temp) + return temp, ret } // nvml.UnitGetFanSpeedInfo() -func UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) { - var FanSpeeds UnitFanSpeeds - ret := nvmlUnitGetFanSpeedInfo(Unit, &FanSpeeds) - return FanSpeeds, ret +func (l *library) UnitGetFanSpeedInfo(unit Unit) (UnitFanSpeeds, Return) { + return unit.GetFanSpeedInfo() } -func (Unit Unit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { - return UnitGetFanSpeedInfo(Unit) +func (unit nvmlUnit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { + var fanSpeeds UnitFanSpeeds + ret := nvmlUnitGetFanSpeedInfo(unit, &fanSpeeds) + return fanSpeeds, ret } // nvml.UnitGetDevices() -func UnitGetDevices(Unit Unit) ([]Device, Return) { - var DeviceCount uint32 = 1 // Will be reduced upon returning +func (l *library) UnitGetDevices(unit Unit) ([]Device, Return) { + return unit.GetDevices() +} + +func (unit nvmlUnit) GetDevices() ([]Device, Return) { + var deviceCount uint32 = 1 // Will be reduced upon returning for { - Devices := make([]Device, DeviceCount) - ret := nvmlUnitGetDevices(Unit, &DeviceCount, &Devices[0]) + devices := make([]nvmlDevice, deviceCount) + ret := nvmlUnitGetDevices(unit, &deviceCount, &devices[0]) if ret == SUCCESS { - return Devices[:DeviceCount], ret + return convertSlice[nvmlDevice, Device](devices[:deviceCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - DeviceCount *= 2 + deviceCount *= 2 } } -func (Unit Unit) GetDevices() ([]Device, Return) { - return UnitGetDevices(Unit) -} - // nvml.UnitSetLedState() -func UnitSetLedState(Unit Unit, Color LedColor) Return { - return nvmlUnitSetLedState(Unit, Color) +func (l *library) UnitSetLedState(unit Unit, color LedColor) Return { + return unit.SetLedState(color) } -func (Unit Unit) SetLedState(Color LedColor) Return { - return UnitSetLedState(Unit, Color) +func (unit nvmlUnit) SetLedState(color LedColor) Return { + return nvmlUnitSetLedState(unit, color) } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go index 2366fb70..bd800771 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go @@ -31,450 +31,450 @@ type VgpuPgpuMetadata struct { } // nvml.VgpuTypeGetClass() -func VgpuTypeGetClass(VgpuTypeId VgpuTypeId) (string, Return) { - var Size uint32 = DEVICE_NAME_BUFFER_SIZE - VgpuTypeClass := make([]byte, DEVICE_NAME_BUFFER_SIZE) - ret := nvmlVgpuTypeGetClass(VgpuTypeId, &VgpuTypeClass[0], &Size) - return string(VgpuTypeClass[:clen(VgpuTypeClass)]), ret +func (l *library) VgpuTypeGetClass(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetClass() } -func (VgpuTypeId VgpuTypeId) GetClass() (string, Return) { - return VgpuTypeGetClass(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetClass() (string, Return) { + var size uint32 = DEVICE_NAME_BUFFER_SIZE + vgpuTypeClass := make([]byte, DEVICE_NAME_BUFFER_SIZE) + ret := nvmlVgpuTypeGetClass(vgpuTypeId, &vgpuTypeClass[0], &size) + return string(vgpuTypeClass[:clen(vgpuTypeClass)]), ret } // nvml.VgpuTypeGetName() -func VgpuTypeGetName(VgpuTypeId VgpuTypeId) (string, Return) { - var Size uint32 = DEVICE_NAME_BUFFER_SIZE - VgpuTypeName := make([]byte, DEVICE_NAME_BUFFER_SIZE) - ret := nvmlVgpuTypeGetName(VgpuTypeId, &VgpuTypeName[0], &Size) - return string(VgpuTypeName[:clen(VgpuTypeName)]), ret +func (l *library) VgpuTypeGetName(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetName() } -func (VgpuTypeId VgpuTypeId) GetName() (string, Return) { - return VgpuTypeGetName(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetName() (string, Return) { + var size uint32 = DEVICE_NAME_BUFFER_SIZE + vgpuTypeName := make([]byte, DEVICE_NAME_BUFFER_SIZE) + ret := nvmlVgpuTypeGetName(vgpuTypeId, &vgpuTypeName[0], &size) + return string(vgpuTypeName[:clen(vgpuTypeName)]), ret } // nvml.VgpuTypeGetGpuInstanceProfileId() -func VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) { - var Size uint32 - ret := nvmlVgpuTypeGetGpuInstanceProfileId(VgpuTypeId, &Size) - return Size, ret +func (l *library) VgpuTypeGetGpuInstanceProfileId(vgpuTypeId VgpuTypeId) (uint32, Return) { + return vgpuTypeId.GetGpuInstanceProfileId() } -func (VgpuTypeId VgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { - return VgpuTypeGetGpuInstanceProfileId(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { + var size uint32 + ret := nvmlVgpuTypeGetGpuInstanceProfileId(vgpuTypeId, &size) + return size, ret } // nvml.VgpuTypeGetDeviceID() -func VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) { - var DeviceID, SubsystemID uint64 - ret := nvmlVgpuTypeGetDeviceID(VgpuTypeId, &DeviceID, &SubsystemID) - return DeviceID, SubsystemID, ret +func (l *library) VgpuTypeGetDeviceID(vgpuTypeId VgpuTypeId) (uint64, uint64, Return) { + return vgpuTypeId.GetDeviceID() } -func (VgpuTypeId VgpuTypeId) GetDeviceID() (uint64, uint64, Return) { - return VgpuTypeGetDeviceID(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetDeviceID() (uint64, uint64, Return) { + var deviceID, subsystemID uint64 + ret := nvmlVgpuTypeGetDeviceID(vgpuTypeId, &deviceID, &subsystemID) + return deviceID, subsystemID, ret } // nvml.VgpuTypeGetFramebufferSize() -func VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) { - var FbSize uint64 - ret := nvmlVgpuTypeGetFramebufferSize(VgpuTypeId, &FbSize) - return FbSize, ret +func (l *library) VgpuTypeGetFramebufferSize(vgpuTypeId VgpuTypeId) (uint64, Return) { + return vgpuTypeId.GetFramebufferSize() } -func (VgpuTypeId VgpuTypeId) GetFramebufferSize() (uint64, Return) { - return VgpuTypeGetFramebufferSize(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetFramebufferSize() (uint64, Return) { + var fbSize uint64 + ret := nvmlVgpuTypeGetFramebufferSize(vgpuTypeId, &fbSize) + return fbSize, ret } // nvml.VgpuTypeGetNumDisplayHeads() -func VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) { - var NumDisplayHeads uint32 - ret := nvmlVgpuTypeGetNumDisplayHeads(VgpuTypeId, &NumDisplayHeads) - return int(NumDisplayHeads), ret +func (l *library) VgpuTypeGetNumDisplayHeads(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetNumDisplayHeads() } -func (VgpuTypeId VgpuTypeId) GetNumDisplayHeads() (int, Return) { - return VgpuTypeGetNumDisplayHeads(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetNumDisplayHeads() (int, Return) { + var numDisplayHeads uint32 + ret := nvmlVgpuTypeGetNumDisplayHeads(vgpuTypeId, &numDisplayHeads) + return int(numDisplayHeads), ret } // nvml.VgpuTypeGetResolution() -func VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) { - var Xdim, Ydim uint32 - ret := nvmlVgpuTypeGetResolution(VgpuTypeId, uint32(DisplayIndex), &Xdim, &Ydim) - return Xdim, Ydim, ret +func (l *library) VgpuTypeGetResolution(vgpuTypeId VgpuTypeId, displayIndex int) (uint32, uint32, Return) { + return vgpuTypeId.GetResolution(displayIndex) } -func (VgpuTypeId VgpuTypeId) GetResolution(DisplayIndex int) (uint32, uint32, Return) { - return VgpuTypeGetResolution(VgpuTypeId, DisplayIndex) +func (vgpuTypeId nvmlVgpuTypeId) GetResolution(displayIndex int) (uint32, uint32, Return) { + var xdim, ydim uint32 + ret := nvmlVgpuTypeGetResolution(vgpuTypeId, uint32(displayIndex), &xdim, &ydim) + return xdim, ydim, ret } // nvml.VgpuTypeGetLicense() -func VgpuTypeGetLicense(VgpuTypeId VgpuTypeId) (string, Return) { - VgpuTypeLicenseString := make([]byte, GRID_LICENSE_BUFFER_SIZE) - ret := nvmlVgpuTypeGetLicense(VgpuTypeId, &VgpuTypeLicenseString[0], GRID_LICENSE_BUFFER_SIZE) - return string(VgpuTypeLicenseString[:clen(VgpuTypeLicenseString)]), ret +func (l *library) VgpuTypeGetLicense(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetLicense() } -func (VgpuTypeId VgpuTypeId) GetLicense() (string, Return) { - return VgpuTypeGetLicense(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetLicense() (string, Return) { + vgpuTypeLicenseString := make([]byte, GRID_LICENSE_BUFFER_SIZE) + ret := nvmlVgpuTypeGetLicense(vgpuTypeId, &vgpuTypeLicenseString[0], GRID_LICENSE_BUFFER_SIZE) + return string(vgpuTypeLicenseString[:clen(vgpuTypeLicenseString)]), ret } // nvml.VgpuTypeGetFrameRateLimit() -func VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) { - var FrameRateLimit uint32 - ret := nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId, &FrameRateLimit) - return FrameRateLimit, ret +func (l *library) VgpuTypeGetFrameRateLimit(vgpuTypeId VgpuTypeId) (uint32, Return) { + return vgpuTypeId.GetFrameRateLimit() } -func (VgpuTypeId VgpuTypeId) GetFrameRateLimit() (uint32, Return) { - return VgpuTypeGetFrameRateLimit(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetFrameRateLimit() (uint32, Return) { + var frameRateLimit uint32 + ret := nvmlVgpuTypeGetFrameRateLimit(vgpuTypeId, &frameRateLimit) + return frameRateLimit, ret } // nvml.VgpuTypeGetMaxInstances() -func VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) { - var VgpuInstanceCount uint32 - ret := nvmlVgpuTypeGetMaxInstances(Device, VgpuTypeId, &VgpuInstanceCount) - return int(VgpuInstanceCount), ret +func (l *library) VgpuTypeGetMaxInstances(device Device, vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstances(device) } -func (Device Device) VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) { - return VgpuTypeGetMaxInstances(Device, VgpuTypeId) +func (device nvmlDevice) VgpuTypeGetMaxInstances(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstances(device) } -func (VgpuTypeId VgpuTypeId) GetMaxInstances(Device Device) (int, Return) { - return VgpuTypeGetMaxInstances(Device, VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetMaxInstances(device Device) (int, Return) { + var vgpuInstanceCount uint32 + ret := nvmlVgpuTypeGetMaxInstances(device.(nvmlDevice), vgpuTypeId, &vgpuInstanceCount) + return int(vgpuInstanceCount), ret } // nvml.VgpuTypeGetMaxInstancesPerVm() -func VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) { - var VgpuInstanceCountPerVm uint32 - ret := nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId, &VgpuInstanceCountPerVm) - return int(VgpuInstanceCountPerVm), ret +func (l *library) VgpuTypeGetMaxInstancesPerVm(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstancesPerVm() } -func (VgpuTypeId VgpuTypeId) GetMaxInstancesPerVm() (int, Return) { - return VgpuTypeGetMaxInstancesPerVm(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetMaxInstancesPerVm() (int, Return) { + var vgpuInstanceCountPerVm uint32 + ret := nvmlVgpuTypeGetMaxInstancesPerVm(vgpuTypeId, &vgpuInstanceCountPerVm) + return int(vgpuInstanceCountPerVm), ret } // nvml.VgpuInstanceGetVmID() -func VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { - var VmIdType VgpuVmIdType - VmId := make([]byte, DEVICE_UUID_BUFFER_SIZE) - ret := nvmlVgpuInstanceGetVmID(VgpuInstance, &VmId[0], DEVICE_UUID_BUFFER_SIZE, &VmIdType) - return string(VmId[:clen(VmId)]), VmIdType, ret +func (l *library) VgpuInstanceGetVmID(vgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { + return vgpuInstance.GetVmID() } -func (VgpuInstance VgpuInstance) GetVmID() (string, VgpuVmIdType, Return) { - return VgpuInstanceGetVmID(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetVmID() (string, VgpuVmIdType, Return) { + var vmIdType VgpuVmIdType + vmId := make([]byte, DEVICE_UUID_BUFFER_SIZE) + ret := nvmlVgpuInstanceGetVmID(vgpuInstance, &vmId[0], DEVICE_UUID_BUFFER_SIZE, &vmIdType) + return string(vmId[:clen(vmId)]), vmIdType, ret } // nvml.VgpuInstanceGetUUID() -func VgpuInstanceGetUUID(VgpuInstance VgpuInstance) (string, Return) { - Uuid := make([]byte, DEVICE_UUID_BUFFER_SIZE) - ret := nvmlVgpuInstanceGetUUID(VgpuInstance, &Uuid[0], DEVICE_UUID_BUFFER_SIZE) - return string(Uuid[:clen(Uuid)]), ret +func (l *library) VgpuInstanceGetUUID(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetUUID() } -func (VgpuInstance VgpuInstance) GetUUID() (string, Return) { - return VgpuInstanceGetUUID(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetUUID() (string, Return) { + uuid := make([]byte, DEVICE_UUID_BUFFER_SIZE) + ret := nvmlVgpuInstanceGetUUID(vgpuInstance, &uuid[0], DEVICE_UUID_BUFFER_SIZE) + return string(uuid[:clen(uuid)]), ret } // nvml.VgpuInstanceGetVmDriverVersion() -func VgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance) (string, Return) { - Version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE) - ret := nvmlVgpuInstanceGetVmDriverVersion(VgpuInstance, &Version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE) - return string(Version[:clen(Version)]), ret +func (l *library) VgpuInstanceGetVmDriverVersion(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetVmDriverVersion() } -func (VgpuInstance VgpuInstance) GetVmDriverVersion() (string, Return) { - return VgpuInstanceGetVmDriverVersion(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetVmDriverVersion() (string, Return) { + version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE) + ret := nvmlVgpuInstanceGetVmDriverVersion(vgpuInstance, &version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE) + return string(version[:clen(version)]), ret } // nvml.VgpuInstanceGetFbUsage() -func VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) { - var FbUsage uint64 - ret := nvmlVgpuInstanceGetFbUsage(VgpuInstance, &FbUsage) - return FbUsage, ret +func (l *library) VgpuInstanceGetFbUsage(vgpuInstance VgpuInstance) (uint64, Return) { + return vgpuInstance.GetFbUsage() } -func (VgpuInstance VgpuInstance) GetFbUsage() (uint64, Return) { - return VgpuInstanceGetFbUsage(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetFbUsage() (uint64, Return) { + var fbUsage uint64 + ret := nvmlVgpuInstanceGetFbUsage(vgpuInstance, &fbUsage) + return fbUsage, ret } // nvml.VgpuInstanceGetLicenseInfo() -func VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { - var LicenseInfo VgpuLicenseInfo - ret := nvmlVgpuInstanceGetLicenseInfo(VgpuInstance, &LicenseInfo) - return LicenseInfo, ret +func (l *library) VgpuInstanceGetLicenseInfo(vgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { + return vgpuInstance.GetLicenseInfo() } -func (VgpuInstance VgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { - return VgpuInstanceGetLicenseInfo(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { + var licenseInfo VgpuLicenseInfo + ret := nvmlVgpuInstanceGetLicenseInfo(vgpuInstance, &licenseInfo) + return licenseInfo, ret } // nvml.VgpuInstanceGetLicenseStatus() -func VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) { - var Licensed uint32 - ret := nvmlVgpuInstanceGetLicenseStatus(VgpuInstance, &Licensed) - return int(Licensed), ret +func (l *library) VgpuInstanceGetLicenseStatus(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetLicenseStatus() } -func (VgpuInstance VgpuInstance) GetLicenseStatus() (int, Return) { - return VgpuInstanceGetLicenseStatus(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetLicenseStatus() (int, Return) { + var licensed uint32 + ret := nvmlVgpuInstanceGetLicenseStatus(vgpuInstance, &licensed) + return int(licensed), ret } // nvml.VgpuInstanceGetType() -func VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) { - var VgpuTypeId VgpuTypeId - ret := nvmlVgpuInstanceGetType(VgpuInstance, &VgpuTypeId) - return VgpuTypeId, ret +func (l *library) VgpuInstanceGetType(vgpuInstance VgpuInstance) (VgpuTypeId, Return) { + return vgpuInstance.GetType() } -func (VgpuInstance VgpuInstance) GetType() (VgpuTypeId, Return) { - return VgpuInstanceGetType(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetType() (VgpuTypeId, Return) { + var vgpuTypeId nvmlVgpuTypeId + ret := nvmlVgpuInstanceGetType(vgpuInstance, &vgpuTypeId) + return vgpuTypeId, ret } // nvml.VgpuInstanceGetFrameRateLimit() -func VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) { - var FrameRateLimit uint32 - ret := nvmlVgpuInstanceGetFrameRateLimit(VgpuInstance, &FrameRateLimit) - return FrameRateLimit, ret +func (l *library) VgpuInstanceGetFrameRateLimit(vgpuInstance VgpuInstance) (uint32, Return) { + return vgpuInstance.GetFrameRateLimit() } -func (VgpuInstance VgpuInstance) GetFrameRateLimit() (uint32, Return) { - return VgpuInstanceGetFrameRateLimit(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetFrameRateLimit() (uint32, Return) { + var frameRateLimit uint32 + ret := nvmlVgpuInstanceGetFrameRateLimit(vgpuInstance, &frameRateLimit) + return frameRateLimit, ret } // nvml.VgpuInstanceGetEccMode() -func VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) { - var EccMode EnableState - ret := nvmlVgpuInstanceGetEccMode(VgpuInstance, &EccMode) - return EccMode, ret +func (l *library) VgpuInstanceGetEccMode(vgpuInstance VgpuInstance) (EnableState, Return) { + return vgpuInstance.GetEccMode() } -func (VgpuInstance VgpuInstance) GetEccMode() (EnableState, Return) { - return VgpuInstanceGetEccMode(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetEccMode() (EnableState, Return) { + var eccMode EnableState + ret := nvmlVgpuInstanceGetEccMode(vgpuInstance, &eccMode) + return eccMode, ret } // nvml.VgpuInstanceGetEncoderCapacity() -func VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) { - var EncoderCapacity uint32 - ret := nvmlVgpuInstanceGetEncoderCapacity(VgpuInstance, &EncoderCapacity) - return int(EncoderCapacity), ret +func (l *library) VgpuInstanceGetEncoderCapacity(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetEncoderCapacity() } -func (VgpuInstance VgpuInstance) GetEncoderCapacity() (int, Return) { - return VgpuInstanceGetEncoderCapacity(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetEncoderCapacity() (int, Return) { + var encoderCapacity uint32 + ret := nvmlVgpuInstanceGetEncoderCapacity(vgpuInstance, &encoderCapacity) + return int(encoderCapacity), ret } // nvml.VgpuInstanceSetEncoderCapacity() -func VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return { - return nvmlVgpuInstanceSetEncoderCapacity(VgpuInstance, uint32(EncoderCapacity)) +func (l *library) VgpuInstanceSetEncoderCapacity(vgpuInstance VgpuInstance, encoderCapacity int) Return { + return vgpuInstance.SetEncoderCapacity(encoderCapacity) } -func (VgpuInstance VgpuInstance) SetEncoderCapacity(EncoderCapacity int) Return { - return VgpuInstanceSetEncoderCapacity(VgpuInstance, EncoderCapacity) +func (vgpuInstance nvmlVgpuInstance) SetEncoderCapacity(encoderCapacity int) Return { + return nvmlVgpuInstanceSetEncoderCapacity(vgpuInstance, uint32(encoderCapacity)) } // nvml.VgpuInstanceGetEncoderStats() -func VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) { - var SessionCount, AverageFps, AverageLatency uint32 - ret := nvmlVgpuInstanceGetEncoderStats(VgpuInstance, &SessionCount, &AverageFps, &AverageLatency) - return int(SessionCount), AverageFps, AverageLatency, ret +func (l *library) VgpuInstanceGetEncoderStats(vgpuInstance VgpuInstance) (int, uint32, uint32, Return) { + return vgpuInstance.GetEncoderStats() } -func (VgpuInstance VgpuInstance) GetEncoderStats() (int, uint32, uint32, Return) { - return VgpuInstanceGetEncoderStats(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetEncoderStats() (int, uint32, uint32, Return) { + var sessionCount, averageFps, averageLatency uint32 + ret := nvmlVgpuInstanceGetEncoderStats(vgpuInstance, &sessionCount, &averageFps, &averageLatency) + return int(sessionCount), averageFps, averageLatency, ret } // nvml.VgpuInstanceGetEncoderSessions() -func VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { - var SessionCount uint32 - var SessionInfo EncoderSessionInfo - ret := nvmlVgpuInstanceGetEncoderSessions(VgpuInstance, &SessionCount, &SessionInfo) - return int(SessionCount), SessionInfo, ret +func (l *library) VgpuInstanceGetEncoderSessions(vgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { + return vgpuInstance.GetEncoderSessions() } -func (VgpuInstance VgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) { - return VgpuInstanceGetEncoderSessions(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) { + var sessionCount uint32 + var sessionInfo EncoderSessionInfo + ret := nvmlVgpuInstanceGetEncoderSessions(vgpuInstance, &sessionCount, &sessionInfo) + return int(sessionCount), sessionInfo, ret } // nvml.VgpuInstanceGetFBCStats() -func VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) { - var FbcStats FBCStats - ret := nvmlVgpuInstanceGetFBCStats(VgpuInstance, &FbcStats) - return FbcStats, ret +func (l *library) VgpuInstanceGetFBCStats(vgpuInstance VgpuInstance) (FBCStats, Return) { + return vgpuInstance.GetFBCStats() } -func (VgpuInstance VgpuInstance) GetFBCStats() (FBCStats, Return) { - return VgpuInstanceGetFBCStats(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetFBCStats() (FBCStats, Return) { + var fbcStats FBCStats + ret := nvmlVgpuInstanceGetFBCStats(vgpuInstance, &fbcStats) + return fbcStats, ret } // nvml.VgpuInstanceGetFBCSessions() -func VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { - var SessionCount uint32 - var SessionInfo FBCSessionInfo - ret := nvmlVgpuInstanceGetFBCSessions(VgpuInstance, &SessionCount, &SessionInfo) - return int(SessionCount), SessionInfo, ret +func (l *library) VgpuInstanceGetFBCSessions(vgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { + return vgpuInstance.GetFBCSessions() } -func (VgpuInstance VgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) { - return VgpuInstanceGetFBCSessions(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) { + var sessionCount uint32 + var sessionInfo FBCSessionInfo + ret := nvmlVgpuInstanceGetFBCSessions(vgpuInstance, &sessionCount, &sessionInfo) + return int(sessionCount), sessionInfo, ret } // nvml.VgpuInstanceGetGpuInstanceId() -func VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) { +func (l *library) VgpuInstanceGetGpuInstanceId(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetGpuInstanceId() +} + +func (vgpuInstance nvmlVgpuInstance) GetGpuInstanceId() (int, Return) { var gpuInstanceId uint32 - ret := nvmlVgpuInstanceGetGpuInstanceId(VgpuInstance, &gpuInstanceId) + ret := nvmlVgpuInstanceGetGpuInstanceId(vgpuInstance, &gpuInstanceId) return int(gpuInstanceId), ret } -func (VgpuInstance VgpuInstance) GetGpuInstanceId() (int, Return) { - return VgpuInstanceGetGpuInstanceId(VgpuInstance) +// nvml.VgpuInstanceGetGpuPciId() +func (l *library) VgpuInstanceGetGpuPciId(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetGpuPciId() } -// nvml.VgpuInstanceGetGpuPciId() -func VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Return) { - var Length uint32 = 1 // Will be reduced upon returning +func (vgpuInstance nvmlVgpuInstance) GetGpuPciId() (string, Return) { + var length uint32 = 1 // Will be reduced upon returning for { - VgpuPciId := make([]byte, Length) - ret := nvmlVgpuInstanceGetGpuPciId(VgpuInstance, &VgpuPciId[0], &Length) + vgpuPciId := make([]byte, length) + ret := nvmlVgpuInstanceGetGpuPciId(vgpuInstance, &vgpuPciId[0], &length) if ret == SUCCESS { - return string(VgpuPciId[:clen(VgpuPciId)]), ret + return string(vgpuPciId[:clen(vgpuPciId)]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return "", ret } - Length *= 2 + length *= 2 } } -func (VgpuInstance VgpuInstance) GetGpuPciId() (string, Return) { - return VgpuInstanceGetGpuPciId(VgpuInstance) +// nvml.VgpuInstanceGetMetadata() +func (l *library) VgpuInstanceGetMetadata(vgpuInstance VgpuInstance) (VgpuMetadata, Return) { + return vgpuInstance.GetMetadata() } -// nvml.VgpuInstanceGetMetadata() -func VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) { - var VgpuMetadata VgpuMetadata - OpaqueDataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata.OpaqueData) - VgpuMetadataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata) - OpaqueDataSize +func (vgpuInstance nvmlVgpuInstance) GetMetadata() (VgpuMetadata, Return) { + var vgpuMetadata VgpuMetadata + opaqueDataSize := unsafe.Sizeof(vgpuMetadata.nvmlVgpuMetadata.OpaqueData) + vgpuMetadataSize := unsafe.Sizeof(vgpuMetadata.nvmlVgpuMetadata) - opaqueDataSize for { - BufferSize := uint32(VgpuMetadataSize + OpaqueDataSize) - Buffer := make([]byte, BufferSize) - nvmlVgpuMetadataPtr := (*nvmlVgpuMetadata)(unsafe.Pointer(&Buffer[0])) - ret := nvmlVgpuInstanceGetMetadata(VgpuInstance, nvmlVgpuMetadataPtr, &BufferSize) + bufferSize := uint32(vgpuMetadataSize + opaqueDataSize) + buffer := make([]byte, bufferSize) + nvmlVgpuMetadataPtr := (*nvmlVgpuMetadata)(unsafe.Pointer(&buffer[0])) + ret := nvmlVgpuInstanceGetMetadata(vgpuInstance, nvmlVgpuMetadataPtr, &bufferSize) if ret == SUCCESS { - VgpuMetadata.nvmlVgpuMetadata = *nvmlVgpuMetadataPtr - VgpuMetadata.OpaqueData = Buffer[VgpuMetadataSize:BufferSize] - return VgpuMetadata, ret + vgpuMetadata.nvmlVgpuMetadata = *nvmlVgpuMetadataPtr + vgpuMetadata.OpaqueData = buffer[vgpuMetadataSize:bufferSize] + return vgpuMetadata, ret } if ret != ERROR_INSUFFICIENT_SIZE { - return VgpuMetadata, ret + return vgpuMetadata, ret } - OpaqueDataSize = 2 * OpaqueDataSize + opaqueDataSize = 2 * opaqueDataSize } } -func (VgpuInstance VgpuInstance) GetMetadata() (VgpuMetadata, Return) { - return VgpuInstanceGetMetadata(VgpuInstance) -} - // nvml.VgpuInstanceGetAccountingMode() -func VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) { - var Mode EnableState - ret := nvmlVgpuInstanceGetAccountingMode(VgpuInstance, &Mode) - return Mode, ret +func (l *library) VgpuInstanceGetAccountingMode(vgpuInstance VgpuInstance) (EnableState, Return) { + return vgpuInstance.GetAccountingMode() } -func (VgpuInstance VgpuInstance) GetAccountingMode() (EnableState, Return) { - return VgpuInstanceGetAccountingMode(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetAccountingMode() (EnableState, Return) { + var mode EnableState + ret := nvmlVgpuInstanceGetAccountingMode(vgpuInstance, &mode) + return mode, ret } // nvml.VgpuInstanceGetAccountingPids() -func VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]int, Return) { - var Count uint32 = 1 // Will be reduced upon returning +func (l *library) VgpuInstanceGetAccountingPids(vgpuInstance VgpuInstance) ([]int, Return) { + return vgpuInstance.GetAccountingPids() +} + +func (vgpuInstance nvmlVgpuInstance) GetAccountingPids() ([]int, Return) { + var count uint32 = 1 // Will be reduced upon returning for { - Pids := make([]uint32, Count) - ret := nvmlVgpuInstanceGetAccountingPids(VgpuInstance, &Count, &Pids[0]) + pids := make([]uint32, count) + ret := nvmlVgpuInstanceGetAccountingPids(vgpuInstance, &count, &pids[0]) if ret == SUCCESS { - return uint32SliceToIntSlice(Pids[:Count]), ret + return uint32SliceToIntSlice(pids[:count]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - Count *= 2 + count *= 2 } } -func (VgpuInstance VgpuInstance) GetAccountingPids() ([]int, Return) { - return VgpuInstanceGetAccountingPids(VgpuInstance) -} - // nvml.VgpuInstanceGetAccountingStats() -func VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) { - var Stats AccountingStats - ret := nvmlVgpuInstanceGetAccountingStats(VgpuInstance, uint32(Pid), &Stats) - return Stats, ret +func (l *library) VgpuInstanceGetAccountingStats(vgpuInstance VgpuInstance, pid int) (AccountingStats, Return) { + return vgpuInstance.GetAccountingStats(pid) } -func (VgpuInstance VgpuInstance) GetAccountingStats(Pid int) (AccountingStats, Return) { - return VgpuInstanceGetAccountingStats(VgpuInstance, Pid) +func (vgpuInstance nvmlVgpuInstance) GetAccountingStats(pid int) (AccountingStats, Return) { + var stats AccountingStats + ret := nvmlVgpuInstanceGetAccountingStats(vgpuInstance, uint32(pid), &stats) + return stats, ret } // nvml.GetVgpuCompatibility() -func GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { - var CompatibilityInfo VgpuPgpuCompatibility - ret := nvmlGetVgpuCompatibility(nvmlVgpuMetadata, PgpuMetadata, &CompatibilityInfo) - return CompatibilityInfo, ret +func (l *library) GetVgpuCompatibility(vgpuMetadata *VgpuMetadata, pgpuMetadata *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { + var compatibilityInfo VgpuPgpuCompatibility + ret := nvmlGetVgpuCompatibility(&vgpuMetadata.nvmlVgpuMetadata, &pgpuMetadata.nvmlVgpuPgpuMetadata, &compatibilityInfo) + return compatibilityInfo, ret } // nvml.GetVgpuVersion() -func GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) { - var Supported, Current VgpuVersion - ret := nvmlGetVgpuVersion(&Supported, &Current) - return Supported, Current, ret +func (l *library) GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) { + var supported, current VgpuVersion + ret := nvmlGetVgpuVersion(&supported, ¤t) + return supported, current, ret } // nvml.SetVgpuVersion() -func SetVgpuVersion(VgpuVersion *VgpuVersion) Return { - return nvmlSetVgpuVersion(VgpuVersion) +func (l *library) SetVgpuVersion(vgpuVersion *VgpuVersion) Return { + return nvmlSetVgpuVersion(vgpuVersion) } // nvml.VgpuInstanceClearAccountingPids() -func VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return { - return nvmlVgpuInstanceClearAccountingPids(VgpuInstance) +func (l *library) VgpuInstanceClearAccountingPids(vgpuInstance VgpuInstance) Return { + return vgpuInstance.ClearAccountingPids() } -func (VgpuInstance VgpuInstance) ClearAccountingPids() Return { - return VgpuInstanceClearAccountingPids(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) ClearAccountingPids() Return { + return nvmlVgpuInstanceClearAccountingPids(vgpuInstance) } // nvml.VgpuInstanceGetMdevUUID() -func VgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance) (string, Return) { - MdevUuid := make([]byte, DEVICE_UUID_BUFFER_SIZE) - ret := nvmlVgpuInstanceGetMdevUUID(VgpuInstance, &MdevUuid[0], DEVICE_UUID_BUFFER_SIZE) - return string(MdevUuid[:clen(MdevUuid)]), ret +func (l *library) VgpuInstanceGetMdevUUID(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetMdevUUID() } -func (VgpuInstance VgpuInstance) GetMdevUUID() (string, Return) { - return VgpuInstanceGetMdevUUID(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetMdevUUID() (string, Return) { + mdevUUID := make([]byte, DEVICE_UUID_BUFFER_SIZE) + ret := nvmlVgpuInstanceGetMdevUUID(vgpuInstance, &mdevUUID[0], DEVICE_UUID_BUFFER_SIZE) + return string(mdevUUID[:clen(mdevUUID)]), ret } // nvml.VgpuTypeGetCapabilities() -func VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) { - var CapResult uint32 - ret := nvmlVgpuTypeGetCapabilities(VgpuTypeId, Capability, &CapResult) - return (CapResult != 0), ret +func (l *library) VgpuTypeGetCapabilities(vgpuTypeId VgpuTypeId, capability VgpuCapability) (bool, Return) { + return vgpuTypeId.GetCapabilities(capability) } -func (VgpuTypeId VgpuTypeId) GetCapabilities(Capability VgpuCapability) (bool, Return) { - return VgpuTypeGetCapabilities(VgpuTypeId, Capability) +func (vgpuTypeId nvmlVgpuTypeId) GetCapabilities(capability VgpuCapability) (bool, Return) { + var capResult uint32 + ret := nvmlVgpuTypeGetCapabilities(vgpuTypeId, capability, &capResult) + return (capResult != 0), ret } // nvml.GetVgpuDriverCapabilities() -func GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) { - var CapResult uint32 - ret := nvmlGetVgpuDriverCapabilities(Capability, &CapResult) - return (CapResult != 0), ret +func (l *library) GetVgpuDriverCapabilities(capability VgpuDriverCapability) (bool, Return) { + var capResult uint32 + ret := nvmlGetVgpuDriverCapabilities(capability, &capResult) + return (capResult != 0), ret } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go new file mode 100644 index 00000000..9997a275 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go @@ -0,0 +1,919 @@ +/** +# Copyright 2024 NVIDIA CORPORATION +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +**/ + +// Generated Code; DO NOT EDIT. + +package nvml + +// The variables below represent package level methods from the library type. +var ( + ComputeInstanceDestroy = libnvml.ComputeInstanceDestroy + ComputeInstanceGetInfo = libnvml.ComputeInstanceGetInfo + DeviceCcuGetStreamState = libnvml.DeviceCcuGetStreamState + DeviceCcuSetStreamState = libnvml.DeviceCcuSetStreamState + DeviceClearAccountingPids = libnvml.DeviceClearAccountingPids + DeviceClearCpuAffinity = libnvml.DeviceClearCpuAffinity + DeviceClearEccErrorCounts = libnvml.DeviceClearEccErrorCounts + DeviceClearFieldValues = libnvml.DeviceClearFieldValues + DeviceCreateGpuInstance = libnvml.DeviceCreateGpuInstance + DeviceCreateGpuInstanceWithPlacement = libnvml.DeviceCreateGpuInstanceWithPlacement + DeviceDiscoverGpus = libnvml.DeviceDiscoverGpus + DeviceFreezeNvLinkUtilizationCounter = libnvml.DeviceFreezeNvLinkUtilizationCounter + DeviceGetAPIRestriction = libnvml.DeviceGetAPIRestriction + DeviceGetAccountingBufferSize = libnvml.DeviceGetAccountingBufferSize + DeviceGetAccountingMode = libnvml.DeviceGetAccountingMode + DeviceGetAccountingPids = libnvml.DeviceGetAccountingPids + DeviceGetAccountingStats = libnvml.DeviceGetAccountingStats + DeviceGetActiveVgpus = libnvml.DeviceGetActiveVgpus + DeviceGetAdaptiveClockInfoStatus = libnvml.DeviceGetAdaptiveClockInfoStatus + DeviceGetApplicationsClock = libnvml.DeviceGetApplicationsClock + DeviceGetArchitecture = libnvml.DeviceGetArchitecture + DeviceGetAttributes = libnvml.DeviceGetAttributes + DeviceGetAutoBoostedClocksEnabled = libnvml.DeviceGetAutoBoostedClocksEnabled + DeviceGetBAR1MemoryInfo = libnvml.DeviceGetBAR1MemoryInfo + DeviceGetBoardId = libnvml.DeviceGetBoardId + DeviceGetBoardPartNumber = libnvml.DeviceGetBoardPartNumber + DeviceGetBrand = libnvml.DeviceGetBrand + DeviceGetBridgeChipInfo = libnvml.DeviceGetBridgeChipInfo + DeviceGetBusType = libnvml.DeviceGetBusType + DeviceGetClkMonStatus = libnvml.DeviceGetClkMonStatus + DeviceGetClock = libnvml.DeviceGetClock + DeviceGetClockInfo = libnvml.DeviceGetClockInfo + DeviceGetComputeInstanceId = libnvml.DeviceGetComputeInstanceId + DeviceGetComputeMode = libnvml.DeviceGetComputeMode + DeviceGetComputeRunningProcesses = libnvml.DeviceGetComputeRunningProcesses + DeviceGetCount = libnvml.DeviceGetCount + DeviceGetCpuAffinity = libnvml.DeviceGetCpuAffinity + DeviceGetCpuAffinityWithinScope = libnvml.DeviceGetCpuAffinityWithinScope + DeviceGetCreatableVgpus = libnvml.DeviceGetCreatableVgpus + DeviceGetCudaComputeCapability = libnvml.DeviceGetCudaComputeCapability + DeviceGetCurrPcieLinkGeneration = libnvml.DeviceGetCurrPcieLinkGeneration + DeviceGetCurrPcieLinkWidth = libnvml.DeviceGetCurrPcieLinkWidth + DeviceGetCurrentClocksThrottleReasons = libnvml.DeviceGetCurrentClocksThrottleReasons + DeviceGetDecoderUtilization = libnvml.DeviceGetDecoderUtilization + DeviceGetDefaultApplicationsClock = libnvml.DeviceGetDefaultApplicationsClock + DeviceGetDefaultEccMode = libnvml.DeviceGetDefaultEccMode + DeviceGetDetailedEccErrors = libnvml.DeviceGetDetailedEccErrors + DeviceGetDeviceHandleFromMigDeviceHandle = libnvml.DeviceGetDeviceHandleFromMigDeviceHandle + DeviceGetDisplayActive = libnvml.DeviceGetDisplayActive + DeviceGetDisplayMode = libnvml.DeviceGetDisplayMode + DeviceGetDriverModel = libnvml.DeviceGetDriverModel + DeviceGetDynamicPstatesInfo = libnvml.DeviceGetDynamicPstatesInfo + DeviceGetEccMode = libnvml.DeviceGetEccMode + DeviceGetEncoderCapacity = libnvml.DeviceGetEncoderCapacity + DeviceGetEncoderSessions = libnvml.DeviceGetEncoderSessions + DeviceGetEncoderStats = libnvml.DeviceGetEncoderStats + DeviceGetEncoderUtilization = libnvml.DeviceGetEncoderUtilization + DeviceGetEnforcedPowerLimit = libnvml.DeviceGetEnforcedPowerLimit + DeviceGetFBCSessions = libnvml.DeviceGetFBCSessions + DeviceGetFBCStats = libnvml.DeviceGetFBCStats + DeviceGetFanControlPolicy_v2 = libnvml.DeviceGetFanControlPolicy_v2 + DeviceGetFanSpeed = libnvml.DeviceGetFanSpeed + DeviceGetFanSpeed_v2 = libnvml.DeviceGetFanSpeed_v2 + DeviceGetFieldValues = libnvml.DeviceGetFieldValues + DeviceGetGpcClkMinMaxVfOffset = libnvml.DeviceGetGpcClkMinMaxVfOffset + DeviceGetGpcClkVfOffset = libnvml.DeviceGetGpcClkVfOffset + DeviceGetGpuFabricInfo = libnvml.DeviceGetGpuFabricInfo + DeviceGetGpuInstanceById = libnvml.DeviceGetGpuInstanceById + DeviceGetGpuInstanceId = libnvml.DeviceGetGpuInstanceId + DeviceGetGpuInstancePossiblePlacements = libnvml.DeviceGetGpuInstancePossiblePlacements + DeviceGetGpuInstanceProfileInfo = libnvml.DeviceGetGpuInstanceProfileInfo + DeviceGetGpuInstanceProfileInfoV = libnvml.DeviceGetGpuInstanceProfileInfoV + DeviceGetGpuInstanceRemainingCapacity = libnvml.DeviceGetGpuInstanceRemainingCapacity + DeviceGetGpuInstances = libnvml.DeviceGetGpuInstances + DeviceGetGpuMaxPcieLinkGeneration = libnvml.DeviceGetGpuMaxPcieLinkGeneration + DeviceGetGpuOperationMode = libnvml.DeviceGetGpuOperationMode + DeviceGetGraphicsRunningProcesses = libnvml.DeviceGetGraphicsRunningProcesses + DeviceGetGridLicensableFeatures = libnvml.DeviceGetGridLicensableFeatures + DeviceGetGspFirmwareMode = libnvml.DeviceGetGspFirmwareMode + DeviceGetGspFirmwareVersion = libnvml.DeviceGetGspFirmwareVersion + DeviceGetHandleByIndex = libnvml.DeviceGetHandleByIndex + DeviceGetHandleByPciBusId = libnvml.DeviceGetHandleByPciBusId + DeviceGetHandleBySerial = libnvml.DeviceGetHandleBySerial + DeviceGetHandleByUUID = libnvml.DeviceGetHandleByUUID + DeviceGetHostVgpuMode = libnvml.DeviceGetHostVgpuMode + DeviceGetIndex = libnvml.DeviceGetIndex + DeviceGetInforomConfigurationChecksum = libnvml.DeviceGetInforomConfigurationChecksum + DeviceGetInforomImageVersion = libnvml.DeviceGetInforomImageVersion + DeviceGetInforomVersion = libnvml.DeviceGetInforomVersion + DeviceGetIrqNum = libnvml.DeviceGetIrqNum + DeviceGetMPSComputeRunningProcesses = libnvml.DeviceGetMPSComputeRunningProcesses + DeviceGetMaxClockInfo = libnvml.DeviceGetMaxClockInfo + DeviceGetMaxCustomerBoostClock = libnvml.DeviceGetMaxCustomerBoostClock + DeviceGetMaxMigDeviceCount = libnvml.DeviceGetMaxMigDeviceCount + DeviceGetMaxPcieLinkGeneration = libnvml.DeviceGetMaxPcieLinkGeneration + DeviceGetMaxPcieLinkWidth = libnvml.DeviceGetMaxPcieLinkWidth + DeviceGetMemClkMinMaxVfOffset = libnvml.DeviceGetMemClkMinMaxVfOffset + DeviceGetMemClkVfOffset = libnvml.DeviceGetMemClkVfOffset + DeviceGetMemoryAffinity = libnvml.DeviceGetMemoryAffinity + DeviceGetMemoryBusWidth = libnvml.DeviceGetMemoryBusWidth + DeviceGetMemoryErrorCounter = libnvml.DeviceGetMemoryErrorCounter + DeviceGetMemoryInfo = libnvml.DeviceGetMemoryInfo + DeviceGetMemoryInfo_v2 = libnvml.DeviceGetMemoryInfo_v2 + DeviceGetMigDeviceHandleByIndex = libnvml.DeviceGetMigDeviceHandleByIndex + DeviceGetMigMode = libnvml.DeviceGetMigMode + DeviceGetMinMaxClockOfPState = libnvml.DeviceGetMinMaxClockOfPState + DeviceGetMinMaxFanSpeed = libnvml.DeviceGetMinMaxFanSpeed + DeviceGetMinorNumber = libnvml.DeviceGetMinorNumber + DeviceGetMultiGpuBoard = libnvml.DeviceGetMultiGpuBoard + DeviceGetName = libnvml.DeviceGetName + DeviceGetNumFans = libnvml.DeviceGetNumFans + DeviceGetNumGpuCores = libnvml.DeviceGetNumGpuCores + DeviceGetNvLinkCapability = libnvml.DeviceGetNvLinkCapability + DeviceGetNvLinkErrorCounter = libnvml.DeviceGetNvLinkErrorCounter + DeviceGetNvLinkRemoteDeviceType = libnvml.DeviceGetNvLinkRemoteDeviceType + DeviceGetNvLinkRemotePciInfo = libnvml.DeviceGetNvLinkRemotePciInfo + DeviceGetNvLinkState = libnvml.DeviceGetNvLinkState + DeviceGetNvLinkUtilizationControl = libnvml.DeviceGetNvLinkUtilizationControl + DeviceGetNvLinkUtilizationCounter = libnvml.DeviceGetNvLinkUtilizationCounter + DeviceGetNvLinkVersion = libnvml.DeviceGetNvLinkVersion + DeviceGetP2PStatus = libnvml.DeviceGetP2PStatus + DeviceGetPciInfo = libnvml.DeviceGetPciInfo + DeviceGetPcieLinkMaxSpeed = libnvml.DeviceGetPcieLinkMaxSpeed + DeviceGetPcieReplayCounter = libnvml.DeviceGetPcieReplayCounter + DeviceGetPcieSpeed = libnvml.DeviceGetPcieSpeed + DeviceGetPcieThroughput = libnvml.DeviceGetPcieThroughput + DeviceGetPerformanceState = libnvml.DeviceGetPerformanceState + DeviceGetPersistenceMode = libnvml.DeviceGetPersistenceMode + DeviceGetPgpuMetadataString = libnvml.DeviceGetPgpuMetadataString + DeviceGetPowerManagementDefaultLimit = libnvml.DeviceGetPowerManagementDefaultLimit + DeviceGetPowerManagementLimit = libnvml.DeviceGetPowerManagementLimit + DeviceGetPowerManagementLimitConstraints = libnvml.DeviceGetPowerManagementLimitConstraints + DeviceGetPowerManagementMode = libnvml.DeviceGetPowerManagementMode + DeviceGetPowerSource = libnvml.DeviceGetPowerSource + DeviceGetPowerState = libnvml.DeviceGetPowerState + DeviceGetPowerUsage = libnvml.DeviceGetPowerUsage + DeviceGetProcessUtilization = libnvml.DeviceGetProcessUtilization + DeviceGetRemappedRows = libnvml.DeviceGetRemappedRows + DeviceGetRetiredPages = libnvml.DeviceGetRetiredPages + DeviceGetRetiredPagesPendingStatus = libnvml.DeviceGetRetiredPagesPendingStatus + DeviceGetRetiredPages_v2 = libnvml.DeviceGetRetiredPages_v2 + DeviceGetRowRemapperHistogram = libnvml.DeviceGetRowRemapperHistogram + DeviceGetSamples = libnvml.DeviceGetSamples + DeviceGetSerial = libnvml.DeviceGetSerial + DeviceGetSupportedClocksThrottleReasons = libnvml.DeviceGetSupportedClocksThrottleReasons + DeviceGetSupportedEventTypes = libnvml.DeviceGetSupportedEventTypes + DeviceGetSupportedGraphicsClocks = libnvml.DeviceGetSupportedGraphicsClocks + DeviceGetSupportedMemoryClocks = libnvml.DeviceGetSupportedMemoryClocks + DeviceGetSupportedPerformanceStates = libnvml.DeviceGetSupportedPerformanceStates + DeviceGetSupportedVgpus = libnvml.DeviceGetSupportedVgpus + DeviceGetTargetFanSpeed = libnvml.DeviceGetTargetFanSpeed + DeviceGetTemperature = libnvml.DeviceGetTemperature + DeviceGetTemperatureThreshold = libnvml.DeviceGetTemperatureThreshold + DeviceGetThermalSettings = libnvml.DeviceGetThermalSettings + DeviceGetTopologyCommonAncestor = libnvml.DeviceGetTopologyCommonAncestor + DeviceGetTopologyNearestGpus = libnvml.DeviceGetTopologyNearestGpus + DeviceGetTotalEccErrors = libnvml.DeviceGetTotalEccErrors + DeviceGetTotalEnergyConsumption = libnvml.DeviceGetTotalEnergyConsumption + DeviceGetUUID = libnvml.DeviceGetUUID + DeviceGetUtilizationRates = libnvml.DeviceGetUtilizationRates + DeviceGetVbiosVersion = libnvml.DeviceGetVbiosVersion + DeviceGetVgpuCapabilities = libnvml.DeviceGetVgpuCapabilities + DeviceGetVgpuMetadata = libnvml.DeviceGetVgpuMetadata + DeviceGetVgpuProcessUtilization = libnvml.DeviceGetVgpuProcessUtilization + DeviceGetVgpuSchedulerCapabilities = libnvml.DeviceGetVgpuSchedulerCapabilities + DeviceGetVgpuSchedulerLog = libnvml.DeviceGetVgpuSchedulerLog + DeviceGetVgpuSchedulerState = libnvml.DeviceGetVgpuSchedulerState + DeviceGetVgpuUtilization = libnvml.DeviceGetVgpuUtilization + DeviceGetViolationStatus = libnvml.DeviceGetViolationStatus + DeviceGetVirtualizationMode = libnvml.DeviceGetVirtualizationMode + DeviceIsMigDeviceHandle = libnvml.DeviceIsMigDeviceHandle + DeviceModifyDrainState = libnvml.DeviceModifyDrainState + DeviceOnSameBoard = libnvml.DeviceOnSameBoard + DeviceQueryDrainState = libnvml.DeviceQueryDrainState + DeviceRegisterEvents = libnvml.DeviceRegisterEvents + DeviceRemoveGpu = libnvml.DeviceRemoveGpu + DeviceRemoveGpu_v2 = libnvml.DeviceRemoveGpu_v2 + DeviceResetApplicationsClocks = libnvml.DeviceResetApplicationsClocks + DeviceResetGpuLockedClocks = libnvml.DeviceResetGpuLockedClocks + DeviceResetMemoryLockedClocks = libnvml.DeviceResetMemoryLockedClocks + DeviceResetNvLinkErrorCounters = libnvml.DeviceResetNvLinkErrorCounters + DeviceResetNvLinkUtilizationCounter = libnvml.DeviceResetNvLinkUtilizationCounter + DeviceSetAPIRestriction = libnvml.DeviceSetAPIRestriction + DeviceSetAccountingMode = libnvml.DeviceSetAccountingMode + DeviceSetApplicationsClocks = libnvml.DeviceSetApplicationsClocks + DeviceSetAutoBoostedClocksEnabled = libnvml.DeviceSetAutoBoostedClocksEnabled + DeviceSetComputeMode = libnvml.DeviceSetComputeMode + DeviceSetCpuAffinity = libnvml.DeviceSetCpuAffinity + DeviceSetDefaultAutoBoostedClocksEnabled = libnvml.DeviceSetDefaultAutoBoostedClocksEnabled + DeviceSetDefaultFanSpeed_v2 = libnvml.DeviceSetDefaultFanSpeed_v2 + DeviceSetDriverModel = libnvml.DeviceSetDriverModel + DeviceSetEccMode = libnvml.DeviceSetEccMode + DeviceSetFanControlPolicy = libnvml.DeviceSetFanControlPolicy + DeviceSetFanSpeed_v2 = libnvml.DeviceSetFanSpeed_v2 + DeviceSetGpcClkVfOffset = libnvml.DeviceSetGpcClkVfOffset + DeviceSetGpuLockedClocks = libnvml.DeviceSetGpuLockedClocks + DeviceSetGpuOperationMode = libnvml.DeviceSetGpuOperationMode + DeviceSetMemClkVfOffset = libnvml.DeviceSetMemClkVfOffset + DeviceSetMemoryLockedClocks = libnvml.DeviceSetMemoryLockedClocks + DeviceSetMigMode = libnvml.DeviceSetMigMode + DeviceSetNvLinkDeviceLowPowerThreshold = libnvml.DeviceSetNvLinkDeviceLowPowerThreshold + DeviceSetNvLinkUtilizationControl = libnvml.DeviceSetNvLinkUtilizationControl + DeviceSetPersistenceMode = libnvml.DeviceSetPersistenceMode + DeviceSetPowerManagementLimit = libnvml.DeviceSetPowerManagementLimit + DeviceSetTemperatureThreshold = libnvml.DeviceSetTemperatureThreshold + DeviceSetVgpuSchedulerState = libnvml.DeviceSetVgpuSchedulerState + DeviceSetVirtualizationMode = libnvml.DeviceSetVirtualizationMode + DeviceValidateInforom = libnvml.DeviceValidateInforom + ErrorString = libnvml.ErrorString + EventSetCreate = libnvml.EventSetCreate + EventSetFree = libnvml.EventSetFree + EventSetWait = libnvml.EventSetWait + Extensions = libnvml.Extensions + GetExcludedDeviceCount = libnvml.GetExcludedDeviceCount + GetExcludedDeviceInfoByIndex = libnvml.GetExcludedDeviceInfoByIndex + GetVgpuCompatibility = libnvml.GetVgpuCompatibility + GetVgpuDriverCapabilities = libnvml.GetVgpuDriverCapabilities + GetVgpuVersion = libnvml.GetVgpuVersion + GpmMetricsGet = libnvml.GpmMetricsGet + GpmMetricsGetV = libnvml.GpmMetricsGetV + GpmMigSampleGet = libnvml.GpmMigSampleGet + GpmQueryDeviceSupport = libnvml.GpmQueryDeviceSupport + GpmQueryDeviceSupportV = libnvml.GpmQueryDeviceSupportV + GpmSampleAlloc = libnvml.GpmSampleAlloc + GpmSampleFree = libnvml.GpmSampleFree + GpmSampleGet = libnvml.GpmSampleGet + GpuInstanceCreateComputeInstance = libnvml.GpuInstanceCreateComputeInstance + GpuInstanceCreateComputeInstanceWithPlacement = libnvml.GpuInstanceCreateComputeInstanceWithPlacement + GpuInstanceDestroy = libnvml.GpuInstanceDestroy + GpuInstanceGetComputeInstanceById = libnvml.GpuInstanceGetComputeInstanceById + GpuInstanceGetComputeInstancePossiblePlacements = libnvml.GpuInstanceGetComputeInstancePossiblePlacements + GpuInstanceGetComputeInstanceProfileInfo = libnvml.GpuInstanceGetComputeInstanceProfileInfo + GpuInstanceGetComputeInstanceProfileInfoV = libnvml.GpuInstanceGetComputeInstanceProfileInfoV + GpuInstanceGetComputeInstanceRemainingCapacity = libnvml.GpuInstanceGetComputeInstanceRemainingCapacity + GpuInstanceGetComputeInstances = libnvml.GpuInstanceGetComputeInstances + GpuInstanceGetInfo = libnvml.GpuInstanceGetInfo + Init = libnvml.Init + InitWithFlags = libnvml.InitWithFlags + SetVgpuVersion = libnvml.SetVgpuVersion + Shutdown = libnvml.Shutdown + SystemGetCudaDriverVersion = libnvml.SystemGetCudaDriverVersion + SystemGetCudaDriverVersion_v2 = libnvml.SystemGetCudaDriverVersion_v2 + SystemGetDriverVersion = libnvml.SystemGetDriverVersion + SystemGetHicVersion = libnvml.SystemGetHicVersion + SystemGetNVMLVersion = libnvml.SystemGetNVMLVersion + SystemGetProcessName = libnvml.SystemGetProcessName + SystemGetTopologyGpuSet = libnvml.SystemGetTopologyGpuSet + UnitGetCount = libnvml.UnitGetCount + UnitGetDevices = libnvml.UnitGetDevices + UnitGetFanSpeedInfo = libnvml.UnitGetFanSpeedInfo + UnitGetHandleByIndex = libnvml.UnitGetHandleByIndex + UnitGetLedState = libnvml.UnitGetLedState + UnitGetPsuInfo = libnvml.UnitGetPsuInfo + UnitGetTemperature = libnvml.UnitGetTemperature + UnitGetUnitInfo = libnvml.UnitGetUnitInfo + UnitSetLedState = libnvml.UnitSetLedState + VgpuInstanceClearAccountingPids = libnvml.VgpuInstanceClearAccountingPids + VgpuInstanceGetAccountingMode = libnvml.VgpuInstanceGetAccountingMode + VgpuInstanceGetAccountingPids = libnvml.VgpuInstanceGetAccountingPids + VgpuInstanceGetAccountingStats = libnvml.VgpuInstanceGetAccountingStats + VgpuInstanceGetEccMode = libnvml.VgpuInstanceGetEccMode + VgpuInstanceGetEncoderCapacity = libnvml.VgpuInstanceGetEncoderCapacity + VgpuInstanceGetEncoderSessions = libnvml.VgpuInstanceGetEncoderSessions + VgpuInstanceGetEncoderStats = libnvml.VgpuInstanceGetEncoderStats + VgpuInstanceGetFBCSessions = libnvml.VgpuInstanceGetFBCSessions + VgpuInstanceGetFBCStats = libnvml.VgpuInstanceGetFBCStats + VgpuInstanceGetFbUsage = libnvml.VgpuInstanceGetFbUsage + VgpuInstanceGetFrameRateLimit = libnvml.VgpuInstanceGetFrameRateLimit + VgpuInstanceGetGpuInstanceId = libnvml.VgpuInstanceGetGpuInstanceId + VgpuInstanceGetGpuPciId = libnvml.VgpuInstanceGetGpuPciId + VgpuInstanceGetLicenseInfo = libnvml.VgpuInstanceGetLicenseInfo + VgpuInstanceGetLicenseStatus = libnvml.VgpuInstanceGetLicenseStatus + VgpuInstanceGetMdevUUID = libnvml.VgpuInstanceGetMdevUUID + VgpuInstanceGetMetadata = libnvml.VgpuInstanceGetMetadata + VgpuInstanceGetType = libnvml.VgpuInstanceGetType + VgpuInstanceGetUUID = libnvml.VgpuInstanceGetUUID + VgpuInstanceGetVmDriverVersion = libnvml.VgpuInstanceGetVmDriverVersion + VgpuInstanceGetVmID = libnvml.VgpuInstanceGetVmID + VgpuInstanceSetEncoderCapacity = libnvml.VgpuInstanceSetEncoderCapacity + VgpuTypeGetCapabilities = libnvml.VgpuTypeGetCapabilities + VgpuTypeGetClass = libnvml.VgpuTypeGetClass + VgpuTypeGetDeviceID = libnvml.VgpuTypeGetDeviceID + VgpuTypeGetFrameRateLimit = libnvml.VgpuTypeGetFrameRateLimit + VgpuTypeGetFramebufferSize = libnvml.VgpuTypeGetFramebufferSize + VgpuTypeGetGpuInstanceProfileId = libnvml.VgpuTypeGetGpuInstanceProfileId + VgpuTypeGetLicense = libnvml.VgpuTypeGetLicense + VgpuTypeGetMaxInstances = libnvml.VgpuTypeGetMaxInstances + VgpuTypeGetMaxInstancesPerVm = libnvml.VgpuTypeGetMaxInstancesPerVm + VgpuTypeGetName = libnvml.VgpuTypeGetName + VgpuTypeGetNumDisplayHeads = libnvml.VgpuTypeGetNumDisplayHeads + VgpuTypeGetResolution = libnvml.VgpuTypeGetResolution +) + +// Interface represents the interface for the library type. +// +//go:generate moq -out mock/interface.go -pkg mock . Interface:Interface +type Interface interface { + ComputeInstanceDestroy(ComputeInstance) Return + ComputeInstanceGetInfo(ComputeInstance) (ComputeInstanceInfo, Return) + DeviceCcuGetStreamState(Device) (int, Return) + DeviceCcuSetStreamState(Device, int) Return + DeviceClearAccountingPids(Device) Return + DeviceClearCpuAffinity(Device) Return + DeviceClearEccErrorCounts(Device, EccCounterType) Return + DeviceClearFieldValues(Device, []FieldValue) Return + DeviceCreateGpuInstance(Device, *GpuInstanceProfileInfo) (GpuInstance, Return) + DeviceCreateGpuInstanceWithPlacement(Device, *GpuInstanceProfileInfo, *GpuInstancePlacement) (GpuInstance, Return) + DeviceDiscoverGpus() (PciInfo, Return) + DeviceFreezeNvLinkUtilizationCounter(Device, int, int, EnableState) Return + DeviceGetAPIRestriction(Device, RestrictedAPI) (EnableState, Return) + DeviceGetAccountingBufferSize(Device) (int, Return) + DeviceGetAccountingMode(Device) (EnableState, Return) + DeviceGetAccountingPids(Device) ([]int, Return) + DeviceGetAccountingStats(Device, uint32) (AccountingStats, Return) + DeviceGetActiveVgpus(Device) ([]VgpuInstance, Return) + DeviceGetAdaptiveClockInfoStatus(Device) (uint32, Return) + DeviceGetApplicationsClock(Device, ClockType) (uint32, Return) + DeviceGetArchitecture(Device) (DeviceArchitecture, Return) + DeviceGetAttributes(Device) (DeviceAttributes, Return) + DeviceGetAutoBoostedClocksEnabled(Device) (EnableState, EnableState, Return) + DeviceGetBAR1MemoryInfo(Device) (BAR1Memory, Return) + DeviceGetBoardId(Device) (uint32, Return) + DeviceGetBoardPartNumber(Device) (string, Return) + DeviceGetBrand(Device) (BrandType, Return) + DeviceGetBridgeChipInfo(Device) (BridgeChipHierarchy, Return) + DeviceGetBusType(Device) (BusType, Return) + DeviceGetClkMonStatus(Device) (ClkMonStatus, Return) + DeviceGetClock(Device, ClockType, ClockId) (uint32, Return) + DeviceGetClockInfo(Device, ClockType) (uint32, Return) + DeviceGetComputeInstanceId(Device) (int, Return) + DeviceGetComputeMode(Device) (ComputeMode, Return) + DeviceGetComputeRunningProcesses(Device) ([]ProcessInfo, Return) + DeviceGetCount() (int, Return) + DeviceGetCpuAffinity(Device, int) ([]uint, Return) + DeviceGetCpuAffinityWithinScope(Device, int, AffinityScope) ([]uint, Return) + DeviceGetCreatableVgpus(Device) ([]VgpuTypeId, Return) + DeviceGetCudaComputeCapability(Device) (int, int, Return) + DeviceGetCurrPcieLinkGeneration(Device) (int, Return) + DeviceGetCurrPcieLinkWidth(Device) (int, Return) + DeviceGetCurrentClocksThrottleReasons(Device) (uint64, Return) + DeviceGetDecoderUtilization(Device) (uint32, uint32, Return) + DeviceGetDefaultApplicationsClock(Device, ClockType) (uint32, Return) + DeviceGetDefaultEccMode(Device) (EnableState, Return) + DeviceGetDetailedEccErrors(Device, MemoryErrorType, EccCounterType) (EccErrorCounts, Return) + DeviceGetDeviceHandleFromMigDeviceHandle(Device) (Device, Return) + DeviceGetDisplayActive(Device) (EnableState, Return) + DeviceGetDisplayMode(Device) (EnableState, Return) + DeviceGetDriverModel(Device) (DriverModel, DriverModel, Return) + DeviceGetDynamicPstatesInfo(Device) (GpuDynamicPstatesInfo, Return) + DeviceGetEccMode(Device) (EnableState, EnableState, Return) + DeviceGetEncoderCapacity(Device, EncoderType) (int, Return) + DeviceGetEncoderSessions(Device) ([]EncoderSessionInfo, Return) + DeviceGetEncoderStats(Device) (int, uint32, uint32, Return) + DeviceGetEncoderUtilization(Device) (uint32, uint32, Return) + DeviceGetEnforcedPowerLimit(Device) (uint32, Return) + DeviceGetFBCSessions(Device) ([]FBCSessionInfo, Return) + DeviceGetFBCStats(Device) (FBCStats, Return) + DeviceGetFanControlPolicy_v2(Device, int) (FanControlPolicy, Return) + DeviceGetFanSpeed(Device) (uint32, Return) + DeviceGetFanSpeed_v2(Device, int) (uint32, Return) + DeviceGetFieldValues(Device, []FieldValue) Return + DeviceGetGpcClkMinMaxVfOffset(Device) (int, int, Return) + DeviceGetGpcClkVfOffset(Device) (int, Return) + DeviceGetGpuFabricInfo(Device) (GpuFabricInfo, Return) + DeviceGetGpuInstanceById(Device, int) (GpuInstance, Return) + DeviceGetGpuInstanceId(Device) (int, Return) + DeviceGetGpuInstancePossiblePlacements(Device, *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) + DeviceGetGpuInstanceProfileInfo(Device, int) (GpuInstanceProfileInfo, Return) + DeviceGetGpuInstanceProfileInfoV(Device, int) GpuInstanceProfileInfoV + DeviceGetGpuInstanceRemainingCapacity(Device, *GpuInstanceProfileInfo) (int, Return) + DeviceGetGpuInstances(Device, *GpuInstanceProfileInfo) ([]GpuInstance, Return) + DeviceGetGpuMaxPcieLinkGeneration(Device) (int, Return) + DeviceGetGpuOperationMode(Device) (GpuOperationMode, GpuOperationMode, Return) + DeviceGetGraphicsRunningProcesses(Device) ([]ProcessInfo, Return) + DeviceGetGridLicensableFeatures(Device) (GridLicensableFeatures, Return) + DeviceGetGspFirmwareMode(Device) (bool, bool, Return) + DeviceGetGspFirmwareVersion(Device) (string, Return) + DeviceGetHandleByIndex(int) (Device, Return) + DeviceGetHandleByPciBusId(string) (Device, Return) + DeviceGetHandleBySerial(string) (Device, Return) + DeviceGetHandleByUUID(string) (Device, Return) + DeviceGetHostVgpuMode(Device) (HostVgpuMode, Return) + DeviceGetIndex(Device) (int, Return) + DeviceGetInforomConfigurationChecksum(Device) (uint32, Return) + DeviceGetInforomImageVersion(Device) (string, Return) + DeviceGetInforomVersion(Device, InforomObject) (string, Return) + DeviceGetIrqNum(Device) (int, Return) + DeviceGetMPSComputeRunningProcesses(Device) ([]ProcessInfo, Return) + DeviceGetMaxClockInfo(Device, ClockType) (uint32, Return) + DeviceGetMaxCustomerBoostClock(Device, ClockType) (uint32, Return) + DeviceGetMaxMigDeviceCount(Device) (int, Return) + DeviceGetMaxPcieLinkGeneration(Device) (int, Return) + DeviceGetMaxPcieLinkWidth(Device) (int, Return) + DeviceGetMemClkMinMaxVfOffset(Device) (int, int, Return) + DeviceGetMemClkVfOffset(Device) (int, Return) + DeviceGetMemoryAffinity(Device, int, AffinityScope) ([]uint, Return) + DeviceGetMemoryBusWidth(Device) (uint32, Return) + DeviceGetMemoryErrorCounter(Device, MemoryErrorType, EccCounterType, MemoryLocation) (uint64, Return) + DeviceGetMemoryInfo(Device) (Memory, Return) + DeviceGetMemoryInfo_v2(Device) (Memory_v2, Return) + DeviceGetMigDeviceHandleByIndex(Device, int) (Device, Return) + DeviceGetMigMode(Device) (int, int, Return) + DeviceGetMinMaxClockOfPState(Device, ClockType, Pstates) (uint32, uint32, Return) + DeviceGetMinMaxFanSpeed(Device) (int, int, Return) + DeviceGetMinorNumber(Device) (int, Return) + DeviceGetMultiGpuBoard(Device) (int, Return) + DeviceGetName(Device) (string, Return) + DeviceGetNumFans(Device) (int, Return) + DeviceGetNumGpuCores(Device) (int, Return) + DeviceGetNvLinkCapability(Device, int, NvLinkCapability) (uint32, Return) + DeviceGetNvLinkErrorCounter(Device, int, NvLinkErrorCounter) (uint64, Return) + DeviceGetNvLinkRemoteDeviceType(Device, int) (IntNvLinkDeviceType, Return) + DeviceGetNvLinkRemotePciInfo(Device, int) (PciInfo, Return) + DeviceGetNvLinkState(Device, int) (EnableState, Return) + DeviceGetNvLinkUtilizationControl(Device, int, int) (NvLinkUtilizationControl, Return) + DeviceGetNvLinkUtilizationCounter(Device, int, int) (uint64, uint64, Return) + DeviceGetNvLinkVersion(Device, int) (uint32, Return) + DeviceGetP2PStatus(Device, Device, GpuP2PCapsIndex) (GpuP2PStatus, Return) + DeviceGetPciInfo(Device) (PciInfo, Return) + DeviceGetPcieLinkMaxSpeed(Device) (uint32, Return) + DeviceGetPcieReplayCounter(Device) (int, Return) + DeviceGetPcieSpeed(Device) (int, Return) + DeviceGetPcieThroughput(Device, PcieUtilCounter) (uint32, Return) + DeviceGetPerformanceState(Device) (Pstates, Return) + DeviceGetPersistenceMode(Device) (EnableState, Return) + DeviceGetPgpuMetadataString(Device) (string, Return) + DeviceGetPowerManagementDefaultLimit(Device) (uint32, Return) + DeviceGetPowerManagementLimit(Device) (uint32, Return) + DeviceGetPowerManagementLimitConstraints(Device) (uint32, uint32, Return) + DeviceGetPowerManagementMode(Device) (EnableState, Return) + DeviceGetPowerSource(Device) (PowerSource, Return) + DeviceGetPowerState(Device) (Pstates, Return) + DeviceGetPowerUsage(Device) (uint32, Return) + DeviceGetProcessUtilization(Device, uint64) ([]ProcessUtilizationSample, Return) + DeviceGetRemappedRows(Device) (int, int, bool, bool, Return) + DeviceGetRetiredPages(Device, PageRetirementCause) ([]uint64, Return) + DeviceGetRetiredPagesPendingStatus(Device) (EnableState, Return) + DeviceGetRetiredPages_v2(Device, PageRetirementCause) ([]uint64, []uint64, Return) + DeviceGetRowRemapperHistogram(Device) (RowRemapperHistogramValues, Return) + DeviceGetSamples(Device, SamplingType, uint64) (ValueType, []Sample, Return) + DeviceGetSerial(Device) (string, Return) + DeviceGetSupportedClocksThrottleReasons(Device) (uint64, Return) + DeviceGetSupportedEventTypes(Device) (uint64, Return) + DeviceGetSupportedGraphicsClocks(Device, int) (int, uint32, Return) + DeviceGetSupportedMemoryClocks(Device) (int, uint32, Return) + DeviceGetSupportedPerformanceStates(Device) ([]Pstates, Return) + DeviceGetSupportedVgpus(Device) ([]VgpuTypeId, Return) + DeviceGetTargetFanSpeed(Device, int) (int, Return) + DeviceGetTemperature(Device, TemperatureSensors) (uint32, Return) + DeviceGetTemperatureThreshold(Device, TemperatureThresholds) (uint32, Return) + DeviceGetThermalSettings(Device, uint32) (GpuThermalSettings, Return) + DeviceGetTopologyCommonAncestor(Device, Device) (GpuTopologyLevel, Return) + DeviceGetTopologyNearestGpus(Device, GpuTopologyLevel) ([]Device, Return) + DeviceGetTotalEccErrors(Device, MemoryErrorType, EccCounterType) (uint64, Return) + DeviceGetTotalEnergyConsumption(Device) (uint64, Return) + DeviceGetUUID(Device) (string, Return) + DeviceGetUtilizationRates(Device) (Utilization, Return) + DeviceGetVbiosVersion(Device) (string, Return) + DeviceGetVgpuCapabilities(Device, DeviceVgpuCapability) (bool, Return) + DeviceGetVgpuMetadata(Device) (VgpuPgpuMetadata, Return) + DeviceGetVgpuProcessUtilization(Device, uint64) ([]VgpuProcessUtilizationSample, Return) + DeviceGetVgpuSchedulerCapabilities(Device) (VgpuSchedulerCapabilities, Return) + DeviceGetVgpuSchedulerLog(Device) (VgpuSchedulerLog, Return) + DeviceGetVgpuSchedulerState(Device) (VgpuSchedulerGetState, Return) + DeviceGetVgpuUtilization(Device, uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) + DeviceGetViolationStatus(Device, PerfPolicyType) (ViolationTime, Return) + DeviceGetVirtualizationMode(Device) (GpuVirtualizationMode, Return) + DeviceIsMigDeviceHandle(Device) (bool, Return) + DeviceModifyDrainState(*PciInfo, EnableState) Return + DeviceOnSameBoard(Device, Device) (int, Return) + DeviceQueryDrainState(*PciInfo) (EnableState, Return) + DeviceRegisterEvents(Device, uint64, EventSet) Return + DeviceRemoveGpu(*PciInfo) Return + DeviceRemoveGpu_v2(*PciInfo, DetachGpuState, PcieLinkState) Return + DeviceResetApplicationsClocks(Device) Return + DeviceResetGpuLockedClocks(Device) Return + DeviceResetMemoryLockedClocks(Device) Return + DeviceResetNvLinkErrorCounters(Device, int) Return + DeviceResetNvLinkUtilizationCounter(Device, int, int) Return + DeviceSetAPIRestriction(Device, RestrictedAPI, EnableState) Return + DeviceSetAccountingMode(Device, EnableState) Return + DeviceSetApplicationsClocks(Device, uint32, uint32) Return + DeviceSetAutoBoostedClocksEnabled(Device, EnableState) Return + DeviceSetComputeMode(Device, ComputeMode) Return + DeviceSetCpuAffinity(Device) Return + DeviceSetDefaultAutoBoostedClocksEnabled(Device, EnableState, uint32) Return + DeviceSetDefaultFanSpeed_v2(Device, int) Return + DeviceSetDriverModel(Device, DriverModel, uint32) Return + DeviceSetEccMode(Device, EnableState) Return + DeviceSetFanControlPolicy(Device, int, FanControlPolicy) Return + DeviceSetFanSpeed_v2(Device, int, int) Return + DeviceSetGpcClkVfOffset(Device, int) Return + DeviceSetGpuLockedClocks(Device, uint32, uint32) Return + DeviceSetGpuOperationMode(Device, GpuOperationMode) Return + DeviceSetMemClkVfOffset(Device, int) Return + DeviceSetMemoryLockedClocks(Device, uint32, uint32) Return + DeviceSetMigMode(Device, int) (Return, Return) + DeviceSetNvLinkDeviceLowPowerThreshold(Device, *NvLinkPowerThres) Return + DeviceSetNvLinkUtilizationControl(Device, int, int, *NvLinkUtilizationControl, bool) Return + DeviceSetPersistenceMode(Device, EnableState) Return + DeviceSetPowerManagementLimit(Device, uint32) Return + DeviceSetTemperatureThreshold(Device, TemperatureThresholds, int) Return + DeviceSetVgpuSchedulerState(Device, *VgpuSchedulerSetState) Return + DeviceSetVirtualizationMode(Device, GpuVirtualizationMode) Return + DeviceValidateInforom(Device) Return + ErrorString(Return) string + EventSetCreate() (EventSet, Return) + EventSetFree(EventSet) Return + EventSetWait(EventSet, uint32) (EventData, Return) + Extensions() ExtendedInterface + GetExcludedDeviceCount() (int, Return) + GetExcludedDeviceInfoByIndex(int) (ExcludedDeviceInfo, Return) + GetVgpuCompatibility(*VgpuMetadata, *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) + GetVgpuDriverCapabilities(VgpuDriverCapability) (bool, Return) + GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) + GpmMetricsGet(*GpmMetricsGetType) Return + GpmMetricsGetV(*GpmMetricsGetType) GpmMetricsGetVType + GpmMigSampleGet(Device, int, GpmSample) Return + GpmQueryDeviceSupport(Device) (GpmSupport, Return) + GpmQueryDeviceSupportV(Device) GpmSupportV + GpmSampleAlloc() (GpmSample, Return) + GpmSampleFree(GpmSample) Return + GpmSampleGet(Device, GpmSample) Return + GpuInstanceCreateComputeInstance(GpuInstance, *ComputeInstanceProfileInfo) (ComputeInstance, Return) + GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, *ComputeInstanceProfileInfo, *ComputeInstancePlacement) (ComputeInstance, Return) + GpuInstanceDestroy(GpuInstance) Return + GpuInstanceGetComputeInstanceById(GpuInstance, int) (ComputeInstance, Return) + GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) + GpuInstanceGetComputeInstanceProfileInfo(GpuInstance, int, int) (ComputeInstanceProfileInfo, Return) + GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance, int, int) ComputeInstanceProfileInfoV + GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance, *ComputeInstanceProfileInfo) (int, Return) + GpuInstanceGetComputeInstances(GpuInstance, *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) + GpuInstanceGetInfo(GpuInstance) (GpuInstanceInfo, Return) + Init() Return + InitWithFlags(uint32) Return + SetVgpuVersion(*VgpuVersion) Return + Shutdown() Return + SystemGetCudaDriverVersion() (int, Return) + SystemGetCudaDriverVersion_v2() (int, Return) + SystemGetDriverVersion() (string, Return) + SystemGetHicVersion() ([]HwbcEntry, Return) + SystemGetNVMLVersion() (string, Return) + SystemGetProcessName(int) (string, Return) + SystemGetTopologyGpuSet(int) ([]Device, Return) + UnitGetCount() (int, Return) + UnitGetDevices(Unit) ([]Device, Return) + UnitGetFanSpeedInfo(Unit) (UnitFanSpeeds, Return) + UnitGetHandleByIndex(int) (Unit, Return) + UnitGetLedState(Unit) (LedState, Return) + UnitGetPsuInfo(Unit) (PSUInfo, Return) + UnitGetTemperature(Unit, int) (uint32, Return) + UnitGetUnitInfo(Unit) (UnitInfo, Return) + UnitSetLedState(Unit, LedColor) Return + VgpuInstanceClearAccountingPids(VgpuInstance) Return + VgpuInstanceGetAccountingMode(VgpuInstance) (EnableState, Return) + VgpuInstanceGetAccountingPids(VgpuInstance) ([]int, Return) + VgpuInstanceGetAccountingStats(VgpuInstance, int) (AccountingStats, Return) + VgpuInstanceGetEccMode(VgpuInstance) (EnableState, Return) + VgpuInstanceGetEncoderCapacity(VgpuInstance) (int, Return) + VgpuInstanceGetEncoderSessions(VgpuInstance) (int, EncoderSessionInfo, Return) + VgpuInstanceGetEncoderStats(VgpuInstance) (int, uint32, uint32, Return) + VgpuInstanceGetFBCSessions(VgpuInstance) (int, FBCSessionInfo, Return) + VgpuInstanceGetFBCStats(VgpuInstance) (FBCStats, Return) + VgpuInstanceGetFbUsage(VgpuInstance) (uint64, Return) + VgpuInstanceGetFrameRateLimit(VgpuInstance) (uint32, Return) + VgpuInstanceGetGpuInstanceId(VgpuInstance) (int, Return) + VgpuInstanceGetGpuPciId(VgpuInstance) (string, Return) + VgpuInstanceGetLicenseInfo(VgpuInstance) (VgpuLicenseInfo, Return) + VgpuInstanceGetLicenseStatus(VgpuInstance) (int, Return) + VgpuInstanceGetMdevUUID(VgpuInstance) (string, Return) + VgpuInstanceGetMetadata(VgpuInstance) (VgpuMetadata, Return) + VgpuInstanceGetType(VgpuInstance) (VgpuTypeId, Return) + VgpuInstanceGetUUID(VgpuInstance) (string, Return) + VgpuInstanceGetVmDriverVersion(VgpuInstance) (string, Return) + VgpuInstanceGetVmID(VgpuInstance) (string, VgpuVmIdType, Return) + VgpuInstanceSetEncoderCapacity(VgpuInstance, int) Return + VgpuTypeGetCapabilities(VgpuTypeId, VgpuCapability) (bool, Return) + VgpuTypeGetClass(VgpuTypeId) (string, Return) + VgpuTypeGetDeviceID(VgpuTypeId) (uint64, uint64, Return) + VgpuTypeGetFrameRateLimit(VgpuTypeId) (uint32, Return) + VgpuTypeGetFramebufferSize(VgpuTypeId) (uint64, Return) + VgpuTypeGetGpuInstanceProfileId(VgpuTypeId) (uint32, Return) + VgpuTypeGetLicense(VgpuTypeId) (string, Return) + VgpuTypeGetMaxInstances(Device, VgpuTypeId) (int, Return) + VgpuTypeGetMaxInstancesPerVm(VgpuTypeId) (int, Return) + VgpuTypeGetName(VgpuTypeId) (string, Return) + VgpuTypeGetNumDisplayHeads(VgpuTypeId) (int, Return) + VgpuTypeGetResolution(VgpuTypeId, int) (uint32, uint32, Return) +} + +// Device represents the interface for the nvmlDevice type. +// +//go:generate moq -out mock/device.go -pkg mock . Device:Device +type Device interface { + CcuGetStreamState() (int, Return) + CcuSetStreamState(int) Return + ClearAccountingPids() Return + ClearCpuAffinity() Return + ClearEccErrorCounts(EccCounterType) Return + ClearFieldValues([]FieldValue) Return + CreateGpuInstance(*GpuInstanceProfileInfo) (GpuInstance, Return) + CreateGpuInstanceWithPlacement(*GpuInstanceProfileInfo, *GpuInstancePlacement) (GpuInstance, Return) + FreezeNvLinkUtilizationCounter(int, int, EnableState) Return + GetAPIRestriction(RestrictedAPI) (EnableState, Return) + GetAccountingBufferSize() (int, Return) + GetAccountingMode() (EnableState, Return) + GetAccountingPids() ([]int, Return) + GetAccountingStats(uint32) (AccountingStats, Return) + GetActiveVgpus() ([]VgpuInstance, Return) + GetAdaptiveClockInfoStatus() (uint32, Return) + GetApplicationsClock(ClockType) (uint32, Return) + GetArchitecture() (DeviceArchitecture, Return) + GetAttributes() (DeviceAttributes, Return) + GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) + GetBAR1MemoryInfo() (BAR1Memory, Return) + GetBoardId() (uint32, Return) + GetBoardPartNumber() (string, Return) + GetBrand() (BrandType, Return) + GetBridgeChipInfo() (BridgeChipHierarchy, Return) + GetBusType() (BusType, Return) + GetClkMonStatus() (ClkMonStatus, Return) + GetClock(ClockType, ClockId) (uint32, Return) + GetClockInfo(ClockType) (uint32, Return) + GetComputeInstanceId() (int, Return) + GetComputeMode() (ComputeMode, Return) + GetComputeRunningProcesses() ([]ProcessInfo, Return) + GetCpuAffinity(int) ([]uint, Return) + GetCpuAffinityWithinScope(int, AffinityScope) ([]uint, Return) + GetCreatableVgpus() ([]VgpuTypeId, Return) + GetCudaComputeCapability() (int, int, Return) + GetCurrPcieLinkGeneration() (int, Return) + GetCurrPcieLinkWidth() (int, Return) + GetCurrentClocksThrottleReasons() (uint64, Return) + GetDecoderUtilization() (uint32, uint32, Return) + GetDefaultApplicationsClock(ClockType) (uint32, Return) + GetDefaultEccMode() (EnableState, Return) + GetDetailedEccErrors(MemoryErrorType, EccCounterType) (EccErrorCounts, Return) + GetDeviceHandleFromMigDeviceHandle() (Device, Return) + GetDisplayActive() (EnableState, Return) + GetDisplayMode() (EnableState, Return) + GetDriverModel() (DriverModel, DriverModel, Return) + GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) + GetEccMode() (EnableState, EnableState, Return) + GetEncoderCapacity(EncoderType) (int, Return) + GetEncoderSessions() ([]EncoderSessionInfo, Return) + GetEncoderStats() (int, uint32, uint32, Return) + GetEncoderUtilization() (uint32, uint32, Return) + GetEnforcedPowerLimit() (uint32, Return) + GetFBCSessions() ([]FBCSessionInfo, Return) + GetFBCStats() (FBCStats, Return) + GetFanControlPolicy_v2(int) (FanControlPolicy, Return) + GetFanSpeed() (uint32, Return) + GetFanSpeed_v2(int) (uint32, Return) + GetFieldValues([]FieldValue) Return + GetGpcClkMinMaxVfOffset() (int, int, Return) + GetGpcClkVfOffset() (int, Return) + GetGpuFabricInfo() (GpuFabricInfo, Return) + GetGpuInstanceById(int) (GpuInstance, Return) + GetGpuInstanceId() (int, Return) + GetGpuInstancePossiblePlacements(*GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) + GetGpuInstanceProfileInfo(int) (GpuInstanceProfileInfo, Return) + GetGpuInstanceProfileInfoV(int) GpuInstanceProfileInfoV + GetGpuInstanceRemainingCapacity(*GpuInstanceProfileInfo) (int, Return) + GetGpuInstances(*GpuInstanceProfileInfo) ([]GpuInstance, Return) + GetGpuMaxPcieLinkGeneration() (int, Return) + GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) + GetGraphicsRunningProcesses() ([]ProcessInfo, Return) + GetGridLicensableFeatures() (GridLicensableFeatures, Return) + GetGspFirmwareMode() (bool, bool, Return) + GetGspFirmwareVersion() (string, Return) + GetHostVgpuMode() (HostVgpuMode, Return) + GetIndex() (int, Return) + GetInforomConfigurationChecksum() (uint32, Return) + GetInforomImageVersion() (string, Return) + GetInforomVersion(InforomObject) (string, Return) + GetIrqNum() (int, Return) + GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) + GetMaxClockInfo(ClockType) (uint32, Return) + GetMaxCustomerBoostClock(ClockType) (uint32, Return) + GetMaxMigDeviceCount() (int, Return) + GetMaxPcieLinkGeneration() (int, Return) + GetMaxPcieLinkWidth() (int, Return) + GetMemClkMinMaxVfOffset() (int, int, Return) + GetMemClkVfOffset() (int, Return) + GetMemoryAffinity(int, AffinityScope) ([]uint, Return) + GetMemoryBusWidth() (uint32, Return) + GetMemoryErrorCounter(MemoryErrorType, EccCounterType, MemoryLocation) (uint64, Return) + GetMemoryInfo() (Memory, Return) + GetMemoryInfo_v2() (Memory_v2, Return) + GetMigDeviceHandleByIndex(int) (Device, Return) + GetMigMode() (int, int, Return) + GetMinMaxClockOfPState(ClockType, Pstates) (uint32, uint32, Return) + GetMinMaxFanSpeed() (int, int, Return) + GetMinorNumber() (int, Return) + GetMultiGpuBoard() (int, Return) + GetName() (string, Return) + GetNumFans() (int, Return) + GetNumGpuCores() (int, Return) + GetNvLinkCapability(int, NvLinkCapability) (uint32, Return) + GetNvLinkErrorCounter(int, NvLinkErrorCounter) (uint64, Return) + GetNvLinkRemoteDeviceType(int) (IntNvLinkDeviceType, Return) + GetNvLinkRemotePciInfo(int) (PciInfo, Return) + GetNvLinkState(int) (EnableState, Return) + GetNvLinkUtilizationControl(int, int) (NvLinkUtilizationControl, Return) + GetNvLinkUtilizationCounter(int, int) (uint64, uint64, Return) + GetNvLinkVersion(int) (uint32, Return) + GetP2PStatus(Device, GpuP2PCapsIndex) (GpuP2PStatus, Return) + GetPciInfo() (PciInfo, Return) + GetPcieLinkMaxSpeed() (uint32, Return) + GetPcieReplayCounter() (int, Return) + GetPcieSpeed() (int, Return) + GetPcieThroughput(PcieUtilCounter) (uint32, Return) + GetPerformanceState() (Pstates, Return) + GetPersistenceMode() (EnableState, Return) + GetPgpuMetadataString() (string, Return) + GetPowerManagementDefaultLimit() (uint32, Return) + GetPowerManagementLimit() (uint32, Return) + GetPowerManagementLimitConstraints() (uint32, uint32, Return) + GetPowerManagementMode() (EnableState, Return) + GetPowerSource() (PowerSource, Return) + GetPowerState() (Pstates, Return) + GetPowerUsage() (uint32, Return) + GetProcessUtilization(uint64) ([]ProcessUtilizationSample, Return) + GetRemappedRows() (int, int, bool, bool, Return) + GetRetiredPages(PageRetirementCause) ([]uint64, Return) + GetRetiredPagesPendingStatus() (EnableState, Return) + GetRetiredPages_v2(PageRetirementCause) ([]uint64, []uint64, Return) + GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) + GetSamples(SamplingType, uint64) (ValueType, []Sample, Return) + GetSerial() (string, Return) + GetSupportedClocksThrottleReasons() (uint64, Return) + GetSupportedEventTypes() (uint64, Return) + GetSupportedGraphicsClocks(int) (int, uint32, Return) + GetSupportedMemoryClocks() (int, uint32, Return) + GetSupportedPerformanceStates() ([]Pstates, Return) + GetSupportedVgpus() ([]VgpuTypeId, Return) + GetTargetFanSpeed(int) (int, Return) + GetTemperature(TemperatureSensors) (uint32, Return) + GetTemperatureThreshold(TemperatureThresholds) (uint32, Return) + GetThermalSettings(uint32) (GpuThermalSettings, Return) + GetTopologyCommonAncestor(Device) (GpuTopologyLevel, Return) + GetTopologyNearestGpus(GpuTopologyLevel) ([]Device, Return) + GetTotalEccErrors(MemoryErrorType, EccCounterType) (uint64, Return) + GetTotalEnergyConsumption() (uint64, Return) + GetUUID() (string, Return) + GetUtilizationRates() (Utilization, Return) + GetVbiosVersion() (string, Return) + GetVgpuCapabilities(DeviceVgpuCapability) (bool, Return) + GetVgpuMetadata() (VgpuPgpuMetadata, Return) + GetVgpuProcessUtilization(uint64) ([]VgpuProcessUtilizationSample, Return) + GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) + GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) + GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) + GetVgpuUtilization(uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) + GetViolationStatus(PerfPolicyType) (ViolationTime, Return) + GetVirtualizationMode() (GpuVirtualizationMode, Return) + GpmMigSampleGet(int, GpmSample) Return + GpmQueryDeviceSupport() (GpmSupport, Return) + GpmQueryDeviceSupportV() GpmSupportV + GpmSampleGet(GpmSample) Return + IsMigDeviceHandle() (bool, Return) + OnSameBoard(Device) (int, Return) + RegisterEvents(uint64, EventSet) Return + ResetApplicationsClocks() Return + ResetGpuLockedClocks() Return + ResetMemoryLockedClocks() Return + ResetNvLinkErrorCounters(int) Return + ResetNvLinkUtilizationCounter(int, int) Return + SetAPIRestriction(RestrictedAPI, EnableState) Return + SetAccountingMode(EnableState) Return + SetApplicationsClocks(uint32, uint32) Return + SetAutoBoostedClocksEnabled(EnableState) Return + SetComputeMode(ComputeMode) Return + SetCpuAffinity() Return + SetDefaultAutoBoostedClocksEnabled(EnableState, uint32) Return + SetDefaultFanSpeed_v2(int) Return + SetDriverModel(DriverModel, uint32) Return + SetEccMode(EnableState) Return + SetFanControlPolicy(int, FanControlPolicy) Return + SetFanSpeed_v2(int, int) Return + SetGpcClkVfOffset(int) Return + SetGpuLockedClocks(uint32, uint32) Return + SetGpuOperationMode(GpuOperationMode) Return + SetMemClkVfOffset(int) Return + SetMemoryLockedClocks(uint32, uint32) Return + SetMigMode(int) (Return, Return) + SetNvLinkDeviceLowPowerThreshold(*NvLinkPowerThres) Return + SetNvLinkUtilizationControl(int, int, *NvLinkUtilizationControl, bool) Return + SetPersistenceMode(EnableState) Return + SetPowerManagementLimit(uint32) Return + SetTemperatureThreshold(TemperatureThresholds, int) Return + SetVgpuSchedulerState(*VgpuSchedulerSetState) Return + SetVirtualizationMode(GpuVirtualizationMode) Return + ValidateInforom() Return + VgpuTypeGetMaxInstances(VgpuTypeId) (int, Return) +} + +// GpuInstance represents the interface for the nvmlGpuInstance type. +// +//go:generate moq -out mock/gpuinstance.go -pkg mock . GpuInstance:GpuInstance +type GpuInstance interface { + CreateComputeInstance(*ComputeInstanceProfileInfo) (ComputeInstance, Return) + CreateComputeInstanceWithPlacement(*ComputeInstanceProfileInfo, *ComputeInstancePlacement) (ComputeInstance, Return) + Destroy() Return + GetComputeInstanceById(int) (ComputeInstance, Return) + GetComputeInstancePossiblePlacements(*ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) + GetComputeInstanceProfileInfo(int, int) (ComputeInstanceProfileInfo, Return) + GetComputeInstanceProfileInfoV(int, int) ComputeInstanceProfileInfoV + GetComputeInstanceRemainingCapacity(*ComputeInstanceProfileInfo) (int, Return) + GetComputeInstances(*ComputeInstanceProfileInfo) ([]ComputeInstance, Return) + GetInfo() (GpuInstanceInfo, Return) +} + +// ComputeInstance represents the interface for the nvmlComputeInstance type. +// +//go:generate moq -out mock/computeinstance.go -pkg mock . ComputeInstance:ComputeInstance +type ComputeInstance interface { + Destroy() Return + GetInfo() (ComputeInstanceInfo, Return) +} + +// EventSet represents the interface for the nvmlEventSet type. +// +//go:generate moq -out mock/eventset.go -pkg mock . EventSet:EventSet +type EventSet interface { + Free() Return + Wait(uint32) (EventData, Return) +} + +// GpmSample represents the interface for the nvmlGpmSample type. +// +//go:generate moq -out mock/gpmsample.go -pkg mock . GpmSample:GpmSample +type GpmSample interface { + Free() Return + Get(Device) Return + MigGet(Device, int) Return +} + +// Unit represents the interface for the nvmlUnit type. +// +//go:generate moq -out mock/unit.go -pkg mock . Unit:Unit +type Unit interface { + GetDevices() ([]Device, Return) + GetFanSpeedInfo() (UnitFanSpeeds, Return) + GetLedState() (LedState, Return) + GetPsuInfo() (PSUInfo, Return) + GetTemperature(int) (uint32, Return) + GetUnitInfo() (UnitInfo, Return) + SetLedState(LedColor) Return +} + +// VgpuInstance represents the interface for the nvmlVgpuInstance type. +// +//go:generate moq -out mock/vgpuinstance.go -pkg mock . VgpuInstance:VgpuInstance +type VgpuInstance interface { + ClearAccountingPids() Return + GetAccountingMode() (EnableState, Return) + GetAccountingPids() ([]int, Return) + GetAccountingStats(int) (AccountingStats, Return) + GetEccMode() (EnableState, Return) + GetEncoderCapacity() (int, Return) + GetEncoderSessions() (int, EncoderSessionInfo, Return) + GetEncoderStats() (int, uint32, uint32, Return) + GetFBCSessions() (int, FBCSessionInfo, Return) + GetFBCStats() (FBCStats, Return) + GetFbUsage() (uint64, Return) + GetFrameRateLimit() (uint32, Return) + GetGpuInstanceId() (int, Return) + GetGpuPciId() (string, Return) + GetLicenseInfo() (VgpuLicenseInfo, Return) + GetLicenseStatus() (int, Return) + GetMdevUUID() (string, Return) + GetMetadata() (VgpuMetadata, Return) + GetType() (VgpuTypeId, Return) + GetUUID() (string, Return) + GetVmDriverVersion() (string, Return) + GetVmID() (string, VgpuVmIdType, Return) + SetEncoderCapacity(int) Return +} + +// VgpuTypeId represents the interface for the nvmlVgpuTypeId type. +// +//go:generate moq -out mock/vgputypeid.go -pkg mock . VgpuTypeId:VgpuTypeId +type VgpuTypeId interface { + GetCapabilities(VgpuCapability) (bool, Return) + GetClass() (string, Return) + GetDeviceID() (uint64, uint64, Return) + GetFrameRateLimit() (uint32, Return) + GetFramebufferSize() (uint64, Return) + GetGpuInstanceProfileId() (uint32, Return) + GetLicense() (string, Return) + GetMaxInstances(Device) (int, Return) + GetMaxInstancesPerVm() (int, Return) + GetName() (string, Return) + GetNumDisplayHeads() (int, Return) + GetResolution(int) (uint32, uint32, Return) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 72ac577d..c8f536be 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -6,7 +6,7 @@ github.com/NVIDIA/go-nvlib/pkg/nvpci github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio github.com/NVIDIA/go-nvlib/pkg/pciids -# github.com/NVIDIA/go-nvml v0.12.0-3 +# github.com/NVIDIA/go-nvml v0.12.0-4 ## explicit; go 1.20 github.com/NVIDIA/go-nvml/pkg/dl github.com/NVIDIA/go-nvml/pkg/nvml