From 41bb0c0208172464c43bce517416267fadbdb270 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Tue, 9 Apr 2024 14:22:21 +0000 Subject: [PATCH 01/21] Add new API call for New() Signed-off-by: Kevin Klues --- pkg/nvml/lib.go | 50 ++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/pkg/nvml/lib.go b/pkg/nvml/lib.go index 09efb1e..054f070 100644 --- a/pkg/nvml/lib.go +++ b/pkg/nvml/lib.go @@ -44,14 +44,37 @@ type library struct { } // libnvml is a global instance of the nvml library. -var libnvml = library{ - path: defaultNvmlLibraryName, - dl: dl.New(defaultNvmlLibraryName, defaultNvmlLibraryLoadFlags), -} +var libnvml = newLibrary() var _ Interface = (*library)(nil) -// GetLibrary returns a the library as a Library interface. +func New(opts ...LibraryOption) Interface { + return newLibrary(opts...) +} + +func newLibrary(opts ...LibraryOption) *library { + l := &library{} + l.init(opts...) + return l +} + +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) +} + func (l *library) GetLibrary() Library { return l } @@ -279,21 +302,6 @@ func SetLibraryOptions(opts ...LibraryOption) error { if libnvml.refcount != 0 { return errLibraryAlreadyLoaded } - - o := libraryOptions{} - for _, opt := range opts { - opt(&o) - } - - if o.path == "" { - o.path = defaultNvmlLibraryName - } - if o.flags == 0 { - o.flags = defaultNvmlLibraryLoadFlags - } - - libnvml.path = o.path - libnvml.dl = dl.New(o.path, o.flags) - + libnvml.init(opts...) return nil } From 21c88e26cf69b4b47d7c36e8ca3884c973163d01 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Tue, 9 Apr 2024 14:33:19 +0000 Subject: [PATCH 02/21] Rearrange where some types / funcs are defined Signed-off-by: Kevin Klues --- pkg/nvml/api.go | 37 ++++++++++++++++++++++++++++++------- pkg/nvml/lib.go | 47 ++++++++++++----------------------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 4885e8e..7cc3150 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -16,19 +16,42 @@ package nvml +// 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) + // Library defines a set of functions defined on the underlying dynamic library. type Library interface { Lookup(string) error } -// dynamicLibrary is an interface for abstacting the underlying library. -// This also allows for mocking and testing. +// GetLibrary returns a representation of the underlying library that implements the Library interface. +func GetLibrary() Library { + return libnvml.GetLibrary() +} -//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 + } +} + +// 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 } // Interface represents the interface for the NVML library. diff --git a/pkg/nvml/lib.go b/pkg/nvml/lib.go index 054f070..3b973ca 100644 --- a/pkg/nvml/lib.go +++ b/pkg/nvml/lib.go @@ -34,6 +34,16 @@ 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 { @@ -43,11 +53,11 @@ type library struct { dl dynamicLibrary } +var _ Interface = (*library)(nil) + // libnvml is a global instance of the nvml library. var libnvml = newLibrary() -var _ Interface = (*library)(nil) - func New(opts ...LibraryOption) Interface { return newLibrary(opts...) } @@ -79,11 +89,6 @@ func (l *library) GetLibrary() Library { return l } -// GetLibrary returns a representation of the underlying library that implements the Library interface. -func GetLibrary() Library { - return libnvml.GetLibrary() -} - // Lookup 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 { @@ -277,31 +282,3 @@ func (l *library) updateVersionedSymbols() { nvmlVgpuInstanceGetLicenseInfo = nvmlVgpuInstanceGetLicenseInfo_v2 } } - -// 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) - -// 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 - } -} - -// 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.refcount != 0 { - return errLibraryAlreadyLoaded - } - libnvml.init(opts...) - return nil -} From 982d869563a384da5fe182adf271e63ef64ab9be Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Tue, 9 Apr 2024 18:36:02 +0000 Subject: [PATCH 03/21] Add an interface to define all methods in the NVML API As part of this, redefine all package level methods as methods hanging off of the 'library' type and create aliases for all package level methods to those methods hanging off of the default 'libnvml' instance of the 'library' type. Signed-off-by: Kevin Klues --- pkg/nvml/api.go | 597 +++++++++++++++++++++++++++++++++++++++++- pkg/nvml/device.go | 446 ++++++++++++++++--------------- pkg/nvml/event_set.go | 6 +- pkg/nvml/gpm.go | 17 +- pkg/nvml/init.go | 6 +- pkg/nvml/lib.go | 18 +- pkg/nvml/return.go | 4 +- pkg/nvml/system.go | 14 +- pkg/nvml/unit.go | 18 +- pkg/nvml/vgpu.go | 78 +++--- 10 files changed, 900 insertions(+), 304 deletions(-) diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 7cc3150..f848fe8 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -30,11 +30,6 @@ type Library interface { Lookup(string) error } -// GetLibrary returns a representation of the underlying library that implements the Library interface. -func GetLibrary() Library { - return libnvml.GetLibrary() -} - // 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) { @@ -54,7 +49,597 @@ func SetLibraryOptions(opts ...LibraryOption) error { return nil } -// Interface represents the interface for the NVML library. +// Interface represents the interface for the top-level NVML library. type Interface interface { + // Library API GetLibrary() Library + // Init API + Init() Return + InitWithFlags(Flags uint32) Return + Shutdown() Return + ErrorString(r Return) string + // System API + SystemGetDriverVersion() (string, Return) + SystemGetNVMLVersion() (string, Return) + SystemGetCudaDriverVersion() (int, Return) + SystemGetCudaDriverVersion_v2() (int, Return) + SystemGetProcessName(Pid int) (string, Return) + SystemGetHicVersion() ([]HwbcEntry, Return) + SystemGetTopologyGpuSet(CpuNumber int) ([]Device, Return) + // Device API + DeviceGetCount() (int, Return) + DeviceGetHandleByIndex(Index int) (Device, Return) + DeviceGetHandleBySerial(Serial string) (Device, Return) + DeviceGetHandleByUUID(Uuid string) (Device, Return) + DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) + DeviceGetName(Device Device) (string, Return) + DeviceGetBrand(Device Device) (BrandType, Return) + DeviceGetIndex(Device Device) (int, Return) + DeviceGetSerial(Device Device) (string, Return) + DeviceGetCpuAffinity(Device Device, NumCPUs int) ([]uint, Return) + DeviceSetCpuAffinity(Device Device) Return + DeviceClearCpuAffinity(Device Device) Return + DeviceGetMemoryAffinity(Device Device, NumNodes int, Scope AffinityScope) ([]uint, Return) + DeviceGetCpuAffinityWithinScope(Device Device, NumCPUs int, Scope AffinityScope) ([]uint, Return) + DeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device) (GpuTopologyLevel, Return) + DeviceGetTopologyNearestGpus(device Device, Level GpuTopologyLevel) ([]Device, Return) + DeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) + DeviceGetUUID(Device Device) (string, Return) + DeviceGetMinorNumber(Device Device) (int, Return) + DeviceGetBoardPartNumber(Device Device) (string, Return) + DeviceGetInforomVersion(Device Device, Object InforomObject) (string, Return) + DeviceGetInforomImageVersion(Device Device) (string, Return) + DeviceGetInforomConfigurationChecksum(Device Device) (uint32, Return) + DeviceValidateInforom(Device Device) Return + DeviceGetDisplayMode(Device Device) (EnableState, Return) + DeviceGetDisplayActive(Device Device) (EnableState, Return) + DeviceGetPersistenceMode(Device Device) (EnableState, Return) + DeviceGetPciInfo(Device Device) (PciInfo, Return) + DeviceGetMaxPcieLinkGeneration(Device Device) (int, Return) + DeviceGetMaxPcieLinkWidth(Device Device) (int, Return) + DeviceGetCurrPcieLinkGeneration(Device Device) (int, Return) + DeviceGetCurrPcieLinkWidth(Device Device) (int, Return) + DeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter) (uint32, Return) + DeviceGetPcieReplayCounter(Device Device) (int, Return) + DeviceGetClockInfo(Device Device, _type ClockType) (uint32, Return) + DeviceGetMaxClockInfo(Device Device, _type ClockType) (uint32, Return) + DeviceGetApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) + DeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) + DeviceResetApplicationsClocks(Device Device) Return + DeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId) (uint32, Return) + DeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType) (uint32, Return) + DeviceGetSupportedMemoryClocks(Device Device) (int, uint32, Return) + DeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz int) (int, uint32, Return) + DeviceGetAutoBoostedClocksEnabled(Device Device) (EnableState, EnableState, Return) + DeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return + DeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return + DeviceGetFanSpeed(Device Device) (uint32, Return) + DeviceGetFanSpeed_v2(Device Device, Fan int) (uint32, Return) + DeviceGetNumFans(Device Device) (int, Return) + DeviceGetTemperature(Device Device, SensorType TemperatureSensors) (uint32, Return) + DeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds) (uint32, Return) + DeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp int) Return + DeviceGetPerformanceState(Device Device) (Pstates, Return) + DeviceGetCurrentClocksThrottleReasons(Device Device) (uint64, Return) + DeviceGetSupportedClocksThrottleReasons(Device Device) (uint64, Return) + DeviceGetPowerState(Device Device) (Pstates, Return) + DeviceGetPowerManagementMode(Device Device) (EnableState, Return) + DeviceGetPowerManagementLimit(Device Device) (uint32, Return) + DeviceGetPowerManagementLimitConstraints(Device Device) (uint32, uint32, Return) + DeviceGetPowerManagementDefaultLimit(Device Device) (uint32, Return) + DeviceGetPowerUsage(Device Device) (uint32, Return) + DeviceGetTotalEnergyConsumption(Device Device) (uint64, Return) + DeviceGetEnforcedPowerLimit(Device Device) (uint32, Return) + DeviceGetGpuOperationMode(Device Device) (GpuOperationMode, GpuOperationMode, Return) + DeviceGetMemoryInfo(Device Device) (Memory, Return) + DeviceGetMemoryInfo_v2(Device Device) (Memory_v2, Return) + DeviceGetComputeMode(Device Device) (ComputeMode, Return) + DeviceGetCudaComputeCapability(Device Device) (int, int, Return) + DeviceGetEccMode(Device Device) (EnableState, EnableState, Return) + DeviceGetBoardId(Device Device) (uint32, Return) + DeviceGetMultiGpuBoard(Device Device) (int, Return) + DeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) + DeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) + DeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) + DeviceGetUtilizationRates(Device Device) (Utilization, Return) + DeviceGetEncoderUtilization(Device Device) (uint32, uint32, Return) + DeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType) (int, Return) + DeviceGetEncoderStats(Device Device) (int, uint32, uint32, Return) + DeviceGetEncoderSessions(Device Device) ([]EncoderSessionInfo, Return) + DeviceGetDecoderUtilization(Device Device) (uint32, uint32, Return) + DeviceGetFBCStats(Device Device) (FBCStats, Return) + DeviceGetFBCSessions(Device Device) ([]FBCSessionInfo, Return) + DeviceGetDriverModel(Device Device) (DriverModel, DriverModel, Return) + DeviceGetVbiosVersion(Device Device) (string, Return) + DeviceGetBridgeChipInfo(Device Device) (BridgeChipHierarchy, Return) + DeviceOnSameBoard(Device1 Device, Device2 Device) (int, Return) + DeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI) (EnableState, Return) + DeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) + DeviceGetBAR1MemoryInfo(Device Device) (BAR1Memory, Return) + DeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType) (ViolationTime, Return) + DeviceGetIrqNum(Device Device) (int, Return) + DeviceGetNumGpuCores(Device Device) (int, Return) + DeviceGetPowerSource(Device Device) (PowerSource, Return) + DeviceGetMemoryBusWidth(Device Device) (uint32, Return) + DeviceGetPcieLinkMaxSpeed(Device Device) (uint32, Return) + DeviceGetAdaptiveClockInfoStatus(Device Device) (uint32, Return) + DeviceGetAccountingMode(Device Device) (EnableState, Return) + DeviceGetAccountingStats(Device Device, Pid uint32) (AccountingStats, Return) + DeviceGetAccountingPids(Device Device) ([]int, Return) + DeviceGetAccountingBufferSize(Device Device) (int, Return) + DeviceGetRetiredPages(Device Device, Cause PageRetirementCause) ([]uint64, Return) + DeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause) ([]uint64, []uint64, Return) + DeviceGetRetiredPagesPendingStatus(Device Device) (EnableState, Return) + DeviceSetPersistenceMode(Device Device, Mode EnableState) Return + DeviceSetComputeMode(Device Device, Mode ComputeMode) Return + DeviceSetEccMode(Device Device, Ecc EnableState) Return + DeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return + DeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return + DeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return + DeviceResetGpuLockedClocks(Device Device) Return + DeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return + DeviceResetMemoryLockedClocks(Device Device) Return + DeviceGetClkMonStatus(Device Device) (ClkMonStatus, Return) + DeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return + DeviceSetPowerManagementLimit(Device Device, Limit uint32) Return + DeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return + DeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return + DeviceSetAccountingMode(Device Device, Mode EnableState) Return + DeviceClearAccountingPids(Device Device) Return + DeviceGetNvLinkState(Device Device, Link int) (EnableState, Return) + DeviceGetNvLinkVersion(Device Device, Link int) (uint32, Return) + DeviceGetNvLinkCapability(Device Device, Link int, Capability NvLinkCapability) (uint32, Return) + DeviceGetNvLinkRemotePciInfo(Device Device, Link int) (PciInfo, Return) + DeviceGetNvLinkErrorCounter(Device Device, Link int, Counter NvLinkErrorCounter) (uint64, Return) + DeviceResetNvLinkErrorCounters(Device Device, Link int) Return + DeviceSetNvLinkUtilizationControl(Device Device, Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return + DeviceGetNvLinkUtilizationControl(Device Device, Link int, Counter int) (NvLinkUtilizationControl, Return) + DeviceGetNvLinkUtilizationCounter(Device Device, Link int, Counter int) (uint64, uint64, Return) + DeviceFreezeNvLinkUtilizationCounter(Device Device, Link int, Counter int, Freeze EnableState) Return + DeviceResetNvLinkUtilizationCounter(Device Device, Link int, Counter int) Return + DeviceGetNvLinkRemoteDeviceType(Device Device, Link int) (IntNvLinkDeviceType, Return) + DeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return + DeviceGetSupportedEventTypes(Device Device) (uint64, Return) + DeviceModifyDrainState(PciInfo *PciInfo, NewState EnableState) Return + DeviceQueryDrainState(PciInfo *PciInfo) (EnableState, Return) + DeviceRemoveGpu(PciInfo *PciInfo) Return + DeviceRemoveGpu_v2(PciInfo *PciInfo, GpuState DetachGpuState, LinkState PcieLinkState) Return + DeviceDiscoverGpus() (PciInfo, Return) + DeviceGetFieldValues(Device Device, Values []FieldValue) Return + DeviceGetVirtualizationMode(Device Device) (GpuVirtualizationMode, Return) + DeviceGetHostVgpuMode(Device Device) (HostVgpuMode, Return) + DeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return + DeviceGetGridLicensableFeatures(Device Device) (GridLicensableFeatures, Return) + DeviceGetProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) + DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) + DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) + DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) + DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return) + DeviceGetPgpuMetadataString(Device Device) (string, Return) + DeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) + DeviceGetAttributes(Device Device) (DeviceAttributes, Return) + DeviceGetRemappedRows(Device Device) (int, int, bool, bool, Return) + DeviceGetRowRemapperHistogram(Device Device) (RowRemapperHistogramValues, Return) + DeviceGetArchitecture(Device Device) (DeviceArchitecture, Return) + DeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) + GetExcludedDeviceCount() (int, Return) + GetExcludedDeviceInfoByIndex(Index int) (ExcludedDeviceInfo, Return) + DeviceSetMigMode(Device Device, Mode int) (Return, Return) + DeviceGetMigMode(Device Device) (int, int, Return) + DeviceGetGpuInstanceProfileInfo(Device Device, Profile int) (GpuInstanceProfileInfo, Return) + DeviceGetGpuInstanceProfileInfoV(Device Device, Profile int) GpuInstanceProfileInfoV + DeviceGetGpuInstancePossiblePlacements(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) + DeviceGetGpuInstanceRemainingCapacity(Device Device, Info *GpuInstanceProfileInfo) (int, Return) + DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfileInfo) (GpuInstance, Return) + DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) + GpuInstanceDestroy(GpuInstance GpuInstance) Return + DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) + DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, Return) + GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) + GpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) + GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile int, EngProfile int) ComputeInstanceProfileInfoV + GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (int, Return) + GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) + ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return + GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) + GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id int) (ComputeInstance, Return) + ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) + DeviceIsMigDeviceHandle(Device Device) (bool, Return) + DeviceGetGpuInstanceId(Device Device) (int, Return) + DeviceGetComputeInstanceId(Device Device) (int, Return) + DeviceGetMaxMigDeviceCount(Device Device) (int, Return) + DeviceGetMigDeviceHandleByIndex(device Device, Index int) (Device, Return) + DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device) (Device, Return) + DeviceGetBusType(Device Device) (BusType, Return) + DeviceSetDefaultFanSpeed_v2(Device Device, Fan int) Return + DeviceGetMinMaxFanSpeed(Device Device) (int, int, Return) + DeviceGetThermalSettings(Device Device, SensorIndex uint32) (GpuThermalSettings, Return) + DeviceGetDefaultEccMode(Device Device) (EnableState, Return) + DeviceGetPcieSpeed(Device Device) (int, Return) + DeviceGetGspFirmwareVersion(Device Device) (string, Return) + DeviceGetGspFirmwareMode(Device Device) (bool, bool, Return) + DeviceGetDynamicPstatesInfo(Device Device) (GpuDynamicPstatesInfo, Return) + DeviceSetFanSpeed_v2(Device Device, Fan int, Speed int) Return + DeviceGetGpcClkVfOffset(Device Device) (int, Return) + DeviceSetGpcClkVfOffset(Device Device, Offset int) Return + DeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates) (uint32, uint32, Return) + DeviceGetSupportedPerformanceStates(Device Device) ([]Pstates, Return) + DeviceGetTargetFanSpeed(Device Device, Fan int) (int, Return) + DeviceGetMemClkVfOffset(Device Device) (int, Return) + DeviceSetMemClkVfOffset(Device Device, Offset int) Return + DeviceGetGpcClkMinMaxVfOffset(Device Device) (int, int, Return) + DeviceGetMemClkMinMaxVfOffset(Device Device) (int, int, Return) + DeviceGetGpuMaxPcieLinkGeneration(Device Device) (int, Return) + DeviceGetFanControlPolicy_v2(Device Device, Fan int) (FanControlPolicy, Return) + DeviceSetFanControlPolicy(Device Device, Fan int, Policy FanControlPolicy) Return + DeviceClearFieldValues(Device Device, Values []FieldValue) Return + DeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability) (bool, Return) + DeviceGetVgpuSchedulerLog(Device Device) (VgpuSchedulerLog, Return) + DeviceGetVgpuSchedulerState(Device Device) (VgpuSchedulerGetState, Return) + DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return + DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) + GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) + GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return + DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) + DeviceCcuGetStreamState(Device Device) (int, Return) + DeviceCcuSetStreamState(Device Device, State int) Return + DeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return + // Event API + EventSetCreate() (EventSet, Return) + EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) + EventSetFree(Set EventSet) Return + // GPM API + GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType + GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return + GpmSampleFree(GpmSample GpmSample) Return + GpmSampleAlloc(GpmSample *GpmSample) Return + GpmSampleGet(Device Device, GpmSample GpmSample) Return + GpmQueryDeviceSupportV(Device Device) GpmSupportV + GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) + GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return + // Unit API + UnitGetCount() (int, Return) + UnitGetHandleByIndex(Index int) (Unit, Return) + UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) + UnitGetLedState(Unit Unit) (LedState, Return) + UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) + UnitGetTemperature(Unit Unit, Type int) (uint32, Return) + UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) + UnitGetDevices(Unit Unit) ([]Device, Return) + UnitSetLedState(Unit Unit, Color LedColor) Return + // vGPU API + VgpuTypeGetClass(VgpuTypeId VgpuTypeId) (string, Return) + VgpuTypeGetName(VgpuTypeId VgpuTypeId) (string, Return) + VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) + VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) + VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) + VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) + VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) + VgpuTypeGetLicense(VgpuTypeId VgpuTypeId) (string, Return) + VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) + VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) + VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) + VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) + VgpuInstanceGetUUID(VgpuInstance VgpuInstance) (string, Return) + VgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance) (string, Return) + VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) + VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) + VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) + VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) + VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) + VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) + VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) + VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return + VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) + VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) + VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) + VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) + VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) + VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Return) + VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) + VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) + VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]int, Return) + VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) + GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) + GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) + SetVgpuVersion(VgpuVersion *VgpuVersion) Return + VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return + VgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance) (string, Return) + VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) + GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) } + +// Define package level methods as aliases to Interface methods of libnvml +var ( + GetLibrary = libnvml.GetLibrary + Init = libnvml.Init + InitWithFlags = libnvml.InitWithFlags + Shutdown = libnvml.Shutdown + ErrorString = libnvml.ErrorString + SystemGetDriverVersion = libnvml.SystemGetDriverVersion + SystemGetNVMLVersion = libnvml.SystemGetNVMLVersion + SystemGetCudaDriverVersion = libnvml.SystemGetCudaDriverVersion + SystemGetCudaDriverVersion_v2 = libnvml.SystemGetCudaDriverVersion_v2 + SystemGetProcessName = libnvml.SystemGetProcessName + SystemGetHicVersion = libnvml.SystemGetHicVersion + SystemGetTopologyGpuSet = libnvml.SystemGetTopologyGpuSet + DeviceGetCount = libnvml.DeviceGetCount + DeviceGetHandleByIndex = libnvml.DeviceGetHandleByIndex + DeviceGetHandleBySerial = libnvml.DeviceGetHandleBySerial + DeviceGetHandleByUUID = libnvml.DeviceGetHandleByUUID + DeviceGetHandleByPciBusId = libnvml.DeviceGetHandleByPciBusId + DeviceGetName = libnvml.DeviceGetName + DeviceGetBrand = libnvml.DeviceGetBrand + DeviceGetIndex = libnvml.DeviceGetIndex + DeviceGetSerial = libnvml.DeviceGetSerial + DeviceGetCpuAffinity = libnvml.DeviceGetCpuAffinity + DeviceSetCpuAffinity = libnvml.DeviceSetCpuAffinity + DeviceClearCpuAffinity = libnvml.DeviceClearCpuAffinity + DeviceGetMemoryAffinity = libnvml.DeviceGetMemoryAffinity + DeviceGetCpuAffinityWithinScope = libnvml.DeviceGetCpuAffinityWithinScope + DeviceGetTopologyCommonAncestor = libnvml.DeviceGetTopologyCommonAncestor + DeviceGetTopologyNearestGpus = libnvml.DeviceGetTopologyNearestGpus + DeviceGetP2PStatus = libnvml.DeviceGetP2PStatus + DeviceGetUUID = libnvml.DeviceGetUUID + DeviceGetMinorNumber = libnvml.DeviceGetMinorNumber + DeviceGetBoardPartNumber = libnvml.DeviceGetBoardPartNumber + DeviceGetInforomVersion = libnvml.DeviceGetInforomVersion + DeviceGetInforomImageVersion = libnvml.DeviceGetInforomImageVersion + DeviceGetInforomConfigurationChecksum = libnvml.DeviceGetInforomConfigurationChecksum + DeviceValidateInforom = libnvml.DeviceValidateInforom + DeviceGetDisplayMode = libnvml.DeviceGetDisplayMode + DeviceGetDisplayActive = libnvml.DeviceGetDisplayActive + DeviceGetPersistenceMode = libnvml.DeviceGetPersistenceMode + DeviceGetPciInfo = libnvml.DeviceGetPciInfo + DeviceGetMaxPcieLinkGeneration = libnvml.DeviceGetMaxPcieLinkGeneration + DeviceGetMaxPcieLinkWidth = libnvml.DeviceGetMaxPcieLinkWidth + DeviceGetCurrPcieLinkGeneration = libnvml.DeviceGetCurrPcieLinkGeneration + DeviceGetCurrPcieLinkWidth = libnvml.DeviceGetCurrPcieLinkWidth + DeviceGetPcieThroughput = libnvml.DeviceGetPcieThroughput + DeviceGetPcieReplayCounter = libnvml.DeviceGetPcieReplayCounter + DeviceGetClockInfo = libnvml.DeviceGetClockInfo + DeviceGetMaxClockInfo = libnvml.DeviceGetMaxClockInfo + DeviceGetApplicationsClock = libnvml.DeviceGetApplicationsClock + DeviceGetDefaultApplicationsClock = libnvml.DeviceGetDefaultApplicationsClock + DeviceResetApplicationsClocks = libnvml.DeviceResetApplicationsClocks + DeviceGetClock = libnvml.DeviceGetClock + DeviceGetMaxCustomerBoostClock = libnvml.DeviceGetMaxCustomerBoostClock + DeviceGetSupportedMemoryClocks = libnvml.DeviceGetSupportedMemoryClocks + DeviceGetSupportedGraphicsClocks = libnvml.DeviceGetSupportedGraphicsClocks + DeviceGetAutoBoostedClocksEnabled = libnvml.DeviceGetAutoBoostedClocksEnabled + DeviceSetAutoBoostedClocksEnabled = libnvml.DeviceSetAutoBoostedClocksEnabled + DeviceSetDefaultAutoBoostedClocksEnabled = libnvml.DeviceSetDefaultAutoBoostedClocksEnabled + DeviceGetFanSpeed = libnvml.DeviceGetFanSpeed + DeviceGetFanSpeed_v2 = libnvml.DeviceGetFanSpeed_v2 + DeviceGetNumFans = libnvml.DeviceGetNumFans + DeviceGetTemperature = libnvml.DeviceGetTemperature + DeviceGetTemperatureThreshold = libnvml.DeviceGetTemperatureThreshold + DeviceSetTemperatureThreshold = libnvml.DeviceSetTemperatureThreshold + DeviceGetPerformanceState = libnvml.DeviceGetPerformanceState + DeviceGetCurrentClocksThrottleReasons = libnvml.DeviceGetCurrentClocksThrottleReasons + DeviceGetSupportedClocksThrottleReasons = libnvml.DeviceGetSupportedClocksThrottleReasons + DeviceGetPowerState = libnvml.DeviceGetPowerState + DeviceGetPowerManagementMode = libnvml.DeviceGetPowerManagementMode + DeviceGetPowerManagementLimit = libnvml.DeviceGetPowerManagementLimit + DeviceGetPowerManagementLimitConstraints = libnvml.DeviceGetPowerManagementLimitConstraints + DeviceGetPowerManagementDefaultLimit = libnvml.DeviceGetPowerManagementDefaultLimit + DeviceGetPowerUsage = libnvml.DeviceGetPowerUsage + DeviceGetTotalEnergyConsumption = libnvml.DeviceGetTotalEnergyConsumption + DeviceGetEnforcedPowerLimit = libnvml.DeviceGetEnforcedPowerLimit + DeviceGetGpuOperationMode = libnvml.DeviceGetGpuOperationMode + DeviceGetMemoryInfo = libnvml.DeviceGetMemoryInfo + DeviceGetMemoryInfo_v2 = libnvml.DeviceGetMemoryInfo_v2 + DeviceGetComputeMode = libnvml.DeviceGetComputeMode + DeviceGetCudaComputeCapability = libnvml.DeviceGetCudaComputeCapability + DeviceGetEccMode = libnvml.DeviceGetEccMode + DeviceGetBoardId = libnvml.DeviceGetBoardId + DeviceGetMultiGpuBoard = libnvml.DeviceGetMultiGpuBoard + DeviceGetTotalEccErrors = libnvml.DeviceGetTotalEccErrors + DeviceGetDetailedEccErrors = libnvml.DeviceGetDetailedEccErrors + DeviceGetMemoryErrorCounter = libnvml.DeviceGetMemoryErrorCounter + DeviceGetUtilizationRates = libnvml.DeviceGetUtilizationRates + DeviceGetEncoderUtilization = libnvml.DeviceGetEncoderUtilization + DeviceGetEncoderCapacity = libnvml.DeviceGetEncoderCapacity + DeviceGetEncoderStats = libnvml.DeviceGetEncoderStats + DeviceGetEncoderSessions = libnvml.DeviceGetEncoderSessions + DeviceGetDecoderUtilization = libnvml.DeviceGetDecoderUtilization + DeviceGetFBCStats = libnvml.DeviceGetFBCStats + DeviceGetFBCSessions = libnvml.DeviceGetFBCSessions + DeviceGetDriverModel = libnvml.DeviceGetDriverModel + DeviceGetVbiosVersion = libnvml.DeviceGetVbiosVersion + DeviceGetBridgeChipInfo = libnvml.DeviceGetBridgeChipInfo + DeviceGetComputeRunningProcesses = libnvml.DeviceGetComputeRunningProcesses + DeviceGetGraphicsRunningProcesses = libnvml.DeviceGetGraphicsRunningProcesses + DeviceGetMPSComputeRunningProcesses = libnvml.DeviceGetMPSComputeRunningProcesses + DeviceOnSameBoard = libnvml.DeviceOnSameBoard + DeviceGetAPIRestriction = libnvml.DeviceGetAPIRestriction + DeviceGetSamples = libnvml.DeviceGetSamples + DeviceGetBAR1MemoryInfo = libnvml.DeviceGetBAR1MemoryInfo + DeviceGetViolationStatus = libnvml.DeviceGetViolationStatus + DeviceGetIrqNum = libnvml.DeviceGetIrqNum + DeviceGetNumGpuCores = libnvml.DeviceGetNumGpuCores + DeviceGetPowerSource = libnvml.DeviceGetPowerSource + DeviceGetMemoryBusWidth = libnvml.DeviceGetMemoryBusWidth + DeviceGetPcieLinkMaxSpeed = libnvml.DeviceGetPcieLinkMaxSpeed + DeviceGetAdaptiveClockInfoStatus = libnvml.DeviceGetAdaptiveClockInfoStatus + DeviceGetAccountingMode = libnvml.DeviceGetAccountingMode + DeviceGetAccountingStats = libnvml.DeviceGetAccountingStats + DeviceGetAccountingPids = libnvml.DeviceGetAccountingPids + DeviceGetAccountingBufferSize = libnvml.DeviceGetAccountingBufferSize + DeviceGetRetiredPages = libnvml.DeviceGetRetiredPages + DeviceGetRetiredPages_v2 = libnvml.DeviceGetRetiredPages_v2 + DeviceGetRetiredPagesPendingStatus = libnvml.DeviceGetRetiredPagesPendingStatus + DeviceSetPersistenceMode = libnvml.DeviceSetPersistenceMode + DeviceSetComputeMode = libnvml.DeviceSetComputeMode + DeviceSetEccMode = libnvml.DeviceSetEccMode + DeviceClearEccErrorCounts = libnvml.DeviceClearEccErrorCounts + DeviceSetDriverModel = libnvml.DeviceSetDriverModel + DeviceSetGpuLockedClocks = libnvml.DeviceSetGpuLockedClocks + DeviceResetGpuLockedClocks = libnvml.DeviceResetGpuLockedClocks + DeviceSetMemoryLockedClocks = libnvml.DeviceSetMemoryLockedClocks + DeviceResetMemoryLockedClocks = libnvml.DeviceResetMemoryLockedClocks + DeviceGetClkMonStatus = libnvml.DeviceGetClkMonStatus + DeviceSetApplicationsClocks = libnvml.DeviceSetApplicationsClocks + DeviceSetPowerManagementLimit = libnvml.DeviceSetPowerManagementLimit + DeviceSetGpuOperationMode = libnvml.DeviceSetGpuOperationMode + DeviceSetAPIRestriction = libnvml.DeviceSetAPIRestriction + DeviceSetAccountingMode = libnvml.DeviceSetAccountingMode + DeviceClearAccountingPids = libnvml.DeviceClearAccountingPids + DeviceGetNvLinkState = libnvml.DeviceGetNvLinkState + DeviceGetNvLinkVersion = libnvml.DeviceGetNvLinkVersion + DeviceGetNvLinkCapability = libnvml.DeviceGetNvLinkCapability + DeviceGetNvLinkRemotePciInfo = libnvml.DeviceGetNvLinkRemotePciInfo + DeviceGetNvLinkErrorCounter = libnvml.DeviceGetNvLinkErrorCounter + DeviceResetNvLinkErrorCounters = libnvml.DeviceResetNvLinkErrorCounters + DeviceSetNvLinkUtilizationControl = libnvml.DeviceSetNvLinkUtilizationControl + DeviceGetNvLinkUtilizationControl = libnvml.DeviceGetNvLinkUtilizationControl + DeviceGetNvLinkUtilizationCounter = libnvml.DeviceGetNvLinkUtilizationCounter + DeviceFreezeNvLinkUtilizationCounter = libnvml.DeviceFreezeNvLinkUtilizationCounter + DeviceResetNvLinkUtilizationCounter = libnvml.DeviceResetNvLinkUtilizationCounter + DeviceGetNvLinkRemoteDeviceType = libnvml.DeviceGetNvLinkRemoteDeviceType + DeviceRegisterEvents = libnvml.DeviceRegisterEvents + DeviceGetSupportedEventTypes = libnvml.DeviceGetSupportedEventTypes + DeviceModifyDrainState = libnvml.DeviceModifyDrainState + DeviceQueryDrainState = libnvml.DeviceQueryDrainState + DeviceRemoveGpu = libnvml.DeviceRemoveGpu + DeviceRemoveGpu_v2 = libnvml.DeviceRemoveGpu_v2 + DeviceDiscoverGpus = libnvml.DeviceDiscoverGpus + DeviceGetFieldValues = libnvml.DeviceGetFieldValues + DeviceGetVirtualizationMode = libnvml.DeviceGetVirtualizationMode + DeviceGetHostVgpuMode = libnvml.DeviceGetHostVgpuMode + DeviceSetVirtualizationMode = libnvml.DeviceSetVirtualizationMode + DeviceGetGridLicensableFeatures = libnvml.DeviceGetGridLicensableFeatures + DeviceGetProcessUtilization = libnvml.DeviceGetProcessUtilization + DeviceGetSupportedVgpus = libnvml.DeviceGetSupportedVgpus + DeviceGetCreatableVgpus = libnvml.DeviceGetCreatableVgpus + DeviceGetActiveVgpus = libnvml.DeviceGetActiveVgpus + DeviceGetVgpuMetadata = libnvml.DeviceGetVgpuMetadata + DeviceGetPgpuMetadataString = libnvml.DeviceGetPgpuMetadataString + DeviceGetVgpuUtilization = libnvml.DeviceGetVgpuUtilization + DeviceGetAttributes = libnvml.DeviceGetAttributes + DeviceGetRemappedRows = libnvml.DeviceGetRemappedRows + DeviceGetRowRemapperHistogram = libnvml.DeviceGetRowRemapperHistogram + DeviceGetArchitecture = libnvml.DeviceGetArchitecture + DeviceGetVgpuProcessUtilization = libnvml.DeviceGetVgpuProcessUtilization + GetExcludedDeviceCount = libnvml.GetExcludedDeviceCount + GetExcludedDeviceInfoByIndex = libnvml.GetExcludedDeviceInfoByIndex + DeviceSetMigMode = libnvml.DeviceSetMigMode + DeviceGetMigMode = libnvml.DeviceGetMigMode + DeviceGetGpuInstanceProfileInfo = libnvml.DeviceGetGpuInstanceProfileInfo + DeviceGetGpuInstanceProfileInfoV = libnvml.DeviceGetGpuInstanceProfileInfoV + DeviceGetGpuInstancePossiblePlacements = libnvml.DeviceGetGpuInstancePossiblePlacements + DeviceGetGpuInstanceRemainingCapacity = libnvml.DeviceGetGpuInstanceRemainingCapacity + DeviceCreateGpuInstance = libnvml.DeviceCreateGpuInstance + DeviceCreateGpuInstanceWithPlacement = libnvml.DeviceCreateGpuInstanceWithPlacement + GpuInstanceDestroy = libnvml.GpuInstanceDestroy + DeviceGetGpuInstances = libnvml.DeviceGetGpuInstances + DeviceGetGpuInstanceById = libnvml.DeviceGetGpuInstanceById + GpuInstanceGetInfo = libnvml.GpuInstanceGetInfo + GpuInstanceGetComputeInstanceProfileInfo = libnvml.GpuInstanceGetComputeInstanceProfileInfo + GpuInstanceGetComputeInstanceProfileInfoV = libnvml.GpuInstanceGetComputeInstanceProfileInfoV + GpuInstanceGetComputeInstanceRemainingCapacity = libnvml.GpuInstanceGetComputeInstanceRemainingCapacity + GpuInstanceCreateComputeInstance = libnvml.GpuInstanceCreateComputeInstance + ComputeInstanceDestroy = libnvml.ComputeInstanceDestroy + GpuInstanceGetComputeInstances = libnvml.GpuInstanceGetComputeInstances + GpuInstanceGetComputeInstanceById = libnvml.GpuInstanceGetComputeInstanceById + ComputeInstanceGetInfo = libnvml.ComputeInstanceGetInfo + DeviceIsMigDeviceHandle = libnvml.DeviceIsMigDeviceHandle + DeviceGetGpuInstanceId = libnvml.DeviceGetGpuInstanceId + DeviceGetComputeInstanceId = libnvml.DeviceGetComputeInstanceId + DeviceGetMaxMigDeviceCount = libnvml.DeviceGetMaxMigDeviceCount + DeviceGetMigDeviceHandleByIndex = libnvml.DeviceGetMigDeviceHandleByIndex + DeviceGetDeviceHandleFromMigDeviceHandle = libnvml.DeviceGetDeviceHandleFromMigDeviceHandle + DeviceGetBusType = libnvml.DeviceGetBusType + DeviceSetDefaultFanSpeed_v2 = libnvml.DeviceSetDefaultFanSpeed_v2 + DeviceGetMinMaxFanSpeed = libnvml.DeviceGetMinMaxFanSpeed + DeviceGetThermalSettings = libnvml.DeviceGetThermalSettings + DeviceGetDefaultEccMode = libnvml.DeviceGetDefaultEccMode + DeviceGetPcieSpeed = libnvml.DeviceGetPcieSpeed + DeviceGetGspFirmwareVersion = libnvml.DeviceGetGspFirmwareVersion + DeviceGetGspFirmwareMode = libnvml.DeviceGetGspFirmwareMode + DeviceGetDynamicPstatesInfo = libnvml.DeviceGetDynamicPstatesInfo + DeviceSetFanSpeed_v2 = libnvml.DeviceSetFanSpeed_v2 + DeviceGetGpcClkVfOffset = libnvml.DeviceGetGpcClkVfOffset + DeviceSetGpcClkVfOffset = libnvml.DeviceSetGpcClkVfOffset + DeviceGetMinMaxClockOfPState = libnvml.DeviceGetMinMaxClockOfPState + DeviceGetSupportedPerformanceStates = libnvml.DeviceGetSupportedPerformanceStates + DeviceGetTargetFanSpeed = libnvml.DeviceGetTargetFanSpeed + DeviceGetMemClkVfOffset = libnvml.DeviceGetMemClkVfOffset + DeviceSetMemClkVfOffset = libnvml.DeviceSetMemClkVfOffset + DeviceGetGpcClkMinMaxVfOffset = libnvml.DeviceGetGpcClkMinMaxVfOffset + DeviceGetMemClkMinMaxVfOffset = libnvml.DeviceGetMemClkMinMaxVfOffset + DeviceGetGpuMaxPcieLinkGeneration = libnvml.DeviceGetGpuMaxPcieLinkGeneration + DeviceGetFanControlPolicy_v2 = libnvml.DeviceGetFanControlPolicy_v2 + DeviceSetFanControlPolicy = libnvml.DeviceSetFanControlPolicy + DeviceClearFieldValues = libnvml.DeviceClearFieldValues + DeviceGetVgpuCapabilities = libnvml.DeviceGetVgpuCapabilities + DeviceGetVgpuSchedulerLog = libnvml.DeviceGetVgpuSchedulerLog + DeviceGetVgpuSchedulerState = libnvml.DeviceGetVgpuSchedulerState + DeviceSetVgpuSchedulerState = libnvml.DeviceSetVgpuSchedulerState + DeviceGetVgpuSchedulerCapabilities = libnvml.DeviceGetVgpuSchedulerCapabilities + GpuInstanceGetComputeInstancePossiblePlacements = libnvml.GpuInstanceGetComputeInstancePossiblePlacements + GpuInstanceCreateComputeInstanceWithPlacement = libnvml.GpuInstanceCreateComputeInstanceWithPlacement + DeviceGetGpuFabricInfo = libnvml.DeviceGetGpuFabricInfo + DeviceCcuGetStreamState = libnvml.DeviceCcuGetStreamState + DeviceCcuSetStreamState = libnvml.DeviceCcuSetStreamState + DeviceSetNvLinkDeviceLowPowerThreshold = libnvml.DeviceSetNvLinkDeviceLowPowerThreshold + EventSetCreate = libnvml.EventSetCreate + EventSetWait = libnvml.EventSetWait + EventSetFree = libnvml.EventSetFree + GpmMetricsGetV = libnvml.GpmMetricsGetV + GpmMetricsGet = libnvml.GpmMetricsGet + GpmSampleFree = libnvml.GpmSampleFree + GpmSampleAlloc = libnvml.GpmSampleAlloc + GpmSampleGet = libnvml.GpmSampleGet + GpmQueryDeviceSupportV = libnvml.GpmQueryDeviceSupportV + GpmQueryDeviceSupport = libnvml.GpmQueryDeviceSupport + GpmMigSampleGet = libnvml.GpmMigSampleGet + UnitGetCount = libnvml.UnitGetCount + UnitGetHandleByIndex = libnvml.UnitGetHandleByIndex + UnitGetUnitInfo = libnvml.UnitGetUnitInfo + UnitGetLedState = libnvml.UnitGetLedState + UnitGetPsuInfo = libnvml.UnitGetPsuInfo + UnitGetTemperature = libnvml.UnitGetTemperature + UnitGetFanSpeedInfo = libnvml.UnitGetFanSpeedInfo + UnitGetDevices = libnvml.UnitGetDevices + UnitSetLedState = libnvml.UnitSetLedState + VgpuTypeGetClass = libnvml.VgpuTypeGetClass + VgpuTypeGetName = libnvml.VgpuTypeGetName + VgpuTypeGetGpuInstanceProfileId = libnvml.VgpuTypeGetGpuInstanceProfileId + VgpuTypeGetDeviceID = libnvml.VgpuTypeGetDeviceID + VgpuTypeGetFramebufferSize = libnvml.VgpuTypeGetFramebufferSize + VgpuTypeGetNumDisplayHeads = libnvml.VgpuTypeGetNumDisplayHeads + VgpuTypeGetResolution = libnvml.VgpuTypeGetResolution + VgpuTypeGetLicense = libnvml.VgpuTypeGetLicense + VgpuTypeGetFrameRateLimit = libnvml.VgpuTypeGetFrameRateLimit + VgpuTypeGetMaxInstances = libnvml.VgpuTypeGetMaxInstances + VgpuTypeGetMaxInstancesPerVm = libnvml.VgpuTypeGetMaxInstancesPerVm + VgpuInstanceGetVmID = libnvml.VgpuInstanceGetVmID + VgpuInstanceGetUUID = libnvml.VgpuInstanceGetUUID + VgpuInstanceGetVmDriverVersion = libnvml.VgpuInstanceGetVmDriverVersion + VgpuInstanceGetFbUsage = libnvml.VgpuInstanceGetFbUsage + VgpuInstanceGetLicenseInfo = libnvml.VgpuInstanceGetLicenseInfo + VgpuInstanceGetLicenseStatus = libnvml.VgpuInstanceGetLicenseStatus + VgpuInstanceGetType = libnvml.VgpuInstanceGetType + VgpuInstanceGetFrameRateLimit = libnvml.VgpuInstanceGetFrameRateLimit + VgpuInstanceGetEccMode = libnvml.VgpuInstanceGetEccMode + VgpuInstanceGetEncoderCapacity = libnvml.VgpuInstanceGetEncoderCapacity + VgpuInstanceSetEncoderCapacity = libnvml.VgpuInstanceSetEncoderCapacity + VgpuInstanceGetEncoderStats = libnvml.VgpuInstanceGetEncoderStats + VgpuInstanceGetEncoderSessions = libnvml.VgpuInstanceGetEncoderSessions + VgpuInstanceGetFBCStats = libnvml.VgpuInstanceGetFBCStats + VgpuInstanceGetFBCSessions = libnvml.VgpuInstanceGetFBCSessions + VgpuInstanceGetGpuInstanceId = libnvml.VgpuInstanceGetGpuInstanceId + VgpuInstanceGetGpuPciId = libnvml.VgpuInstanceGetGpuPciId + VgpuInstanceGetMetadata = libnvml.VgpuInstanceGetMetadata + VgpuInstanceGetAccountingMode = libnvml.VgpuInstanceGetAccountingMode + VgpuInstanceGetAccountingPids = libnvml.VgpuInstanceGetAccountingPids + VgpuInstanceGetAccountingStats = libnvml.VgpuInstanceGetAccountingStats + GetVgpuCompatibility = libnvml.GetVgpuCompatibility + GetVgpuVersion = libnvml.GetVgpuVersion + SetVgpuVersion = libnvml.SetVgpuVersion + VgpuInstanceClearAccountingPids = libnvml.VgpuInstanceClearAccountingPids + VgpuInstanceGetMdevUUID = libnvml.VgpuInstanceGetMdevUUID + VgpuTypeGetCapabilities = libnvml.VgpuTypeGetCapabilities + GetVgpuDriverCapabilities = libnvml.GetVgpuDriverCapabilities +) diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index 91a7baa..4cdf04f 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -22,42 +22,42 @@ import ( type EccBitType = MemoryErrorType // nvml.DeviceGetCount() -func DeviceGetCount() (int, Return) { +func (l *library) DeviceGetCount() (int, Return) { var DeviceCount uint32 ret := nvmlDeviceGetCount(&DeviceCount) return int(DeviceCount), ret } // nvml.DeviceGetHandleByIndex() -func DeviceGetHandleByIndex(Index int) (Device, Return) { +func (l *library) DeviceGetHandleByIndex(Index int) (Device, Return) { var Device Device ret := nvmlDeviceGetHandleByIndex(uint32(Index), &Device) return Device, ret } // nvml.DeviceGetHandleBySerial() -func DeviceGetHandleBySerial(Serial string) (Device, Return) { +func (l *library) DeviceGetHandleBySerial(Serial string) (Device, Return) { var Device Device ret := nvmlDeviceGetHandleBySerial(Serial+string(rune(0)), &Device) return Device, ret } // nvml.DeviceGetHandleByUUID() -func DeviceGetHandleByUUID(Uuid string) (Device, Return) { +func (l *library) DeviceGetHandleByUUID(Uuid string) (Device, Return) { var Device Device ret := nvmlDeviceGetHandleByUUID(Uuid+string(rune(0)), &Device) return Device, ret } // nvml.DeviceGetHandleByPciBusId() -func DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) { +func (l *library) DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) { var Device Device ret := nvmlDeviceGetHandleByPciBusId(PciBusId+string(rune(0)), &Device) return Device, ret } // nvml.DeviceGetName() -func DeviceGetName(Device Device) (string, Return) { +func (l *library) 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 @@ -68,7 +68,7 @@ func (Device Device) GetName() (string, Return) { } // nvml.DeviceGetBrand() -func DeviceGetBrand(Device Device) (BrandType, Return) { +func (l *library) DeviceGetBrand(Device Device) (BrandType, Return) { var _type BrandType ret := nvmlDeviceGetBrand(Device, &_type) return _type, ret @@ -79,7 +79,7 @@ func (Device Device) GetBrand() (BrandType, Return) { } // nvml.DeviceGetIndex() -func DeviceGetIndex(Device Device) (int, Return) { +func (l *library) DeviceGetIndex(Device Device) (int, Return) { var Index uint32 ret := nvmlDeviceGetIndex(Device, &Index) return int(Index), ret @@ -90,7 +90,7 @@ func (Device Device) GetIndex() (int, Return) { } // nvml.DeviceGetSerial() -func DeviceGetSerial(Device Device) (string, Return) { +func (l *library) 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 @@ -101,7 +101,7 @@ func (Device Device) GetSerial() (string, Return) { } // nvml.DeviceGetCpuAffinity() -func DeviceGetCpuAffinity(Device Device, NumCPUs int) ([]uint, Return) { +func (l *library) 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]) @@ -113,7 +113,7 @@ func (Device Device) GetCpuAffinity(NumCPUs int) ([]uint, Return) { } // nvml.DeviceSetCpuAffinity() -func DeviceSetCpuAffinity(Device Device) Return { +func (l *library) DeviceSetCpuAffinity(Device Device) Return { return nvmlDeviceSetCpuAffinity(Device) } @@ -122,7 +122,7 @@ func (Device Device) SetCpuAffinity() Return { } // nvml.DeviceClearCpuAffinity() -func DeviceClearCpuAffinity(Device Device) Return { +func (l *library) DeviceClearCpuAffinity(Device Device) Return { return nvmlDeviceClearCpuAffinity(Device) } @@ -131,7 +131,7 @@ func (Device Device) ClearCpuAffinity() Return { } // nvml.DeviceGetMemoryAffinity() -func DeviceGetMemoryAffinity(Device Device, NumNodes int, Scope AffinityScope) ([]uint, Return) { +func (l *library) 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) @@ -143,7 +143,7 @@ func (Device Device) GetMemoryAffinity(NumNodes int, Scope AffinityScope) ([]uin } // nvml.DeviceGetCpuAffinityWithinScope() -func DeviceGetCpuAffinityWithinScope(Device Device, NumCPUs int, Scope AffinityScope) ([]uint, Return) { +func (l *library) 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) @@ -155,7 +155,7 @@ func (Device Device) GetCpuAffinityWithinScope(NumCPUs int, Scope AffinityScope) } // nvml.DeviceGetTopologyCommonAncestor() -func DeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device) (GpuTopologyLevel, Return) { +func (l *library) DeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device) (GpuTopologyLevel, Return) { var PathInfo GpuTopologyLevel ret := nvmlDeviceGetTopologyCommonAncestor(Device1, Device2, &PathInfo) return PathInfo, ret @@ -166,7 +166,7 @@ func (Device1 Device) GetTopologyCommonAncestor(Device2 Device) (GpuTopologyLeve } // nvml.DeviceGetTopologyNearestGpus() -func DeviceGetTopologyNearestGpus(device Device, Level GpuTopologyLevel) ([]Device, Return) { +func (l *library) DeviceGetTopologyNearestGpus(device Device, Level GpuTopologyLevel) ([]Device, Return) { var Count uint32 ret := nvmlDeviceGetTopologyNearestGpus(device, Level, &Count, nil) if ret != SUCCESS { @@ -185,7 +185,7 @@ func (Device Device) GetTopologyNearestGpus(Level GpuTopologyLevel) ([]Device, R } // nvml.DeviceGetP2PStatus() -func DeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { +func (l *library) DeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { var P2pStatus GpuP2PStatus ret := nvmlDeviceGetP2PStatus(Device1, Device2, P2pIndex, &P2pStatus) return P2pStatus, ret @@ -196,7 +196,7 @@ func (Device1 Device) GetP2PStatus(Device2 Device, P2pIndex GpuP2PCapsIndex) (Gp } // nvml.DeviceGetUUID() -func DeviceGetUUID(Device Device) (string, Return) { +func (l *library) 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 @@ -207,7 +207,7 @@ func (Device Device) GetUUID() (string, Return) { } // nvml.DeviceGetMinorNumber() -func DeviceGetMinorNumber(Device Device) (int, Return) { +func (l *library) DeviceGetMinorNumber(Device Device) (int, Return) { var MinorNumber uint32 ret := nvmlDeviceGetMinorNumber(Device, &MinorNumber) return int(MinorNumber), ret @@ -218,7 +218,7 @@ func (Device Device) GetMinorNumber() (int, Return) { } // nvml.DeviceGetBoardPartNumber() -func DeviceGetBoardPartNumber(Device Device) (string, Return) { +func (l *library) 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 @@ -229,7 +229,7 @@ func (Device Device) GetBoardPartNumber() (string, Return) { } // nvml.DeviceGetInforomVersion() -func DeviceGetInforomVersion(Device Device, Object InforomObject) (string, Return) { +func (l *library) 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 @@ -240,7 +240,7 @@ func (Device Device) GetInforomVersion(Object InforomObject) (string, Return) { } // nvml.DeviceGetInforomImageVersion() -func DeviceGetInforomImageVersion(Device Device) (string, Return) { +func (l *library) 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 @@ -251,7 +251,7 @@ func (Device Device) GetInforomImageVersion() (string, Return) { } // nvml.DeviceGetInforomConfigurationChecksum() -func DeviceGetInforomConfigurationChecksum(Device Device) (uint32, Return) { +func (l *library) DeviceGetInforomConfigurationChecksum(Device Device) (uint32, Return) { var Checksum uint32 ret := nvmlDeviceGetInforomConfigurationChecksum(Device, &Checksum) return Checksum, ret @@ -262,7 +262,7 @@ func (Device Device) GetInforomConfigurationChecksum() (uint32, Return) { } // nvml.DeviceValidateInforom() -func DeviceValidateInforom(Device Device) Return { +func (l *library) DeviceValidateInforom(Device Device) Return { return nvmlDeviceValidateInforom(Device) } @@ -271,7 +271,7 @@ func (Device Device) ValidateInforom() Return { } // nvml.DeviceGetDisplayMode() -func DeviceGetDisplayMode(Device Device) (EnableState, Return) { +func (l *library) DeviceGetDisplayMode(Device Device) (EnableState, Return) { var Display EnableState ret := nvmlDeviceGetDisplayMode(Device, &Display) return Display, ret @@ -282,7 +282,7 @@ func (Device Device) GetDisplayMode() (EnableState, Return) { } // nvml.DeviceGetDisplayActive() -func DeviceGetDisplayActive(Device Device) (EnableState, Return) { +func (l *library) DeviceGetDisplayActive(Device Device) (EnableState, Return) { var IsActive EnableState ret := nvmlDeviceGetDisplayActive(Device, &IsActive) return IsActive, ret @@ -293,7 +293,7 @@ func (Device Device) GetDisplayActive() (EnableState, Return) { } // nvml.DeviceGetPersistenceMode() -func DeviceGetPersistenceMode(Device Device) (EnableState, Return) { +func (l *library) DeviceGetPersistenceMode(Device Device) (EnableState, Return) { var Mode EnableState ret := nvmlDeviceGetPersistenceMode(Device, &Mode) return Mode, ret @@ -304,7 +304,7 @@ func (Device Device) GetPersistenceMode() (EnableState, Return) { } // nvml.DeviceGetPciInfo() -func DeviceGetPciInfo(Device Device) (PciInfo, Return) { +func (l *library) DeviceGetPciInfo(Device Device) (PciInfo, Return) { var Pci PciInfo ret := nvmlDeviceGetPciInfo(Device, &Pci) return Pci, ret @@ -315,7 +315,7 @@ func (Device Device) GetPciInfo() (PciInfo, Return) { } // nvml.DeviceGetMaxPcieLinkGeneration() -func DeviceGetMaxPcieLinkGeneration(Device Device) (int, Return) { +func (l *library) DeviceGetMaxPcieLinkGeneration(Device Device) (int, Return) { var MaxLinkGen uint32 ret := nvmlDeviceGetMaxPcieLinkGeneration(Device, &MaxLinkGen) return int(MaxLinkGen), ret @@ -326,7 +326,7 @@ func (Device Device) GetMaxPcieLinkGeneration() (int, Return) { } // nvml.DeviceGetMaxPcieLinkWidth() -func DeviceGetMaxPcieLinkWidth(Device Device) (int, Return) { +func (l *library) DeviceGetMaxPcieLinkWidth(Device Device) (int, Return) { var MaxLinkWidth uint32 ret := nvmlDeviceGetMaxPcieLinkWidth(Device, &MaxLinkWidth) return int(MaxLinkWidth), ret @@ -337,7 +337,7 @@ func (Device Device) GetMaxPcieLinkWidth() (int, Return) { } // nvml.DeviceGetCurrPcieLinkGeneration() -func DeviceGetCurrPcieLinkGeneration(Device Device) (int, Return) { +func (l *library) DeviceGetCurrPcieLinkGeneration(Device Device) (int, Return) { var CurrLinkGen uint32 ret := nvmlDeviceGetCurrPcieLinkGeneration(Device, &CurrLinkGen) return int(CurrLinkGen), ret @@ -348,7 +348,7 @@ func (Device Device) GetCurrPcieLinkGeneration() (int, Return) { } // nvml.DeviceGetCurrPcieLinkWidth() -func DeviceGetCurrPcieLinkWidth(Device Device) (int, Return) { +func (l *library) DeviceGetCurrPcieLinkWidth(Device Device) (int, Return) { var CurrLinkWidth uint32 ret := nvmlDeviceGetCurrPcieLinkWidth(Device, &CurrLinkWidth) return int(CurrLinkWidth), ret @@ -359,7 +359,7 @@ func (Device Device) GetCurrPcieLinkWidth() (int, Return) { } // nvml.DeviceGetPcieThroughput() -func DeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter) (uint32, Return) { +func (l *library) DeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter) (uint32, Return) { var Value uint32 ret := nvmlDeviceGetPcieThroughput(Device, Counter, &Value) return Value, ret @@ -370,7 +370,7 @@ func (Device Device) GetPcieThroughput(Counter PcieUtilCounter) (uint32, Return) } // nvml.DeviceGetPcieReplayCounter() -func DeviceGetPcieReplayCounter(Device Device) (int, Return) { +func (l *library) DeviceGetPcieReplayCounter(Device Device) (int, Return) { var Value uint32 ret := nvmlDeviceGetPcieReplayCounter(Device, &Value) return int(Value), ret @@ -381,7 +381,7 @@ func (Device Device) GetPcieReplayCounter() (int, Return) { } // nvml.nvmlDeviceGetClockInfo() -func DeviceGetClockInfo(Device Device, _type ClockType) (uint32, Return) { +func (l *library) DeviceGetClockInfo(Device Device, _type ClockType) (uint32, Return) { var Clock uint32 ret := nvmlDeviceGetClockInfo(Device, _type, &Clock) return Clock, ret @@ -392,7 +392,7 @@ func (Device Device) GetClockInfo(_type ClockType) (uint32, Return) { } // nvml.DeviceGetMaxClockInfo() -func DeviceGetMaxClockInfo(Device Device, _type ClockType) (uint32, Return) { +func (l *library) DeviceGetMaxClockInfo(Device Device, _type ClockType) (uint32, Return) { var Clock uint32 ret := nvmlDeviceGetMaxClockInfo(Device, _type, &Clock) return Clock, ret @@ -403,7 +403,7 @@ func (Device Device) GetMaxClockInfo(_type ClockType) (uint32, Return) { } // nvml.DeviceGetApplicationsClock() -func DeviceGetApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { +func (l *library) DeviceGetApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { var ClockMHz uint32 ret := nvmlDeviceGetApplicationsClock(Device, ClockType, &ClockMHz) return ClockMHz, ret @@ -414,7 +414,7 @@ func (Device Device) GetApplicationsClock(ClockType ClockType) (uint32, Return) } // nvml.DeviceGetDefaultApplicationsClock() -func DeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { +func (l *library) DeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { var ClockMHz uint32 ret := nvmlDeviceGetDefaultApplicationsClock(Device, ClockType, &ClockMHz) return ClockMHz, ret @@ -425,7 +425,7 @@ func (Device Device) GetDefaultApplicationsClock(ClockType ClockType) (uint32, R } // nvml.DeviceResetApplicationsClocks() -func DeviceResetApplicationsClocks(Device Device) Return { +func (l *library) DeviceResetApplicationsClocks(Device Device) Return { return nvmlDeviceResetApplicationsClocks(Device) } @@ -434,7 +434,7 @@ func (Device Device) ResetApplicationsClocks() Return { } // nvml.DeviceGetClock() -func DeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId) (uint32, Return) { +func (l *library) DeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId) (uint32, Return) { var ClockMHz uint32 ret := nvmlDeviceGetClock(Device, ClockType, ClockId, &ClockMHz) return ClockMHz, ret @@ -445,7 +445,7 @@ func (Device Device) GetClock(ClockType ClockType, ClockId ClockId) (uint32, Ret } // nvml.DeviceGetMaxCustomerBoostClock() -func DeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType) (uint32, Return) { +func (l *library) DeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType) (uint32, Return) { var ClockMHz uint32 ret := nvmlDeviceGetMaxCustomerBoostClock(Device, ClockType, &ClockMHz) return ClockMHz, ret @@ -456,7 +456,7 @@ func (Device Device) GetMaxCustomerBoostClock(ClockType ClockType) (uint32, Retu } // nvml.DeviceGetSupportedMemoryClocks() -func DeviceGetSupportedMemoryClocks(Device Device) (int, uint32, Return) { +func (l *library) DeviceGetSupportedMemoryClocks(Device Device) (int, uint32, Return) { var Count, ClocksMHz uint32 ret := nvmlDeviceGetSupportedMemoryClocks(Device, &Count, &ClocksMHz) return int(Count), ClocksMHz, ret @@ -467,7 +467,7 @@ func (Device Device) GetSupportedMemoryClocks() (int, uint32, Return) { } // nvml.DeviceGetSupportedGraphicsClocks() -func DeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz int) (int, uint32, Return) { +func (l *library) DeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz int) (int, uint32, Return) { var Count, ClocksMHz uint32 ret := nvmlDeviceGetSupportedGraphicsClocks(Device, uint32(MemoryClockMHz), &Count, &ClocksMHz) return int(Count), ClocksMHz, ret @@ -478,7 +478,7 @@ func (Device Device) GetSupportedGraphicsClocks(MemoryClockMHz int) (int, uint32 } // nvml.DeviceGetAutoBoostedClocksEnabled() -func DeviceGetAutoBoostedClocksEnabled(Device Device) (EnableState, EnableState, Return) { +func (l *library) DeviceGetAutoBoostedClocksEnabled(Device Device) (EnableState, EnableState, Return) { var IsEnabled, DefaultIsEnabled EnableState ret := nvmlDeviceGetAutoBoostedClocksEnabled(Device, &IsEnabled, &DefaultIsEnabled) return IsEnabled, DefaultIsEnabled, ret @@ -489,7 +489,7 @@ func (Device Device) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Re } // nvml.DeviceSetAutoBoostedClocksEnabled() -func DeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return { +func (l *library) DeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return { return nvmlDeviceSetAutoBoostedClocksEnabled(Device, Enabled) } @@ -498,7 +498,7 @@ func (Device Device) SetAutoBoostedClocksEnabled(Enabled EnableState) Return { } // nvml.DeviceSetDefaultAutoBoostedClocksEnabled() -func DeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return { +func (l *library) DeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return { return nvmlDeviceSetDefaultAutoBoostedClocksEnabled(Device, Enabled, Flags) } @@ -507,7 +507,7 @@ func (Device Device) SetDefaultAutoBoostedClocksEnabled(Enabled EnableState, Fla } // nvml.DeviceGetFanSpeed() -func DeviceGetFanSpeed(Device Device) (uint32, Return) { +func (l *library) DeviceGetFanSpeed(Device Device) (uint32, Return) { var Speed uint32 ret := nvmlDeviceGetFanSpeed(Device, &Speed) return Speed, ret @@ -518,7 +518,7 @@ func (Device Device) GetFanSpeed() (uint32, Return) { } // nvml.DeviceGetFanSpeed_v2() -func DeviceGetFanSpeed_v2(Device Device, Fan int) (uint32, Return) { +func (l *library) DeviceGetFanSpeed_v2(Device Device, Fan int) (uint32, Return) { var Speed uint32 ret := nvmlDeviceGetFanSpeed_v2(Device, uint32(Fan), &Speed) return Speed, ret @@ -529,7 +529,7 @@ func (Device Device) GetFanSpeed_v2(Fan int) (uint32, Return) { } // nvml.DeviceGetNumFans() -func DeviceGetNumFans(Device Device) (int, Return) { +func (l *library) DeviceGetNumFans(Device Device) (int, Return) { var NumFans uint32 ret := nvmlDeviceGetNumFans(Device, &NumFans) return int(NumFans), ret @@ -540,7 +540,7 @@ func (Device Device) GetNumFans() (int, Return) { } // nvml.DeviceGetTemperature() -func DeviceGetTemperature(Device Device, SensorType TemperatureSensors) (uint32, Return) { +func (l *library) DeviceGetTemperature(Device Device, SensorType TemperatureSensors) (uint32, Return) { var Temp uint32 ret := nvmlDeviceGetTemperature(Device, SensorType, &Temp) return Temp, ret @@ -551,7 +551,7 @@ func (Device Device) GetTemperature(SensorType TemperatureSensors) (uint32, Retu } // nvml.DeviceGetTemperatureThreshold() -func DeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds) (uint32, Return) { +func (l *library) DeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds) (uint32, Return) { var Temp uint32 ret := nvmlDeviceGetTemperatureThreshold(Device, ThresholdType, &Temp) return Temp, ret @@ -562,7 +562,7 @@ func (Device Device) GetTemperatureThreshold(ThresholdType TemperatureThresholds } // nvml.DeviceSetTemperatureThreshold() -func DeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp int) Return { +func (l *library) DeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp int) Return { t := int32(Temp) ret := nvmlDeviceSetTemperatureThreshold(Device, ThresholdType, &t) return ret @@ -573,7 +573,7 @@ func (Device Device) SetTemperatureThreshold(ThresholdType TemperatureThresholds } // nvml.DeviceGetPerformanceState() -func DeviceGetPerformanceState(Device Device) (Pstates, Return) { +func (l *library) DeviceGetPerformanceState(Device Device) (Pstates, Return) { var PState Pstates ret := nvmlDeviceGetPerformanceState(Device, &PState) return PState, ret @@ -584,7 +584,7 @@ func (Device Device) GetPerformanceState() (Pstates, Return) { } // nvml.DeviceGetCurrentClocksThrottleReasons() -func DeviceGetCurrentClocksThrottleReasons(Device Device) (uint64, Return) { +func (l *library) DeviceGetCurrentClocksThrottleReasons(Device Device) (uint64, Return) { var ClocksThrottleReasons uint64 ret := nvmlDeviceGetCurrentClocksThrottleReasons(Device, &ClocksThrottleReasons) return ClocksThrottleReasons, ret @@ -595,7 +595,7 @@ func (Device Device) GetCurrentClocksThrottleReasons() (uint64, Return) { } // nvml.DeviceGetSupportedClocksThrottleReasons() -func DeviceGetSupportedClocksThrottleReasons(Device Device) (uint64, Return) { +func (l *library) DeviceGetSupportedClocksThrottleReasons(Device Device) (uint64, Return) { var SupportedClocksThrottleReasons uint64 ret := nvmlDeviceGetSupportedClocksThrottleReasons(Device, &SupportedClocksThrottleReasons) return SupportedClocksThrottleReasons, ret @@ -606,7 +606,7 @@ func (Device Device) GetSupportedClocksThrottleReasons() (uint64, Return) { } // nvml.DeviceGetPowerState() -func DeviceGetPowerState(Device Device) (Pstates, Return) { +func (l *library) DeviceGetPowerState(Device Device) (Pstates, Return) { var PState Pstates ret := nvmlDeviceGetPowerState(Device, &PState) return PState, ret @@ -617,7 +617,7 @@ func (Device Device) GetPowerState() (Pstates, Return) { } // nvml.DeviceGetPowerManagementMode() -func DeviceGetPowerManagementMode(Device Device) (EnableState, Return) { +func (l *library) DeviceGetPowerManagementMode(Device Device) (EnableState, Return) { var Mode EnableState ret := nvmlDeviceGetPowerManagementMode(Device, &Mode) return Mode, ret @@ -628,7 +628,7 @@ func (Device Device) GetPowerManagementMode() (EnableState, Return) { } // nvml.DeviceGetPowerManagementLimit() -func DeviceGetPowerManagementLimit(Device Device) (uint32, Return) { +func (l *library) DeviceGetPowerManagementLimit(Device Device) (uint32, Return) { var Limit uint32 ret := nvmlDeviceGetPowerManagementLimit(Device, &Limit) return Limit, ret @@ -639,7 +639,7 @@ func (Device Device) GetPowerManagementLimit() (uint32, Return) { } // nvml.DeviceGetPowerManagementLimitConstraints() -func DeviceGetPowerManagementLimitConstraints(Device Device) (uint32, uint32, Return) { +func (l *library) DeviceGetPowerManagementLimitConstraints(Device Device) (uint32, uint32, Return) { var MinLimit, MaxLimit uint32 ret := nvmlDeviceGetPowerManagementLimitConstraints(Device, &MinLimit, &MaxLimit) return MinLimit, MaxLimit, ret @@ -650,7 +650,7 @@ func (Device Device) GetPowerManagementLimitConstraints() (uint32, uint32, Retur } // nvml.DeviceGetPowerManagementDefaultLimit() -func DeviceGetPowerManagementDefaultLimit(Device Device) (uint32, Return) { +func (l *library) DeviceGetPowerManagementDefaultLimit(Device Device) (uint32, Return) { var DefaultLimit uint32 ret := nvmlDeviceGetPowerManagementDefaultLimit(Device, &DefaultLimit) return DefaultLimit, ret @@ -661,7 +661,7 @@ func (Device Device) GetPowerManagementDefaultLimit() (uint32, Return) { } // nvml.DeviceGetPowerUsage() -func DeviceGetPowerUsage(Device Device) (uint32, Return) { +func (l *library) DeviceGetPowerUsage(Device Device) (uint32, Return) { var Power uint32 ret := nvmlDeviceGetPowerUsage(Device, &Power) return Power, ret @@ -672,7 +672,7 @@ func (Device Device) GetPowerUsage() (uint32, Return) { } // nvml.DeviceGetTotalEnergyConsumption() -func DeviceGetTotalEnergyConsumption(Device Device) (uint64, Return) { +func (l *library) DeviceGetTotalEnergyConsumption(Device Device) (uint64, Return) { var Energy uint64 ret := nvmlDeviceGetTotalEnergyConsumption(Device, &Energy) return Energy, ret @@ -683,7 +683,7 @@ func (Device Device) GetTotalEnergyConsumption() (uint64, Return) { } // nvml.DeviceGetEnforcedPowerLimit() -func DeviceGetEnforcedPowerLimit(Device Device) (uint32, Return) { +func (l *library) DeviceGetEnforcedPowerLimit(Device Device) (uint32, Return) { var Limit uint32 ret := nvmlDeviceGetEnforcedPowerLimit(Device, &Limit) return Limit, ret @@ -694,7 +694,7 @@ func (Device Device) GetEnforcedPowerLimit() (uint32, Return) { } // nvml.DeviceGetGpuOperationMode() -func DeviceGetGpuOperationMode(Device Device) (GpuOperationMode, GpuOperationMode, Return) { +func (l *library) DeviceGetGpuOperationMode(Device Device) (GpuOperationMode, GpuOperationMode, Return) { var Current, Pending GpuOperationMode ret := nvmlDeviceGetGpuOperationMode(Device, &Current, &Pending) return Current, Pending, ret @@ -705,7 +705,7 @@ func (Device Device) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, } // nvml.DeviceGetMemoryInfo() -func DeviceGetMemoryInfo(Device Device) (Memory, Return) { +func (l *library) DeviceGetMemoryInfo(Device Device) (Memory, Return) { var Memory Memory ret := nvmlDeviceGetMemoryInfo(Device, &Memory) return Memory, ret @@ -716,7 +716,7 @@ func (Device Device) GetMemoryInfo() (Memory, Return) { } // nvml.DeviceGetMemoryInfo_v2() -func DeviceGetMemoryInfo_v2(Device Device) (Memory_v2, Return) { +func (l *library) DeviceGetMemoryInfo_v2(Device Device) (Memory_v2, Return) { var Memory Memory_v2 Memory.Version = STRUCT_VERSION(Memory, 2) ret := nvmlDeviceGetMemoryInfo_v2(Device, &Memory) @@ -728,7 +728,7 @@ func (Device Device) GetMemoryInfo_v2() (Memory_v2, Return) { } // nvml.DeviceGetComputeMode() -func DeviceGetComputeMode(Device Device) (ComputeMode, Return) { +func (l *library) DeviceGetComputeMode(Device Device) (ComputeMode, Return) { var Mode ComputeMode ret := nvmlDeviceGetComputeMode(Device, &Mode) return Mode, ret @@ -739,7 +739,7 @@ func (Device Device) GetComputeMode() (ComputeMode, Return) { } // nvml.DeviceGetCudaComputeCapability() -func DeviceGetCudaComputeCapability(Device Device) (int, int, Return) { +func (l *library) DeviceGetCudaComputeCapability(Device Device) (int, int, Return) { var Major, Minor int32 ret := nvmlDeviceGetCudaComputeCapability(Device, &Major, &Minor) return int(Major), int(Minor), ret @@ -750,7 +750,7 @@ func (Device Device) GetCudaComputeCapability() (int, int, Return) { } // nvml.DeviceGetEccMode() -func DeviceGetEccMode(Device Device) (EnableState, EnableState, Return) { +func (l *library) DeviceGetEccMode(Device Device) (EnableState, EnableState, Return) { var Current, Pending EnableState ret := nvmlDeviceGetEccMode(Device, &Current, &Pending) return Current, Pending, ret @@ -761,7 +761,7 @@ func (Device Device) GetEccMode() (EnableState, EnableState, Return) { } // nvml.DeviceGetBoardId() -func DeviceGetBoardId(Device Device) (uint32, Return) { +func (l *library) DeviceGetBoardId(Device Device) (uint32, Return) { var BoardId uint32 ret := nvmlDeviceGetBoardId(Device, &BoardId) return BoardId, ret @@ -772,7 +772,7 @@ func (Device Device) GetBoardId() (uint32, Return) { } // nvml.DeviceGetMultiGpuBoard() -func DeviceGetMultiGpuBoard(Device Device) (int, Return) { +func (l *library) DeviceGetMultiGpuBoard(Device Device) (int, Return) { var MultiGpuBool uint32 ret := nvmlDeviceGetMultiGpuBoard(Device, &MultiGpuBool) return int(MultiGpuBool), ret @@ -783,7 +783,7 @@ func (Device Device) GetMultiGpuBoard() (int, Return) { } // nvml.DeviceGetTotalEccErrors() -func DeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { +func (l *library) DeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { var EccCounts uint64 ret := nvmlDeviceGetTotalEccErrors(Device, ErrorType, CounterType, &EccCounts) return EccCounts, ret @@ -794,7 +794,7 @@ func (Device Device) GetTotalEccErrors(ErrorType MemoryErrorType, CounterType Ec } // nvml.DeviceGetDetailedEccErrors() -func DeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { +func (l *library) DeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { var EccCounts EccErrorCounts ret := nvmlDeviceGetDetailedEccErrors(Device, ErrorType, CounterType, &EccCounts) return EccCounts, ret @@ -805,7 +805,7 @@ func (Device Device) GetDetailedEccErrors(ErrorType MemoryErrorType, CounterType } // nvml.DeviceGetMemoryErrorCounter() -func DeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { +func (l *library) DeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { var Count uint64 ret := nvmlDeviceGetMemoryErrorCounter(Device, ErrorType, CounterType, LocationType, &Count) return Count, ret @@ -816,7 +816,7 @@ func (Device Device) GetMemoryErrorCounter(ErrorType MemoryErrorType, CounterTyp } // nvml.DeviceGetUtilizationRates() -func DeviceGetUtilizationRates(Device Device) (Utilization, Return) { +func (l *library) DeviceGetUtilizationRates(Device Device) (Utilization, Return) { var Utilization Utilization ret := nvmlDeviceGetUtilizationRates(Device, &Utilization) return Utilization, ret @@ -827,7 +827,7 @@ func (Device Device) GetUtilizationRates() (Utilization, Return) { } // nvml.DeviceGetEncoderUtilization() -func DeviceGetEncoderUtilization(Device Device) (uint32, uint32, Return) { +func (l *library) DeviceGetEncoderUtilization(Device Device) (uint32, uint32, Return) { var Utilization, SamplingPeriodUs uint32 ret := nvmlDeviceGetEncoderUtilization(Device, &Utilization, &SamplingPeriodUs) return Utilization, SamplingPeriodUs, ret @@ -838,7 +838,7 @@ func (Device Device) GetEncoderUtilization() (uint32, uint32, Return) { } // nvml.DeviceGetEncoderCapacity() -func DeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType) (int, Return) { +func (l *library) DeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType) (int, Return) { var EncoderCapacity uint32 ret := nvmlDeviceGetEncoderCapacity(Device, EncoderQueryType, &EncoderCapacity) return int(EncoderCapacity), ret @@ -849,7 +849,7 @@ func (Device Device) GetEncoderCapacity(EncoderQueryType EncoderType) (int, Retu } // nvml.DeviceGetEncoderStats() -func DeviceGetEncoderStats(Device Device) (int, uint32, uint32, Return) { +func (l *library) DeviceGetEncoderStats(Device Device) (int, uint32, uint32, Return) { var SessionCount, AverageFps, AverageLatency uint32 ret := nvmlDeviceGetEncoderStats(Device, &SessionCount, &AverageFps, &AverageLatency) return int(SessionCount), AverageFps, AverageLatency, ret @@ -860,7 +860,7 @@ func (Device Device) GetEncoderStats() (int, uint32, uint32, Return) { } // nvml.DeviceGetEncoderSessions() -func DeviceGetEncoderSessions(Device Device) ([]EncoderSessionInfo, Return) { +func (l *library) DeviceGetEncoderSessions(Device Device) ([]EncoderSessionInfo, Return) { var SessionCount uint32 = 1 // Will be reduced upon returning for { SessionInfos := make([]EncoderSessionInfo, SessionCount) @@ -880,7 +880,7 @@ func (Device Device) GetEncoderSessions() ([]EncoderSessionInfo, Return) { } // nvml.DeviceGetDecoderUtilization() -func DeviceGetDecoderUtilization(Device Device) (uint32, uint32, Return) { +func (l *library) DeviceGetDecoderUtilization(Device Device) (uint32, uint32, Return) { var Utilization, SamplingPeriodUs uint32 ret := nvmlDeviceGetDecoderUtilization(Device, &Utilization, &SamplingPeriodUs) return Utilization, SamplingPeriodUs, ret @@ -891,7 +891,7 @@ func (Device Device) GetDecoderUtilization() (uint32, uint32, Return) { } // nvml.DeviceGetFBCStats() -func DeviceGetFBCStats(Device Device) (FBCStats, Return) { +func (l *library) DeviceGetFBCStats(Device Device) (FBCStats, Return) { var FbcStats FBCStats ret := nvmlDeviceGetFBCStats(Device, &FbcStats) return FbcStats, ret @@ -902,7 +902,7 @@ func (Device Device) GetFBCStats() (FBCStats, Return) { } // nvml.DeviceGetFBCSessions() -func DeviceGetFBCSessions(Device Device) ([]FBCSessionInfo, Return) { +func (l *library) DeviceGetFBCSessions(Device Device) ([]FBCSessionInfo, Return) { var SessionCount uint32 = 1 // Will be reduced upon returning for { SessionInfo := make([]FBCSessionInfo, SessionCount) @@ -922,7 +922,7 @@ func (Device Device) GetFBCSessions() ([]FBCSessionInfo, Return) { } // nvml.DeviceGetDriverModel() -func DeviceGetDriverModel(Device Device) (DriverModel, DriverModel, Return) { +func (l *library) DeviceGetDriverModel(Device Device) (DriverModel, DriverModel, Return) { var Current, Pending DriverModel ret := nvmlDeviceGetDriverModel(Device, &Current, &Pending) return Current, Pending, ret @@ -933,7 +933,7 @@ func (Device Device) GetDriverModel() (DriverModel, DriverModel, Return) { } // nvml.DeviceGetVbiosVersion() -func DeviceGetVbiosVersion(Device Device) (string, Return) { +func (l *library) 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 @@ -944,7 +944,7 @@ func (Device Device) GetVbiosVersion() (string, Return) { } // nvml.DeviceGetBridgeChipInfo() -func DeviceGetBridgeChipInfo(Device Device) (BridgeChipHierarchy, Return) { +func (l *library) DeviceGetBridgeChipInfo(Device Device) (BridgeChipHierarchy, Return) { var BridgeHierarchy BridgeChipHierarchy ret := nvmlDeviceGetBridgeChipInfo(Device, &BridgeHierarchy) return BridgeHierarchy, ret @@ -1000,6 +1000,10 @@ func deviceGetComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) } } +func (l *library) DeviceGetComputeRunningProcesses(Device Device) ([]ProcessInfo, Return) { + return deviceGetComputeRunningProcesses(Device) +} + func (Device Device) GetComputeRunningProcesses() ([]ProcessInfo, Return) { return DeviceGetComputeRunningProcesses(Device) } @@ -1050,6 +1054,10 @@ func deviceGetGraphicsRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) } } +func (l *library) DeviceGetGraphicsRunningProcesses(Device Device) ([]ProcessInfo, Return) { + return deviceGetGraphicsRunningProcesses(Device) +} + func (Device Device) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { return DeviceGetGraphicsRunningProcesses(Device) } @@ -1100,12 +1108,16 @@ func deviceGetMPSComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Retur } } +func (l *library) DeviceGetMPSComputeRunningProcesses(Device Device) ([]ProcessInfo, Return) { + return deviceGetMPSComputeRunningProcesses(Device) +} + func (Device Device) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { return DeviceGetMPSComputeRunningProcesses(Device) } // nvml.DeviceOnSameBoard() -func DeviceOnSameBoard(Device1 Device, Device2 Device) (int, Return) { +func (l *library) DeviceOnSameBoard(Device1 Device, Device2 Device) (int, Return) { var OnSameBoard int32 ret := nvmlDeviceOnSameBoard(Device1, Device2, &OnSameBoard) return int(OnSameBoard), ret @@ -1116,7 +1128,7 @@ func (Device1 Device) OnSameBoard(Device2 Device) (int, Return) { } // nvml.DeviceGetAPIRestriction() -func DeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI) (EnableState, Return) { +func (l *library) DeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI) (EnableState, Return) { var IsRestricted EnableState ret := nvmlDeviceGetAPIRestriction(Device, ApiType, &IsRestricted) return IsRestricted, ret @@ -1127,7 +1139,7 @@ func (Device Device) GetAPIRestriction(ApiType RestrictedAPI) (EnableState, Retu } // nvml.DeviceGetSamples() -func DeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { +func (l *library) DeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { var SampleValType ValueType var SampleCount uint32 ret := nvmlDeviceGetSamples(Device, _type, LastSeenTimeStamp, &SampleValType, &SampleCount, nil) @@ -1147,7 +1159,7 @@ func (Device Device) GetSamples(_type SamplingType, LastSeenTimeStamp uint64) (V } // nvml.DeviceGetBAR1MemoryInfo() -func DeviceGetBAR1MemoryInfo(Device Device) (BAR1Memory, Return) { +func (l *library) DeviceGetBAR1MemoryInfo(Device Device) (BAR1Memory, Return) { var Bar1Memory BAR1Memory ret := nvmlDeviceGetBAR1MemoryInfo(Device, &Bar1Memory) return Bar1Memory, ret @@ -1158,7 +1170,7 @@ func (Device Device) GetBAR1MemoryInfo() (BAR1Memory, Return) { } // nvml.DeviceGetViolationStatus() -func DeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType) (ViolationTime, Return) { +func (l *library) DeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType) (ViolationTime, Return) { var ViolTime ViolationTime ret := nvmlDeviceGetViolationStatus(Device, PerfPolicyType, &ViolTime) return ViolTime, ret @@ -1169,7 +1181,7 @@ func (Device Device) GetViolationStatus(PerfPolicyType PerfPolicyType) (Violatio } // nvml.DeviceGetIrqNum() -func DeviceGetIrqNum(Device Device) (int, Return) { +func (l *library) DeviceGetIrqNum(Device Device) (int, Return) { var IrqNum uint32 ret := nvmlDeviceGetIrqNum(Device, &IrqNum) return int(IrqNum), ret @@ -1180,7 +1192,7 @@ func (Device Device) GetIrqNum() (int, Return) { } // nvml.DeviceGetNumGpuCores() -func DeviceGetNumGpuCores(Device Device) (int, Return) { +func (l *library) DeviceGetNumGpuCores(Device Device) (int, Return) { var NumCores uint32 ret := nvmlDeviceGetNumGpuCores(Device, &NumCores) return int(NumCores), ret @@ -1191,7 +1203,7 @@ func (Device Device) GetNumGpuCores() (int, Return) { } // nvml.DeviceGetPowerSource() -func DeviceGetPowerSource(Device Device) (PowerSource, Return) { +func (l *library) DeviceGetPowerSource(Device Device) (PowerSource, Return) { var PowerSource PowerSource ret := nvmlDeviceGetPowerSource(Device, &PowerSource) return PowerSource, ret @@ -1202,7 +1214,7 @@ func (Device Device) GetPowerSource() (PowerSource, Return) { } // nvml.DeviceGetMemoryBusWidth() -func DeviceGetMemoryBusWidth(Device Device) (uint32, Return) { +func (l *library) DeviceGetMemoryBusWidth(Device Device) (uint32, Return) { var BusWidth uint32 ret := nvmlDeviceGetMemoryBusWidth(Device, &BusWidth) return BusWidth, ret @@ -1213,7 +1225,7 @@ func (Device Device) GetMemoryBusWidth() (uint32, Return) { } // nvml.DeviceGetPcieLinkMaxSpeed() -func DeviceGetPcieLinkMaxSpeed(Device Device) (uint32, Return) { +func (l *library) DeviceGetPcieLinkMaxSpeed(Device Device) (uint32, Return) { var MaxSpeed uint32 ret := nvmlDeviceGetPcieLinkMaxSpeed(Device, &MaxSpeed) return MaxSpeed, ret @@ -1224,7 +1236,7 @@ func (Device Device) GetPcieLinkMaxSpeed() (uint32, Return) { } // nvml.DeviceGetAdaptiveClockInfoStatus() -func DeviceGetAdaptiveClockInfoStatus(Device Device) (uint32, Return) { +func (l *library) DeviceGetAdaptiveClockInfoStatus(Device Device) (uint32, Return) { var AdaptiveClockStatus uint32 ret := nvmlDeviceGetAdaptiveClockInfoStatus(Device, &AdaptiveClockStatus) return AdaptiveClockStatus, ret @@ -1235,7 +1247,7 @@ func (Device Device) GetAdaptiveClockInfoStatus() (uint32, Return) { } // nvml.DeviceGetAccountingMode() -func DeviceGetAccountingMode(Device Device) (EnableState, Return) { +func (l *library) DeviceGetAccountingMode(Device Device) (EnableState, Return) { var Mode EnableState ret := nvmlDeviceGetAccountingMode(Device, &Mode) return Mode, ret @@ -1246,7 +1258,7 @@ func (Device Device) GetAccountingMode() (EnableState, Return) { } // nvml.DeviceGetAccountingStats() -func DeviceGetAccountingStats(Device Device, Pid uint32) (AccountingStats, Return) { +func (l *library) DeviceGetAccountingStats(Device Device, Pid uint32) (AccountingStats, Return) { var Stats AccountingStats ret := nvmlDeviceGetAccountingStats(Device, Pid, &Stats) return Stats, ret @@ -1257,7 +1269,7 @@ func (Device Device) GetAccountingStats(Pid uint32) (AccountingStats, Return) { } // nvml.DeviceGetAccountingPids() -func DeviceGetAccountingPids(Device Device) ([]int, Return) { +func (l *library) DeviceGetAccountingPids(Device Device) ([]int, Return) { var Count uint32 = 1 // Will be reduced upon returning for { Pids := make([]uint32, Count) @@ -1277,7 +1289,7 @@ func (Device Device) GetAccountingPids() ([]int, Return) { } // nvml.DeviceGetAccountingBufferSize() -func DeviceGetAccountingBufferSize(Device Device) (int, Return) { +func (l *library) DeviceGetAccountingBufferSize(Device Device) (int, Return) { var BufferSize uint32 ret := nvmlDeviceGetAccountingBufferSize(Device, &BufferSize) return int(BufferSize), ret @@ -1288,7 +1300,7 @@ func (Device Device) GetAccountingBufferSize() (int, Return) { } // nvml.DeviceGetRetiredPages() -func DeviceGetRetiredPages(Device Device, Cause PageRetirementCause) ([]uint64, Return) { +func (l *library) DeviceGetRetiredPages(Device Device, Cause PageRetirementCause) ([]uint64, Return) { var PageCount uint32 = 1 // Will be reduced upon returning for { Addresses := make([]uint64, PageCount) @@ -1308,7 +1320,7 @@ func (Device Device) GetRetiredPages(Cause PageRetirementCause) ([]uint64, Retur } // nvml.DeviceGetRetiredPages_v2() -func DeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause) ([]uint64, []uint64, Return) { +func (l *library) DeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause) ([]uint64, []uint64, Return) { var PageCount uint32 = 1 // Will be reduced upon returning for { Addresses := make([]uint64, PageCount) @@ -1329,7 +1341,7 @@ func (Device Device) GetRetiredPages_v2(Cause PageRetirementCause) ([]uint64, [] } // nvml.DeviceGetRetiredPagesPendingStatus() -func DeviceGetRetiredPagesPendingStatus(Device Device) (EnableState, Return) { +func (l *library) DeviceGetRetiredPagesPendingStatus(Device Device) (EnableState, Return) { var IsPending EnableState ret := nvmlDeviceGetRetiredPagesPendingStatus(Device, &IsPending) return IsPending, ret @@ -1340,7 +1352,7 @@ func (Device Device) GetRetiredPagesPendingStatus() (EnableState, Return) { } // nvml.DeviceSetPersistenceMode() -func DeviceSetPersistenceMode(Device Device, Mode EnableState) Return { +func (l *library) DeviceSetPersistenceMode(Device Device, Mode EnableState) Return { return nvmlDeviceSetPersistenceMode(Device, Mode) } @@ -1349,7 +1361,7 @@ func (Device Device) SetPersistenceMode(Mode EnableState) Return { } // nvml.DeviceSetComputeMode() -func DeviceSetComputeMode(Device Device, Mode ComputeMode) Return { +func (l *library) DeviceSetComputeMode(Device Device, Mode ComputeMode) Return { return nvmlDeviceSetComputeMode(Device, Mode) } @@ -1358,7 +1370,7 @@ func (Device Device) SetComputeMode(Mode ComputeMode) Return { } // nvml.DeviceSetEccMode() -func DeviceSetEccMode(Device Device, Ecc EnableState) Return { +func (l *library) DeviceSetEccMode(Device Device, Ecc EnableState) Return { return nvmlDeviceSetEccMode(Device, Ecc) } @@ -1367,7 +1379,7 @@ func (Device Device) SetEccMode(Ecc EnableState) Return { } // nvml.DeviceClearEccErrorCounts() -func DeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return { +func (l *library) DeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return { return nvmlDeviceClearEccErrorCounts(Device, CounterType) } @@ -1376,7 +1388,7 @@ func (Device Device) ClearEccErrorCounts(CounterType EccCounterType) Return { } // nvml.DeviceSetDriverModel() -func DeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return { +func (l *library) DeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return { return nvmlDeviceSetDriverModel(Device, DriverModel, Flags) } @@ -1385,7 +1397,7 @@ func (Device Device) SetDriverModel(DriverModel DriverModel, Flags uint32) Retur } // nvml.DeviceSetGpuLockedClocks() -func DeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { +func (l *library) DeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { return nvmlDeviceSetGpuLockedClocks(Device, MinGpuClockMHz, MaxGpuClockMHz) } @@ -1394,7 +1406,7 @@ func (Device Device) SetGpuLockedClocks(MinGpuClockMHz uint32, MaxGpuClockMHz ui } // nvml.DeviceResetGpuLockedClocks() -func DeviceResetGpuLockedClocks(Device Device) Return { +func (l *library) DeviceResetGpuLockedClocks(Device Device) Return { return nvmlDeviceResetGpuLockedClocks(Device) } @@ -1403,7 +1415,7 @@ func (Device Device) ResetGpuLockedClocks() Return { } // nvmlDeviceSetMemoryLockedClocks() -func DeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { +func (l *library) DeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { return nvmlDeviceSetMemoryLockedClocks(Device, MinMemClockMHz, MaxMemClockMHz) } @@ -1412,7 +1424,7 @@ func (Device Device) SetMemoryLockedClocks(NinMemClockMHz uint32, MaxMemClockMHz } // nvmlDeviceResetMemoryLockedClocks() -func DeviceResetMemoryLockedClocks(Device Device) Return { +func (l *library) DeviceResetMemoryLockedClocks(Device Device) Return { return nvmlDeviceResetMemoryLockedClocks(Device) } @@ -1421,7 +1433,7 @@ func (Device Device) ResetMemoryLockedClocks() Return { } // nvml.DeviceGetClkMonStatus() -func DeviceGetClkMonStatus(Device Device) (ClkMonStatus, Return) { +func (l *library) DeviceGetClkMonStatus(Device Device) (ClkMonStatus, Return) { var Status ClkMonStatus ret := nvmlDeviceGetClkMonStatus(Device, &Status) return Status, ret @@ -1432,7 +1444,7 @@ func (Device Device) GetClkMonStatus() (ClkMonStatus, Return) { } // nvml.DeviceSetApplicationsClocks() -func DeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return { +func (l *library) DeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return { return nvmlDeviceSetApplicationsClocks(Device, MemClockMHz, GraphicsClockMHz) } @@ -1441,7 +1453,7 @@ func (Device Device) SetApplicationsClocks(MemClockMHz uint32, GraphicsClockMHz } // nvml.DeviceSetPowerManagementLimit() -func DeviceSetPowerManagementLimit(Device Device, Limit uint32) Return { +func (l *library) DeviceSetPowerManagementLimit(Device Device, Limit uint32) Return { return nvmlDeviceSetPowerManagementLimit(Device, Limit) } @@ -1450,7 +1462,7 @@ func (Device Device) SetPowerManagementLimit(Limit uint32) Return { } // nvml.DeviceSetGpuOperationMode() -func DeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return { +func (l *library) DeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return { return nvmlDeviceSetGpuOperationMode(Device, Mode) } @@ -1459,7 +1471,7 @@ func (Device Device) SetGpuOperationMode(Mode GpuOperationMode) Return { } // nvml.DeviceSetAPIRestriction() -func DeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return { +func (l *library) DeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return { return nvmlDeviceSetAPIRestriction(Device, ApiType, IsRestricted) } @@ -1468,7 +1480,7 @@ func (Device Device) SetAPIRestriction(ApiType RestrictedAPI, IsRestricted Enabl } // nvml.DeviceSetAccountingMode() -func DeviceSetAccountingMode(Device Device, Mode EnableState) Return { +func (l *library) DeviceSetAccountingMode(Device Device, Mode EnableState) Return { return nvmlDeviceSetAccountingMode(Device, Mode) } @@ -1477,7 +1489,7 @@ func (Device Device) SetAccountingMode(Mode EnableState) Return { } // nvml.DeviceClearAccountingPids() -func DeviceClearAccountingPids(Device Device) Return { +func (l *library) DeviceClearAccountingPids(Device Device) Return { return nvmlDeviceClearAccountingPids(Device) } @@ -1486,7 +1498,7 @@ func (Device Device) ClearAccountingPids() Return { } // nvml.DeviceGetNvLinkState() -func DeviceGetNvLinkState(Device Device, Link int) (EnableState, Return) { +func (l *library) DeviceGetNvLinkState(Device Device, Link int) (EnableState, Return) { var IsActive EnableState ret := nvmlDeviceGetNvLinkState(Device, uint32(Link), &IsActive) return IsActive, ret @@ -1497,7 +1509,7 @@ func (Device Device) GetNvLinkState(Link int) (EnableState, Return) { } // nvml.DeviceGetNvLinkVersion() -func DeviceGetNvLinkVersion(Device Device, Link int) (uint32, Return) { +func (l *library) DeviceGetNvLinkVersion(Device Device, Link int) (uint32, Return) { var Version uint32 ret := nvmlDeviceGetNvLinkVersion(Device, uint32(Link), &Version) return Version, ret @@ -1508,7 +1520,7 @@ func (Device Device) GetNvLinkVersion(Link int) (uint32, Return) { } // nvml.DeviceGetNvLinkCapability() -func DeviceGetNvLinkCapability(Device Device, Link int, Capability NvLinkCapability) (uint32, Return) { +func (l *library) DeviceGetNvLinkCapability(Device Device, Link int, Capability NvLinkCapability) (uint32, Return) { var CapResult uint32 ret := nvmlDeviceGetNvLinkCapability(Device, uint32(Link), Capability, &CapResult) return CapResult, ret @@ -1519,7 +1531,7 @@ func (Device Device) GetNvLinkCapability(Link int, Capability NvLinkCapability) } // nvml.DeviceGetNvLinkRemotePciInfo() -func DeviceGetNvLinkRemotePciInfo(Device Device, Link int) (PciInfo, Return) { +func (l *library) DeviceGetNvLinkRemotePciInfo(Device Device, Link int) (PciInfo, Return) { var Pci PciInfo ret := nvmlDeviceGetNvLinkRemotePciInfo(Device, uint32(Link), &Pci) return Pci, ret @@ -1530,7 +1542,7 @@ func (Device Device) GetNvLinkRemotePciInfo(Link int) (PciInfo, Return) { } // nvml.DeviceGetNvLinkErrorCounter() -func DeviceGetNvLinkErrorCounter(Device Device, Link int, Counter NvLinkErrorCounter) (uint64, Return) { +func (l *library) DeviceGetNvLinkErrorCounter(Device Device, Link int, Counter NvLinkErrorCounter) (uint64, Return) { var CounterValue uint64 ret := nvmlDeviceGetNvLinkErrorCounter(Device, uint32(Link), Counter, &CounterValue) return CounterValue, ret @@ -1541,7 +1553,7 @@ func (Device Device) GetNvLinkErrorCounter(Link int, Counter NvLinkErrorCounter) } // nvml.DeviceResetNvLinkErrorCounters() -func DeviceResetNvLinkErrorCounters(Device Device, Link int) Return { +func (l *library) DeviceResetNvLinkErrorCounters(Device Device, Link int) Return { return nvmlDeviceResetNvLinkErrorCounters(Device, uint32(Link)) } @@ -1550,7 +1562,7 @@ func (Device Device) ResetNvLinkErrorCounters(Link int) Return { } // nvml.DeviceSetNvLinkUtilizationControl() -func DeviceSetNvLinkUtilizationControl(Device Device, Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { +func (l *library) DeviceSetNvLinkUtilizationControl(Device Device, Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { reset := uint32(0) if Reset { reset = 1 @@ -1563,7 +1575,7 @@ func (Device Device) SetNvLinkUtilizationControl(Link int, Counter int, Control } // nvml.DeviceGetNvLinkUtilizationControl() -func DeviceGetNvLinkUtilizationControl(Device Device, Link int, Counter int) (NvLinkUtilizationControl, Return) { +func (l *library) DeviceGetNvLinkUtilizationControl(Device Device, Link int, Counter int) (NvLinkUtilizationControl, Return) { var Control NvLinkUtilizationControl ret := nvmlDeviceGetNvLinkUtilizationControl(Device, uint32(Link), uint32(Counter), &Control) return Control, ret @@ -1574,7 +1586,7 @@ func (Device Device) GetNvLinkUtilizationControl(Link int, Counter int) (NvLinkU } // nvml.DeviceGetNvLinkUtilizationCounter() -func DeviceGetNvLinkUtilizationCounter(Device Device, Link int, Counter int) (uint64, uint64, Return) { +func (l *library) 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 @@ -1585,7 +1597,7 @@ func (Device Device) GetNvLinkUtilizationCounter(Link int, Counter int) (uint64, } // nvml.DeviceFreezeNvLinkUtilizationCounter() -func DeviceFreezeNvLinkUtilizationCounter(Device Device, Link int, Counter int, Freeze EnableState) Return { +func (l *library) DeviceFreezeNvLinkUtilizationCounter(Device Device, Link int, Counter int, Freeze EnableState) Return { return nvmlDeviceFreezeNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter), Freeze) } @@ -1594,7 +1606,7 @@ func (Device Device) FreezeNvLinkUtilizationCounter(Link int, Counter int, Freez } // nvml.DeviceResetNvLinkUtilizationCounter() -func DeviceResetNvLinkUtilizationCounter(Device Device, Link int, Counter int) Return { +func (l *library) DeviceResetNvLinkUtilizationCounter(Device Device, Link int, Counter int) Return { return nvmlDeviceResetNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter)) } @@ -1603,7 +1615,7 @@ func (Device Device) ResetNvLinkUtilizationCounter(Link int, Counter int) Return } // nvml.DeviceGetNvLinkRemoteDeviceType() -func DeviceGetNvLinkRemoteDeviceType(Device Device, Link int) (IntNvLinkDeviceType, Return) { +func (l *library) DeviceGetNvLinkRemoteDeviceType(Device Device, Link int) (IntNvLinkDeviceType, Return) { var NvLinkDeviceType IntNvLinkDeviceType ret := nvmlDeviceGetNvLinkRemoteDeviceType(Device, uint32(Link), &NvLinkDeviceType) return NvLinkDeviceType, ret @@ -1614,7 +1626,7 @@ func (Device Device) GetNvLinkRemoteDeviceType(Link int) (IntNvLinkDeviceType, R } // nvml.DeviceRegisterEvents() -func DeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return { +func (l *library) DeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return { return nvmlDeviceRegisterEvents(Device, EventTypes, Set) } @@ -1623,7 +1635,7 @@ func (Device Device) RegisterEvents(EventTypes uint64, Set EventSet) Return { } // nvmlDeviceGetSupportedEventTypes() -func DeviceGetSupportedEventTypes(Device Device) (uint64, Return) { +func (l *library) DeviceGetSupportedEventTypes(Device Device) (uint64, Return) { var EventTypes uint64 ret := nvmlDeviceGetSupportedEventTypes(Device, &EventTypes) return EventTypes, ret @@ -1634,36 +1646,36 @@ func (Device Device) GetSupportedEventTypes() (uint64, Return) { } // nvml.DeviceModifyDrainState() -func DeviceModifyDrainState(PciInfo *PciInfo, NewState EnableState) Return { +func (l *library) DeviceModifyDrainState(PciInfo *PciInfo, NewState EnableState) Return { return nvmlDeviceModifyDrainState(PciInfo, NewState) } // nvml.DeviceQueryDrainState() -func DeviceQueryDrainState(PciInfo *PciInfo) (EnableState, Return) { +func (l *library) DeviceQueryDrainState(PciInfo *PciInfo) (EnableState, Return) { var CurrentState EnableState ret := nvmlDeviceQueryDrainState(PciInfo, &CurrentState) return CurrentState, ret } // nvml.DeviceRemoveGpu() -func DeviceRemoveGpu(PciInfo *PciInfo) Return { +func (l *library) DeviceRemoveGpu(PciInfo *PciInfo) Return { return nvmlDeviceRemoveGpu(PciInfo) } // nvml.DeviceRemoveGpu_v2() -func DeviceRemoveGpu_v2(PciInfo *PciInfo, GpuState DetachGpuState, LinkState PcieLinkState) Return { +func (l *library) DeviceRemoveGpu_v2(PciInfo *PciInfo, GpuState DetachGpuState, LinkState PcieLinkState) Return { return nvmlDeviceRemoveGpu_v2(PciInfo, GpuState, LinkState) } // nvml.DeviceDiscoverGpus() -func DeviceDiscoverGpus() (PciInfo, Return) { +func (l *library) DeviceDiscoverGpus() (PciInfo, Return) { var PciInfo PciInfo ret := nvmlDeviceDiscoverGpus(&PciInfo) return PciInfo, ret } // nvml.DeviceGetFieldValues() -func DeviceGetFieldValues(Device Device, Values []FieldValue) Return { +func (l *library) DeviceGetFieldValues(Device Device, Values []FieldValue) Return { ValuesCount := len(Values) return nvmlDeviceGetFieldValues(Device, int32(ValuesCount), &Values[0]) } @@ -1673,7 +1685,7 @@ func (Device Device) GetFieldValues(Values []FieldValue) Return { } // nvml.DeviceGetVirtualizationMode() -func DeviceGetVirtualizationMode(Device Device) (GpuVirtualizationMode, Return) { +func (l *library) DeviceGetVirtualizationMode(Device Device) (GpuVirtualizationMode, Return) { var PVirtualMode GpuVirtualizationMode ret := nvmlDeviceGetVirtualizationMode(Device, &PVirtualMode) return PVirtualMode, ret @@ -1684,7 +1696,7 @@ func (Device Device) GetVirtualizationMode() (GpuVirtualizationMode, Return) { } // nvml.DeviceGetHostVgpuMode() -func DeviceGetHostVgpuMode(Device Device) (HostVgpuMode, Return) { +func (l *library) DeviceGetHostVgpuMode(Device Device) (HostVgpuMode, Return) { var PHostVgpuMode HostVgpuMode ret := nvmlDeviceGetHostVgpuMode(Device, &PHostVgpuMode) return PHostVgpuMode, ret @@ -1695,7 +1707,7 @@ func (Device Device) GetHostVgpuMode() (HostVgpuMode, Return) { } // nvml.DeviceSetVirtualizationMode() -func DeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return { +func (l *library) DeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return { return nvmlDeviceSetVirtualizationMode(Device, VirtualMode) } @@ -1704,7 +1716,7 @@ func (Device Device) SetVirtualizationMode(VirtualMode GpuVirtualizationMode) Re } // nvml.DeviceGetGridLicensableFeatures() -func DeviceGetGridLicensableFeatures(Device Device) (GridLicensableFeatures, Return) { +func (l *library) DeviceGetGridLicensableFeatures(Device Device) (GridLicensableFeatures, Return) { var PGridLicensableFeatures GridLicensableFeatures ret := nvmlDeviceGetGridLicensableFeatures(Device, &PGridLicensableFeatures) return PGridLicensableFeatures, ret @@ -1715,7 +1727,7 @@ func (Device Device) GetGridLicensableFeatures() (GridLicensableFeatures, Return } // nvml.DeviceGetProcessUtilization() -func DeviceGetProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) { +func (l *library) DeviceGetProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) { var ProcessSamplesCount uint32 ret := nvmlDeviceGetProcessUtilization(Device, nil, &ProcessSamplesCount, LastSeenTimeStamp) if ret != ERROR_INSUFFICIENT_SIZE { @@ -1734,7 +1746,7 @@ func (Device Device) GetProcessUtilization(LastSeenTimeStamp uint64) ([]ProcessU } // nvml.DeviceGetSupportedVgpus() -func DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) { +func (l *library) DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { VgpuTypeIds := make([]VgpuTypeId, VgpuCount) @@ -1754,7 +1766,7 @@ func (Device Device) GetSupportedVgpus() ([]VgpuTypeId, Return) { } // nvml.DeviceGetCreatableVgpus() -func DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) { +func (l *library) DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { VgpuTypeIds := make([]VgpuTypeId, VgpuCount) @@ -1774,7 +1786,7 @@ func (Device Device) GetCreatableVgpus() ([]VgpuTypeId, Return) { } // nvml.DeviceGetActiveVgpus() -func DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) { +func (l *library) DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { VgpuInstances := make([]VgpuInstance, VgpuCount) @@ -1794,7 +1806,7 @@ func (Device Device) GetActiveVgpus() ([]VgpuInstance, Return) { } // nvml.DeviceGetVgpuMetadata() -func DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return) { +func (l *library) DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return) { var VgpuPgpuMetadata VgpuPgpuMetadata OpaqueDataSize := unsafe.Sizeof(VgpuPgpuMetadata.nvmlVgpuPgpuMetadata.OpaqueData) VgpuPgpuMetadataSize := unsafe.Sizeof(VgpuPgpuMetadata.nvmlVgpuPgpuMetadata) - OpaqueDataSize @@ -1820,7 +1832,7 @@ func (Device Device) GetVgpuMetadata() (VgpuPgpuMetadata, Return) { } // nvml.DeviceGetPgpuMetadataString() -func DeviceGetPgpuMetadataString(Device Device) (string, Return) { +func (l *library) DeviceGetPgpuMetadataString(Device Device) (string, Return) { var BufferSize uint32 = 1 // Will be reduced upon returning for { PgpuMetadata := make([]byte, BufferSize) @@ -1840,7 +1852,7 @@ func (Device Device) GetPgpuMetadataString() (string, Return) { } // nvml.DeviceGetVgpuUtilization() -func DeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { +func (l *library) DeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { var SampleValType ValueType var VgpuInstanceSamplesCount uint32 = 1 // Will be reduced upon returning for { @@ -1861,7 +1873,7 @@ func (Device Device) GetVgpuUtilization(LastSeenTimeStamp uint64) (ValueType, [] } // nvml.DeviceGetAttributes() -func DeviceGetAttributes(Device Device) (DeviceAttributes, Return) { +func (l *library) DeviceGetAttributes(Device Device) (DeviceAttributes, Return) { var Attributes DeviceAttributes ret := nvmlDeviceGetAttributes(Device, &Attributes) return Attributes, ret @@ -1872,7 +1884,7 @@ func (Device Device) GetAttributes() (DeviceAttributes, Return) { } // nvml.DeviceGetRemappedRows() -func DeviceGetRemappedRows(Device Device) (int, int, bool, bool, Return) { +func (l *library) 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 @@ -1883,7 +1895,7 @@ func (Device Device) GetRemappedRows() (int, int, bool, bool, Return) { } // nvml.DeviceGetRowRemapperHistogram() -func DeviceGetRowRemapperHistogram(Device Device) (RowRemapperHistogramValues, Return) { +func (l *library) DeviceGetRowRemapperHistogram(Device Device) (RowRemapperHistogramValues, Return) { var Values RowRemapperHistogramValues ret := nvmlDeviceGetRowRemapperHistogram(Device, &Values) return Values, ret @@ -1894,7 +1906,7 @@ func (Device Device) GetRowRemapperHistogram() (RowRemapperHistogramValues, Retu } // nvml.DeviceGetArchitecture() -func DeviceGetArchitecture(Device Device) (DeviceArchitecture, Return) { +func (l *library) DeviceGetArchitecture(Device Device) (DeviceArchitecture, Return) { var Arch DeviceArchitecture ret := nvmlDeviceGetArchitecture(Device, &Arch) return Arch, ret @@ -1905,7 +1917,7 @@ func (Device Device) GetArchitecture() (DeviceArchitecture, Return) { } // nvml.DeviceGetVgpuProcessUtilization() -func DeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) { +func (l *library) DeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) { var VgpuProcessSamplesCount uint32 = 1 // Will be reduced upon returning for { UtilizationSamples := make([]VgpuProcessUtilizationSample, VgpuProcessSamplesCount) @@ -1925,21 +1937,21 @@ func (Device Device) GetVgpuProcessUtilization(LastSeenTimeStamp uint64) ([]Vgpu } // nvml.GetExcludedDeviceCount() -func GetExcludedDeviceCount() (int, Return) { +func (l *library) GetExcludedDeviceCount() (int, Return) { var DeviceCount uint32 ret := nvmlGetExcludedDeviceCount(&DeviceCount) return int(DeviceCount), ret } // nvml.GetExcludedDeviceInfoByIndex() -func GetExcludedDeviceInfoByIndex(Index int) (ExcludedDeviceInfo, Return) { +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) { +func (l *library) DeviceSetMigMode(Device Device, Mode int) (Return, Return) { var ActivationStatus Return ret := nvmlDeviceSetMigMode(Device, uint32(Mode), &ActivationStatus) return ActivationStatus, ret @@ -1950,7 +1962,7 @@ func (Device Device) SetMigMode(Mode int) (Return, Return) { } // nvml.DeviceGetMigMode() -func DeviceGetMigMode(Device Device) (int, int, Return) { +func (l *library) DeviceGetMigMode(Device Device) (int, int, Return) { var CurrentMode, PendingMode uint32 ret := nvmlDeviceGetMigMode(Device, &CurrentMode, &PendingMode) return int(CurrentMode), int(PendingMode), ret @@ -1961,7 +1973,7 @@ func (Device Device) GetMigMode() (int, int, Return) { } // nvml.DeviceGetGpuInstanceProfileInfo() -func DeviceGetGpuInstanceProfileInfo(Device Device, Profile int) (GpuInstanceProfileInfo, Return) { +func (l *library) DeviceGetGpuInstanceProfileInfo(Device Device, Profile int) (GpuInstanceProfileInfo, Return) { var Info GpuInstanceProfileInfo ret := nvmlDeviceGetGpuInstanceProfileInfo(Device, uint32(Profile), &Info) return Info, ret @@ -1988,7 +2000,7 @@ func (InfoV GpuInstanceProfileInfoV) V2() (GpuInstanceProfileInfo_v2, Return) { return Info, ret } -func DeviceGetGpuInstanceProfileInfoV(Device Device, Profile int) GpuInstanceProfileInfoV { +func (l *library) DeviceGetGpuInstanceProfileInfoV(Device Device, Profile int) GpuInstanceProfileInfoV { return GpuInstanceProfileInfoV{Device, Profile} } @@ -1997,7 +2009,7 @@ func (Device Device) GetGpuInstanceProfileInfoV(Profile int) GpuInstanceProfileI } // nvml.DeviceGetGpuInstancePossiblePlacements() -func DeviceGetGpuInstancePossiblePlacements(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { +func (l *library) DeviceGetGpuInstancePossiblePlacements(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { if Info == nil { return nil, ERROR_INVALID_ARGUMENT } @@ -2019,7 +2031,7 @@ func (Device Device) GetGpuInstancePossiblePlacements(Info *GpuInstanceProfileIn } // nvml.DeviceGetGpuInstanceRemainingCapacity() -func DeviceGetGpuInstanceRemainingCapacity(Device Device, Info *GpuInstanceProfileInfo) (int, Return) { +func (l *library) DeviceGetGpuInstanceRemainingCapacity(Device Device, Info *GpuInstanceProfileInfo) (int, Return) { if Info == nil { return 0, ERROR_INVALID_ARGUMENT } @@ -2033,7 +2045,7 @@ func (Device Device) GetGpuInstanceRemainingCapacity(Info *GpuInstanceProfileInf } // nvml.DeviceCreateGpuInstance() -func DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfileInfo) (GpuInstance, Return) { +func (l *library) DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfileInfo) (GpuInstance, Return) { if Info == nil { return GpuInstance{}, ERROR_INVALID_ARGUMENT } @@ -2047,7 +2059,7 @@ func (Device Device) CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstanc } // nvml.DeviceCreateGpuInstanceWithPlacement() -func DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { +func (l *library) DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { if Info == nil { return GpuInstance{}, ERROR_INVALID_ARGUMENT } @@ -2061,7 +2073,7 @@ func (Device Device) CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo } // nvml.GpuInstanceDestroy() -func GpuInstanceDestroy(GpuInstance GpuInstance) Return { +func (l *library) GpuInstanceDestroy(GpuInstance GpuInstance) Return { return nvmlGpuInstanceDestroy(GpuInstance) } @@ -2070,7 +2082,7 @@ func (GpuInstance GpuInstance) Destroy() Return { } // nvml.DeviceGetGpuInstances() -func DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { +func (l *library) DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { if Info == nil { return nil, ERROR_INVALID_ARGUMENT } @@ -2085,7 +2097,7 @@ func (Device Device) GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstanc } // nvml.DeviceGetGpuInstanceById() -func DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, Return) { +func (l *library) DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, Return) { var GpuInstance GpuInstance ret := nvmlDeviceGetGpuInstanceById(Device, uint32(Id), &GpuInstance) return GpuInstance, ret @@ -2096,7 +2108,7 @@ func (Device Device) GetGpuInstanceById(Id int) (GpuInstance, Return) { } // nvml.GpuInstanceGetInfo() -func GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) { +func (l *library) GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) { var Info GpuInstanceInfo ret := nvmlGpuInstanceGetInfo(GpuInstance, &Info) return Info, ret @@ -2107,7 +2119,7 @@ func (GpuInstance GpuInstance) GetInfo() (GpuInstanceInfo, Return) { } // nvml.GpuInstanceGetComputeInstanceProfileInfo() -func GpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { +func (l *library) GpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { var Info ComputeInstanceProfileInfo ret := nvmlGpuInstanceGetComputeInstanceProfileInfo(GpuInstance, uint32(Profile), uint32(EngProfile), &Info) return Info, ret @@ -2135,7 +2147,7 @@ func (InfoV ComputeInstanceProfileInfoV) V2() (ComputeInstanceProfileInfo_v2, Re return Info, ret } -func GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile int, EngProfile int) ComputeInstanceProfileInfoV { +func (l *library) GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile int, EngProfile int) ComputeInstanceProfileInfoV { return ComputeInstanceProfileInfoV{GpuInstance, Profile, EngProfile} } @@ -2144,7 +2156,7 @@ func (GpuInstance GpuInstance) GetComputeInstanceProfileInfoV(Profile int, EngPr } // nvml.GpuInstanceGetComputeInstanceRemainingCapacity() -func GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (int, Return) { +func (l *library) GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (int, Return) { if Info == nil { return 0, ERROR_INVALID_ARGUMENT } @@ -2158,7 +2170,7 @@ func (GpuInstance GpuInstance) GetComputeInstanceRemainingCapacity(Info *Compute } // nvml.GpuInstanceCreateComputeInstance() -func GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { +func (l *library) GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { if Info == nil { return ComputeInstance{}, ERROR_INVALID_ARGUMENT } @@ -2172,7 +2184,7 @@ func (GpuInstance GpuInstance) CreateComputeInstance(Info *ComputeInstanceProfil } // nvml.ComputeInstanceDestroy() -func ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { +func (l *library) ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { return nvmlComputeInstanceDestroy(ComputeInstance) } @@ -2181,7 +2193,7 @@ func (ComputeInstance ComputeInstance) Destroy() Return { } // nvml.GpuInstanceGetComputeInstances() -func GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { +func (l *library) GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { if Info == nil { return nil, ERROR_INVALID_ARGUMENT } @@ -2196,7 +2208,7 @@ func (GpuInstance GpuInstance) GetComputeInstances(Info *ComputeInstanceProfileI } // nvml.GpuInstanceGetComputeInstanceById() -func GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id int) (ComputeInstance, Return) { +func (l *library) GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id int) (ComputeInstance, Return) { var ComputeInstance ComputeInstance ret := nvmlGpuInstanceGetComputeInstanceById(GpuInstance, uint32(Id), &ComputeInstance) return ComputeInstance, ret @@ -2207,7 +2219,7 @@ func (GpuInstance GpuInstance) GetComputeInstanceById(Id int) (ComputeInstance, } // nvml.ComputeInstanceGetInfo() -func ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) { +func (l *library) ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) { var Info ComputeInstanceInfo ret := nvmlComputeInstanceGetInfo(ComputeInstance, &Info) return Info, ret @@ -2218,7 +2230,7 @@ func (ComputeInstance ComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { } // nvml.DeviceIsMigDeviceHandle() -func DeviceIsMigDeviceHandle(Device Device) (bool, Return) { +func (l *library) DeviceIsMigDeviceHandle(Device Device) (bool, Return) { var IsMigDevice uint32 ret := nvmlDeviceIsMigDeviceHandle(Device, &IsMigDevice) return (IsMigDevice != 0), ret @@ -2229,7 +2241,7 @@ func (Device Device) IsMigDeviceHandle() (bool, Return) { } // nvml DeviceGetGpuInstanceId() -func DeviceGetGpuInstanceId(Device Device) (int, Return) { +func (l *library) DeviceGetGpuInstanceId(Device Device) (int, Return) { var Id uint32 ret := nvmlDeviceGetGpuInstanceId(Device, &Id) return int(Id), ret @@ -2240,7 +2252,7 @@ func (Device Device) GetGpuInstanceId() (int, Return) { } // nvml.DeviceGetComputeInstanceId() -func DeviceGetComputeInstanceId(Device Device) (int, Return) { +func (l *library) DeviceGetComputeInstanceId(Device Device) (int, Return) { var Id uint32 ret := nvmlDeviceGetComputeInstanceId(Device, &Id) return int(Id), ret @@ -2251,7 +2263,7 @@ func (Device Device) GetComputeInstanceId() (int, Return) { } // nvml.DeviceGetMaxMigDeviceCount() -func DeviceGetMaxMigDeviceCount(Device Device) (int, Return) { +func (l *library) DeviceGetMaxMigDeviceCount(Device Device) (int, Return) { var Count uint32 ret := nvmlDeviceGetMaxMigDeviceCount(Device, &Count) return int(Count), ret @@ -2262,7 +2274,7 @@ func (Device Device) GetMaxMigDeviceCount() (int, Return) { } // nvml.DeviceGetMigDeviceHandleByIndex() -func DeviceGetMigDeviceHandleByIndex(device Device, Index int) (Device, Return) { +func (l *library) DeviceGetMigDeviceHandleByIndex(device Device, Index int) (Device, Return) { var MigDevice Device ret := nvmlDeviceGetMigDeviceHandleByIndex(device, uint32(Index), &MigDevice) return MigDevice, ret @@ -2273,7 +2285,7 @@ func (Device Device) GetMigDeviceHandleByIndex(Index int) (Device, Return) { } // nvml.DeviceGetDeviceHandleFromMigDeviceHandle() -func DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device) (Device, Return) { +func (l *library) DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device) (Device, Return) { var Device Device ret := nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice, &Device) return Device, ret @@ -2284,7 +2296,7 @@ func (MigDevice Device) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { } // nvml.DeviceGetBusType() -func DeviceGetBusType(Device Device) (BusType, Return) { +func (l *library) DeviceGetBusType(Device Device) (BusType, Return) { var Type BusType ret := nvmlDeviceGetBusType(Device, &Type) return Type, ret @@ -2295,7 +2307,7 @@ func (Device Device) GetBusType() (BusType, Return) { } // nvml.DeviceSetDefaultFanSpeed_v2() -func DeviceSetDefaultFanSpeed_v2(Device Device, Fan int) Return { +func (l *library) DeviceSetDefaultFanSpeed_v2(Device Device, Fan int) Return { return nvmlDeviceSetDefaultFanSpeed_v2(Device, uint32(Fan)) } @@ -2304,7 +2316,7 @@ func (Device Device) SetDefaultFanSpeed_v2(Fan int) Return { } // nvml.DeviceGetMinMaxFanSpeed() -func DeviceGetMinMaxFanSpeed(Device Device) (int, int, Return) { +func (l *library) DeviceGetMinMaxFanSpeed(Device Device) (int, int, Return) { var MinSpeed, MaxSpeed uint32 ret := nvmlDeviceGetMinMaxFanSpeed(Device, &MinSpeed, &MaxSpeed) return int(MinSpeed), int(MaxSpeed), ret @@ -2315,7 +2327,7 @@ func (Device Device) GetMinMaxFanSpeed() (int, int, Return) { } // nvml.DeviceGetThermalSettings() -func DeviceGetThermalSettings(Device Device, SensorIndex uint32) (GpuThermalSettings, Return) { +func (l *library) DeviceGetThermalSettings(Device Device, SensorIndex uint32) (GpuThermalSettings, Return) { var PThermalSettings GpuThermalSettings ret := nvmlDeviceGetThermalSettings(Device, SensorIndex, &PThermalSettings) return PThermalSettings, ret @@ -2326,7 +2338,7 @@ func (Device Device) GetThermalSettings(SensorIndex uint32) (GpuThermalSettings, } // nvml.DeviceGetDefaultEccMode() -func DeviceGetDefaultEccMode(Device Device) (EnableState, Return) { +func (l *library) DeviceGetDefaultEccMode(Device Device) (EnableState, Return) { var DefaultMode EnableState ret := nvmlDeviceGetDefaultEccMode(Device, &DefaultMode) return DefaultMode, ret @@ -2337,7 +2349,7 @@ func (Device Device) GetDefaultEccMode() (EnableState, Return) { } // nvml.DeviceGetPcieSpeed() -func DeviceGetPcieSpeed(Device Device) (int, Return) { +func (l *library) DeviceGetPcieSpeed(Device Device) (int, Return) { var PcieSpeed uint32 ret := nvmlDeviceGetPcieSpeed(Device, &PcieSpeed) return int(PcieSpeed), ret @@ -2348,7 +2360,7 @@ func (Device Device) GetPcieSpeed() (int, Return) { } // nvml.DeviceGetGspFirmwareVersion() -func DeviceGetGspFirmwareVersion(Device Device) (string, Return) { +func (l *library) DeviceGetGspFirmwareVersion(Device Device) (string, Return) { Version := make([]byte, GSP_FIRMWARE_VERSION_BUF_SIZE) ret := nvmlDeviceGetGspFirmwareVersion(Device, &Version[0]) return string(Version[:clen(Version)]), ret @@ -2359,7 +2371,7 @@ func (Device Device) GetGspFirmwareVersion() (string, Return) { } // nvml.DeviceGetGspFirmwareMode() -func DeviceGetGspFirmwareMode(Device Device) (bool, bool, Return) { +func (l *library) DeviceGetGspFirmwareMode(Device Device) (bool, bool, Return) { var IsEnabled, DefaultMode uint32 ret := nvmlDeviceGetGspFirmwareMode(Device, &IsEnabled, &DefaultMode) return (IsEnabled != 0), (DefaultMode != 0), ret @@ -2370,7 +2382,7 @@ func (Device Device) GetGspFirmwareMode() (bool, bool, Return) { } // nvml.DeviceGetDynamicPstatesInfo() -func DeviceGetDynamicPstatesInfo(Device Device) (GpuDynamicPstatesInfo, Return) { +func (l *library) DeviceGetDynamicPstatesInfo(Device Device) (GpuDynamicPstatesInfo, Return) { var PDynamicPstatesInfo GpuDynamicPstatesInfo ret := nvmlDeviceGetDynamicPstatesInfo(Device, &PDynamicPstatesInfo) return PDynamicPstatesInfo, ret @@ -2381,7 +2393,7 @@ func (Device Device) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { } // nvml.DeviceSetFanSpeed_v2() -func DeviceSetFanSpeed_v2(Device Device, Fan int, Speed int) Return { +func (l *library) DeviceSetFanSpeed_v2(Device Device, Fan int, Speed int) Return { return nvmlDeviceSetFanSpeed_v2(Device, uint32(Fan), uint32(Speed)) } @@ -2390,7 +2402,7 @@ func (Device Device) SetFanSpeed_v2(Fan int, Speed int) Return { } // nvml.DeviceGetGpcClkVfOffset() -func DeviceGetGpcClkVfOffset(Device Device) (int, Return) { +func (l *library) DeviceGetGpcClkVfOffset(Device Device) (int, Return) { var Offset int32 ret := nvmlDeviceGetGpcClkVfOffset(Device, &Offset) return int(Offset), ret @@ -2401,7 +2413,7 @@ func (Device Device) GetGpcClkVfOffset() (int, Return) { } // nvml.DeviceSetGpcClkVfOffset() -func DeviceSetGpcClkVfOffset(Device Device, Offset int) Return { +func (l *library) DeviceSetGpcClkVfOffset(Device Device, Offset int) Return { return nvmlDeviceSetGpcClkVfOffset(Device, int32(Offset)) } @@ -2410,7 +2422,7 @@ func (Device Device) SetGpcClkVfOffset(Offset int) Return { } // nvml.DeviceGetMinMaxClockOfPState() -func DeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates) (uint32, uint32, Return) { +func (l *library) 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 @@ -2421,7 +2433,7 @@ func (Device Device) GetMinMaxClockOfPState(_type ClockType, Pstate Pstates) (ui } // nvml.DeviceGetSupportedPerformanceStates() -func DeviceGetSupportedPerformanceStates(Device Device) ([]Pstates, Return) { +func (l *library) DeviceGetSupportedPerformanceStates(Device Device) ([]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++ { @@ -2437,7 +2449,7 @@ func (Device Device) GetSupportedPerformanceStates() ([]Pstates, Return) { } // nvml.DeviceGetTargetFanSpeed() -func DeviceGetTargetFanSpeed(Device Device, Fan int) (int, Return) { +func (l *library) DeviceGetTargetFanSpeed(Device Device, Fan int) (int, Return) { var TargetSpeed uint32 ret := nvmlDeviceGetTargetFanSpeed(Device, uint32(Fan), &TargetSpeed) return int(TargetSpeed), ret @@ -2448,7 +2460,7 @@ func (Device Device) GetTargetFanSpeed(Fan int) (int, Return) { } // nvml.DeviceGetMemClkVfOffset() -func DeviceGetMemClkVfOffset(Device Device) (int, Return) { +func (l *library) DeviceGetMemClkVfOffset(Device Device) (int, Return) { var Offset int32 ret := nvmlDeviceGetMemClkVfOffset(Device, &Offset) return int(Offset), ret @@ -2459,7 +2471,7 @@ func (Device Device) GetMemClkVfOffset() (int, Return) { } // nvml.DeviceSetMemClkVfOffset() -func DeviceSetMemClkVfOffset(Device Device, Offset int) Return { +func (l *library) DeviceSetMemClkVfOffset(Device Device, Offset int) Return { return nvmlDeviceSetMemClkVfOffset(Device, int32(Offset)) } @@ -2468,7 +2480,7 @@ func (Device Device) SetMemClkVfOffset(Offset int) Return { } // nvml.DeviceGetGpcClkMinMaxVfOffset() -func DeviceGetGpcClkMinMaxVfOffset(Device Device) (int, int, Return) { +func (l *library) DeviceGetGpcClkMinMaxVfOffset(Device Device) (int, int, Return) { var MinOffset, MaxOffset int32 ret := nvmlDeviceGetGpcClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) return int(MinOffset), int(MaxOffset), ret @@ -2479,7 +2491,7 @@ func (Device Device) GetGpcClkMinMaxVfOffset() (int, int, Return) { } // nvml.DeviceGetMemClkMinMaxVfOffset() -func DeviceGetMemClkMinMaxVfOffset(Device Device) (int, int, Return) { +func (l *library) DeviceGetMemClkMinMaxVfOffset(Device Device) (int, int, Return) { var MinOffset, MaxOffset int32 ret := nvmlDeviceGetMemClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) return int(MinOffset), int(MaxOffset), ret @@ -2490,7 +2502,7 @@ func (Device Device) GetMemClkMinMaxVfOffset() (int, int, Return) { } // nvml.DeviceGetGpuMaxPcieLinkGeneration() -func DeviceGetGpuMaxPcieLinkGeneration(Device Device) (int, Return) { +func (l *library) DeviceGetGpuMaxPcieLinkGeneration(Device Device) (int, Return) { var MaxLinkGenDevice uint32 ret := nvmlDeviceGetGpuMaxPcieLinkGeneration(Device, &MaxLinkGenDevice) return int(MaxLinkGenDevice), ret @@ -2501,7 +2513,7 @@ func (Device Device) GetGpuMaxPcieLinkGeneration() (int, Return) { } // nvml.DeviceGetFanControlPolicy_v2() -func DeviceGetFanControlPolicy_v2(Device Device, Fan int) (FanControlPolicy, Return) { +func (l *library) DeviceGetFanControlPolicy_v2(Device Device, Fan int) (FanControlPolicy, Return) { var Policy FanControlPolicy ret := nvmlDeviceGetFanControlPolicy_v2(Device, uint32(Fan), &Policy) return Policy, ret @@ -2512,7 +2524,7 @@ func (Device Device) GetFanControlPolicy_v2(Fan int) (FanControlPolicy, Return) } // nvml.DeviceSetFanControlPolicy() -func DeviceSetFanControlPolicy(Device Device, Fan int, Policy FanControlPolicy) Return { +func (l *library) DeviceSetFanControlPolicy(Device Device, Fan int, Policy FanControlPolicy) Return { return nvmlDeviceSetFanControlPolicy(Device, uint32(Fan), Policy) } @@ -2521,7 +2533,7 @@ func (Device Device) SetFanControlPolicy(Fan int, Policy FanControlPolicy) Retur } // nvml.DeviceClearFieldValues() -func DeviceClearFieldValues(Device Device, Values []FieldValue) Return { +func (l *library) DeviceClearFieldValues(Device Device, Values []FieldValue) Return { ValuesCount := len(Values) return nvmlDeviceClearFieldValues(Device, int32(ValuesCount), &Values[0]) } @@ -2531,7 +2543,7 @@ func (Device Device) ClearFieldValues(Values []FieldValue) Return { } // nvml.DeviceGetVgpuCapabilities() -func DeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability) (bool, Return) { +func (l *library) DeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability) (bool, Return) { var CapResult uint32 ret := nvmlDeviceGetVgpuCapabilities(Device, Capability, &CapResult) return (CapResult != 0), ret @@ -2542,7 +2554,7 @@ func (Device Device) GetVgpuCapabilities(Capability DeviceVgpuCapability) (bool, } // nvml.DeviceGetVgpuSchedulerLog() -func DeviceGetVgpuSchedulerLog(Device Device) (VgpuSchedulerLog, Return) { +func (l *library) DeviceGetVgpuSchedulerLog(Device Device) (VgpuSchedulerLog, Return) { var PSchedulerLog VgpuSchedulerLog ret := nvmlDeviceGetVgpuSchedulerLog(Device, &PSchedulerLog) return PSchedulerLog, ret @@ -2553,7 +2565,7 @@ func (Device Device) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { } // nvml.DeviceGetVgpuSchedulerState() -func DeviceGetVgpuSchedulerState(Device Device) (VgpuSchedulerGetState, Return) { +func (l *library) DeviceGetVgpuSchedulerState(Device Device) (VgpuSchedulerGetState, Return) { var PSchedulerState VgpuSchedulerGetState ret := nvmlDeviceGetVgpuSchedulerState(Device, &PSchedulerState) return PSchedulerState, ret @@ -2564,7 +2576,7 @@ func (Device Device) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { } // nvml.DeviceSetVgpuSchedulerState() -func DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return { +func (l *library) DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return { return nvmlDeviceSetVgpuSchedulerState(Device, PSchedulerState) } @@ -2573,7 +2585,7 @@ func (Device Device) SetVgpuSchedulerState(PSchedulerState *VgpuSchedulerSetStat } // nvml.DeviceGetVgpuSchedulerCapabilities() -func DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) { +func (l *library) DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) { var PCapabilities VgpuSchedulerCapabilities ret := nvmlDeviceGetVgpuSchedulerCapabilities(Device, &PCapabilities) return PCapabilities, ret @@ -2584,7 +2596,7 @@ func (Device Device) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, } // nvml.GpuInstanceGetComputeInstancePossiblePlacements() -func GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { +func (l *library) GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { var Count uint32 ret := nvmlGpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, Info.Id, nil, &Count) if ret != SUCCESS { @@ -2603,7 +2615,7 @@ func (GpuInstance GpuInstance) GetComputeInstancePossiblePlacements(Info *Comput } // nvml.GpuInstanceCreateComputeInstanceWithPlacement() -func GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { +func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { return nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, ComputeInstance) } @@ -2612,7 +2624,7 @@ func (GpuInstance GpuInstance) CreateComputeInstanceWithPlacement(Info *ComputeI } // nvml.DeviceGetGpuFabricInfo() -func DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) { +func (l *library) DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) { var GpuFabricInfo GpuFabricInfo ret := nvmlDeviceGetGpuFabricInfo(Device, &GpuFabricInfo) return GpuFabricInfo, ret @@ -2623,7 +2635,7 @@ func (Device Device) GetGpuFabricInfo() (GpuFabricInfo, Return) { } // nvml.DeviceCcuGetStreamState() -func DeviceCcuGetStreamState(Device Device) (int, Return) { +func (l *library) DeviceCcuGetStreamState(Device Device) (int, Return) { var State uint32 ret := nvmlDeviceCcuGetStreamState(Device, &State) return int(State), ret @@ -2634,7 +2646,7 @@ func (Device Device) CcuGetStreamState() (int, Return) { } // nvml.DeviceCcuSetStreamState() -func DeviceCcuSetStreamState(Device Device, State int) Return { +func (l *library) DeviceCcuSetStreamState(Device Device, State int) Return { return nvmlDeviceCcuSetStreamState(Device, uint32(State)) } @@ -2643,7 +2655,7 @@ func (Device Device) CcuSetStreamState(State int) Return { } // nvml.DeviceSetNvLinkDeviceLowPowerThreshold() -func DeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return { +func (l *library) DeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return { return nvmlDeviceSetNvLinkDeviceLowPowerThreshold(Device, Info) } diff --git a/pkg/nvml/event_set.go b/pkg/nvml/event_set.go index c6315f5..9e2c79e 100644 --- a/pkg/nvml/event_set.go +++ b/pkg/nvml/event_set.go @@ -15,14 +15,14 @@ package nvml // nvml.EventSetCreate() -func EventSetCreate() (EventSet, Return) { +func (l *library) EventSetCreate() (EventSet, Return) { var Set EventSet ret := nvmlEventSetCreate(&Set) return Set, ret } // nvml.EventSetWait() -func EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) { +func (l *library) EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) { var Data EventData ret := nvmlEventSetWait(Set, &Data, Timeoutms) return Data, ret @@ -33,7 +33,7 @@ func (Set EventSet) Wait(Timeoutms uint32) (EventData, Return) { } // nvml.EventSetFree() -func EventSetFree(Set EventSet) Return { +func (l *library) EventSetFree(Set EventSet) Return { return nvmlEventSetFree(Set) } diff --git a/pkg/nvml/gpm.go b/pkg/nvml/gpm.go index c46c5d7..a8a79f8 100644 --- a/pkg/nvml/gpm.go +++ b/pkg/nvml/gpm.go @@ -19,32 +19,31 @@ type GpmMetricsGetVType struct { metricsGet *GpmMetricsGetType } -func GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType { +func (l *library) GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType { return GpmMetricsGetVType{MetricsGet} } - func (MetricsGetV GpmMetricsGetVType) V1() Return { MetricsGetV.metricsGet.Version = 1 return nvmlGpmMetricsGet(MetricsGetV.metricsGet) } -func GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { +func (l *library) GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { MetricsGet.Version = GPM_METRICS_GET_VERSION return nvmlGpmMetricsGet(MetricsGet) } // nvml.GpmSampleFree() -func GpmSampleFree(GpmSample GpmSample) Return { +func (l *library) GpmSampleFree(GpmSample GpmSample) Return { return nvmlGpmSampleFree(GpmSample) } // nvml.GpmSampleAlloc() -func GpmSampleAlloc(GpmSample *GpmSample) Return { +func (l *library) GpmSampleAlloc(GpmSample *GpmSample) Return { return nvmlGpmSampleAlloc(GpmSample) } // nvml.GpmSampleGet() -func GpmSampleGet(Device Device, GpmSample GpmSample) Return { +func (l *library) GpmSampleGet(Device Device, GpmSample GpmSample) Return { return nvmlGpmSampleGet(Device, GpmSample) } @@ -57,7 +56,7 @@ type GpmSupportV struct { device Device } -func GpmQueryDeviceSupportV(Device Device) GpmSupportV { +func (l *library) GpmQueryDeviceSupportV(Device Device) GpmSupportV { return GpmSupportV{Device} } @@ -72,7 +71,7 @@ func (GpmSupportV GpmSupportV) V1() (GpmSupport, Return) { return GpmSupport, ret } -func GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) { +func (l *library) GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) { var GpmSupport GpmSupport GpmSupport.Version = GPM_SUPPORT_VERSION ret := nvmlGpmQueryDeviceSupport(Device, &GpmSupport) @@ -84,7 +83,7 @@ func (Device Device) GpmQueryDeviceSupport() (GpmSupport, Return) { } // nvml.GpmMigSampleGet() -func GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return { +func (l *library) GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return { return nvmlGpmMigSampleGet(Device, uint32(GpuInstanceId), GpmSample) } diff --git a/pkg/nvml/init.go b/pkg/nvml/init.go index bed2ab4..ca92f23 100644 --- a/pkg/nvml/init.go +++ b/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,7 +25,7 @@ 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 } @@ -33,7 +33,7 @@ func InitWithFlags(Flags uint32) Return { } // nvml.Shutdown() -func Shutdown() Return { +func (l *library) Shutdown() Return { ret := nvmlShutdown() if ret != SUCCESS { return ret diff --git a/pkg/nvml/lib.go b/pkg/nvml/lib.go index 3b973ca..a0dfb71 100644 --- a/pkg/nvml/lib.go +++ b/pkg/nvml/lib.go @@ -149,9 +149,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 @@ -251,27 +251,27 @@ func (l *library) updateVersionedSymbols() { } err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v2") if err == nil { - DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v2 + deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v2 } err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v3") if err == nil { - DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3 + deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3 } err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v2") if err == nil { - DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2 + deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2 } err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v3") if err == nil { - DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3 + deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3 } err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v2") if err == nil { - DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2 + deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2 } err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v3") if err == nil { - DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v3 + deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v3 } err = l.Lookup("nvmlDeviceGetGpuInstancePossiblePlacements_v2") if err == nil { diff --git a/pkg/nvml/return.go b/pkg/nvml/return.go index 0a0ccee..c94b310 100644 --- a/pkg/nvml/return.go +++ b/pkg/nvml/return.go @@ -19,8 +19,8 @@ import ( ) // nvml.ErrorString() -func ErrorString(r Return) string { - if err := GetLibrary().Lookup("nvmlErrorString"); err != nil { +func (l *library) ErrorString(r Return) string { + if err := l.GetLibrary().Lookup("nvmlErrorString"); err != nil { return fallbackErrorStringFunc(r) } return nvmlErrorString(r) diff --git a/pkg/nvml/system.go b/pkg/nvml/system.go index 424f99b..2f7b1da 100644 --- a/pkg/nvml/system.go +++ b/pkg/nvml/system.go @@ -15,42 +15,42 @@ 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) { +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) { +func (l *library) SystemGetHicVersion() ([]HwbcEntry, Return) { var HwbcCount uint32 = 1 // Will be reduced upon returning for { HwbcEntries := make([]HwbcEntry, HwbcCount) @@ -66,7 +66,7 @@ func SystemGetHicVersion() ([]HwbcEntry, Return) { } // nvml.SystemGetTopologyGpuSet() -func SystemGetTopologyGpuSet(CpuNumber int) ([]Device, Return) { +func (l *library) SystemGetTopologyGpuSet(CpuNumber int) ([]Device, Return) { var Count uint32 ret := nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, nil) if ret != SUCCESS { diff --git a/pkg/nvml/unit.go b/pkg/nvml/unit.go index aba916a..f6801d0 100644 --- a/pkg/nvml/unit.go +++ b/pkg/nvml/unit.go @@ -15,21 +15,21 @@ 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) { +func (l *library) UnitGetHandleByIndex(Index int) (Unit, Return) { var Unit Unit ret := nvmlUnitGetHandleByIndex(uint32(Index), &Unit) return Unit, ret } // nvml.UnitGetUnitInfo() -func UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) { +func (l *library) UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) { var Info UnitInfo ret := nvmlUnitGetUnitInfo(Unit, &Info) return Info, ret @@ -40,7 +40,7 @@ func (Unit Unit) GetUnitInfo() (UnitInfo, Return) { } // nvml.UnitGetLedState() -func UnitGetLedState(Unit Unit) (LedState, Return) { +func (l *library) UnitGetLedState(Unit Unit) (LedState, Return) { var State LedState ret := nvmlUnitGetLedState(Unit, &State) return State, ret @@ -51,7 +51,7 @@ func (Unit Unit) GetLedState() (LedState, Return) { } // nvml.UnitGetPsuInfo() -func UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) { +func (l *library) UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) { var Psu PSUInfo ret := nvmlUnitGetPsuInfo(Unit, &Psu) return Psu, ret @@ -62,7 +62,7 @@ func (Unit Unit) GetPsuInfo() (PSUInfo, Return) { } // nvml.UnitGetTemperature() -func UnitGetTemperature(Unit Unit, Type int) (uint32, Return) { +func (l *library) UnitGetTemperature(Unit Unit, Type int) (uint32, Return) { var Temp uint32 ret := nvmlUnitGetTemperature(Unit, uint32(Type), &Temp) return Temp, ret @@ -73,7 +73,7 @@ func (Unit Unit) GetTemperature(Type int) (uint32, Return) { } // nvml.UnitGetFanSpeedInfo() -func UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) { +func (l *library) UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) { var FanSpeeds UnitFanSpeeds ret := nvmlUnitGetFanSpeedInfo(Unit, &FanSpeeds) return FanSpeeds, ret @@ -84,7 +84,7 @@ func (Unit Unit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { } // nvml.UnitGetDevices() -func UnitGetDevices(Unit Unit) ([]Device, Return) { +func (l *library) UnitGetDevices(Unit Unit) ([]Device, Return) { var DeviceCount uint32 = 1 // Will be reduced upon returning for { Devices := make([]Device, DeviceCount) @@ -104,7 +104,7 @@ func (Unit Unit) GetDevices() ([]Device, Return) { } // nvml.UnitSetLedState() -func UnitSetLedState(Unit Unit, Color LedColor) Return { +func (l *library) UnitSetLedState(Unit Unit, Color LedColor) Return { return nvmlUnitSetLedState(Unit, Color) } diff --git a/pkg/nvml/vgpu.go b/pkg/nvml/vgpu.go index 2366fb7..170a0c7 100644 --- a/pkg/nvml/vgpu.go +++ b/pkg/nvml/vgpu.go @@ -31,7 +31,7 @@ type VgpuPgpuMetadata struct { } // nvml.VgpuTypeGetClass() -func VgpuTypeGetClass(VgpuTypeId VgpuTypeId) (string, Return) { +func (l *library) 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) @@ -43,7 +43,7 @@ func (VgpuTypeId VgpuTypeId) GetClass() (string, Return) { } // nvml.VgpuTypeGetName() -func VgpuTypeGetName(VgpuTypeId VgpuTypeId) (string, Return) { +func (l *library) 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) @@ -55,7 +55,7 @@ func (VgpuTypeId VgpuTypeId) GetName() (string, Return) { } // nvml.VgpuTypeGetGpuInstanceProfileId() -func VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) { +func (l *library) VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) { var Size uint32 ret := nvmlVgpuTypeGetGpuInstanceProfileId(VgpuTypeId, &Size) return Size, ret @@ -66,7 +66,7 @@ func (VgpuTypeId VgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { } // nvml.VgpuTypeGetDeviceID() -func VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) { +func (l *library) VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) { var DeviceID, SubsystemID uint64 ret := nvmlVgpuTypeGetDeviceID(VgpuTypeId, &DeviceID, &SubsystemID) return DeviceID, SubsystemID, ret @@ -77,7 +77,7 @@ func (VgpuTypeId VgpuTypeId) GetDeviceID() (uint64, uint64, Return) { } // nvml.VgpuTypeGetFramebufferSize() -func VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) { +func (l *library) VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) { var FbSize uint64 ret := nvmlVgpuTypeGetFramebufferSize(VgpuTypeId, &FbSize) return FbSize, ret @@ -88,7 +88,7 @@ func (VgpuTypeId VgpuTypeId) GetFramebufferSize() (uint64, Return) { } // nvml.VgpuTypeGetNumDisplayHeads() -func VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) { +func (l *library) VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) { var NumDisplayHeads uint32 ret := nvmlVgpuTypeGetNumDisplayHeads(VgpuTypeId, &NumDisplayHeads) return int(NumDisplayHeads), ret @@ -99,7 +99,7 @@ func (VgpuTypeId VgpuTypeId) GetNumDisplayHeads() (int, Return) { } // nvml.VgpuTypeGetResolution() -func VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) { +func (l *library) VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) { var Xdim, Ydim uint32 ret := nvmlVgpuTypeGetResolution(VgpuTypeId, uint32(DisplayIndex), &Xdim, &Ydim) return Xdim, Ydim, ret @@ -110,7 +110,7 @@ func (VgpuTypeId VgpuTypeId) GetResolution(DisplayIndex int) (uint32, uint32, Re } // nvml.VgpuTypeGetLicense() -func VgpuTypeGetLicense(VgpuTypeId VgpuTypeId) (string, Return) { +func (l *library) 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 @@ -121,7 +121,7 @@ func (VgpuTypeId VgpuTypeId) GetLicense() (string, Return) { } // nvml.VgpuTypeGetFrameRateLimit() -func VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) { +func (l *library) VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) { var FrameRateLimit uint32 ret := nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId, &FrameRateLimit) return FrameRateLimit, ret @@ -132,7 +132,7 @@ func (VgpuTypeId VgpuTypeId) GetFrameRateLimit() (uint32, Return) { } // nvml.VgpuTypeGetMaxInstances() -func VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) { +func (l *library) VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) { var VgpuInstanceCount uint32 ret := nvmlVgpuTypeGetMaxInstances(Device, VgpuTypeId, &VgpuInstanceCount) return int(VgpuInstanceCount), ret @@ -147,7 +147,7 @@ func (VgpuTypeId VgpuTypeId) GetMaxInstances(Device Device) (int, Return) { } // nvml.VgpuTypeGetMaxInstancesPerVm() -func VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) { +func (l *library) VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) { var VgpuInstanceCountPerVm uint32 ret := nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId, &VgpuInstanceCountPerVm) return int(VgpuInstanceCountPerVm), ret @@ -158,7 +158,7 @@ func (VgpuTypeId VgpuTypeId) GetMaxInstancesPerVm() (int, Return) { } // nvml.VgpuInstanceGetVmID() -func VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { +func (l *library) 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) @@ -170,7 +170,7 @@ func (VgpuInstance VgpuInstance) GetVmID() (string, VgpuVmIdType, Return) { } // nvml.VgpuInstanceGetUUID() -func VgpuInstanceGetUUID(VgpuInstance VgpuInstance) (string, Return) { +func (l *library) 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 @@ -181,7 +181,7 @@ func (VgpuInstance VgpuInstance) GetUUID() (string, Return) { } // nvml.VgpuInstanceGetVmDriverVersion() -func VgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance) (string, Return) { +func (l *library) 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 @@ -192,7 +192,7 @@ func (VgpuInstance VgpuInstance) GetVmDriverVersion() (string, Return) { } // nvml.VgpuInstanceGetFbUsage() -func VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) { +func (l *library) VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) { var FbUsage uint64 ret := nvmlVgpuInstanceGetFbUsage(VgpuInstance, &FbUsage) return FbUsage, ret @@ -203,7 +203,7 @@ func (VgpuInstance VgpuInstance) GetFbUsage() (uint64, Return) { } // nvml.VgpuInstanceGetLicenseInfo() -func VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { +func (l *library) VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { var LicenseInfo VgpuLicenseInfo ret := nvmlVgpuInstanceGetLicenseInfo(VgpuInstance, &LicenseInfo) return LicenseInfo, ret @@ -214,7 +214,7 @@ func (VgpuInstance VgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { } // nvml.VgpuInstanceGetLicenseStatus() -func VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) { +func (l *library) VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) { var Licensed uint32 ret := nvmlVgpuInstanceGetLicenseStatus(VgpuInstance, &Licensed) return int(Licensed), ret @@ -225,7 +225,7 @@ func (VgpuInstance VgpuInstance) GetLicenseStatus() (int, Return) { } // nvml.VgpuInstanceGetType() -func VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) { +func (l *library) VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) { var VgpuTypeId VgpuTypeId ret := nvmlVgpuInstanceGetType(VgpuInstance, &VgpuTypeId) return VgpuTypeId, ret @@ -236,7 +236,7 @@ func (VgpuInstance VgpuInstance) GetType() (VgpuTypeId, Return) { } // nvml.VgpuInstanceGetFrameRateLimit() -func VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) { +func (l *library) VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) { var FrameRateLimit uint32 ret := nvmlVgpuInstanceGetFrameRateLimit(VgpuInstance, &FrameRateLimit) return FrameRateLimit, ret @@ -247,7 +247,7 @@ func (VgpuInstance VgpuInstance) GetFrameRateLimit() (uint32, Return) { } // nvml.VgpuInstanceGetEccMode() -func VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) { +func (l *library) VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) { var EccMode EnableState ret := nvmlVgpuInstanceGetEccMode(VgpuInstance, &EccMode) return EccMode, ret @@ -258,7 +258,7 @@ func (VgpuInstance VgpuInstance) GetEccMode() (EnableState, Return) { } // nvml.VgpuInstanceGetEncoderCapacity() -func VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) { +func (l *library) VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) { var EncoderCapacity uint32 ret := nvmlVgpuInstanceGetEncoderCapacity(VgpuInstance, &EncoderCapacity) return int(EncoderCapacity), ret @@ -269,7 +269,7 @@ func (VgpuInstance VgpuInstance) GetEncoderCapacity() (int, Return) { } // nvml.VgpuInstanceSetEncoderCapacity() -func VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return { +func (l *library) VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return { return nvmlVgpuInstanceSetEncoderCapacity(VgpuInstance, uint32(EncoderCapacity)) } @@ -278,7 +278,7 @@ func (VgpuInstance VgpuInstance) SetEncoderCapacity(EncoderCapacity int) Return } // nvml.VgpuInstanceGetEncoderStats() -func VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) { +func (l *library) VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) { var SessionCount, AverageFps, AverageLatency uint32 ret := nvmlVgpuInstanceGetEncoderStats(VgpuInstance, &SessionCount, &AverageFps, &AverageLatency) return int(SessionCount), AverageFps, AverageLatency, ret @@ -289,7 +289,7 @@ func (VgpuInstance VgpuInstance) GetEncoderStats() (int, uint32, uint32, Return) } // nvml.VgpuInstanceGetEncoderSessions() -func VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { +func (l *library) VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { var SessionCount uint32 var SessionInfo EncoderSessionInfo ret := nvmlVgpuInstanceGetEncoderSessions(VgpuInstance, &SessionCount, &SessionInfo) @@ -301,7 +301,7 @@ func (VgpuInstance VgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, } // nvml.VgpuInstanceGetFBCStats() -func VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) { +func (l *library) VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) { var FbcStats FBCStats ret := nvmlVgpuInstanceGetFBCStats(VgpuInstance, &FbcStats) return FbcStats, ret @@ -312,7 +312,7 @@ func (VgpuInstance VgpuInstance) GetFBCStats() (FBCStats, Return) { } // nvml.VgpuInstanceGetFBCSessions() -func VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { +func (l *library) VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { var SessionCount uint32 var SessionInfo FBCSessionInfo ret := nvmlVgpuInstanceGetFBCSessions(VgpuInstance, &SessionCount, &SessionInfo) @@ -324,7 +324,7 @@ func (VgpuInstance VgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) } // nvml.VgpuInstanceGetGpuInstanceId() -func VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) { +func (l *library) VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) { var gpuInstanceId uint32 ret := nvmlVgpuInstanceGetGpuInstanceId(VgpuInstance, &gpuInstanceId) return int(gpuInstanceId), ret @@ -335,7 +335,7 @@ func (VgpuInstance VgpuInstance) GetGpuInstanceId() (int, Return) { } // nvml.VgpuInstanceGetGpuPciId() -func VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Return) { +func (l *library) VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Return) { var Length uint32 = 1 // Will be reduced upon returning for { VgpuPciId := make([]byte, Length) @@ -355,7 +355,7 @@ func (VgpuInstance VgpuInstance) GetGpuPciId() (string, Return) { } // nvml.VgpuInstanceGetMetadata() -func VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) { +func (l *library) VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) { var VgpuMetadata VgpuMetadata OpaqueDataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata.OpaqueData) VgpuMetadataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata) - OpaqueDataSize @@ -381,7 +381,7 @@ func (VgpuInstance VgpuInstance) GetMetadata() (VgpuMetadata, Return) { } // nvml.VgpuInstanceGetAccountingMode() -func VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) { +func (l *library) VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) { var Mode EnableState ret := nvmlVgpuInstanceGetAccountingMode(VgpuInstance, &Mode) return Mode, ret @@ -392,7 +392,7 @@ func (VgpuInstance VgpuInstance) GetAccountingMode() (EnableState, Return) { } // nvml.VgpuInstanceGetAccountingPids() -func VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]int, Return) { +func (l *library) VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]int, Return) { var Count uint32 = 1 // Will be reduced upon returning for { Pids := make([]uint32, Count) @@ -412,7 +412,7 @@ func (VgpuInstance VgpuInstance) GetAccountingPids() ([]int, Return) { } // nvml.VgpuInstanceGetAccountingStats() -func VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) { +func (l *library) VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) { var Stats AccountingStats ret := nvmlVgpuInstanceGetAccountingStats(VgpuInstance, uint32(Pid), &Stats) return Stats, ret @@ -423,26 +423,26 @@ func (VgpuInstance VgpuInstance) GetAccountingStats(Pid int) (AccountingStats, R } // nvml.GetVgpuCompatibility() -func GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { +func (l *library) GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { var CompatibilityInfo VgpuPgpuCompatibility ret := nvmlGetVgpuCompatibility(nvmlVgpuMetadata, PgpuMetadata, &CompatibilityInfo) return CompatibilityInfo, ret } // nvml.GetVgpuVersion() -func GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) { +func (l *library) GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) { var Supported, Current VgpuVersion ret := nvmlGetVgpuVersion(&Supported, &Current) return Supported, Current, ret } // nvml.SetVgpuVersion() -func SetVgpuVersion(VgpuVersion *VgpuVersion) Return { +func (l *library) SetVgpuVersion(VgpuVersion *VgpuVersion) Return { return nvmlSetVgpuVersion(VgpuVersion) } // nvml.VgpuInstanceClearAccountingPids() -func VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return { +func (l *library) VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return { return nvmlVgpuInstanceClearAccountingPids(VgpuInstance) } @@ -451,7 +451,7 @@ func (VgpuInstance VgpuInstance) ClearAccountingPids() Return { } // nvml.VgpuInstanceGetMdevUUID() -func VgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance) (string, Return) { +func (l *library) 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 @@ -462,7 +462,7 @@ func (VgpuInstance VgpuInstance) GetMdevUUID() (string, Return) { } // nvml.VgpuTypeGetCapabilities() -func VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) { +func (l *library) VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) { var CapResult uint32 ret := nvmlVgpuTypeGetCapabilities(VgpuTypeId, Capability, &CapResult) return (CapResult != 0), ret @@ -473,7 +473,7 @@ func (VgpuTypeId VgpuTypeId) GetCapabilities(Capability VgpuCapability) (bool, R } // nvml.GetVgpuDriverCapabilities() -func GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) { +func (l *library) GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) { var CapResult uint32 ret := nvmlGetVgpuDriverCapabilities(Capability, &CapResult) return (CapResult != 0), ret From e828eae7d34040244a9b08c64c3a7641e0345d6c Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Fri, 12 Apr 2024 17:06:48 +0000 Subject: [PATCH 04/21] Allow nvml.Return to be used as an error Signed-off-by: Kevin Klues --- pkg/nvml/lib.go | 7 +++++++ pkg/nvml/return.go | 22 ++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/pkg/nvml/lib.go b/pkg/nvml/lib.go index a0dfb71..ed4f469 100644 --- a/pkg/nvml/lib.go +++ b/pkg/nvml/lib.go @@ -113,6 +113,10 @@ func (l *library) load() (rerr error) { return fmt.Errorf("error opening %s: %w", l.path, err) } + // Update the errorStringFunc to point to nvml.ErrorString + errorStringFunc = nvmlErrorString + + // Update all versioned symbols l.updateVersionedSymbols() return nil @@ -134,6 +138,9 @@ func (l *library) close() (rerr error) { return fmt.Errorf("error closing %s: %w", l.path, err) } + // Update the errorStringFunc to point to defaultErrorStringFunc + errorStringFunc = defaultErrorStringFunc + return nil } diff --git a/pkg/nvml/return.go b/pkg/nvml/return.go index c94b310..1aec3ec 100644 --- a/pkg/nvml/return.go +++ b/pkg/nvml/return.go @@ -20,16 +20,26 @@ import ( // nvml.ErrorString() func (l *library) ErrorString(r Return) string { - if err := l.GetLibrary().Lookup("nvmlErrorString"); err != nil { - return fallbackErrorStringFunc(r) - } - return nvmlErrorString(r) + 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" From a1de4c02492431b7c48fe4605af0ddb457c8a5c0 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 09:36:10 +0000 Subject: [PATCH 05/21] Convert Device into an interface instead of a concrete type Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 1 + pkg/nvml/api.go | 204 +++++ pkg/nvml/cgo_helpers_static.go | 11 + pkg/nvml/device.go | 1534 ++++++++++++++++---------------- pkg/nvml/gpm.go | 26 +- pkg/nvml/nvml.go | 1312 +++++++++++++-------------- pkg/nvml/system.go | 4 +- pkg/nvml/types_gen.go | 8 +- pkg/nvml/unit.go | 4 +- pkg/nvml/vgpu.go | 8 +- 10 files changed, 1664 insertions(+), 1448 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index 3ca8d28..4590e92 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -64,6 +64,7 @@ TRANSLATOR: - {action: replace, from: "^nvml"} - {action: replace, from: "_t$"} - {transform: export} + - {action: replace, from: "^Device$", to: "nvmlDevice"} - {action: replace, from: "^VgpuMetadata", to: "nvmlVgpuMetadata"} - {action: replace, from: "^VgpuPgpuMetadata", to: "nvmlVgpuPgpuMetadata"} - {action: replace, from: "^GpmMetricsGet", to: "GpmMetricsGetType"} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index f848fe8..73db1eb 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -349,6 +349,210 @@ type Interface interface { GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) } +type Device interface { + GetName() (string, Return) + GetBrand() (BrandType, Return) + GetIndex() (int, Return) + GetSerial() (string, Return) + GetCpuAffinity(NumCPUs int) ([]uint, Return) + SetCpuAffinity() Return + ClearCpuAffinity() Return + GetMemoryAffinity(NumNodes int, Scope AffinityScope) ([]uint, Return) + GetCpuAffinityWithinScope(NumCPUs int, Scope AffinityScope) ([]uint, Return) + GetTopologyCommonAncestor(Device2 Device) (GpuTopologyLevel, Return) + GetTopologyNearestGpus(Level GpuTopologyLevel) ([]Device, Return) + GetP2PStatus(Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) + GetUUID() (string, Return) + GetMinorNumber() (int, Return) + GetBoardPartNumber() (string, Return) + GetInforomVersion(Object InforomObject) (string, Return) + GetInforomImageVersion() (string, Return) + GetInforomConfigurationChecksum() (uint32, Return) + ValidateInforom() Return + GetDisplayMode() (EnableState, Return) + GetDisplayActive() (EnableState, Return) + GetPersistenceMode() (EnableState, Return) + GetPciInfo() (PciInfo, Return) + GetMaxPcieLinkGeneration() (int, Return) + GetMaxPcieLinkWidth() (int, Return) + GetCurrPcieLinkGeneration() (int, Return) + GetCurrPcieLinkWidth() (int, Return) + GetPcieThroughput(Counter PcieUtilCounter) (uint32, Return) + GetPcieReplayCounter() (int, Return) + GetClockInfo(_type ClockType) (uint32, Return) + GetMaxClockInfo(_type ClockType) (uint32, Return) + GetApplicationsClock(ClockType ClockType) (uint32, Return) + GetDefaultApplicationsClock(ClockType ClockType) (uint32, Return) + ResetApplicationsClocks() Return + GetClock(ClockType ClockType, ClockId ClockId) (uint32, Return) + GetMaxCustomerBoostClock(ClockType ClockType) (uint32, Return) + GetSupportedMemoryClocks() (int, uint32, Return) + GetSupportedGraphicsClocks(MemoryClockMHz int) (int, uint32, Return) + GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) + SetAutoBoostedClocksEnabled(Enabled EnableState) Return + SetDefaultAutoBoostedClocksEnabled(Enabled EnableState, Flags uint32) Return + GetFanSpeed() (uint32, Return) + GetFanSpeed_v2(Fan int) (uint32, Return) + GetNumFans() (int, Return) + GetTemperature(SensorType TemperatureSensors) (uint32, Return) + GetTemperatureThreshold(ThresholdType TemperatureThresholds) (uint32, Return) + SetTemperatureThreshold(ThresholdType TemperatureThresholds, Temp int) Return + GetPerformanceState() (Pstates, Return) + GetCurrentClocksThrottleReasons() (uint64, Return) + GetSupportedClocksThrottleReasons() (uint64, Return) + GetPowerState() (Pstates, Return) + GetPowerManagementMode() (EnableState, Return) + GetPowerManagementLimit() (uint32, Return) + GetPowerManagementLimitConstraints() (uint32, uint32, Return) + GetPowerManagementDefaultLimit() (uint32, Return) + GetPowerUsage() (uint32, Return) + GetTotalEnergyConsumption() (uint64, Return) + GetEnforcedPowerLimit() (uint32, Return) + GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) + GetMemoryInfo() (Memory, Return) + GetMemoryInfo_v2() (Memory_v2, Return) + GetComputeMode() (ComputeMode, Return) + GetCudaComputeCapability() (int, int, Return) + GetEccMode() (EnableState, EnableState, Return) + GetBoardId() (uint32, Return) + GetMultiGpuBoard() (int, Return) + GetTotalEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) + GetDetailedEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) + GetMemoryErrorCounter(ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) + GetUtilizationRates() (Utilization, Return) + GetEncoderUtilization() (uint32, uint32, Return) + GetEncoderCapacity(EncoderQueryType EncoderType) (int, Return) + GetEncoderStats() (int, uint32, uint32, Return) + GetEncoderSessions() ([]EncoderSessionInfo, Return) + GetDecoderUtilization() (uint32, uint32, Return) + GetFBCStats() (FBCStats, Return) + GetFBCSessions() ([]FBCSessionInfo, Return) + GetDriverModel() (DriverModel, DriverModel, Return) + GetVbiosVersion() (string, Return) + GetBridgeChipInfo() (BridgeChipHierarchy, Return) + GetComputeRunningProcesses() ([]ProcessInfo, Return) + GetGraphicsRunningProcesses() ([]ProcessInfo, Return) + GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) + OnSameBoard(Device2 Device) (int, Return) + GetAPIRestriction(ApiType RestrictedAPI) (EnableState, Return) + GetSamples(_type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) + GetBAR1MemoryInfo() (BAR1Memory, Return) + GetViolationStatus(PerfPolicyType PerfPolicyType) (ViolationTime, Return) + GetIrqNum() (int, Return) + GetNumGpuCores() (int, Return) + GetPowerSource() (PowerSource, Return) + GetMemoryBusWidth() (uint32, Return) + GetPcieLinkMaxSpeed() (uint32, Return) + GetAdaptiveClockInfoStatus() (uint32, Return) + GetAccountingMode() (EnableState, Return) + GetAccountingStats(Pid uint32) (AccountingStats, Return) + GetAccountingPids() ([]int, Return) + GetAccountingBufferSize() (int, Return) + GetRetiredPages(Cause PageRetirementCause) ([]uint64, Return) + GetRetiredPages_v2(Cause PageRetirementCause) ([]uint64, []uint64, Return) + GetRetiredPagesPendingStatus() (EnableState, Return) + SetPersistenceMode(Mode EnableState) Return + SetComputeMode(Mode ComputeMode) Return + SetEccMode(Ecc EnableState) Return + ClearEccErrorCounts(CounterType EccCounterType) Return + SetDriverModel(DriverModel DriverModel, Flags uint32) Return + SetGpuLockedClocks(MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return + ResetGpuLockedClocks() Return + SetMemoryLockedClocks(NinMemClockMHz uint32, MaxMemClockMHz uint32) Return + ResetMemoryLockedClocks() Return + GetClkMonStatus() (ClkMonStatus, Return) + SetApplicationsClocks(MemClockMHz uint32, GraphicsClockMHz uint32) Return + SetPowerManagementLimit(Limit uint32) Return + SetGpuOperationMode(Mode GpuOperationMode) Return + SetAPIRestriction(ApiType RestrictedAPI, IsRestricted EnableState) Return + SetAccountingMode(Mode EnableState) Return + ClearAccountingPids() Return + GetNvLinkState(Link int) (EnableState, Return) + GetNvLinkVersion(Link int) (uint32, Return) + GetNvLinkCapability(Link int, Capability NvLinkCapability) (uint32, Return) + GetNvLinkRemotePciInfo(Link int) (PciInfo, Return) + GetNvLinkErrorCounter(Link int, Counter NvLinkErrorCounter) (uint64, Return) + ResetNvLinkErrorCounters(Link int) Return + SetNvLinkUtilizationControl(Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return + GetNvLinkUtilizationControl(Link int, Counter int) (NvLinkUtilizationControl, Return) + GetNvLinkUtilizationCounter(Link int, Counter int) (uint64, uint64, Return) + FreezeNvLinkUtilizationCounter(Link int, Counter int, Freeze EnableState) Return + ResetNvLinkUtilizationCounter(Link int, Counter int) Return + GetNvLinkRemoteDeviceType(Link int) (IntNvLinkDeviceType, Return) + RegisterEvents(EventTypes uint64, Set EventSet) Return + GetSupportedEventTypes() (uint64, Return) + GetFieldValues(Values []FieldValue) Return + GetVirtualizationMode() (GpuVirtualizationMode, Return) + GetHostVgpuMode() (HostVgpuMode, Return) + SetVirtualizationMode(VirtualMode GpuVirtualizationMode) Return + GetGridLicensableFeatures() (GridLicensableFeatures, Return) + GetProcessUtilization(LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) + GetSupportedVgpus() ([]VgpuTypeId, Return) + GetCreatableVgpus() ([]VgpuTypeId, Return) + GetActiveVgpus() ([]VgpuInstance, Return) + GetVgpuMetadata() (VgpuPgpuMetadata, Return) + GetPgpuMetadataString() (string, Return) + GetVgpuUtilization(LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) + GetAttributes() (DeviceAttributes, Return) + GetRemappedRows() (int, int, bool, bool, Return) + GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) + GetArchitecture() (DeviceArchitecture, Return) + GetVgpuProcessUtilization(LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) + SetMigMode(Mode int) (Return, Return) + GetMigMode() (int, int, Return) + GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) + GetGpuInstanceProfileInfoV(Profile int) GpuInstanceProfileInfoV + GetGpuInstancePossiblePlacements(Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) + GetGpuInstanceRemainingCapacity(Info *GpuInstanceProfileInfo) (int, Return) + CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) + CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) + GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) + GetGpuInstanceById(Id int) (GpuInstance, Return) + IsMigDeviceHandle() (bool, Return) + GetGpuInstanceId() (int, Return) + GetComputeInstanceId() (int, Return) + GetMaxMigDeviceCount() (int, Return) + GetMigDeviceHandleByIndex(Index int) (Device, Return) + GetDeviceHandleFromMigDeviceHandle() (Device, Return) + GetBusType() (BusType, Return) + SetDefaultFanSpeed_v2(Fan int) Return + GetMinMaxFanSpeed() (int, int, Return) + GetThermalSettings(SensorIndex uint32) (GpuThermalSettings, Return) + GetDefaultEccMode() (EnableState, Return) + GetPcieSpeed() (int, Return) + GetGspFirmwareVersion() (string, Return) + GetGspFirmwareMode() (bool, bool, Return) + GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) + SetFanSpeed_v2(Fan int, Speed int) Return + GetGpcClkVfOffset() (int, Return) + SetGpcClkVfOffset(Offset int) Return + GetMinMaxClockOfPState(_type ClockType, Pstate Pstates) (uint32, uint32, Return) + GetSupportedPerformanceStates() ([]Pstates, Return) + GetTargetFanSpeed(Fan int) (int, Return) + GetMemClkVfOffset() (int, Return) + SetMemClkVfOffset(Offset int) Return + GetGpcClkMinMaxVfOffset() (int, int, Return) + GetMemClkMinMaxVfOffset() (int, int, Return) + GetGpuMaxPcieLinkGeneration() (int, Return) + GetFanControlPolicy_v2(Fan int) (FanControlPolicy, Return) + SetFanControlPolicy(Fan int, Policy FanControlPolicy) Return + ClearFieldValues(Values []FieldValue) Return + GetVgpuCapabilities(Capability DeviceVgpuCapability) (bool, Return) + GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) + GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) + SetVgpuSchedulerState(PSchedulerState *VgpuSchedulerSetState) Return + GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) + GetGpuFabricInfo() (GpuFabricInfo, Return) + CcuGetStreamState() (int, Return) + CcuSetStreamState(State int) Return + SetNvLinkDeviceLowPowerThreshold(Info *NvLinkPowerThres) Return + GpmSampleGet(GpmSample GpmSample) Return + GpmQueryDeviceSupportV() GpmSupportV + GpmQueryDeviceSupport() (GpmSupport, Return) + GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) Return + VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) +} + // Define package level methods as aliases to Interface methods of libnvml var ( GetLibrary = libnvml.GetLibrary diff --git a/pkg/nvml/cgo_helpers_static.go b/pkg/nvml/cgo_helpers_static.go index b04f366..1f30eaa 100644 --- a/pkg/nvml/cgo_helpers_static.go +++ b/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/pkg/nvml/device.go b/pkg/nvml/device.go index 4cdf04f..9a2aa78 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -30,143 +30,147 @@ func (l *library) DeviceGetCount() (int, Return) { // nvml.DeviceGetHandleByIndex() func (l *library) DeviceGetHandleByIndex(Index int) (Device, Return) { - var Device Device + var Device nvmlDevice ret := nvmlDeviceGetHandleByIndex(uint32(Index), &Device) return Device, ret } // nvml.DeviceGetHandleBySerial() func (l *library) DeviceGetHandleBySerial(Serial string) (Device, Return) { - var Device Device + var Device nvmlDevice ret := nvmlDeviceGetHandleBySerial(Serial+string(rune(0)), &Device) return Device, ret } // nvml.DeviceGetHandleByUUID() func (l *library) DeviceGetHandleByUUID(Uuid string) (Device, Return) { - var Device Device + var Device nvmlDevice ret := nvmlDeviceGetHandleByUUID(Uuid+string(rune(0)), &Device) return Device, ret } // nvml.DeviceGetHandleByPciBusId() func (l *library) DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) { - var Device Device + var Device nvmlDevice ret := nvmlDeviceGetHandleByPciBusId(PciBusId+string(rune(0)), &Device) return Device, ret } // nvml.DeviceGetName() func (l *library) DeviceGetName(Device Device) (string, Return) { + return Device.GetName() +} + +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 } -func (Device Device) GetName() (string, Return) { - return DeviceGetName(Device) -} - // nvml.DeviceGetBrand() func (l *library) DeviceGetBrand(Device Device) (BrandType, Return) { + return Device.GetBrand() +} + +func (Device nvmlDevice) GetBrand() (BrandType, Return) { var _type BrandType ret := nvmlDeviceGetBrand(Device, &_type) return _type, ret } -func (Device Device) GetBrand() (BrandType, Return) { - return DeviceGetBrand(Device) -} - // nvml.DeviceGetIndex() func (l *library) DeviceGetIndex(Device Device) (int, Return) { + return Device.GetIndex() +} + +func (Device nvmlDevice) GetIndex() (int, Return) { var Index uint32 ret := nvmlDeviceGetIndex(Device, &Index) return int(Index), ret } -func (Device Device) GetIndex() (int, Return) { - return DeviceGetIndex(Device) -} - // nvml.DeviceGetSerial() func (l *library) DeviceGetSerial(Device Device) (string, Return) { + return Device.GetSerial() +} + +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 } -func (Device Device) GetSerial() (string, Return) { - return DeviceGetSerial(Device) -} - // nvml.DeviceGetCpuAffinity() func (l *library) DeviceGetCpuAffinity(Device Device, NumCPUs int) ([]uint, Return) { + return Device.GetCpuAffinity(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 } -func (Device Device) GetCpuAffinity(NumCPUs int) ([]uint, Return) { - return DeviceGetCpuAffinity(Device, NumCPUs) -} - // nvml.DeviceSetCpuAffinity() func (l *library) DeviceSetCpuAffinity(Device Device) Return { - return nvmlDeviceSetCpuAffinity(Device) + return Device.SetCpuAffinity() } -func (Device Device) SetCpuAffinity() Return { - return DeviceSetCpuAffinity(Device) +func (Device nvmlDevice) SetCpuAffinity() Return { + return nvmlDeviceSetCpuAffinity(Device) } // nvml.DeviceClearCpuAffinity() func (l *library) DeviceClearCpuAffinity(Device Device) Return { - return nvmlDeviceClearCpuAffinity(Device) + return Device.ClearCpuAffinity() } -func (Device Device) ClearCpuAffinity() Return { - return DeviceClearCpuAffinity(Device) +func (Device nvmlDevice) ClearCpuAffinity() Return { + return nvmlDeviceClearCpuAffinity(Device) } // nvml.DeviceGetMemoryAffinity() func (l *library) DeviceGetMemoryAffinity(Device Device, NumNodes int, Scope AffinityScope) ([]uint, Return) { + return Device.GetMemoryAffinity(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 } -func (Device Device) GetMemoryAffinity(NumNodes int, Scope AffinityScope) ([]uint, Return) { - return DeviceGetMemoryAffinity(Device, NumNodes, Scope) -} - // nvml.DeviceGetCpuAffinityWithinScope() func (l *library) DeviceGetCpuAffinityWithinScope(Device Device, NumCPUs int, Scope AffinityScope) ([]uint, Return) { + return Device.GetCpuAffinityWithinScope(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 } -func (Device Device) GetCpuAffinityWithinScope(NumCPUs int, Scope AffinityScope) ([]uint, Return) { - return DeviceGetCpuAffinityWithinScope(Device, NumCPUs, Scope) -} - // nvml.DeviceGetTopologyCommonAncestor() func (l *library) DeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device) (GpuTopologyLevel, Return) { + return Device1.GetTopologyCommonAncestor(Device2) +} + +func (Device1 nvmlDevice) GetTopologyCommonAncestor(Device2 Device) (GpuTopologyLevel, Return) { var PathInfo GpuTopologyLevel - ret := nvmlDeviceGetTopologyCommonAncestor(Device1, Device2, &PathInfo) + ret := nvmlDeviceGetTopologyCommonAncestor(Device1, Device2.(nvmlDevice), &PathInfo) return PathInfo, ret } -func (Device1 Device) GetTopologyCommonAncestor(Device2 Device) (GpuTopologyLevel, Return) { - return DeviceGetTopologyCommonAncestor(Device1, Device2) +// nvml.DeviceGetTopologyNearestGpus() +func (l *library) DeviceGetTopologyNearestGpus(Device Device, Level GpuTopologyLevel) ([]Device, Return) { + return Device.GetTopologyNearestGpus(Level) } -// nvml.DeviceGetTopologyNearestGpus() -func (l *library) DeviceGetTopologyNearestGpus(device Device, Level GpuTopologyLevel) ([]Device, Return) { +func (device nvmlDevice) GetTopologyNearestGpus(Level GpuTopologyLevel) ([]Device, Return) { var Count uint32 ret := nvmlDeviceGetTopologyNearestGpus(device, Level, &Count, nil) if ret != SUCCESS { @@ -175,692 +179,692 @@ func (l *library) DeviceGetTopologyNearestGpus(device Device, Level GpuTopologyL if Count == 0 { return []Device{}, ret } - DeviceArray := make([]Device, Count) + DeviceArray := make([]nvmlDevice, Count) ret = nvmlDeviceGetTopologyNearestGpus(device, Level, &Count, &DeviceArray[0]) - return DeviceArray, ret -} - -func (Device Device) GetTopologyNearestGpus(Level GpuTopologyLevel) ([]Device, Return) { - return DeviceGetTopologyNearestGpus(Device, Level) + return convertSlice[nvmlDevice, Device](DeviceArray), ret } // nvml.DeviceGetP2PStatus() func (l *library) DeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { - var P2pStatus GpuP2PStatus - ret := nvmlDeviceGetP2PStatus(Device1, Device2, P2pIndex, &P2pStatus) - return P2pStatus, ret + 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 (l *library) DeviceGetUUID(Device Device) (string, Return) { + return Device.GetUUID() +} + +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 } -func (Device Device) GetUUID() (string, Return) { - return DeviceGetUUID(Device) -} - // nvml.DeviceGetMinorNumber() func (l *library) DeviceGetMinorNumber(Device Device) (int, Return) { + return Device.GetMinorNumber() +} + +func (Device nvmlDevice) GetMinorNumber() (int, Return) { var MinorNumber uint32 ret := nvmlDeviceGetMinorNumber(Device, &MinorNumber) return int(MinorNumber), ret } -func (Device Device) GetMinorNumber() (int, Return) { - return DeviceGetMinorNumber(Device) -} - // nvml.DeviceGetBoardPartNumber() func (l *library) DeviceGetBoardPartNumber(Device Device) (string, Return) { + return Device.GetBoardPartNumber() +} + +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 } -func (Device Device) GetBoardPartNumber() (string, Return) { - return DeviceGetBoardPartNumber(Device) -} - // nvml.DeviceGetInforomVersion() func (l *library) DeviceGetInforomVersion(Device Device, Object InforomObject) (string, Return) { + return Device.GetInforomVersion(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 } -func (Device Device) GetInforomVersion(Object InforomObject) (string, Return) { - return DeviceGetInforomVersion(Device, Object) -} - // nvml.DeviceGetInforomImageVersion() func (l *library) DeviceGetInforomImageVersion(Device Device) (string, Return) { + return Device.GetInforomImageVersion() +} + +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 } -func (Device Device) GetInforomImageVersion() (string, Return) { - return DeviceGetInforomImageVersion(Device) -} - // nvml.DeviceGetInforomConfigurationChecksum() func (l *library) DeviceGetInforomConfigurationChecksum(Device Device) (uint32, Return) { + return Device.GetInforomConfigurationChecksum() +} + +func (Device nvmlDevice) GetInforomConfigurationChecksum() (uint32, Return) { var Checksum uint32 ret := nvmlDeviceGetInforomConfigurationChecksum(Device, &Checksum) return Checksum, ret } -func (Device Device) GetInforomConfigurationChecksum() (uint32, Return) { - return DeviceGetInforomConfigurationChecksum(Device) -} - // nvml.DeviceValidateInforom() func (l *library) DeviceValidateInforom(Device Device) Return { - return nvmlDeviceValidateInforom(Device) + return Device.ValidateInforom() } -func (Device Device) ValidateInforom() Return { - return DeviceValidateInforom(Device) +func (Device nvmlDevice) ValidateInforom() Return { + return nvmlDeviceValidateInforom(Device) } // nvml.DeviceGetDisplayMode() func (l *library) DeviceGetDisplayMode(Device Device) (EnableState, Return) { + return Device.GetDisplayMode() +} + +func (Device nvmlDevice) GetDisplayMode() (EnableState, Return) { var Display EnableState ret := nvmlDeviceGetDisplayMode(Device, &Display) return Display, ret } -func (Device Device) GetDisplayMode() (EnableState, Return) { - return DeviceGetDisplayMode(Device) -} - // nvml.DeviceGetDisplayActive() func (l *library) DeviceGetDisplayActive(Device Device) (EnableState, Return) { + return Device.GetDisplayActive() +} + +func (Device nvmlDevice) GetDisplayActive() (EnableState, Return) { var IsActive EnableState ret := nvmlDeviceGetDisplayActive(Device, &IsActive) return IsActive, ret } -func (Device Device) GetDisplayActive() (EnableState, Return) { - return DeviceGetDisplayActive(Device) -} - // nvml.DeviceGetPersistenceMode() func (l *library) DeviceGetPersistenceMode(Device Device) (EnableState, Return) { + return Device.GetPersistenceMode() +} + +func (Device nvmlDevice) GetPersistenceMode() (EnableState, Return) { var Mode EnableState ret := nvmlDeviceGetPersistenceMode(Device, &Mode) return Mode, ret } -func (Device Device) GetPersistenceMode() (EnableState, Return) { - return DeviceGetPersistenceMode(Device) -} - // nvml.DeviceGetPciInfo() func (l *library) DeviceGetPciInfo(Device Device) (PciInfo, Return) { + return Device.GetPciInfo() +} + +func (Device nvmlDevice) GetPciInfo() (PciInfo, Return) { var Pci PciInfo ret := nvmlDeviceGetPciInfo(Device, &Pci) return Pci, ret } -func (Device Device) GetPciInfo() (PciInfo, Return) { - return DeviceGetPciInfo(Device) -} - // nvml.DeviceGetMaxPcieLinkGeneration() func (l *library) DeviceGetMaxPcieLinkGeneration(Device Device) (int, Return) { + return Device.GetMaxPcieLinkGeneration() +} + +func (Device nvmlDevice) GetMaxPcieLinkGeneration() (int, Return) { var MaxLinkGen uint32 ret := nvmlDeviceGetMaxPcieLinkGeneration(Device, &MaxLinkGen) return int(MaxLinkGen), ret } -func (Device Device) GetMaxPcieLinkGeneration() (int, Return) { - return DeviceGetMaxPcieLinkGeneration(Device) -} - // nvml.DeviceGetMaxPcieLinkWidth() func (l *library) DeviceGetMaxPcieLinkWidth(Device Device) (int, Return) { + return Device.GetMaxPcieLinkWidth() +} + +func (Device nvmlDevice) GetMaxPcieLinkWidth() (int, Return) { var MaxLinkWidth uint32 ret := nvmlDeviceGetMaxPcieLinkWidth(Device, &MaxLinkWidth) return int(MaxLinkWidth), ret } -func (Device Device) GetMaxPcieLinkWidth() (int, Return) { - return DeviceGetMaxPcieLinkWidth(Device) -} - // nvml.DeviceGetCurrPcieLinkGeneration() func (l *library) DeviceGetCurrPcieLinkGeneration(Device Device) (int, Return) { + return Device.GetCurrPcieLinkGeneration() +} + +func (Device nvmlDevice) GetCurrPcieLinkGeneration() (int, Return) { var CurrLinkGen uint32 ret := nvmlDeviceGetCurrPcieLinkGeneration(Device, &CurrLinkGen) return int(CurrLinkGen), ret } -func (Device Device) GetCurrPcieLinkGeneration() (int, Return) { - return DeviceGetCurrPcieLinkGeneration(Device) -} - // nvml.DeviceGetCurrPcieLinkWidth() func (l *library) DeviceGetCurrPcieLinkWidth(Device Device) (int, Return) { + return Device.GetCurrPcieLinkWidth() +} + +func (Device nvmlDevice) GetCurrPcieLinkWidth() (int, Return) { var CurrLinkWidth uint32 ret := nvmlDeviceGetCurrPcieLinkWidth(Device, &CurrLinkWidth) return int(CurrLinkWidth), ret } -func (Device Device) GetCurrPcieLinkWidth() (int, Return) { - return DeviceGetCurrPcieLinkWidth(Device) -} - // nvml.DeviceGetPcieThroughput() func (l *library) DeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter) (uint32, Return) { + return Device.GetPcieThroughput(Counter) +} + +func (Device nvmlDevice) GetPcieThroughput(Counter PcieUtilCounter) (uint32, Return) { var Value uint32 ret := nvmlDeviceGetPcieThroughput(Device, Counter, &Value) return Value, ret } -func (Device Device) GetPcieThroughput(Counter PcieUtilCounter) (uint32, Return) { - return DeviceGetPcieThroughput(Device, Counter) -} - // nvml.DeviceGetPcieReplayCounter() func (l *library) DeviceGetPcieReplayCounter(Device Device) (int, Return) { + return Device.GetPcieReplayCounter() +} + +func (Device nvmlDevice) GetPcieReplayCounter() (int, Return) { var Value uint32 ret := nvmlDeviceGetPcieReplayCounter(Device, &Value) return int(Value), ret } -func (Device Device) GetPcieReplayCounter() (int, Return) { - return DeviceGetPcieReplayCounter(Device) -} - // nvml.nvmlDeviceGetClockInfo() func (l *library) DeviceGetClockInfo(Device Device, _type ClockType) (uint32, Return) { + return Device.GetClockInfo(_type) +} + +func (Device nvmlDevice) GetClockInfo(_type ClockType) (uint32, Return) { var Clock uint32 ret := nvmlDeviceGetClockInfo(Device, _type, &Clock) return Clock, ret } -func (Device Device) GetClockInfo(_type ClockType) (uint32, Return) { - return DeviceGetClockInfo(Device, _type) -} - // nvml.DeviceGetMaxClockInfo() func (l *library) DeviceGetMaxClockInfo(Device Device, _type ClockType) (uint32, Return) { + return Device.GetMaxClockInfo(_type) +} + +func (Device nvmlDevice) GetMaxClockInfo(_type ClockType) (uint32, Return) { var Clock uint32 ret := nvmlDeviceGetMaxClockInfo(Device, _type, &Clock) return Clock, ret } -func (Device Device) GetMaxClockInfo(_type ClockType) (uint32, Return) { - return DeviceGetMaxClockInfo(Device, _type) -} - // nvml.DeviceGetApplicationsClock() func (l *library) DeviceGetApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { + return Device.GetApplicationsClock(ClockType) +} + +func (Device nvmlDevice) GetApplicationsClock(ClockType ClockType) (uint32, Return) { var ClockMHz uint32 ret := nvmlDeviceGetApplicationsClock(Device, ClockType, &ClockMHz) return ClockMHz, ret } -func (Device Device) GetApplicationsClock(ClockType ClockType) (uint32, Return) { - return DeviceGetApplicationsClock(Device, ClockType) -} - // nvml.DeviceGetDefaultApplicationsClock() func (l *library) DeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { + return Device.GetDefaultApplicationsClock(ClockType) +} + +func (Device nvmlDevice) GetDefaultApplicationsClock(ClockType ClockType) (uint32, Return) { var ClockMHz uint32 ret := nvmlDeviceGetDefaultApplicationsClock(Device, ClockType, &ClockMHz) return ClockMHz, ret } -func (Device Device) GetDefaultApplicationsClock(ClockType ClockType) (uint32, Return) { - return DeviceGetDefaultApplicationsClock(Device, ClockType) -} - // nvml.DeviceResetApplicationsClocks() func (l *library) DeviceResetApplicationsClocks(Device Device) Return { - return nvmlDeviceResetApplicationsClocks(Device) + return Device.ResetApplicationsClocks() } -func (Device Device) ResetApplicationsClocks() Return { - return DeviceResetApplicationsClocks(Device) +func (Device nvmlDevice) ResetApplicationsClocks() Return { + return nvmlDeviceResetApplicationsClocks(Device) } // nvml.DeviceGetClock() func (l *library) DeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId) (uint32, Return) { + return Device.GetClock(ClockType, ClockId) +} + +func (Device nvmlDevice) GetClock(ClockType ClockType, ClockId ClockId) (uint32, Return) { var ClockMHz uint32 ret := nvmlDeviceGetClock(Device, ClockType, ClockId, &ClockMHz) return ClockMHz, ret } -func (Device Device) GetClock(ClockType ClockType, ClockId ClockId) (uint32, Return) { - return DeviceGetClock(Device, ClockType, ClockId) -} - // nvml.DeviceGetMaxCustomerBoostClock() func (l *library) DeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType) (uint32, Return) { + return Device.GetMaxCustomerBoostClock(ClockType) +} + +func (Device nvmlDevice) GetMaxCustomerBoostClock(ClockType ClockType) (uint32, Return) { var ClockMHz uint32 ret := nvmlDeviceGetMaxCustomerBoostClock(Device, ClockType, &ClockMHz) return ClockMHz, ret } -func (Device Device) GetMaxCustomerBoostClock(ClockType ClockType) (uint32, Return) { - return DeviceGetMaxCustomerBoostClock(Device, ClockType) -} - // nvml.DeviceGetSupportedMemoryClocks() func (l *library) DeviceGetSupportedMemoryClocks(Device Device) (int, uint32, Return) { + return Device.GetSupportedMemoryClocks() +} + +func (Device nvmlDevice) GetSupportedMemoryClocks() (int, uint32, Return) { var Count, ClocksMHz uint32 ret := nvmlDeviceGetSupportedMemoryClocks(Device, &Count, &ClocksMHz) return int(Count), ClocksMHz, ret } -func (Device Device) GetSupportedMemoryClocks() (int, uint32, Return) { - return DeviceGetSupportedMemoryClocks(Device) -} - // nvml.DeviceGetSupportedGraphicsClocks() func (l *library) DeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz int) (int, uint32, Return) { + return Device.GetSupportedGraphicsClocks(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 } -func (Device Device) GetSupportedGraphicsClocks(MemoryClockMHz int) (int, uint32, Return) { - return DeviceGetSupportedGraphicsClocks(Device, MemoryClockMHz) -} - // nvml.DeviceGetAutoBoostedClocksEnabled() func (l *library) DeviceGetAutoBoostedClocksEnabled(Device Device) (EnableState, EnableState, Return) { + return Device.GetAutoBoostedClocksEnabled() +} + +func (Device nvmlDevice) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) { var IsEnabled, DefaultIsEnabled EnableState ret := nvmlDeviceGetAutoBoostedClocksEnabled(Device, &IsEnabled, &DefaultIsEnabled) return IsEnabled, DefaultIsEnabled, ret } -func (Device Device) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) { - return DeviceGetAutoBoostedClocksEnabled(Device) -} - // nvml.DeviceSetAutoBoostedClocksEnabled() func (l *library) DeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return { - return nvmlDeviceSetAutoBoostedClocksEnabled(Device, Enabled) + 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 (l *library) DeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return { - return nvmlDeviceSetDefaultAutoBoostedClocksEnabled(Device, Enabled, Flags) + 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 (l *library) DeviceGetFanSpeed(Device Device) (uint32, Return) { + return Device.GetFanSpeed() +} + +func (Device nvmlDevice) GetFanSpeed() (uint32, Return) { var Speed uint32 ret := nvmlDeviceGetFanSpeed(Device, &Speed) return Speed, ret } -func (Device Device) GetFanSpeed() (uint32, Return) { - return DeviceGetFanSpeed(Device) -} - // nvml.DeviceGetFanSpeed_v2() func (l *library) DeviceGetFanSpeed_v2(Device Device, Fan int) (uint32, Return) { + return Device.GetFanSpeed_v2(Fan) +} + +func (Device nvmlDevice) GetFanSpeed_v2(Fan int) (uint32, Return) { var Speed uint32 ret := nvmlDeviceGetFanSpeed_v2(Device, uint32(Fan), &Speed) return Speed, ret } -func (Device Device) GetFanSpeed_v2(Fan int) (uint32, Return) { - return DeviceGetFanSpeed_v2(Device, Fan) -} - // nvml.DeviceGetNumFans() func (l *library) DeviceGetNumFans(Device Device) (int, Return) { + return Device.GetNumFans() +} + +func (Device nvmlDevice) GetNumFans() (int, Return) { var NumFans uint32 ret := nvmlDeviceGetNumFans(Device, &NumFans) return int(NumFans), ret } -func (Device Device) GetNumFans() (int, Return) { - return DeviceGetNumFans(Device) -} - // nvml.DeviceGetTemperature() func (l *library) DeviceGetTemperature(Device Device, SensorType TemperatureSensors) (uint32, Return) { + return Device.GetTemperature(SensorType) +} + +func (Device nvmlDevice) GetTemperature(SensorType TemperatureSensors) (uint32, Return) { var Temp uint32 ret := nvmlDeviceGetTemperature(Device, SensorType, &Temp) return Temp, ret } -func (Device Device) GetTemperature(SensorType TemperatureSensors) (uint32, Return) { - return DeviceGetTemperature(Device, SensorType) -} - // nvml.DeviceGetTemperatureThreshold() func (l *library) DeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds) (uint32, Return) { + return Device.GetTemperatureThreshold(ThresholdType) +} + +func (Device nvmlDevice) GetTemperatureThreshold(ThresholdType TemperatureThresholds) (uint32, Return) { var Temp uint32 ret := nvmlDeviceGetTemperatureThreshold(Device, ThresholdType, &Temp) return Temp, ret } -func (Device Device) GetTemperatureThreshold(ThresholdType TemperatureThresholds) (uint32, Return) { - return DeviceGetTemperatureThreshold(Device, ThresholdType) -} - // nvml.DeviceSetTemperatureThreshold() func (l *library) DeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp int) Return { + return Device.SetTemperatureThreshold(ThresholdType, Temp) +} + +func (Device nvmlDevice) SetTemperatureThreshold(ThresholdType TemperatureThresholds, Temp int) Return { t := int32(Temp) ret := nvmlDeviceSetTemperatureThreshold(Device, ThresholdType, &t) return ret } -func (Device Device) SetTemperatureThreshold(ThresholdType TemperatureThresholds, Temp int) Return { - return DeviceSetTemperatureThreshold(Device, ThresholdType, Temp) -} - // nvml.DeviceGetPerformanceState() func (l *library) DeviceGetPerformanceState(Device Device) (Pstates, Return) { + return Device.GetPerformanceState() +} + +func (Device nvmlDevice) GetPerformanceState() (Pstates, Return) { var PState Pstates ret := nvmlDeviceGetPerformanceState(Device, &PState) return PState, ret } -func (Device Device) GetPerformanceState() (Pstates, Return) { - return DeviceGetPerformanceState(Device) -} - // nvml.DeviceGetCurrentClocksThrottleReasons() func (l *library) DeviceGetCurrentClocksThrottleReasons(Device Device) (uint64, Return) { + return Device.GetCurrentClocksThrottleReasons() +} + +func (Device nvmlDevice) GetCurrentClocksThrottleReasons() (uint64, Return) { var ClocksThrottleReasons uint64 ret := nvmlDeviceGetCurrentClocksThrottleReasons(Device, &ClocksThrottleReasons) return ClocksThrottleReasons, ret } -func (Device Device) GetCurrentClocksThrottleReasons() (uint64, Return) { - return DeviceGetCurrentClocksThrottleReasons(Device) -} - // nvml.DeviceGetSupportedClocksThrottleReasons() func (l *library) DeviceGetSupportedClocksThrottleReasons(Device Device) (uint64, Return) { + return Device.GetSupportedClocksThrottleReasons() +} + +func (Device nvmlDevice) GetSupportedClocksThrottleReasons() (uint64, Return) { var SupportedClocksThrottleReasons uint64 ret := nvmlDeviceGetSupportedClocksThrottleReasons(Device, &SupportedClocksThrottleReasons) return SupportedClocksThrottleReasons, ret } -func (Device Device) GetSupportedClocksThrottleReasons() (uint64, Return) { - return DeviceGetSupportedClocksThrottleReasons(Device) -} - // nvml.DeviceGetPowerState() func (l *library) DeviceGetPowerState(Device Device) (Pstates, Return) { + return Device.GetPowerState() +} + +func (Device nvmlDevice) GetPowerState() (Pstates, Return) { var PState Pstates ret := nvmlDeviceGetPowerState(Device, &PState) return PState, ret } -func (Device Device) GetPowerState() (Pstates, Return) { - return DeviceGetPowerState(Device) -} - // nvml.DeviceGetPowerManagementMode() func (l *library) DeviceGetPowerManagementMode(Device Device) (EnableState, Return) { + return Device.GetPowerManagementMode() +} + +func (Device nvmlDevice) GetPowerManagementMode() (EnableState, Return) { var Mode EnableState ret := nvmlDeviceGetPowerManagementMode(Device, &Mode) return Mode, ret } -func (Device Device) GetPowerManagementMode() (EnableState, Return) { - return DeviceGetPowerManagementMode(Device) -} - // nvml.DeviceGetPowerManagementLimit() func (l *library) DeviceGetPowerManagementLimit(Device Device) (uint32, Return) { + return Device.GetPowerManagementLimit() +} + +func (Device nvmlDevice) GetPowerManagementLimit() (uint32, Return) { var Limit uint32 ret := nvmlDeviceGetPowerManagementLimit(Device, &Limit) return Limit, ret } -func (Device Device) GetPowerManagementLimit() (uint32, Return) { - return DeviceGetPowerManagementLimit(Device) -} - // nvml.DeviceGetPowerManagementLimitConstraints() func (l *library) DeviceGetPowerManagementLimitConstraints(Device Device) (uint32, uint32, Return) { + return Device.GetPowerManagementLimitConstraints() +} + +func (Device nvmlDevice) GetPowerManagementLimitConstraints() (uint32, uint32, Return) { var MinLimit, MaxLimit uint32 ret := nvmlDeviceGetPowerManagementLimitConstraints(Device, &MinLimit, &MaxLimit) return MinLimit, MaxLimit, ret } -func (Device Device) GetPowerManagementLimitConstraints() (uint32, uint32, Return) { - return DeviceGetPowerManagementLimitConstraints(Device) -} - // nvml.DeviceGetPowerManagementDefaultLimit() func (l *library) DeviceGetPowerManagementDefaultLimit(Device Device) (uint32, Return) { + return Device.GetPowerManagementDefaultLimit() +} + +func (Device nvmlDevice) GetPowerManagementDefaultLimit() (uint32, Return) { var DefaultLimit uint32 ret := nvmlDeviceGetPowerManagementDefaultLimit(Device, &DefaultLimit) return DefaultLimit, ret } -func (Device Device) GetPowerManagementDefaultLimit() (uint32, Return) { - return DeviceGetPowerManagementDefaultLimit(Device) -} - // nvml.DeviceGetPowerUsage() func (l *library) DeviceGetPowerUsage(Device Device) (uint32, Return) { + return Device.GetPowerUsage() +} + +func (Device nvmlDevice) GetPowerUsage() (uint32, Return) { var Power uint32 ret := nvmlDeviceGetPowerUsage(Device, &Power) return Power, ret } -func (Device Device) GetPowerUsage() (uint32, Return) { - return DeviceGetPowerUsage(Device) -} - // nvml.DeviceGetTotalEnergyConsumption() func (l *library) DeviceGetTotalEnergyConsumption(Device Device) (uint64, Return) { + return Device.GetTotalEnergyConsumption() +} + +func (Device nvmlDevice) GetTotalEnergyConsumption() (uint64, Return) { var Energy uint64 ret := nvmlDeviceGetTotalEnergyConsumption(Device, &Energy) return Energy, ret } -func (Device Device) GetTotalEnergyConsumption() (uint64, Return) { - return DeviceGetTotalEnergyConsumption(Device) -} - // nvml.DeviceGetEnforcedPowerLimit() func (l *library) DeviceGetEnforcedPowerLimit(Device Device) (uint32, Return) { + return Device.GetEnforcedPowerLimit() +} + +func (Device nvmlDevice) GetEnforcedPowerLimit() (uint32, Return) { var Limit uint32 ret := nvmlDeviceGetEnforcedPowerLimit(Device, &Limit) return Limit, ret } -func (Device Device) GetEnforcedPowerLimit() (uint32, Return) { - return DeviceGetEnforcedPowerLimit(Device) -} - // nvml.DeviceGetGpuOperationMode() func (l *library) DeviceGetGpuOperationMode(Device Device) (GpuOperationMode, GpuOperationMode, Return) { + return Device.GetGpuOperationMode() +} + +func (Device nvmlDevice) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) { var Current, Pending GpuOperationMode ret := nvmlDeviceGetGpuOperationMode(Device, &Current, &Pending) return Current, Pending, ret } -func (Device Device) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) { - return DeviceGetGpuOperationMode(Device) -} - // nvml.DeviceGetMemoryInfo() func (l *library) DeviceGetMemoryInfo(Device Device) (Memory, Return) { + return Device.GetMemoryInfo() +} + +func (Device nvmlDevice) GetMemoryInfo() (Memory, Return) { var Memory Memory ret := nvmlDeviceGetMemoryInfo(Device, &Memory) return Memory, ret } -func (Device Device) GetMemoryInfo() (Memory, Return) { - return DeviceGetMemoryInfo(Device) -} - // nvml.DeviceGetMemoryInfo_v2() func (l *library) DeviceGetMemoryInfo_v2(Device Device) (Memory_v2, Return) { + return Device.GetMemoryInfo_v2() +} + +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 } -func (Device Device) GetMemoryInfo_v2() (Memory_v2, Return) { - return DeviceGetMemoryInfo_v2(Device) -} - // nvml.DeviceGetComputeMode() func (l *library) DeviceGetComputeMode(Device Device) (ComputeMode, Return) { + return Device.GetComputeMode() +} + +func (Device nvmlDevice) GetComputeMode() (ComputeMode, Return) { var Mode ComputeMode ret := nvmlDeviceGetComputeMode(Device, &Mode) return Mode, ret } -func (Device Device) GetComputeMode() (ComputeMode, Return) { - return DeviceGetComputeMode(Device) -} - // nvml.DeviceGetCudaComputeCapability() func (l *library) DeviceGetCudaComputeCapability(Device Device) (int, int, Return) { + return Device.GetCudaComputeCapability() +} + +func (Device nvmlDevice) GetCudaComputeCapability() (int, int, Return) { var Major, Minor int32 ret := nvmlDeviceGetCudaComputeCapability(Device, &Major, &Minor) return int(Major), int(Minor), ret } -func (Device Device) GetCudaComputeCapability() (int, int, Return) { - return DeviceGetCudaComputeCapability(Device) -} - // nvml.DeviceGetEccMode() func (l *library) DeviceGetEccMode(Device Device) (EnableState, EnableState, Return) { + return Device.GetEccMode() +} + +func (Device nvmlDevice) GetEccMode() (EnableState, EnableState, Return) { var Current, Pending EnableState ret := nvmlDeviceGetEccMode(Device, &Current, &Pending) return Current, Pending, ret } -func (Device Device) GetEccMode() (EnableState, EnableState, Return) { - return DeviceGetEccMode(Device) -} - // nvml.DeviceGetBoardId() func (l *library) DeviceGetBoardId(Device Device) (uint32, Return) { + return Device.GetBoardId() +} + +func (Device nvmlDevice) GetBoardId() (uint32, Return) { var BoardId uint32 ret := nvmlDeviceGetBoardId(Device, &BoardId) return BoardId, ret } -func (Device Device) GetBoardId() (uint32, Return) { - return DeviceGetBoardId(Device) -} - // nvml.DeviceGetMultiGpuBoard() func (l *library) DeviceGetMultiGpuBoard(Device Device) (int, Return) { + return Device.GetMultiGpuBoard() +} + +func (Device nvmlDevice) GetMultiGpuBoard() (int, Return) { var MultiGpuBool uint32 ret := nvmlDeviceGetMultiGpuBoard(Device, &MultiGpuBool) return int(MultiGpuBool), ret } -func (Device Device) GetMultiGpuBoard() (int, Return) { - return DeviceGetMultiGpuBoard(Device) -} - // nvml.DeviceGetTotalEccErrors() func (l *library) DeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { + return Device.GetTotalEccErrors(ErrorType, CounterType) +} + +func (Device nvmlDevice) GetTotalEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { var EccCounts uint64 ret := nvmlDeviceGetTotalEccErrors(Device, ErrorType, CounterType, &EccCounts) return EccCounts, ret } -func (Device Device) GetTotalEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { - return DeviceGetTotalEccErrors(Device, ErrorType, CounterType) -} - // nvml.DeviceGetDetailedEccErrors() func (l *library) DeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { + return Device.GetDetailedEccErrors(ErrorType, CounterType) +} + +func (Device nvmlDevice) GetDetailedEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { var EccCounts EccErrorCounts ret := nvmlDeviceGetDetailedEccErrors(Device, ErrorType, CounterType, &EccCounts) return EccCounts, ret } -func (Device Device) GetDetailedEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { - return DeviceGetDetailedEccErrors(Device, ErrorType, CounterType) -} - // nvml.DeviceGetMemoryErrorCounter() func (l *library) DeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { + return Device.GetMemoryErrorCounter(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 } -func (Device Device) GetMemoryErrorCounter(ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { - return DeviceGetMemoryErrorCounter(Device, ErrorType, CounterType, LocationType) -} - // nvml.DeviceGetUtilizationRates() func (l *library) DeviceGetUtilizationRates(Device Device) (Utilization, Return) { + return Device.GetUtilizationRates() +} + +func (Device nvmlDevice) GetUtilizationRates() (Utilization, Return) { var Utilization Utilization ret := nvmlDeviceGetUtilizationRates(Device, &Utilization) return Utilization, ret } -func (Device Device) GetUtilizationRates() (Utilization, Return) { - return DeviceGetUtilizationRates(Device) -} - // nvml.DeviceGetEncoderUtilization() func (l *library) DeviceGetEncoderUtilization(Device Device) (uint32, uint32, Return) { + return Device.GetEncoderUtilization() +} + +func (Device nvmlDevice) GetEncoderUtilization() (uint32, uint32, Return) { var Utilization, SamplingPeriodUs uint32 ret := nvmlDeviceGetEncoderUtilization(Device, &Utilization, &SamplingPeriodUs) return Utilization, SamplingPeriodUs, ret } -func (Device Device) GetEncoderUtilization() (uint32, uint32, Return) { - return DeviceGetEncoderUtilization(Device) -} - // nvml.DeviceGetEncoderCapacity() func (l *library) DeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType) (int, Return) { + return Device.GetEncoderCapacity(EncoderQueryType) +} + +func (Device nvmlDevice) GetEncoderCapacity(EncoderQueryType EncoderType) (int, Return) { var EncoderCapacity uint32 ret := nvmlDeviceGetEncoderCapacity(Device, EncoderQueryType, &EncoderCapacity) return int(EncoderCapacity), ret } -func (Device Device) GetEncoderCapacity(EncoderQueryType EncoderType) (int, Return) { - return DeviceGetEncoderCapacity(Device, EncoderQueryType) -} - // nvml.DeviceGetEncoderStats() func (l *library) DeviceGetEncoderStats(Device Device) (int, uint32, uint32, Return) { + return Device.GetEncoderStats() +} + +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 } -func (Device Device) GetEncoderStats() (int, uint32, uint32, Return) { - return DeviceGetEncoderStats(Device) -} - // nvml.DeviceGetEncoderSessions() 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) @@ -875,34 +879,34 @@ func (l *library) DeviceGetEncoderSessions(Device Device) ([]EncoderSessionInfo, } } -func (Device Device) GetEncoderSessions() ([]EncoderSessionInfo, Return) { - return DeviceGetEncoderSessions(Device) -} - // nvml.DeviceGetDecoderUtilization() func (l *library) DeviceGetDecoderUtilization(Device Device) (uint32, uint32, Return) { + return Device.GetDecoderUtilization() +} + +func (Device nvmlDevice) GetDecoderUtilization() (uint32, uint32, Return) { var Utilization, SamplingPeriodUs uint32 ret := nvmlDeviceGetDecoderUtilization(Device, &Utilization, &SamplingPeriodUs) return Utilization, SamplingPeriodUs, ret } -func (Device Device) GetDecoderUtilization() (uint32, uint32, Return) { - return DeviceGetDecoderUtilization(Device) -} - // nvml.DeviceGetFBCStats() func (l *library) DeviceGetFBCStats(Device Device) (FBCStats, Return) { + return Device.GetFBCStats() +} + +func (Device nvmlDevice) GetFBCStats() (FBCStats, Return) { var FbcStats FBCStats ret := nvmlDeviceGetFBCStats(Device, &FbcStats) return FbcStats, ret } -func (Device Device) GetFBCStats() (FBCStats, Return) { - return DeviceGetFBCStats(Device) -} - // nvml.DeviceGetFBCSessions() 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) @@ -917,45 +921,41 @@ func (l *library) DeviceGetFBCSessions(Device Device) ([]FBCSessionInfo, Return) } } -func (Device Device) GetFBCSessions() ([]FBCSessionInfo, Return) { - return DeviceGetFBCSessions(Device) -} - // nvml.DeviceGetDriverModel() func (l *library) DeviceGetDriverModel(Device Device) (DriverModel, DriverModel, Return) { + return Device.GetDriverModel() +} + +func (Device nvmlDevice) GetDriverModel() (DriverModel, DriverModel, Return) { var Current, Pending DriverModel ret := nvmlDeviceGetDriverModel(Device, &Current, &Pending) return Current, Pending, ret } -func (Device Device) GetDriverModel() (DriverModel, DriverModel, Return) { - return DeviceGetDriverModel(Device) -} - // nvml.DeviceGetVbiosVersion() func (l *library) DeviceGetVbiosVersion(Device Device) (string, Return) { + return Device.GetVbiosVersion() +} + +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 } -func (Device Device) GetVbiosVersion() (string, Return) { - return DeviceGetVbiosVersion(Device) -} - // nvml.DeviceGetBridgeChipInfo() func (l *library) DeviceGetBridgeChipInfo(Device Device) (BridgeChipHierarchy, Return) { + return Device.GetBridgeChipInfo() +} + +func (Device nvmlDevice) GetBridgeChipInfo() (BridgeChipHierarchy, Return) { var BridgeHierarchy BridgeChipHierarchy ret := nvmlDeviceGetBridgeChipInfo(Device, &BridgeHierarchy) return BridgeHierarchy, ret } -func (Device Device) GetBridgeChipInfo() (BridgeChipHierarchy, Return) { - return DeviceGetBridgeChipInfo(Device) -} - // nvml.DeviceGetComputeRunningProcesses() -func deviceGetComputeRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { +func deviceGetComputeRunningProcesses_v1(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo_v1, InfoCount) @@ -970,7 +970,7 @@ func deviceGetComputeRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) } } -func deviceGetComputeRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { +func deviceGetComputeRunningProcesses_v2(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo_v2, InfoCount) @@ -985,7 +985,7 @@ func deviceGetComputeRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) } } -func deviceGetComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { +func deviceGetComputeRunningProcesses_v3(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo, InfoCount) @@ -1001,15 +1001,15 @@ func deviceGetComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) } func (l *library) DeviceGetComputeRunningProcesses(Device Device) ([]ProcessInfo, Return) { - return deviceGetComputeRunningProcesses(Device) + return Device.GetComputeRunningProcesses() } -func (Device Device) GetComputeRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetComputeRunningProcesses(Device) +func (Device nvmlDevice) GetComputeRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetComputeRunningProcesses(Device) } // nvml.DeviceGetGraphicsRunningProcesses() -func deviceGetGraphicsRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { +func deviceGetGraphicsRunningProcesses_v1(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo_v1, InfoCount) @@ -1024,7 +1024,7 @@ func deviceGetGraphicsRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) } } -func deviceGetGraphicsRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { +func deviceGetGraphicsRunningProcesses_v2(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo_v2, InfoCount) @@ -1039,7 +1039,7 @@ func deviceGetGraphicsRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) } } -func deviceGetGraphicsRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { +func deviceGetGraphicsRunningProcesses_v3(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo, InfoCount) @@ -1055,15 +1055,15 @@ func deviceGetGraphicsRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) } func (l *library) DeviceGetGraphicsRunningProcesses(Device Device) ([]ProcessInfo, Return) { - return deviceGetGraphicsRunningProcesses(Device) + return Device.GetGraphicsRunningProcesses() } -func (Device Device) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetGraphicsRunningProcesses(Device) +func (Device nvmlDevice) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetGraphicsRunningProcesses(Device) } // nvml.DeviceGetMPSComputeRunningProcesses() -func deviceGetMPSComputeRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { +func deviceGetMPSComputeRunningProcesses_v1(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo_v1, InfoCount) @@ -1078,7 +1078,7 @@ func deviceGetMPSComputeRunningProcesses_v1(Device Device) ([]ProcessInfo, Retur } } -func deviceGetMPSComputeRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { +func deviceGetMPSComputeRunningProcesses_v2(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo_v2, InfoCount) @@ -1093,7 +1093,7 @@ func deviceGetMPSComputeRunningProcesses_v2(Device Device) ([]ProcessInfo, Retur } } -func deviceGetMPSComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { +func deviceGetMPSComputeRunningProcesses_v3(Device nvmlDevice) ([]ProcessInfo, Return) { var InfoCount uint32 = 1 // Will be reduced upon returning for { Infos := make([]ProcessInfo, InfoCount) @@ -1109,37 +1109,41 @@ func deviceGetMPSComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Retur } func (l *library) DeviceGetMPSComputeRunningProcesses(Device Device) ([]ProcessInfo, Return) { - return deviceGetMPSComputeRunningProcesses(Device) + return Device.GetMPSComputeRunningProcesses() } -func (Device Device) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetMPSComputeRunningProcesses(Device) +func (Device nvmlDevice) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetMPSComputeRunningProcesses(Device) } // nvml.DeviceOnSameBoard() func (l *library) DeviceOnSameBoard(Device1 Device, Device2 Device) (int, Return) { - var OnSameBoard int32 - ret := nvmlDeviceOnSameBoard(Device1, Device2, &OnSameBoard) - return int(OnSameBoard), ret + 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 (l *library) DeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI) (EnableState, Return) { + return Device.GetAPIRestriction(ApiType) +} + +func (Device nvmlDevice) GetAPIRestriction(ApiType RestrictedAPI) (EnableState, Return) { var IsRestricted EnableState ret := nvmlDeviceGetAPIRestriction(Device, ApiType, &IsRestricted) return IsRestricted, ret } -func (Device Device) GetAPIRestriction(ApiType RestrictedAPI) (EnableState, Return) { - return DeviceGetAPIRestriction(Device, ApiType) -} - // nvml.DeviceGetSamples() func (l *library) DeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { + return Device.GetSamples(_type, LastSeenTimeStamp) +} + +func (Device nvmlDevice) GetSamples(_type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { var SampleValType ValueType var SampleCount uint32 ret := nvmlDeviceGetSamples(Device, _type, LastSeenTimeStamp, &SampleValType, &SampleCount, nil) @@ -1154,122 +1158,122 @@ func (l *library) DeviceGetSamples(Device Device, _type SamplingType, LastSeenTi return SampleValType, Samples, ret } -func (Device Device) GetSamples(_type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { - return DeviceGetSamples(Device, _type, LastSeenTimeStamp) -} - // nvml.DeviceGetBAR1MemoryInfo() func (l *library) DeviceGetBAR1MemoryInfo(Device Device) (BAR1Memory, Return) { + return Device.GetBAR1MemoryInfo() +} + +func (Device nvmlDevice) GetBAR1MemoryInfo() (BAR1Memory, Return) { var Bar1Memory BAR1Memory ret := nvmlDeviceGetBAR1MemoryInfo(Device, &Bar1Memory) return Bar1Memory, ret } -func (Device Device) GetBAR1MemoryInfo() (BAR1Memory, Return) { - return DeviceGetBAR1MemoryInfo(Device) -} - // nvml.DeviceGetViolationStatus() func (l *library) DeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType) (ViolationTime, Return) { + return Device.GetViolationStatus(PerfPolicyType) +} + +func (Device nvmlDevice) GetViolationStatus(PerfPolicyType PerfPolicyType) (ViolationTime, Return) { var ViolTime ViolationTime ret := nvmlDeviceGetViolationStatus(Device, PerfPolicyType, &ViolTime) return ViolTime, ret } -func (Device Device) GetViolationStatus(PerfPolicyType PerfPolicyType) (ViolationTime, Return) { - return DeviceGetViolationStatus(Device, PerfPolicyType) -} - // nvml.DeviceGetIrqNum() func (l *library) DeviceGetIrqNum(Device Device) (int, Return) { + return Device.GetIrqNum() +} + +func (Device nvmlDevice) GetIrqNum() (int, Return) { var IrqNum uint32 ret := nvmlDeviceGetIrqNum(Device, &IrqNum) return int(IrqNum), ret } -func (Device Device) GetIrqNum() (int, Return) { - return DeviceGetIrqNum(Device) -} - // nvml.DeviceGetNumGpuCores() func (l *library) DeviceGetNumGpuCores(Device Device) (int, Return) { + return Device.GetNumGpuCores() +} + +func (Device nvmlDevice) GetNumGpuCores() (int, Return) { var NumCores uint32 ret := nvmlDeviceGetNumGpuCores(Device, &NumCores) return int(NumCores), ret } -func (Device Device) GetNumGpuCores() (int, Return) { - return DeviceGetNumGpuCores(Device) -} - // nvml.DeviceGetPowerSource() func (l *library) DeviceGetPowerSource(Device Device) (PowerSource, Return) { + return Device.GetPowerSource() +} + +func (Device nvmlDevice) GetPowerSource() (PowerSource, Return) { var PowerSource PowerSource ret := nvmlDeviceGetPowerSource(Device, &PowerSource) return PowerSource, ret } -func (Device Device) GetPowerSource() (PowerSource, Return) { - return DeviceGetPowerSource(Device) -} - // nvml.DeviceGetMemoryBusWidth() func (l *library) DeviceGetMemoryBusWidth(Device Device) (uint32, Return) { + return Device.GetMemoryBusWidth() +} + +func (Device nvmlDevice) GetMemoryBusWidth() (uint32, Return) { var BusWidth uint32 ret := nvmlDeviceGetMemoryBusWidth(Device, &BusWidth) return BusWidth, ret } -func (Device Device) GetMemoryBusWidth() (uint32, Return) { - return DeviceGetMemoryBusWidth(Device) -} - // nvml.DeviceGetPcieLinkMaxSpeed() func (l *library) DeviceGetPcieLinkMaxSpeed(Device Device) (uint32, Return) { + return Device.GetPcieLinkMaxSpeed() +} + +func (Device nvmlDevice) GetPcieLinkMaxSpeed() (uint32, Return) { var MaxSpeed uint32 ret := nvmlDeviceGetPcieLinkMaxSpeed(Device, &MaxSpeed) return MaxSpeed, ret } -func (Device Device) GetPcieLinkMaxSpeed() (uint32, Return) { - return DeviceGetPcieLinkMaxSpeed(Device) -} - // nvml.DeviceGetAdaptiveClockInfoStatus() func (l *library) DeviceGetAdaptiveClockInfoStatus(Device Device) (uint32, Return) { + return Device.GetAdaptiveClockInfoStatus() +} + +func (Device nvmlDevice) GetAdaptiveClockInfoStatus() (uint32, Return) { var AdaptiveClockStatus uint32 ret := nvmlDeviceGetAdaptiveClockInfoStatus(Device, &AdaptiveClockStatus) return AdaptiveClockStatus, ret } -func (Device Device) GetAdaptiveClockInfoStatus() (uint32, Return) { - return DeviceGetAdaptiveClockInfoStatus(Device) -} - // nvml.DeviceGetAccountingMode() func (l *library) DeviceGetAccountingMode(Device Device) (EnableState, Return) { + return Device.GetAccountingMode() +} + +func (Device nvmlDevice) GetAccountingMode() (EnableState, Return) { var Mode EnableState ret := nvmlDeviceGetAccountingMode(Device, &Mode) return Mode, ret } -func (Device Device) GetAccountingMode() (EnableState, Return) { - return DeviceGetAccountingMode(Device) -} - // nvml.DeviceGetAccountingStats() func (l *library) DeviceGetAccountingStats(Device Device, Pid uint32) (AccountingStats, Return) { + return Device.GetAccountingStats(Pid) +} + +func (Device nvmlDevice) GetAccountingStats(Pid uint32) (AccountingStats, Return) { var Stats AccountingStats ret := nvmlDeviceGetAccountingStats(Device, Pid, &Stats) return Stats, ret } -func (Device Device) GetAccountingStats(Pid uint32) (AccountingStats, Return) { - return DeviceGetAccountingStats(Device, Pid) -} - // nvml.DeviceGetAccountingPids() 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) @@ -1284,23 +1288,23 @@ func (l *library) DeviceGetAccountingPids(Device Device) ([]int, Return) { } } -func (Device Device) GetAccountingPids() ([]int, Return) { - return DeviceGetAccountingPids(Device) -} - // nvml.DeviceGetAccountingBufferSize() func (l *library) DeviceGetAccountingBufferSize(Device Device) (int, Return) { + return Device.GetAccountingBufferSize() +} + +func (Device nvmlDevice) GetAccountingBufferSize() (int, Return) { var BufferSize uint32 ret := nvmlDeviceGetAccountingBufferSize(Device, &BufferSize) return int(BufferSize), ret } -func (Device Device) GetAccountingBufferSize() (int, Return) { - return DeviceGetAccountingBufferSize(Device) -} - // nvml.DeviceGetRetiredPages() 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) @@ -1315,12 +1319,12 @@ func (l *library) DeviceGetRetiredPages(Device Device, Cause PageRetirementCause } } -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) +} + +func (Device nvmlDevice) GetRetiredPages_v2(Cause PageRetirementCause) ([]uint64, []uint64, Return) { var PageCount uint32 = 1 // Will be reduced upon returning for { Addresses := make([]uint64, PageCount) @@ -1336,233 +1340,233 @@ func (l *library) DeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCa } } -func (Device Device) GetRetiredPages_v2(Cause PageRetirementCause) ([]uint64, []uint64, Return) { - return DeviceGetRetiredPages_v2(Device, Cause) -} - // nvml.DeviceGetRetiredPagesPendingStatus() func (l *library) DeviceGetRetiredPagesPendingStatus(Device Device) (EnableState, Return) { + return Device.GetRetiredPagesPendingStatus() +} + +func (Device nvmlDevice) GetRetiredPagesPendingStatus() (EnableState, Return) { var IsPending EnableState ret := nvmlDeviceGetRetiredPagesPendingStatus(Device, &IsPending) return IsPending, ret } -func (Device Device) GetRetiredPagesPendingStatus() (EnableState, Return) { - return DeviceGetRetiredPagesPendingStatus(Device) -} - // nvml.DeviceSetPersistenceMode() func (l *library) DeviceSetPersistenceMode(Device Device, Mode EnableState) Return { - return nvmlDeviceSetPersistenceMode(Device, Mode) + 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 (l *library) DeviceSetComputeMode(Device Device, Mode ComputeMode) Return { - return nvmlDeviceSetComputeMode(Device, Mode) + 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 (l *library) DeviceSetEccMode(Device Device, Ecc EnableState) Return { - return nvmlDeviceSetEccMode(Device, Ecc) + 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 (l *library) DeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return { - return nvmlDeviceClearEccErrorCounts(Device, CounterType) + 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 (l *library) DeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return { - return nvmlDeviceSetDriverModel(Device, DriverModel, Flags) + 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 (l *library) DeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - return nvmlDeviceSetGpuLockedClocks(Device, MinGpuClockMHz, MaxGpuClockMHz) + 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 (l *library) DeviceResetGpuLockedClocks(Device Device) Return { - return nvmlDeviceResetGpuLockedClocks(Device) + return Device.ResetGpuLockedClocks() } -func (Device Device) ResetGpuLockedClocks() Return { - return DeviceResetGpuLockedClocks(Device) +func (Device nvmlDevice) ResetGpuLockedClocks() Return { + return nvmlDeviceResetGpuLockedClocks(Device) } // nvmlDeviceSetMemoryLockedClocks() func (l *library) DeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - return nvmlDeviceSetMemoryLockedClocks(Device, MinMemClockMHz, MaxMemClockMHz) + return Device.SetMemoryLockedClocks(MinMemClockMHz, MaxMemClockMHz) } -func (Device Device) SetMemoryLockedClocks(NinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - return DeviceSetMemoryLockedClocks(Device, NinMemClockMHz, MaxMemClockMHz) +func (Device nvmlDevice) SetMemoryLockedClocks(NinMemClockMHz uint32, MaxMemClockMHz uint32) Return { + return nvmlDeviceSetMemoryLockedClocks(Device, NinMemClockMHz, MaxMemClockMHz) } // nvmlDeviceResetMemoryLockedClocks() func (l *library) DeviceResetMemoryLockedClocks(Device Device) Return { - return nvmlDeviceResetMemoryLockedClocks(Device) + return Device.ResetMemoryLockedClocks() } -func (Device Device) ResetMemoryLockedClocks() Return { - return DeviceResetMemoryLockedClocks(Device) +func (Device nvmlDevice) ResetMemoryLockedClocks() Return { + return nvmlDeviceResetMemoryLockedClocks(Device) } // nvml.DeviceGetClkMonStatus() func (l *library) DeviceGetClkMonStatus(Device Device) (ClkMonStatus, Return) { + return Device.GetClkMonStatus() +} + +func (Device nvmlDevice) GetClkMonStatus() (ClkMonStatus, Return) { var Status ClkMonStatus ret := nvmlDeviceGetClkMonStatus(Device, &Status) return Status, ret } -func (Device Device) GetClkMonStatus() (ClkMonStatus, Return) { - return DeviceGetClkMonStatus(Device) -} - // nvml.DeviceSetApplicationsClocks() func (l *library) DeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return { - return nvmlDeviceSetApplicationsClocks(Device, MemClockMHz, GraphicsClockMHz) + 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 (l *library) DeviceSetPowerManagementLimit(Device Device, Limit uint32) Return { - return nvmlDeviceSetPowerManagementLimit(Device, Limit) + 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 (l *library) DeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return { - return nvmlDeviceSetGpuOperationMode(Device, Mode) + 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 (l *library) DeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return { - return nvmlDeviceSetAPIRestriction(Device, ApiType, IsRestricted) + 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 (l *library) DeviceSetAccountingMode(Device Device, Mode EnableState) Return { - return nvmlDeviceSetAccountingMode(Device, Mode) + 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 (l *library) DeviceClearAccountingPids(Device Device) Return { - return nvmlDeviceClearAccountingPids(Device) + return Device.ClearAccountingPids() } -func (Device Device) ClearAccountingPids() Return { - return DeviceClearAccountingPids(Device) +func (Device nvmlDevice) ClearAccountingPids() Return { + return nvmlDeviceClearAccountingPids(Device) } // nvml.DeviceGetNvLinkState() func (l *library) DeviceGetNvLinkState(Device Device, Link int) (EnableState, Return) { + return Device.GetNvLinkState(Link) +} + +func (Device nvmlDevice) GetNvLinkState(Link int) (EnableState, Return) { var IsActive EnableState ret := nvmlDeviceGetNvLinkState(Device, uint32(Link), &IsActive) return IsActive, ret } -func (Device Device) GetNvLinkState(Link int) (EnableState, Return) { - return DeviceGetNvLinkState(Device, Link) -} - // nvml.DeviceGetNvLinkVersion() func (l *library) DeviceGetNvLinkVersion(Device Device, Link int) (uint32, Return) { + return Device.GetNvLinkVersion(Link) +} + +func (Device nvmlDevice) GetNvLinkVersion(Link int) (uint32, Return) { var Version uint32 ret := nvmlDeviceGetNvLinkVersion(Device, uint32(Link), &Version) return Version, ret } -func (Device Device) GetNvLinkVersion(Link int) (uint32, Return) { - return DeviceGetNvLinkVersion(Device, Link) -} - // nvml.DeviceGetNvLinkCapability() func (l *library) DeviceGetNvLinkCapability(Device Device, Link int, Capability NvLinkCapability) (uint32, Return) { + return Device.GetNvLinkCapability(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 } -func (Device Device) GetNvLinkCapability(Link int, Capability NvLinkCapability) (uint32, Return) { - return DeviceGetNvLinkCapability(Device, Link, Capability) -} - // nvml.DeviceGetNvLinkRemotePciInfo() func (l *library) DeviceGetNvLinkRemotePciInfo(Device Device, Link int) (PciInfo, Return) { + return Device.GetNvLinkRemotePciInfo(Link) +} + +func (Device nvmlDevice) GetNvLinkRemotePciInfo(Link int) (PciInfo, Return) { var Pci PciInfo ret := nvmlDeviceGetNvLinkRemotePciInfo(Device, uint32(Link), &Pci) return Pci, ret } -func (Device Device) GetNvLinkRemotePciInfo(Link int) (PciInfo, Return) { - return DeviceGetNvLinkRemotePciInfo(Device, Link) -} - // nvml.DeviceGetNvLinkErrorCounter() func (l *library) DeviceGetNvLinkErrorCounter(Device Device, Link int, Counter NvLinkErrorCounter) (uint64, Return) { + return Device.GetNvLinkErrorCounter(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 } -func (Device Device) GetNvLinkErrorCounter(Link int, Counter NvLinkErrorCounter) (uint64, Return) { - return DeviceGetNvLinkErrorCounter(Device, Link, Counter) -} - // nvml.DeviceResetNvLinkErrorCounters() func (l *library) DeviceResetNvLinkErrorCounters(Device Device, Link int) Return { - return nvmlDeviceResetNvLinkErrorCounters(Device, uint32(Link)) + 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 (l *library) DeviceSetNvLinkUtilizationControl(Device Device, Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { + return Device.SetNvLinkUtilizationControl(Link, Counter, Control, Reset) +} + +func (Device nvmlDevice) SetNvLinkUtilizationControl(Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { reset := uint32(0) if Reset { reset = 1 @@ -1570,81 +1574,77 @@ func (l *library) DeviceSetNvLinkUtilizationControl(Device Device, Link int, Cou return nvmlDeviceSetNvLinkUtilizationControl(Device, uint32(Link), uint32(Counter), Control, reset) } -func (Device Device) SetNvLinkUtilizationControl(Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { - return DeviceSetNvLinkUtilizationControl(Device, Link, Counter, Control, Reset) -} - // nvml.DeviceGetNvLinkUtilizationControl() func (l *library) DeviceGetNvLinkUtilizationControl(Device Device, Link int, Counter int) (NvLinkUtilizationControl, Return) { + return Device.GetNvLinkUtilizationControl(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 } -func (Device Device) GetNvLinkUtilizationControl(Link int, Counter int) (NvLinkUtilizationControl, Return) { - return DeviceGetNvLinkUtilizationControl(Device, Link, Counter) -} - // nvml.DeviceGetNvLinkUtilizationCounter() func (l *library) DeviceGetNvLinkUtilizationCounter(Device Device, Link int, Counter int) (uint64, uint64, Return) { + return Device.GetNvLinkUtilizationCounter(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 } -func (Device Device) GetNvLinkUtilizationCounter(Link int, Counter int) (uint64, uint64, Return) { - return DeviceGetNvLinkUtilizationCounter(Device, Link, Counter) -} - // nvml.DeviceFreezeNvLinkUtilizationCounter() func (l *library) DeviceFreezeNvLinkUtilizationCounter(Device Device, Link int, Counter int, Freeze EnableState) Return { - return nvmlDeviceFreezeNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter), Freeze) + 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 (l *library) DeviceResetNvLinkUtilizationCounter(Device Device, Link int, Counter int) Return { - return nvmlDeviceResetNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter)) + 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 (l *library) DeviceGetNvLinkRemoteDeviceType(Device Device, Link int) (IntNvLinkDeviceType, Return) { + return Device.GetNvLinkRemoteDeviceType(Link) +} + +func (Device nvmlDevice) GetNvLinkRemoteDeviceType(Link int) (IntNvLinkDeviceType, Return) { var NvLinkDeviceType IntNvLinkDeviceType ret := nvmlDeviceGetNvLinkRemoteDeviceType(Device, uint32(Link), &NvLinkDeviceType) return NvLinkDeviceType, ret } -func (Device Device) GetNvLinkRemoteDeviceType(Link int) (IntNvLinkDeviceType, Return) { - return DeviceGetNvLinkRemoteDeviceType(Device, Link) -} - // nvml.DeviceRegisterEvents() func (l *library) DeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return { - return nvmlDeviceRegisterEvents(Device, EventTypes, Set) + 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) } // nvmlDeviceGetSupportedEventTypes() func (l *library) DeviceGetSupportedEventTypes(Device Device) (uint64, Return) { + return Device.GetSupportedEventTypes() +} + +func (Device nvmlDevice) GetSupportedEventTypes() (uint64, Return) { var EventTypes uint64 ret := nvmlDeviceGetSupportedEventTypes(Device, &EventTypes) return EventTypes, ret } -func (Device Device) GetSupportedEventTypes() (uint64, Return) { - return DeviceGetSupportedEventTypes(Device) -} - // nvml.DeviceModifyDrainState() func (l *library) DeviceModifyDrainState(PciInfo *PciInfo, NewState EnableState) Return { return nvmlDeviceModifyDrainState(PciInfo, NewState) @@ -1676,58 +1676,62 @@ func (l *library) DeviceDiscoverGpus() (PciInfo, Return) { // nvml.DeviceGetFieldValues() func (l *library) DeviceGetFieldValues(Device Device, Values []FieldValue) Return { - ValuesCount := len(Values) - return nvmlDeviceGetFieldValues(Device, int32(ValuesCount), &Values[0]) + 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 (l *library) DeviceGetVirtualizationMode(Device Device) (GpuVirtualizationMode, Return) { + return Device.GetVirtualizationMode() +} + +func (Device nvmlDevice) GetVirtualizationMode() (GpuVirtualizationMode, Return) { var PVirtualMode GpuVirtualizationMode ret := nvmlDeviceGetVirtualizationMode(Device, &PVirtualMode) return PVirtualMode, ret } -func (Device Device) GetVirtualizationMode() (GpuVirtualizationMode, Return) { - return DeviceGetVirtualizationMode(Device) -} - // nvml.DeviceGetHostVgpuMode() func (l *library) DeviceGetHostVgpuMode(Device Device) (HostVgpuMode, Return) { + return Device.GetHostVgpuMode() +} + +func (Device nvmlDevice) GetHostVgpuMode() (HostVgpuMode, Return) { var PHostVgpuMode HostVgpuMode ret := nvmlDeviceGetHostVgpuMode(Device, &PHostVgpuMode) return PHostVgpuMode, ret } -func (Device Device) GetHostVgpuMode() (HostVgpuMode, Return) { - return DeviceGetHostVgpuMode(Device) -} - // nvml.DeviceSetVirtualizationMode() func (l *library) DeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return { - return nvmlDeviceSetVirtualizationMode(Device, VirtualMode) + 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 (l *library) DeviceGetGridLicensableFeatures(Device Device) (GridLicensableFeatures, Return) { + return Device.GetGridLicensableFeatures() +} + +func (Device nvmlDevice) GetGridLicensableFeatures() (GridLicensableFeatures, Return) { var PGridLicensableFeatures GridLicensableFeatures ret := nvmlDeviceGetGridLicensableFeatures(Device, &PGridLicensableFeatures) return PGridLicensableFeatures, ret } -func (Device Device) GetGridLicensableFeatures() (GridLicensableFeatures, Return) { - return DeviceGetGridLicensableFeatures(Device) -} - // nvml.DeviceGetProcessUtilization() 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 { @@ -1741,12 +1745,12 @@ func (l *library) DeviceGetProcessUtilization(Device Device, LastSeenTimeStamp u 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() +} + +func (Device nvmlDevice) GetSupportedVgpus() ([]VgpuTypeId, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { VgpuTypeIds := make([]VgpuTypeId, VgpuCount) @@ -1761,12 +1765,12 @@ func (l *library) DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) } } -func (Device Device) GetSupportedVgpus() ([]VgpuTypeId, Return) { - return DeviceGetSupportedVgpus(Device) -} - // nvml.DeviceGetCreatableVgpus() func (l *library) DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) { + return Device.GetCreatableVgpus() +} + +func (Device nvmlDevice) GetCreatableVgpus() ([]VgpuTypeId, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { VgpuTypeIds := make([]VgpuTypeId, VgpuCount) @@ -1781,12 +1785,12 @@ func (l *library) DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) } } -func (Device Device) GetCreatableVgpus() ([]VgpuTypeId, Return) { - return DeviceGetCreatableVgpus(Device) -} - // nvml.DeviceGetActiveVgpus() func (l *library) DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) { + return Device.GetActiveVgpus() +} + +func (Device nvmlDevice) GetActiveVgpus() ([]VgpuInstance, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { VgpuInstances := make([]VgpuInstance, VgpuCount) @@ -1801,12 +1805,12 @@ func (l *library) DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) { } } -func (Device Device) GetActiveVgpus() ([]VgpuInstance, Return) { - return DeviceGetActiveVgpus(Device) -} - // nvml.DeviceGetVgpuMetadata() func (l *library) DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return) { + return Device.GetVgpuMetadata() +} + +func (Device nvmlDevice) GetVgpuMetadata() (VgpuPgpuMetadata, Return) { var VgpuPgpuMetadata VgpuPgpuMetadata OpaqueDataSize := unsafe.Sizeof(VgpuPgpuMetadata.nvmlVgpuPgpuMetadata.OpaqueData) VgpuPgpuMetadataSize := unsafe.Sizeof(VgpuPgpuMetadata.nvmlVgpuPgpuMetadata) - OpaqueDataSize @@ -1827,12 +1831,12 @@ func (l *library) DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return } } -func (Device Device) GetVgpuMetadata() (VgpuPgpuMetadata, Return) { - return DeviceGetVgpuMetadata(Device) -} - // nvml.DeviceGetPgpuMetadataString() func (l *library) DeviceGetPgpuMetadataString(Device Device) (string, Return) { + return Device.GetPgpuMetadataString() +} + +func (Device nvmlDevice) GetPgpuMetadataString() (string, Return) { var BufferSize uint32 = 1 // Will be reduced upon returning for { PgpuMetadata := make([]byte, BufferSize) @@ -1847,12 +1851,12 @@ func (l *library) DeviceGetPgpuMetadataString(Device Device) (string, Return) { } } -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) +} + +func (Device nvmlDevice) GetVgpuUtilization(LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { var SampleValType ValueType var VgpuInstanceSamplesCount uint32 = 1 // Will be reduced upon returning for { @@ -1868,56 +1872,56 @@ func (l *library) DeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint } } -func (Device Device) GetVgpuUtilization(LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { - return DeviceGetVgpuUtilization(Device, LastSeenTimeStamp) -} - // nvml.DeviceGetAttributes() func (l *library) DeviceGetAttributes(Device Device) (DeviceAttributes, Return) { + return Device.GetAttributes() +} + +func (Device nvmlDevice) GetAttributes() (DeviceAttributes, Return) { var Attributes DeviceAttributes ret := nvmlDeviceGetAttributes(Device, &Attributes) return Attributes, ret } -func (Device Device) GetAttributes() (DeviceAttributes, Return) { - return DeviceGetAttributes(Device) -} - // nvml.DeviceGetRemappedRows() func (l *library) DeviceGetRemappedRows(Device Device) (int, int, bool, bool, Return) { + return Device.GetRemappedRows() +} + +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 } -func (Device Device) GetRemappedRows() (int, int, bool, bool, Return) { - return DeviceGetRemappedRows(Device) -} - // nvml.DeviceGetRowRemapperHistogram() func (l *library) DeviceGetRowRemapperHistogram(Device Device) (RowRemapperHistogramValues, Return) { + return Device.GetRowRemapperHistogram() +} + +func (Device nvmlDevice) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) { var Values RowRemapperHistogramValues ret := nvmlDeviceGetRowRemapperHistogram(Device, &Values) return Values, ret } -func (Device Device) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) { - return DeviceGetRowRemapperHistogram(Device) -} - // nvml.DeviceGetArchitecture() func (l *library) DeviceGetArchitecture(Device Device) (DeviceArchitecture, Return) { + return Device.GetArchitecture() +} + +func (Device nvmlDevice) GetArchitecture() (DeviceArchitecture, Return) { var Arch DeviceArchitecture ret := nvmlDeviceGetArchitecture(Device, &Arch) return Arch, ret } -func (Device Device) GetArchitecture() (DeviceArchitecture, Return) { - return DeviceGetArchitecture(Device) -} - // nvml.DeviceGetVgpuProcessUtilization() 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) @@ -1932,10 +1936,6 @@ func (l *library) DeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeSta } } -func (Device Device) GetVgpuProcessUtilization(LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) { - return DeviceGetVgpuProcessUtilization(Device, LastSeenTimeStamp) -} - // nvml.GetExcludedDeviceCount() func (l *library) GetExcludedDeviceCount() (int, Return) { var DeviceCount uint32 @@ -1952,40 +1952,40 @@ func (l *library) GetExcludedDeviceInfoByIndex(Index int) (ExcludedDeviceInfo, R // nvml.DeviceSetMigMode() func (l *library) DeviceSetMigMode(Device Device, Mode int) (Return, Return) { + return Device.SetMigMode(Mode) +} + +func (Device nvmlDevice) SetMigMode(Mode int) (Return, Return) { var ActivationStatus Return ret := nvmlDeviceSetMigMode(Device, uint32(Mode), &ActivationStatus) return ActivationStatus, ret } -func (Device Device) SetMigMode(Mode int) (Return, Return) { - return DeviceSetMigMode(Device, Mode) -} - // nvml.DeviceGetMigMode() func (l *library) DeviceGetMigMode(Device Device) (int, int, Return) { + return Device.GetMigMode() +} + +func (Device nvmlDevice) GetMigMode() (int, int, Return) { var CurrentMode, PendingMode uint32 ret := nvmlDeviceGetMigMode(Device, &CurrentMode, &PendingMode) return int(CurrentMode), int(PendingMode), ret } -func (Device Device) GetMigMode() (int, int, Return) { - return DeviceGetMigMode(Device) -} - // nvml.DeviceGetGpuInstanceProfileInfo() func (l *library) DeviceGetGpuInstanceProfileInfo(Device Device, Profile int) (GpuInstanceProfileInfo, Return) { + return Device.GetGpuInstanceProfileInfo(Profile) +} + +func (Device nvmlDevice) GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) { var Info GpuInstanceProfileInfo ret := nvmlDeviceGetGpuInstanceProfileInfo(Device, uint32(Profile), &Info) return Info, ret } -func (Device Device) GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) { - return DeviceGetGpuInstanceProfileInfo(Device, Profile) -} - // nvml.DeviceGetGpuInstanceProfileInfoV() type GpuInstanceProfileInfoV struct { - device Device + device nvmlDevice profile int } @@ -2001,15 +2001,19 @@ func (InfoV GpuInstanceProfileInfoV) V2() (GpuInstanceProfileInfo_v2, Return) { } func (l *library) DeviceGetGpuInstanceProfileInfoV(Device Device, Profile int) GpuInstanceProfileInfoV { - return GpuInstanceProfileInfoV{Device, Profile} + 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 (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 } @@ -2026,12 +2030,12 @@ func (l *library) DeviceGetGpuInstancePossiblePlacements(Device Device, Info *Gp 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) +} + +func (Device nvmlDevice) GetGpuInstanceRemainingCapacity(Info *GpuInstanceProfileInfo) (int, Return) { if Info == nil { return 0, ERROR_INVALID_ARGUMENT } @@ -2040,12 +2044,12 @@ func (l *library) DeviceGetGpuInstanceRemainingCapacity(Device Device, Info *Gpu return int(Count), ret } -func (Device Device) GetGpuInstanceRemainingCapacity(Info *GpuInstanceProfileInfo) (int, Return) { - return DeviceGetGpuInstanceRemainingCapacity(Device, Info) -} - // nvml.DeviceCreateGpuInstance() func (l *library) DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfileInfo) (GpuInstance, Return) { + return Device.CreateGpuInstance(Info) +} + +func (Device nvmlDevice) CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) { if Info == nil { return GpuInstance{}, ERROR_INVALID_ARGUMENT } @@ -2054,12 +2058,12 @@ func (l *library) DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfil return GpuInstance, ret } -func (Device Device) CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) { - return DeviceCreateGpuInstance(Device, Info) -} - // nvml.DeviceCreateGpuInstanceWithPlacement() func (l *library) DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { + return Device.CreateGpuInstanceWithPlacement(Info, Placement) +} + +func (Device nvmlDevice) CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { if Info == nil { return GpuInstance{}, ERROR_INVALID_ARGUMENT } @@ -2068,10 +2072,6 @@ func (l *library) DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuI return GpuInstance, ret } -func (Device Device) CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { - return DeviceCreateGpuInstanceWithPlacement(Device, Info, Placement) -} - // nvml.GpuInstanceDestroy() func (l *library) GpuInstanceDestroy(GpuInstance GpuInstance) Return { return nvmlGpuInstanceDestroy(GpuInstance) @@ -2083,6 +2083,10 @@ func (GpuInstance GpuInstance) Destroy() Return { // nvml.DeviceGetGpuInstances() func (l *library) DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { + return Device.GetGpuInstances(Info) +} + +func (Device nvmlDevice) GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { if Info == nil { return nil, ERROR_INVALID_ARGUMENT } @@ -2092,21 +2096,17 @@ func (l *library) DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileI return GpuInstances[:Count], ret } -func (Device Device) GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - return DeviceGetGpuInstances(Device, Info) -} - // nvml.DeviceGetGpuInstanceById() func (l *library) DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, Return) { + return Device.GetGpuInstanceById(Id) +} + +func (Device nvmlDevice) GetGpuInstanceById(Id int) (GpuInstance, Return) { var GpuInstance GpuInstance ret := nvmlDeviceGetGpuInstanceById(Device, uint32(Id), &GpuInstance) return GpuInstance, ret } -func (Device Device) GetGpuInstanceById(Id int) (GpuInstance, Return) { - return DeviceGetGpuInstanceById(Device, Id) -} - // nvml.GpuInstanceGetInfo() func (l *library) GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) { var Info GpuInstanceInfo @@ -2231,209 +2231,213 @@ func (ComputeInstance ComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { // nvml.DeviceIsMigDeviceHandle() func (l *library) DeviceIsMigDeviceHandle(Device Device) (bool, Return) { + return Device.IsMigDeviceHandle() +} + +func (Device nvmlDevice) IsMigDeviceHandle() (bool, Return) { var IsMigDevice uint32 ret := nvmlDeviceIsMigDeviceHandle(Device, &IsMigDevice) return (IsMigDevice != 0), ret } -func (Device Device) IsMigDeviceHandle() (bool, Return) { - return DeviceIsMigDeviceHandle(Device) -} - // nvml DeviceGetGpuInstanceId() func (l *library) DeviceGetGpuInstanceId(Device Device) (int, Return) { + return Device.GetGpuInstanceId() +} + +func (Device nvmlDevice) GetGpuInstanceId() (int, Return) { var Id uint32 ret := nvmlDeviceGetGpuInstanceId(Device, &Id) return int(Id), ret } -func (Device Device) GetGpuInstanceId() (int, Return) { - return DeviceGetGpuInstanceId(Device) -} - // nvml.DeviceGetComputeInstanceId() func (l *library) DeviceGetComputeInstanceId(Device Device) (int, Return) { + return Device.GetComputeInstanceId() +} + +func (Device nvmlDevice) GetComputeInstanceId() (int, Return) { var Id uint32 ret := nvmlDeviceGetComputeInstanceId(Device, &Id) return int(Id), ret } -func (Device Device) GetComputeInstanceId() (int, Return) { - return DeviceGetComputeInstanceId(Device) -} - // nvml.DeviceGetMaxMigDeviceCount() func (l *library) DeviceGetMaxMigDeviceCount(Device Device) (int, Return) { + return Device.GetMaxMigDeviceCount() +} + +func (Device nvmlDevice) GetMaxMigDeviceCount() (int, Return) { var Count uint32 ret := nvmlDeviceGetMaxMigDeviceCount(Device, &Count) return int(Count), ret } -func (Device Device) GetMaxMigDeviceCount() (int, Return) { - return DeviceGetMaxMigDeviceCount(Device) -} - // nvml.DeviceGetMigDeviceHandleByIndex() func (l *library) DeviceGetMigDeviceHandleByIndex(device Device, Index int) (Device, Return) { - var MigDevice Device - ret := nvmlDeviceGetMigDeviceHandleByIndex(device, uint32(Index), &MigDevice) - return MigDevice, ret + 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 (l *library) DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device) (Device, Return) { - var Device Device - ret := nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice, &Device) - return Device, ret + 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 (l *library) DeviceGetBusType(Device Device) (BusType, Return) { + return Device.GetBusType() +} + +func (Device nvmlDevice) GetBusType() (BusType, Return) { var Type BusType ret := nvmlDeviceGetBusType(Device, &Type) return Type, ret } -func (Device Device) GetBusType() (BusType, Return) { - return DeviceGetBusType(Device) -} - // nvml.DeviceSetDefaultFanSpeed_v2() func (l *library) DeviceSetDefaultFanSpeed_v2(Device Device, Fan int) Return { - return nvmlDeviceSetDefaultFanSpeed_v2(Device, uint32(Fan)) + 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 (l *library) DeviceGetMinMaxFanSpeed(Device Device) (int, int, Return) { + return Device.GetMinMaxFanSpeed() +} + +func (Device nvmlDevice) GetMinMaxFanSpeed() (int, int, Return) { var MinSpeed, MaxSpeed uint32 ret := nvmlDeviceGetMinMaxFanSpeed(Device, &MinSpeed, &MaxSpeed) return int(MinSpeed), int(MaxSpeed), ret } -func (Device Device) GetMinMaxFanSpeed() (int, int, Return) { - return DeviceGetMinMaxFanSpeed(Device) -} - // nvml.DeviceGetThermalSettings() func (l *library) DeviceGetThermalSettings(Device Device, SensorIndex uint32) (GpuThermalSettings, Return) { + return Device.GetThermalSettings(SensorIndex) +} + +func (Device nvmlDevice) GetThermalSettings(SensorIndex uint32) (GpuThermalSettings, Return) { var PThermalSettings GpuThermalSettings ret := nvmlDeviceGetThermalSettings(Device, SensorIndex, &PThermalSettings) return PThermalSettings, ret } -func (Device Device) GetThermalSettings(SensorIndex uint32) (GpuThermalSettings, Return) { - return DeviceGetThermalSettings(Device, SensorIndex) -} - // nvml.DeviceGetDefaultEccMode() func (l *library) DeviceGetDefaultEccMode(Device Device) (EnableState, Return) { + return Device.GetDefaultEccMode() +} + +func (Device nvmlDevice) GetDefaultEccMode() (EnableState, Return) { var DefaultMode EnableState ret := nvmlDeviceGetDefaultEccMode(Device, &DefaultMode) return DefaultMode, ret } -func (Device Device) GetDefaultEccMode() (EnableState, Return) { - return DeviceGetDefaultEccMode(Device) -} - // nvml.DeviceGetPcieSpeed() func (l *library) DeviceGetPcieSpeed(Device Device) (int, Return) { + return Device.GetPcieSpeed() +} + +func (Device nvmlDevice) GetPcieSpeed() (int, Return) { var PcieSpeed uint32 ret := nvmlDeviceGetPcieSpeed(Device, &PcieSpeed) return int(PcieSpeed), ret } -func (Device Device) GetPcieSpeed() (int, Return) { - return DeviceGetPcieSpeed(Device) -} - // nvml.DeviceGetGspFirmwareVersion() func (l *library) DeviceGetGspFirmwareVersion(Device Device) (string, Return) { + return Device.GetGspFirmwareVersion() +} + +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 } -func (Device Device) GetGspFirmwareVersion() (string, Return) { - return DeviceGetGspFirmwareVersion(Device) -} - // nvml.DeviceGetGspFirmwareMode() func (l *library) DeviceGetGspFirmwareMode(Device Device) (bool, bool, Return) { + return Device.GetGspFirmwareMode() +} + +func (Device nvmlDevice) GetGspFirmwareMode() (bool, bool, Return) { var IsEnabled, DefaultMode uint32 ret := nvmlDeviceGetGspFirmwareMode(Device, &IsEnabled, &DefaultMode) return (IsEnabled != 0), (DefaultMode != 0), ret } -func (Device Device) GetGspFirmwareMode() (bool, bool, Return) { - return DeviceGetGspFirmwareMode(Device) -} - // nvml.DeviceGetDynamicPstatesInfo() func (l *library) DeviceGetDynamicPstatesInfo(Device Device) (GpuDynamicPstatesInfo, Return) { + return Device.GetDynamicPstatesInfo() +} + +func (Device nvmlDevice) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { var PDynamicPstatesInfo GpuDynamicPstatesInfo ret := nvmlDeviceGetDynamicPstatesInfo(Device, &PDynamicPstatesInfo) return PDynamicPstatesInfo, ret } -func (Device Device) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { - return DeviceGetDynamicPstatesInfo(Device) -} - // nvml.DeviceSetFanSpeed_v2() func (l *library) DeviceSetFanSpeed_v2(Device Device, Fan int, Speed int) Return { - return nvmlDeviceSetFanSpeed_v2(Device, uint32(Fan), uint32(Speed)) + 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 (l *library) DeviceGetGpcClkVfOffset(Device Device) (int, Return) { + return Device.GetGpcClkVfOffset() +} + +func (Device nvmlDevice) GetGpcClkVfOffset() (int, Return) { var Offset int32 ret := nvmlDeviceGetGpcClkVfOffset(Device, &Offset) return int(Offset), ret } -func (Device Device) GetGpcClkVfOffset() (int, Return) { - return DeviceGetGpcClkVfOffset(Device) -} - // nvml.DeviceSetGpcClkVfOffset() func (l *library) DeviceSetGpcClkVfOffset(Device Device, Offset int) Return { - return nvmlDeviceSetGpcClkVfOffset(Device, int32(Offset)) + 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 (l *library) DeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates) (uint32, uint32, Return) { + return Device.GetMinMaxClockOfPState(_type, Pstate) +} + +func (Device nvmlDevice) GetMinMaxClockOfPState(_type ClockType, Pstate Pstates) (uint32, uint32, Return) { var MinClockMHz, MaxClockMHz uint32 ret := nvmlDeviceGetMinMaxClockOfPState(Device, _type, Pstate, &MinClockMHz, &MaxClockMHz) return MinClockMHz, MaxClockMHz, ret } -func (Device Device) GetMinMaxClockOfPState(_type ClockType, Pstate Pstates) (uint32, uint32, Return) { - return DeviceGetMinMaxClockOfPState(Device, _type, Pstate) -} - // nvml.DeviceGetSupportedPerformanceStates() 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++ { @@ -2444,157 +2448,153 @@ func (l *library) DeviceGetSupportedPerformanceStates(Device Device) ([]Pstates, return Pstates, ret } -func (Device Device) GetSupportedPerformanceStates() ([]Pstates, Return) { - return DeviceGetSupportedPerformanceStates(Device) -} - // nvml.DeviceGetTargetFanSpeed() func (l *library) DeviceGetTargetFanSpeed(Device Device, Fan int) (int, Return) { + return Device.GetTargetFanSpeed(Fan) +} + +func (Device nvmlDevice) GetTargetFanSpeed(Fan int) (int, Return) { var TargetSpeed uint32 ret := nvmlDeviceGetTargetFanSpeed(Device, uint32(Fan), &TargetSpeed) return int(TargetSpeed), ret } -func (Device Device) GetTargetFanSpeed(Fan int) (int, Return) { - return DeviceGetTargetFanSpeed(Device, Fan) -} - // nvml.DeviceGetMemClkVfOffset() func (l *library) DeviceGetMemClkVfOffset(Device Device) (int, Return) { + return Device.GetMemClkVfOffset() +} + +func (Device nvmlDevice) GetMemClkVfOffset() (int, Return) { var Offset int32 ret := nvmlDeviceGetMemClkVfOffset(Device, &Offset) return int(Offset), ret } -func (Device Device) GetMemClkVfOffset() (int, Return) { - return DeviceGetMemClkVfOffset(Device) -} - // nvml.DeviceSetMemClkVfOffset() func (l *library) DeviceSetMemClkVfOffset(Device Device, Offset int) Return { - return nvmlDeviceSetMemClkVfOffset(Device, int32(Offset)) + 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 (l *library) DeviceGetGpcClkMinMaxVfOffset(Device Device) (int, int, Return) { + return Device.GetGpcClkMinMaxVfOffset() +} + +func (Device nvmlDevice) GetGpcClkMinMaxVfOffset() (int, int, Return) { var MinOffset, MaxOffset int32 ret := nvmlDeviceGetGpcClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) return int(MinOffset), int(MaxOffset), ret } -func (Device Device) GetGpcClkMinMaxVfOffset() (int, int, Return) { - return DeviceGetGpcClkMinMaxVfOffset(Device) -} - // nvml.DeviceGetMemClkMinMaxVfOffset() func (l *library) DeviceGetMemClkMinMaxVfOffset(Device Device) (int, int, Return) { + return Device.GetMemClkMinMaxVfOffset() +} + +func (Device nvmlDevice) GetMemClkMinMaxVfOffset() (int, int, Return) { var MinOffset, MaxOffset int32 ret := nvmlDeviceGetMemClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) return int(MinOffset), int(MaxOffset), ret } -func (Device Device) GetMemClkMinMaxVfOffset() (int, int, Return) { - return DeviceGetMemClkMinMaxVfOffset(Device) -} - // nvml.DeviceGetGpuMaxPcieLinkGeneration() func (l *library) DeviceGetGpuMaxPcieLinkGeneration(Device Device) (int, Return) { + return Device.GetGpuMaxPcieLinkGeneration() +} + +func (Device nvmlDevice) GetGpuMaxPcieLinkGeneration() (int, Return) { var MaxLinkGenDevice uint32 ret := nvmlDeviceGetGpuMaxPcieLinkGeneration(Device, &MaxLinkGenDevice) return int(MaxLinkGenDevice), ret } -func (Device Device) GetGpuMaxPcieLinkGeneration() (int, Return) { - return DeviceGetGpuMaxPcieLinkGeneration(Device) -} - // nvml.DeviceGetFanControlPolicy_v2() func (l *library) DeviceGetFanControlPolicy_v2(Device Device, Fan int) (FanControlPolicy, Return) { + return Device.GetFanControlPolicy_v2(Fan) +} + +func (Device nvmlDevice) GetFanControlPolicy_v2(Fan int) (FanControlPolicy, Return) { var Policy FanControlPolicy ret := nvmlDeviceGetFanControlPolicy_v2(Device, uint32(Fan), &Policy) return Policy, ret } -func (Device Device) GetFanControlPolicy_v2(Fan int) (FanControlPolicy, Return) { - return DeviceGetFanControlPolicy_v2(Device, Fan) -} - // nvml.DeviceSetFanControlPolicy() func (l *library) DeviceSetFanControlPolicy(Device Device, Fan int, Policy FanControlPolicy) Return { - return nvmlDeviceSetFanControlPolicy(Device, uint32(Fan), Policy) + 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 (l *library) DeviceClearFieldValues(Device Device, Values []FieldValue) Return { - ValuesCount := len(Values) - return nvmlDeviceClearFieldValues(Device, int32(ValuesCount), &Values[0]) + 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 (l *library) DeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability) (bool, Return) { + return Device.GetVgpuCapabilities(Capability) +} + +func (Device nvmlDevice) GetVgpuCapabilities(Capability DeviceVgpuCapability) (bool, Return) { var CapResult uint32 ret := nvmlDeviceGetVgpuCapabilities(Device, Capability, &CapResult) return (CapResult != 0), ret } -func (Device Device) GetVgpuCapabilities(Capability DeviceVgpuCapability) (bool, Return) { - return DeviceGetVgpuCapabilities(Device, Capability) -} - // nvml.DeviceGetVgpuSchedulerLog() func (l *library) DeviceGetVgpuSchedulerLog(Device Device) (VgpuSchedulerLog, Return) { + return Device.GetVgpuSchedulerLog() +} + +func (Device nvmlDevice) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { var PSchedulerLog VgpuSchedulerLog ret := nvmlDeviceGetVgpuSchedulerLog(Device, &PSchedulerLog) return PSchedulerLog, ret } -func (Device Device) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { - return DeviceGetVgpuSchedulerLog(Device) -} - // nvml.DeviceGetVgpuSchedulerState() func (l *library) DeviceGetVgpuSchedulerState(Device Device) (VgpuSchedulerGetState, Return) { + return Device.GetVgpuSchedulerState() +} + +func (Device nvmlDevice) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { var PSchedulerState VgpuSchedulerGetState ret := nvmlDeviceGetVgpuSchedulerState(Device, &PSchedulerState) return PSchedulerState, ret } -func (Device Device) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { - return DeviceGetVgpuSchedulerState(Device) -} - // nvml.DeviceSetVgpuSchedulerState() func (l *library) DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return { - return nvmlDeviceSetVgpuSchedulerState(Device, PSchedulerState) + 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 (l *library) DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) { + return Device.GetVgpuSchedulerCapabilities() +} + +func (Device nvmlDevice) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) { var PCapabilities VgpuSchedulerCapabilities ret := nvmlDeviceGetVgpuSchedulerCapabilities(Device, &PCapabilities) return PCapabilities, ret } -func (Device Device) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) { - return DeviceGetVgpuSchedulerCapabilities(Device) -} - // nvml.GpuInstanceGetComputeInstancePossiblePlacements() func (l *library) GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { var Count uint32 @@ -2625,40 +2625,40 @@ func (GpuInstance GpuInstance) CreateComputeInstanceWithPlacement(Info *ComputeI // nvml.DeviceGetGpuFabricInfo() func (l *library) DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) { + return Device.GetGpuFabricInfo() +} + +func (Device nvmlDevice) GetGpuFabricInfo() (GpuFabricInfo, Return) { var GpuFabricInfo GpuFabricInfo ret := nvmlDeviceGetGpuFabricInfo(Device, &GpuFabricInfo) return GpuFabricInfo, ret } -func (Device Device) GetGpuFabricInfo() (GpuFabricInfo, Return) { - return DeviceGetGpuFabricInfo(Device) -} - // nvml.DeviceCcuGetStreamState() func (l *library) DeviceCcuGetStreamState(Device Device) (int, Return) { + return Device.CcuGetStreamState() +} + +func (Device nvmlDevice) CcuGetStreamState() (int, Return) { var State uint32 ret := nvmlDeviceCcuGetStreamState(Device, &State) return int(State), ret } -func (Device Device) CcuGetStreamState() (int, Return) { - return DeviceCcuGetStreamState(Device) -} - // nvml.DeviceCcuSetStreamState() func (l *library) DeviceCcuSetStreamState(Device Device, State int) Return { - return nvmlDeviceCcuSetStreamState(Device, uint32(State)) + 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 (l *library) DeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return { - return nvmlDeviceSetNvLinkDeviceLowPowerThreshold(Device, Info) + 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/pkg/nvml/gpm.go b/pkg/nvml/gpm.go index a8a79f8..2d825f0 100644 --- a/pkg/nvml/gpm.go +++ b/pkg/nvml/gpm.go @@ -44,23 +44,23 @@ func (l *library) GpmSampleAlloc(GpmSample *GpmSample) Return { // nvml.GpmSampleGet() func (l *library) GpmSampleGet(Device Device, GpmSample GpmSample) Return { - return nvmlGpmSampleGet(Device, GpmSample) + return Device.GpmSampleGet(GpmSample) } -func (Device Device) GpmSampleGet(GpmSample GpmSample) Return { - return GpmSampleGet(Device, GpmSample) +func (Device nvmlDevice) GpmSampleGet(GpmSample GpmSample) Return { + return nvmlGpmSampleGet(Device, GpmSample) } // nvml.GpmQueryDeviceSupport() type GpmSupportV struct { - device Device + device nvmlDevice } func (l *library) GpmQueryDeviceSupportV(Device Device) GpmSupportV { - return GpmSupportV{Device} + return Device.GpmQueryDeviceSupportV() } -func (Device Device) GpmQueryDeviceSupportV() GpmSupportV { +func (Device nvmlDevice) GpmQueryDeviceSupportV() GpmSupportV { return GpmSupportV{Device} } @@ -72,21 +72,21 @@ func (GpmSupportV GpmSupportV) V1() (GpmSupport, Return) { } func (l *library) GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) { + return Device.GpmQueryDeviceSupport() +} + +func (Device nvmlDevice) GpmQueryDeviceSupport() (GpmSupport, Return) { var GpmSupport GpmSupport GpmSupport.Version = GPM_SUPPORT_VERSION ret := nvmlGpmQueryDeviceSupport(Device, &GpmSupport) return GpmSupport, ret } -func (Device Device) GpmQueryDeviceSupport() (GpmSupport, Return) { - return GpmQueryDeviceSupport(Device) -} - // nvml.GpmMigSampleGet() func (l *library) GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return { - return nvmlGpmMigSampleGet(Device, uint32(GpuInstanceId), GpmSample) + return Device.GpmMigSampleGet(GpuInstanceId, GpmSample) } -func (Device Device) GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) Return { - return GpmMigSampleGet(Device, GpuInstanceId, GpmSample) +func (Device nvmlDevice) GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) Return { + return nvmlGpmMigSampleGet(Device, uint32(GpuInstanceId), GpmSample) } diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index 9bd6965..169fb28 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -166,7 +166,7 @@ func nvmlUnitGetFanSpeedInfo(Unit Unit, FanSpeeds *UnitFanSpeeds) Return { } // nvmlUnitGetDevices function as declared in nvml/nvml.h -func nvmlUnitGetDevices(Unit Unit, DeviceCount *uint32, Devices *Device) Return { +func nvmlUnitGetDevices(Unit Unit, DeviceCount *uint32, Devices *nvmlDevice) Return { cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown cDeviceCount, _ := (*C.uint)(unsafe.Pointer(DeviceCount)), cgoAllocsUnknown cDevices, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Devices)), cgoAllocsUnknown @@ -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,11 +366,11 @@ 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 } @@ -386,756 +386,756 @@ func nvmlVgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance, MdevUuid *byte, Size } // 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,206 +1145,206 @@ 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 } @@ -1359,274 +1359,274 @@ func nvmlUnitSetLedState(Unit Unit, Color LedColor) Return { } // 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 } @@ -1640,20 +1640,20 @@ 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 EventSet) 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 } @@ -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,31 +1808,31 @@ 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 *VgpuTypeId) 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 *VgpuTypeId) 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 } @@ -1925,11 +1925,11 @@ func nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId, FrameRateLimit *uint32 } // 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 +func nvmlVgpuTypeGetMaxInstances(nvmlDevice nvmlDevice, VgpuTypeId VgpuTypeId, VgpuInstanceCount *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown cVgpuInstanceCount, _ := (*C.uint)(unsafe.Pointer(VgpuInstanceCount)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetMaxInstances(cDevice, cVgpuTypeId, cVgpuInstanceCount) + __ret := C.nvmlVgpuTypeGetMaxInstances(cnvmlDevice, cVgpuTypeId, cVgpuInstanceCount) __v := (Return)(__ret) return __v } @@ -1944,11 +1944,11 @@ func nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId, VgpuInstanceCountPe } // 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 *VgpuInstance) 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 } @@ -2127,11 +2127,11 @@ func nvmlVgpuInstanceGetMetadata(VgpuInstance VgpuInstance, nvmlVgpuMetadata *nv } // 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,24 +2210,24 @@ 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 } @@ -2296,83 +2296,83 @@ 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, GpuInstance *GpuInstance) 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) + __ret := C.nvmlDeviceCreateGpuInstance(cnvmlDevice, cProfileId, cGpuInstance) __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, GpuInstance *GpuInstance) 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) + __ret := C.nvmlDeviceCreateGpuInstanceWithPlacement(cnvmlDevice, cProfileId, cPlacement, cGpuInstance) __v := (Return)(__ret) return __v } @@ -2386,22 +2386,22 @@ func nvmlGpuInstanceDestroy(GpuInstance GpuInstance) Return { } // 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 *GpuInstance, 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, GpuInstance *GpuInstance) 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) + __ret := C.nvmlDeviceGetGpuInstanceById(cnvmlDevice, cId, cGpuInstance) __v := (Return)(__ret) return __v } @@ -2518,171 +2518,171 @@ func nvmlComputeInstanceGetInfo_v2(ComputeInstance ComputeInstance, Info *Comput } // 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 } @@ -2712,56 +2712,56 @@ func nvmlGpmSampleAlloc(GpmSample *GpmSample) Return { } // nvmlGpmSampleGet function as declared in nvml/nvml.h -func nvmlGpmSampleGet(Device Device, GpmSample GpmSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlGpmSampleGet(nvmlDevice nvmlDevice, GpmSample GpmSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmSampleGet(cDevice, cGpmSample) + __ret := C.nvmlGpmSampleGet(cnvmlDevice, cGpmSample) __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, GpmSample GpmSample) 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) + __ret := C.nvmlGpmMigSampleGet(cnvmlDevice, cGpuInstanceId, cGpmSample) __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 } @@ -2873,10 +2873,10 @@ 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 } @@ -2891,72 +2891,72 @@ func nvmlComputeInstanceGetInfo_v1(ComputeInstance ComputeInstance, Info *Comput } // 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 } diff --git a/pkg/nvml/system.go b/pkg/nvml/system.go index 2f7b1da..48caf56 100644 --- a/pkg/nvml/system.go +++ b/pkg/nvml/system.go @@ -75,7 +75,7 @@ func (l *library) SystemGetTopologyGpuSet(CpuNumber int) ([]Device, Return) { if Count == 0 { return []Device{}, ret } - DeviceArray := make([]Device, Count) + DeviceArray := make([]nvmlDevice, Count) ret = nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, &DeviceArray[0]) - return DeviceArray, ret + return convertSlice[nvmlDevice, Device](DeviceArray), ret } diff --git a/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index 396886d..1226894 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -5,7 +5,7 @@ package nvml import "unsafe" -type Device struct { +type nvmlDevice struct { Handle *_Ctype_struct_nvmlDevice_st } @@ -359,7 +359,7 @@ type EventSet struct { } type EventData struct { - Device Device + Device nvmlDevice EventType uint64 EventData uint64 GpuInstanceId uint32 @@ -495,7 +495,7 @@ type GpuInstanceProfileInfo_v2 struct { } type GpuInstanceInfo struct { - Device Device + Device nvmlDevice Id uint32 ProfileId uint32 Placement GpuInstancePlacement @@ -537,7 +537,7 @@ type ComputeInstanceProfileInfo_v2 struct { } type ComputeInstanceInfo struct { - Device Device + Device nvmlDevice GpuInstance GpuInstance Id uint32 ProfileId uint32 diff --git a/pkg/nvml/unit.go b/pkg/nvml/unit.go index f6801d0..4398606 100644 --- a/pkg/nvml/unit.go +++ b/pkg/nvml/unit.go @@ -87,10 +87,10 @@ func (Unit Unit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { func (l *library) UnitGetDevices(Unit Unit) ([]Device, Return) { var DeviceCount uint32 = 1 // Will be reduced upon returning for { - Devices := make([]Device, DeviceCount) + 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 diff --git a/pkg/nvml/vgpu.go b/pkg/nvml/vgpu.go index 170a0c7..87796f9 100644 --- a/pkg/nvml/vgpu.go +++ b/pkg/nvml/vgpu.go @@ -133,15 +133,15 @@ func (VgpuTypeId VgpuTypeId) GetFrameRateLimit() (uint32, Return) { // nvml.VgpuTypeGetMaxInstances() func (l *library) VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) { + return Device.VgpuTypeGetMaxInstances(VgpuTypeId) +} + +func (Device nvmlDevice) VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) { var VgpuInstanceCount uint32 ret := nvmlVgpuTypeGetMaxInstances(Device, VgpuTypeId, &VgpuInstanceCount) return int(VgpuInstanceCount), ret } -func (Device Device) VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) { - return VgpuTypeGetMaxInstances(Device, VgpuTypeId) -} - func (VgpuTypeId VgpuTypeId) GetMaxInstances(Device Device) (int, Return) { return VgpuTypeGetMaxInstances(Device, VgpuTypeId) } From e818572457839e81d87ec432fdf83056b0e562bc Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 09:51:55 +0000 Subject: [PATCH 06/21] Convert Unit into an interface instead of a concrete type Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 1 + pkg/nvml/api.go | 10 ++++++++ pkg/nvml/nvml.go | 48 ++++++++++++++++++------------------- pkg/nvml/types_gen.go | 2 +- pkg/nvml/unit.go | 56 +++++++++++++++++++++---------------------- 5 files changed, 64 insertions(+), 53 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index 4590e92..41e74d5 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -65,6 +65,7 @@ TRANSLATOR: - {action: replace, from: "_t$"} - {transform: export} - {action: replace, from: "^Device$", to: "nvmlDevice"} + - {action: replace, from: "^Unit$", to: "nvmlUnit"} - {action: replace, from: "^VgpuMetadata", to: "nvmlVgpuMetadata"} - {action: replace, from: "^VgpuPgpuMetadata", to: "nvmlVgpuPgpuMetadata"} - {action: replace, from: "^GpmMetricsGet", to: "GpmMetricsGetType"} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 73db1eb..492f3cb 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -553,6 +553,16 @@ type Device interface { VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) } +type Unit interface { + GetUnitInfo() (UnitInfo, Return) + GetLedState() (LedState, Return) + GetPsuInfo() (PSUInfo, Return) + GetTemperature(Type int) (uint32, Return) + GetFanSpeedInfo() (UnitFanSpeeds, Return) + GetDevices() ([]Device, Return) + SetLedState(Color LedColor) Return +} + // Define package level methods as aliases to Interface methods of libnvml var ( GetLibrary = libnvml.GetLibrary diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index 169fb28..867c346 100644 --- a/pkg/nvml/nvml.go +++ b/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 *nvmlDevice) 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 } @@ -1350,10 +1350,10 @@ func nvmlDeviceGetArchitecture(nvmlDevice nvmlDevice, Arch *DeviceArchitecture) } // 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 } diff --git a/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index 1226894..204ed71 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -316,7 +316,7 @@ type FieldValue struct { Value [8]byte } -type Unit struct { +type nvmlUnit struct { Handle *_Ctype_struct_nvmlUnit_st } diff --git a/pkg/nvml/unit.go b/pkg/nvml/unit.go index 4398606..6100752 100644 --- a/pkg/nvml/unit.go +++ b/pkg/nvml/unit.go @@ -23,68 +23,72 @@ func (l *library) UnitGetCount() (int, Return) { // nvml.UnitGetHandleByIndex() func (l *library) UnitGetHandleByIndex(Index int) (Unit, Return) { - var Unit Unit + var Unit nvmlUnit ret := nvmlUnitGetHandleByIndex(uint32(Index), &Unit) return Unit, ret } // nvml.UnitGetUnitInfo() func (l *library) UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) { + return Unit.GetUnitInfo() +} + +func (Unit nvmlUnit) GetUnitInfo() (UnitInfo, Return) { var Info UnitInfo ret := nvmlUnitGetUnitInfo(Unit, &Info) return Info, ret } -func (Unit Unit) GetUnitInfo() (UnitInfo, Return) { - return UnitGetUnitInfo(Unit) -} - // nvml.UnitGetLedState() func (l *library) UnitGetLedState(Unit Unit) (LedState, Return) { + return Unit.GetLedState() +} + +func (Unit nvmlUnit) GetLedState() (LedState, Return) { var State LedState ret := nvmlUnitGetLedState(Unit, &State) return State, ret } -func (Unit Unit) GetLedState() (LedState, Return) { - return UnitGetLedState(Unit) -} - // nvml.UnitGetPsuInfo() func (l *library) UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) { + return Unit.GetPsuInfo() +} + +func (Unit nvmlUnit) GetPsuInfo() (PSUInfo, Return) { var Psu PSUInfo ret := nvmlUnitGetPsuInfo(Unit, &Psu) return Psu, ret } -func (Unit Unit) GetPsuInfo() (PSUInfo, Return) { - return UnitGetPsuInfo(Unit) -} - // nvml.UnitGetTemperature() func (l *library) UnitGetTemperature(Unit Unit, Type int) (uint32, Return) { + return Unit.GetTemperature(Type) +} + +func (Unit nvmlUnit) GetTemperature(Type int) (uint32, Return) { var Temp uint32 ret := nvmlUnitGetTemperature(Unit, uint32(Type), &Temp) return Temp, ret } -func (Unit Unit) GetTemperature(Type int) (uint32, Return) { - return UnitGetTemperature(Unit, Type) -} - // nvml.UnitGetFanSpeedInfo() func (l *library) UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) { + return Unit.GetFanSpeedInfo() +} + +func (Unit nvmlUnit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { var FanSpeeds UnitFanSpeeds ret := nvmlUnitGetFanSpeedInfo(Unit, &FanSpeeds) return FanSpeeds, ret } -func (Unit Unit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { - return UnitGetFanSpeedInfo(Unit) -} - // nvml.UnitGetDevices() 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([]nvmlDevice, DeviceCount) @@ -99,15 +103,11 @@ func (l *library) UnitGetDevices(Unit Unit) ([]Device, Return) { } } -func (Unit Unit) GetDevices() ([]Device, Return) { - return UnitGetDevices(Unit) -} - // nvml.UnitSetLedState() func (l *library) UnitSetLedState(Unit Unit, Color LedColor) Return { - return nvmlUnitSetLedState(Unit, Color) + 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) } From 1082707099f36c4c6497fe984ca5ca4138ed4dd6 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 10:07:54 +0000 Subject: [PATCH 07/21] Convert EventSet into an interface instead of a concrete type Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 1 + pkg/nvml/api.go | 5 +++++ pkg/nvml/device.go | 2 +- pkg/nvml/event_set.go | 16 ++++++++-------- pkg/nvml/nvml.go | 10 +++++----- pkg/nvml/types_gen.go | 2 +- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index 41e74d5..7d7efb7 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -66,6 +66,7 @@ TRANSLATOR: - {transform: export} - {action: replace, from: "^Device$", to: "nvmlDevice"} - {action: replace, from: "^Unit$", to: "nvmlUnit"} + - {action: replace, from: "^EventSet$", to: "nvmlEventSet"} - {action: replace, from: "^VgpuMetadata", to: "nvmlVgpuMetadata"} - {action: replace, from: "^VgpuPgpuMetadata", to: "nvmlVgpuPgpuMetadata"} - {action: replace, from: "^GpmMetricsGet", to: "GpmMetricsGetType"} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 492f3cb..723d177 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -553,6 +553,11 @@ type Device interface { VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) } +type EventSet interface { + Wait(Timeoutms uint32) (EventData, Return) + Free() Return +} + type Unit interface { GetUnitInfo() (UnitInfo, Return) GetLedState() (LedState, Return) diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index 9a2aa78..b1f94c8 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -1631,7 +1631,7 @@ func (l *library) DeviceRegisterEvents(Device Device, EventTypes uint64, Set Eve } func (Device nvmlDevice) RegisterEvents(EventTypes uint64, Set EventSet) Return { - return nvmlDeviceRegisterEvents(Device, EventTypes, Set) + return nvmlDeviceRegisterEvents(Device, EventTypes, Set.(nvmlEventSet)) } // nvmlDeviceGetSupportedEventTypes() diff --git a/pkg/nvml/event_set.go b/pkg/nvml/event_set.go index 9e2c79e..23965b3 100644 --- a/pkg/nvml/event_set.go +++ b/pkg/nvml/event_set.go @@ -16,27 +16,27 @@ package nvml // nvml.EventSetCreate() func (l *library) EventSetCreate() (EventSet, Return) { - var Set EventSet + var Set nvmlEventSet ret := nvmlEventSetCreate(&Set) return Set, ret } // nvml.EventSetWait() func (l *library) EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) { + return Set.Wait(Timeoutms) +} + +func (Set nvmlEventSet) Wait(Timeoutms uint32) (EventData, Return) { var Data EventData ret := nvmlEventSetWait(Set, &Data, Timeoutms) return Data, ret } -func (Set EventSet) Wait(Timeoutms uint32) (EventData, Return) { - return EventSetWait(Set, Timeoutms) -} - // nvml.EventSetFree() func (l *library) EventSetFree(Set EventSet) Return { - return nvmlEventSetFree(Set) + return Set.Free() } -func (Set EventSet) Free() Return { - return EventSetFree(Set) +func (Set nvmlEventSet) Free() Return { + return nvmlEventSetFree(Set) } diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index 867c346..a472650 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -1632,7 +1632,7 @@ func nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice nvmlDevice, Link uint32, PNv } // 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,7 +1640,7 @@ func nvmlEventSetCreate(Set *EventSet) Return { } // nvmlDeviceRegisterEvents function as declared in nvml/nvml.h -func nvmlDeviceRegisterEvents(nvmlDevice nvmlDevice, EventTypes uint64, Set EventSet) Return { +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 @@ -1659,7 +1659,7 @@ func nvmlDeviceGetSupportedEventTypes(nvmlDevice nvmlDevice, EventTypes *uint64) } // 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 *EventData, 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) @@ -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 *EventData, Timeoutms uint32) Return { cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown cData, _ := (*C.nvmlEventData_t)(unsafe.Pointer(Data)), cgoAllocsUnknown cTimeoutms, _ := (C.uint)(Timeoutms), cgoAllocsUnknown diff --git a/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index 204ed71..d5886ce 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -354,7 +354,7 @@ type UnitFanSpeeds struct { Count uint32 } -type EventSet struct { +type nvmlEventSet struct { Handle *_Ctype_struct_nvmlEventSet_st } From 3577f241c339d65903de0c7ca55d948e01a62a64 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 11:04:11 +0000 Subject: [PATCH 08/21] Convert VgpuInstance into an interface instead of a concrete type Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 1 + pkg/nvml/api.go | 26 ++++++ pkg/nvml/device.go | 4 +- pkg/nvml/nvml.go | 146 +++++++++++++++++----------------- pkg/nvml/types_gen.go | 2 +- pkg/nvml/vgpu.go | 180 +++++++++++++++++++++--------------------- 6 files changed, 193 insertions(+), 166 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index 7d7efb7..f4bc193 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -67,6 +67,7 @@ TRANSLATOR: - {action: replace, from: "^Device$", to: "nvmlDevice"} - {action: replace, from: "^Unit$", to: "nvmlUnit"} - {action: replace, from: "^EventSet$", to: "nvmlEventSet"} + - {action: replace, from: "^VgpuInstance$", to: "nvmlVgpuInstance"} - {action: replace, from: "^VgpuMetadata", to: "nvmlVgpuMetadata"} - {action: replace, from: "^VgpuPgpuMetadata", to: "nvmlVgpuPgpuMetadata"} - {action: replace, from: "^GpmMetricsGet", to: "GpmMetricsGetType"} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 723d177..ed2f158 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -568,6 +568,32 @@ type Unit interface { SetLedState(Color LedColor) Return } +type VgpuInstance interface { + GetVmID() (string, VgpuVmIdType, Return) + GetUUID() (string, Return) + GetVmDriverVersion() (string, Return) + GetFbUsage() (uint64, Return) + GetLicenseInfo() (VgpuLicenseInfo, Return) + GetLicenseStatus() (int, Return) + GetType() (VgpuTypeId, Return) + GetFrameRateLimit() (uint32, Return) + GetEccMode() (EnableState, Return) + GetEncoderCapacity() (int, Return) + SetEncoderCapacity(EncoderCapacity int) Return + GetEncoderStats() (int, uint32, uint32, Return) + GetEncoderSessions() (int, EncoderSessionInfo, Return) + GetFBCStats() (FBCStats, Return) + GetFBCSessions() (int, FBCSessionInfo, Return) + GetGpuInstanceId() (int, Return) + GetGpuPciId() (string, Return) + GetMetadata() (VgpuMetadata, Return) + GetAccountingMode() (EnableState, Return) + GetAccountingPids() ([]int, Return) + GetAccountingStats(Pid int) (AccountingStats, Return) + ClearAccountingPids() Return + GetMdevUUID() (string, Return) +} + // Define package level methods as aliases to Interface methods of libnvml var ( GetLibrary = libnvml.GetLibrary diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index b1f94c8..a486231 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -1793,10 +1793,10 @@ func (l *library) DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) { func (Device nvmlDevice) GetActiveVgpus() ([]VgpuInstance, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuInstances := make([]VgpuInstance, VgpuCount) + 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 diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index a472650..fd55959 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -376,11 +376,11 @@ func nvmlDeviceGetUUID(nvmlDevice nvmlDevice, Uuid *byte, Length uint32) Return } // 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 } @@ -1944,7 +1944,7 @@ func nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId, VgpuInstanceCountPe } // nvmlDeviceGetActiveVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetActiveVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuInstances *VgpuInstance) Return { +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 @@ -1954,154 +1954,154 @@ func nvmlDeviceGetActiveVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuInst } // 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 +func nvmlVgpuInstanceGetType(nvmlVgpuInstance nvmlVgpuInstance, VgpuTypeId *VgpuTypeId) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cVgpuTypeId, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(VgpuTypeId)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetType(cVgpuInstance, cVgpuTypeId) + __ret := C.nvmlVgpuInstanceGetType(cnvmlVgpuInstance, cVgpuTypeId) __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 } @@ -2117,11 +2117,11 @@ func nvmlVgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapabilit } // 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 } @@ -2233,47 +2233,47 @@ func nvmlDeviceGetVgpuProcessUtilization(nvmlDevice nvmlDevice, LastSeenTimeStam } // 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 } @@ -2962,10 +2962,10 @@ func nvmlDeviceGetGpuInstancePossiblePlacements_v1(nvmlDevice nvmlDevice, Profil } // 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/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index d5886ce..24ce62a 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -145,7 +145,7 @@ type ClkMonStatus struct { type VgpuTypeId uint32 -type VgpuInstance uint32 +type nvmlVgpuInstance uint32 type VgpuInstanceUtilizationSample struct { VgpuInstance uint32 diff --git a/pkg/nvml/vgpu.go b/pkg/nvml/vgpu.go index 87796f9..1994b06 100644 --- a/pkg/nvml/vgpu.go +++ b/pkg/nvml/vgpu.go @@ -159,183 +159,187 @@ func (VgpuTypeId VgpuTypeId) GetMaxInstancesPerVm() (int, Return) { // nvml.VgpuInstanceGetVmID() func (l *library) VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { + return VgpuInstance.GetVmID() +} + +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 } -func (VgpuInstance VgpuInstance) GetVmID() (string, VgpuVmIdType, Return) { - return VgpuInstanceGetVmID(VgpuInstance) -} - // nvml.VgpuInstanceGetUUID() func (l *library) VgpuInstanceGetUUID(VgpuInstance VgpuInstance) (string, Return) { + return VgpuInstance.GetUUID() +} + +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 } -func (VgpuInstance VgpuInstance) GetUUID() (string, Return) { - return VgpuInstanceGetUUID(VgpuInstance) -} - // nvml.VgpuInstanceGetVmDriverVersion() func (l *library) VgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance) (string, Return) { + return VgpuInstance.GetVmDriverVersion() +} + +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 } -func (VgpuInstance VgpuInstance) GetVmDriverVersion() (string, Return) { - return VgpuInstanceGetVmDriverVersion(VgpuInstance) -} - // nvml.VgpuInstanceGetFbUsage() func (l *library) VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) { + return VgpuInstance.GetFbUsage() +} + +func (VgpuInstance nvmlVgpuInstance) GetFbUsage() (uint64, Return) { var FbUsage uint64 ret := nvmlVgpuInstanceGetFbUsage(VgpuInstance, &FbUsage) return FbUsage, ret } -func (VgpuInstance VgpuInstance) GetFbUsage() (uint64, Return) { - return VgpuInstanceGetFbUsage(VgpuInstance) -} - // nvml.VgpuInstanceGetLicenseInfo() func (l *library) VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { + return VgpuInstance.GetLicenseInfo() +} + +func (VgpuInstance nvmlVgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { var LicenseInfo VgpuLicenseInfo ret := nvmlVgpuInstanceGetLicenseInfo(VgpuInstance, &LicenseInfo) return LicenseInfo, ret } -func (VgpuInstance VgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { - return VgpuInstanceGetLicenseInfo(VgpuInstance) -} - // nvml.VgpuInstanceGetLicenseStatus() func (l *library) VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) { + return VgpuInstance.GetLicenseStatus() +} + +func (VgpuInstance nvmlVgpuInstance) GetLicenseStatus() (int, Return) { var Licensed uint32 ret := nvmlVgpuInstanceGetLicenseStatus(VgpuInstance, &Licensed) return int(Licensed), ret } -func (VgpuInstance VgpuInstance) GetLicenseStatus() (int, Return) { - return VgpuInstanceGetLicenseStatus(VgpuInstance) -} - // nvml.VgpuInstanceGetType() func (l *library) VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) { + return VgpuInstance.GetType() +} + +func (VgpuInstance nvmlVgpuInstance) GetType() (VgpuTypeId, Return) { var VgpuTypeId VgpuTypeId ret := nvmlVgpuInstanceGetType(VgpuInstance, &VgpuTypeId) return VgpuTypeId, ret } -func (VgpuInstance VgpuInstance) GetType() (VgpuTypeId, Return) { - return VgpuInstanceGetType(VgpuInstance) -} - // nvml.VgpuInstanceGetFrameRateLimit() func (l *library) VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) { + return VgpuInstance.GetFrameRateLimit() +} + +func (VgpuInstance nvmlVgpuInstance) GetFrameRateLimit() (uint32, Return) { var FrameRateLimit uint32 ret := nvmlVgpuInstanceGetFrameRateLimit(VgpuInstance, &FrameRateLimit) return FrameRateLimit, ret } -func (VgpuInstance VgpuInstance) GetFrameRateLimit() (uint32, Return) { - return VgpuInstanceGetFrameRateLimit(VgpuInstance) -} - // nvml.VgpuInstanceGetEccMode() func (l *library) VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) { + return VgpuInstance.GetEccMode() +} + +func (VgpuInstance nvmlVgpuInstance) GetEccMode() (EnableState, Return) { var EccMode EnableState ret := nvmlVgpuInstanceGetEccMode(VgpuInstance, &EccMode) return EccMode, ret } -func (VgpuInstance VgpuInstance) GetEccMode() (EnableState, Return) { - return VgpuInstanceGetEccMode(VgpuInstance) -} - // nvml.VgpuInstanceGetEncoderCapacity() func (l *library) VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) { + return VgpuInstance.GetEncoderCapacity() +} + +func (VgpuInstance nvmlVgpuInstance) GetEncoderCapacity() (int, Return) { var EncoderCapacity uint32 ret := nvmlVgpuInstanceGetEncoderCapacity(VgpuInstance, &EncoderCapacity) return int(EncoderCapacity), ret } -func (VgpuInstance VgpuInstance) GetEncoderCapacity() (int, Return) { - return VgpuInstanceGetEncoderCapacity(VgpuInstance) -} - // nvml.VgpuInstanceSetEncoderCapacity() func (l *library) VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return { - return nvmlVgpuInstanceSetEncoderCapacity(VgpuInstance, uint32(EncoderCapacity)) + 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 (l *library) VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) { + return VgpuInstance.GetEncoderStats() +} + +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 } -func (VgpuInstance VgpuInstance) GetEncoderStats() (int, uint32, uint32, Return) { - return VgpuInstanceGetEncoderStats(VgpuInstance) -} - // nvml.VgpuInstanceGetEncoderSessions() func (l *library) VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { + return VgpuInstance.GetEncoderSessions() +} + +func (VgpuInstance nvmlVgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) { var SessionCount uint32 var SessionInfo EncoderSessionInfo ret := nvmlVgpuInstanceGetEncoderSessions(VgpuInstance, &SessionCount, &SessionInfo) return int(SessionCount), SessionInfo, ret } -func (VgpuInstance VgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) { - return VgpuInstanceGetEncoderSessions(VgpuInstance) -} - // nvml.VgpuInstanceGetFBCStats() func (l *library) VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) { + return VgpuInstance.GetFBCStats() +} + +func (VgpuInstance nvmlVgpuInstance) GetFBCStats() (FBCStats, Return) { var FbcStats FBCStats ret := nvmlVgpuInstanceGetFBCStats(VgpuInstance, &FbcStats) return FbcStats, ret } -func (VgpuInstance VgpuInstance) GetFBCStats() (FBCStats, Return) { - return VgpuInstanceGetFBCStats(VgpuInstance) -} - // nvml.VgpuInstanceGetFBCSessions() func (l *library) VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { + return VgpuInstance.GetFBCSessions() +} + +func (VgpuInstance nvmlVgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) { var SessionCount uint32 var SessionInfo FBCSessionInfo ret := nvmlVgpuInstanceGetFBCSessions(VgpuInstance, &SessionCount, &SessionInfo) return int(SessionCount), SessionInfo, ret } -func (VgpuInstance VgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) { - return VgpuInstanceGetFBCSessions(VgpuInstance) -} - // nvml.VgpuInstanceGetGpuInstanceId() func (l *library) VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) { + return VgpuInstance.GetGpuInstanceId() +} + +func (VgpuInstance nvmlVgpuInstance) GetGpuInstanceId() (int, Return) { var gpuInstanceId uint32 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() +} + +func (VgpuInstance nvmlVgpuInstance) GetGpuPciId() (string, Return) { var Length uint32 = 1 // Will be reduced upon returning for { VgpuPciId := make([]byte, Length) @@ -350,12 +354,12 @@ func (l *library) VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Re } } -func (VgpuInstance VgpuInstance) GetGpuPciId() (string, Return) { - return VgpuInstanceGetGpuPciId(VgpuInstance) -} - // nvml.VgpuInstanceGetMetadata() func (l *library) VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) { + return VgpuInstance.GetMetadata() +} + +func (VgpuInstance nvmlVgpuInstance) GetMetadata() (VgpuMetadata, Return) { var VgpuMetadata VgpuMetadata OpaqueDataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata.OpaqueData) VgpuMetadataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata) - OpaqueDataSize @@ -376,23 +380,23 @@ func (l *library) VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetada } } -func (VgpuInstance VgpuInstance) GetMetadata() (VgpuMetadata, Return) { - return VgpuInstanceGetMetadata(VgpuInstance) -} - // nvml.VgpuInstanceGetAccountingMode() func (l *library) VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) { + return VgpuInstance.GetAccountingMode() +} + +func (VgpuInstance nvmlVgpuInstance) GetAccountingMode() (EnableState, Return) { var Mode EnableState ret := nvmlVgpuInstanceGetAccountingMode(VgpuInstance, &Mode) return Mode, ret } -func (VgpuInstance VgpuInstance) GetAccountingMode() (EnableState, Return) { - return VgpuInstanceGetAccountingMode(VgpuInstance) -} - // nvml.VgpuInstanceGetAccountingPids() 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) @@ -407,21 +411,17 @@ func (l *library) VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]in } } -func (VgpuInstance VgpuInstance) GetAccountingPids() ([]int, Return) { - return VgpuInstanceGetAccountingPids(VgpuInstance) -} - // nvml.VgpuInstanceGetAccountingStats() func (l *library) VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) { + return VgpuInstance.GetAccountingStats(Pid) +} + +func (VgpuInstance nvmlVgpuInstance) GetAccountingStats(Pid int) (AccountingStats, Return) { var Stats AccountingStats ret := nvmlVgpuInstanceGetAccountingStats(VgpuInstance, uint32(Pid), &Stats) return Stats, ret } -func (VgpuInstance VgpuInstance) GetAccountingStats(Pid int) (AccountingStats, Return) { - return VgpuInstanceGetAccountingStats(VgpuInstance, Pid) -} - // nvml.GetVgpuCompatibility() func (l *library) GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { var CompatibilityInfo VgpuPgpuCompatibility @@ -443,24 +443,24 @@ func (l *library) SetVgpuVersion(VgpuVersion *VgpuVersion) Return { // nvml.VgpuInstanceClearAccountingPids() func (l *library) VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return { - return nvmlVgpuInstanceClearAccountingPids(VgpuInstance) + return VgpuInstance.ClearAccountingPids() } -func (VgpuInstance VgpuInstance) ClearAccountingPids() Return { - return VgpuInstanceClearAccountingPids(VgpuInstance) +func (VgpuInstance nvmlVgpuInstance) ClearAccountingPids() Return { + return nvmlVgpuInstanceClearAccountingPids(VgpuInstance) } // nvml.VgpuInstanceGetMdevUUID() func (l *library) VgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance) (string, Return) { + return VgpuInstance.GetMdevUUID() +} + +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 } -func (VgpuInstance VgpuInstance) GetMdevUUID() (string, Return) { - return VgpuInstanceGetMdevUUID(VgpuInstance) -} - // nvml.VgpuTypeGetCapabilities() func (l *library) VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) { var CapResult uint32 From dd2504be861cda182a2a2248c7fb7d6e6347f2f8 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 11:18:33 +0000 Subject: [PATCH 09/21] Convert VgpuTypeId into an interface instead of a concrete type Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 1 + pkg/nvml/api.go | 15 +++++++ pkg/nvml/device.go | 8 ++-- pkg/nvml/nvml.go | 82 ++++++++++++++++----------------- pkg/nvml/types_gen.go | 2 +- pkg/nvml/vgpu.go | 102 +++++++++++++++++++++--------------------- 6 files changed, 113 insertions(+), 97 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index f4bc193..717eb15 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -68,6 +68,7 @@ TRANSLATOR: - {action: replace, from: "^Unit$", to: "nvmlUnit"} - {action: replace, from: "^EventSet$", to: "nvmlEventSet"} - {action: replace, from: "^VgpuInstance$", to: "nvmlVgpuInstance"} + - {action: replace, from: "^VgpuTypeId$", to: "nvmlVgpuTypeId"} - {action: replace, from: "^VgpuMetadata", to: "nvmlVgpuMetadata"} - {action: replace, from: "^VgpuPgpuMetadata", to: "nvmlVgpuPgpuMetadata"} - {action: replace, from: "^GpmMetricsGet", to: "GpmMetricsGetType"} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index ed2f158..05692a4 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -594,6 +594,21 @@ type VgpuInstance interface { GetMdevUUID() (string, Return) } +type VgpuTypeId interface { + GetClass() (string, Return) + GetName() (string, Return) + GetGpuInstanceProfileId() (uint32, Return) + GetDeviceID() (uint64, uint64, Return) + GetFramebufferSize() (uint64, Return) + GetNumDisplayHeads() (int, Return) + GetResolution(DisplayIndex int) (uint32, uint32, Return) + GetLicense() (string, Return) + GetFrameRateLimit() (uint32, Return) + GetMaxInstances(Device Device) (int, Return) + GetMaxInstancesPerVm() (int, Return) + GetCapabilities(Capability VgpuCapability) (bool, Return) +} + // Define package level methods as aliases to Interface methods of libnvml var ( GetLibrary = libnvml.GetLibrary diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index a486231..0fa18cf 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -1753,10 +1753,10 @@ func (l *library) DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) func (Device nvmlDevice) GetSupportedVgpus() ([]VgpuTypeId, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuTypeIds := make([]VgpuTypeId, VgpuCount) + 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 @@ -1773,10 +1773,10 @@ func (l *library) DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) func (Device nvmlDevice) GetCreatableVgpus() ([]VgpuTypeId, Return) { var VgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuTypeIds := make([]VgpuTypeId, VgpuCount) + 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 diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index fd55959..bc87d6f 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -1818,7 +1818,7 @@ func nvmlDeviceGetVgpuCapabilities(nvmlDevice nvmlDevice, Capability DeviceVgpuC } // nvmlDeviceGetSupportedVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuTypeIds *VgpuTypeId) Return { +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 @@ -1828,7 +1828,7 @@ func nvmlDeviceGetSupportedVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuT } // nvmlDeviceGetCreatableVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetCreatableVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuTypeIds *VgpuTypeId) Return { +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 @@ -1838,107 +1838,107 @@ func nvmlDeviceGetCreatableVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuT } // 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(nvmlDevice nvmlDevice, VgpuTypeId VgpuTypeId, VgpuInstanceCount *uint32) Return { +func nvmlVgpuTypeGetMaxInstances(nvmlDevice nvmlDevice, nvmlVgpuTypeId nvmlVgpuTypeId, VgpuInstanceCount *uint32) Return { cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuInstanceCount, _ := (*C.uint)(unsafe.Pointer(VgpuInstanceCount)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetMaxInstances(cnvmlDevice, 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 } @@ -2003,10 +2003,10 @@ func nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance nvmlVgpuInstance, License } // nvmlVgpuInstanceGetType function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetType(nvmlVgpuInstance nvmlVgpuInstance, VgpuTypeId *VgpuTypeId) Return { +func nvmlVgpuInstanceGetType(nvmlVgpuInstance nvmlVgpuInstance, nvmlVgpuTypeId *nvmlVgpuTypeId) Return { cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown - cVgpuTypeId, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(VgpuTypeId)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetType(cnvmlVgpuInstance, cVgpuTypeId) + cnvmlVgpuTypeId, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(nvmlVgpuTypeId)), cgoAllocsUnknown + __ret := C.nvmlVgpuInstanceGetType(cnvmlVgpuInstance, cnvmlVgpuTypeId) __v := (Return)(__ret) return __v } @@ -2107,11 +2107,11 @@ func nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance nvmlVgpuInstance, VgpuPciId *b } // 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 } diff --git a/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index 24ce62a..079a218 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -143,7 +143,7 @@ type ClkMonStatus struct { ClkMonList [32]ClkMonFaultInfo } -type VgpuTypeId uint32 +type nvmlVgpuTypeId uint32 type nvmlVgpuInstance uint32 diff --git a/pkg/nvml/vgpu.go b/pkg/nvml/vgpu.go index 1994b06..f82d928 100644 --- a/pkg/nvml/vgpu.go +++ b/pkg/nvml/vgpu.go @@ -32,131 +32,131 @@ type VgpuPgpuMetadata struct { // nvml.VgpuTypeGetClass() func (l *library) VgpuTypeGetClass(VgpuTypeId VgpuTypeId) (string, Return) { + return VgpuTypeId.GetClass() +} + +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 } -func (VgpuTypeId VgpuTypeId) GetClass() (string, Return) { - return VgpuTypeGetClass(VgpuTypeId) -} - // nvml.VgpuTypeGetName() func (l *library) VgpuTypeGetName(VgpuTypeId VgpuTypeId) (string, Return) { + return VgpuTypeId.GetName() +} + +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 } -func (VgpuTypeId VgpuTypeId) GetName() (string, Return) { - return VgpuTypeGetName(VgpuTypeId) -} - // nvml.VgpuTypeGetGpuInstanceProfileId() func (l *library) VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) { + return VgpuTypeId.GetGpuInstanceProfileId() +} + +func (VgpuTypeId nvmlVgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { var Size uint32 ret := nvmlVgpuTypeGetGpuInstanceProfileId(VgpuTypeId, &Size) return Size, ret } -func (VgpuTypeId VgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { - return VgpuTypeGetGpuInstanceProfileId(VgpuTypeId) -} - // nvml.VgpuTypeGetDeviceID() func (l *library) VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) { + return VgpuTypeId.GetDeviceID() +} + +func (VgpuTypeId nvmlVgpuTypeId) GetDeviceID() (uint64, uint64, Return) { var DeviceID, SubsystemID uint64 ret := nvmlVgpuTypeGetDeviceID(VgpuTypeId, &DeviceID, &SubsystemID) return DeviceID, SubsystemID, ret } -func (VgpuTypeId VgpuTypeId) GetDeviceID() (uint64, uint64, Return) { - return VgpuTypeGetDeviceID(VgpuTypeId) -} - // nvml.VgpuTypeGetFramebufferSize() func (l *library) VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) { + return VgpuTypeId.GetFramebufferSize() +} + +func (VgpuTypeId nvmlVgpuTypeId) GetFramebufferSize() (uint64, Return) { var FbSize uint64 ret := nvmlVgpuTypeGetFramebufferSize(VgpuTypeId, &FbSize) return FbSize, ret } -func (VgpuTypeId VgpuTypeId) GetFramebufferSize() (uint64, Return) { - return VgpuTypeGetFramebufferSize(VgpuTypeId) -} - // nvml.VgpuTypeGetNumDisplayHeads() func (l *library) VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) { + return VgpuTypeId.GetNumDisplayHeads() +} + +func (VgpuTypeId nvmlVgpuTypeId) GetNumDisplayHeads() (int, Return) { var NumDisplayHeads uint32 ret := nvmlVgpuTypeGetNumDisplayHeads(VgpuTypeId, &NumDisplayHeads) return int(NumDisplayHeads), ret } -func (VgpuTypeId VgpuTypeId) GetNumDisplayHeads() (int, Return) { - return VgpuTypeGetNumDisplayHeads(VgpuTypeId) -} - // nvml.VgpuTypeGetResolution() func (l *library) VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) { + return VgpuTypeId.GetResolution(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 } -func (VgpuTypeId VgpuTypeId) GetResolution(DisplayIndex int) (uint32, uint32, Return) { - return VgpuTypeGetResolution(VgpuTypeId, DisplayIndex) -} - // nvml.VgpuTypeGetLicense() func (l *library) VgpuTypeGetLicense(VgpuTypeId VgpuTypeId) (string, Return) { + return VgpuTypeId.GetLicense() +} + +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 } -func (VgpuTypeId VgpuTypeId) GetLicense() (string, Return) { - return VgpuTypeGetLicense(VgpuTypeId) -} - // nvml.VgpuTypeGetFrameRateLimit() func (l *library) VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) { + return VgpuTypeId.GetFrameRateLimit() +} + +func (VgpuTypeId nvmlVgpuTypeId) GetFrameRateLimit() (uint32, Return) { var FrameRateLimit uint32 ret := nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId, &FrameRateLimit) return FrameRateLimit, ret } -func (VgpuTypeId VgpuTypeId) GetFrameRateLimit() (uint32, Return) { - return VgpuTypeGetFrameRateLimit(VgpuTypeId) -} - // nvml.VgpuTypeGetMaxInstances() func (l *library) VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) { - return Device.VgpuTypeGetMaxInstances(VgpuTypeId) + return VgpuTypeId.GetMaxInstances(Device) } func (Device nvmlDevice) VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) { - var VgpuInstanceCount uint32 - ret := nvmlVgpuTypeGetMaxInstances(Device, VgpuTypeId, &VgpuInstanceCount) - return int(VgpuInstanceCount), ret + 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 (l *library) VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) { + return VgpuTypeId.GetMaxInstancesPerVm() +} + +func (VgpuTypeId nvmlVgpuTypeId) GetMaxInstancesPerVm() (int, Return) { var VgpuInstanceCountPerVm uint32 ret := nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId, &VgpuInstanceCountPerVm) return int(VgpuInstanceCountPerVm), ret } -func (VgpuTypeId VgpuTypeId) GetMaxInstancesPerVm() (int, Return) { - return VgpuTypeGetMaxInstancesPerVm(VgpuTypeId) -} - // nvml.VgpuInstanceGetVmID() func (l *library) VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { return VgpuInstance.GetVmID() @@ -230,7 +230,7 @@ func (l *library) VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Re } func (VgpuInstance nvmlVgpuInstance) GetType() (VgpuTypeId, Return) { - var VgpuTypeId VgpuTypeId + var VgpuTypeId nvmlVgpuTypeId ret := nvmlVgpuInstanceGetType(VgpuInstance, &VgpuTypeId) return VgpuTypeId, ret } @@ -463,15 +463,15 @@ func (VgpuInstance nvmlVgpuInstance) GetMdevUUID() (string, Return) { // nvml.VgpuTypeGetCapabilities() func (l *library) VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) { + return VgpuTypeId.GetCapabilities(Capability) +} + +func (VgpuTypeId nvmlVgpuTypeId) GetCapabilities(Capability VgpuCapability) (bool, Return) { var CapResult uint32 ret := nvmlVgpuTypeGetCapabilities(VgpuTypeId, Capability, &CapResult) return (CapResult != 0), ret } -func (VgpuTypeId VgpuTypeId) GetCapabilities(Capability VgpuCapability) (bool, Return) { - return VgpuTypeGetCapabilities(VgpuTypeId, Capability) -} - // nvml.GetVgpuDriverCapabilities() func (l *library) GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) { var CapResult uint32 From daa1f3f39ae03bf2d498d1cb338f788ce43cfb20 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 11:40:38 +0000 Subject: [PATCH 10/21] Convert GpuInstance into an interface instead of a concrete type Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 1 + pkg/nvml/api.go | 13 +++++++ pkg/nvml/device.go | 90 +++++++++++++++++++++---------------------- pkg/nvml/nvml.go | 80 +++++++++++++++++++------------------- pkg/nvml/types_gen.go | 4 +- 5 files changed, 101 insertions(+), 87 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index 717eb15..4785703 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -67,6 +67,7 @@ TRANSLATOR: - {action: replace, from: "^Device$", to: "nvmlDevice"} - {action: replace, from: "^Unit$", to: "nvmlUnit"} - {action: replace, from: "^EventSet$", to: "nvmlEventSet"} + - {action: replace, from: "^GpuInstance$", to: "nvmlGpuInstance"} - {action: replace, from: "^VgpuInstance$", to: "nvmlVgpuInstance"} - {action: replace, from: "^VgpuTypeId$", to: "nvmlVgpuTypeId"} - {action: replace, from: "^VgpuMetadata", to: "nvmlVgpuMetadata"} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 05692a4..153e76a 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -553,6 +553,19 @@ type Device interface { VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) } +type GpuInstance interface { + Destroy() Return + GetInfo() (GpuInstanceInfo, Return) + GetComputeInstanceProfileInfo(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) + GetComputeInstanceProfileInfoV(Profile int, EngProfile int) ComputeInstanceProfileInfoV + GetComputeInstanceRemainingCapacity(Info *ComputeInstanceProfileInfo) (int, Return) + CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) + GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) + GetComputeInstanceById(Id int) (ComputeInstance, Return) + GetComputeInstancePossiblePlacements(Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) + CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return +} + type EventSet interface { Wait(Timeoutms uint32) (EventData, Return) Free() Return diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index 0fa18cf..806358b 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -2051,9 +2051,9 @@ func (l *library) DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfil func (Device nvmlDevice) CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) { if Info == nil { - return GpuInstance{}, ERROR_INVALID_ARGUMENT + return nil, ERROR_INVALID_ARGUMENT } - var GpuInstance GpuInstance + var GpuInstance nvmlGpuInstance ret := nvmlDeviceCreateGpuInstance(Device, Info.Id, &GpuInstance) return GpuInstance, ret } @@ -2065,20 +2065,20 @@ func (l *library) DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuI func (Device nvmlDevice) CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { if Info == nil { - return GpuInstance{}, ERROR_INVALID_ARGUMENT + return nil, ERROR_INVALID_ARGUMENT } - var GpuInstance GpuInstance + var GpuInstance nvmlGpuInstance ret := nvmlDeviceCreateGpuInstanceWithPlacement(Device, Info.Id, Placement, &GpuInstance) return GpuInstance, ret } // nvml.GpuInstanceDestroy() func (l *library) GpuInstanceDestroy(GpuInstance GpuInstance) Return { - return nvmlGpuInstanceDestroy(GpuInstance) + return GpuInstance.Destroy() } -func (GpuInstance GpuInstance) Destroy() Return { - return GpuInstanceDestroy(GpuInstance) +func (GpuInstance nvmlGpuInstance) Destroy() Return { + return nvmlGpuInstanceDestroy(GpuInstance) } // nvml.DeviceGetGpuInstances() @@ -2091,9 +2091,9 @@ func (Device nvmlDevice) GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuIns return nil, ERROR_INVALID_ARGUMENT } var Count uint32 = Info.InstanceCount - GpuInstances := make([]GpuInstance, Count) + GpuInstances := make([]nvmlGpuInstance, Count) ret := nvmlDeviceGetGpuInstances(Device, Info.Id, &GpuInstances[0], &Count) - return GpuInstances[:Count], ret + return convertSlice[nvmlGpuInstance, GpuInstance](GpuInstances[:Count]), ret } // nvml.DeviceGetGpuInstanceById() @@ -2102,36 +2102,36 @@ func (l *library) DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, } func (Device nvmlDevice) GetGpuInstanceById(Id int) (GpuInstance, Return) { - var GpuInstance GpuInstance + var GpuInstance nvmlGpuInstance ret := nvmlDeviceGetGpuInstanceById(Device, uint32(Id), &GpuInstance) return GpuInstance, ret } // nvml.GpuInstanceGetInfo() func (l *library) GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) { + return GpuInstance.GetInfo() +} + +func (GpuInstance nvmlGpuInstance) GetInfo() (GpuInstanceInfo, Return) { var Info GpuInstanceInfo ret := nvmlGpuInstanceGetInfo(GpuInstance, &Info) return Info, ret } -func (GpuInstance GpuInstance) GetInfo() (GpuInstanceInfo, Return) { - return GpuInstanceGetInfo(GpuInstance) -} - // nvml.GpuInstanceGetComputeInstanceProfileInfo() func (l *library) GpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { + return GpuInstance.GetComputeInstanceProfileInfo(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 } -func (GpuInstance GpuInstance) GetComputeInstanceProfileInfo(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { - return GpuInstanceGetComputeInstanceProfileInfo(GpuInstance, Profile, EngProfile) -} - // nvml.GpuInstanceGetComputeInstanceProfileInfoV() type ComputeInstanceProfileInfoV struct { - gpuInstance GpuInstance + gpuInstance nvmlGpuInstance profile int engProfile int } @@ -2148,15 +2148,19 @@ func (InfoV ComputeInstanceProfileInfoV) V2() (ComputeInstanceProfileInfo_v2, Re } func (l *library) GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile int, EngProfile int) ComputeInstanceProfileInfoV { - return ComputeInstanceProfileInfoV{GpuInstance, Profile, EngProfile} + 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 (l *library) GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (int, Return) { + return GpuInstance.GetComputeInstanceRemainingCapacity(Info) +} + +func (GpuInstance nvmlGpuInstance) GetComputeInstanceRemainingCapacity(Info *ComputeInstanceProfileInfo) (int, Return) { if Info == nil { return 0, ERROR_INVALID_ARGUMENT } @@ -2165,12 +2169,12 @@ func (l *library) GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance Gpu return int(Count), ret } -func (GpuInstance GpuInstance) GetComputeInstanceRemainingCapacity(Info *ComputeInstanceProfileInfo) (int, Return) { - return GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance, Info) -} - // nvml.GpuInstanceCreateComputeInstance() func (l *library) GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { + return GpuInstance.CreateComputeInstance(Info) +} + +func (GpuInstance nvmlGpuInstance) CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { if Info == nil { return ComputeInstance{}, ERROR_INVALID_ARGUMENT } @@ -2179,10 +2183,6 @@ func (l *library) GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info return ComputeInstance, ret } -func (GpuInstance GpuInstance) CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - return GpuInstanceCreateComputeInstance(GpuInstance, Info) -} - // nvml.ComputeInstanceDestroy() func (l *library) ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { return nvmlComputeInstanceDestroy(ComputeInstance) @@ -2194,6 +2194,10 @@ func (ComputeInstance ComputeInstance) Destroy() Return { // nvml.GpuInstanceGetComputeInstances() func (l *library) GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { + return GpuInstance.GetComputeInstances(Info) +} + +func (GpuInstance nvmlGpuInstance) GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { if Info == nil { return nil, ERROR_INVALID_ARGUMENT } @@ -2203,21 +2207,17 @@ func (l *library) GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info * return ComputeInstances[:Count], ret } -func (GpuInstance GpuInstance) GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - return GpuInstanceGetComputeInstances(GpuInstance, Info) -} - // nvml.GpuInstanceGetComputeInstanceById() func (l *library) GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id int) (ComputeInstance, Return) { + return GpuInstance.GetComputeInstanceById(Id) +} + +func (GpuInstance nvmlGpuInstance) GetComputeInstanceById(Id int) (ComputeInstance, Return) { var ComputeInstance ComputeInstance ret := nvmlGpuInstanceGetComputeInstanceById(GpuInstance, uint32(Id), &ComputeInstance) return ComputeInstance, ret } -func (GpuInstance GpuInstance) GetComputeInstanceById(Id int) (ComputeInstance, Return) { - return GpuInstanceGetComputeInstanceById(GpuInstance, Id) -} - // nvml.ComputeInstanceGetInfo() func (l *library) ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) { var Info ComputeInstanceInfo @@ -2597,6 +2597,10 @@ func (Device nvmlDevice) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabiliti // nvml.GpuInstanceGetComputeInstancePossiblePlacements() 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 { @@ -2610,17 +2614,13 @@ func (l *library) GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance Gp return PlacementArray, ret } -func (GpuInstance GpuInstance) GetComputeInstancePossiblePlacements(Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { - return GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, Info) -} - // nvml.GpuInstanceCreateComputeInstanceWithPlacement() func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - return nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, ComputeInstance) + return GpuInstance.CreateComputeInstanceWithPlacement(Info, Placement, ComputeInstance) } -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 *ComputeInstance) Return { + return nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, ComputeInstance) } // nvml.DeviceGetGpuFabricInfo() diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index bc87d6f..4f3d06d 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -2357,36 +2357,36 @@ func nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice nvmlDevice, ProfileId } // nvmlDeviceCreateGpuInstance function as declared in nvml/nvml.h -func nvmlDeviceCreateGpuInstance(nvmlDevice nvmlDevice, ProfileId uint32, GpuInstance *GpuInstance) Return { +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(cnvmlDevice, 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(nvmlDevice nvmlDevice, ProfileId uint32, Placement *GpuInstancePlacement, GpuInstance *GpuInstance) Return { +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(cnvmlDevice, 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(nvmlDevice nvmlDevice, ProfileId uint32, GpuInstances *GpuInstance, Count *uint32) Return { +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 @@ -2397,84 +2397,84 @@ func nvmlDeviceGetGpuInstances(nvmlDevice nvmlDevice, ProfileId uint32, GpuInsta } // nvmlDeviceGetGpuInstanceById function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceById(nvmlDevice nvmlDevice, Id uint32, GpuInstance *GpuInstance) Return { +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(cnvmlDevice, 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 *GpuInstanceInfo) 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, ComputeInstance *ComputeInstance) 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) + __ret := C.nvmlGpuInstanceCreateComputeInstance(cnvmlGpuInstance, cProfileId, cComputeInstance) __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, ComputeInstance *ComputeInstance) 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) + __ret := C.nvmlGpuInstanceCreateComputeInstanceWithPlacement(cnvmlGpuInstance, cProfileId, cPlacement, cComputeInstance) __v := (Return)(__ret) return __v } @@ -2488,22 +2488,22 @@ func nvmlComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { } // 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 *ComputeInstance, 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, ComputeInstance *ComputeInstance) 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) + __ret := C.nvmlGpuInstanceGetComputeInstanceById(cnvmlGpuInstance, cId, cComputeInstance) __v := (Return)(__ret) return __v } diff --git a/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index 079a218..ff3bdd2 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -501,7 +501,7 @@ type GpuInstanceInfo struct { Placement GpuInstancePlacement } -type GpuInstance struct { +type nvmlGpuInstance struct { Handle *_Ctype_struct_nvmlGpuInstance_st } @@ -538,7 +538,7 @@ type ComputeInstanceProfileInfo_v2 struct { type ComputeInstanceInfo struct { Device nvmlDevice - GpuInstance GpuInstance + GpuInstance nvmlGpuInstance Id uint32 ProfileId uint32 Placement ComputeInstancePlacement From 06469702e17e7ff310293915489be1194e17bd23 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 11:52:50 +0000 Subject: [PATCH 11/21] Fix API call for GpuInstanceCreateComputeInstanceWithPlacement A new ComputeInstance should be returned, not passed in by reference Signed-off-by: Kevin Klues --- pkg/nvml/api.go | 4 ++-- pkg/nvml/device.go | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 153e76a..5718ea9 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -279,7 +279,7 @@ type Interface interface { DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) - GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return + GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) DeviceCcuGetStreamState(Device Device) (int, Return) DeviceCcuSetStreamState(Device Device, State int) Return @@ -563,7 +563,7 @@ type GpuInstance interface { GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) GetComputeInstanceById(Id int) (ComputeInstance, Return) GetComputeInstancePossiblePlacements(Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) - CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return + CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) } type EventSet interface { diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index 806358b..bfd3f29 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -2615,12 +2615,14 @@ func (GpuInstance nvmlGpuInstance) GetComputeInstancePossiblePlacements(Info *Co } // nvml.GpuInstanceCreateComputeInstanceWithPlacement() -func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - return GpuInstance.CreateComputeInstanceWithPlacement(Info, Placement, ComputeInstance) +func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) { + return GpuInstance.CreateComputeInstanceWithPlacement(Info, Placement) } -func (GpuInstance nvmlGpuInstance) CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - return nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, ComputeInstance) +func (GpuInstance nvmlGpuInstance) CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) { + var ComputeInstance ComputeInstance + ret := nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, &ComputeInstance) + return ComputeInstance, ret } // nvml.DeviceGetGpuFabricInfo() From fbdfe740b4db18bc343dd97ef14d9cd26fd4b967 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 11:58:25 +0000 Subject: [PATCH 12/21] Convert ComputeInstance into an interface instead of a concrete type Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 1 + pkg/nvml/api.go | 5 +++++ pkg/nvml/device.go | 26 +++++++++++++------------- pkg/nvml/nvml.go | 38 +++++++++++++++++++------------------- pkg/nvml/types_gen.go | 2 +- 5 files changed, 39 insertions(+), 33 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index 4785703..de1dcf9 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -67,6 +67,7 @@ TRANSLATOR: - {action: replace, from: "^Device$", to: "nvmlDevice"} - {action: replace, from: "^Unit$", to: "nvmlUnit"} - {action: replace, from: "^EventSet$", to: "nvmlEventSet"} + - {action: replace, from: "^ComputeInstance$", to: "nvmlComputeInstance"} - {action: replace, from: "^GpuInstance$", to: "nvmlGpuInstance"} - {action: replace, from: "^VgpuInstance$", to: "nvmlVgpuInstance"} - {action: replace, from: "^VgpuTypeId$", to: "nvmlVgpuTypeId"} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 5718ea9..cc2cb55 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -566,6 +566,11 @@ type GpuInstance interface { CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) } +type ComputeInstance interface { + Destroy() Return + GetInfo() (ComputeInstanceInfo, Return) +} + type EventSet interface { Wait(Timeoutms uint32) (EventData, Return) Free() Return diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index bfd3f29..7ad00fd 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -2176,20 +2176,20 @@ func (l *library) GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info func (GpuInstance nvmlGpuInstance) CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { if Info == nil { - return ComputeInstance{}, ERROR_INVALID_ARGUMENT + return nil, ERROR_INVALID_ARGUMENT } - var ComputeInstance ComputeInstance + var ComputeInstance nvmlComputeInstance ret := nvmlGpuInstanceCreateComputeInstance(GpuInstance, Info.Id, &ComputeInstance) return ComputeInstance, ret } // nvml.ComputeInstanceDestroy() func (l *library) ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { - return nvmlComputeInstanceDestroy(ComputeInstance) + return ComputeInstance.Destroy() } -func (ComputeInstance ComputeInstance) Destroy() Return { - return ComputeInstanceDestroy(ComputeInstance) +func (ComputeInstance nvmlComputeInstance) Destroy() Return { + return nvmlComputeInstanceDestroy(ComputeInstance) } // nvml.GpuInstanceGetComputeInstances() @@ -2202,9 +2202,9 @@ func (GpuInstance nvmlGpuInstance) GetComputeInstances(Info *ComputeInstanceProf return nil, ERROR_INVALID_ARGUMENT } var Count uint32 = Info.InstanceCount - ComputeInstances := make([]ComputeInstance, Count) + ComputeInstances := make([]nvmlComputeInstance, Count) ret := nvmlGpuInstanceGetComputeInstances(GpuInstance, Info.Id, &ComputeInstances[0], &Count) - return ComputeInstances[:Count], ret + return convertSlice[nvmlComputeInstance, ComputeInstance](ComputeInstances[:Count]), ret } // nvml.GpuInstanceGetComputeInstanceById() @@ -2213,22 +2213,22 @@ func (l *library) GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id } func (GpuInstance nvmlGpuInstance) GetComputeInstanceById(Id int) (ComputeInstance, Return) { - var ComputeInstance ComputeInstance + var ComputeInstance nvmlComputeInstance ret := nvmlGpuInstanceGetComputeInstanceById(GpuInstance, uint32(Id), &ComputeInstance) return ComputeInstance, ret } // nvml.ComputeInstanceGetInfo() func (l *library) ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) { + return ComputeInstance.GetInfo() +} + +func (ComputeInstance nvmlComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { var Info ComputeInstanceInfo ret := nvmlComputeInstanceGetInfo(ComputeInstance, &Info) return Info, ret } -func (ComputeInstance ComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { - return ComputeInstanceGetInfo(ComputeInstance) -} - // nvml.DeviceIsMigDeviceHandle() func (l *library) DeviceIsMigDeviceHandle(Device Device) (bool, Return) { return Device.IsMigDeviceHandle() @@ -2620,7 +2620,7 @@ func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuI } func (GpuInstance nvmlGpuInstance) CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) { - var ComputeInstance ComputeInstance + var ComputeInstance nvmlComputeInstance ret := nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, &ComputeInstance) return ComputeInstance, ret } diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index 4f3d06d..a5810aa 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -2459,36 +2459,36 @@ func nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance nvmlGpu } // nvmlGpuInstanceCreateComputeInstance function as declared in nvml/nvml.h -func nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, ComputeInstance *ComputeInstance) Return { +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(cnvmlGpuInstance, 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(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { +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(cnvmlGpuInstance, 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(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, ComputeInstances *ComputeInstance, Count *uint32) Return { +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 @@ -2499,20 +2499,20 @@ func nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance nvmlGpuInstance, Profile } // nvmlGpuInstanceGetComputeInstanceById function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance nvmlGpuInstance, Id uint32, ComputeInstance *ComputeInstance) Return { +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(cnvmlGpuInstance, 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 *ComputeInstanceInfo) 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 } @@ -2882,10 +2882,10 @@ func nvmlDeviceGetAttributes_v1(nvmlDevice nvmlDevice, Attributes *DeviceAttribu } // 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 *ComputeInstanceInfo) 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 } diff --git a/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index ff3bdd2..d492537 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -544,7 +544,7 @@ type ComputeInstanceInfo struct { Placement ComputeInstancePlacement } -type ComputeInstance struct { +type nvmlComputeInstance struct { Handle *_Ctype_struct_nvmlComputeInstance_st } From 630d5a661515a2f325d6c1e50920f82a3e3a071d Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 12:09:19 +0000 Subject: [PATCH 13/21] Fix API call for GpmSampleAlloc A new GpmSample should be returned, not passed in by reference. As part of this, add methods to hang of of the GpmSample type (which were missing previously). Signed-off-by: Kevin Klues --- pkg/nvml/api.go | 2 +- pkg/nvml/gpm.go | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index cc2cb55..e7ca6cc 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -292,7 +292,7 @@ type Interface interface { GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return GpmSampleFree(GpmSample GpmSample) Return - GpmSampleAlloc(GpmSample *GpmSample) Return + GpmSampleAlloc() (GpmSample, Return) GpmSampleGet(Device Device, GpmSample GpmSample) Return GpmQueryDeviceSupportV(Device Device) GpmSupportV GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) diff --git a/pkg/nvml/gpm.go b/pkg/nvml/gpm.go index 2d825f0..a52e426 100644 --- a/pkg/nvml/gpm.go +++ b/pkg/nvml/gpm.go @@ -37,18 +37,28 @@ func (l *library) GpmSampleFree(GpmSample GpmSample) Return { return nvmlGpmSampleFree(GpmSample) } +func (GpmSample GpmSample) Free() Return { + return GpmSampleFree(GpmSample) +} + // nvml.GpmSampleAlloc() -func (l *library) GpmSampleAlloc(GpmSample *GpmSample) Return { - return nvmlGpmSampleAlloc(GpmSample) +func (l *library) GpmSampleAlloc() (GpmSample, Return) { + var GpmSample GpmSample + ret := nvmlGpmSampleAlloc(&GpmSample) + return GpmSample, ret } // nvml.GpmSampleGet() func (l *library) GpmSampleGet(Device Device, GpmSample GpmSample) Return { - return Device.GpmSampleGet(GpmSample) + return GpmSample.Get(Device) } func (Device nvmlDevice) GpmSampleGet(GpmSample GpmSample) Return { - return nvmlGpmSampleGet(Device, GpmSample) + return GpmSample.Get(Device) +} + +func (GpmSample GpmSample) Get(Device Device) Return { + return nvmlGpmSampleGet(Device.(nvmlDevice), GpmSample) } // nvml.GpmQueryDeviceSupport() @@ -84,9 +94,13 @@ func (Device nvmlDevice) GpmQueryDeviceSupport() (GpmSupport, Return) { // nvml.GpmMigSampleGet() func (l *library) GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return { - return Device.GpmMigSampleGet(GpuInstanceId, GpmSample) + return GpmSample.MigGet(Device, GpuInstanceId) } func (Device nvmlDevice) GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) Return { - return nvmlGpmMigSampleGet(Device, uint32(GpuInstanceId), GpmSample) + return GpmSample.MigGet(Device, GpuInstanceId) +} + +func (GpmSample GpmSample) MigGet(Device Device, GpuInstanceId int) Return { + return nvmlGpmMigSampleGet(Device.(nvmlDevice), uint32(GpuInstanceId), GpmSample) } From 80b40648b87d6c0be0268e4f34c0c2d540102099 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 12:15:26 +0000 Subject: [PATCH 14/21] Convert GpmSample into an interface instead of a concrete type Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 1 + pkg/nvml/api.go | 6 ++++++ pkg/nvml/gpm.go | 12 ++++++------ pkg/nvml/nvml.go | 24 ++++++++++++------------ pkg/nvml/types_gen.go | 6 +++--- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index de1dcf9..e375797 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -67,6 +67,7 @@ TRANSLATOR: - {action: replace, from: "^Device$", to: "nvmlDevice"} - {action: replace, from: "^Unit$", to: "nvmlUnit"} - {action: replace, from: "^EventSet$", to: "nvmlEventSet"} + - {action: replace, from: "^GpmSample$", to: "nvmlGpmSample"} - {action: replace, from: "^ComputeInstance$", to: "nvmlComputeInstance"} - {action: replace, from: "^GpuInstance$", to: "nvmlGpuInstance"} - {action: replace, from: "^VgpuInstance$", to: "nvmlVgpuInstance"} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index e7ca6cc..1398213 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -576,6 +576,12 @@ type EventSet interface { Free() Return } +type GpmSample interface { + Free() Return + Get(Device Device) Return + MigGet(Device Device, GpuInstanceId int) Return +} + type Unit interface { GetUnitInfo() (UnitInfo, Return) GetLedState() (LedState, Return) diff --git a/pkg/nvml/gpm.go b/pkg/nvml/gpm.go index a52e426..a0a74cf 100644 --- a/pkg/nvml/gpm.go +++ b/pkg/nvml/gpm.go @@ -34,16 +34,16 @@ func (l *library) GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { // nvml.GpmSampleFree() func (l *library) GpmSampleFree(GpmSample GpmSample) Return { - return nvmlGpmSampleFree(GpmSample) + return GpmSample.Free() } -func (GpmSample GpmSample) Free() Return { - return GpmSampleFree(GpmSample) +func (GpmSample nvmlGpmSample) Free() Return { + return nvmlGpmSampleFree(GpmSample) } // nvml.GpmSampleAlloc() func (l *library) GpmSampleAlloc() (GpmSample, Return) { - var GpmSample GpmSample + var GpmSample nvmlGpmSample ret := nvmlGpmSampleAlloc(&GpmSample) return GpmSample, ret } @@ -57,7 +57,7 @@ func (Device nvmlDevice) GpmSampleGet(GpmSample GpmSample) Return { return GpmSample.Get(Device) } -func (GpmSample GpmSample) Get(Device Device) Return { +func (GpmSample nvmlGpmSample) Get(Device Device) Return { return nvmlGpmSampleGet(Device.(nvmlDevice), GpmSample) } @@ -101,6 +101,6 @@ func (Device nvmlDevice) GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) return GpmSample.MigGet(Device, GpuInstanceId) } -func (GpmSample GpmSample) MigGet(Device Device, GpuInstanceId int) Return { +func (GpmSample nvmlGpmSample) MigGet(Device Device, GpuInstanceId int) Return { return nvmlGpmMigSampleGet(Device.(nvmlDevice), uint32(GpuInstanceId), GpmSample) } diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index a5810aa..2cdcf53 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -2696,36 +2696,36 @@ 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(nvmlDevice nvmlDevice, GpmSample GpmSample) Return { +func nvmlGpmSampleGet(nvmlDevice nvmlDevice, nvmlGpmSample nvmlGpmSample) Return { cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown - cGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmSampleGet(cnvmlDevice, cGpmSample) + 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(nvmlDevice nvmlDevice, GpuInstanceId uint32, GpmSample GpmSample) Return { +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(cnvmlDevice, cGpuInstanceId, cGpmSample) + cnvmlGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmMigSampleGet(cnvmlDevice, cGpuInstanceId, cnvmlGpmSample) __v := (Return)(__ret) return __v } diff --git a/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index d492537..167fb79 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -548,7 +548,7 @@ type nvmlComputeInstance struct { Handle *_Ctype_struct_nvmlComputeInstance_st } -type GpmSample struct { +type nvmlGpmSample struct { Handle *_Ctype_struct_nvmlGpmSample_st } @@ -568,8 +568,8 @@ type GpmMetric struct { type GpmMetricsGetType struct { Version uint32 NumMetrics uint32 - Sample1 GpmSample - Sample2 GpmSample + Sample1 nvmlGpmSample + Sample2 nvmlGpmSample Metrics [98]GpmMetric } From 3d3e863147d6f9fa81866ef9502dae27c7f2bebf Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 21:53:11 +0000 Subject: [PATCH 15/21] Convert all uppercase local variables to lowercase Signed-off-by: Kevin Klues --- pkg/nvml/api.go | 761 ++++++------ pkg/nvml/device.go | 2678 ++++++++++++++++++++--------------------- pkg/nvml/event_set.go | 20 +- pkg/nvml/gpm.go | 86 +- pkg/nvml/init.go | 4 +- pkg/nvml/system.go | 32 +- pkg/nvml/unit.go | 92 +- pkg/nvml/vgpu.go | 474 ++++---- 8 files changed, 2075 insertions(+), 2072 deletions(-) diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 1398213..ce2b7c7 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -55,7 +55,7 @@ type Interface interface { GetLibrary() Library // Init API Init() Return - InitWithFlags(Flags uint32) Return + InitWithFlags(flags uint32) Return Shutdown() Return ErrorString(r Return) string // System API @@ -63,290 +63,293 @@ type Interface interface { SystemGetNVMLVersion() (string, Return) SystemGetCudaDriverVersion() (int, Return) SystemGetCudaDriverVersion_v2() (int, Return) - SystemGetProcessName(Pid int) (string, Return) + SystemGetProcessName(pid int) (string, Return) SystemGetHicVersion() ([]HwbcEntry, Return) - SystemGetTopologyGpuSet(CpuNumber int) ([]Device, Return) + SystemGetTopologyGpuSet(cpuNumber int) ([]Device, Return) // Device API DeviceGetCount() (int, Return) - DeviceGetHandleByIndex(Index int) (Device, Return) - DeviceGetHandleBySerial(Serial string) (Device, Return) - DeviceGetHandleByUUID(Uuid string) (Device, Return) - DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) - DeviceGetName(Device Device) (string, Return) - DeviceGetBrand(Device Device) (BrandType, Return) - DeviceGetIndex(Device Device) (int, Return) - DeviceGetSerial(Device Device) (string, Return) - DeviceGetCpuAffinity(Device Device, NumCPUs int) ([]uint, Return) - DeviceSetCpuAffinity(Device Device) Return - DeviceClearCpuAffinity(Device Device) Return - DeviceGetMemoryAffinity(Device Device, NumNodes int, Scope AffinityScope) ([]uint, Return) - DeviceGetCpuAffinityWithinScope(Device Device, NumCPUs int, Scope AffinityScope) ([]uint, Return) - DeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device) (GpuTopologyLevel, Return) - DeviceGetTopologyNearestGpus(device Device, Level GpuTopologyLevel) ([]Device, Return) - DeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) - DeviceGetUUID(Device Device) (string, Return) - DeviceGetMinorNumber(Device Device) (int, Return) - DeviceGetBoardPartNumber(Device Device) (string, Return) - DeviceGetInforomVersion(Device Device, Object InforomObject) (string, Return) - DeviceGetInforomImageVersion(Device Device) (string, Return) - DeviceGetInforomConfigurationChecksum(Device Device) (uint32, Return) - DeviceValidateInforom(Device Device) Return - DeviceGetDisplayMode(Device Device) (EnableState, Return) - DeviceGetDisplayActive(Device Device) (EnableState, Return) - DeviceGetPersistenceMode(Device Device) (EnableState, Return) - DeviceGetPciInfo(Device Device) (PciInfo, Return) - DeviceGetMaxPcieLinkGeneration(Device Device) (int, Return) - DeviceGetMaxPcieLinkWidth(Device Device) (int, Return) - DeviceGetCurrPcieLinkGeneration(Device Device) (int, Return) - DeviceGetCurrPcieLinkWidth(Device Device) (int, Return) - DeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter) (uint32, Return) - DeviceGetPcieReplayCounter(Device Device) (int, Return) - DeviceGetClockInfo(Device Device, _type ClockType) (uint32, Return) - DeviceGetMaxClockInfo(Device Device, _type ClockType) (uint32, Return) - DeviceGetApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) - DeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) - DeviceResetApplicationsClocks(Device Device) Return - DeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId) (uint32, Return) - DeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType) (uint32, Return) - DeviceGetSupportedMemoryClocks(Device Device) (int, uint32, Return) - DeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz int) (int, uint32, Return) - DeviceGetAutoBoostedClocksEnabled(Device Device) (EnableState, EnableState, Return) - DeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return - DeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return - DeviceGetFanSpeed(Device Device) (uint32, Return) - DeviceGetFanSpeed_v2(Device Device, Fan int) (uint32, Return) - DeviceGetNumFans(Device Device) (int, Return) - DeviceGetTemperature(Device Device, SensorType TemperatureSensors) (uint32, Return) - DeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds) (uint32, Return) - DeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp int) Return - DeviceGetPerformanceState(Device Device) (Pstates, Return) - DeviceGetCurrentClocksThrottleReasons(Device Device) (uint64, Return) - DeviceGetSupportedClocksThrottleReasons(Device Device) (uint64, Return) - DeviceGetPowerState(Device Device) (Pstates, Return) - DeviceGetPowerManagementMode(Device Device) (EnableState, Return) - DeviceGetPowerManagementLimit(Device Device) (uint32, Return) - DeviceGetPowerManagementLimitConstraints(Device Device) (uint32, uint32, Return) - DeviceGetPowerManagementDefaultLimit(Device Device) (uint32, Return) - DeviceGetPowerUsage(Device Device) (uint32, Return) - DeviceGetTotalEnergyConsumption(Device Device) (uint64, Return) - DeviceGetEnforcedPowerLimit(Device Device) (uint32, Return) - DeviceGetGpuOperationMode(Device Device) (GpuOperationMode, GpuOperationMode, Return) - DeviceGetMemoryInfo(Device Device) (Memory, Return) - DeviceGetMemoryInfo_v2(Device Device) (Memory_v2, Return) - DeviceGetComputeMode(Device Device) (ComputeMode, Return) - DeviceGetCudaComputeCapability(Device Device) (int, int, Return) - DeviceGetEccMode(Device Device) (EnableState, EnableState, Return) - DeviceGetBoardId(Device Device) (uint32, Return) - DeviceGetMultiGpuBoard(Device Device) (int, Return) - DeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) - DeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) - DeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) - DeviceGetUtilizationRates(Device Device) (Utilization, Return) - DeviceGetEncoderUtilization(Device Device) (uint32, uint32, Return) - DeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType) (int, Return) - DeviceGetEncoderStats(Device Device) (int, uint32, uint32, Return) - DeviceGetEncoderSessions(Device Device) ([]EncoderSessionInfo, Return) - DeviceGetDecoderUtilization(Device Device) (uint32, uint32, Return) - DeviceGetFBCStats(Device Device) (FBCStats, Return) - DeviceGetFBCSessions(Device Device) ([]FBCSessionInfo, Return) - DeviceGetDriverModel(Device Device) (DriverModel, DriverModel, Return) - DeviceGetVbiosVersion(Device Device) (string, Return) - DeviceGetBridgeChipInfo(Device Device) (BridgeChipHierarchy, Return) - DeviceOnSameBoard(Device1 Device, Device2 Device) (int, Return) - DeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI) (EnableState, Return) - DeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) - DeviceGetBAR1MemoryInfo(Device Device) (BAR1Memory, Return) - DeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType) (ViolationTime, Return) - DeviceGetIrqNum(Device Device) (int, Return) - DeviceGetNumGpuCores(Device Device) (int, Return) - DeviceGetPowerSource(Device Device) (PowerSource, Return) - DeviceGetMemoryBusWidth(Device Device) (uint32, Return) - DeviceGetPcieLinkMaxSpeed(Device Device) (uint32, Return) - DeviceGetAdaptiveClockInfoStatus(Device Device) (uint32, Return) - DeviceGetAccountingMode(Device Device) (EnableState, Return) - DeviceGetAccountingStats(Device Device, Pid uint32) (AccountingStats, Return) - DeviceGetAccountingPids(Device Device) ([]int, Return) - DeviceGetAccountingBufferSize(Device Device) (int, Return) - DeviceGetRetiredPages(Device Device, Cause PageRetirementCause) ([]uint64, Return) - DeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause) ([]uint64, []uint64, Return) - DeviceGetRetiredPagesPendingStatus(Device Device) (EnableState, Return) - DeviceSetPersistenceMode(Device Device, Mode EnableState) Return - DeviceSetComputeMode(Device Device, Mode ComputeMode) Return - DeviceSetEccMode(Device Device, Ecc EnableState) Return - DeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return - DeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return - DeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return - DeviceResetGpuLockedClocks(Device Device) Return - DeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return - DeviceResetMemoryLockedClocks(Device Device) Return - DeviceGetClkMonStatus(Device Device) (ClkMonStatus, Return) - DeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return - DeviceSetPowerManagementLimit(Device Device, Limit uint32) Return - DeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return - DeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return - DeviceSetAccountingMode(Device Device, Mode EnableState) Return - DeviceClearAccountingPids(Device Device) Return - DeviceGetNvLinkState(Device Device, Link int) (EnableState, Return) - DeviceGetNvLinkVersion(Device Device, Link int) (uint32, Return) - DeviceGetNvLinkCapability(Device Device, Link int, Capability NvLinkCapability) (uint32, Return) - DeviceGetNvLinkRemotePciInfo(Device Device, Link int) (PciInfo, Return) - DeviceGetNvLinkErrorCounter(Device Device, Link int, Counter NvLinkErrorCounter) (uint64, Return) - DeviceResetNvLinkErrorCounters(Device Device, Link int) Return - DeviceSetNvLinkUtilizationControl(Device Device, Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return - DeviceGetNvLinkUtilizationControl(Device Device, Link int, Counter int) (NvLinkUtilizationControl, Return) - DeviceGetNvLinkUtilizationCounter(Device Device, Link int, Counter int) (uint64, uint64, Return) - DeviceFreezeNvLinkUtilizationCounter(Device Device, Link int, Counter int, Freeze EnableState) Return - DeviceResetNvLinkUtilizationCounter(Device Device, Link int, Counter int) Return - DeviceGetNvLinkRemoteDeviceType(Device Device, Link int) (IntNvLinkDeviceType, Return) - DeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return - DeviceGetSupportedEventTypes(Device Device) (uint64, Return) - DeviceModifyDrainState(PciInfo *PciInfo, NewState EnableState) Return - DeviceQueryDrainState(PciInfo *PciInfo) (EnableState, Return) - DeviceRemoveGpu(PciInfo *PciInfo) Return - DeviceRemoveGpu_v2(PciInfo *PciInfo, GpuState DetachGpuState, LinkState PcieLinkState) Return + DeviceGetHandleByIndex(index int) (Device, Return) + DeviceGetHandleBySerial(serial string) (Device, Return) + DeviceGetHandleByUUID(uuid string) (Device, Return) + DeviceGetHandleByPciBusId(pciBusId string) (Device, Return) + DeviceGetName(device Device) (string, Return) + DeviceGetBrand(device Device) (BrandType, Return) + DeviceGetIndex(device Device) (int, Return) + DeviceGetSerial(device Device) (string, Return) + DeviceGetCpuAffinity(device Device, numCPUs int) ([]uint, Return) + DeviceSetCpuAffinity(device Device) Return + DeviceClearCpuAffinity(device Device) Return + DeviceGetMemoryAffinity(device Device, numNodes int, scope AffinityScope) ([]uint, Return) + DeviceGetCpuAffinityWithinScope(device Device, numCPUs int, scope AffinityScope) ([]uint, Return) + DeviceGetTopologyCommonAncestor(device1 Device, device2 Device) (GpuTopologyLevel, Return) + DeviceGetTopologyNearestGpus(device Device, level GpuTopologyLevel) ([]Device, Return) + DeviceGetP2PStatus(device1 Device, device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) + DeviceGetUUID(device Device) (string, Return) + DeviceGetMinorNumber(device Device) (int, Return) + DeviceGetBoardPartNumber(device Device) (string, Return) + DeviceGetInforomVersion(device Device, object InforomObject) (string, Return) + DeviceGetInforomImageVersion(device Device) (string, Return) + DeviceGetInforomConfigurationChecksum(device Device) (uint32, Return) + DeviceValidateInforom(device Device) Return + DeviceGetDisplayMode(device Device) (EnableState, Return) + DeviceGetDisplayActive(device Device) (EnableState, Return) + DeviceGetPersistenceMode(device Device) (EnableState, Return) + DeviceGetPciInfo(device Device) (PciInfo, Return) + DeviceGetMaxPcieLinkGeneration(device Device) (int, Return) + DeviceGetMaxPcieLinkWidth(device Device) (int, Return) + DeviceGetCurrPcieLinkGeneration(device Device) (int, Return) + DeviceGetCurrPcieLinkWidth(device Device) (int, Return) + DeviceGetPcieThroughput(device Device, counter PcieUtilCounter) (uint32, Return) + DeviceGetPcieReplayCounter(device Device) (int, Return) + DeviceGetClockInfo(device Device, clockType ClockType) (uint32, Return) + DeviceGetMaxClockInfo(device Device, clockType ClockType) (uint32, Return) + DeviceGetApplicationsClock(device Device, clockType ClockType) (uint32, Return) + DeviceGetDefaultApplicationsClock(device Device, clockType ClockType) (uint32, Return) + DeviceResetApplicationsClocks(device Device) Return + DeviceGetClock(device Device, clockType ClockType, clockId ClockId) (uint32, Return) + DeviceGetMaxCustomerBoostClock(device Device, clockType ClockType) (uint32, Return) + DeviceGetSupportedMemoryClocks(device Device) (int, uint32, Return) + DeviceGetSupportedGraphicsClocks(device Device, memoryClockMHz int) (int, uint32, Return) + DeviceGetAutoBoostedClocksEnabled(device Device) (EnableState, EnableState, Return) + DeviceSetAutoBoostedClocksEnabled(device Device, enabled EnableState) Return + DeviceSetDefaultAutoBoostedClocksEnabled(device Device, enabled EnableState, flags uint32) Return + DeviceGetFanSpeed(device Device) (uint32, Return) + DeviceGetFanSpeed_v2(device Device, fan int) (uint32, Return) + DeviceGetNumFans(device Device) (int, Return) + DeviceGetTemperature(device Device, sensorType TemperatureSensors) (uint32, Return) + DeviceGetTemperatureThreshold(device Device, thresholdType TemperatureThresholds) (uint32, Return) + DeviceSetTemperatureThreshold(device Device, thresholdType TemperatureThresholds, temp int) Return + DeviceGetPerformanceState(device Device) (Pstates, Return) + DeviceGetCurrentClocksThrottleReasons(device Device) (uint64, Return) + DeviceGetSupportedClocksThrottleReasons(device Device) (uint64, Return) + DeviceGetPowerState(device Device) (Pstates, Return) + DeviceGetPowerManagementMode(device Device) (EnableState, Return) + DeviceGetPowerManagementLimit(device Device) (uint32, Return) + DeviceGetPowerManagementLimitConstraints(device Device) (uint32, uint32, Return) + DeviceGetPowerManagementDefaultLimit(device Device) (uint32, Return) + DeviceGetPowerUsage(device Device) (uint32, Return) + DeviceGetTotalEnergyConsumption(device Device) (uint64, Return) + DeviceGetEnforcedPowerLimit(device Device) (uint32, Return) + DeviceGetGpuOperationMode(device Device) (GpuOperationMode, GpuOperationMode, Return) + DeviceGetMemoryInfo(device Device) (Memory, Return) + DeviceGetMemoryInfo_v2(device Device) (Memory_v2, Return) + DeviceGetComputeMode(device Device) (ComputeMode, Return) + DeviceGetCudaComputeCapability(device Device) (int, int, Return) + DeviceGetEccMode(device Device) (EnableState, EnableState, Return) + DeviceGetBoardId(device Device) (uint32, Return) + DeviceGetMultiGpuBoard(device Device) (int, Return) + DeviceGetTotalEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) + DeviceGetDetailedEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) + DeviceGetMemoryErrorCounter(device Device, errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) + DeviceGetUtilizationRates(device Device) (Utilization, Return) + DeviceGetEncoderUtilization(device Device) (uint32, uint32, Return) + DeviceGetEncoderCapacity(device Device, encoderQueryType EncoderType) (int, Return) + DeviceGetEncoderStats(device Device) (int, uint32, uint32, Return) + DeviceGetEncoderSessions(device Device) ([]EncoderSessionInfo, Return) + DeviceGetDecoderUtilization(device Device) (uint32, uint32, Return) + DeviceGetFBCStats(device Device) (FBCStats, Return) + DeviceGetFBCSessions(device Device) ([]FBCSessionInfo, Return) + DeviceGetDriverModel(device Device) (DriverModel, DriverModel, Return) + DeviceGetVbiosVersion(device Device) (string, Return) + DeviceGetBridgeChipInfo(device Device) (BridgeChipHierarchy, Return) + DeviceGetComputeRunningProcesses(device Device) ([]ProcessInfo, Return) + DeviceGetGraphicsRunningProcesses(device Device) ([]ProcessInfo, Return) + DeviceGetMPSComputeRunningProcesses(device Device) ([]ProcessInfo, Return) + DeviceOnSameBoard(device1 Device, device2 Device) (int, Return) + DeviceGetAPIRestriction(device Device, apiType RestrictedAPI) (EnableState, Return) + DeviceGetSamples(device Device, samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) + DeviceGetBAR1MemoryInfo(device Device) (BAR1Memory, Return) + DeviceGetViolationStatus(device Device, perfPolicyType PerfPolicyType) (ViolationTime, Return) + DeviceGetIrqNum(device Device) (int, Return) + DeviceGetNumGpuCores(device Device) (int, Return) + DeviceGetPowerSource(device Device) (PowerSource, Return) + DeviceGetMemoryBusWidth(device Device) (uint32, Return) + DeviceGetPcieLinkMaxSpeed(device Device) (uint32, Return) + DeviceGetAdaptiveClockInfoStatus(device Device) (uint32, Return) + DeviceGetAccountingMode(device Device) (EnableState, Return) + DeviceGetAccountingStats(device Device, pid uint32) (AccountingStats, Return) + DeviceGetAccountingPids(device Device) ([]int, Return) + DeviceGetAccountingBufferSize(device Device) (int, Return) + DeviceGetRetiredPages(device Device, cause PageRetirementCause) ([]uint64, Return) + DeviceGetRetiredPages_v2(device Device, cause PageRetirementCause) ([]uint64, []uint64, Return) + DeviceGetRetiredPagesPendingStatus(device Device) (EnableState, Return) + DeviceSetPersistenceMode(device Device, mode EnableState) Return + DeviceSetComputeMode(device Device, mode ComputeMode) Return + DeviceSetEccMode(device Device, ecc EnableState) Return + DeviceClearEccErrorCounts(device Device, counterType EccCounterType) Return + DeviceSetDriverModel(device Device, driverModel DriverModel, flags uint32) Return + DeviceSetGpuLockedClocks(device Device, minGpuClockMHz uint32, maxGpuClockMHz uint32) Return + DeviceResetGpuLockedClocks(device Device) Return + DeviceSetMemoryLockedClocks(device Device, minMemClockMHz uint32, maxMemClockMHz uint32) Return + DeviceResetMemoryLockedClocks(device Device) Return + DeviceGetClkMonStatus(device Device) (ClkMonStatus, Return) + DeviceSetApplicationsClocks(device Device, memClockMHz uint32, graphicsClockMHz uint32) Return + DeviceSetPowerManagementLimit(device Device, limit uint32) Return + DeviceSetGpuOperationMode(device Device, mode GpuOperationMode) Return + DeviceSetAPIRestriction(device Device, apiType RestrictedAPI, isRestricted EnableState) Return + DeviceSetAccountingMode(device Device, mode EnableState) Return + DeviceClearAccountingPids(device Device) Return + DeviceGetNvLinkState(device Device, link int) (EnableState, Return) + DeviceGetNvLinkVersion(device Device, link int) (uint32, Return) + DeviceGetNvLinkCapability(device Device, link int, capability NvLinkCapability) (uint32, Return) + DeviceGetNvLinkRemotePciInfo(device Device, link int) (PciInfo, Return) + DeviceGetNvLinkErrorCounter(device Device, link int, counter NvLinkErrorCounter) (uint64, Return) + DeviceResetNvLinkErrorCounters(device Device, link int) Return + DeviceSetNvLinkUtilizationControl(device Device, link int, counter int, control *NvLinkUtilizationControl, reset bool) Return + DeviceGetNvLinkUtilizationControl(device Device, link int, counter int) (NvLinkUtilizationControl, Return) + DeviceGetNvLinkUtilizationCounter(device Device, link int, counter int) (uint64, uint64, Return) + DeviceFreezeNvLinkUtilizationCounter(device Device, link int, counter int, freeze EnableState) Return + DeviceResetNvLinkUtilizationCounter(device Device, link int, counter int) Return + DeviceGetNvLinkRemoteDeviceType(device Device, link int) (IntNvLinkDeviceType, Return) + DeviceRegisterEvents(device Device, eventTypes uint64, set EventSet) Return + DeviceGetSupportedEventTypes(device Device) (uint64, Return) + DeviceModifyDrainState(pciInfo *PciInfo, newState EnableState) Return + DeviceQueryDrainState(pciInfo *PciInfo) (EnableState, Return) + DeviceRemoveGpu(pciInfo *PciInfo) Return + DeviceRemoveGpu_v2(pciInfo *PciInfo, gpuState DetachGpuState, linkState PcieLinkState) Return DeviceDiscoverGpus() (PciInfo, Return) - DeviceGetFieldValues(Device Device, Values []FieldValue) Return - DeviceGetVirtualizationMode(Device Device) (GpuVirtualizationMode, Return) - DeviceGetHostVgpuMode(Device Device) (HostVgpuMode, Return) - DeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return - DeviceGetGridLicensableFeatures(Device Device) (GridLicensableFeatures, Return) - DeviceGetProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) - DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) - DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) - DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) - DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return) - DeviceGetPgpuMetadataString(Device Device) (string, Return) - DeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) - DeviceGetAttributes(Device Device) (DeviceAttributes, Return) - DeviceGetRemappedRows(Device Device) (int, int, bool, bool, Return) - DeviceGetRowRemapperHistogram(Device Device) (RowRemapperHistogramValues, Return) - DeviceGetArchitecture(Device Device) (DeviceArchitecture, Return) - DeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) + DeviceGetFieldValues(device Device, values []FieldValue) Return + DeviceGetVirtualizationMode(device Device) (GpuVirtualizationMode, Return) + DeviceGetHostVgpuMode(device Device) (HostVgpuMode, Return) + DeviceSetVirtualizationMode(device Device, virtualMode GpuVirtualizationMode) Return + DeviceGetGridLicensableFeatures(device Device) (GridLicensableFeatures, Return) + DeviceGetProcessUtilization(device Device, lastSeenTimestamp uint64) ([]ProcessUtilizationSample, Return) + DeviceGetSupportedVgpus(device Device) ([]VgpuTypeId, Return) + DeviceGetCreatableVgpus(device Device) ([]VgpuTypeId, Return) + DeviceGetActiveVgpus(device Device) ([]VgpuInstance, Return) + DeviceGetVgpuMetadata(device Device) (VgpuPgpuMetadata, Return) + DeviceGetPgpuMetadataString(device Device) (string, Return) + DeviceGetVgpuUtilization(device Device, lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) + DeviceGetAttributes(device Device) (DeviceAttributes, Return) + DeviceGetRemappedRows(device Device) (int, int, bool, bool, Return) + DeviceGetRowRemapperHistogram(device Device) (RowRemapperHistogramValues, Return) + DeviceGetArchitecture(device Device) (DeviceArchitecture, Return) + DeviceGetVgpuProcessUtilization(device Device, lastSeenTimestamp uint64) ([]VgpuProcessUtilizationSample, Return) GetExcludedDeviceCount() (int, Return) - GetExcludedDeviceInfoByIndex(Index int) (ExcludedDeviceInfo, Return) - DeviceSetMigMode(Device Device, Mode int) (Return, Return) - DeviceGetMigMode(Device Device) (int, int, Return) - DeviceGetGpuInstanceProfileInfo(Device Device, Profile int) (GpuInstanceProfileInfo, Return) - DeviceGetGpuInstanceProfileInfoV(Device Device, Profile int) GpuInstanceProfileInfoV - DeviceGetGpuInstancePossiblePlacements(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) - DeviceGetGpuInstanceRemainingCapacity(Device Device, Info *GpuInstanceProfileInfo) (int, Return) - DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfileInfo) (GpuInstance, Return) - DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) - GpuInstanceDestroy(GpuInstance GpuInstance) Return - DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) - DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, Return) - GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) - GpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) - GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile int, EngProfile int) ComputeInstanceProfileInfoV - GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (int, Return) - GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) - ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return - GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) - GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id int) (ComputeInstance, Return) - ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) - DeviceIsMigDeviceHandle(Device Device) (bool, Return) - DeviceGetGpuInstanceId(Device Device) (int, Return) - DeviceGetComputeInstanceId(Device Device) (int, Return) - DeviceGetMaxMigDeviceCount(Device Device) (int, Return) - DeviceGetMigDeviceHandleByIndex(device Device, Index int) (Device, Return) - DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device) (Device, Return) - DeviceGetBusType(Device Device) (BusType, Return) - DeviceSetDefaultFanSpeed_v2(Device Device, Fan int) Return - DeviceGetMinMaxFanSpeed(Device Device) (int, int, Return) - DeviceGetThermalSettings(Device Device, SensorIndex uint32) (GpuThermalSettings, Return) - DeviceGetDefaultEccMode(Device Device) (EnableState, Return) - DeviceGetPcieSpeed(Device Device) (int, Return) - DeviceGetGspFirmwareVersion(Device Device) (string, Return) - DeviceGetGspFirmwareMode(Device Device) (bool, bool, Return) - DeviceGetDynamicPstatesInfo(Device Device) (GpuDynamicPstatesInfo, Return) - DeviceSetFanSpeed_v2(Device Device, Fan int, Speed int) Return - DeviceGetGpcClkVfOffset(Device Device) (int, Return) - DeviceSetGpcClkVfOffset(Device Device, Offset int) Return - DeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates) (uint32, uint32, Return) - DeviceGetSupportedPerformanceStates(Device Device) ([]Pstates, Return) - DeviceGetTargetFanSpeed(Device Device, Fan int) (int, Return) - DeviceGetMemClkVfOffset(Device Device) (int, Return) - DeviceSetMemClkVfOffset(Device Device, Offset int) Return - DeviceGetGpcClkMinMaxVfOffset(Device Device) (int, int, Return) - DeviceGetMemClkMinMaxVfOffset(Device Device) (int, int, Return) - DeviceGetGpuMaxPcieLinkGeneration(Device Device) (int, Return) - DeviceGetFanControlPolicy_v2(Device Device, Fan int) (FanControlPolicy, Return) - DeviceSetFanControlPolicy(Device Device, Fan int, Policy FanControlPolicy) Return - DeviceClearFieldValues(Device Device, Values []FieldValue) Return - DeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability) (bool, Return) - DeviceGetVgpuSchedulerLog(Device Device) (VgpuSchedulerLog, Return) - DeviceGetVgpuSchedulerState(Device Device) (VgpuSchedulerGetState, Return) - DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return - DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) - GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) - GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) - DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) - DeviceCcuGetStreamState(Device Device) (int, Return) - DeviceCcuSetStreamState(Device Device, State int) Return - DeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return + GetExcludedDeviceInfoByIndex(index int) (ExcludedDeviceInfo, Return) + DeviceSetMigMode(device Device, mode int) (Return, Return) + DeviceGetMigMode(device Device) (int, int, Return) + DeviceGetGpuInstanceProfileInfo(device Device, profile int) (GpuInstanceProfileInfo, Return) + DeviceGetGpuInstanceProfileInfoV(device Device, profile int) GpuInstanceProfileInfoV + DeviceGetGpuInstancePossiblePlacements(device Device, info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) + DeviceGetGpuInstanceRemainingCapacity(device Device, info *GpuInstanceProfileInfo) (int, Return) + DeviceCreateGpuInstance(device Device, info *GpuInstanceProfileInfo) (GpuInstance, Return) + DeviceCreateGpuInstanceWithPlacement(device Device, info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) + GpuInstanceDestroy(gpuInstance GpuInstance) Return + DeviceGetGpuInstances(device Device, info *GpuInstanceProfileInfo) ([]GpuInstance, Return) + DeviceGetGpuInstanceById(device Device, id int) (GpuInstance, Return) + GpuInstanceGetInfo(gpuInstance GpuInstance) (GpuInstanceInfo, Return) + GpuInstanceGetComputeInstanceProfileInfo(gpuInstance GpuInstance, profile int, engProfile int) (ComputeInstanceProfileInfo, Return) + GpuInstanceGetComputeInstanceProfileInfoV(gpuInstance GpuInstance, profile int, engProfile int) ComputeInstanceProfileInfoV + GpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (int, Return) + GpuInstanceCreateComputeInstance(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (ComputeInstance, Return) + ComputeInstanceDestroy(computeInstance ComputeInstance) Return + GpuInstanceGetComputeInstances(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) + GpuInstanceGetComputeInstanceById(gpuInstance GpuInstance, id int) (ComputeInstance, Return) + ComputeInstanceGetInfo(computeInstance ComputeInstance) (ComputeInstanceInfo, Return) + DeviceIsMigDeviceHandle(device Device) (bool, Return) + DeviceGetGpuInstanceId(device Device) (int, Return) + DeviceGetComputeInstanceId(device Device) (int, Return) + DeviceGetMaxMigDeviceCount(device Device) (int, Return) + DeviceGetMigDeviceHandleByIndex(device Device, index int) (Device, Return) + DeviceGetDeviceHandleFromMigDeviceHandle(migdevice Device) (Device, Return) + DeviceGetBusType(device Device) (BusType, Return) + DeviceSetDefaultFanSpeed_v2(device Device, fan int) Return + DeviceGetMinMaxFanSpeed(device Device) (int, int, Return) + DeviceGetThermalSettings(device Device, sensorIndex uint32) (GpuThermalSettings, Return) + DeviceGetDefaultEccMode(device Device) (EnableState, Return) + DeviceGetPcieSpeed(device Device) (int, Return) + DeviceGetGspFirmwareVersion(device Device) (string, Return) + DeviceGetGspFirmwareMode(device Device) (bool, bool, Return) + DeviceGetDynamicPstatesInfo(device Device) (GpuDynamicPstatesInfo, Return) + DeviceSetFanSpeed_v2(device Device, fan int, speed int) Return + DeviceGetGpcClkVfOffset(device Device) (int, Return) + DeviceSetGpcClkVfOffset(device Device, offset int) Return + DeviceGetMinMaxClockOfPState(device Device, clockType ClockType, pstate Pstates) (uint32, uint32, Return) + DeviceGetSupportedPerformanceStates(device Device) ([]Pstates, Return) + DeviceGetTargetFanSpeed(device Device, fan int) (int, Return) + DeviceGetMemClkVfOffset(device Device) (int, Return) + DeviceSetMemClkVfOffset(device Device, offset int) Return + DeviceGetGpcClkMinMaxVfOffset(device Device) (int, int, Return) + DeviceGetMemClkMinMaxVfOffset(device Device) (int, int, Return) + DeviceGetGpuMaxPcieLinkGeneration(device Device) (int, Return) + DeviceGetFanControlPolicy_v2(device Device, fan int) (FanControlPolicy, Return) + DeviceSetFanControlPolicy(device Device, fan int, policy FanControlPolicy) Return + DeviceClearFieldValues(device Device, values []FieldValue) Return + DeviceGetVgpuCapabilities(device Device, capability DeviceVgpuCapability) (bool, Return) + DeviceGetVgpuSchedulerLog(device Device) (VgpuSchedulerLog, Return) + DeviceGetVgpuSchedulerState(device Device) (VgpuSchedulerGetState, Return) + DeviceSetVgpuSchedulerState(device Device, pSchedulerState *VgpuSchedulerSetState) Return + DeviceGetVgpuSchedulerCapabilities(device Device) (VgpuSchedulerCapabilities, Return) + GpuInstanceGetComputeInstancePossiblePlacements(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) + GpuInstanceCreateComputeInstanceWithPlacement(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) + DeviceGetGpuFabricInfo(device Device) (GpuFabricInfo, Return) + DeviceCcuGetStreamState(device Device) (int, Return) + DeviceCcuSetStreamState(device Device, state int) Return + DeviceSetNvLinkDeviceLowPowerThreshold(device Device, info *NvLinkPowerThres) Return // Event API EventSetCreate() (EventSet, Return) - EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) - EventSetFree(Set EventSet) Return + EventSetWait(set EventSet, timeoutms uint32) (EventData, Return) + EventSetFree(set EventSet) Return // GPM API - GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType - GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return - GpmSampleFree(GpmSample GpmSample) Return + GpmMetricsGetV(metricsGet *GpmMetricsGetType) GpmMetricsGetVType + GpmMetricsGet(metricsGet *GpmMetricsGetType) Return + GpmSampleFree(gpmSample GpmSample) Return GpmSampleAlloc() (GpmSample, Return) - GpmSampleGet(Device Device, GpmSample GpmSample) Return - GpmQueryDeviceSupportV(Device Device) GpmSupportV - GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) - GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return + GpmSampleGet(device Device, gpmSample GpmSample) Return + GpmQueryDeviceSupportV(device Device) GpmSupportV + GpmQueryDeviceSupport(device Device) (GpmSupport, Return) + GpmMigSampleGet(device Device, gpuInstanceId int, gpmSample GpmSample) Return // Unit API UnitGetCount() (int, Return) - UnitGetHandleByIndex(Index int) (Unit, Return) - UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) - UnitGetLedState(Unit Unit) (LedState, Return) - UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) - UnitGetTemperature(Unit Unit, Type int) (uint32, Return) - UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) - UnitGetDevices(Unit Unit) ([]Device, Return) - UnitSetLedState(Unit Unit, Color LedColor) Return + UnitGetHandleByIndex(index int) (Unit, Return) + UnitGetUnitInfo(unit Unit) (UnitInfo, Return) + UnitGetLedState(unit Unit) (LedState, Return) + UnitGetPsuInfo(unit Unit) (PSUInfo, Return) + UnitGetTemperature(unit Unit, ttype int) (uint32, Return) + UnitGetFanSpeedInfo(unit Unit) (UnitFanSpeeds, Return) + UnitGetDevices(unit Unit) ([]Device, Return) + UnitSetLedState(unit Unit, color LedColor) Return // vGPU API - VgpuTypeGetClass(VgpuTypeId VgpuTypeId) (string, Return) - VgpuTypeGetName(VgpuTypeId VgpuTypeId) (string, Return) - VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) - VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) - VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) - VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) - VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) - VgpuTypeGetLicense(VgpuTypeId VgpuTypeId) (string, Return) - VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) - VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) - VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) - VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) - VgpuInstanceGetUUID(VgpuInstance VgpuInstance) (string, Return) - VgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance) (string, Return) - VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) - VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) - VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) - VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) - VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) - VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) - VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) - VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return - VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) - VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) - VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) - VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) - VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) - VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Return) - VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) - VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) - VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]int, Return) - VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) - GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) + VgpuTypeGetClass(vgpuTypeId VgpuTypeId) (string, Return) + VgpuTypeGetName(vgpuTypeId VgpuTypeId) (string, Return) + VgpuTypeGetGpuInstanceProfileId(vgpuTypeId VgpuTypeId) (uint32, Return) + VgpuTypeGetDeviceID(vgpuTypeId VgpuTypeId) (uint64, uint64, Return) + VgpuTypeGetFramebufferSize(vgpuTypeId VgpuTypeId) (uint64, Return) + VgpuTypeGetNumDisplayHeads(vgpuTypeId VgpuTypeId) (int, Return) + VgpuTypeGetResolution(vgpuTypeId VgpuTypeId, displayIndex int) (uint32, uint32, Return) + VgpuTypeGetLicense(vgpuTypeId VgpuTypeId) (string, Return) + VgpuTypeGetFrameRateLimit(vgpuTypeId VgpuTypeId) (uint32, Return) + VgpuTypeGetMaxInstances(device Device, vgpuTypeId VgpuTypeId) (int, Return) + VgpuTypeGetMaxInstancesPerVm(vgpuTypeId VgpuTypeId) (int, Return) + VgpuInstanceGetVmID(vgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) + VgpuInstanceGetUUID(vgpuInstance VgpuInstance) (string, Return) + VgpuInstanceGetVmDriverVersion(vgpuInstance VgpuInstance) (string, Return) + VgpuInstanceGetFbUsage(vgpuInstance VgpuInstance) (uint64, Return) + VgpuInstanceGetLicenseInfo(vgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) + VgpuInstanceGetLicenseStatus(vgpuInstance VgpuInstance) (int, Return) + VgpuInstanceGetType(vgpuInstance VgpuInstance) (VgpuTypeId, Return) + VgpuInstanceGetFrameRateLimit(vgpuInstance VgpuInstance) (uint32, Return) + VgpuInstanceGetEccMode(vgpuInstance VgpuInstance) (EnableState, Return) + VgpuInstanceGetEncoderCapacity(vgpuInstance VgpuInstance) (int, Return) + VgpuInstanceSetEncoderCapacity(vgpuInstance VgpuInstance, encoderCapacity int) Return + VgpuInstanceGetEncoderStats(vgpuInstance VgpuInstance) (int, uint32, uint32, Return) + VgpuInstanceGetEncoderSessions(vgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) + VgpuInstanceGetFBCStats(vgpuInstance VgpuInstance) (FBCStats, Return) + VgpuInstanceGetFBCSessions(vgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) + VgpuInstanceGetGpuInstanceId(vgpuInstance VgpuInstance) (int, Return) + VgpuInstanceGetGpuPciId(vgpuInstance VgpuInstance) (string, Return) + VgpuInstanceGetMetadata(vgpuInstance VgpuInstance) (VgpuMetadata, Return) + VgpuInstanceGetAccountingMode(vgpuInstance VgpuInstance) (EnableState, Return) + VgpuInstanceGetAccountingPids(vgpuInstance VgpuInstance) ([]int, Return) + VgpuInstanceGetAccountingStats(vgpuInstance VgpuInstance, pid int) (AccountingStats, Return) + GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, pgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) - SetVgpuVersion(VgpuVersion *VgpuVersion) Return - VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return - VgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance) (string, Return) - VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) - GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) + SetVgpuVersion(vgpuVersion *VgpuVersion) Return + VgpuInstanceClearAccountingPids(vgpuInstance VgpuInstance) Return + VgpuInstanceGetMdevUUID(vgpuInstance VgpuInstance) (string, Return) + VgpuTypeGetCapabilities(vgpuTypeId VgpuTypeId, capability VgpuCapability) (bool, Return) + GetVgpuDriverCapabilities(capability VgpuDriverCapability) (bool, Return) } type Device interface { @@ -354,18 +357,18 @@ type Device interface { GetBrand() (BrandType, Return) GetIndex() (int, Return) GetSerial() (string, Return) - GetCpuAffinity(NumCPUs int) ([]uint, Return) + GetCpuAffinity(numCPUs int) ([]uint, Return) SetCpuAffinity() Return ClearCpuAffinity() Return - GetMemoryAffinity(NumNodes int, Scope AffinityScope) ([]uint, Return) - GetCpuAffinityWithinScope(NumCPUs int, Scope AffinityScope) ([]uint, Return) - GetTopologyCommonAncestor(Device2 Device) (GpuTopologyLevel, Return) - GetTopologyNearestGpus(Level GpuTopologyLevel) ([]Device, Return) - GetP2PStatus(Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) + GetMemoryAffinity(numNodes int, scope AffinityScope) ([]uint, Return) + GetCpuAffinityWithinScope(numCPUs int, scope AffinityScope) ([]uint, Return) + GetTopologyCommonAncestor(device2 Device) (GpuTopologyLevel, Return) + GetTopologyNearestGpus(level GpuTopologyLevel) ([]Device, Return) + GetP2PStatus(device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) GetUUID() (string, Return) GetMinorNumber() (int, Return) GetBoardPartNumber() (string, Return) - GetInforomVersion(Object InforomObject) (string, Return) + GetInforomVersion(object InforomObject) (string, Return) GetInforomImageVersion() (string, Return) GetInforomConfigurationChecksum() (uint32, Return) ValidateInforom() Return @@ -377,26 +380,26 @@ type Device interface { GetMaxPcieLinkWidth() (int, Return) GetCurrPcieLinkGeneration() (int, Return) GetCurrPcieLinkWidth() (int, Return) - GetPcieThroughput(Counter PcieUtilCounter) (uint32, Return) + GetPcieThroughput(counter PcieUtilCounter) (uint32, Return) GetPcieReplayCounter() (int, Return) - GetClockInfo(_type ClockType) (uint32, Return) - GetMaxClockInfo(_type ClockType) (uint32, Return) - GetApplicationsClock(ClockType ClockType) (uint32, Return) - GetDefaultApplicationsClock(ClockType ClockType) (uint32, Return) + GetClockInfo(clockType ClockType) (uint32, Return) + GetMaxClockInfo(clockType ClockType) (uint32, Return) + GetApplicationsClock(clockType ClockType) (uint32, Return) + GetDefaultApplicationsClock(clockType ClockType) (uint32, Return) ResetApplicationsClocks() Return - GetClock(ClockType ClockType, ClockId ClockId) (uint32, Return) - GetMaxCustomerBoostClock(ClockType ClockType) (uint32, Return) + GetClock(clockType ClockType, clockId ClockId) (uint32, Return) + GetMaxCustomerBoostClock(clockType ClockType) (uint32, Return) GetSupportedMemoryClocks() (int, uint32, Return) - GetSupportedGraphicsClocks(MemoryClockMHz int) (int, uint32, Return) + GetSupportedGraphicsClocks(memoryClockMHz int) (int, uint32, Return) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) - SetAutoBoostedClocksEnabled(Enabled EnableState) Return - SetDefaultAutoBoostedClocksEnabled(Enabled EnableState, Flags uint32) Return + SetAutoBoostedClocksEnabled(enabled EnableState) Return + SetDefaultAutoBoostedClocksEnabled(enabled EnableState, flags uint32) Return GetFanSpeed() (uint32, Return) - GetFanSpeed_v2(Fan int) (uint32, Return) + GetFanSpeed_v2(fan int) (uint32, Return) GetNumFans() (int, Return) - GetTemperature(SensorType TemperatureSensors) (uint32, Return) - GetTemperatureThreshold(ThresholdType TemperatureThresholds) (uint32, Return) - SetTemperatureThreshold(ThresholdType TemperatureThresholds, Temp int) Return + GetTemperature(sensorType TemperatureSensors) (uint32, Return) + GetTemperatureThreshold(thresholdType TemperatureThresholds) (uint32, Return) + SetTemperatureThreshold(thresholdType TemperatureThresholds, temp int) Return GetPerformanceState() (Pstates, Return) GetCurrentClocksThrottleReasons() (uint64, Return) GetSupportedClocksThrottleReasons() (uint64, Return) @@ -416,12 +419,12 @@ type Device interface { GetEccMode() (EnableState, EnableState, Return) GetBoardId() (uint32, Return) GetMultiGpuBoard() (int, Return) - GetTotalEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) - GetDetailedEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) - GetMemoryErrorCounter(ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) + GetTotalEccErrors(errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) + GetDetailedEccErrors(errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) + GetMemoryErrorCounter(errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) GetUtilizationRates() (Utilization, Return) GetEncoderUtilization() (uint32, uint32, Return) - GetEncoderCapacity(EncoderQueryType EncoderType) (int, Return) + GetEncoderCapacity(encoderQueryType EncoderType) (int, Return) GetEncoderStats() (int, uint32, uint32, Return) GetEncoderSessions() ([]EncoderSessionInfo, Return) GetDecoderUtilization() (uint32, uint32, Return) @@ -433,11 +436,11 @@ type Device interface { GetComputeRunningProcesses() ([]ProcessInfo, Return) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) - OnSameBoard(Device2 Device) (int, Return) - GetAPIRestriction(ApiType RestrictedAPI) (EnableState, Return) - GetSamples(_type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) + OnSameBoard(device2 Device) (int, Return) + GetAPIRestriction(apiType RestrictedAPI) (EnableState, Return) + GetSamples(samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) GetBAR1MemoryInfo() (BAR1Memory, Return) - GetViolationStatus(PerfPolicyType PerfPolicyType) (ViolationTime, Return) + GetViolationStatus(perfPolicyType PerfPolicyType) (ViolationTime, Return) GetIrqNum() (int, Return) GetNumGpuCores() (int, Return) GetPowerSource() (PowerSource, Return) @@ -445,125 +448,125 @@ type Device interface { GetPcieLinkMaxSpeed() (uint32, Return) GetAdaptiveClockInfoStatus() (uint32, Return) GetAccountingMode() (EnableState, Return) - GetAccountingStats(Pid uint32) (AccountingStats, Return) + GetAccountingStats(pid uint32) (AccountingStats, Return) GetAccountingPids() ([]int, Return) GetAccountingBufferSize() (int, Return) - GetRetiredPages(Cause PageRetirementCause) ([]uint64, Return) - GetRetiredPages_v2(Cause PageRetirementCause) ([]uint64, []uint64, Return) + GetRetiredPages(cause PageRetirementCause) ([]uint64, Return) + GetRetiredPages_v2(cause PageRetirementCause) ([]uint64, []uint64, Return) GetRetiredPagesPendingStatus() (EnableState, Return) - SetPersistenceMode(Mode EnableState) Return - SetComputeMode(Mode ComputeMode) Return - SetEccMode(Ecc EnableState) Return - ClearEccErrorCounts(CounterType EccCounterType) Return - SetDriverModel(DriverModel DriverModel, Flags uint32) Return - SetGpuLockedClocks(MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return + SetPersistenceMode(mode EnableState) Return + SetComputeMode(mode ComputeMode) Return + SetEccMode(ecc EnableState) Return + ClearEccErrorCounts(counterType EccCounterType) Return + SetDriverModel(driverModel DriverModel, flags uint32) Return + SetGpuLockedClocks(minGpuClockMHz uint32, maxGpuClockMHz uint32) Return ResetGpuLockedClocks() Return - SetMemoryLockedClocks(NinMemClockMHz uint32, MaxMemClockMHz uint32) Return + SetMemoryLockedClocks(minMemClockMHz uint32, maxMemClockMHz uint32) Return ResetMemoryLockedClocks() Return GetClkMonStatus() (ClkMonStatus, Return) - SetApplicationsClocks(MemClockMHz uint32, GraphicsClockMHz uint32) Return - SetPowerManagementLimit(Limit uint32) Return - SetGpuOperationMode(Mode GpuOperationMode) Return - SetAPIRestriction(ApiType RestrictedAPI, IsRestricted EnableState) Return - SetAccountingMode(Mode EnableState) Return + SetApplicationsClocks(memClockMHz uint32, graphicsClockMHz uint32) Return + SetPowerManagementLimit(limit uint32) Return + SetGpuOperationMode(mode GpuOperationMode) Return + SetAPIRestriction(apiType RestrictedAPI, isRestricted EnableState) Return + SetAccountingMode(mode EnableState) Return ClearAccountingPids() Return - GetNvLinkState(Link int) (EnableState, Return) - GetNvLinkVersion(Link int) (uint32, Return) - GetNvLinkCapability(Link int, Capability NvLinkCapability) (uint32, Return) - GetNvLinkRemotePciInfo(Link int) (PciInfo, Return) - GetNvLinkErrorCounter(Link int, Counter NvLinkErrorCounter) (uint64, Return) - ResetNvLinkErrorCounters(Link int) Return - SetNvLinkUtilizationControl(Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return - GetNvLinkUtilizationControl(Link int, Counter int) (NvLinkUtilizationControl, Return) - GetNvLinkUtilizationCounter(Link int, Counter int) (uint64, uint64, Return) - FreezeNvLinkUtilizationCounter(Link int, Counter int, Freeze EnableState) Return - ResetNvLinkUtilizationCounter(Link int, Counter int) Return - GetNvLinkRemoteDeviceType(Link int) (IntNvLinkDeviceType, Return) - RegisterEvents(EventTypes uint64, Set EventSet) Return + GetNvLinkState(link int) (EnableState, Return) + GetNvLinkVersion(link int) (uint32, Return) + GetNvLinkCapability(link int, capability NvLinkCapability) (uint32, Return) + GetNvLinkRemotePciInfo(link int) (PciInfo, Return) + GetNvLinkErrorCounter(link int, counter NvLinkErrorCounter) (uint64, Return) + ResetNvLinkErrorCounters(link int) Return + SetNvLinkUtilizationControl(link int, counter int, control *NvLinkUtilizationControl, reset bool) Return + GetNvLinkUtilizationControl(link int, counter int) (NvLinkUtilizationControl, Return) + GetNvLinkUtilizationCounter(link int, counter int) (uint64, uint64, Return) + FreezeNvLinkUtilizationCounter(link int, counter int, freeze EnableState) Return + ResetNvLinkUtilizationCounter(link int, counter int) Return + GetNvLinkRemoteDeviceType(link int) (IntNvLinkDeviceType, Return) + RegisterEvents(eventTypes uint64, set EventSet) Return GetSupportedEventTypes() (uint64, Return) - GetFieldValues(Values []FieldValue) Return + GetFieldValues(values []FieldValue) Return GetVirtualizationMode() (GpuVirtualizationMode, Return) GetHostVgpuMode() (HostVgpuMode, Return) - SetVirtualizationMode(VirtualMode GpuVirtualizationMode) Return + SetVirtualizationMode(virtualMode GpuVirtualizationMode) Return GetGridLicensableFeatures() (GridLicensableFeatures, Return) - GetProcessUtilization(LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) + GetProcessUtilization(lastSeenTimestamp uint64) ([]ProcessUtilizationSample, Return) GetSupportedVgpus() ([]VgpuTypeId, Return) GetCreatableVgpus() ([]VgpuTypeId, Return) GetActiveVgpus() ([]VgpuInstance, Return) GetVgpuMetadata() (VgpuPgpuMetadata, Return) GetPgpuMetadataString() (string, Return) - GetVgpuUtilization(LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) + GetVgpuUtilization(lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) GetAttributes() (DeviceAttributes, Return) GetRemappedRows() (int, int, bool, bool, Return) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) GetArchitecture() (DeviceArchitecture, Return) - GetVgpuProcessUtilization(LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) - SetMigMode(Mode int) (Return, Return) + GetVgpuProcessUtilization(lastSeenTimestamp uint64) ([]VgpuProcessUtilizationSample, Return) + SetMigMode(mode int) (Return, Return) GetMigMode() (int, int, Return) - GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) - GetGpuInstanceProfileInfoV(Profile int) GpuInstanceProfileInfoV - GetGpuInstancePossiblePlacements(Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) - GetGpuInstanceRemainingCapacity(Info *GpuInstanceProfileInfo) (int, Return) - CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) - CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) - GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) - GetGpuInstanceById(Id int) (GpuInstance, Return) + GetGpuInstanceProfileInfo(profile int) (GpuInstanceProfileInfo, Return) + GetGpuInstanceProfileInfoV(profile int) GpuInstanceProfileInfoV + GetGpuInstancePossiblePlacements(info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) + GetGpuInstanceRemainingCapacity(info *GpuInstanceProfileInfo) (int, Return) + CreateGpuInstance(info *GpuInstanceProfileInfo) (GpuInstance, Return) + CreateGpuInstanceWithPlacement(info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) + GetGpuInstances(info *GpuInstanceProfileInfo) ([]GpuInstance, Return) + GetGpuInstanceById(id int) (GpuInstance, Return) IsMigDeviceHandle() (bool, Return) GetGpuInstanceId() (int, Return) GetComputeInstanceId() (int, Return) GetMaxMigDeviceCount() (int, Return) - GetMigDeviceHandleByIndex(Index int) (Device, Return) + GetMigDeviceHandleByIndex(index int) (Device, Return) GetDeviceHandleFromMigDeviceHandle() (Device, Return) GetBusType() (BusType, Return) - SetDefaultFanSpeed_v2(Fan int) Return + SetDefaultFanSpeed_v2(fan int) Return GetMinMaxFanSpeed() (int, int, Return) - GetThermalSettings(SensorIndex uint32) (GpuThermalSettings, Return) + GetThermalSettings(sensorIndex uint32) (GpuThermalSettings, Return) GetDefaultEccMode() (EnableState, Return) GetPcieSpeed() (int, Return) GetGspFirmwareVersion() (string, Return) GetGspFirmwareMode() (bool, bool, Return) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) - SetFanSpeed_v2(Fan int, Speed int) Return + SetFanSpeed_v2(fan int, speed int) Return GetGpcClkVfOffset() (int, Return) - SetGpcClkVfOffset(Offset int) Return - GetMinMaxClockOfPState(_type ClockType, Pstate Pstates) (uint32, uint32, Return) + SetGpcClkVfOffset(offset int) Return + GetMinMaxClockOfPState(clockType ClockType, pstate Pstates) (uint32, uint32, Return) GetSupportedPerformanceStates() ([]Pstates, Return) - GetTargetFanSpeed(Fan int) (int, Return) + GetTargetFanSpeed(fan int) (int, Return) GetMemClkVfOffset() (int, Return) - SetMemClkVfOffset(Offset int) Return + SetMemClkVfOffset(offset int) Return GetGpcClkMinMaxVfOffset() (int, int, Return) GetMemClkMinMaxVfOffset() (int, int, Return) GetGpuMaxPcieLinkGeneration() (int, Return) - GetFanControlPolicy_v2(Fan int) (FanControlPolicy, Return) - SetFanControlPolicy(Fan int, Policy FanControlPolicy) Return - ClearFieldValues(Values []FieldValue) Return - GetVgpuCapabilities(Capability DeviceVgpuCapability) (bool, Return) + GetFanControlPolicy_v2(fan int) (FanControlPolicy, Return) + SetFanControlPolicy(fan int, policy FanControlPolicy) Return + ClearFieldValues(values []FieldValue) Return + GetVgpuCapabilities(capability DeviceVgpuCapability) (bool, Return) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) - SetVgpuSchedulerState(PSchedulerState *VgpuSchedulerSetState) Return + SetVgpuSchedulerState(pSchedulerState *VgpuSchedulerSetState) Return GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) GetGpuFabricInfo() (GpuFabricInfo, Return) CcuGetStreamState() (int, Return) - CcuSetStreamState(State int) Return - SetNvLinkDeviceLowPowerThreshold(Info *NvLinkPowerThres) Return - GpmSampleGet(GpmSample GpmSample) Return + CcuSetStreamState(state int) Return + SetNvLinkDeviceLowPowerThreshold(info *NvLinkPowerThres) Return + GpmSampleGet(gpmSample GpmSample) Return GpmQueryDeviceSupportV() GpmSupportV GpmQueryDeviceSupport() (GpmSupport, Return) - GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) Return - VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) + GpmMigSampleGet(gpuInstanceId int, gpmSample GpmSample) Return + VgpuTypeGetMaxInstances(vgpuTypeId VgpuTypeId) (int, Return) } type GpuInstance interface { Destroy() Return GetInfo() (GpuInstanceInfo, Return) - GetComputeInstanceProfileInfo(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) - GetComputeInstanceProfileInfoV(Profile int, EngProfile int) ComputeInstanceProfileInfoV - GetComputeInstanceRemainingCapacity(Info *ComputeInstanceProfileInfo) (int, Return) - CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) - GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) - GetComputeInstanceById(Id int) (ComputeInstance, Return) - GetComputeInstancePossiblePlacements(Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) - CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) + GetComputeInstanceProfileInfo(profile int, engProfile int) (ComputeInstanceProfileInfo, Return) + GetComputeInstanceProfileInfoV(profile int, engProfile int) ComputeInstanceProfileInfoV + GetComputeInstanceRemainingCapacity(info *ComputeInstanceProfileInfo) (int, Return) + CreateComputeInstance(info *ComputeInstanceProfileInfo) (ComputeInstance, Return) + GetComputeInstances(info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) + GetComputeInstanceById(id int) (ComputeInstance, Return) + GetComputeInstancePossiblePlacements(info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) + CreateComputeInstanceWithPlacement(info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) } type ComputeInstance interface { @@ -572,24 +575,24 @@ type ComputeInstance interface { } type EventSet interface { - Wait(Timeoutms uint32) (EventData, Return) + Wait(timeoutms uint32) (EventData, Return) Free() Return } type GpmSample interface { Free() Return - Get(Device Device) Return - MigGet(Device Device, GpuInstanceId int) Return + Get(device Device) Return + MigGet(device Device, gpuInstanceId int) Return } type Unit interface { GetUnitInfo() (UnitInfo, Return) GetLedState() (LedState, Return) GetPsuInfo() (PSUInfo, Return) - GetTemperature(Type int) (uint32, Return) + GetTemperature(ttype int) (uint32, Return) GetFanSpeedInfo() (UnitFanSpeeds, Return) GetDevices() ([]Device, Return) - SetLedState(Color LedColor) Return + SetLedState(color LedColor) Return } type VgpuInstance interface { @@ -603,7 +606,7 @@ type VgpuInstance interface { GetFrameRateLimit() (uint32, Return) GetEccMode() (EnableState, Return) GetEncoderCapacity() (int, Return) - SetEncoderCapacity(EncoderCapacity int) Return + SetEncoderCapacity(encoderCapacity int) Return GetEncoderStats() (int, uint32, uint32, Return) GetEncoderSessions() (int, EncoderSessionInfo, Return) GetFBCStats() (FBCStats, Return) @@ -613,7 +616,7 @@ type VgpuInstance interface { GetMetadata() (VgpuMetadata, Return) GetAccountingMode() (EnableState, Return) GetAccountingPids() ([]int, Return) - GetAccountingStats(Pid int) (AccountingStats, Return) + GetAccountingStats(pid int) (AccountingStats, Return) ClearAccountingPids() Return GetMdevUUID() (string, Return) } @@ -625,12 +628,12 @@ type VgpuTypeId interface { GetDeviceID() (uint64, uint64, Return) GetFramebufferSize() (uint64, Return) GetNumDisplayHeads() (int, Return) - GetResolution(DisplayIndex int) (uint32, uint32, Return) + GetResolution(displayIndex int) (uint32, uint32, Return) GetLicense() (string, Return) GetFrameRateLimit() (uint32, Return) - GetMaxInstances(Device Device) (int, Return) + GetMaxInstances(device Device) (int, Return) GetMaxInstancesPerVm() (int, Return) - GetCapabilities(Capability VgpuCapability) (bool, Return) + GetCapabilities(capability VgpuCapability) (bool, Return) } // Define package level methods as aliases to Interface methods of libnvml diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index 7ad00fd..dc9cb53 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -23,1964 +23,1964 @@ type EccBitType = MemoryErrorType // nvml.DeviceGetCount() func (l *library) DeviceGetCount() (int, Return) { - var DeviceCount uint32 - ret := nvmlDeviceGetCount(&DeviceCount) - return int(DeviceCount), ret + var deviceCount uint32 + ret := nvmlDeviceGetCount(&deviceCount) + return int(deviceCount), ret } // nvml.DeviceGetHandleByIndex() -func (l *library) DeviceGetHandleByIndex(Index int) (Device, Return) { - var Device nvmlDevice - 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 (l *library) DeviceGetHandleBySerial(Serial string) (Device, Return) { - var Device nvmlDevice - 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 (l *library) DeviceGetHandleByUUID(Uuid string) (Device, Return) { - var Device nvmlDevice - 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 (l *library) DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) { - var Device nvmlDevice - 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 (l *library) DeviceGetName(Device Device) (string, Return) { - return Device.GetName() +func (l *library) DeviceGetName(device Device) (string, Return) { + return device.GetName() } -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 +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 (l *library) DeviceGetBrand(Device Device) (BrandType, Return) { - return Device.GetBrand() +func (l *library) DeviceGetBrand(device Device) (BrandType, Return) { + return device.GetBrand() } -func (Device nvmlDevice) GetBrand() (BrandType, Return) { - var _type BrandType - ret := nvmlDeviceGetBrand(Device, &_type) - return _type, ret +func (device nvmlDevice) GetBrand() (BrandType, Return) { + var brandType BrandType + ret := nvmlDeviceGetBrand(device, &brandType) + return brandType, ret } // nvml.DeviceGetIndex() -func (l *library) DeviceGetIndex(Device Device) (int, Return) { - return Device.GetIndex() +func (l *library) DeviceGetIndex(device Device) (int, Return) { + return device.GetIndex() } -func (Device nvmlDevice) GetIndex() (int, Return) { - var Index uint32 - ret := nvmlDeviceGetIndex(Device, &Index) - return int(Index), ret +func (device nvmlDevice) GetIndex() (int, Return) { + var index uint32 + ret := nvmlDeviceGetIndex(device, &index) + return int(index), ret } // nvml.DeviceGetSerial() -func (l *library) DeviceGetSerial(Device Device) (string, Return) { - return Device.GetSerial() +func (l *library) DeviceGetSerial(device Device) (string, Return) { + return device.GetSerial() } -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 +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 (l *library) DeviceGetCpuAffinity(Device Device, NumCPUs int) ([]uint, Return) { - return Device.GetCpuAffinity(NumCPUs) +func (l *library) DeviceGetCpuAffinity(device Device, numCPUs int) ([]uint, Return) { + return device.GetCpuAffinity(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 +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 (l *library) DeviceSetCpuAffinity(Device Device) Return { - return Device.SetCpuAffinity() +func (l *library) DeviceSetCpuAffinity(device Device) Return { + return device.SetCpuAffinity() } -func (Device nvmlDevice) SetCpuAffinity() Return { - return nvmlDeviceSetCpuAffinity(Device) +func (device nvmlDevice) SetCpuAffinity() Return { + return nvmlDeviceSetCpuAffinity(device) } // nvml.DeviceClearCpuAffinity() -func (l *library) DeviceClearCpuAffinity(Device Device) Return { - return Device.ClearCpuAffinity() +func (l *library) DeviceClearCpuAffinity(device Device) Return { + return device.ClearCpuAffinity() } -func (Device nvmlDevice) ClearCpuAffinity() Return { - return nvmlDeviceClearCpuAffinity(Device) +func (device nvmlDevice) ClearCpuAffinity() Return { + return nvmlDeviceClearCpuAffinity(device) } // nvml.DeviceGetMemoryAffinity() -func (l *library) DeviceGetMemoryAffinity(Device Device, NumNodes int, Scope AffinityScope) ([]uint, Return) { - return Device.GetMemoryAffinity(NumNodes, Scope) +func (l *library) DeviceGetMemoryAffinity(device Device, numNodes int, scope AffinityScope) ([]uint, Return) { + return device.GetMemoryAffinity(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 +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 (l *library) DeviceGetCpuAffinityWithinScope(Device Device, NumCPUs int, Scope AffinityScope) ([]uint, Return) { - return Device.GetCpuAffinityWithinScope(NumCPUs, Scope) +func (l *library) DeviceGetCpuAffinityWithinScope(device Device, numCPUs int, scope AffinityScope) ([]uint, Return) { + return device.GetCpuAffinityWithinScope(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 +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 (l *library) DeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device) (GpuTopologyLevel, Return) { - return Device1.GetTopologyCommonAncestor(Device2) +func (l *library) DeviceGetTopologyCommonAncestor(device1 Device, device2 Device) (GpuTopologyLevel, Return) { + return device1.GetTopologyCommonAncestor(device2) } -func (Device1 nvmlDevice) GetTopologyCommonAncestor(Device2 Device) (GpuTopologyLevel, Return) { - var PathInfo GpuTopologyLevel - ret := nvmlDeviceGetTopologyCommonAncestor(Device1, Device2.(nvmlDevice), &PathInfo) - return PathInfo, ret +func (device1 nvmlDevice) GetTopologyCommonAncestor(device2 Device) (GpuTopologyLevel, Return) { + var pathInfo GpuTopologyLevel + ret := nvmlDeviceGetTopologyCommonAncestor(device1, device2.(nvmlDevice), &pathInfo) + return pathInfo, ret } // nvml.DeviceGetTopologyNearestGpus() -func (l *library) DeviceGetTopologyNearestGpus(Device Device, Level GpuTopologyLevel) ([]Device, Return) { - return Device.GetTopologyNearestGpus(Level) +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) +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([]nvmlDevice, Count) - ret = nvmlDeviceGetTopologyNearestGpus(device, Level, &Count, &DeviceArray[0]) - return convertSlice[nvmlDevice, Device](DeviceArray), ret + deviceArray := make([]nvmlDevice, count) + ret = nvmlDeviceGetTopologyNearestGpus(device, level, &count, &deviceArray[0]) + return convertSlice[nvmlDevice, Device](deviceArray), ret } // nvml.DeviceGetP2PStatus() -func (l *library) DeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { - return Device1.GetP2PStatus(Device2, P2pIndex) +func (l *library) DeviceGetP2PStatus(device1 Device, device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { + return device1.GetP2PStatus(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 +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 (l *library) DeviceGetUUID(Device Device) (string, Return) { - return Device.GetUUID() +func (l *library) DeviceGetUUID(device Device) (string, Return) { + return device.GetUUID() } -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 +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 (l *library) DeviceGetMinorNumber(Device Device) (int, Return) { - return Device.GetMinorNumber() +func (l *library) DeviceGetMinorNumber(device Device) (int, Return) { + return device.GetMinorNumber() } -func (Device nvmlDevice) GetMinorNumber() (int, Return) { - var MinorNumber uint32 - ret := nvmlDeviceGetMinorNumber(Device, &MinorNumber) - return int(MinorNumber), ret +func (device nvmlDevice) GetMinorNumber() (int, Return) { + var minorNumber uint32 + ret := nvmlDeviceGetMinorNumber(device, &minorNumber) + return int(minorNumber), ret } // nvml.DeviceGetBoardPartNumber() -func (l *library) DeviceGetBoardPartNumber(Device Device) (string, Return) { - return Device.GetBoardPartNumber() +func (l *library) DeviceGetBoardPartNumber(device Device) (string, Return) { + return device.GetBoardPartNumber() } -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 +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 (l *library) DeviceGetInforomVersion(Device Device, Object InforomObject) (string, Return) { - return Device.GetInforomVersion(Object) +func (l *library) DeviceGetInforomVersion(device Device, object InforomObject) (string, Return) { + return device.GetInforomVersion(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 +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 (l *library) DeviceGetInforomImageVersion(Device Device) (string, Return) { - return Device.GetInforomImageVersion() +func (l *library) DeviceGetInforomImageVersion(device Device) (string, Return) { + return device.GetInforomImageVersion() } -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 +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 (l *library) DeviceGetInforomConfigurationChecksum(Device Device) (uint32, Return) { - return Device.GetInforomConfigurationChecksum() +func (l *library) DeviceGetInforomConfigurationChecksum(device Device) (uint32, Return) { + return device.GetInforomConfigurationChecksum() } -func (Device nvmlDevice) GetInforomConfigurationChecksum() (uint32, Return) { - var Checksum uint32 - ret := nvmlDeviceGetInforomConfigurationChecksum(Device, &Checksum) - return Checksum, ret +func (device nvmlDevice) GetInforomConfigurationChecksum() (uint32, Return) { + var checksum uint32 + ret := nvmlDeviceGetInforomConfigurationChecksum(device, &checksum) + return checksum, ret } // nvml.DeviceValidateInforom() -func (l *library) DeviceValidateInforom(Device Device) Return { - return Device.ValidateInforom() +func (l *library) DeviceValidateInforom(device Device) Return { + return device.ValidateInforom() } -func (Device nvmlDevice) ValidateInforom() Return { - return nvmlDeviceValidateInforom(Device) +func (device nvmlDevice) ValidateInforom() Return { + return nvmlDeviceValidateInforom(device) } // nvml.DeviceGetDisplayMode() -func (l *library) DeviceGetDisplayMode(Device Device) (EnableState, Return) { - return Device.GetDisplayMode() +func (l *library) DeviceGetDisplayMode(device Device) (EnableState, Return) { + return device.GetDisplayMode() } -func (Device nvmlDevice) GetDisplayMode() (EnableState, Return) { - var Display EnableState - ret := nvmlDeviceGetDisplayMode(Device, &Display) - return Display, ret +func (device nvmlDevice) GetDisplayMode() (EnableState, Return) { + var display EnableState + ret := nvmlDeviceGetDisplayMode(device, &display) + return display, ret } // nvml.DeviceGetDisplayActive() -func (l *library) DeviceGetDisplayActive(Device Device) (EnableState, Return) { - return Device.GetDisplayActive() +func (l *library) DeviceGetDisplayActive(device Device) (EnableState, Return) { + return device.GetDisplayActive() } -func (Device nvmlDevice) GetDisplayActive() (EnableState, Return) { - var IsActive EnableState - ret := nvmlDeviceGetDisplayActive(Device, &IsActive) - return IsActive, ret +func (device nvmlDevice) GetDisplayActive() (EnableState, Return) { + var isActive EnableState + ret := nvmlDeviceGetDisplayActive(device, &isActive) + return isActive, ret } // nvml.DeviceGetPersistenceMode() -func (l *library) DeviceGetPersistenceMode(Device Device) (EnableState, Return) { - return Device.GetPersistenceMode() +func (l *library) DeviceGetPersistenceMode(device Device) (EnableState, Return) { + return device.GetPersistenceMode() } -func (Device nvmlDevice) GetPersistenceMode() (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetPersistenceMode(Device, &Mode) - return Mode, ret +func (device nvmlDevice) GetPersistenceMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetPersistenceMode(device, &mode) + return mode, ret } // nvml.DeviceGetPciInfo() -func (l *library) DeviceGetPciInfo(Device Device) (PciInfo, Return) { - return Device.GetPciInfo() +func (l *library) DeviceGetPciInfo(device Device) (PciInfo, Return) { + return device.GetPciInfo() } -func (Device nvmlDevice) GetPciInfo() (PciInfo, Return) { - var Pci PciInfo - ret := nvmlDeviceGetPciInfo(Device, &Pci) - return Pci, ret +func (device nvmlDevice) GetPciInfo() (PciInfo, Return) { + var pci PciInfo + ret := nvmlDeviceGetPciInfo(device, &pci) + return pci, ret } // nvml.DeviceGetMaxPcieLinkGeneration() -func (l *library) DeviceGetMaxPcieLinkGeneration(Device Device) (int, Return) { - return Device.GetMaxPcieLinkGeneration() +func (l *library) DeviceGetMaxPcieLinkGeneration(device Device) (int, Return) { + return device.GetMaxPcieLinkGeneration() } -func (Device nvmlDevice) GetMaxPcieLinkGeneration() (int, Return) { - var MaxLinkGen uint32 - ret := nvmlDeviceGetMaxPcieLinkGeneration(Device, &MaxLinkGen) - return int(MaxLinkGen), ret +func (device nvmlDevice) GetMaxPcieLinkGeneration() (int, Return) { + var maxLinkGen uint32 + ret := nvmlDeviceGetMaxPcieLinkGeneration(device, &maxLinkGen) + return int(maxLinkGen), ret } // nvml.DeviceGetMaxPcieLinkWidth() -func (l *library) DeviceGetMaxPcieLinkWidth(Device Device) (int, Return) { - return Device.GetMaxPcieLinkWidth() +func (l *library) DeviceGetMaxPcieLinkWidth(device Device) (int, Return) { + return device.GetMaxPcieLinkWidth() } -func (Device nvmlDevice) GetMaxPcieLinkWidth() (int, Return) { - var MaxLinkWidth uint32 - ret := nvmlDeviceGetMaxPcieLinkWidth(Device, &MaxLinkWidth) - return int(MaxLinkWidth), ret +func (device nvmlDevice) GetMaxPcieLinkWidth() (int, Return) { + var maxLinkWidth uint32 + ret := nvmlDeviceGetMaxPcieLinkWidth(device, &maxLinkWidth) + return int(maxLinkWidth), ret } // nvml.DeviceGetCurrPcieLinkGeneration() -func (l *library) DeviceGetCurrPcieLinkGeneration(Device Device) (int, Return) { - return Device.GetCurrPcieLinkGeneration() +func (l *library) DeviceGetCurrPcieLinkGeneration(device Device) (int, Return) { + return device.GetCurrPcieLinkGeneration() } -func (Device nvmlDevice) GetCurrPcieLinkGeneration() (int, Return) { - var CurrLinkGen uint32 - ret := nvmlDeviceGetCurrPcieLinkGeneration(Device, &CurrLinkGen) - return int(CurrLinkGen), ret +func (device nvmlDevice) GetCurrPcieLinkGeneration() (int, Return) { + var currLinkGen uint32 + ret := nvmlDeviceGetCurrPcieLinkGeneration(device, &currLinkGen) + return int(currLinkGen), ret } // nvml.DeviceGetCurrPcieLinkWidth() -func (l *library) DeviceGetCurrPcieLinkWidth(Device Device) (int, Return) { - return Device.GetCurrPcieLinkWidth() +func (l *library) DeviceGetCurrPcieLinkWidth(device Device) (int, Return) { + return device.GetCurrPcieLinkWidth() } -func (Device nvmlDevice) GetCurrPcieLinkWidth() (int, Return) { - var CurrLinkWidth uint32 - ret := nvmlDeviceGetCurrPcieLinkWidth(Device, &CurrLinkWidth) - return int(CurrLinkWidth), ret +func (device nvmlDevice) GetCurrPcieLinkWidth() (int, Return) { + var currLinkWidth uint32 + ret := nvmlDeviceGetCurrPcieLinkWidth(device, &currLinkWidth) + return int(currLinkWidth), ret } // nvml.DeviceGetPcieThroughput() -func (l *library) DeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter) (uint32, Return) { - return Device.GetPcieThroughput(Counter) +func (l *library) DeviceGetPcieThroughput(device Device, counter PcieUtilCounter) (uint32, Return) { + return device.GetPcieThroughput(counter) } -func (Device nvmlDevice) GetPcieThroughput(Counter PcieUtilCounter) (uint32, Return) { - var Value uint32 - ret := nvmlDeviceGetPcieThroughput(Device, Counter, &Value) - return Value, ret +func (device nvmlDevice) GetPcieThroughput(counter PcieUtilCounter) (uint32, Return) { + var value uint32 + ret := nvmlDeviceGetPcieThroughput(device, counter, &value) + return value, ret } // nvml.DeviceGetPcieReplayCounter() -func (l *library) DeviceGetPcieReplayCounter(Device Device) (int, Return) { - return Device.GetPcieReplayCounter() +func (l *library) DeviceGetPcieReplayCounter(device Device) (int, Return) { + return device.GetPcieReplayCounter() } -func (Device nvmlDevice) GetPcieReplayCounter() (int, Return) { - var Value uint32 - ret := nvmlDeviceGetPcieReplayCounter(Device, &Value) - return int(Value), ret +func (device nvmlDevice) GetPcieReplayCounter() (int, Return) { + var value uint32 + ret := nvmlDeviceGetPcieReplayCounter(device, &value) + return int(value), ret } // nvml.nvmlDeviceGetClockInfo() -func (l *library) DeviceGetClockInfo(Device Device, _type ClockType) (uint32, Return) { - return Device.GetClockInfo(_type) +func (l *library) DeviceGetClockInfo(device Device, clockType ClockType) (uint32, Return) { + return device.GetClockInfo(clockType) } -func (Device nvmlDevice) GetClockInfo(_type ClockType) (uint32, Return) { - var Clock uint32 - ret := nvmlDeviceGetClockInfo(Device, _type, &Clock) - return Clock, ret +func (device nvmlDevice) GetClockInfo(clockType ClockType) (uint32, Return) { + var clock uint32 + ret := nvmlDeviceGetClockInfo(device, clockType, &clock) + return clock, ret } // nvml.DeviceGetMaxClockInfo() -func (l *library) DeviceGetMaxClockInfo(Device Device, _type ClockType) (uint32, Return) { - return Device.GetMaxClockInfo(_type) +func (l *library) DeviceGetMaxClockInfo(device Device, clockType ClockType) (uint32, Return) { + return device.GetMaxClockInfo(clockType) } -func (Device nvmlDevice) GetMaxClockInfo(_type ClockType) (uint32, Return) { - var Clock uint32 - ret := nvmlDeviceGetMaxClockInfo(Device, _type, &Clock) - return Clock, ret +func (device nvmlDevice) GetMaxClockInfo(clockType ClockType) (uint32, Return) { + var clock uint32 + ret := nvmlDeviceGetMaxClockInfo(device, clockType, &clock) + return clock, ret } // nvml.DeviceGetApplicationsClock() -func (l *library) DeviceGetApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { - return Device.GetApplicationsClock(ClockType) +func (l *library) DeviceGetApplicationsClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetApplicationsClock(clockType) } -func (Device nvmlDevice) GetApplicationsClock(ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetApplicationsClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (device nvmlDevice) GetApplicationsClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetApplicationsClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceGetDefaultApplicationsClock() -func (l *library) DeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { - return Device.GetDefaultApplicationsClock(ClockType) +func (l *library) DeviceGetDefaultApplicationsClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetDefaultApplicationsClock(clockType) } -func (Device nvmlDevice) GetDefaultApplicationsClock(ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetDefaultApplicationsClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (device nvmlDevice) GetDefaultApplicationsClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetDefaultApplicationsClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceResetApplicationsClocks() -func (l *library) DeviceResetApplicationsClocks(Device Device) Return { - return Device.ResetApplicationsClocks() +func (l *library) DeviceResetApplicationsClocks(device Device) Return { + return device.ResetApplicationsClocks() } -func (Device nvmlDevice) ResetApplicationsClocks() Return { - return nvmlDeviceResetApplicationsClocks(Device) +func (device nvmlDevice) ResetApplicationsClocks() Return { + return nvmlDeviceResetApplicationsClocks(device) } // nvml.DeviceGetClock() -func (l *library) DeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId) (uint32, Return) { - return Device.GetClock(ClockType, ClockId) +func (l *library) DeviceGetClock(device Device, clockType ClockType, clockId ClockId) (uint32, Return) { + return device.GetClock(clockType, clockId) } -func (Device nvmlDevice) GetClock(ClockType ClockType, ClockId ClockId) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetClock(Device, ClockType, ClockId, &ClockMHz) - return ClockMHz, ret +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 (l *library) DeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType) (uint32, Return) { - return Device.GetMaxCustomerBoostClock(ClockType) +func (l *library) DeviceGetMaxCustomerBoostClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetMaxCustomerBoostClock(clockType) } -func (Device nvmlDevice) GetMaxCustomerBoostClock(ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetMaxCustomerBoostClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (device nvmlDevice) GetMaxCustomerBoostClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetMaxCustomerBoostClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceGetSupportedMemoryClocks() -func (l *library) DeviceGetSupportedMemoryClocks(Device Device) (int, uint32, Return) { - return Device.GetSupportedMemoryClocks() +func (l *library) DeviceGetSupportedMemoryClocks(device Device) (int, uint32, Return) { + return device.GetSupportedMemoryClocks() } -func (Device nvmlDevice) GetSupportedMemoryClocks() (int, uint32, Return) { - var Count, ClocksMHz uint32 - ret := nvmlDeviceGetSupportedMemoryClocks(Device, &Count, &ClocksMHz) - return int(Count), ClocksMHz, ret +func (device nvmlDevice) GetSupportedMemoryClocks() (int, uint32, Return) { + var count, clocksMHz uint32 + ret := nvmlDeviceGetSupportedMemoryClocks(device, &count, &clocksMHz) + return int(count), clocksMHz, ret } // nvml.DeviceGetSupportedGraphicsClocks() -func (l *library) DeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz int) (int, uint32, Return) { - return Device.GetSupportedGraphicsClocks(MemoryClockMHz) +func (l *library) DeviceGetSupportedGraphicsClocks(device Device, memoryClockMHz int) (int, uint32, Return) { + return device.GetSupportedGraphicsClocks(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 +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 (l *library) DeviceGetAutoBoostedClocksEnabled(Device Device) (EnableState, EnableState, Return) { - return Device.GetAutoBoostedClocksEnabled() +func (l *library) DeviceGetAutoBoostedClocksEnabled(device Device) (EnableState, EnableState, Return) { + return device.GetAutoBoostedClocksEnabled() } -func (Device nvmlDevice) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) { - var IsEnabled, DefaultIsEnabled EnableState - ret := nvmlDeviceGetAutoBoostedClocksEnabled(Device, &IsEnabled, &DefaultIsEnabled) - return IsEnabled, DefaultIsEnabled, ret +func (device nvmlDevice) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) { + var isEnabled, defaultIsEnabled EnableState + ret := nvmlDeviceGetAutoBoostedClocksEnabled(device, &isEnabled, &defaultIsEnabled) + return isEnabled, defaultIsEnabled, ret } // nvml.DeviceSetAutoBoostedClocksEnabled() -func (l *library) DeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return { - return Device.SetAutoBoostedClocksEnabled(Enabled) +func (l *library) DeviceSetAutoBoostedClocksEnabled(device Device, enabled EnableState) Return { + return device.SetAutoBoostedClocksEnabled(enabled) } -func (Device nvmlDevice) SetAutoBoostedClocksEnabled(Enabled EnableState) Return { - return nvmlDeviceSetAutoBoostedClocksEnabled(Device, Enabled) +func (device nvmlDevice) SetAutoBoostedClocksEnabled(enabled EnableState) Return { + return nvmlDeviceSetAutoBoostedClocksEnabled(device, enabled) } // nvml.DeviceSetDefaultAutoBoostedClocksEnabled() -func (l *library) DeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return { - return Device.SetDefaultAutoBoostedClocksEnabled(Enabled, Flags) +func (l *library) DeviceSetDefaultAutoBoostedClocksEnabled(device Device, enabled EnableState, flags uint32) Return { + return device.SetDefaultAutoBoostedClocksEnabled(enabled, flags) } -func (Device nvmlDevice) SetDefaultAutoBoostedClocksEnabled(Enabled EnableState, Flags uint32) Return { - return nvmlDeviceSetDefaultAutoBoostedClocksEnabled(Device, Enabled, Flags) +func (device nvmlDevice) SetDefaultAutoBoostedClocksEnabled(enabled EnableState, flags uint32) Return { + return nvmlDeviceSetDefaultAutoBoostedClocksEnabled(device, enabled, flags) } // nvml.DeviceGetFanSpeed() -func (l *library) DeviceGetFanSpeed(Device Device) (uint32, Return) { - return Device.GetFanSpeed() +func (l *library) DeviceGetFanSpeed(device Device) (uint32, Return) { + return device.GetFanSpeed() } -func (Device nvmlDevice) GetFanSpeed() (uint32, Return) { - var Speed uint32 - ret := nvmlDeviceGetFanSpeed(Device, &Speed) - return Speed, ret +func (device nvmlDevice) GetFanSpeed() (uint32, Return) { + var speed uint32 + ret := nvmlDeviceGetFanSpeed(device, &speed) + return speed, ret } // nvml.DeviceGetFanSpeed_v2() -func (l *library) DeviceGetFanSpeed_v2(Device Device, Fan int) (uint32, Return) { - return Device.GetFanSpeed_v2(Fan) +func (l *library) DeviceGetFanSpeed_v2(device Device, fan int) (uint32, Return) { + return device.GetFanSpeed_v2(fan) } -func (Device nvmlDevice) GetFanSpeed_v2(Fan int) (uint32, Return) { - var Speed uint32 - ret := nvmlDeviceGetFanSpeed_v2(Device, uint32(Fan), &Speed) - return Speed, ret +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 (l *library) DeviceGetNumFans(Device Device) (int, Return) { - return Device.GetNumFans() +func (l *library) DeviceGetNumFans(device Device) (int, Return) { + return device.GetNumFans() } -func (Device nvmlDevice) GetNumFans() (int, Return) { - var NumFans uint32 - ret := nvmlDeviceGetNumFans(Device, &NumFans) - return int(NumFans), ret +func (device nvmlDevice) GetNumFans() (int, Return) { + var numFans uint32 + ret := nvmlDeviceGetNumFans(device, &numFans) + return int(numFans), ret } // nvml.DeviceGetTemperature() -func (l *library) DeviceGetTemperature(Device Device, SensorType TemperatureSensors) (uint32, Return) { - return Device.GetTemperature(SensorType) +func (l *library) DeviceGetTemperature(device Device, sensorType TemperatureSensors) (uint32, Return) { + return device.GetTemperature(sensorType) } -func (Device nvmlDevice) GetTemperature(SensorType TemperatureSensors) (uint32, Return) { - var Temp uint32 - ret := nvmlDeviceGetTemperature(Device, SensorType, &Temp) - return Temp, ret +func (device nvmlDevice) GetTemperature(sensorType TemperatureSensors) (uint32, Return) { + var temp uint32 + ret := nvmlDeviceGetTemperature(device, sensorType, &temp) + return temp, ret } // nvml.DeviceGetTemperatureThreshold() -func (l *library) DeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds) (uint32, Return) { - return Device.GetTemperatureThreshold(ThresholdType) +func (l *library) DeviceGetTemperatureThreshold(device Device, thresholdType TemperatureThresholds) (uint32, Return) { + return device.GetTemperatureThreshold(thresholdType) } -func (Device nvmlDevice) GetTemperatureThreshold(ThresholdType TemperatureThresholds) (uint32, Return) { - var Temp uint32 - ret := nvmlDeviceGetTemperatureThreshold(Device, ThresholdType, &Temp) - return Temp, ret +func (device nvmlDevice) GetTemperatureThreshold(thresholdType TemperatureThresholds) (uint32, Return) { + var temp uint32 + ret := nvmlDeviceGetTemperatureThreshold(device, thresholdType, &temp) + return temp, ret } // nvml.DeviceSetTemperatureThreshold() -func (l *library) DeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp int) Return { - return Device.SetTemperatureThreshold(ThresholdType, Temp) +func (l *library) DeviceSetTemperatureThreshold(device Device, thresholdType TemperatureThresholds, temp int) Return { + return device.SetTemperatureThreshold(thresholdType, temp) } -func (Device nvmlDevice) SetTemperatureThreshold(ThresholdType TemperatureThresholds, Temp int) Return { - t := int32(Temp) - ret := nvmlDeviceSetTemperatureThreshold(Device, ThresholdType, &t) +func (device nvmlDevice) SetTemperatureThreshold(thresholdType TemperatureThresholds, temp int) Return { + t := int32(temp) + ret := nvmlDeviceSetTemperatureThreshold(device, thresholdType, &t) return ret } // nvml.DeviceGetPerformanceState() -func (l *library) DeviceGetPerformanceState(Device Device) (Pstates, Return) { - return Device.GetPerformanceState() +func (l *library) DeviceGetPerformanceState(device Device) (Pstates, Return) { + return device.GetPerformanceState() } -func (Device nvmlDevice) GetPerformanceState() (Pstates, Return) { - var PState Pstates - ret := nvmlDeviceGetPerformanceState(Device, &PState) - return PState, ret +func (device nvmlDevice) GetPerformanceState() (Pstates, Return) { + var pState Pstates + ret := nvmlDeviceGetPerformanceState(device, &pState) + return pState, ret } // nvml.DeviceGetCurrentClocksThrottleReasons() -func (l *library) DeviceGetCurrentClocksThrottleReasons(Device Device) (uint64, Return) { - return Device.GetCurrentClocksThrottleReasons() +func (l *library) DeviceGetCurrentClocksThrottleReasons(device Device) (uint64, Return) { + return device.GetCurrentClocksThrottleReasons() } -func (Device nvmlDevice) GetCurrentClocksThrottleReasons() (uint64, Return) { - var ClocksThrottleReasons uint64 - ret := nvmlDeviceGetCurrentClocksThrottleReasons(Device, &ClocksThrottleReasons) - return ClocksThrottleReasons, ret +func (device nvmlDevice) GetCurrentClocksThrottleReasons() (uint64, Return) { + var clocksThrottleReasons uint64 + ret := nvmlDeviceGetCurrentClocksThrottleReasons(device, &clocksThrottleReasons) + return clocksThrottleReasons, ret } // nvml.DeviceGetSupportedClocksThrottleReasons() -func (l *library) DeviceGetSupportedClocksThrottleReasons(Device Device) (uint64, Return) { - return Device.GetSupportedClocksThrottleReasons() +func (l *library) DeviceGetSupportedClocksThrottleReasons(device Device) (uint64, Return) { + return device.GetSupportedClocksThrottleReasons() } -func (Device nvmlDevice) GetSupportedClocksThrottleReasons() (uint64, Return) { - var SupportedClocksThrottleReasons uint64 - ret := nvmlDeviceGetSupportedClocksThrottleReasons(Device, &SupportedClocksThrottleReasons) - return SupportedClocksThrottleReasons, ret +func (device nvmlDevice) GetSupportedClocksThrottleReasons() (uint64, Return) { + var supportedClocksThrottleReasons uint64 + ret := nvmlDeviceGetSupportedClocksThrottleReasons(device, &supportedClocksThrottleReasons) + return supportedClocksThrottleReasons, ret } // nvml.DeviceGetPowerState() -func (l *library) DeviceGetPowerState(Device Device) (Pstates, Return) { - return Device.GetPowerState() +func (l *library) DeviceGetPowerState(device Device) (Pstates, Return) { + return device.GetPowerState() } -func (Device nvmlDevice) GetPowerState() (Pstates, Return) { - var PState Pstates - ret := nvmlDeviceGetPowerState(Device, &PState) - return PState, ret +func (device nvmlDevice) GetPowerState() (Pstates, Return) { + var pState Pstates + ret := nvmlDeviceGetPowerState(device, &pState) + return pState, ret } // nvml.DeviceGetPowerManagementMode() -func (l *library) DeviceGetPowerManagementMode(Device Device) (EnableState, Return) { - return Device.GetPowerManagementMode() +func (l *library) DeviceGetPowerManagementMode(device Device) (EnableState, Return) { + return device.GetPowerManagementMode() } -func (Device nvmlDevice) GetPowerManagementMode() (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetPowerManagementMode(Device, &Mode) - return Mode, ret +func (device nvmlDevice) GetPowerManagementMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetPowerManagementMode(device, &mode) + return mode, ret } // nvml.DeviceGetPowerManagementLimit() -func (l *library) DeviceGetPowerManagementLimit(Device Device) (uint32, Return) { - return Device.GetPowerManagementLimit() +func (l *library) DeviceGetPowerManagementLimit(device Device) (uint32, Return) { + return device.GetPowerManagementLimit() } -func (Device nvmlDevice) GetPowerManagementLimit() (uint32, Return) { - var Limit uint32 - ret := nvmlDeviceGetPowerManagementLimit(Device, &Limit) - return Limit, ret +func (device nvmlDevice) GetPowerManagementLimit() (uint32, Return) { + var limit uint32 + ret := nvmlDeviceGetPowerManagementLimit(device, &limit) + return limit, ret } // nvml.DeviceGetPowerManagementLimitConstraints() -func (l *library) DeviceGetPowerManagementLimitConstraints(Device Device) (uint32, uint32, Return) { - return Device.GetPowerManagementLimitConstraints() +func (l *library) DeviceGetPowerManagementLimitConstraints(device Device) (uint32, uint32, Return) { + return device.GetPowerManagementLimitConstraints() } -func (Device nvmlDevice) GetPowerManagementLimitConstraints() (uint32, uint32, Return) { - var MinLimit, MaxLimit uint32 - ret := nvmlDeviceGetPowerManagementLimitConstraints(Device, &MinLimit, &MaxLimit) - return MinLimit, MaxLimit, ret +func (device nvmlDevice) GetPowerManagementLimitConstraints() (uint32, uint32, Return) { + var minLimit, maxLimit uint32 + ret := nvmlDeviceGetPowerManagementLimitConstraints(device, &minLimit, &maxLimit) + return minLimit, maxLimit, ret } // nvml.DeviceGetPowerManagementDefaultLimit() -func (l *library) DeviceGetPowerManagementDefaultLimit(Device Device) (uint32, Return) { - return Device.GetPowerManagementDefaultLimit() +func (l *library) DeviceGetPowerManagementDefaultLimit(device Device) (uint32, Return) { + return device.GetPowerManagementDefaultLimit() } -func (Device nvmlDevice) GetPowerManagementDefaultLimit() (uint32, Return) { - var DefaultLimit uint32 - ret := nvmlDeviceGetPowerManagementDefaultLimit(Device, &DefaultLimit) - return DefaultLimit, ret +func (device nvmlDevice) GetPowerManagementDefaultLimit() (uint32, Return) { + var defaultLimit uint32 + ret := nvmlDeviceGetPowerManagementDefaultLimit(device, &defaultLimit) + return defaultLimit, ret } // nvml.DeviceGetPowerUsage() -func (l *library) DeviceGetPowerUsage(Device Device) (uint32, Return) { - return Device.GetPowerUsage() +func (l *library) DeviceGetPowerUsage(device Device) (uint32, Return) { + return device.GetPowerUsage() } -func (Device nvmlDevice) GetPowerUsage() (uint32, Return) { - var Power uint32 - ret := nvmlDeviceGetPowerUsage(Device, &Power) - return Power, ret +func (device nvmlDevice) GetPowerUsage() (uint32, Return) { + var power uint32 + ret := nvmlDeviceGetPowerUsage(device, &power) + return power, ret } // nvml.DeviceGetTotalEnergyConsumption() -func (l *library) DeviceGetTotalEnergyConsumption(Device Device) (uint64, Return) { - return Device.GetTotalEnergyConsumption() +func (l *library) DeviceGetTotalEnergyConsumption(device Device) (uint64, Return) { + return device.GetTotalEnergyConsumption() } -func (Device nvmlDevice) GetTotalEnergyConsumption() (uint64, Return) { - var Energy uint64 - ret := nvmlDeviceGetTotalEnergyConsumption(Device, &Energy) - return Energy, ret +func (device nvmlDevice) GetTotalEnergyConsumption() (uint64, Return) { + var energy uint64 + ret := nvmlDeviceGetTotalEnergyConsumption(device, &energy) + return energy, ret } // nvml.DeviceGetEnforcedPowerLimit() -func (l *library) DeviceGetEnforcedPowerLimit(Device Device) (uint32, Return) { - return Device.GetEnforcedPowerLimit() +func (l *library) DeviceGetEnforcedPowerLimit(device Device) (uint32, Return) { + return device.GetEnforcedPowerLimit() } -func (Device nvmlDevice) GetEnforcedPowerLimit() (uint32, Return) { - var Limit uint32 - ret := nvmlDeviceGetEnforcedPowerLimit(Device, &Limit) - return Limit, ret +func (device nvmlDevice) GetEnforcedPowerLimit() (uint32, Return) { + var limit uint32 + ret := nvmlDeviceGetEnforcedPowerLimit(device, &limit) + return limit, ret } // nvml.DeviceGetGpuOperationMode() -func (l *library) DeviceGetGpuOperationMode(Device Device) (GpuOperationMode, GpuOperationMode, Return) { - return Device.GetGpuOperationMode() +func (l *library) DeviceGetGpuOperationMode(device Device) (GpuOperationMode, GpuOperationMode, Return) { + return device.GetGpuOperationMode() } -func (Device nvmlDevice) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) { - var Current, Pending GpuOperationMode - ret := nvmlDeviceGetGpuOperationMode(Device, &Current, &Pending) - return Current, Pending, ret +func (device nvmlDevice) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) { + var current, pending GpuOperationMode + ret := nvmlDeviceGetGpuOperationMode(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetMemoryInfo() -func (l *library) DeviceGetMemoryInfo(Device Device) (Memory, Return) { - return Device.GetMemoryInfo() +func (l *library) DeviceGetMemoryInfo(device Device) (Memory, Return) { + return device.GetMemoryInfo() } -func (Device nvmlDevice) GetMemoryInfo() (Memory, Return) { - var Memory Memory - ret := nvmlDeviceGetMemoryInfo(Device, &Memory) - return Memory, ret +func (device nvmlDevice) GetMemoryInfo() (Memory, Return) { + var memory Memory + ret := nvmlDeviceGetMemoryInfo(device, &memory) + return memory, ret } // nvml.DeviceGetMemoryInfo_v2() -func (l *library) DeviceGetMemoryInfo_v2(Device Device) (Memory_v2, Return) { - return Device.GetMemoryInfo_v2() +func (l *library) DeviceGetMemoryInfo_v2(device Device) (Memory_v2, Return) { + return device.GetMemoryInfo_v2() } -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 +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 (l *library) DeviceGetComputeMode(Device Device) (ComputeMode, Return) { - return Device.GetComputeMode() +func (l *library) DeviceGetComputeMode(device Device) (ComputeMode, Return) { + return device.GetComputeMode() } -func (Device nvmlDevice) GetComputeMode() (ComputeMode, Return) { - var Mode ComputeMode - ret := nvmlDeviceGetComputeMode(Device, &Mode) - return Mode, ret +func (device nvmlDevice) GetComputeMode() (ComputeMode, Return) { + var mode ComputeMode + ret := nvmlDeviceGetComputeMode(device, &mode) + return mode, ret } // nvml.DeviceGetCudaComputeCapability() -func (l *library) DeviceGetCudaComputeCapability(Device Device) (int, int, Return) { - return Device.GetCudaComputeCapability() +func (l *library) DeviceGetCudaComputeCapability(device Device) (int, int, Return) { + return device.GetCudaComputeCapability() } -func (Device nvmlDevice) GetCudaComputeCapability() (int, int, Return) { - var Major, Minor int32 - ret := nvmlDeviceGetCudaComputeCapability(Device, &Major, &Minor) - return int(Major), int(Minor), ret +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 (l *library) DeviceGetEccMode(Device Device) (EnableState, EnableState, Return) { - return Device.GetEccMode() +func (l *library) DeviceGetEccMode(device Device) (EnableState, EnableState, Return) { + return device.GetEccMode() } -func (Device nvmlDevice) GetEccMode() (EnableState, EnableState, Return) { - var Current, Pending EnableState - ret := nvmlDeviceGetEccMode(Device, &Current, &Pending) - return Current, Pending, ret +func (device nvmlDevice) GetEccMode() (EnableState, EnableState, Return) { + var current, pending EnableState + ret := nvmlDeviceGetEccMode(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetBoardId() -func (l *library) DeviceGetBoardId(Device Device) (uint32, Return) { - return Device.GetBoardId() +func (l *library) DeviceGetBoardId(device Device) (uint32, Return) { + return device.GetBoardId() } -func (Device nvmlDevice) GetBoardId() (uint32, Return) { - var BoardId uint32 - ret := nvmlDeviceGetBoardId(Device, &BoardId) - return BoardId, ret +func (device nvmlDevice) GetBoardId() (uint32, Return) { + var boardId uint32 + ret := nvmlDeviceGetBoardId(device, &boardId) + return boardId, ret } // nvml.DeviceGetMultiGpuBoard() -func (l *library) DeviceGetMultiGpuBoard(Device Device) (int, Return) { - return Device.GetMultiGpuBoard() +func (l *library) DeviceGetMultiGpuBoard(device Device) (int, Return) { + return device.GetMultiGpuBoard() } -func (Device nvmlDevice) GetMultiGpuBoard() (int, Return) { - var MultiGpuBool uint32 - ret := nvmlDeviceGetMultiGpuBoard(Device, &MultiGpuBool) - return int(MultiGpuBool), ret +func (device nvmlDevice) GetMultiGpuBoard() (int, Return) { + var multiGpuBool uint32 + ret := nvmlDeviceGetMultiGpuBoard(device, &multiGpuBool) + return int(multiGpuBool), ret } // nvml.DeviceGetTotalEccErrors() -func (l *library) DeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { - return Device.GetTotalEccErrors(ErrorType, CounterType) +func (l *library) DeviceGetTotalEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) { + return device.GetTotalEccErrors(errorType, counterType) } -func (Device nvmlDevice) GetTotalEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { - var EccCounts uint64 - ret := nvmlDeviceGetTotalEccErrors(Device, ErrorType, CounterType, &EccCounts) - return EccCounts, ret +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 (l *library) DeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { - return Device.GetDetailedEccErrors(ErrorType, CounterType) +func (l *library) DeviceGetDetailedEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) { + return device.GetDetailedEccErrors(errorType, counterType) } -func (Device nvmlDevice) GetDetailedEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { - var EccCounts EccErrorCounts - ret := nvmlDeviceGetDetailedEccErrors(Device, ErrorType, CounterType, &EccCounts) - return EccCounts, ret +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 (l *library) DeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { - return Device.GetMemoryErrorCounter(ErrorType, CounterType, LocationType) +func (l *library) DeviceGetMemoryErrorCounter(device Device, errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) { + return device.GetMemoryErrorCounter(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 +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 (l *library) DeviceGetUtilizationRates(Device Device) (Utilization, Return) { - return Device.GetUtilizationRates() +func (l *library) DeviceGetUtilizationRates(device Device) (Utilization, Return) { + return device.GetUtilizationRates() } -func (Device nvmlDevice) GetUtilizationRates() (Utilization, Return) { - var Utilization Utilization - ret := nvmlDeviceGetUtilizationRates(Device, &Utilization) - return Utilization, ret +func (device nvmlDevice) GetUtilizationRates() (Utilization, Return) { + var utilization Utilization + ret := nvmlDeviceGetUtilizationRates(device, &utilization) + return utilization, ret } // nvml.DeviceGetEncoderUtilization() -func (l *library) DeviceGetEncoderUtilization(Device Device) (uint32, uint32, Return) { - return Device.GetEncoderUtilization() +func (l *library) DeviceGetEncoderUtilization(device Device) (uint32, uint32, Return) { + return device.GetEncoderUtilization() } -func (Device nvmlDevice) GetEncoderUtilization() (uint32, uint32, Return) { - var Utilization, SamplingPeriodUs uint32 - ret := nvmlDeviceGetEncoderUtilization(Device, &Utilization, &SamplingPeriodUs) - return Utilization, SamplingPeriodUs, ret +func (device nvmlDevice) GetEncoderUtilization() (uint32, uint32, Return) { + var utilization, samplingPeriodUs uint32 + ret := nvmlDeviceGetEncoderUtilization(device, &utilization, &samplingPeriodUs) + return utilization, samplingPeriodUs, ret } // nvml.DeviceGetEncoderCapacity() -func (l *library) DeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType) (int, Return) { - return Device.GetEncoderCapacity(EncoderQueryType) +func (l *library) DeviceGetEncoderCapacity(device Device, encoderQueryType EncoderType) (int, Return) { + return device.GetEncoderCapacity(encoderQueryType) } -func (Device nvmlDevice) GetEncoderCapacity(EncoderQueryType EncoderType) (int, Return) { - var EncoderCapacity uint32 - ret := nvmlDeviceGetEncoderCapacity(Device, EncoderQueryType, &EncoderCapacity) - return int(EncoderCapacity), ret +func (device nvmlDevice) GetEncoderCapacity(encoderQueryType EncoderType) (int, Return) { + var encoderCapacity uint32 + ret := nvmlDeviceGetEncoderCapacity(device, encoderQueryType, &encoderCapacity) + return int(encoderCapacity), ret } // nvml.DeviceGetEncoderStats() -func (l *library) DeviceGetEncoderStats(Device Device) (int, uint32, uint32, Return) { - return Device.GetEncoderStats() +func (l *library) DeviceGetEncoderStats(device Device) (int, uint32, uint32, Return) { + return device.GetEncoderStats() } -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 +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 (l *library) DeviceGetEncoderSessions(Device Device) ([]EncoderSessionInfo, Return) { - return Device.GetEncoderSessions() +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 +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 } } // nvml.DeviceGetDecoderUtilization() -func (l *library) DeviceGetDecoderUtilization(Device Device) (uint32, uint32, Return) { - return Device.GetDecoderUtilization() +func (l *library) DeviceGetDecoderUtilization(device Device) (uint32, uint32, Return) { + return device.GetDecoderUtilization() } -func (Device nvmlDevice) GetDecoderUtilization() (uint32, uint32, Return) { - var Utilization, SamplingPeriodUs uint32 - ret := nvmlDeviceGetDecoderUtilization(Device, &Utilization, &SamplingPeriodUs) - return Utilization, SamplingPeriodUs, ret +func (device nvmlDevice) GetDecoderUtilization() (uint32, uint32, Return) { + var utilization, samplingPeriodUs uint32 + ret := nvmlDeviceGetDecoderUtilization(device, &utilization, &samplingPeriodUs) + return utilization, samplingPeriodUs, ret } // nvml.DeviceGetFBCStats() -func (l *library) DeviceGetFBCStats(Device Device) (FBCStats, Return) { - return Device.GetFBCStats() +func (l *library) DeviceGetFBCStats(device Device) (FBCStats, Return) { + return device.GetFBCStats() } -func (Device nvmlDevice) GetFBCStats() (FBCStats, Return) { - var FbcStats FBCStats - ret := nvmlDeviceGetFBCStats(Device, &FbcStats) - return FbcStats, ret +func (device nvmlDevice) GetFBCStats() (FBCStats, Return) { + var fbcStats FBCStats + ret := nvmlDeviceGetFBCStats(device, &fbcStats) + return fbcStats, ret } // nvml.DeviceGetFBCSessions() -func (l *library) DeviceGetFBCSessions(Device Device) ([]FBCSessionInfo, Return) { - return Device.GetFBCSessions() +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 +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 } } // nvml.DeviceGetDriverModel() -func (l *library) DeviceGetDriverModel(Device Device) (DriverModel, DriverModel, Return) { - return Device.GetDriverModel() +func (l *library) DeviceGetDriverModel(device Device) (DriverModel, DriverModel, Return) { + return device.GetDriverModel() } -func (Device nvmlDevice) GetDriverModel() (DriverModel, DriverModel, Return) { - var Current, Pending DriverModel - ret := nvmlDeviceGetDriverModel(Device, &Current, &Pending) - return Current, Pending, ret +func (device nvmlDevice) GetDriverModel() (DriverModel, DriverModel, Return) { + var current, pending DriverModel + ret := nvmlDeviceGetDriverModel(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetVbiosVersion() -func (l *library) DeviceGetVbiosVersion(Device Device) (string, Return) { - return Device.GetVbiosVersion() +func (l *library) DeviceGetVbiosVersion(device Device) (string, Return) { + return device.GetVbiosVersion() } -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 +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 (l *library) DeviceGetBridgeChipInfo(Device Device) (BridgeChipHierarchy, Return) { - return Device.GetBridgeChipInfo() +func (l *library) DeviceGetBridgeChipInfo(device Device) (BridgeChipHierarchy, Return) { + return device.GetBridgeChipInfo() } -func (Device nvmlDevice) GetBridgeChipInfo() (BridgeChipHierarchy, Return) { - var BridgeHierarchy BridgeChipHierarchy - ret := nvmlDeviceGetBridgeChipInfo(Device, &BridgeHierarchy) - return BridgeHierarchy, ret +func (device nvmlDevice) GetBridgeChipInfo() (BridgeChipHierarchy, Return) { + var bridgeHierarchy BridgeChipHierarchy + ret := nvmlDeviceGetBridgeChipInfo(device, &bridgeHierarchy) + return bridgeHierarchy, ret } // nvml.DeviceGetComputeRunningProcesses() -func deviceGetComputeRunningProcesses_v1(Device nvmlDevice) ([]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 nvmlDevice) ([]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 nvmlDevice) ([]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 (l *library) DeviceGetComputeRunningProcesses(Device Device) ([]ProcessInfo, Return) { - return Device.GetComputeRunningProcesses() +func (l *library) DeviceGetComputeRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetComputeRunningProcesses() } -func (Device nvmlDevice) GetComputeRunningProcesses() ([]ProcessInfo, Return) { - return deviceGetComputeRunningProcesses(Device) +func (device nvmlDevice) GetComputeRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetComputeRunningProcesses(device) } // nvml.DeviceGetGraphicsRunningProcesses() -func deviceGetGraphicsRunningProcesses_v1(Device nvmlDevice) ([]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 nvmlDevice) ([]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 nvmlDevice) ([]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 (l *library) DeviceGetGraphicsRunningProcesses(Device Device) ([]ProcessInfo, Return) { - return Device.GetGraphicsRunningProcesses() +func (l *library) DeviceGetGraphicsRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetGraphicsRunningProcesses() } -func (Device nvmlDevice) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { - return deviceGetGraphicsRunningProcesses(Device) +func (device nvmlDevice) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetGraphicsRunningProcesses(device) } // nvml.DeviceGetMPSComputeRunningProcesses() -func deviceGetMPSComputeRunningProcesses_v1(Device nvmlDevice) ([]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 nvmlDevice) ([]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 nvmlDevice) ([]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 (l *library) DeviceGetMPSComputeRunningProcesses(Device Device) ([]ProcessInfo, Return) { - return Device.GetMPSComputeRunningProcesses() +func (l *library) DeviceGetMPSComputeRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetMPSComputeRunningProcesses() } -func (Device nvmlDevice) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { - return deviceGetMPSComputeRunningProcesses(Device) +func (device nvmlDevice) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetMPSComputeRunningProcesses(device) } // nvml.DeviceOnSameBoard() -func (l *library) DeviceOnSameBoard(Device1 Device, Device2 Device) (int, Return) { - return Device1.OnSameBoard(Device2) +func (l *library) DeviceOnSameBoard(device1 Device, device2 Device) (int, Return) { + return device1.OnSameBoard(device2) } -func (Device1 nvmlDevice) OnSameBoard(Device2 Device) (int, Return) { - var OnSameBoard int32 - ret := nvmlDeviceOnSameBoard(Device1, Device2.(nvmlDevice), &OnSameBoard) - return int(OnSameBoard), ret +func (device1 nvmlDevice) OnSameBoard(device2 Device) (int, Return) { + var onSameBoard int32 + ret := nvmlDeviceOnSameBoard(device1, device2.(nvmlDevice), &onSameBoard) + return int(onSameBoard), ret } // nvml.DeviceGetAPIRestriction() -func (l *library) DeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI) (EnableState, Return) { - return Device.GetAPIRestriction(ApiType) +func (l *library) DeviceGetAPIRestriction(device Device, apiType RestrictedAPI) (EnableState, Return) { + return device.GetAPIRestriction(apiType) } -func (Device nvmlDevice) GetAPIRestriction(ApiType RestrictedAPI) (EnableState, Return) { - var IsRestricted EnableState - ret := nvmlDeviceGetAPIRestriction(Device, ApiType, &IsRestricted) - return IsRestricted, ret +func (device nvmlDevice) GetAPIRestriction(apiType RestrictedAPI) (EnableState, Return) { + var isRestricted EnableState + ret := nvmlDeviceGetAPIRestriction(device, apiType, &isRestricted) + return isRestricted, ret } // nvml.DeviceGetSamples() -func (l *library) DeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { - return Device.GetSamples(_type, LastSeenTimeStamp) +func (l *library) DeviceGetSamples(device Device, samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) { + return device.GetSamples(samplingType, lastSeenTimestamp) } -func (Device nvmlDevice) GetSamples(_type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { - var SampleValType ValueType - var SampleCount uint32 - ret := nvmlDeviceGetSamples(Device, _type, LastSeenTimeStamp, &SampleValType, &SampleCount, nil) +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 + samples := make([]Sample, sampleCount) + ret = nvmlDeviceGetSamples(device, samplingType, lastSeenTimestamp, &sampleValType, &sampleCount, &samples[0]) + return sampleValType, samples, ret } // nvml.DeviceGetBAR1MemoryInfo() -func (l *library) DeviceGetBAR1MemoryInfo(Device Device) (BAR1Memory, Return) { - return Device.GetBAR1MemoryInfo() +func (l *library) DeviceGetBAR1MemoryInfo(device Device) (BAR1Memory, Return) { + return device.GetBAR1MemoryInfo() } -func (Device nvmlDevice) GetBAR1MemoryInfo() (BAR1Memory, Return) { - var Bar1Memory BAR1Memory - ret := nvmlDeviceGetBAR1MemoryInfo(Device, &Bar1Memory) - return Bar1Memory, ret +func (device nvmlDevice) GetBAR1MemoryInfo() (BAR1Memory, Return) { + var bar1Memory BAR1Memory + ret := nvmlDeviceGetBAR1MemoryInfo(device, &bar1Memory) + return bar1Memory, ret } // nvml.DeviceGetViolationStatus() -func (l *library) DeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType) (ViolationTime, Return) { - return Device.GetViolationStatus(PerfPolicyType) +func (l *library) DeviceGetViolationStatus(device Device, perfPolicyType PerfPolicyType) (ViolationTime, Return) { + return device.GetViolationStatus(perfPolicyType) } -func (Device nvmlDevice) GetViolationStatus(PerfPolicyType PerfPolicyType) (ViolationTime, Return) { - var ViolTime ViolationTime - ret := nvmlDeviceGetViolationStatus(Device, PerfPolicyType, &ViolTime) - return ViolTime, ret +func (device nvmlDevice) GetViolationStatus(perfPolicyType PerfPolicyType) (ViolationTime, Return) { + var violTime ViolationTime + ret := nvmlDeviceGetViolationStatus(device, perfPolicyType, &violTime) + return violTime, ret } // nvml.DeviceGetIrqNum() -func (l *library) DeviceGetIrqNum(Device Device) (int, Return) { - return Device.GetIrqNum() +func (l *library) DeviceGetIrqNum(device Device) (int, Return) { + return device.GetIrqNum() } -func (Device nvmlDevice) GetIrqNum() (int, Return) { - var IrqNum uint32 - ret := nvmlDeviceGetIrqNum(Device, &IrqNum) - return int(IrqNum), ret +func (device nvmlDevice) GetIrqNum() (int, Return) { + var irqNum uint32 + ret := nvmlDeviceGetIrqNum(device, &irqNum) + return int(irqNum), ret } // nvml.DeviceGetNumGpuCores() -func (l *library) DeviceGetNumGpuCores(Device Device) (int, Return) { - return Device.GetNumGpuCores() +func (l *library) DeviceGetNumGpuCores(device Device) (int, Return) { + return device.GetNumGpuCores() } -func (Device nvmlDevice) GetNumGpuCores() (int, Return) { - var NumCores uint32 - ret := nvmlDeviceGetNumGpuCores(Device, &NumCores) - return int(NumCores), ret +func (device nvmlDevice) GetNumGpuCores() (int, Return) { + var numCores uint32 + ret := nvmlDeviceGetNumGpuCores(device, &numCores) + return int(numCores), ret } // nvml.DeviceGetPowerSource() -func (l *library) DeviceGetPowerSource(Device Device) (PowerSource, Return) { - return Device.GetPowerSource() +func (l *library) DeviceGetPowerSource(device Device) (PowerSource, Return) { + return device.GetPowerSource() } -func (Device nvmlDevice) GetPowerSource() (PowerSource, Return) { - var PowerSource PowerSource - ret := nvmlDeviceGetPowerSource(Device, &PowerSource) - return PowerSource, ret +func (device nvmlDevice) GetPowerSource() (PowerSource, Return) { + var powerSource PowerSource + ret := nvmlDeviceGetPowerSource(device, &powerSource) + return powerSource, ret } // nvml.DeviceGetMemoryBusWidth() -func (l *library) DeviceGetMemoryBusWidth(Device Device) (uint32, Return) { - return Device.GetMemoryBusWidth() +func (l *library) DeviceGetMemoryBusWidth(device Device) (uint32, Return) { + return device.GetMemoryBusWidth() } -func (Device nvmlDevice) GetMemoryBusWidth() (uint32, Return) { - var BusWidth uint32 - ret := nvmlDeviceGetMemoryBusWidth(Device, &BusWidth) - return BusWidth, ret +func (device nvmlDevice) GetMemoryBusWidth() (uint32, Return) { + var busWidth uint32 + ret := nvmlDeviceGetMemoryBusWidth(device, &busWidth) + return busWidth, ret } // nvml.DeviceGetPcieLinkMaxSpeed() -func (l *library) DeviceGetPcieLinkMaxSpeed(Device Device) (uint32, Return) { - return Device.GetPcieLinkMaxSpeed() +func (l *library) DeviceGetPcieLinkMaxSpeed(device Device) (uint32, Return) { + return device.GetPcieLinkMaxSpeed() } -func (Device nvmlDevice) GetPcieLinkMaxSpeed() (uint32, Return) { - var MaxSpeed uint32 - ret := nvmlDeviceGetPcieLinkMaxSpeed(Device, &MaxSpeed) - return MaxSpeed, ret +func (device nvmlDevice) GetPcieLinkMaxSpeed() (uint32, Return) { + var maxSpeed uint32 + ret := nvmlDeviceGetPcieLinkMaxSpeed(device, &maxSpeed) + return maxSpeed, ret } // nvml.DeviceGetAdaptiveClockInfoStatus() -func (l *library) DeviceGetAdaptiveClockInfoStatus(Device Device) (uint32, Return) { - return Device.GetAdaptiveClockInfoStatus() +func (l *library) DeviceGetAdaptiveClockInfoStatus(device Device) (uint32, Return) { + return device.GetAdaptiveClockInfoStatus() } -func (Device nvmlDevice) GetAdaptiveClockInfoStatus() (uint32, Return) { - var AdaptiveClockStatus uint32 - ret := nvmlDeviceGetAdaptiveClockInfoStatus(Device, &AdaptiveClockStatus) - return AdaptiveClockStatus, ret +func (device nvmlDevice) GetAdaptiveClockInfoStatus() (uint32, Return) { + var adaptiveClockStatus uint32 + ret := nvmlDeviceGetAdaptiveClockInfoStatus(device, &adaptiveClockStatus) + return adaptiveClockStatus, ret } // nvml.DeviceGetAccountingMode() -func (l *library) DeviceGetAccountingMode(Device Device) (EnableState, Return) { - return Device.GetAccountingMode() +func (l *library) DeviceGetAccountingMode(device Device) (EnableState, Return) { + return device.GetAccountingMode() } -func (Device nvmlDevice) GetAccountingMode() (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetAccountingMode(Device, &Mode) - return Mode, ret +func (device nvmlDevice) GetAccountingMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetAccountingMode(device, &mode) + return mode, ret } // nvml.DeviceGetAccountingStats() -func (l *library) DeviceGetAccountingStats(Device Device, Pid uint32) (AccountingStats, Return) { - return Device.GetAccountingStats(Pid) +func (l *library) DeviceGetAccountingStats(device Device, pid uint32) (AccountingStats, Return) { + return device.GetAccountingStats(pid) } -func (Device nvmlDevice) GetAccountingStats(Pid uint32) (AccountingStats, Return) { - var Stats AccountingStats - ret := nvmlDeviceGetAccountingStats(Device, Pid, &Stats) - return Stats, ret +func (device nvmlDevice) GetAccountingStats(pid uint32) (AccountingStats, Return) { + var stats AccountingStats + ret := nvmlDeviceGetAccountingStats(device, pid, &stats) + return stats, ret } // nvml.DeviceGetAccountingPids() -func (l *library) DeviceGetAccountingPids(Device Device) ([]int, Return) { - return Device.GetAccountingPids() +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 +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 } } // nvml.DeviceGetAccountingBufferSize() -func (l *library) DeviceGetAccountingBufferSize(Device Device) (int, Return) { - return Device.GetAccountingBufferSize() +func (l *library) DeviceGetAccountingBufferSize(device Device) (int, Return) { + return device.GetAccountingBufferSize() } -func (Device nvmlDevice) GetAccountingBufferSize() (int, Return) { - var BufferSize uint32 - ret := nvmlDeviceGetAccountingBufferSize(Device, &BufferSize) - return int(BufferSize), ret +func (device nvmlDevice) GetAccountingBufferSize() (int, Return) { + var bufferSize uint32 + ret := nvmlDeviceGetAccountingBufferSize(device, &bufferSize) + return int(bufferSize), ret } // nvml.DeviceGetRetiredPages() -func (l *library) DeviceGetRetiredPages(Device Device, Cause PageRetirementCause) ([]uint64, Return) { - return Device.GetRetiredPages(Cause) +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 +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 } } // nvml.DeviceGetRetiredPages_v2() -func (l *library) DeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause) ([]uint64, []uint64, Return) { - return Device.GetRetiredPages_v2(Cause) +func (l *library) DeviceGetRetiredPages_v2(device Device, cause PageRetirementCause) ([]uint64, []uint64, Return) { + return device.GetRetiredPages_v2(cause) } -func (Device nvmlDevice) GetRetiredPages_v2(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 } } // nvml.DeviceGetRetiredPagesPendingStatus() -func (l *library) DeviceGetRetiredPagesPendingStatus(Device Device) (EnableState, Return) { - return Device.GetRetiredPagesPendingStatus() +func (l *library) DeviceGetRetiredPagesPendingStatus(device Device) (EnableState, Return) { + return device.GetRetiredPagesPendingStatus() } -func (Device nvmlDevice) GetRetiredPagesPendingStatus() (EnableState, Return) { - var IsPending EnableState - ret := nvmlDeviceGetRetiredPagesPendingStatus(Device, &IsPending) - return IsPending, ret +func (device nvmlDevice) GetRetiredPagesPendingStatus() (EnableState, Return) { + var isPending EnableState + ret := nvmlDeviceGetRetiredPagesPendingStatus(device, &isPending) + return isPending, ret } // nvml.DeviceSetPersistenceMode() -func (l *library) DeviceSetPersistenceMode(Device Device, Mode EnableState) Return { - return Device.SetPersistenceMode(Mode) +func (l *library) DeviceSetPersistenceMode(device Device, mode EnableState) Return { + return device.SetPersistenceMode(mode) } -func (Device nvmlDevice) SetPersistenceMode(Mode EnableState) Return { - return nvmlDeviceSetPersistenceMode(Device, Mode) +func (device nvmlDevice) SetPersistenceMode(mode EnableState) Return { + return nvmlDeviceSetPersistenceMode(device, mode) } // nvml.DeviceSetComputeMode() -func (l *library) DeviceSetComputeMode(Device Device, Mode ComputeMode) Return { - return Device.SetComputeMode(Mode) +func (l *library) DeviceSetComputeMode(device Device, mode ComputeMode) Return { + return device.SetComputeMode(mode) } -func (Device nvmlDevice) SetComputeMode(Mode ComputeMode) Return { - return nvmlDeviceSetComputeMode(Device, Mode) +func (device nvmlDevice) SetComputeMode(mode ComputeMode) Return { + return nvmlDeviceSetComputeMode(device, mode) } // nvml.DeviceSetEccMode() -func (l *library) DeviceSetEccMode(Device Device, Ecc EnableState) Return { - return Device.SetEccMode(Ecc) +func (l *library) DeviceSetEccMode(device Device, ecc EnableState) Return { + return device.SetEccMode(ecc) } -func (Device nvmlDevice) SetEccMode(Ecc EnableState) Return { - return nvmlDeviceSetEccMode(Device, Ecc) +func (device nvmlDevice) SetEccMode(ecc EnableState) Return { + return nvmlDeviceSetEccMode(device, ecc) } // nvml.DeviceClearEccErrorCounts() -func (l *library) DeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return { - return Device.ClearEccErrorCounts(CounterType) +func (l *library) DeviceClearEccErrorCounts(device Device, counterType EccCounterType) Return { + return device.ClearEccErrorCounts(counterType) } -func (Device nvmlDevice) ClearEccErrorCounts(CounterType EccCounterType) Return { - return nvmlDeviceClearEccErrorCounts(Device, CounterType) +func (device nvmlDevice) ClearEccErrorCounts(counterType EccCounterType) Return { + return nvmlDeviceClearEccErrorCounts(device, counterType) } // nvml.DeviceSetDriverModel() -func (l *library) DeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return { - return Device.SetDriverModel(DriverModel, Flags) +func (l *library) DeviceSetDriverModel(device Device, driverModel DriverModel, flags uint32) Return { + return device.SetDriverModel(driverModel, flags) } -func (Device nvmlDevice) SetDriverModel(DriverModel DriverModel, Flags uint32) Return { - return nvmlDeviceSetDriverModel(Device, DriverModel, Flags) +func (device nvmlDevice) SetDriverModel(driverModel DriverModel, flags uint32) Return { + return nvmlDeviceSetDriverModel(device, driverModel, flags) } // nvml.DeviceSetGpuLockedClocks() -func (l *library) DeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - return Device.SetGpuLockedClocks(MinGpuClockMHz, MaxGpuClockMHz) +func (l *library) DeviceSetGpuLockedClocks(device Device, minGpuClockMHz uint32, maxGpuClockMHz uint32) Return { + return device.SetGpuLockedClocks(minGpuClockMHz, maxGpuClockMHz) } -func (Device nvmlDevice) SetGpuLockedClocks(MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - return nvmlDeviceSetGpuLockedClocks(Device, MinGpuClockMHz, MaxGpuClockMHz) +func (device nvmlDevice) SetGpuLockedClocks(minGpuClockMHz uint32, maxGpuClockMHz uint32) Return { + return nvmlDeviceSetGpuLockedClocks(device, minGpuClockMHz, maxGpuClockMHz) } // nvml.DeviceResetGpuLockedClocks() -func (l *library) DeviceResetGpuLockedClocks(Device Device) Return { - return Device.ResetGpuLockedClocks() +func (l *library) DeviceResetGpuLockedClocks(device Device) Return { + return device.ResetGpuLockedClocks() } -func (Device nvmlDevice) ResetGpuLockedClocks() Return { - return nvmlDeviceResetGpuLockedClocks(Device) +func (device nvmlDevice) ResetGpuLockedClocks() Return { + return nvmlDeviceResetGpuLockedClocks(device) } // nvmlDeviceSetMemoryLockedClocks() -func (l *library) DeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - return Device.SetMemoryLockedClocks(MinMemClockMHz, MaxMemClockMHz) +func (l *library) DeviceSetMemoryLockedClocks(device Device, minMemClockMHz uint32, maxMemClockMHz uint32) Return { + return device.SetMemoryLockedClocks(minMemClockMHz, maxMemClockMHz) } -func (Device nvmlDevice) SetMemoryLockedClocks(NinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - return nvmlDeviceSetMemoryLockedClocks(Device, NinMemClockMHz, MaxMemClockMHz) +func (device nvmlDevice) SetMemoryLockedClocks(minMemClockMHz uint32, maxMemClockMHz uint32) Return { + return nvmlDeviceSetMemoryLockedClocks(device, minMemClockMHz, maxMemClockMHz) } // nvmlDeviceResetMemoryLockedClocks() -func (l *library) DeviceResetMemoryLockedClocks(Device Device) Return { - return Device.ResetMemoryLockedClocks() +func (l *library) DeviceResetMemoryLockedClocks(device Device) Return { + return device.ResetMemoryLockedClocks() } -func (Device nvmlDevice) ResetMemoryLockedClocks() Return { - return nvmlDeviceResetMemoryLockedClocks(Device) +func (device nvmlDevice) ResetMemoryLockedClocks() Return { + return nvmlDeviceResetMemoryLockedClocks(device) } // nvml.DeviceGetClkMonStatus() -func (l *library) DeviceGetClkMonStatus(Device Device) (ClkMonStatus, Return) { - return Device.GetClkMonStatus() +func (l *library) DeviceGetClkMonStatus(device Device) (ClkMonStatus, Return) { + return device.GetClkMonStatus() } -func (Device nvmlDevice) GetClkMonStatus() (ClkMonStatus, Return) { - var Status ClkMonStatus - ret := nvmlDeviceGetClkMonStatus(Device, &Status) - return Status, ret +func (device nvmlDevice) GetClkMonStatus() (ClkMonStatus, Return) { + var status ClkMonStatus + ret := nvmlDeviceGetClkMonStatus(device, &status) + return status, ret } // nvml.DeviceSetApplicationsClocks() -func (l *library) DeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return { - return Device.SetApplicationsClocks(MemClockMHz, GraphicsClockMHz) +func (l *library) DeviceSetApplicationsClocks(device Device, memClockMHz uint32, graphicsClockMHz uint32) Return { + return device.SetApplicationsClocks(memClockMHz, graphicsClockMHz) } -func (Device nvmlDevice) SetApplicationsClocks(MemClockMHz uint32, GraphicsClockMHz uint32) Return { - return nvmlDeviceSetApplicationsClocks(Device, MemClockMHz, GraphicsClockMHz) +func (device nvmlDevice) SetApplicationsClocks(memClockMHz uint32, graphicsClockMHz uint32) Return { + return nvmlDeviceSetApplicationsClocks(device, memClockMHz, graphicsClockMHz) } // nvml.DeviceSetPowerManagementLimit() -func (l *library) DeviceSetPowerManagementLimit(Device Device, Limit uint32) Return { - return Device.SetPowerManagementLimit(Limit) +func (l *library) DeviceSetPowerManagementLimit(device Device, limit uint32) Return { + return device.SetPowerManagementLimit(limit) } -func (Device nvmlDevice) SetPowerManagementLimit(Limit uint32) Return { - return nvmlDeviceSetPowerManagementLimit(Device, Limit) +func (device nvmlDevice) SetPowerManagementLimit(limit uint32) Return { + return nvmlDeviceSetPowerManagementLimit(device, limit) } // nvml.DeviceSetGpuOperationMode() -func (l *library) DeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return { - return Device.SetGpuOperationMode(Mode) +func (l *library) DeviceSetGpuOperationMode(device Device, mode GpuOperationMode) Return { + return device.SetGpuOperationMode(mode) } -func (Device nvmlDevice) SetGpuOperationMode(Mode GpuOperationMode) Return { - return nvmlDeviceSetGpuOperationMode(Device, Mode) +func (device nvmlDevice) SetGpuOperationMode(mode GpuOperationMode) Return { + return nvmlDeviceSetGpuOperationMode(device, mode) } // nvml.DeviceSetAPIRestriction() -func (l *library) DeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return { - return Device.SetAPIRestriction(ApiType, IsRestricted) +func (l *library) DeviceSetAPIRestriction(device Device, apiType RestrictedAPI, isRestricted EnableState) Return { + return device.SetAPIRestriction(apiType, isRestricted) } -func (Device nvmlDevice) SetAPIRestriction(ApiType RestrictedAPI, IsRestricted EnableState) Return { - return nvmlDeviceSetAPIRestriction(Device, ApiType, IsRestricted) +func (device nvmlDevice) SetAPIRestriction(apiType RestrictedAPI, isRestricted EnableState) Return { + return nvmlDeviceSetAPIRestriction(device, apiType, isRestricted) } // nvml.DeviceSetAccountingMode() -func (l *library) DeviceSetAccountingMode(Device Device, Mode EnableState) Return { - return Device.SetAccountingMode(Mode) +func (l *library) DeviceSetAccountingMode(device Device, mode EnableState) Return { + return device.SetAccountingMode(mode) } -func (Device nvmlDevice) SetAccountingMode(Mode EnableState) Return { - return nvmlDeviceSetAccountingMode(Device, Mode) +func (device nvmlDevice) SetAccountingMode(mode EnableState) Return { + return nvmlDeviceSetAccountingMode(device, mode) } // nvml.DeviceClearAccountingPids() -func (l *library) DeviceClearAccountingPids(Device Device) Return { - return Device.ClearAccountingPids() +func (l *library) DeviceClearAccountingPids(device Device) Return { + return device.ClearAccountingPids() } -func (Device nvmlDevice) ClearAccountingPids() Return { - return nvmlDeviceClearAccountingPids(Device) +func (device nvmlDevice) ClearAccountingPids() Return { + return nvmlDeviceClearAccountingPids(device) } // nvml.DeviceGetNvLinkState() -func (l *library) DeviceGetNvLinkState(Device Device, Link int) (EnableState, Return) { - return Device.GetNvLinkState(Link) +func (l *library) DeviceGetNvLinkState(device Device, link int) (EnableState, Return) { + return device.GetNvLinkState(link) } -func (Device nvmlDevice) GetNvLinkState(Link int) (EnableState, Return) { - var IsActive EnableState - ret := nvmlDeviceGetNvLinkState(Device, uint32(Link), &IsActive) - return IsActive, ret +func (device nvmlDevice) GetNvLinkState(link int) (EnableState, Return) { + var isActive EnableState + ret := nvmlDeviceGetNvLinkState(device, uint32(link), &isActive) + return isActive, ret } // nvml.DeviceGetNvLinkVersion() -func (l *library) DeviceGetNvLinkVersion(Device Device, Link int) (uint32, Return) { - return Device.GetNvLinkVersion(Link) +func (l *library) DeviceGetNvLinkVersion(device Device, link int) (uint32, Return) { + return device.GetNvLinkVersion(link) } -func (Device nvmlDevice) GetNvLinkVersion(Link int) (uint32, Return) { - var Version uint32 - ret := nvmlDeviceGetNvLinkVersion(Device, uint32(Link), &Version) - return Version, ret +func (device nvmlDevice) GetNvLinkVersion(link int) (uint32, Return) { + var version uint32 + ret := nvmlDeviceGetNvLinkVersion(device, uint32(link), &version) + return version, ret } // nvml.DeviceGetNvLinkCapability() -func (l *library) DeviceGetNvLinkCapability(Device Device, Link int, Capability NvLinkCapability) (uint32, Return) { - return Device.GetNvLinkCapability(Link, Capability) +func (l *library) DeviceGetNvLinkCapability(device Device, link int, capability NvLinkCapability) (uint32, Return) { + return device.GetNvLinkCapability(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 +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 (l *library) DeviceGetNvLinkRemotePciInfo(Device Device, Link int) (PciInfo, Return) { - return Device.GetNvLinkRemotePciInfo(Link) +func (l *library) DeviceGetNvLinkRemotePciInfo(device Device, link int) (PciInfo, Return) { + return device.GetNvLinkRemotePciInfo(link) } -func (Device nvmlDevice) GetNvLinkRemotePciInfo(Link int) (PciInfo, Return) { - var Pci PciInfo - ret := nvmlDeviceGetNvLinkRemotePciInfo(Device, uint32(Link), &Pci) - return Pci, ret +func (device nvmlDevice) GetNvLinkRemotePciInfo(link int) (PciInfo, Return) { + var pci PciInfo + ret := nvmlDeviceGetNvLinkRemotePciInfo(device, uint32(link), &pci) + return pci, ret } // nvml.DeviceGetNvLinkErrorCounter() -func (l *library) DeviceGetNvLinkErrorCounter(Device Device, Link int, Counter NvLinkErrorCounter) (uint64, Return) { - return Device.GetNvLinkErrorCounter(Link, Counter) +func (l *library) DeviceGetNvLinkErrorCounter(device Device, link int, counter NvLinkErrorCounter) (uint64, Return) { + return device.GetNvLinkErrorCounter(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 +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 (l *library) DeviceResetNvLinkErrorCounters(Device Device, Link int) Return { - return Device.ResetNvLinkErrorCounters(Link) +func (l *library) DeviceResetNvLinkErrorCounters(device Device, link int) Return { + return device.ResetNvLinkErrorCounters(link) } -func (Device nvmlDevice) ResetNvLinkErrorCounters(Link int) Return { - return nvmlDeviceResetNvLinkErrorCounters(Device, uint32(Link)) +func (device nvmlDevice) ResetNvLinkErrorCounters(link int) Return { + return nvmlDeviceResetNvLinkErrorCounters(device, uint32(link)) } // nvml.DeviceSetNvLinkUtilizationControl() -func (l *library) DeviceSetNvLinkUtilizationControl(Device Device, Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { - return Device.SetNvLinkUtilizationControl(Link, 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 nvmlDevice) SetNvLinkUtilizationControl(Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { - reset := uint32(0) - if Reset { - reset = 1 +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, reset) + return nvmlDeviceSetNvLinkUtilizationControl(device, uint32(link), uint32(counter), control, resetValue) } // nvml.DeviceGetNvLinkUtilizationControl() -func (l *library) DeviceGetNvLinkUtilizationControl(Device Device, Link int, Counter int) (NvLinkUtilizationControl, Return) { - return Device.GetNvLinkUtilizationControl(Link, Counter) +func (l *library) DeviceGetNvLinkUtilizationControl(device Device, link int, counter int) (NvLinkUtilizationControl, Return) { + return device.GetNvLinkUtilizationControl(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 +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 (l *library) DeviceGetNvLinkUtilizationCounter(Device Device, Link int, Counter int) (uint64, uint64, Return) { - return Device.GetNvLinkUtilizationCounter(Link, Counter) +func (l *library) DeviceGetNvLinkUtilizationCounter(device Device, link int, counter int) (uint64, uint64, Return) { + return device.GetNvLinkUtilizationCounter(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 +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 (l *library) DeviceFreezeNvLinkUtilizationCounter(Device Device, Link int, Counter int, Freeze EnableState) Return { - return Device.FreezeNvLinkUtilizationCounter(Link, Counter, Freeze) +func (l *library) DeviceFreezeNvLinkUtilizationCounter(device Device, link int, counter int, freeze EnableState) Return { + return device.FreezeNvLinkUtilizationCounter(link, counter, freeze) } -func (Device nvmlDevice) FreezeNvLinkUtilizationCounter(Link int, Counter int, Freeze EnableState) Return { - return nvmlDeviceFreezeNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter), Freeze) +func (device nvmlDevice) FreezeNvLinkUtilizationCounter(link int, counter int, freeze EnableState) Return { + return nvmlDeviceFreezeNvLinkUtilizationCounter(device, uint32(link), uint32(counter), freeze) } // nvml.DeviceResetNvLinkUtilizationCounter() -func (l *library) DeviceResetNvLinkUtilizationCounter(Device Device, Link int, Counter int) Return { - return Device.ResetNvLinkUtilizationCounter(Link, Counter) +func (l *library) DeviceResetNvLinkUtilizationCounter(device Device, link int, counter int) Return { + return device.ResetNvLinkUtilizationCounter(link, counter) } -func (Device nvmlDevice) ResetNvLinkUtilizationCounter(Link int, Counter int) Return { - return nvmlDeviceResetNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter)) +func (device nvmlDevice) ResetNvLinkUtilizationCounter(link int, counter int) Return { + return nvmlDeviceResetNvLinkUtilizationCounter(device, uint32(link), uint32(counter)) } // nvml.DeviceGetNvLinkRemoteDeviceType() -func (l *library) DeviceGetNvLinkRemoteDeviceType(Device Device, Link int) (IntNvLinkDeviceType, Return) { - return Device.GetNvLinkRemoteDeviceType(Link) +func (l *library) DeviceGetNvLinkRemoteDeviceType(device Device, link int) (IntNvLinkDeviceType, Return) { + return device.GetNvLinkRemoteDeviceType(link) } -func (Device nvmlDevice) GetNvLinkRemoteDeviceType(Link int) (IntNvLinkDeviceType, Return) { - var NvLinkDeviceType IntNvLinkDeviceType - ret := nvmlDeviceGetNvLinkRemoteDeviceType(Device, uint32(Link), &NvLinkDeviceType) - return NvLinkDeviceType, ret +func (device nvmlDevice) GetNvLinkRemoteDeviceType(link int) (IntNvLinkDeviceType, Return) { + var nvLinkDeviceType IntNvLinkDeviceType + ret := nvmlDeviceGetNvLinkRemoteDeviceType(device, uint32(link), &nvLinkDeviceType) + return nvLinkDeviceType, ret } // nvml.DeviceRegisterEvents() -func (l *library) DeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return { - return Device.RegisterEvents(EventTypes, Set) +func (l *library) DeviceRegisterEvents(device Device, eventTypes uint64, set EventSet) Return { + return device.RegisterEvents(eventTypes, set) } -func (Device nvmlDevice) RegisterEvents(EventTypes uint64, Set EventSet) Return { - return nvmlDeviceRegisterEvents(Device, EventTypes, Set.(nvmlEventSet)) +func (device nvmlDevice) RegisterEvents(eventTypes uint64, set EventSet) Return { + return nvmlDeviceRegisterEvents(device, eventTypes, set.(nvmlEventSet)) } // nvmlDeviceGetSupportedEventTypes() -func (l *library) DeviceGetSupportedEventTypes(Device Device) (uint64, Return) { - return Device.GetSupportedEventTypes() +func (l *library) DeviceGetSupportedEventTypes(device Device) (uint64, Return) { + return device.GetSupportedEventTypes() } -func (Device nvmlDevice) GetSupportedEventTypes() (uint64, Return) { - var EventTypes uint64 - ret := nvmlDeviceGetSupportedEventTypes(Device, &EventTypes) - return EventTypes, ret +func (device nvmlDevice) GetSupportedEventTypes() (uint64, Return) { + var eventTypes uint64 + ret := nvmlDeviceGetSupportedEventTypes(device, &eventTypes) + return eventTypes, ret } // nvml.DeviceModifyDrainState() -func (l *library) 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 (l *library) 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 (l *library) DeviceRemoveGpu(PciInfo *PciInfo) Return { - return nvmlDeviceRemoveGpu(PciInfo) +func (l *library) DeviceRemoveGpu(pciInfo *PciInfo) Return { + return nvmlDeviceRemoveGpu(pciInfo) } // nvml.DeviceRemoveGpu_v2() -func (l *library) 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 (l *library) DeviceDiscoverGpus() (PciInfo, Return) { - var PciInfo PciInfo - ret := nvmlDeviceDiscoverGpus(&PciInfo) - return PciInfo, ret + var pciInfo PciInfo + ret := nvmlDeviceDiscoverGpus(&pciInfo) + return pciInfo, ret } // nvml.DeviceGetFieldValues() -func (l *library) DeviceGetFieldValues(Device Device, Values []FieldValue) Return { - return Device.GetFieldValues(Values) +func (l *library) DeviceGetFieldValues(device Device, values []FieldValue) Return { + return device.GetFieldValues(values) } -func (Device nvmlDevice) GetFieldValues(Values []FieldValue) Return { - ValuesCount := len(Values) - return nvmlDeviceGetFieldValues(Device, int32(ValuesCount), &Values[0]) +func (device nvmlDevice) GetFieldValues(values []FieldValue) Return { + valuesCount := len(values) + return nvmlDeviceGetFieldValues(device, int32(valuesCount), &values[0]) } // nvml.DeviceGetVirtualizationMode() -func (l *library) DeviceGetVirtualizationMode(Device Device) (GpuVirtualizationMode, Return) { - return Device.GetVirtualizationMode() +func (l *library) DeviceGetVirtualizationMode(device Device) (GpuVirtualizationMode, Return) { + return device.GetVirtualizationMode() } -func (Device nvmlDevice) GetVirtualizationMode() (GpuVirtualizationMode, Return) { - var PVirtualMode GpuVirtualizationMode - ret := nvmlDeviceGetVirtualizationMode(Device, &PVirtualMode) - return PVirtualMode, ret +func (device nvmlDevice) GetVirtualizationMode() (GpuVirtualizationMode, Return) { + var pVirtualMode GpuVirtualizationMode + ret := nvmlDeviceGetVirtualizationMode(device, &pVirtualMode) + return pVirtualMode, ret } // nvml.DeviceGetHostVgpuMode() -func (l *library) DeviceGetHostVgpuMode(Device Device) (HostVgpuMode, Return) { - return Device.GetHostVgpuMode() +func (l *library) DeviceGetHostVgpuMode(device Device) (HostVgpuMode, Return) { + return device.GetHostVgpuMode() } -func (Device nvmlDevice) GetHostVgpuMode() (HostVgpuMode, Return) { - var PHostVgpuMode HostVgpuMode - ret := nvmlDeviceGetHostVgpuMode(Device, &PHostVgpuMode) - return PHostVgpuMode, ret +func (device nvmlDevice) GetHostVgpuMode() (HostVgpuMode, Return) { + var pHostVgpuMode HostVgpuMode + ret := nvmlDeviceGetHostVgpuMode(device, &pHostVgpuMode) + return pHostVgpuMode, ret } // nvml.DeviceSetVirtualizationMode() -func (l *library) DeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return { - return Device.SetVirtualizationMode(VirtualMode) +func (l *library) DeviceSetVirtualizationMode(device Device, virtualMode GpuVirtualizationMode) Return { + return device.SetVirtualizationMode(virtualMode) } -func (Device nvmlDevice) SetVirtualizationMode(VirtualMode GpuVirtualizationMode) Return { - return nvmlDeviceSetVirtualizationMode(Device, VirtualMode) +func (device nvmlDevice) SetVirtualizationMode(virtualMode GpuVirtualizationMode) Return { + return nvmlDeviceSetVirtualizationMode(device, virtualMode) } // nvml.DeviceGetGridLicensableFeatures() -func (l *library) DeviceGetGridLicensableFeatures(Device Device) (GridLicensableFeatures, Return) { - return Device.GetGridLicensableFeatures() +func (l *library) DeviceGetGridLicensableFeatures(device Device) (GridLicensableFeatures, Return) { + return device.GetGridLicensableFeatures() } -func (Device nvmlDevice) GetGridLicensableFeatures() (GridLicensableFeatures, Return) { - var PGridLicensableFeatures GridLicensableFeatures - ret := nvmlDeviceGetGridLicensableFeatures(Device, &PGridLicensableFeatures) - return PGridLicensableFeatures, ret +func (device nvmlDevice) GetGridLicensableFeatures() (GridLicensableFeatures, Return) { + var pGridLicensableFeatures GridLicensableFeatures + ret := nvmlDeviceGetGridLicensableFeatures(device, &pGridLicensableFeatures) + return pGridLicensableFeatures, ret } // nvml.DeviceGetProcessUtilization() -func (l *library) DeviceGetProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) { - return Device.GetProcessUtilization(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) +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 } // nvml.DeviceGetSupportedVgpus() -func (l *library) DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) { - return Device.GetSupportedVgpus() +func (l *library) DeviceGetSupportedVgpus(device Device) ([]VgpuTypeId, Return) { + return device.GetSupportedVgpus() } -func (Device nvmlDevice) GetSupportedVgpus() ([]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([]nvmlVgpuTypeId, VgpuCount) - ret := nvmlDeviceGetSupportedVgpus(Device, &VgpuCount, &VgpuTypeIds[0]) + vgpuTypeIds := make([]nvmlVgpuTypeId, vgpuCount) + ret := nvmlDeviceGetSupportedVgpus(device, &vgpuCount, &vgpuTypeIds[0]) if ret == SUCCESS { - return convertSlice[nvmlVgpuTypeId, VgpuTypeId](VgpuTypeIds[:VgpuCount]), ret + return convertSlice[nvmlVgpuTypeId, VgpuTypeId](vgpuTypeIds[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } // nvml.DeviceGetCreatableVgpus() -func (l *library) DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) { - return Device.GetCreatableVgpus() +func (l *library) DeviceGetCreatableVgpus(device Device) ([]VgpuTypeId, Return) { + return device.GetCreatableVgpus() } -func (Device nvmlDevice) GetCreatableVgpus() ([]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([]nvmlVgpuTypeId, VgpuCount) - ret := nvmlDeviceGetCreatableVgpus(Device, &VgpuCount, &VgpuTypeIds[0]) + vgpuTypeIds := make([]nvmlVgpuTypeId, vgpuCount) + ret := nvmlDeviceGetCreatableVgpus(device, &vgpuCount, &vgpuTypeIds[0]) if ret == SUCCESS { - return convertSlice[nvmlVgpuTypeId, VgpuTypeId](VgpuTypeIds[:VgpuCount]), ret + return convertSlice[nvmlVgpuTypeId, VgpuTypeId](vgpuTypeIds[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } // nvml.DeviceGetActiveVgpus() -func (l *library) DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) { - return Device.GetActiveVgpus() +func (l *library) DeviceGetActiveVgpus(device Device) ([]VgpuInstance, Return) { + return device.GetActiveVgpus() } -func (Device nvmlDevice) GetActiveVgpus() ([]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([]nvmlVgpuInstance, VgpuCount) - ret := nvmlDeviceGetActiveVgpus(Device, &VgpuCount, &VgpuInstances[0]) + vgpuInstances := make([]nvmlVgpuInstance, vgpuCount) + ret := nvmlDeviceGetActiveVgpus(device, &vgpuCount, &vgpuInstances[0]) if ret == SUCCESS { - return convertSlice[nvmlVgpuInstance, VgpuInstance](VgpuInstances[:VgpuCount]), ret + return convertSlice[nvmlVgpuInstance, VgpuInstance](vgpuInstances[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } // nvml.DeviceGetVgpuMetadata() -func (l *library) DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return) { - return Device.GetVgpuMetadata() +func (l *library) DeviceGetVgpuMetadata(device Device) (VgpuPgpuMetadata, Return) { + return device.GetVgpuMetadata() } -func (Device nvmlDevice) GetVgpuMetadata() (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 } } // nvml.DeviceGetPgpuMetadataString() -func (l *library) DeviceGetPgpuMetadataString(Device Device) (string, Return) { - return Device.GetPgpuMetadataString() +func (l *library) DeviceGetPgpuMetadataString(device Device) (string, Return) { + return device.GetPgpuMetadataString() } -func (Device nvmlDevice) GetPgpuMetadataString() (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 } } // nvml.DeviceGetVgpuUtilization() -func (l *library) DeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { - return Device.GetVgpuUtilization(LastSeenTimeStamp) +func (l *library) DeviceGetVgpuUtilization(device Device, lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { + return device.GetVgpuUtilization(lastSeenTimestamp) } -func (Device nvmlDevice) GetVgpuUtilization(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 } } // nvml.DeviceGetAttributes() -func (l *library) DeviceGetAttributes(Device Device) (DeviceAttributes, Return) { - return Device.GetAttributes() +func (l *library) DeviceGetAttributes(device Device) (DeviceAttributes, Return) { + return device.GetAttributes() } -func (Device nvmlDevice) GetAttributes() (DeviceAttributes, Return) { - var Attributes DeviceAttributes - ret := nvmlDeviceGetAttributes(Device, &Attributes) - return Attributes, ret +func (device nvmlDevice) GetAttributes() (DeviceAttributes, Return) { + var attributes DeviceAttributes + ret := nvmlDeviceGetAttributes(device, &attributes) + return attributes, ret } // nvml.DeviceGetRemappedRows() -func (l *library) DeviceGetRemappedRows(Device Device) (int, int, bool, bool, Return) { - return Device.GetRemappedRows() +func (l *library) DeviceGetRemappedRows(device Device) (int, int, bool, bool, Return) { + return device.GetRemappedRows() } -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 +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 (l *library) DeviceGetRowRemapperHistogram(Device Device) (RowRemapperHistogramValues, Return) { - return Device.GetRowRemapperHistogram() +func (l *library) DeviceGetRowRemapperHistogram(device Device) (RowRemapperHistogramValues, Return) { + return device.GetRowRemapperHistogram() } -func (Device nvmlDevice) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) { - var Values RowRemapperHistogramValues - ret := nvmlDeviceGetRowRemapperHistogram(Device, &Values) - return Values, ret +func (device nvmlDevice) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) { + var values RowRemapperHistogramValues + ret := nvmlDeviceGetRowRemapperHistogram(device, &values) + return values, ret } // nvml.DeviceGetArchitecture() -func (l *library) DeviceGetArchitecture(Device Device) (DeviceArchitecture, Return) { - return Device.GetArchitecture() +func (l *library) DeviceGetArchitecture(device Device) (DeviceArchitecture, Return) { + return device.GetArchitecture() } -func (Device nvmlDevice) GetArchitecture() (DeviceArchitecture, Return) { - var Arch DeviceArchitecture - ret := nvmlDeviceGetArchitecture(Device, &Arch) - return Arch, ret +func (device nvmlDevice) GetArchitecture() (DeviceArchitecture, Return) { + var arch DeviceArchitecture + ret := nvmlDeviceGetArchitecture(device, &arch) + return arch, ret } // nvml.DeviceGetVgpuProcessUtilization() -func (l *library) DeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) { - return Device.GetVgpuProcessUtilization(LastSeenTimeStamp) +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 +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 } } // nvml.GetExcludedDeviceCount() func (l *library) GetExcludedDeviceCount() (int, Return) { - var DeviceCount uint32 - ret := nvmlGetExcludedDeviceCount(&DeviceCount) - return int(DeviceCount), ret + var deviceCount uint32 + ret := nvmlGetExcludedDeviceCount(&deviceCount) + return int(deviceCount), ret } // nvml.GetExcludedDeviceInfoByIndex() -func (l *library) 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 (l *library) DeviceSetMigMode(Device Device, Mode int) (Return, Return) { - return Device.SetMigMode(Mode) +func (l *library) DeviceSetMigMode(device Device, mode int) (Return, Return) { + return device.SetMigMode(mode) } -func (Device nvmlDevice) SetMigMode(Mode int) (Return, Return) { - var ActivationStatus Return - ret := nvmlDeviceSetMigMode(Device, uint32(Mode), &ActivationStatus) - return ActivationStatus, ret +func (device nvmlDevice) SetMigMode(mode int) (Return, Return) { + var activationStatus Return + ret := nvmlDeviceSetMigMode(device, uint32(mode), &activationStatus) + return activationStatus, ret } // nvml.DeviceGetMigMode() -func (l *library) DeviceGetMigMode(Device Device) (int, int, Return) { - return Device.GetMigMode() +func (l *library) DeviceGetMigMode(device Device) (int, int, Return) { + return device.GetMigMode() } -func (Device nvmlDevice) GetMigMode() (int, int, Return) { - var CurrentMode, PendingMode uint32 - ret := nvmlDeviceGetMigMode(Device, &CurrentMode, &PendingMode) - return int(CurrentMode), int(PendingMode), ret +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 (l *library) DeviceGetGpuInstanceProfileInfo(Device Device, Profile int) (GpuInstanceProfileInfo, Return) { - return Device.GetGpuInstanceProfileInfo(Profile) +func (l *library) DeviceGetGpuInstanceProfileInfo(device Device, profile int) (GpuInstanceProfileInfo, Return) { + return device.GetGpuInstanceProfileInfo(profile) } -func (Device nvmlDevice) GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) { - var Info GpuInstanceProfileInfo - ret := nvmlDeviceGetGpuInstanceProfileInfo(Device, uint32(Profile), &Info) - return Info, ret +func (device nvmlDevice) GetGpuInstanceProfileInfo(profile int) (GpuInstanceProfileInfo, Return) { + var info GpuInstanceProfileInfo + ret := nvmlDeviceGetGpuInstanceProfileInfo(device, uint32(profile), &info) + return info, ret } // nvml.DeviceGetGpuInstanceProfileInfoV() @@ -1989,144 +1989,144 @@ type GpuInstanceProfileInfoV struct { 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 (l *library) DeviceGetGpuInstanceProfileInfoV(Device Device, Profile int) GpuInstanceProfileInfoV { - return Device.GetGpuInstanceProfileInfoV(Profile) +func (l *library) DeviceGetGpuInstanceProfileInfoV(device Device, profile int) GpuInstanceProfileInfoV { + return device.GetGpuInstanceProfileInfoV(profile) } -func (Device nvmlDevice) GetGpuInstanceProfileInfoV(Profile int) GpuInstanceProfileInfoV { - return GpuInstanceProfileInfoV{Device, Profile} +func (device nvmlDevice) GetGpuInstanceProfileInfoV(profile int) GpuInstanceProfileInfoV { + return GpuInstanceProfileInfoV{device, profile} } // nvml.DeviceGetGpuInstancePossiblePlacements() -func (l *library) DeviceGetGpuInstancePossiblePlacements(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { - return Device.GetGpuInstancePossiblePlacements(Info) +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 { +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 } // nvml.DeviceGetGpuInstanceRemainingCapacity() -func (l *library) DeviceGetGpuInstanceRemainingCapacity(Device Device, Info *GpuInstanceProfileInfo) (int, Return) { - return Device.GetGpuInstanceRemainingCapacity(Info) +func (l *library) DeviceGetGpuInstanceRemainingCapacity(device Device, info *GpuInstanceProfileInfo) (int, Return) { + return device.GetGpuInstanceRemainingCapacity(info) } -func (Device nvmlDevice) GetGpuInstanceRemainingCapacity(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 + var count uint32 + ret := nvmlDeviceGetGpuInstanceRemainingCapacity(device, info.Id, &count) + return int(count), ret } // nvml.DeviceCreateGpuInstance() -func (l *library) DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfileInfo) (GpuInstance, Return) { - return Device.CreateGpuInstance(Info) +func (l *library) DeviceCreateGpuInstance(device Device, info *GpuInstanceProfileInfo) (GpuInstance, Return) { + return device.CreateGpuInstance(info) } -func (Device nvmlDevice) CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) { - if Info == nil { +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 + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceCreateGpuInstance(device, info.Id, &gpuInstance) + return gpuInstance, ret } // nvml.DeviceCreateGpuInstanceWithPlacement() -func (l *library) DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { - return Device.CreateGpuInstanceWithPlacement(Info, Placement) +func (l *library) DeviceCreateGpuInstanceWithPlacement(device Device, info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) { + return device.CreateGpuInstanceWithPlacement(info, placement) } -func (Device nvmlDevice) CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { - if Info == nil { +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 + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceCreateGpuInstanceWithPlacement(device, info.Id, placement, &gpuInstance) + return gpuInstance, ret } // nvml.GpuInstanceDestroy() -func (l *library) GpuInstanceDestroy(GpuInstance GpuInstance) Return { - return GpuInstance.Destroy() +func (l *library) GpuInstanceDestroy(gpuInstance GpuInstance) Return { + return gpuInstance.Destroy() } -func (GpuInstance nvmlGpuInstance) Destroy() Return { - return nvmlGpuInstanceDestroy(GpuInstance) +func (gpuInstance nvmlGpuInstance) Destroy() Return { + return nvmlGpuInstanceDestroy(gpuInstance) } // nvml.DeviceGetGpuInstances() -func (l *library) DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - return Device.GetGpuInstances(Info) +func (l *library) DeviceGetGpuInstances(device Device, info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { + return device.GetGpuInstances(info) } -func (Device nvmlDevice) GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - if Info == nil { +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 + 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 (l *library) DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, Return) { - return Device.GetGpuInstanceById(Id) +func (l *library) DeviceGetGpuInstanceById(device Device, id int) (GpuInstance, Return) { + return device.GetGpuInstanceById(id) } -func (Device nvmlDevice) GetGpuInstanceById(Id int) (GpuInstance, Return) { - var GpuInstance nvmlGpuInstance - ret := nvmlDeviceGetGpuInstanceById(Device, uint32(Id), &GpuInstance) - return GpuInstance, ret +func (device nvmlDevice) GetGpuInstanceById(id int) (GpuInstance, Return) { + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceGetGpuInstanceById(device, uint32(id), &gpuInstance) + return gpuInstance, ret } // nvml.GpuInstanceGetInfo() -func (l *library) GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) { - return GpuInstance.GetInfo() +func (l *library) GpuInstanceGetInfo(gpuInstance GpuInstance) (GpuInstanceInfo, Return) { + return gpuInstance.GetInfo() } -func (GpuInstance nvmlGpuInstance) GetInfo() (GpuInstanceInfo, Return) { - var Info GpuInstanceInfo - ret := nvmlGpuInstanceGetInfo(GpuInstance, &Info) - return Info, ret +func (gpuInstance nvmlGpuInstance) GetInfo() (GpuInstanceInfo, Return) { + var info GpuInstanceInfo + ret := nvmlGpuInstanceGetInfo(gpuInstance, &info) + return info, ret } // nvml.GpuInstanceGetComputeInstanceProfileInfo() -func (l *library) GpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { - return GpuInstance.GetComputeInstanceProfileInfo(Profile, EngProfile) +func (l *library) GpuInstanceGetComputeInstanceProfileInfo(gpuInstance GpuInstance, profile int, engProfile int) (ComputeInstanceProfileInfo, Return) { + return gpuInstance.GetComputeInstanceProfileInfo(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 +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() @@ -2136,531 +2136,531 @@ type ComputeInstanceProfileInfoV struct { 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 (l *library) GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile int, EngProfile int) ComputeInstanceProfileInfoV { - return GpuInstance.GetComputeInstanceProfileInfoV(Profile, EngProfile) +func (l *library) GpuInstanceGetComputeInstanceProfileInfoV(gpuInstance GpuInstance, profile int, engProfile int) ComputeInstanceProfileInfoV { + return gpuInstance.GetComputeInstanceProfileInfoV(profile, engProfile) } -func (GpuInstance nvmlGpuInstance) GetComputeInstanceProfileInfoV(Profile int, EngProfile int) ComputeInstanceProfileInfoV { - return ComputeInstanceProfileInfoV{GpuInstance, Profile, EngProfile} +func (gpuInstance nvmlGpuInstance) GetComputeInstanceProfileInfoV(profile int, engProfile int) ComputeInstanceProfileInfoV { + return ComputeInstanceProfileInfoV{gpuInstance, profile, engProfile} } // nvml.GpuInstanceGetComputeInstanceRemainingCapacity() -func (l *library) GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (int, Return) { - return GpuInstance.GetComputeInstanceRemainingCapacity(Info) +func (l *library) GpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (int, Return) { + return gpuInstance.GetComputeInstanceRemainingCapacity(info) } -func (GpuInstance nvmlGpuInstance) GetComputeInstanceRemainingCapacity(Info *ComputeInstanceProfileInfo) (int, Return) { - if Info == nil { +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 + var count uint32 + ret := nvmlGpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance, info.Id, &count) + return int(count), ret } // nvml.GpuInstanceCreateComputeInstance() -func (l *library) GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - return GpuInstance.CreateComputeInstance(Info) +func (l *library) GpuInstanceCreateComputeInstance(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { + return gpuInstance.CreateComputeInstance(info) } -func (GpuInstance nvmlGpuInstance) CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - if Info == nil { +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 + var computeInstance nvmlComputeInstance + ret := nvmlGpuInstanceCreateComputeInstance(gpuInstance, info.Id, &computeInstance) + return computeInstance, ret } // nvml.ComputeInstanceDestroy() -func (l *library) ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { - return ComputeInstance.Destroy() +func (l *library) ComputeInstanceDestroy(computeInstance ComputeInstance) Return { + return computeInstance.Destroy() } -func (ComputeInstance nvmlComputeInstance) Destroy() Return { - return nvmlComputeInstanceDestroy(ComputeInstance) +func (computeInstance nvmlComputeInstance) Destroy() Return { + return nvmlComputeInstanceDestroy(computeInstance) } // nvml.GpuInstanceGetComputeInstances() -func (l *library) GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - return GpuInstance.GetComputeInstances(Info) +func (l *library) GpuInstanceGetComputeInstances(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { + return gpuInstance.GetComputeInstances(info) } -func (GpuInstance nvmlGpuInstance) GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - if Info == nil { +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 + 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 (l *library) GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id int) (ComputeInstance, Return) { - return GpuInstance.GetComputeInstanceById(Id) +func (l *library) GpuInstanceGetComputeInstanceById(gpuInstance GpuInstance, id int) (ComputeInstance, Return) { + return gpuInstance.GetComputeInstanceById(id) } -func (GpuInstance nvmlGpuInstance) GetComputeInstanceById(Id int) (ComputeInstance, Return) { - var ComputeInstance nvmlComputeInstance - ret := nvmlGpuInstanceGetComputeInstanceById(GpuInstance, uint32(Id), &ComputeInstance) - return ComputeInstance, ret +func (gpuInstance nvmlGpuInstance) GetComputeInstanceById(id int) (ComputeInstance, Return) { + var computeInstance nvmlComputeInstance + ret := nvmlGpuInstanceGetComputeInstanceById(gpuInstance, uint32(id), &computeInstance) + return computeInstance, ret } // nvml.ComputeInstanceGetInfo() -func (l *library) ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) { - return ComputeInstance.GetInfo() +func (l *library) ComputeInstanceGetInfo(computeInstance ComputeInstance) (ComputeInstanceInfo, Return) { + return computeInstance.GetInfo() } -func (ComputeInstance nvmlComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { - var Info ComputeInstanceInfo - ret := nvmlComputeInstanceGetInfo(ComputeInstance, &Info) - return Info, ret +func (computeInstance nvmlComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { + var info ComputeInstanceInfo + ret := nvmlComputeInstanceGetInfo(computeInstance, &info) + return info, ret } // nvml.DeviceIsMigDeviceHandle() -func (l *library) DeviceIsMigDeviceHandle(Device Device) (bool, Return) { - return Device.IsMigDeviceHandle() +func (l *library) DeviceIsMigDeviceHandle(device Device) (bool, Return) { + return device.IsMigDeviceHandle() } -func (Device nvmlDevice) IsMigDeviceHandle() (bool, Return) { - var IsMigDevice uint32 - ret := nvmlDeviceIsMigDeviceHandle(Device, &IsMigDevice) - return (IsMigDevice != 0), ret +func (device nvmlDevice) IsMigDeviceHandle() (bool, Return) { + var isMigDevice uint32 + ret := nvmlDeviceIsMigDeviceHandle(device, &isMigDevice) + return (isMigDevice != 0), ret } // nvml DeviceGetGpuInstanceId() -func (l *library) DeviceGetGpuInstanceId(Device Device) (int, Return) { - return Device.GetGpuInstanceId() +func (l *library) DeviceGetGpuInstanceId(device Device) (int, Return) { + return device.GetGpuInstanceId() } -func (Device nvmlDevice) GetGpuInstanceId() (int, Return) { - var Id uint32 - ret := nvmlDeviceGetGpuInstanceId(Device, &Id) - return int(Id), ret +func (device nvmlDevice) GetGpuInstanceId() (int, Return) { + var id uint32 + ret := nvmlDeviceGetGpuInstanceId(device, &id) + return int(id), ret } // nvml.DeviceGetComputeInstanceId() -func (l *library) DeviceGetComputeInstanceId(Device Device) (int, Return) { - return Device.GetComputeInstanceId() +func (l *library) DeviceGetComputeInstanceId(device Device) (int, Return) { + return device.GetComputeInstanceId() } -func (Device nvmlDevice) GetComputeInstanceId() (int, Return) { - var Id uint32 - ret := nvmlDeviceGetComputeInstanceId(Device, &Id) - return int(Id), ret +func (device nvmlDevice) GetComputeInstanceId() (int, Return) { + var id uint32 + ret := nvmlDeviceGetComputeInstanceId(device, &id) + return int(id), ret } // nvml.DeviceGetMaxMigDeviceCount() -func (l *library) DeviceGetMaxMigDeviceCount(Device Device) (int, Return) { - return Device.GetMaxMigDeviceCount() +func (l *library) DeviceGetMaxMigDeviceCount(device Device) (int, Return) { + return device.GetMaxMigDeviceCount() } -func (Device nvmlDevice) GetMaxMigDeviceCount() (int, Return) { - var Count uint32 - ret := nvmlDeviceGetMaxMigDeviceCount(Device, &Count) - return int(Count), ret +func (device nvmlDevice) GetMaxMigDeviceCount() (int, Return) { + var count uint32 + ret := nvmlDeviceGetMaxMigDeviceCount(device, &count) + return int(count), ret } // nvml.DeviceGetMigDeviceHandleByIndex() -func (l *library) DeviceGetMigDeviceHandleByIndex(device Device, Index int) (Device, Return) { - return device.GetMigDeviceHandleByIndex(Index) +func (l *library) DeviceGetMigDeviceHandleByIndex(device Device, index int) (Device, Return) { + return device.GetMigDeviceHandleByIndex(index) } -func (Device nvmlDevice) GetMigDeviceHandleByIndex(Index int) (Device, Return) { - var MigDevice nvmlDevice - ret := nvmlDeviceGetMigDeviceHandleByIndex(Device, uint32(Index), &MigDevice) - return MigDevice, ret +func (device nvmlDevice) GetMigDeviceHandleByIndex(index int) (Device, Return) { + var migDevice nvmlDevice + ret := nvmlDeviceGetMigDeviceHandleByIndex(device, uint32(index), &migDevice) + return migDevice, ret } // nvml.DeviceGetDeviceHandleFromMigDeviceHandle() -func (l *library) DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device) (Device, Return) { - return MigDevice.GetDeviceHandleFromMigDeviceHandle() +func (l *library) DeviceGetDeviceHandleFromMigDeviceHandle(migdevice Device) (Device, Return) { + return migdevice.GetDeviceHandleFromMigDeviceHandle() } -func (MigDevice nvmlDevice) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { - var Device nvmlDevice - ret := nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice, &Device) - return Device, ret +func (migDevice nvmlDevice) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetDeviceHandleFromMigDeviceHandle(migDevice, &device) + return device, ret } // nvml.DeviceGetBusType() -func (l *library) DeviceGetBusType(Device Device) (BusType, Return) { - return Device.GetBusType() +func (l *library) DeviceGetBusType(device Device) (BusType, Return) { + return device.GetBusType() } -func (Device nvmlDevice) GetBusType() (BusType, Return) { - var Type BusType - ret := nvmlDeviceGetBusType(Device, &Type) - return Type, ret +func (device nvmlDevice) GetBusType() (BusType, Return) { + var busType BusType + ret := nvmlDeviceGetBusType(device, &busType) + return busType, ret } // nvml.DeviceSetDefaultFanSpeed_v2() -func (l *library) DeviceSetDefaultFanSpeed_v2(Device Device, Fan int) Return { - return Device.SetDefaultFanSpeed_v2(Fan) +func (l *library) DeviceSetDefaultFanSpeed_v2(device Device, fan int) Return { + return device.SetDefaultFanSpeed_v2(fan) } -func (Device nvmlDevice) SetDefaultFanSpeed_v2(Fan int) Return { - return nvmlDeviceSetDefaultFanSpeed_v2(Device, uint32(Fan)) +func (device nvmlDevice) SetDefaultFanSpeed_v2(fan int) Return { + return nvmlDeviceSetDefaultFanSpeed_v2(device, uint32(fan)) } // nvml.DeviceGetMinMaxFanSpeed() -func (l *library) DeviceGetMinMaxFanSpeed(Device Device) (int, int, Return) { - return Device.GetMinMaxFanSpeed() +func (l *library) DeviceGetMinMaxFanSpeed(device Device) (int, int, Return) { + return device.GetMinMaxFanSpeed() } -func (Device nvmlDevice) GetMinMaxFanSpeed() (int, int, Return) { - var MinSpeed, MaxSpeed uint32 - ret := nvmlDeviceGetMinMaxFanSpeed(Device, &MinSpeed, &MaxSpeed) - return int(MinSpeed), int(MaxSpeed), ret +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 (l *library) DeviceGetThermalSettings(Device Device, SensorIndex uint32) (GpuThermalSettings, Return) { - return Device.GetThermalSettings(SensorIndex) +func (l *library) DeviceGetThermalSettings(device Device, sensorIndex uint32) (GpuThermalSettings, Return) { + return device.GetThermalSettings(sensorIndex) } -func (Device nvmlDevice) GetThermalSettings(SensorIndex uint32) (GpuThermalSettings, Return) { - var PThermalSettings GpuThermalSettings - ret := nvmlDeviceGetThermalSettings(Device, SensorIndex, &PThermalSettings) - return PThermalSettings, ret +func (device nvmlDevice) GetThermalSettings(sensorIndex uint32) (GpuThermalSettings, Return) { + var pThermalSettings GpuThermalSettings + ret := nvmlDeviceGetThermalSettings(device, sensorIndex, &pThermalSettings) + return pThermalSettings, ret } // nvml.DeviceGetDefaultEccMode() -func (l *library) DeviceGetDefaultEccMode(Device Device) (EnableState, Return) { - return Device.GetDefaultEccMode() +func (l *library) DeviceGetDefaultEccMode(device Device) (EnableState, Return) { + return device.GetDefaultEccMode() } -func (Device nvmlDevice) GetDefaultEccMode() (EnableState, Return) { - var DefaultMode EnableState - ret := nvmlDeviceGetDefaultEccMode(Device, &DefaultMode) - return DefaultMode, ret +func (device nvmlDevice) GetDefaultEccMode() (EnableState, Return) { + var defaultMode EnableState + ret := nvmlDeviceGetDefaultEccMode(device, &defaultMode) + return defaultMode, ret } // nvml.DeviceGetPcieSpeed() -func (l *library) DeviceGetPcieSpeed(Device Device) (int, Return) { - return Device.GetPcieSpeed() +func (l *library) DeviceGetPcieSpeed(device Device) (int, Return) { + return device.GetPcieSpeed() } -func (Device nvmlDevice) GetPcieSpeed() (int, Return) { - var PcieSpeed uint32 - ret := nvmlDeviceGetPcieSpeed(Device, &PcieSpeed) - return int(PcieSpeed), ret +func (device nvmlDevice) GetPcieSpeed() (int, Return) { + var pcieSpeed uint32 + ret := nvmlDeviceGetPcieSpeed(device, &pcieSpeed) + return int(pcieSpeed), ret } // nvml.DeviceGetGspFirmwareVersion() -func (l *library) DeviceGetGspFirmwareVersion(Device Device) (string, Return) { - return Device.GetGspFirmwareVersion() +func (l *library) DeviceGetGspFirmwareVersion(device Device) (string, Return) { + return device.GetGspFirmwareVersion() } -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 +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 (l *library) DeviceGetGspFirmwareMode(Device Device) (bool, bool, Return) { - return Device.GetGspFirmwareMode() +func (l *library) DeviceGetGspFirmwareMode(device Device) (bool, bool, Return) { + return device.GetGspFirmwareMode() } -func (Device nvmlDevice) GetGspFirmwareMode() (bool, bool, Return) { - var IsEnabled, DefaultMode uint32 - ret := nvmlDeviceGetGspFirmwareMode(Device, &IsEnabled, &DefaultMode) - return (IsEnabled != 0), (DefaultMode != 0), ret +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 (l *library) DeviceGetDynamicPstatesInfo(Device Device) (GpuDynamicPstatesInfo, Return) { - return Device.GetDynamicPstatesInfo() +func (l *library) DeviceGetDynamicPstatesInfo(device Device) (GpuDynamicPstatesInfo, Return) { + return device.GetDynamicPstatesInfo() } -func (Device nvmlDevice) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { - var PDynamicPstatesInfo GpuDynamicPstatesInfo - ret := nvmlDeviceGetDynamicPstatesInfo(Device, &PDynamicPstatesInfo) - return PDynamicPstatesInfo, ret +func (device nvmlDevice) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { + var pDynamicPstatesInfo GpuDynamicPstatesInfo + ret := nvmlDeviceGetDynamicPstatesInfo(device, &pDynamicPstatesInfo) + return pDynamicPstatesInfo, ret } // nvml.DeviceSetFanSpeed_v2() -func (l *library) DeviceSetFanSpeed_v2(Device Device, Fan int, Speed int) Return { - return Device.SetFanSpeed_v2(Fan, Speed) +func (l *library) DeviceSetFanSpeed_v2(device Device, fan int, speed int) Return { + return device.SetFanSpeed_v2(fan, speed) } -func (Device nvmlDevice) SetFanSpeed_v2(Fan int, Speed int) Return { - return nvmlDeviceSetFanSpeed_v2(Device, uint32(Fan), uint32(Speed)) +func (device nvmlDevice) SetFanSpeed_v2(fan int, speed int) Return { + return nvmlDeviceSetFanSpeed_v2(device, uint32(fan), uint32(speed)) } // nvml.DeviceGetGpcClkVfOffset() -func (l *library) DeviceGetGpcClkVfOffset(Device Device) (int, Return) { - return Device.GetGpcClkVfOffset() +func (l *library) DeviceGetGpcClkVfOffset(device Device) (int, Return) { + return device.GetGpcClkVfOffset() } -func (Device nvmlDevice) GetGpcClkVfOffset() (int, Return) { - var Offset int32 - ret := nvmlDeviceGetGpcClkVfOffset(Device, &Offset) - return int(Offset), ret +func (device nvmlDevice) GetGpcClkVfOffset() (int, Return) { + var offset int32 + ret := nvmlDeviceGetGpcClkVfOffset(device, &offset) + return int(offset), ret } // nvml.DeviceSetGpcClkVfOffset() -func (l *library) DeviceSetGpcClkVfOffset(Device Device, Offset int) Return { - return Device.SetGpcClkVfOffset(Offset) +func (l *library) DeviceSetGpcClkVfOffset(device Device, offset int) Return { + return device.SetGpcClkVfOffset(offset) } -func (Device nvmlDevice) SetGpcClkVfOffset(Offset int) Return { - return nvmlDeviceSetGpcClkVfOffset(Device, int32(Offset)) +func (device nvmlDevice) SetGpcClkVfOffset(offset int) Return { + return nvmlDeviceSetGpcClkVfOffset(device, int32(offset)) } // nvml.DeviceGetMinMaxClockOfPState() -func (l *library) DeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates) (uint32, uint32, Return) { - return Device.GetMinMaxClockOfPState(_type, Pstate) +func (l *library) DeviceGetMinMaxClockOfPState(device Device, clockType ClockType, pstate Pstates) (uint32, uint32, Return) { + return device.GetMinMaxClockOfPState(clockType, pstate) } -func (Device nvmlDevice) GetMinMaxClockOfPState(_type ClockType, Pstate Pstates) (uint32, uint32, Return) { - var MinClockMHz, MaxClockMHz uint32 - ret := nvmlDeviceGetMinMaxClockOfPState(Device, _type, Pstate, &MinClockMHz, &MaxClockMHz) - return MinClockMHz, MaxClockMHz, ret +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 (l *library) DeviceGetSupportedPerformanceStates(Device Device) ([]Pstates, Return) { - return Device.GetSupportedPerformanceStates() +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) +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 + return pstates, ret } // nvml.DeviceGetTargetFanSpeed() -func (l *library) DeviceGetTargetFanSpeed(Device Device, Fan int) (int, Return) { - return Device.GetTargetFanSpeed(Fan) +func (l *library) DeviceGetTargetFanSpeed(device Device, fan int) (int, Return) { + return device.GetTargetFanSpeed(fan) } -func (Device nvmlDevice) GetTargetFanSpeed(Fan int) (int, Return) { - var TargetSpeed uint32 - ret := nvmlDeviceGetTargetFanSpeed(Device, uint32(Fan), &TargetSpeed) - return int(TargetSpeed), ret +func (device nvmlDevice) GetTargetFanSpeed(fan int) (int, Return) { + var targetSpeed uint32 + ret := nvmlDeviceGetTargetFanSpeed(device, uint32(fan), &targetSpeed) + return int(targetSpeed), ret } // nvml.DeviceGetMemClkVfOffset() -func (l *library) DeviceGetMemClkVfOffset(Device Device) (int, Return) { - return Device.GetMemClkVfOffset() +func (l *library) DeviceGetMemClkVfOffset(device Device) (int, Return) { + return device.GetMemClkVfOffset() } -func (Device nvmlDevice) GetMemClkVfOffset() (int, Return) { - var Offset int32 - ret := nvmlDeviceGetMemClkVfOffset(Device, &Offset) - return int(Offset), ret +func (device nvmlDevice) GetMemClkVfOffset() (int, Return) { + var offset int32 + ret := nvmlDeviceGetMemClkVfOffset(device, &offset) + return int(offset), ret } // nvml.DeviceSetMemClkVfOffset() -func (l *library) DeviceSetMemClkVfOffset(Device Device, Offset int) Return { - return Device.SetMemClkVfOffset(Offset) +func (l *library) DeviceSetMemClkVfOffset(device Device, offset int) Return { + return device.SetMemClkVfOffset(offset) } -func (Device nvmlDevice) SetMemClkVfOffset(Offset int) Return { - return nvmlDeviceSetMemClkVfOffset(Device, int32(Offset)) +func (device nvmlDevice) SetMemClkVfOffset(offset int) Return { + return nvmlDeviceSetMemClkVfOffset(device, int32(offset)) } // nvml.DeviceGetGpcClkMinMaxVfOffset() -func (l *library) DeviceGetGpcClkMinMaxVfOffset(Device Device) (int, int, Return) { - return Device.GetGpcClkMinMaxVfOffset() +func (l *library) DeviceGetGpcClkMinMaxVfOffset(device Device) (int, int, Return) { + return device.GetGpcClkMinMaxVfOffset() } -func (Device nvmlDevice) GetGpcClkMinMaxVfOffset() (int, int, Return) { - var MinOffset, MaxOffset int32 - ret := nvmlDeviceGetGpcClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) - return int(MinOffset), int(MaxOffset), ret +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 (l *library) DeviceGetMemClkMinMaxVfOffset(Device Device) (int, int, Return) { - return Device.GetMemClkMinMaxVfOffset() +func (l *library) DeviceGetMemClkMinMaxVfOffset(device Device) (int, int, Return) { + return device.GetMemClkMinMaxVfOffset() } -func (Device nvmlDevice) GetMemClkMinMaxVfOffset() (int, int, Return) { - var MinOffset, MaxOffset int32 - ret := nvmlDeviceGetMemClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) - return int(MinOffset), int(MaxOffset), ret +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 (l *library) DeviceGetGpuMaxPcieLinkGeneration(Device Device) (int, Return) { - return Device.GetGpuMaxPcieLinkGeneration() +func (l *library) DeviceGetGpuMaxPcieLinkGeneration(device Device) (int, Return) { + return device.GetGpuMaxPcieLinkGeneration() } -func (Device nvmlDevice) GetGpuMaxPcieLinkGeneration() (int, Return) { - var MaxLinkGenDevice uint32 - ret := nvmlDeviceGetGpuMaxPcieLinkGeneration(Device, &MaxLinkGenDevice) - return int(MaxLinkGenDevice), ret +func (device nvmlDevice) GetGpuMaxPcieLinkGeneration() (int, Return) { + var maxLinkGenDevice uint32 + ret := nvmlDeviceGetGpuMaxPcieLinkGeneration(device, &maxLinkGenDevice) + return int(maxLinkGenDevice), ret } // nvml.DeviceGetFanControlPolicy_v2() -func (l *library) DeviceGetFanControlPolicy_v2(Device Device, Fan int) (FanControlPolicy, Return) { - return Device.GetFanControlPolicy_v2(Fan) +func (l *library) DeviceGetFanControlPolicy_v2(device Device, fan int) (FanControlPolicy, Return) { + return device.GetFanControlPolicy_v2(fan) } -func (Device nvmlDevice) GetFanControlPolicy_v2(Fan int) (FanControlPolicy, Return) { - var Policy FanControlPolicy - ret := nvmlDeviceGetFanControlPolicy_v2(Device, uint32(Fan), &Policy) - return Policy, ret +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 (l *library) DeviceSetFanControlPolicy(Device Device, Fan int, Policy FanControlPolicy) Return { - return Device.SetFanControlPolicy(Fan, Policy) +func (l *library) DeviceSetFanControlPolicy(device Device, fan int, policy FanControlPolicy) Return { + return device.SetFanControlPolicy(fan, policy) } -func (Device nvmlDevice) SetFanControlPolicy(Fan int, Policy FanControlPolicy) Return { - return nvmlDeviceSetFanControlPolicy(Device, uint32(Fan), Policy) +func (device nvmlDevice) SetFanControlPolicy(fan int, policy FanControlPolicy) Return { + return nvmlDeviceSetFanControlPolicy(device, uint32(fan), policy) } // nvml.DeviceClearFieldValues() -func (l *library) DeviceClearFieldValues(Device Device, Values []FieldValue) Return { - return Device.ClearFieldValues(Values) +func (l *library) DeviceClearFieldValues(device Device, values []FieldValue) Return { + return device.ClearFieldValues(values) } -func (Device nvmlDevice) ClearFieldValues(Values []FieldValue) Return { - ValuesCount := len(Values) - return nvmlDeviceClearFieldValues(Device, int32(ValuesCount), &Values[0]) +func (device nvmlDevice) ClearFieldValues(values []FieldValue) Return { + valuesCount := len(values) + return nvmlDeviceClearFieldValues(device, int32(valuesCount), &values[0]) } // nvml.DeviceGetVgpuCapabilities() -func (l *library) DeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability) (bool, Return) { - return Device.GetVgpuCapabilities(Capability) +func (l *library) DeviceGetVgpuCapabilities(device Device, capability DeviceVgpuCapability) (bool, Return) { + return device.GetVgpuCapabilities(capability) } -func (Device nvmlDevice) GetVgpuCapabilities(Capability DeviceVgpuCapability) (bool, Return) { - var CapResult uint32 - ret := nvmlDeviceGetVgpuCapabilities(Device, Capability, &CapResult) - return (CapResult != 0), ret +func (device nvmlDevice) GetVgpuCapabilities(capability DeviceVgpuCapability) (bool, Return) { + var capResult uint32 + ret := nvmlDeviceGetVgpuCapabilities(device, capability, &capResult) + return (capResult != 0), ret } // nvml.DeviceGetVgpuSchedulerLog() -func (l *library) DeviceGetVgpuSchedulerLog(Device Device) (VgpuSchedulerLog, Return) { - return Device.GetVgpuSchedulerLog() +func (l *library) DeviceGetVgpuSchedulerLog(device Device) (VgpuSchedulerLog, Return) { + return device.GetVgpuSchedulerLog() } -func (Device nvmlDevice) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { - var PSchedulerLog VgpuSchedulerLog - ret := nvmlDeviceGetVgpuSchedulerLog(Device, &PSchedulerLog) - return PSchedulerLog, ret +func (device nvmlDevice) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { + var pSchedulerLog VgpuSchedulerLog + ret := nvmlDeviceGetVgpuSchedulerLog(device, &pSchedulerLog) + return pSchedulerLog, ret } // nvml.DeviceGetVgpuSchedulerState() -func (l *library) DeviceGetVgpuSchedulerState(Device Device) (VgpuSchedulerGetState, Return) { - return Device.GetVgpuSchedulerState() +func (l *library) DeviceGetVgpuSchedulerState(device Device) (VgpuSchedulerGetState, Return) { + return device.GetVgpuSchedulerState() } -func (Device nvmlDevice) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { - var PSchedulerState VgpuSchedulerGetState - ret := nvmlDeviceGetVgpuSchedulerState(Device, &PSchedulerState) - return PSchedulerState, ret +func (device nvmlDevice) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { + var pSchedulerState VgpuSchedulerGetState + ret := nvmlDeviceGetVgpuSchedulerState(device, &pSchedulerState) + return pSchedulerState, ret } // nvml.DeviceSetVgpuSchedulerState() -func (l *library) DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return { - return Device.SetVgpuSchedulerState(PSchedulerState) +func (l *library) DeviceSetVgpuSchedulerState(device Device, pSchedulerState *VgpuSchedulerSetState) Return { + return device.SetVgpuSchedulerState(pSchedulerState) } -func (Device nvmlDevice) SetVgpuSchedulerState(PSchedulerState *VgpuSchedulerSetState) Return { - return nvmlDeviceSetVgpuSchedulerState(Device, PSchedulerState) +func (device nvmlDevice) SetVgpuSchedulerState(pSchedulerState *VgpuSchedulerSetState) Return { + return nvmlDeviceSetVgpuSchedulerState(device, pSchedulerState) } // nvml.DeviceGetVgpuSchedulerCapabilities() -func (l *library) DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) { - return Device.GetVgpuSchedulerCapabilities() +func (l *library) DeviceGetVgpuSchedulerCapabilities(device Device) (VgpuSchedulerCapabilities, Return) { + return device.GetVgpuSchedulerCapabilities() } -func (Device nvmlDevice) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) { - var PCapabilities VgpuSchedulerCapabilities - ret := nvmlDeviceGetVgpuSchedulerCapabilities(Device, &PCapabilities) - return PCapabilities, ret +func (device nvmlDevice) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) { + var pCapabilities VgpuSchedulerCapabilities + ret := nvmlDeviceGetVgpuSchedulerCapabilities(device, &pCapabilities) + return pCapabilities, ret } // nvml.GpuInstanceGetComputeInstancePossiblePlacements() -func (l *library) GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { - return GpuInstance.GetComputeInstancePossiblePlacements(Info) +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) +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 + placementArray := make([]ComputeInstancePlacement, count) + ret = nvmlGpuInstanceGetComputeInstancePossiblePlacements(gpuInstance, info.Id, &placementArray[0], &count) + return placementArray, ret } // nvml.GpuInstanceCreateComputeInstanceWithPlacement() -func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) { - return GpuInstance.CreateComputeInstanceWithPlacement(Info, Placement) +func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) { + return gpuInstance.CreateComputeInstanceWithPlacement(info, placement) } -func (GpuInstance nvmlGpuInstance) CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement) (ComputeInstance, Return) { - var ComputeInstance nvmlComputeInstance - ret := nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, &ComputeInstance) - return ComputeInstance, ret +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 (l *library) DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) { - return Device.GetGpuFabricInfo() +func (l *library) DeviceGetGpuFabricInfo(device Device) (GpuFabricInfo, Return) { + return device.GetGpuFabricInfo() } -func (Device nvmlDevice) GetGpuFabricInfo() (GpuFabricInfo, Return) { - var GpuFabricInfo GpuFabricInfo - ret := nvmlDeviceGetGpuFabricInfo(Device, &GpuFabricInfo) - return GpuFabricInfo, ret +func (device nvmlDevice) GetGpuFabricInfo() (GpuFabricInfo, Return) { + var gpuFabricInfo GpuFabricInfo + ret := nvmlDeviceGetGpuFabricInfo(device, &gpuFabricInfo) + return gpuFabricInfo, ret } // nvml.DeviceCcuGetStreamState() -func (l *library) DeviceCcuGetStreamState(Device Device) (int, Return) { - return Device.CcuGetStreamState() +func (l *library) DeviceCcuGetStreamState(device Device) (int, Return) { + return device.CcuGetStreamState() } -func (Device nvmlDevice) CcuGetStreamState() (int, Return) { - var State uint32 - ret := nvmlDeviceCcuGetStreamState(Device, &State) - return int(State), ret +func (device nvmlDevice) CcuGetStreamState() (int, Return) { + var state uint32 + ret := nvmlDeviceCcuGetStreamState(device, &state) + return int(state), ret } // nvml.DeviceCcuSetStreamState() -func (l *library) DeviceCcuSetStreamState(Device Device, State int) Return { - return Device.CcuSetStreamState(State) +func (l *library) DeviceCcuSetStreamState(device Device, state int) Return { + return device.CcuSetStreamState(state) } -func (Device nvmlDevice) CcuSetStreamState(State int) Return { - return nvmlDeviceCcuSetStreamState(Device, uint32(State)) +func (device nvmlDevice) CcuSetStreamState(state int) Return { + return nvmlDeviceCcuSetStreamState(device, uint32(state)) } // nvml.DeviceSetNvLinkDeviceLowPowerThreshold() -func (l *library) DeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return { - return Device.SetNvLinkDeviceLowPowerThreshold(Info) +func (l *library) DeviceSetNvLinkDeviceLowPowerThreshold(device Device, info *NvLinkPowerThres) Return { + return device.SetNvLinkDeviceLowPowerThreshold(info) } -func (Device nvmlDevice) SetNvLinkDeviceLowPowerThreshold(Info *NvLinkPowerThres) Return { - return nvmlDeviceSetNvLinkDeviceLowPowerThreshold(Device, Info) +func (device nvmlDevice) SetNvLinkDeviceLowPowerThreshold(info *NvLinkPowerThres) Return { + return nvmlDeviceSetNvLinkDeviceLowPowerThreshold(device, info) } diff --git a/pkg/nvml/event_set.go b/pkg/nvml/event_set.go index 23965b3..3ebcae9 100644 --- a/pkg/nvml/event_set.go +++ b/pkg/nvml/event_set.go @@ -22,21 +22,21 @@ func (l *library) EventSetCreate() (EventSet, Return) { } // nvml.EventSetWait() -func (l *library) EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) { - return Set.Wait(Timeoutms) +func (l *library) EventSetWait(set EventSet, timeoutms uint32) (EventData, Return) { + return set.Wait(timeoutms) } -func (Set nvmlEventSet) Wait(Timeoutms uint32) (EventData, Return) { - var Data EventData - ret := nvmlEventSetWait(Set, &Data, Timeoutms) - return Data, ret +func (set nvmlEventSet) Wait(timeoutms uint32) (EventData, Return) { + var data EventData + ret := nvmlEventSetWait(set, &data, timeoutms) + return data, ret } // nvml.EventSetFree() -func (l *library) EventSetFree(Set EventSet) Return { - return Set.Free() +func (l *library) EventSetFree(set EventSet) Return { + return set.Free() } -func (Set nvmlEventSet) Free() Return { - return nvmlEventSetFree(Set) +func (set nvmlEventSet) Free() Return { + return nvmlEventSetFree(set) } diff --git a/pkg/nvml/gpm.go b/pkg/nvml/gpm.go index a0a74cf..3650f40 100644 --- a/pkg/nvml/gpm.go +++ b/pkg/nvml/gpm.go @@ -19,46 +19,46 @@ type GpmMetricsGetVType struct { metricsGet *GpmMetricsGetType } -func (l *library) GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType { - return GpmMetricsGetVType{MetricsGet} +func (l *library) GpmMetricsGetV(metricsGet *GpmMetricsGetType) GpmMetricsGetVType { + return GpmMetricsGetVType{metricsGet} } -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 (l *library) 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) } // nvml.GpmSampleFree() -func (l *library) GpmSampleFree(GpmSample GpmSample) Return { - return GpmSample.Free() +func (l *library) GpmSampleFree(gpmSample GpmSample) Return { + return gpmSample.Free() } -func (GpmSample nvmlGpmSample) Free() Return { - return nvmlGpmSampleFree(GpmSample) +func (gpmSample nvmlGpmSample) Free() Return { + return nvmlGpmSampleFree(gpmSample) } // nvml.GpmSampleAlloc() func (l *library) GpmSampleAlloc() (GpmSample, Return) { - var GpmSample nvmlGpmSample - ret := nvmlGpmSampleAlloc(&GpmSample) - return GpmSample, ret + var gpmSample nvmlGpmSample + ret := nvmlGpmSampleAlloc(&gpmSample) + return gpmSample, ret } // nvml.GpmSampleGet() -func (l *library) GpmSampleGet(Device Device, GpmSample GpmSample) Return { - return GpmSample.Get(Device) +func (l *library) GpmSampleGet(device Device, gpmSample GpmSample) Return { + return gpmSample.Get(device) } -func (Device nvmlDevice) GpmSampleGet(GpmSample GpmSample) Return { - return GpmSample.Get(Device) +func (device nvmlDevice) GpmSampleGet(gpmSample GpmSample) Return { + return gpmSample.Get(device) } -func (GpmSample nvmlGpmSample) Get(Device Device) Return { - return nvmlGpmSampleGet(Device.(nvmlDevice), GpmSample) +func (gpmSample nvmlGpmSample) Get(device Device) Return { + return nvmlGpmSampleGet(device.(nvmlDevice), gpmSample) } // nvml.GpmQueryDeviceSupport() @@ -66,41 +66,41 @@ type GpmSupportV struct { device nvmlDevice } -func (l *library) GpmQueryDeviceSupportV(Device Device) GpmSupportV { - return Device.GpmQueryDeviceSupportV() +func (l *library) GpmQueryDeviceSupportV(device Device) GpmSupportV { + return device.GpmQueryDeviceSupportV() } -func (Device nvmlDevice) 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 (l *library) GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) { - return Device.GpmQueryDeviceSupport() +func (l *library) GpmQueryDeviceSupport(device Device) (GpmSupport, Return) { + return device.GpmQueryDeviceSupport() } -func (Device nvmlDevice) GpmQueryDeviceSupport() (GpmSupport, Return) { - var GpmSupport GpmSupport - GpmSupport.Version = GPM_SUPPORT_VERSION - ret := nvmlGpmQueryDeviceSupport(Device, &GpmSupport) - return GpmSupport, ret +func (device nvmlDevice) GpmQueryDeviceSupport() (GpmSupport, Return) { + var gpmSupport GpmSupport + gpmSupport.Version = GPM_SUPPORT_VERSION + ret := nvmlGpmQueryDeviceSupport(device, &gpmSupport) + return gpmSupport, ret } // nvml.GpmMigSampleGet() -func (l *library) GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return { - return GpmSample.MigGet(Device, GpuInstanceId) +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 nvmlDevice) GpmMigSampleGet(gpuInstanceId int, gpmSample GpmSample) Return { + return gpmSample.MigGet(device, gpuInstanceId) } -func (GpmSample nvmlGpmSample) MigGet(Device Device, GpuInstanceId int) Return { - return nvmlGpmMigSampleGet(Device.(nvmlDevice), uint32(GpuInstanceId), GpmSample) +func (gpmSample nvmlGpmSample) MigGet(device Device, gpuInstanceId int) Return { + return nvmlGpmMigSampleGet(device.(nvmlDevice), uint32(gpuInstanceId), gpmSample) } diff --git a/pkg/nvml/init.go b/pkg/nvml/init.go index ca92f23..6c4bd58 100644 --- a/pkg/nvml/init.go +++ b/pkg/nvml/init.go @@ -25,11 +25,11 @@ func (l *library) Init() Return { } // nvml.InitWithFlags() -func (l *library) 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() diff --git a/pkg/nvml/system.go b/pkg/nvml/system.go index 48caf56..03145b2 100644 --- a/pkg/nvml/system.go +++ b/pkg/nvml/system.go @@ -43,39 +43,39 @@ func (l *library) SystemGetCudaDriverVersion_v2() (int, Return) { } // nvml.SystemGetProcessName() -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 +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 (l *library) SystemGetHicVersion() ([]HwbcEntry, Return) { - var HwbcCount uint32 = 1 // Will be reduced upon returning + 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 (l *library) 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([]nvmlDevice, Count) - ret = nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, &DeviceArray[0]) - return convertSlice[nvmlDevice, Device](DeviceArray), ret + deviceArray := make([]nvmlDevice, count) + ret = nvmlSystemGetTopologyGpuSet(uint32(cpuNumber), &count, &deviceArray[0]) + return convertSlice[nvmlDevice, Device](deviceArray), ret } diff --git a/pkg/nvml/unit.go b/pkg/nvml/unit.go index 6100752..617ad54 100644 --- a/pkg/nvml/unit.go +++ b/pkg/nvml/unit.go @@ -22,92 +22,92 @@ func (l *library) UnitGetCount() (int, Return) { } // nvml.UnitGetHandleByIndex() -func (l *library) UnitGetHandleByIndex(Index int) (Unit, Return) { - var Unit nvmlUnit - 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 (l *library) UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) { - return Unit.GetUnitInfo() +func (l *library) UnitGetUnitInfo(unit Unit) (UnitInfo, Return) { + return unit.GetUnitInfo() } -func (Unit nvmlUnit) GetUnitInfo() (UnitInfo, Return) { - var Info UnitInfo - ret := nvmlUnitGetUnitInfo(Unit, &Info) - return Info, ret +func (unit nvmlUnit) GetUnitInfo() (UnitInfo, Return) { + var info UnitInfo + ret := nvmlUnitGetUnitInfo(unit, &info) + return info, ret } // nvml.UnitGetLedState() -func (l *library) UnitGetLedState(Unit Unit) (LedState, Return) { - return Unit.GetLedState() +func (l *library) UnitGetLedState(unit Unit) (LedState, Return) { + return unit.GetLedState() } -func (Unit nvmlUnit) GetLedState() (LedState, Return) { - var State LedState - ret := nvmlUnitGetLedState(Unit, &State) - return State, ret +func (unit nvmlUnit) GetLedState() (LedState, Return) { + var state LedState + ret := nvmlUnitGetLedState(unit, &state) + return state, ret } // nvml.UnitGetPsuInfo() -func (l *library) UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) { - return Unit.GetPsuInfo() +func (l *library) UnitGetPsuInfo(unit Unit) (PSUInfo, Return) { + return unit.GetPsuInfo() } -func (Unit nvmlUnit) GetPsuInfo() (PSUInfo, Return) { - var Psu PSUInfo - ret := nvmlUnitGetPsuInfo(Unit, &Psu) - return Psu, ret +func (unit nvmlUnit) GetPsuInfo() (PSUInfo, Return) { + var psu PSUInfo + ret := nvmlUnitGetPsuInfo(unit, &psu) + return psu, ret } // nvml.UnitGetTemperature() -func (l *library) UnitGetTemperature(Unit Unit, Type int) (uint32, Return) { - return Unit.GetTemperature(Type) +func (l *library) UnitGetTemperature(unit Unit, ttype int) (uint32, Return) { + return unit.GetTemperature(ttype) } -func (Unit nvmlUnit) GetTemperature(Type int) (uint32, Return) { - var Temp uint32 - ret := nvmlUnitGetTemperature(Unit, uint32(Type), &Temp) - return Temp, ret +func (unit nvmlUnit) GetTemperature(ttype int) (uint32, Return) { + var temp uint32 + ret := nvmlUnitGetTemperature(unit, uint32(ttype), &temp) + return temp, ret } // nvml.UnitGetFanSpeedInfo() -func (l *library) UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) { - return Unit.GetFanSpeedInfo() +func (l *library) UnitGetFanSpeedInfo(unit Unit) (UnitFanSpeeds, Return) { + return unit.GetFanSpeedInfo() } -func (Unit nvmlUnit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { - var FanSpeeds UnitFanSpeeds - ret := nvmlUnitGetFanSpeedInfo(Unit, &FanSpeeds) - return FanSpeeds, ret +func (unit nvmlUnit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { + var fanSpeeds UnitFanSpeeds + ret := nvmlUnitGetFanSpeedInfo(unit, &fanSpeeds) + return fanSpeeds, ret } // nvml.UnitGetDevices() -func (l *library) UnitGetDevices(Unit Unit) ([]Device, Return) { - return Unit.GetDevices() +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 +func (unit nvmlUnit) GetDevices() ([]Device, Return) { + var deviceCount uint32 = 1 // Will be reduced upon returning for { - Devices := make([]nvmlDevice, DeviceCount) - ret := nvmlUnitGetDevices(Unit, &DeviceCount, &Devices[0]) + devices := make([]nvmlDevice, deviceCount) + ret := nvmlUnitGetDevices(unit, &deviceCount, &devices[0]) if ret == SUCCESS { - return convertSlice[nvmlDevice, Device](Devices[:DeviceCount]), ret + return convertSlice[nvmlDevice, Device](devices[:deviceCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - DeviceCount *= 2 + deviceCount *= 2 } } // nvml.UnitSetLedState() -func (l *library) UnitSetLedState(Unit Unit, Color LedColor) Return { - return Unit.SetLedState(Color) +func (l *library) UnitSetLedState(unit Unit, color LedColor) Return { + return unit.SetLedState(color) } -func (Unit nvmlUnit) SetLedState(Color LedColor) Return { - return nvmlUnitSetLedState(Unit, Color) +func (unit nvmlUnit) SetLedState(color LedColor) Return { + return nvmlUnitSetLedState(unit, color) } diff --git a/pkg/nvml/vgpu.go b/pkg/nvml/vgpu.go index f82d928..b75a5e4 100644 --- a/pkg/nvml/vgpu.go +++ b/pkg/nvml/vgpu.go @@ -31,450 +31,450 @@ type VgpuPgpuMetadata struct { } // nvml.VgpuTypeGetClass() -func (l *library) VgpuTypeGetClass(VgpuTypeId VgpuTypeId) (string, Return) { - return VgpuTypeId.GetClass() +func (l *library) VgpuTypeGetClass(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetClass() } -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 +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 (l *library) VgpuTypeGetName(VgpuTypeId VgpuTypeId) (string, Return) { - return VgpuTypeId.GetName() +func (l *library) VgpuTypeGetName(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetName() } -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 +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 (l *library) VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) { - return VgpuTypeId.GetGpuInstanceProfileId() +func (l *library) VgpuTypeGetGpuInstanceProfileId(vgpuTypeId VgpuTypeId) (uint32, Return) { + return vgpuTypeId.GetGpuInstanceProfileId() } -func (VgpuTypeId nvmlVgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { - var Size uint32 - ret := nvmlVgpuTypeGetGpuInstanceProfileId(VgpuTypeId, &Size) - return Size, ret +func (vgpuTypeId nvmlVgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { + var size uint32 + ret := nvmlVgpuTypeGetGpuInstanceProfileId(vgpuTypeId, &size) + return size, ret } // nvml.VgpuTypeGetDeviceID() -func (l *library) VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) { - return VgpuTypeId.GetDeviceID() +func (l *library) VgpuTypeGetDeviceID(vgpuTypeId VgpuTypeId) (uint64, uint64, Return) { + return vgpuTypeId.GetDeviceID() } -func (VgpuTypeId nvmlVgpuTypeId) GetDeviceID() (uint64, uint64, Return) { - var DeviceID, SubsystemID uint64 - ret := nvmlVgpuTypeGetDeviceID(VgpuTypeId, &DeviceID, &SubsystemID) - return DeviceID, SubsystemID, ret +func (vgpuTypeId nvmlVgpuTypeId) GetDeviceID() (uint64, uint64, Return) { + var deviceID, subsystemID uint64 + ret := nvmlVgpuTypeGetDeviceID(vgpuTypeId, &deviceID, &subsystemID) + return deviceID, subsystemID, ret } // nvml.VgpuTypeGetFramebufferSize() -func (l *library) VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) { - return VgpuTypeId.GetFramebufferSize() +func (l *library) VgpuTypeGetFramebufferSize(vgpuTypeId VgpuTypeId) (uint64, Return) { + return vgpuTypeId.GetFramebufferSize() } -func (VgpuTypeId nvmlVgpuTypeId) GetFramebufferSize() (uint64, Return) { - var FbSize uint64 - ret := nvmlVgpuTypeGetFramebufferSize(VgpuTypeId, &FbSize) - return FbSize, ret +func (vgpuTypeId nvmlVgpuTypeId) GetFramebufferSize() (uint64, Return) { + var fbSize uint64 + ret := nvmlVgpuTypeGetFramebufferSize(vgpuTypeId, &fbSize) + return fbSize, ret } // nvml.VgpuTypeGetNumDisplayHeads() -func (l *library) VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) { - return VgpuTypeId.GetNumDisplayHeads() +func (l *library) VgpuTypeGetNumDisplayHeads(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetNumDisplayHeads() } -func (VgpuTypeId nvmlVgpuTypeId) GetNumDisplayHeads() (int, Return) { - var NumDisplayHeads uint32 - ret := nvmlVgpuTypeGetNumDisplayHeads(VgpuTypeId, &NumDisplayHeads) - return int(NumDisplayHeads), ret +func (vgpuTypeId nvmlVgpuTypeId) GetNumDisplayHeads() (int, Return) { + var numDisplayHeads uint32 + ret := nvmlVgpuTypeGetNumDisplayHeads(vgpuTypeId, &numDisplayHeads) + return int(numDisplayHeads), ret } // nvml.VgpuTypeGetResolution() -func (l *library) VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) { - return VgpuTypeId.GetResolution(DisplayIndex) +func (l *library) VgpuTypeGetResolution(vgpuTypeId VgpuTypeId, displayIndex int) (uint32, uint32, Return) { + return vgpuTypeId.GetResolution(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 +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 (l *library) VgpuTypeGetLicense(VgpuTypeId VgpuTypeId) (string, Return) { - return VgpuTypeId.GetLicense() +func (l *library) VgpuTypeGetLicense(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetLicense() } -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 +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 (l *library) VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) { - return VgpuTypeId.GetFrameRateLimit() +func (l *library) VgpuTypeGetFrameRateLimit(vgpuTypeId VgpuTypeId) (uint32, Return) { + return vgpuTypeId.GetFrameRateLimit() } -func (VgpuTypeId nvmlVgpuTypeId) GetFrameRateLimit() (uint32, Return) { - var FrameRateLimit uint32 - ret := nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId, &FrameRateLimit) - return FrameRateLimit, ret +func (vgpuTypeId nvmlVgpuTypeId) GetFrameRateLimit() (uint32, Return) { + var frameRateLimit uint32 + ret := nvmlVgpuTypeGetFrameRateLimit(vgpuTypeId, &frameRateLimit) + return frameRateLimit, ret } // nvml.VgpuTypeGetMaxInstances() -func (l *library) VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) { - return VgpuTypeId.GetMaxInstances(Device) +func (l *library) VgpuTypeGetMaxInstances(device Device, vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstances(device) } -func (Device nvmlDevice) VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) { - return VgpuTypeId.GetMaxInstances(Device) +func (device nvmlDevice) VgpuTypeGetMaxInstances(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstances(device) } -func (VgpuTypeId nvmlVgpuTypeId) GetMaxInstances(Device Device) (int, Return) { - var VgpuInstanceCount uint32 - ret := nvmlVgpuTypeGetMaxInstances(Device.(nvmlDevice), VgpuTypeId, &VgpuInstanceCount) - return int(VgpuInstanceCount), ret +func (vgpuTypeId nvmlVgpuTypeId) GetMaxInstances(device Device) (int, Return) { + var vgpuInstanceCount uint32 + ret := nvmlVgpuTypeGetMaxInstances(device.(nvmlDevice), vgpuTypeId, &vgpuInstanceCount) + return int(vgpuInstanceCount), ret } // nvml.VgpuTypeGetMaxInstancesPerVm() -func (l *library) VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) { - return VgpuTypeId.GetMaxInstancesPerVm() +func (l *library) VgpuTypeGetMaxInstancesPerVm(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstancesPerVm() } -func (VgpuTypeId nvmlVgpuTypeId) GetMaxInstancesPerVm() (int, Return) { - var VgpuInstanceCountPerVm uint32 - ret := nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId, &VgpuInstanceCountPerVm) - return int(VgpuInstanceCountPerVm), ret +func (vgpuTypeId nvmlVgpuTypeId) GetMaxInstancesPerVm() (int, Return) { + var vgpuInstanceCountPerVm uint32 + ret := nvmlVgpuTypeGetMaxInstancesPerVm(vgpuTypeId, &vgpuInstanceCountPerVm) + return int(vgpuInstanceCountPerVm), ret } // nvml.VgpuInstanceGetVmID() -func (l *library) VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { - return VgpuInstance.GetVmID() +func (l *library) VgpuInstanceGetVmID(vgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { + return vgpuInstance.GetVmID() } -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 +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 (l *library) VgpuInstanceGetUUID(VgpuInstance VgpuInstance) (string, Return) { - return VgpuInstance.GetUUID() +func (l *library) VgpuInstanceGetUUID(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetUUID() } -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 +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 (l *library) VgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance) (string, Return) { - return VgpuInstance.GetVmDriverVersion() +func (l *library) VgpuInstanceGetVmDriverVersion(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetVmDriverVersion() } -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 +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 (l *library) VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) { - return VgpuInstance.GetFbUsage() +func (l *library) VgpuInstanceGetFbUsage(vgpuInstance VgpuInstance) (uint64, Return) { + return vgpuInstance.GetFbUsage() } -func (VgpuInstance nvmlVgpuInstance) GetFbUsage() (uint64, Return) { - var FbUsage uint64 - ret := nvmlVgpuInstanceGetFbUsage(VgpuInstance, &FbUsage) - return FbUsage, ret +func (vgpuInstance nvmlVgpuInstance) GetFbUsage() (uint64, Return) { + var fbUsage uint64 + ret := nvmlVgpuInstanceGetFbUsage(vgpuInstance, &fbUsage) + return fbUsage, ret } // nvml.VgpuInstanceGetLicenseInfo() -func (l *library) VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { - return VgpuInstance.GetLicenseInfo() +func (l *library) VgpuInstanceGetLicenseInfo(vgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { + return vgpuInstance.GetLicenseInfo() } -func (VgpuInstance nvmlVgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { - var LicenseInfo VgpuLicenseInfo - ret := nvmlVgpuInstanceGetLicenseInfo(VgpuInstance, &LicenseInfo) - return LicenseInfo, ret +func (vgpuInstance nvmlVgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { + var licenseInfo VgpuLicenseInfo + ret := nvmlVgpuInstanceGetLicenseInfo(vgpuInstance, &licenseInfo) + return licenseInfo, ret } // nvml.VgpuInstanceGetLicenseStatus() -func (l *library) VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) { - return VgpuInstance.GetLicenseStatus() +func (l *library) VgpuInstanceGetLicenseStatus(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetLicenseStatus() } -func (VgpuInstance nvmlVgpuInstance) GetLicenseStatus() (int, Return) { - var Licensed uint32 - ret := nvmlVgpuInstanceGetLicenseStatus(VgpuInstance, &Licensed) - return int(Licensed), ret +func (vgpuInstance nvmlVgpuInstance) GetLicenseStatus() (int, Return) { + var licensed uint32 + ret := nvmlVgpuInstanceGetLicenseStatus(vgpuInstance, &licensed) + return int(licensed), ret } // nvml.VgpuInstanceGetType() -func (l *library) VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) { - return VgpuInstance.GetType() +func (l *library) VgpuInstanceGetType(vgpuInstance VgpuInstance) (VgpuTypeId, Return) { + return vgpuInstance.GetType() } -func (VgpuInstance nvmlVgpuInstance) GetType() (VgpuTypeId, Return) { - var VgpuTypeId nvmlVgpuTypeId - ret := nvmlVgpuInstanceGetType(VgpuInstance, &VgpuTypeId) - return VgpuTypeId, ret +func (vgpuInstance nvmlVgpuInstance) GetType() (VgpuTypeId, Return) { + var vgpuTypeId nvmlVgpuTypeId + ret := nvmlVgpuInstanceGetType(vgpuInstance, &vgpuTypeId) + return vgpuTypeId, ret } // nvml.VgpuInstanceGetFrameRateLimit() -func (l *library) VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) { - return VgpuInstance.GetFrameRateLimit() +func (l *library) VgpuInstanceGetFrameRateLimit(vgpuInstance VgpuInstance) (uint32, Return) { + return vgpuInstance.GetFrameRateLimit() } -func (VgpuInstance nvmlVgpuInstance) GetFrameRateLimit() (uint32, Return) { - var FrameRateLimit uint32 - ret := nvmlVgpuInstanceGetFrameRateLimit(VgpuInstance, &FrameRateLimit) - return FrameRateLimit, ret +func (vgpuInstance nvmlVgpuInstance) GetFrameRateLimit() (uint32, Return) { + var frameRateLimit uint32 + ret := nvmlVgpuInstanceGetFrameRateLimit(vgpuInstance, &frameRateLimit) + return frameRateLimit, ret } // nvml.VgpuInstanceGetEccMode() -func (l *library) VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) { - return VgpuInstance.GetEccMode() +func (l *library) VgpuInstanceGetEccMode(vgpuInstance VgpuInstance) (EnableState, Return) { + return vgpuInstance.GetEccMode() } -func (VgpuInstance nvmlVgpuInstance) GetEccMode() (EnableState, Return) { - var EccMode EnableState - ret := nvmlVgpuInstanceGetEccMode(VgpuInstance, &EccMode) - return EccMode, ret +func (vgpuInstance nvmlVgpuInstance) GetEccMode() (EnableState, Return) { + var eccMode EnableState + ret := nvmlVgpuInstanceGetEccMode(vgpuInstance, &eccMode) + return eccMode, ret } // nvml.VgpuInstanceGetEncoderCapacity() -func (l *library) VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) { - return VgpuInstance.GetEncoderCapacity() +func (l *library) VgpuInstanceGetEncoderCapacity(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetEncoderCapacity() } -func (VgpuInstance nvmlVgpuInstance) GetEncoderCapacity() (int, Return) { - var EncoderCapacity uint32 - ret := nvmlVgpuInstanceGetEncoderCapacity(VgpuInstance, &EncoderCapacity) - return int(EncoderCapacity), ret +func (vgpuInstance nvmlVgpuInstance) GetEncoderCapacity() (int, Return) { + var encoderCapacity uint32 + ret := nvmlVgpuInstanceGetEncoderCapacity(vgpuInstance, &encoderCapacity) + return int(encoderCapacity), ret } // nvml.VgpuInstanceSetEncoderCapacity() -func (l *library) VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return { - return VgpuInstance.SetEncoderCapacity(EncoderCapacity) +func (l *library) VgpuInstanceSetEncoderCapacity(vgpuInstance VgpuInstance, encoderCapacity int) Return { + return vgpuInstance.SetEncoderCapacity(encoderCapacity) } -func (VgpuInstance nvmlVgpuInstance) SetEncoderCapacity(EncoderCapacity int) Return { - return nvmlVgpuInstanceSetEncoderCapacity(VgpuInstance, uint32(EncoderCapacity)) +func (vgpuInstance nvmlVgpuInstance) SetEncoderCapacity(encoderCapacity int) Return { + return nvmlVgpuInstanceSetEncoderCapacity(vgpuInstance, uint32(encoderCapacity)) } // nvml.VgpuInstanceGetEncoderStats() -func (l *library) VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) { - return VgpuInstance.GetEncoderStats() +func (l *library) VgpuInstanceGetEncoderStats(vgpuInstance VgpuInstance) (int, uint32, uint32, Return) { + return vgpuInstance.GetEncoderStats() } -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 +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 (l *library) VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { - return VgpuInstance.GetEncoderSessions() +func (l *library) VgpuInstanceGetEncoderSessions(vgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { + return vgpuInstance.GetEncoderSessions() } -func (VgpuInstance nvmlVgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) { - var SessionCount uint32 - var SessionInfo EncoderSessionInfo - ret := nvmlVgpuInstanceGetEncoderSessions(VgpuInstance, &SessionCount, &SessionInfo) - return int(SessionCount), SessionInfo, ret +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 (l *library) VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) { - return VgpuInstance.GetFBCStats() +func (l *library) VgpuInstanceGetFBCStats(vgpuInstance VgpuInstance) (FBCStats, Return) { + return vgpuInstance.GetFBCStats() } -func (VgpuInstance nvmlVgpuInstance) GetFBCStats() (FBCStats, Return) { - var FbcStats FBCStats - ret := nvmlVgpuInstanceGetFBCStats(VgpuInstance, &FbcStats) - return FbcStats, ret +func (vgpuInstance nvmlVgpuInstance) GetFBCStats() (FBCStats, Return) { + var fbcStats FBCStats + ret := nvmlVgpuInstanceGetFBCStats(vgpuInstance, &fbcStats) + return fbcStats, ret } // nvml.VgpuInstanceGetFBCSessions() -func (l *library) VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { - return VgpuInstance.GetFBCSessions() +func (l *library) VgpuInstanceGetFBCSessions(vgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { + return vgpuInstance.GetFBCSessions() } -func (VgpuInstance nvmlVgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) { - var SessionCount uint32 - var SessionInfo FBCSessionInfo - ret := nvmlVgpuInstanceGetFBCSessions(VgpuInstance, &SessionCount, &SessionInfo) - return int(SessionCount), SessionInfo, ret +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 (l *library) VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) { - return VgpuInstance.GetGpuInstanceId() +func (l *library) VgpuInstanceGetGpuInstanceId(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetGpuInstanceId() } -func (VgpuInstance nvmlVgpuInstance) GetGpuInstanceId() (int, Return) { +func (vgpuInstance nvmlVgpuInstance) GetGpuInstanceId() (int, Return) { var gpuInstanceId uint32 - ret := nvmlVgpuInstanceGetGpuInstanceId(VgpuInstance, &gpuInstanceId) + ret := nvmlVgpuInstanceGetGpuInstanceId(vgpuInstance, &gpuInstanceId) return int(gpuInstanceId), ret } // nvml.VgpuInstanceGetGpuPciId() -func (l *library) VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Return) { - return VgpuInstance.GetGpuPciId() +func (l *library) VgpuInstanceGetGpuPciId(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetGpuPciId() } -func (VgpuInstance nvmlVgpuInstance) GetGpuPciId() (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 } } // nvml.VgpuInstanceGetMetadata() -func (l *library) VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) { - return VgpuInstance.GetMetadata() +func (l *library) VgpuInstanceGetMetadata(vgpuInstance VgpuInstance) (VgpuMetadata, Return) { + return vgpuInstance.GetMetadata() } -func (VgpuInstance nvmlVgpuInstance) GetMetadata() (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 } } // nvml.VgpuInstanceGetAccountingMode() -func (l *library) VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) { - return VgpuInstance.GetAccountingMode() +func (l *library) VgpuInstanceGetAccountingMode(vgpuInstance VgpuInstance) (EnableState, Return) { + return vgpuInstance.GetAccountingMode() } -func (VgpuInstance nvmlVgpuInstance) GetAccountingMode() (EnableState, Return) { - var Mode EnableState - ret := nvmlVgpuInstanceGetAccountingMode(VgpuInstance, &Mode) - return Mode, ret +func (vgpuInstance nvmlVgpuInstance) GetAccountingMode() (EnableState, Return) { + var mode EnableState + ret := nvmlVgpuInstanceGetAccountingMode(vgpuInstance, &mode) + return mode, ret } // nvml.VgpuInstanceGetAccountingPids() -func (l *library) VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]int, Return) { - return VgpuInstance.GetAccountingPids() +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 +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 } } // nvml.VgpuInstanceGetAccountingStats() -func (l *library) VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) { - return VgpuInstance.GetAccountingStats(Pid) +func (l *library) VgpuInstanceGetAccountingStats(vgpuInstance VgpuInstance, pid int) (AccountingStats, Return) { + return vgpuInstance.GetAccountingStats(pid) } -func (VgpuInstance nvmlVgpuInstance) GetAccountingStats(Pid int) (AccountingStats, Return) { - var Stats AccountingStats - ret := nvmlVgpuInstanceGetAccountingStats(VgpuInstance, uint32(Pid), &Stats) - return Stats, ret +func (vgpuInstance nvmlVgpuInstance) GetAccountingStats(pid int) (AccountingStats, Return) { + var stats AccountingStats + ret := nvmlVgpuInstanceGetAccountingStats(vgpuInstance, uint32(pid), &stats) + return stats, ret } // nvml.GetVgpuCompatibility() -func (l *library) GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { - var CompatibilityInfo VgpuPgpuCompatibility - ret := nvmlGetVgpuCompatibility(nvmlVgpuMetadata, PgpuMetadata, &CompatibilityInfo) - return CompatibilityInfo, ret +func (l *library) GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, pgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { + var compatibilityInfo VgpuPgpuCompatibility + ret := nvmlGetVgpuCompatibility(nvmlVgpuMetadata, pgpuMetadata, &compatibilityInfo) + return compatibilityInfo, ret } // nvml.GetVgpuVersion() func (l *library) GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) { - var Supported, Current VgpuVersion - ret := nvmlGetVgpuVersion(&Supported, &Current) - return Supported, Current, ret + var supported, current VgpuVersion + ret := nvmlGetVgpuVersion(&supported, ¤t) + return supported, current, ret } // nvml.SetVgpuVersion() -func (l *library) SetVgpuVersion(VgpuVersion *VgpuVersion) Return { - return nvmlSetVgpuVersion(VgpuVersion) +func (l *library) SetVgpuVersion(vgpuVersion *VgpuVersion) Return { + return nvmlSetVgpuVersion(vgpuVersion) } // nvml.VgpuInstanceClearAccountingPids() -func (l *library) VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return { - return VgpuInstance.ClearAccountingPids() +func (l *library) VgpuInstanceClearAccountingPids(vgpuInstance VgpuInstance) Return { + return vgpuInstance.ClearAccountingPids() } -func (VgpuInstance nvmlVgpuInstance) ClearAccountingPids() Return { - return nvmlVgpuInstanceClearAccountingPids(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) ClearAccountingPids() Return { + return nvmlVgpuInstanceClearAccountingPids(vgpuInstance) } // nvml.VgpuInstanceGetMdevUUID() -func (l *library) VgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance) (string, Return) { - return VgpuInstance.GetMdevUUID() +func (l *library) VgpuInstanceGetMdevUUID(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetMdevUUID() } -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 +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 (l *library) VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) { - return VgpuTypeId.GetCapabilities(Capability) +func (l *library) VgpuTypeGetCapabilities(vgpuTypeId VgpuTypeId, capability VgpuCapability) (bool, Return) { + return vgpuTypeId.GetCapabilities(capability) } -func (VgpuTypeId nvmlVgpuTypeId) GetCapabilities(Capability VgpuCapability) (bool, Return) { - var CapResult uint32 - ret := nvmlVgpuTypeGetCapabilities(VgpuTypeId, Capability, &CapResult) - return (CapResult != 0), ret +func (vgpuTypeId nvmlVgpuTypeId) GetCapabilities(capability VgpuCapability) (bool, Return) { + var capResult uint32 + ret := nvmlVgpuTypeGetCapabilities(vgpuTypeId, capability, &capResult) + return (capResult != 0), ret } // nvml.GetVgpuDriverCapabilities() -func (l *library) 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 } From f01937ed2a841df82d284f791e2b41bf78a398d1 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 22:19:31 +0000 Subject: [PATCH 16/21] Fix API call for GetVgpuCompatibility Signed-off-by: Kevin Klues --- pkg/nvml/api.go | 2 +- pkg/nvml/vgpu.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index ce2b7c7..6c327e7 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -343,7 +343,7 @@ type Interface interface { VgpuInstanceGetAccountingMode(vgpuInstance VgpuInstance) (EnableState, Return) VgpuInstanceGetAccountingPids(vgpuInstance VgpuInstance) ([]int, Return) VgpuInstanceGetAccountingStats(vgpuInstance VgpuInstance, pid int) (AccountingStats, Return) - GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, pgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) + GetVgpuCompatibility(vgpuMetadata *VgpuMetadata, pgpuMetadata *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) SetVgpuVersion(vgpuVersion *VgpuVersion) Return VgpuInstanceClearAccountingPids(vgpuInstance VgpuInstance) Return diff --git a/pkg/nvml/vgpu.go b/pkg/nvml/vgpu.go index b75a5e4..bd80077 100644 --- a/pkg/nvml/vgpu.go +++ b/pkg/nvml/vgpu.go @@ -423,9 +423,9 @@ func (vgpuInstance nvmlVgpuInstance) GetAccountingStats(pid int) (AccountingStat } // nvml.GetVgpuCompatibility() -func (l *library) GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, pgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { +func (l *library) GetVgpuCompatibility(vgpuMetadata *VgpuMetadata, pgpuMetadata *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { var compatibilityInfo VgpuPgpuCompatibility - ret := nvmlGetVgpuCompatibility(nvmlVgpuMetadata, pgpuMetadata, &compatibilityInfo) + ret := nvmlGetVgpuCompatibility(&vgpuMetadata.nvmlVgpuMetadata, &pgpuMetadata.nvmlVgpuPgpuMetadata, &compatibilityInfo) return compatibilityInfo, ret } From b34e706fc671fb913a7dc887028cfb0ff2678137 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Fri, 12 Apr 2024 09:38:48 +0000 Subject: [PATCH 17/21] Ensure that exported structs reference interface types not private types Signed-off-by: Kevin Klues --- gen/nvml/nvml.yml | 5 +++- pkg/nvml/device.go | 67 ++++++++++++++++++++++++++++++++++++++++--- pkg/nvml/event_set.go | 35 ++++++++++++++++++++-- pkg/nvml/gpm.go | 41 ++++++++++++++++++++++++-- pkg/nvml/nvml.go | 12 ++++---- pkg/nvml/types_gen.go | 8 +++--- 6 files changed, 148 insertions(+), 20 deletions(-) diff --git a/gen/nvml/nvml.yml b/gen/nvml/nvml.yml index e375797..73ea49c 100644 --- a/gen/nvml/nvml.yml +++ b/gen/nvml/nvml.yml @@ -67,14 +67,17 @@ TRANSLATOR: - {action: replace, from: "^Device$", to: "nvmlDevice"} - {action: replace, from: "^Unit$", to: "nvmlUnit"} - {action: replace, from: "^EventSet$", to: "nvmlEventSet"} + - {action: replace, from: "^EventData$", to: "nvmlEventData"} - {action: replace, from: "^GpmSample$", to: "nvmlGpmSample"} - {action: replace, from: "^ComputeInstance$", to: "nvmlComputeInstance"} + - {action: replace, from: "^ComputeInstanceInfo$", to: "nvmlComputeInstanceInfo"} - {action: replace, from: "^GpuInstance$", to: "nvmlGpuInstance"} + - {action: replace, from: "^GpuInstanceInfo$", to: "nvmlGpuInstanceInfo"} - {action: replace, from: "^VgpuInstance$", to: "nvmlVgpuInstance"} - {action: replace, from: "^VgpuTypeId$", to: "nvmlVgpuTypeId"} - {action: replace, from: "^VgpuMetadata", to: "nvmlVgpuMetadata"} - {action: replace, from: "^VgpuPgpuMetadata", to: "nvmlVgpuPgpuMetadata"} - - {action: replace, from: "^GpmMetricsGet", to: "GpmMetricsGetType"} + - {action: replace, from: "^GpmMetricsGet", to: "nvmlGpmMetricsGetType"} function: - {action: accept, from: "^nvml"} - {action: replace, from: "^nvmlInit$", to: "nvmlInit_v1"} diff --git a/pkg/nvml/device.go b/pkg/nvml/device.go index dc9cb53..7ee5e55 100644 --- a/pkg/nvml/device.go +++ b/pkg/nvml/device.go @@ -21,6 +21,65 @@ 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 (l *library) DeviceGetCount() (int, Return) { var deviceCount uint32 @@ -2113,9 +2172,9 @@ func (l *library) GpuInstanceGetInfo(gpuInstance GpuInstance) (GpuInstanceInfo, } func (gpuInstance nvmlGpuInstance) GetInfo() (GpuInstanceInfo, Return) { - var info GpuInstanceInfo + var info nvmlGpuInstanceInfo ret := nvmlGpuInstanceGetInfo(gpuInstance, &info) - return info, ret + return info.convert(), ret } // nvml.GpuInstanceGetComputeInstanceProfileInfo() @@ -2224,9 +2283,9 @@ func (l *library) ComputeInstanceGetInfo(computeInstance ComputeInstance) (Compu } func (computeInstance nvmlComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { - var info ComputeInstanceInfo + var info nvmlComputeInstanceInfo ret := nvmlComputeInstanceGetInfo(computeInstance, &info) - return info, ret + return info.convert(), ret } // nvml.DeviceIsMigDeviceHandle() diff --git a/pkg/nvml/event_set.go b/pkg/nvml/event_set.go index 3ebcae9..933b4de 100644 --- a/pkg/nvml/event_set.go +++ b/pkg/nvml/event_set.go @@ -14,6 +14,37 @@ 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 (l *library) EventSetCreate() (EventSet, Return) { var Set nvmlEventSet @@ -27,9 +58,9 @@ func (l *library) EventSetWait(set EventSet, timeoutms uint32) (EventData, Retur } func (set nvmlEventSet) Wait(timeoutms uint32) (EventData, Return) { - var data EventData + var data nvmlEventData ret := nvmlEventSetWait(set, &data, timeoutms) - return data, ret + return data.convert(), ret } // nvml.EventSetFree() diff --git a/pkg/nvml/gpm.go b/pkg/nvml/gpm.go index 3650f40..783514b 100644 --- a/pkg/nvml/gpm.go +++ b/pkg/nvml/gpm.go @@ -14,13 +14,48 @@ 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 (l *library) GpmMetricsGetV(metricsGet *GpmMetricsGetType) GpmMetricsGetVType { - return GpmMetricsGetVType{metricsGet} + return GpmMetricsGetVType{metricsGet.convert()} } func (metricsGetV GpmMetricsGetVType) V1() Return { metricsGetV.metricsGet.Version = 1 @@ -29,7 +64,7 @@ func (metricsGetV GpmMetricsGetVType) V1() Return { func (l *library) GpmMetricsGet(metricsGet *GpmMetricsGetType) Return { metricsGet.Version = GPM_METRICS_GET_VERSION - return nvmlGpmMetricsGet(metricsGet) + return nvmlGpmMetricsGet(metricsGet.convert()) } // nvml.GpmSampleFree() diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index 2cdcf53..65fcffa 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -1659,7 +1659,7 @@ func nvmlDeviceGetSupportedEventTypes(nvmlDevice nvmlDevice, EventTypes *uint64) } // nvmlEventSetWait_v2 function as declared in nvml/nvml.h -func nvmlEventSetWait_v2(Set nvmlEventSet, 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 @@ -2407,7 +2407,7 @@ func nvmlDeviceGetGpuInstanceById(nvmlDevice nvmlDevice, Id uint32, nvmlGpuInsta } // nvmlGpuInstanceGetInfo function as declared in nvml/nvml.h -func nvmlGpuInstanceGetInfo(nvmlGpuInstance nvmlGpuInstance, Info *GpuInstanceInfo) Return { +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(cnvmlGpuInstance, cInfo) @@ -2509,7 +2509,7 @@ func nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance nvmlGpuInstance, Id u } // nvmlComputeInstanceGetInfo_v2 function as declared in nvml/nvml.h -func nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance nvmlComputeInstance, Info *ComputeInstanceInfo) Return { +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(cnvmlComputeInstance, cInfo) @@ -2688,7 +2688,7 @@ func nvmlDeviceGetGpuFabricInfo(nvmlDevice nvmlDevice, GpuFabricInfo *GpuFabricI } // 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) @@ -2863,7 +2863,7 @@ func nvmlDeviceRemoveGpu_v1(PciInfo *PciInfo) Return { } // nvmlEventSetWait_v1 function as declared in nvml/nvml.h -func nvmlEventSetWait_v1(Set nvmlEventSet, 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 @@ -2882,7 +2882,7 @@ func nvmlDeviceGetAttributes_v1(nvmlDevice nvmlDevice, Attributes *DeviceAttribu } // nvmlComputeInstanceGetInfo_v1 function as declared in nvml/nvml.h -func nvmlComputeInstanceGetInfo_v1(nvmlComputeInstance nvmlComputeInstance, Info *ComputeInstanceInfo) Return { +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(cnvmlComputeInstance, cInfo) diff --git a/pkg/nvml/types_gen.go b/pkg/nvml/types_gen.go index 167fb79..6a57bab 100644 --- a/pkg/nvml/types_gen.go +++ b/pkg/nvml/types_gen.go @@ -358,7 +358,7 @@ type nvmlEventSet struct { Handle *_Ctype_struct_nvmlEventSet_st } -type EventData struct { +type nvmlEventData struct { Device nvmlDevice EventType uint64 EventData uint64 @@ -494,7 +494,7 @@ type GpuInstanceProfileInfo_v2 struct { Name [96]int8 } -type GpuInstanceInfo struct { +type nvmlGpuInstanceInfo struct { Device nvmlDevice Id uint32 ProfileId uint32 @@ -536,7 +536,7 @@ type ComputeInstanceProfileInfo_v2 struct { Name [96]int8 } -type ComputeInstanceInfo struct { +type nvmlComputeInstanceInfo struct { Device nvmlDevice GpuInstance nvmlGpuInstance Id uint32 @@ -565,7 +565,7 @@ type GpmMetric struct { MetricInfo GpmMetricMetricInfo } -type GpmMetricsGetType struct { +type nvmlGpmMetricsGetType struct { Version uint32 NumMetrics uint32 Sample1 nvmlGpmSample From 6f207423b498d0b26a11e544dc2e341fe9a3aa62 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Thu, 11 Apr 2024 17:29:42 +0000 Subject: [PATCH 18/21] Add ability to generate interfaces and package methods from library Signed-off-by: Kevin Klues --- Makefile | 7 +- gen/nvml/generateapi.go | 418 ++++++++++++++++ pkg/nvml/api.go | 882 ---------------------------------- pkg/nvml/zz_generated.api.go | 901 +++++++++++++++++++++++++++++++++++ 4 files changed, 1325 insertions(+), 883 deletions(-) create mode 100644 gen/nvml/generateapi.go create mode 100644 pkg/nvml/zz_generated.api.go diff --git a/Makefile b/Makefile index dabb108..95921d7 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ check: $(CHECK_TARGETS) # Apply go fmt to the codebase fmt: - go list -f '{{.Dir}}' $(MODULE)/pkg/... \ + go list -f '{{.Dir}}' $(MODULE)/pkg/... $(MODULE)/gen/... \ | xargs gofmt -s -l -w golangci-lint: @@ -144,6 +144,10 @@ bindings: .create-bindings .strip-autogen-comment .strip-nvml-h-linenumber go fmt types_gen.go; \ cd -> /dev/null rm -rf $(PKG_BINDINGS_DIR)/nvml.yml $(PKG_BINDINGS_DIR)/cgo_helpers.go $(PKG_BINDINGS_DIR)/types.go $(PKG_BINDINGS_DIR)/_obj + go run $(GEN_BINDINGS_DIR)/generateapi.go \ + --sourceDir $(PKG_BINDINGS_DIR) \ + --output $(PKG_BINDINGS_DIR)/zz_generated.api.go + make fmt .strip-autogen-comment: SED_SEARCH_STRING := // WARNING: This file has automatically been generated on .strip-autogen-comment: SED_REPLACE_STRING := // WARNING: THIS FILE WAS AUTOMATICALLY GENERATED. @@ -166,6 +170,7 @@ clean-bindings: rm -f $(PKG_BINDINGS_DIR)/nvml.go rm -f $(PKG_BINDINGS_DIR)/nvml.h rm -f $(PKG_BINDINGS_DIR)/types_gen.go + rm -f $(PKG_BINDINGS_DIR)/zz_generated.api.go # Update nvml.h from the Anaconda package repository update-nvml-h: JQ ?= $(DOCKER) run -i --rm -v "$(PWD):$(PWD)" -w "$(PWD)" backplane/jq:latest diff --git a/gen/nvml/generateapi.go b/gen/nvml/generateapi.go new file mode 100644 index 0000000..37f6699 --- /dev/null +++ b/gen/nvml/generateapi.go @@ -0,0 +1,418 @@ +/** +# 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. +**/ + +package main + +import ( + "flag" + "fmt" + "go/ast" + "go/parser" + "go/token" + "io" + "io/fs" + "os" + "path/filepath" + "slices" + "sort" + "strings" + "unicode" +) + +type GeneratableInterfacePoperties struct { + Type string + Interface string + Exclude []string + PackageMethodsAliasedFrom string +} + +var GeneratableInterfaces = []GeneratableInterfacePoperties{ + { + Type: "library", + Interface: "Interface", + Exclude: []string{"Lookup"}, + PackageMethodsAliasedFrom: "libnvml", + }, + { + Type: "nvmlDevice", + Interface: "Device", + }, + { + Type: "nvmlGpuInstance", + Interface: "GpuInstance", + }, + { + Type: "nvmlComputeInstance", + Interface: "ComputeInstance", + }, + { + Type: "nvmlEventSet", + Interface: "EventSet", + }, + { + Type: "nvmlGpmSample", + Interface: "GpmSample", + }, + { + Type: "nvmlUnit", + Interface: "Unit", + }, + { + Type: "nvmlVgpuInstance", + Interface: "VgpuInstance", + }, + { + Type: "nvmlVgpuTypeId", + Interface: "VgpuTypeId", + }, +} + +func main() { + sourceDir := flag.String("sourceDir", "", "Path to the source directory for all go files") + output := flag.String("output", "", "Path to the output file (default: stdout)") + flag.Parse() + + // Check if required flags are provided + if *sourceDir == "" { + flag.Usage() + return + } + + writer, closer, err := getWriter(*output) + if err != nil { + fmt.Printf("Error: %v", err) + return + } + defer closer() + + header, err := generateHeader() + if err != nil { + fmt.Printf("Error: %v", err) + return + } + fmt.Fprintf(writer, header) + + for i, p := range GeneratableInterfaces { + if p.PackageMethodsAliasedFrom != "" { + comment, err := generatePackageMethodsComment(p) + if err != nil { + fmt.Printf("Error: %v", err) + return + } + fmt.Fprintf(writer, comment) + + output, err := generatePackageMethods(*sourceDir, p) + if err != nil { + fmt.Printf("Error: %v", err) + return + } + fmt.Fprintf(writer, "%s\n", output) + } + + comment, err := generateInterfaceComment(p) + if err != nil { + fmt.Printf("Error: %v", err) + return + } + fmt.Fprintf(writer, comment) + + output, err := generateInterface(*sourceDir, p) + if err != nil { + fmt.Printf("Error: %v", err) + return + } + fmt.Fprintf(writer, output) + + if i < (len(GeneratableInterfaces) - 1) { + fmt.Fprintf(writer, "\n") + } + } +} + +func getWriter(outputFile string) (io.Writer, func() error, error) { + if outputFile == "" { + return os.Stdout, func() error { return nil }, nil + } + + file, err := os.Create(outputFile) + if err != nil { + return nil, nil, err + } + + return file, file.Close, nil +} + +func generateHeader() (string, error) { + lines := []string{ + "/**", + "# 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", + "", + "", + } + return strings.Join(lines, "\n"), nil +} + +func generatePackageMethodsComment(input GeneratableInterfacePoperties) (string, error) { + commentFmt := []string{ + "// The variables below represent package level methods from the %s type.", + } + + var signature strings.Builder + comment := strings.Join(commentFmt, "\n") + comment = fmt.Sprintf(comment, input.Type) + signature.WriteString(fmt.Sprintf("%s\n", comment)) + return signature.String(), nil +} + +func generateInterfaceComment(input GeneratableInterfacePoperties) (string, error) { + commentFmt := []string{ + "// %s represents the interface for the %s type.", + } + + var signature strings.Builder + comment := strings.Join(commentFmt, "\n") + comment = fmt.Sprintf(comment, input.Interface, input.Type) + signature.WriteString(fmt.Sprintf("%s\n", comment)) + return signature.String(), nil +} + +func generatePackageMethods(sourceDir string, input GeneratableInterfacePoperties) (string, error) { + var signature strings.Builder + + signature.WriteString("var (\n") + + methods, err := extractMethodsFromPackage(sourceDir, input) + if err != nil { + return "", err + } + + for _, method := range methods { + name := method.Name.Name + formatted := fmt.Sprintf("\t%s = %s.%s\n", name, input.PackageMethodsAliasedFrom, name) + signature.WriteString(formatted) + } + + signature.WriteString(")\n") + + return signature.String(), nil +} + +func generateInterface(sourceDir string, input GeneratableInterfacePoperties) (string, error) { + var signature strings.Builder + + signature.WriteString(fmt.Sprintf("type %s interface {\n", input.Interface)) + + methods, err := extractMethodsFromPackage(sourceDir, input) + if err != nil { + return "", err + } + + for _, method := range methods { + formatted := fmt.Sprintf("\t%s\n", formatMethodSignature(method)) + signature.WriteString(formatted) + } + + signature.WriteString("}\n") + + return signature.String(), nil +} + +func getGoFiles(sourceDir string) (map[string][]byte, error) { + gofiles := make(map[string][]byte) + + err := filepath.WalkDir(sourceDir, func(path string, d fs.DirEntry, err error) error { + if err != nil { + return err + } + if d.IsDir() || filepath.Ext(path) != ".go" { + return nil + } + + content, err := os.ReadFile(path) + if err != nil { + return err + } + + gofiles[path] = content + + return nil + }) + if err != nil { + return nil, fmt.Errorf("walking %s: %w\n", sourceDir, err) + } + + return gofiles, nil +} + +func extractMethodsFromPackage(sourceDir string, input GeneratableInterfacePoperties) ([]*ast.FuncDecl, error) { + gofiles, err := getGoFiles(sourceDir) + if err != nil { + return nil, err + } + + var methods []*ast.FuncDecl + for file, content := range gofiles { + m, err := extractMethods(file, content, input) + if err != nil { + return nil, err + } + methods = append(methods, m...) + } + + sort.Slice(methods, func(i, j int) bool { + return methods[i].Name.Name < methods[j].Name.Name + }) + + return methods, nil +} + +func extractMethods(sourceFile string, sourceContent []byte, input GeneratableInterfacePoperties) ([]*ast.FuncDecl, error) { + // Parse source file + fset := token.NewFileSet() + node, err := parser.ParseFile(fset, sourceFile, sourceContent, parser.ParseComments) + if err != nil { + return nil, err + } + + // Traverse AST to find type declarations and associated methods + var methods []*ast.FuncDecl + for _, decl := range node.Decls { + funcDecl, ok := decl.(*ast.FuncDecl) + if !ok { + continue + } + + // Check if the function is a method associated with the specified type + if receiverType := funcDecl.Recv; receiverType != nil { + var ident *ast.Ident + + for _, field := range receiverType.List { + switch fieldType := field.Type.(type) { + case *ast.Ident: + ident = fieldType + case *ast.StarExpr: + // Update ident if it's a *ast.StarExpr + if newIdent, ok := fieldType.X.(*ast.Ident); ok { + // If the inner type is an *ast.Ident, update ident + ident = newIdent + } + } + + // No identifier found + if ident == nil { + continue + } + + // Identifier is not the one we are looking for + if ident.Name != input.Type { + continue + } + + // Ignore non-public methods + if !isPublic(funcDecl.Name.Name) { + continue + } + + // Ignore method in the exclude list + if slices.Contains(input.Exclude, funcDecl.Name.Name) { + continue + } + + methods = append(methods, funcDecl) + } + } + } + + return methods, nil +} + +func formatMethodSignature(decl *ast.FuncDecl) string { + var signature strings.Builder + + // Write method name + signature.WriteString(decl.Name.Name) + signature.WriteString("(") + + // Write parameters + if decl.Type.Params != nil { + for i, param := range decl.Type.Params.List { + if i > 0 { + signature.WriteString(", ") + } + signature.WriteString(formatFieldList(param)) + } + } + + signature.WriteString(")") + + // Write return types + if decl.Type.Results != nil { + signature.WriteString(" ") + if len(decl.Type.Results.List) > 1 { + signature.WriteString("(") + } + for i, result := range decl.Type.Results.List { + if i > 0 { + signature.WriteString(", ") + } + signature.WriteString(formatFieldList(result)) + } + if len(decl.Type.Results.List) > 1 { + signature.WriteString(")") + } + } + + return signature.String() +} + +func formatFieldList(field *ast.Field) string { + var builder strings.Builder + switch fieldType := field.Type.(type) { + case *ast.Ident: + builder.WriteString(fieldType.Name) + case *ast.ArrayType: + builder.WriteString("[]") + builder.WriteString(formatFieldList(&ast.Field{Type: fieldType.Elt})) + case *ast.StarExpr: + builder.WriteString("*") + builder.WriteString(formatFieldList(&ast.Field{Type: fieldType.X})) + } + return builder.String() +} + +func isPublic(name string) bool { + if len(name) == 0 { + return false + } + return unicode.IsUpper([]rune(name)[0]) +} diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 6c327e7..9ede936 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -48,885 +48,3 @@ func SetLibraryOptions(opts ...LibraryOption) error { libnvml.init(opts...) return nil } - -// Interface represents the interface for the top-level NVML library. -type Interface interface { - // Library API - GetLibrary() Library - // Init API - Init() Return - InitWithFlags(flags uint32) Return - Shutdown() Return - ErrorString(r Return) string - // System API - SystemGetDriverVersion() (string, Return) - SystemGetNVMLVersion() (string, Return) - SystemGetCudaDriverVersion() (int, Return) - SystemGetCudaDriverVersion_v2() (int, Return) - SystemGetProcessName(pid int) (string, Return) - SystemGetHicVersion() ([]HwbcEntry, Return) - SystemGetTopologyGpuSet(cpuNumber int) ([]Device, Return) - // Device API - DeviceGetCount() (int, Return) - DeviceGetHandleByIndex(index int) (Device, Return) - DeviceGetHandleBySerial(serial string) (Device, Return) - DeviceGetHandleByUUID(uuid string) (Device, Return) - DeviceGetHandleByPciBusId(pciBusId string) (Device, Return) - DeviceGetName(device Device) (string, Return) - DeviceGetBrand(device Device) (BrandType, Return) - DeviceGetIndex(device Device) (int, Return) - DeviceGetSerial(device Device) (string, Return) - DeviceGetCpuAffinity(device Device, numCPUs int) ([]uint, Return) - DeviceSetCpuAffinity(device Device) Return - DeviceClearCpuAffinity(device Device) Return - DeviceGetMemoryAffinity(device Device, numNodes int, scope AffinityScope) ([]uint, Return) - DeviceGetCpuAffinityWithinScope(device Device, numCPUs int, scope AffinityScope) ([]uint, Return) - DeviceGetTopologyCommonAncestor(device1 Device, device2 Device) (GpuTopologyLevel, Return) - DeviceGetTopologyNearestGpus(device Device, level GpuTopologyLevel) ([]Device, Return) - DeviceGetP2PStatus(device1 Device, device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) - DeviceGetUUID(device Device) (string, Return) - DeviceGetMinorNumber(device Device) (int, Return) - DeviceGetBoardPartNumber(device Device) (string, Return) - DeviceGetInforomVersion(device Device, object InforomObject) (string, Return) - DeviceGetInforomImageVersion(device Device) (string, Return) - DeviceGetInforomConfigurationChecksum(device Device) (uint32, Return) - DeviceValidateInforom(device Device) Return - DeviceGetDisplayMode(device Device) (EnableState, Return) - DeviceGetDisplayActive(device Device) (EnableState, Return) - DeviceGetPersistenceMode(device Device) (EnableState, Return) - DeviceGetPciInfo(device Device) (PciInfo, Return) - DeviceGetMaxPcieLinkGeneration(device Device) (int, Return) - DeviceGetMaxPcieLinkWidth(device Device) (int, Return) - DeviceGetCurrPcieLinkGeneration(device Device) (int, Return) - DeviceGetCurrPcieLinkWidth(device Device) (int, Return) - DeviceGetPcieThroughput(device Device, counter PcieUtilCounter) (uint32, Return) - DeviceGetPcieReplayCounter(device Device) (int, Return) - DeviceGetClockInfo(device Device, clockType ClockType) (uint32, Return) - DeviceGetMaxClockInfo(device Device, clockType ClockType) (uint32, Return) - DeviceGetApplicationsClock(device Device, clockType ClockType) (uint32, Return) - DeviceGetDefaultApplicationsClock(device Device, clockType ClockType) (uint32, Return) - DeviceResetApplicationsClocks(device Device) Return - DeviceGetClock(device Device, clockType ClockType, clockId ClockId) (uint32, Return) - DeviceGetMaxCustomerBoostClock(device Device, clockType ClockType) (uint32, Return) - DeviceGetSupportedMemoryClocks(device Device) (int, uint32, Return) - DeviceGetSupportedGraphicsClocks(device Device, memoryClockMHz int) (int, uint32, Return) - DeviceGetAutoBoostedClocksEnabled(device Device) (EnableState, EnableState, Return) - DeviceSetAutoBoostedClocksEnabled(device Device, enabled EnableState) Return - DeviceSetDefaultAutoBoostedClocksEnabled(device Device, enabled EnableState, flags uint32) Return - DeviceGetFanSpeed(device Device) (uint32, Return) - DeviceGetFanSpeed_v2(device Device, fan int) (uint32, Return) - DeviceGetNumFans(device Device) (int, Return) - DeviceGetTemperature(device Device, sensorType TemperatureSensors) (uint32, Return) - DeviceGetTemperatureThreshold(device Device, thresholdType TemperatureThresholds) (uint32, Return) - DeviceSetTemperatureThreshold(device Device, thresholdType TemperatureThresholds, temp int) Return - DeviceGetPerformanceState(device Device) (Pstates, Return) - DeviceGetCurrentClocksThrottleReasons(device Device) (uint64, Return) - DeviceGetSupportedClocksThrottleReasons(device Device) (uint64, Return) - DeviceGetPowerState(device Device) (Pstates, Return) - DeviceGetPowerManagementMode(device Device) (EnableState, Return) - DeviceGetPowerManagementLimit(device Device) (uint32, Return) - DeviceGetPowerManagementLimitConstraints(device Device) (uint32, uint32, Return) - DeviceGetPowerManagementDefaultLimit(device Device) (uint32, Return) - DeviceGetPowerUsage(device Device) (uint32, Return) - DeviceGetTotalEnergyConsumption(device Device) (uint64, Return) - DeviceGetEnforcedPowerLimit(device Device) (uint32, Return) - DeviceGetGpuOperationMode(device Device) (GpuOperationMode, GpuOperationMode, Return) - DeviceGetMemoryInfo(device Device) (Memory, Return) - DeviceGetMemoryInfo_v2(device Device) (Memory_v2, Return) - DeviceGetComputeMode(device Device) (ComputeMode, Return) - DeviceGetCudaComputeCapability(device Device) (int, int, Return) - DeviceGetEccMode(device Device) (EnableState, EnableState, Return) - DeviceGetBoardId(device Device) (uint32, Return) - DeviceGetMultiGpuBoard(device Device) (int, Return) - DeviceGetTotalEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) - DeviceGetDetailedEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) - DeviceGetMemoryErrorCounter(device Device, errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) - DeviceGetUtilizationRates(device Device) (Utilization, Return) - DeviceGetEncoderUtilization(device Device) (uint32, uint32, Return) - DeviceGetEncoderCapacity(device Device, encoderQueryType EncoderType) (int, Return) - DeviceGetEncoderStats(device Device) (int, uint32, uint32, Return) - DeviceGetEncoderSessions(device Device) ([]EncoderSessionInfo, Return) - DeviceGetDecoderUtilization(device Device) (uint32, uint32, Return) - DeviceGetFBCStats(device Device) (FBCStats, Return) - DeviceGetFBCSessions(device Device) ([]FBCSessionInfo, Return) - DeviceGetDriverModel(device Device) (DriverModel, DriverModel, Return) - DeviceGetVbiosVersion(device Device) (string, Return) - DeviceGetBridgeChipInfo(device Device) (BridgeChipHierarchy, Return) - DeviceGetComputeRunningProcesses(device Device) ([]ProcessInfo, Return) - DeviceGetGraphicsRunningProcesses(device Device) ([]ProcessInfo, Return) - DeviceGetMPSComputeRunningProcesses(device Device) ([]ProcessInfo, Return) - DeviceOnSameBoard(device1 Device, device2 Device) (int, Return) - DeviceGetAPIRestriction(device Device, apiType RestrictedAPI) (EnableState, Return) - DeviceGetSamples(device Device, samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) - DeviceGetBAR1MemoryInfo(device Device) (BAR1Memory, Return) - DeviceGetViolationStatus(device Device, perfPolicyType PerfPolicyType) (ViolationTime, Return) - DeviceGetIrqNum(device Device) (int, Return) - DeviceGetNumGpuCores(device Device) (int, Return) - DeviceGetPowerSource(device Device) (PowerSource, Return) - DeviceGetMemoryBusWidth(device Device) (uint32, Return) - DeviceGetPcieLinkMaxSpeed(device Device) (uint32, Return) - DeviceGetAdaptiveClockInfoStatus(device Device) (uint32, Return) - DeviceGetAccountingMode(device Device) (EnableState, Return) - DeviceGetAccountingStats(device Device, pid uint32) (AccountingStats, Return) - DeviceGetAccountingPids(device Device) ([]int, Return) - DeviceGetAccountingBufferSize(device Device) (int, Return) - DeviceGetRetiredPages(device Device, cause PageRetirementCause) ([]uint64, Return) - DeviceGetRetiredPages_v2(device Device, cause PageRetirementCause) ([]uint64, []uint64, Return) - DeviceGetRetiredPagesPendingStatus(device Device) (EnableState, Return) - DeviceSetPersistenceMode(device Device, mode EnableState) Return - DeviceSetComputeMode(device Device, mode ComputeMode) Return - DeviceSetEccMode(device Device, ecc EnableState) Return - DeviceClearEccErrorCounts(device Device, counterType EccCounterType) Return - DeviceSetDriverModel(device Device, driverModel DriverModel, flags uint32) Return - DeviceSetGpuLockedClocks(device Device, minGpuClockMHz uint32, maxGpuClockMHz uint32) Return - DeviceResetGpuLockedClocks(device Device) Return - DeviceSetMemoryLockedClocks(device Device, minMemClockMHz uint32, maxMemClockMHz uint32) Return - DeviceResetMemoryLockedClocks(device Device) Return - DeviceGetClkMonStatus(device Device) (ClkMonStatus, Return) - DeviceSetApplicationsClocks(device Device, memClockMHz uint32, graphicsClockMHz uint32) Return - DeviceSetPowerManagementLimit(device Device, limit uint32) Return - DeviceSetGpuOperationMode(device Device, mode GpuOperationMode) Return - DeviceSetAPIRestriction(device Device, apiType RestrictedAPI, isRestricted EnableState) Return - DeviceSetAccountingMode(device Device, mode EnableState) Return - DeviceClearAccountingPids(device Device) Return - DeviceGetNvLinkState(device Device, link int) (EnableState, Return) - DeviceGetNvLinkVersion(device Device, link int) (uint32, Return) - DeviceGetNvLinkCapability(device Device, link int, capability NvLinkCapability) (uint32, Return) - DeviceGetNvLinkRemotePciInfo(device Device, link int) (PciInfo, Return) - DeviceGetNvLinkErrorCounter(device Device, link int, counter NvLinkErrorCounter) (uint64, Return) - DeviceResetNvLinkErrorCounters(device Device, link int) Return - DeviceSetNvLinkUtilizationControl(device Device, link int, counter int, control *NvLinkUtilizationControl, reset bool) Return - DeviceGetNvLinkUtilizationControl(device Device, link int, counter int) (NvLinkUtilizationControl, Return) - DeviceGetNvLinkUtilizationCounter(device Device, link int, counter int) (uint64, uint64, Return) - DeviceFreezeNvLinkUtilizationCounter(device Device, link int, counter int, freeze EnableState) Return - DeviceResetNvLinkUtilizationCounter(device Device, link int, counter int) Return - DeviceGetNvLinkRemoteDeviceType(device Device, link int) (IntNvLinkDeviceType, Return) - DeviceRegisterEvents(device Device, eventTypes uint64, set EventSet) Return - DeviceGetSupportedEventTypes(device Device) (uint64, Return) - DeviceModifyDrainState(pciInfo *PciInfo, newState EnableState) Return - DeviceQueryDrainState(pciInfo *PciInfo) (EnableState, Return) - DeviceRemoveGpu(pciInfo *PciInfo) Return - DeviceRemoveGpu_v2(pciInfo *PciInfo, gpuState DetachGpuState, linkState PcieLinkState) Return - DeviceDiscoverGpus() (PciInfo, Return) - DeviceGetFieldValues(device Device, values []FieldValue) Return - DeviceGetVirtualizationMode(device Device) (GpuVirtualizationMode, Return) - DeviceGetHostVgpuMode(device Device) (HostVgpuMode, Return) - DeviceSetVirtualizationMode(device Device, virtualMode GpuVirtualizationMode) Return - DeviceGetGridLicensableFeatures(device Device) (GridLicensableFeatures, Return) - DeviceGetProcessUtilization(device Device, lastSeenTimestamp uint64) ([]ProcessUtilizationSample, Return) - DeviceGetSupportedVgpus(device Device) ([]VgpuTypeId, Return) - DeviceGetCreatableVgpus(device Device) ([]VgpuTypeId, Return) - DeviceGetActiveVgpus(device Device) ([]VgpuInstance, Return) - DeviceGetVgpuMetadata(device Device) (VgpuPgpuMetadata, Return) - DeviceGetPgpuMetadataString(device Device) (string, Return) - DeviceGetVgpuUtilization(device Device, lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) - DeviceGetAttributes(device Device) (DeviceAttributes, Return) - DeviceGetRemappedRows(device Device) (int, int, bool, bool, Return) - DeviceGetRowRemapperHistogram(device Device) (RowRemapperHistogramValues, Return) - DeviceGetArchitecture(device Device) (DeviceArchitecture, Return) - DeviceGetVgpuProcessUtilization(device Device, lastSeenTimestamp uint64) ([]VgpuProcessUtilizationSample, Return) - GetExcludedDeviceCount() (int, Return) - GetExcludedDeviceInfoByIndex(index int) (ExcludedDeviceInfo, Return) - DeviceSetMigMode(device Device, mode int) (Return, Return) - DeviceGetMigMode(device Device) (int, int, Return) - DeviceGetGpuInstanceProfileInfo(device Device, profile int) (GpuInstanceProfileInfo, Return) - DeviceGetGpuInstanceProfileInfoV(device Device, profile int) GpuInstanceProfileInfoV - DeviceGetGpuInstancePossiblePlacements(device Device, info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) - DeviceGetGpuInstanceRemainingCapacity(device Device, info *GpuInstanceProfileInfo) (int, Return) - DeviceCreateGpuInstance(device Device, info *GpuInstanceProfileInfo) (GpuInstance, Return) - DeviceCreateGpuInstanceWithPlacement(device Device, info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) - GpuInstanceDestroy(gpuInstance GpuInstance) Return - DeviceGetGpuInstances(device Device, info *GpuInstanceProfileInfo) ([]GpuInstance, Return) - DeviceGetGpuInstanceById(device Device, id int) (GpuInstance, Return) - GpuInstanceGetInfo(gpuInstance GpuInstance) (GpuInstanceInfo, Return) - GpuInstanceGetComputeInstanceProfileInfo(gpuInstance GpuInstance, profile int, engProfile int) (ComputeInstanceProfileInfo, Return) - GpuInstanceGetComputeInstanceProfileInfoV(gpuInstance GpuInstance, profile int, engProfile int) ComputeInstanceProfileInfoV - GpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (int, Return) - GpuInstanceCreateComputeInstance(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (ComputeInstance, Return) - ComputeInstanceDestroy(computeInstance ComputeInstance) Return - GpuInstanceGetComputeInstances(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) - GpuInstanceGetComputeInstanceById(gpuInstance GpuInstance, id int) (ComputeInstance, Return) - ComputeInstanceGetInfo(computeInstance ComputeInstance) (ComputeInstanceInfo, Return) - DeviceIsMigDeviceHandle(device Device) (bool, Return) - DeviceGetGpuInstanceId(device Device) (int, Return) - DeviceGetComputeInstanceId(device Device) (int, Return) - DeviceGetMaxMigDeviceCount(device Device) (int, Return) - DeviceGetMigDeviceHandleByIndex(device Device, index int) (Device, Return) - DeviceGetDeviceHandleFromMigDeviceHandle(migdevice Device) (Device, Return) - DeviceGetBusType(device Device) (BusType, Return) - DeviceSetDefaultFanSpeed_v2(device Device, fan int) Return - DeviceGetMinMaxFanSpeed(device Device) (int, int, Return) - DeviceGetThermalSettings(device Device, sensorIndex uint32) (GpuThermalSettings, Return) - DeviceGetDefaultEccMode(device Device) (EnableState, Return) - DeviceGetPcieSpeed(device Device) (int, Return) - DeviceGetGspFirmwareVersion(device Device) (string, Return) - DeviceGetGspFirmwareMode(device Device) (bool, bool, Return) - DeviceGetDynamicPstatesInfo(device Device) (GpuDynamicPstatesInfo, Return) - DeviceSetFanSpeed_v2(device Device, fan int, speed int) Return - DeviceGetGpcClkVfOffset(device Device) (int, Return) - DeviceSetGpcClkVfOffset(device Device, offset int) Return - DeviceGetMinMaxClockOfPState(device Device, clockType ClockType, pstate Pstates) (uint32, uint32, Return) - DeviceGetSupportedPerformanceStates(device Device) ([]Pstates, Return) - DeviceGetTargetFanSpeed(device Device, fan int) (int, Return) - DeviceGetMemClkVfOffset(device Device) (int, Return) - DeviceSetMemClkVfOffset(device Device, offset int) Return - DeviceGetGpcClkMinMaxVfOffset(device Device) (int, int, Return) - DeviceGetMemClkMinMaxVfOffset(device Device) (int, int, Return) - DeviceGetGpuMaxPcieLinkGeneration(device Device) (int, Return) - DeviceGetFanControlPolicy_v2(device Device, fan int) (FanControlPolicy, Return) - DeviceSetFanControlPolicy(device Device, fan int, policy FanControlPolicy) Return - DeviceClearFieldValues(device Device, values []FieldValue) Return - DeviceGetVgpuCapabilities(device Device, capability DeviceVgpuCapability) (bool, Return) - DeviceGetVgpuSchedulerLog(device Device) (VgpuSchedulerLog, Return) - DeviceGetVgpuSchedulerState(device Device) (VgpuSchedulerGetState, Return) - DeviceSetVgpuSchedulerState(device Device, pSchedulerState *VgpuSchedulerSetState) Return - DeviceGetVgpuSchedulerCapabilities(device Device) (VgpuSchedulerCapabilities, Return) - GpuInstanceGetComputeInstancePossiblePlacements(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) - GpuInstanceCreateComputeInstanceWithPlacement(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) - DeviceGetGpuFabricInfo(device Device) (GpuFabricInfo, Return) - DeviceCcuGetStreamState(device Device) (int, Return) - DeviceCcuSetStreamState(device Device, state int) Return - DeviceSetNvLinkDeviceLowPowerThreshold(device Device, info *NvLinkPowerThres) Return - // Event API - EventSetCreate() (EventSet, Return) - EventSetWait(set EventSet, timeoutms uint32) (EventData, Return) - EventSetFree(set EventSet) Return - // GPM API - GpmMetricsGetV(metricsGet *GpmMetricsGetType) GpmMetricsGetVType - GpmMetricsGet(metricsGet *GpmMetricsGetType) Return - GpmSampleFree(gpmSample GpmSample) Return - GpmSampleAlloc() (GpmSample, Return) - GpmSampleGet(device Device, gpmSample GpmSample) Return - GpmQueryDeviceSupportV(device Device) GpmSupportV - GpmQueryDeviceSupport(device Device) (GpmSupport, Return) - GpmMigSampleGet(device Device, gpuInstanceId int, gpmSample GpmSample) Return - // Unit API - UnitGetCount() (int, Return) - UnitGetHandleByIndex(index int) (Unit, Return) - UnitGetUnitInfo(unit Unit) (UnitInfo, Return) - UnitGetLedState(unit Unit) (LedState, Return) - UnitGetPsuInfo(unit Unit) (PSUInfo, Return) - UnitGetTemperature(unit Unit, ttype int) (uint32, Return) - UnitGetFanSpeedInfo(unit Unit) (UnitFanSpeeds, Return) - UnitGetDevices(unit Unit) ([]Device, Return) - UnitSetLedState(unit Unit, color LedColor) Return - // vGPU API - VgpuTypeGetClass(vgpuTypeId VgpuTypeId) (string, Return) - VgpuTypeGetName(vgpuTypeId VgpuTypeId) (string, Return) - VgpuTypeGetGpuInstanceProfileId(vgpuTypeId VgpuTypeId) (uint32, Return) - VgpuTypeGetDeviceID(vgpuTypeId VgpuTypeId) (uint64, uint64, Return) - VgpuTypeGetFramebufferSize(vgpuTypeId VgpuTypeId) (uint64, Return) - VgpuTypeGetNumDisplayHeads(vgpuTypeId VgpuTypeId) (int, Return) - VgpuTypeGetResolution(vgpuTypeId VgpuTypeId, displayIndex int) (uint32, uint32, Return) - VgpuTypeGetLicense(vgpuTypeId VgpuTypeId) (string, Return) - VgpuTypeGetFrameRateLimit(vgpuTypeId VgpuTypeId) (uint32, Return) - VgpuTypeGetMaxInstances(device Device, vgpuTypeId VgpuTypeId) (int, Return) - VgpuTypeGetMaxInstancesPerVm(vgpuTypeId VgpuTypeId) (int, Return) - VgpuInstanceGetVmID(vgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) - VgpuInstanceGetUUID(vgpuInstance VgpuInstance) (string, Return) - VgpuInstanceGetVmDriverVersion(vgpuInstance VgpuInstance) (string, Return) - VgpuInstanceGetFbUsage(vgpuInstance VgpuInstance) (uint64, Return) - VgpuInstanceGetLicenseInfo(vgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) - VgpuInstanceGetLicenseStatus(vgpuInstance VgpuInstance) (int, Return) - VgpuInstanceGetType(vgpuInstance VgpuInstance) (VgpuTypeId, Return) - VgpuInstanceGetFrameRateLimit(vgpuInstance VgpuInstance) (uint32, Return) - VgpuInstanceGetEccMode(vgpuInstance VgpuInstance) (EnableState, Return) - VgpuInstanceGetEncoderCapacity(vgpuInstance VgpuInstance) (int, Return) - VgpuInstanceSetEncoderCapacity(vgpuInstance VgpuInstance, encoderCapacity int) Return - VgpuInstanceGetEncoderStats(vgpuInstance VgpuInstance) (int, uint32, uint32, Return) - VgpuInstanceGetEncoderSessions(vgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) - VgpuInstanceGetFBCStats(vgpuInstance VgpuInstance) (FBCStats, Return) - VgpuInstanceGetFBCSessions(vgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) - VgpuInstanceGetGpuInstanceId(vgpuInstance VgpuInstance) (int, Return) - VgpuInstanceGetGpuPciId(vgpuInstance VgpuInstance) (string, Return) - VgpuInstanceGetMetadata(vgpuInstance VgpuInstance) (VgpuMetadata, Return) - VgpuInstanceGetAccountingMode(vgpuInstance VgpuInstance) (EnableState, Return) - VgpuInstanceGetAccountingPids(vgpuInstance VgpuInstance) ([]int, Return) - VgpuInstanceGetAccountingStats(vgpuInstance VgpuInstance, pid int) (AccountingStats, Return) - GetVgpuCompatibility(vgpuMetadata *VgpuMetadata, pgpuMetadata *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) - GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) - SetVgpuVersion(vgpuVersion *VgpuVersion) Return - VgpuInstanceClearAccountingPids(vgpuInstance VgpuInstance) Return - VgpuInstanceGetMdevUUID(vgpuInstance VgpuInstance) (string, Return) - VgpuTypeGetCapabilities(vgpuTypeId VgpuTypeId, capability VgpuCapability) (bool, Return) - GetVgpuDriverCapabilities(capability VgpuDriverCapability) (bool, Return) -} - -type Device interface { - GetName() (string, Return) - GetBrand() (BrandType, Return) - GetIndex() (int, Return) - GetSerial() (string, Return) - GetCpuAffinity(numCPUs int) ([]uint, Return) - SetCpuAffinity() Return - ClearCpuAffinity() Return - GetMemoryAffinity(numNodes int, scope AffinityScope) ([]uint, Return) - GetCpuAffinityWithinScope(numCPUs int, scope AffinityScope) ([]uint, Return) - GetTopologyCommonAncestor(device2 Device) (GpuTopologyLevel, Return) - GetTopologyNearestGpus(level GpuTopologyLevel) ([]Device, Return) - GetP2PStatus(device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) - GetUUID() (string, Return) - GetMinorNumber() (int, Return) - GetBoardPartNumber() (string, Return) - GetInforomVersion(object InforomObject) (string, Return) - GetInforomImageVersion() (string, Return) - GetInforomConfigurationChecksum() (uint32, Return) - ValidateInforom() Return - GetDisplayMode() (EnableState, Return) - GetDisplayActive() (EnableState, Return) - GetPersistenceMode() (EnableState, Return) - GetPciInfo() (PciInfo, Return) - GetMaxPcieLinkGeneration() (int, Return) - GetMaxPcieLinkWidth() (int, Return) - GetCurrPcieLinkGeneration() (int, Return) - GetCurrPcieLinkWidth() (int, Return) - GetPcieThroughput(counter PcieUtilCounter) (uint32, Return) - GetPcieReplayCounter() (int, Return) - GetClockInfo(clockType ClockType) (uint32, Return) - GetMaxClockInfo(clockType ClockType) (uint32, Return) - GetApplicationsClock(clockType ClockType) (uint32, Return) - GetDefaultApplicationsClock(clockType ClockType) (uint32, Return) - ResetApplicationsClocks() Return - GetClock(clockType ClockType, clockId ClockId) (uint32, Return) - GetMaxCustomerBoostClock(clockType ClockType) (uint32, Return) - GetSupportedMemoryClocks() (int, uint32, Return) - GetSupportedGraphicsClocks(memoryClockMHz int) (int, uint32, Return) - GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) - SetAutoBoostedClocksEnabled(enabled EnableState) Return - SetDefaultAutoBoostedClocksEnabled(enabled EnableState, flags uint32) Return - GetFanSpeed() (uint32, Return) - GetFanSpeed_v2(fan int) (uint32, Return) - GetNumFans() (int, Return) - GetTemperature(sensorType TemperatureSensors) (uint32, Return) - GetTemperatureThreshold(thresholdType TemperatureThresholds) (uint32, Return) - SetTemperatureThreshold(thresholdType TemperatureThresholds, temp int) Return - GetPerformanceState() (Pstates, Return) - GetCurrentClocksThrottleReasons() (uint64, Return) - GetSupportedClocksThrottleReasons() (uint64, Return) - GetPowerState() (Pstates, Return) - GetPowerManagementMode() (EnableState, Return) - GetPowerManagementLimit() (uint32, Return) - GetPowerManagementLimitConstraints() (uint32, uint32, Return) - GetPowerManagementDefaultLimit() (uint32, Return) - GetPowerUsage() (uint32, Return) - GetTotalEnergyConsumption() (uint64, Return) - GetEnforcedPowerLimit() (uint32, Return) - GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) - GetMemoryInfo() (Memory, Return) - GetMemoryInfo_v2() (Memory_v2, Return) - GetComputeMode() (ComputeMode, Return) - GetCudaComputeCapability() (int, int, Return) - GetEccMode() (EnableState, EnableState, Return) - GetBoardId() (uint32, Return) - GetMultiGpuBoard() (int, Return) - GetTotalEccErrors(errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) - GetDetailedEccErrors(errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) - GetMemoryErrorCounter(errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) - GetUtilizationRates() (Utilization, Return) - GetEncoderUtilization() (uint32, uint32, Return) - GetEncoderCapacity(encoderQueryType EncoderType) (int, Return) - GetEncoderStats() (int, uint32, uint32, Return) - GetEncoderSessions() ([]EncoderSessionInfo, Return) - GetDecoderUtilization() (uint32, uint32, Return) - GetFBCStats() (FBCStats, Return) - GetFBCSessions() ([]FBCSessionInfo, Return) - GetDriverModel() (DriverModel, DriverModel, Return) - GetVbiosVersion() (string, Return) - GetBridgeChipInfo() (BridgeChipHierarchy, Return) - GetComputeRunningProcesses() ([]ProcessInfo, Return) - GetGraphicsRunningProcesses() ([]ProcessInfo, Return) - GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) - OnSameBoard(device2 Device) (int, Return) - GetAPIRestriction(apiType RestrictedAPI) (EnableState, Return) - GetSamples(samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) - GetBAR1MemoryInfo() (BAR1Memory, Return) - GetViolationStatus(perfPolicyType PerfPolicyType) (ViolationTime, Return) - GetIrqNum() (int, Return) - GetNumGpuCores() (int, Return) - GetPowerSource() (PowerSource, Return) - GetMemoryBusWidth() (uint32, Return) - GetPcieLinkMaxSpeed() (uint32, Return) - GetAdaptiveClockInfoStatus() (uint32, Return) - GetAccountingMode() (EnableState, Return) - GetAccountingStats(pid uint32) (AccountingStats, Return) - GetAccountingPids() ([]int, Return) - GetAccountingBufferSize() (int, Return) - GetRetiredPages(cause PageRetirementCause) ([]uint64, Return) - GetRetiredPages_v2(cause PageRetirementCause) ([]uint64, []uint64, Return) - GetRetiredPagesPendingStatus() (EnableState, Return) - SetPersistenceMode(mode EnableState) Return - SetComputeMode(mode ComputeMode) Return - SetEccMode(ecc EnableState) Return - ClearEccErrorCounts(counterType EccCounterType) Return - SetDriverModel(driverModel DriverModel, flags uint32) Return - SetGpuLockedClocks(minGpuClockMHz uint32, maxGpuClockMHz uint32) Return - ResetGpuLockedClocks() Return - SetMemoryLockedClocks(minMemClockMHz uint32, maxMemClockMHz uint32) Return - ResetMemoryLockedClocks() Return - GetClkMonStatus() (ClkMonStatus, Return) - SetApplicationsClocks(memClockMHz uint32, graphicsClockMHz uint32) Return - SetPowerManagementLimit(limit uint32) Return - SetGpuOperationMode(mode GpuOperationMode) Return - SetAPIRestriction(apiType RestrictedAPI, isRestricted EnableState) Return - SetAccountingMode(mode EnableState) Return - ClearAccountingPids() Return - GetNvLinkState(link int) (EnableState, Return) - GetNvLinkVersion(link int) (uint32, Return) - GetNvLinkCapability(link int, capability NvLinkCapability) (uint32, Return) - GetNvLinkRemotePciInfo(link int) (PciInfo, Return) - GetNvLinkErrorCounter(link int, counter NvLinkErrorCounter) (uint64, Return) - ResetNvLinkErrorCounters(link int) Return - SetNvLinkUtilizationControl(link int, counter int, control *NvLinkUtilizationControl, reset bool) Return - GetNvLinkUtilizationControl(link int, counter int) (NvLinkUtilizationControl, Return) - GetNvLinkUtilizationCounter(link int, counter int) (uint64, uint64, Return) - FreezeNvLinkUtilizationCounter(link int, counter int, freeze EnableState) Return - ResetNvLinkUtilizationCounter(link int, counter int) Return - GetNvLinkRemoteDeviceType(link int) (IntNvLinkDeviceType, Return) - RegisterEvents(eventTypes uint64, set EventSet) Return - GetSupportedEventTypes() (uint64, Return) - GetFieldValues(values []FieldValue) Return - GetVirtualizationMode() (GpuVirtualizationMode, Return) - GetHostVgpuMode() (HostVgpuMode, Return) - SetVirtualizationMode(virtualMode GpuVirtualizationMode) Return - GetGridLicensableFeatures() (GridLicensableFeatures, Return) - GetProcessUtilization(lastSeenTimestamp uint64) ([]ProcessUtilizationSample, Return) - GetSupportedVgpus() ([]VgpuTypeId, Return) - GetCreatableVgpus() ([]VgpuTypeId, Return) - GetActiveVgpus() ([]VgpuInstance, Return) - GetVgpuMetadata() (VgpuPgpuMetadata, Return) - GetPgpuMetadataString() (string, Return) - GetVgpuUtilization(lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) - GetAttributes() (DeviceAttributes, Return) - GetRemappedRows() (int, int, bool, bool, Return) - GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) - GetArchitecture() (DeviceArchitecture, Return) - GetVgpuProcessUtilization(lastSeenTimestamp uint64) ([]VgpuProcessUtilizationSample, Return) - SetMigMode(mode int) (Return, Return) - GetMigMode() (int, int, Return) - GetGpuInstanceProfileInfo(profile int) (GpuInstanceProfileInfo, Return) - GetGpuInstanceProfileInfoV(profile int) GpuInstanceProfileInfoV - GetGpuInstancePossiblePlacements(info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) - GetGpuInstanceRemainingCapacity(info *GpuInstanceProfileInfo) (int, Return) - CreateGpuInstance(info *GpuInstanceProfileInfo) (GpuInstance, Return) - CreateGpuInstanceWithPlacement(info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) - GetGpuInstances(info *GpuInstanceProfileInfo) ([]GpuInstance, Return) - GetGpuInstanceById(id int) (GpuInstance, Return) - IsMigDeviceHandle() (bool, Return) - GetGpuInstanceId() (int, Return) - GetComputeInstanceId() (int, Return) - GetMaxMigDeviceCount() (int, Return) - GetMigDeviceHandleByIndex(index int) (Device, Return) - GetDeviceHandleFromMigDeviceHandle() (Device, Return) - GetBusType() (BusType, Return) - SetDefaultFanSpeed_v2(fan int) Return - GetMinMaxFanSpeed() (int, int, Return) - GetThermalSettings(sensorIndex uint32) (GpuThermalSettings, Return) - GetDefaultEccMode() (EnableState, Return) - GetPcieSpeed() (int, Return) - GetGspFirmwareVersion() (string, Return) - GetGspFirmwareMode() (bool, bool, Return) - GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) - SetFanSpeed_v2(fan int, speed int) Return - GetGpcClkVfOffset() (int, Return) - SetGpcClkVfOffset(offset int) Return - GetMinMaxClockOfPState(clockType ClockType, pstate Pstates) (uint32, uint32, Return) - GetSupportedPerformanceStates() ([]Pstates, Return) - GetTargetFanSpeed(fan int) (int, Return) - GetMemClkVfOffset() (int, Return) - SetMemClkVfOffset(offset int) Return - GetGpcClkMinMaxVfOffset() (int, int, Return) - GetMemClkMinMaxVfOffset() (int, int, Return) - GetGpuMaxPcieLinkGeneration() (int, Return) - GetFanControlPolicy_v2(fan int) (FanControlPolicy, Return) - SetFanControlPolicy(fan int, policy FanControlPolicy) Return - ClearFieldValues(values []FieldValue) Return - GetVgpuCapabilities(capability DeviceVgpuCapability) (bool, Return) - GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) - GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) - SetVgpuSchedulerState(pSchedulerState *VgpuSchedulerSetState) Return - GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) - GetGpuFabricInfo() (GpuFabricInfo, Return) - CcuGetStreamState() (int, Return) - CcuSetStreamState(state int) Return - SetNvLinkDeviceLowPowerThreshold(info *NvLinkPowerThres) Return - GpmSampleGet(gpmSample GpmSample) Return - GpmQueryDeviceSupportV() GpmSupportV - GpmQueryDeviceSupport() (GpmSupport, Return) - GpmMigSampleGet(gpuInstanceId int, gpmSample GpmSample) Return - VgpuTypeGetMaxInstances(vgpuTypeId VgpuTypeId) (int, Return) -} - -type GpuInstance interface { - Destroy() Return - GetInfo() (GpuInstanceInfo, Return) - GetComputeInstanceProfileInfo(profile int, engProfile int) (ComputeInstanceProfileInfo, Return) - GetComputeInstanceProfileInfoV(profile int, engProfile int) ComputeInstanceProfileInfoV - GetComputeInstanceRemainingCapacity(info *ComputeInstanceProfileInfo) (int, Return) - CreateComputeInstance(info *ComputeInstanceProfileInfo) (ComputeInstance, Return) - GetComputeInstances(info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) - GetComputeInstanceById(id int) (ComputeInstance, Return) - GetComputeInstancePossiblePlacements(info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) - CreateComputeInstanceWithPlacement(info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) -} - -type ComputeInstance interface { - Destroy() Return - GetInfo() (ComputeInstanceInfo, Return) -} - -type EventSet interface { - Wait(timeoutms uint32) (EventData, Return) - Free() Return -} - -type GpmSample interface { - Free() Return - Get(device Device) Return - MigGet(device Device, gpuInstanceId int) Return -} - -type Unit interface { - GetUnitInfo() (UnitInfo, Return) - GetLedState() (LedState, Return) - GetPsuInfo() (PSUInfo, Return) - GetTemperature(ttype int) (uint32, Return) - GetFanSpeedInfo() (UnitFanSpeeds, Return) - GetDevices() ([]Device, Return) - SetLedState(color LedColor) Return -} - -type VgpuInstance interface { - GetVmID() (string, VgpuVmIdType, Return) - GetUUID() (string, Return) - GetVmDriverVersion() (string, Return) - GetFbUsage() (uint64, Return) - GetLicenseInfo() (VgpuLicenseInfo, Return) - GetLicenseStatus() (int, Return) - GetType() (VgpuTypeId, Return) - GetFrameRateLimit() (uint32, Return) - GetEccMode() (EnableState, Return) - GetEncoderCapacity() (int, Return) - SetEncoderCapacity(encoderCapacity int) Return - GetEncoderStats() (int, uint32, uint32, Return) - GetEncoderSessions() (int, EncoderSessionInfo, Return) - GetFBCStats() (FBCStats, Return) - GetFBCSessions() (int, FBCSessionInfo, Return) - GetGpuInstanceId() (int, Return) - GetGpuPciId() (string, Return) - GetMetadata() (VgpuMetadata, Return) - GetAccountingMode() (EnableState, Return) - GetAccountingPids() ([]int, Return) - GetAccountingStats(pid int) (AccountingStats, Return) - ClearAccountingPids() Return - GetMdevUUID() (string, Return) -} - -type VgpuTypeId interface { - GetClass() (string, Return) - GetName() (string, Return) - GetGpuInstanceProfileId() (uint32, Return) - GetDeviceID() (uint64, uint64, Return) - GetFramebufferSize() (uint64, Return) - GetNumDisplayHeads() (int, Return) - GetResolution(displayIndex int) (uint32, uint32, Return) - GetLicense() (string, Return) - GetFrameRateLimit() (uint32, Return) - GetMaxInstances(device Device) (int, Return) - GetMaxInstancesPerVm() (int, Return) - GetCapabilities(capability VgpuCapability) (bool, Return) -} - -// Define package level methods as aliases to Interface methods of libnvml -var ( - GetLibrary = libnvml.GetLibrary - Init = libnvml.Init - InitWithFlags = libnvml.InitWithFlags - Shutdown = libnvml.Shutdown - ErrorString = libnvml.ErrorString - SystemGetDriverVersion = libnvml.SystemGetDriverVersion - SystemGetNVMLVersion = libnvml.SystemGetNVMLVersion - SystemGetCudaDriverVersion = libnvml.SystemGetCudaDriverVersion - SystemGetCudaDriverVersion_v2 = libnvml.SystemGetCudaDriverVersion_v2 - SystemGetProcessName = libnvml.SystemGetProcessName - SystemGetHicVersion = libnvml.SystemGetHicVersion - SystemGetTopologyGpuSet = libnvml.SystemGetTopologyGpuSet - DeviceGetCount = libnvml.DeviceGetCount - DeviceGetHandleByIndex = libnvml.DeviceGetHandleByIndex - DeviceGetHandleBySerial = libnvml.DeviceGetHandleBySerial - DeviceGetHandleByUUID = libnvml.DeviceGetHandleByUUID - DeviceGetHandleByPciBusId = libnvml.DeviceGetHandleByPciBusId - DeviceGetName = libnvml.DeviceGetName - DeviceGetBrand = libnvml.DeviceGetBrand - DeviceGetIndex = libnvml.DeviceGetIndex - DeviceGetSerial = libnvml.DeviceGetSerial - DeviceGetCpuAffinity = libnvml.DeviceGetCpuAffinity - DeviceSetCpuAffinity = libnvml.DeviceSetCpuAffinity - DeviceClearCpuAffinity = libnvml.DeviceClearCpuAffinity - DeviceGetMemoryAffinity = libnvml.DeviceGetMemoryAffinity - DeviceGetCpuAffinityWithinScope = libnvml.DeviceGetCpuAffinityWithinScope - DeviceGetTopologyCommonAncestor = libnvml.DeviceGetTopologyCommonAncestor - DeviceGetTopologyNearestGpus = libnvml.DeviceGetTopologyNearestGpus - DeviceGetP2PStatus = libnvml.DeviceGetP2PStatus - DeviceGetUUID = libnvml.DeviceGetUUID - DeviceGetMinorNumber = libnvml.DeviceGetMinorNumber - DeviceGetBoardPartNumber = libnvml.DeviceGetBoardPartNumber - DeviceGetInforomVersion = libnvml.DeviceGetInforomVersion - DeviceGetInforomImageVersion = libnvml.DeviceGetInforomImageVersion - DeviceGetInforomConfigurationChecksum = libnvml.DeviceGetInforomConfigurationChecksum - DeviceValidateInforom = libnvml.DeviceValidateInforom - DeviceGetDisplayMode = libnvml.DeviceGetDisplayMode - DeviceGetDisplayActive = libnvml.DeviceGetDisplayActive - DeviceGetPersistenceMode = libnvml.DeviceGetPersistenceMode - DeviceGetPciInfo = libnvml.DeviceGetPciInfo - DeviceGetMaxPcieLinkGeneration = libnvml.DeviceGetMaxPcieLinkGeneration - DeviceGetMaxPcieLinkWidth = libnvml.DeviceGetMaxPcieLinkWidth - DeviceGetCurrPcieLinkGeneration = libnvml.DeviceGetCurrPcieLinkGeneration - DeviceGetCurrPcieLinkWidth = libnvml.DeviceGetCurrPcieLinkWidth - DeviceGetPcieThroughput = libnvml.DeviceGetPcieThroughput - DeviceGetPcieReplayCounter = libnvml.DeviceGetPcieReplayCounter - DeviceGetClockInfo = libnvml.DeviceGetClockInfo - DeviceGetMaxClockInfo = libnvml.DeviceGetMaxClockInfo - DeviceGetApplicationsClock = libnvml.DeviceGetApplicationsClock - DeviceGetDefaultApplicationsClock = libnvml.DeviceGetDefaultApplicationsClock - DeviceResetApplicationsClocks = libnvml.DeviceResetApplicationsClocks - DeviceGetClock = libnvml.DeviceGetClock - DeviceGetMaxCustomerBoostClock = libnvml.DeviceGetMaxCustomerBoostClock - DeviceGetSupportedMemoryClocks = libnvml.DeviceGetSupportedMemoryClocks - DeviceGetSupportedGraphicsClocks = libnvml.DeviceGetSupportedGraphicsClocks - DeviceGetAutoBoostedClocksEnabled = libnvml.DeviceGetAutoBoostedClocksEnabled - DeviceSetAutoBoostedClocksEnabled = libnvml.DeviceSetAutoBoostedClocksEnabled - DeviceSetDefaultAutoBoostedClocksEnabled = libnvml.DeviceSetDefaultAutoBoostedClocksEnabled - DeviceGetFanSpeed = libnvml.DeviceGetFanSpeed - DeviceGetFanSpeed_v2 = libnvml.DeviceGetFanSpeed_v2 - DeviceGetNumFans = libnvml.DeviceGetNumFans - DeviceGetTemperature = libnvml.DeviceGetTemperature - DeviceGetTemperatureThreshold = libnvml.DeviceGetTemperatureThreshold - DeviceSetTemperatureThreshold = libnvml.DeviceSetTemperatureThreshold - DeviceGetPerformanceState = libnvml.DeviceGetPerformanceState - DeviceGetCurrentClocksThrottleReasons = libnvml.DeviceGetCurrentClocksThrottleReasons - DeviceGetSupportedClocksThrottleReasons = libnvml.DeviceGetSupportedClocksThrottleReasons - DeviceGetPowerState = libnvml.DeviceGetPowerState - DeviceGetPowerManagementMode = libnvml.DeviceGetPowerManagementMode - DeviceGetPowerManagementLimit = libnvml.DeviceGetPowerManagementLimit - DeviceGetPowerManagementLimitConstraints = libnvml.DeviceGetPowerManagementLimitConstraints - DeviceGetPowerManagementDefaultLimit = libnvml.DeviceGetPowerManagementDefaultLimit - DeviceGetPowerUsage = libnvml.DeviceGetPowerUsage - DeviceGetTotalEnergyConsumption = libnvml.DeviceGetTotalEnergyConsumption - DeviceGetEnforcedPowerLimit = libnvml.DeviceGetEnforcedPowerLimit - DeviceGetGpuOperationMode = libnvml.DeviceGetGpuOperationMode - DeviceGetMemoryInfo = libnvml.DeviceGetMemoryInfo - DeviceGetMemoryInfo_v2 = libnvml.DeviceGetMemoryInfo_v2 - DeviceGetComputeMode = libnvml.DeviceGetComputeMode - DeviceGetCudaComputeCapability = libnvml.DeviceGetCudaComputeCapability - DeviceGetEccMode = libnvml.DeviceGetEccMode - DeviceGetBoardId = libnvml.DeviceGetBoardId - DeviceGetMultiGpuBoard = libnvml.DeviceGetMultiGpuBoard - DeviceGetTotalEccErrors = libnvml.DeviceGetTotalEccErrors - DeviceGetDetailedEccErrors = libnvml.DeviceGetDetailedEccErrors - DeviceGetMemoryErrorCounter = libnvml.DeviceGetMemoryErrorCounter - DeviceGetUtilizationRates = libnvml.DeviceGetUtilizationRates - DeviceGetEncoderUtilization = libnvml.DeviceGetEncoderUtilization - DeviceGetEncoderCapacity = libnvml.DeviceGetEncoderCapacity - DeviceGetEncoderStats = libnvml.DeviceGetEncoderStats - DeviceGetEncoderSessions = libnvml.DeviceGetEncoderSessions - DeviceGetDecoderUtilization = libnvml.DeviceGetDecoderUtilization - DeviceGetFBCStats = libnvml.DeviceGetFBCStats - DeviceGetFBCSessions = libnvml.DeviceGetFBCSessions - DeviceGetDriverModel = libnvml.DeviceGetDriverModel - DeviceGetVbiosVersion = libnvml.DeviceGetVbiosVersion - DeviceGetBridgeChipInfo = libnvml.DeviceGetBridgeChipInfo - DeviceGetComputeRunningProcesses = libnvml.DeviceGetComputeRunningProcesses - DeviceGetGraphicsRunningProcesses = libnvml.DeviceGetGraphicsRunningProcesses - DeviceGetMPSComputeRunningProcesses = libnvml.DeviceGetMPSComputeRunningProcesses - DeviceOnSameBoard = libnvml.DeviceOnSameBoard - DeviceGetAPIRestriction = libnvml.DeviceGetAPIRestriction - DeviceGetSamples = libnvml.DeviceGetSamples - DeviceGetBAR1MemoryInfo = libnvml.DeviceGetBAR1MemoryInfo - DeviceGetViolationStatus = libnvml.DeviceGetViolationStatus - DeviceGetIrqNum = libnvml.DeviceGetIrqNum - DeviceGetNumGpuCores = libnvml.DeviceGetNumGpuCores - DeviceGetPowerSource = libnvml.DeviceGetPowerSource - DeviceGetMemoryBusWidth = libnvml.DeviceGetMemoryBusWidth - DeviceGetPcieLinkMaxSpeed = libnvml.DeviceGetPcieLinkMaxSpeed - DeviceGetAdaptiveClockInfoStatus = libnvml.DeviceGetAdaptiveClockInfoStatus - DeviceGetAccountingMode = libnvml.DeviceGetAccountingMode - DeviceGetAccountingStats = libnvml.DeviceGetAccountingStats - DeviceGetAccountingPids = libnvml.DeviceGetAccountingPids - DeviceGetAccountingBufferSize = libnvml.DeviceGetAccountingBufferSize - DeviceGetRetiredPages = libnvml.DeviceGetRetiredPages - DeviceGetRetiredPages_v2 = libnvml.DeviceGetRetiredPages_v2 - DeviceGetRetiredPagesPendingStatus = libnvml.DeviceGetRetiredPagesPendingStatus - DeviceSetPersistenceMode = libnvml.DeviceSetPersistenceMode - DeviceSetComputeMode = libnvml.DeviceSetComputeMode - DeviceSetEccMode = libnvml.DeviceSetEccMode - DeviceClearEccErrorCounts = libnvml.DeviceClearEccErrorCounts - DeviceSetDriverModel = libnvml.DeviceSetDriverModel - DeviceSetGpuLockedClocks = libnvml.DeviceSetGpuLockedClocks - DeviceResetGpuLockedClocks = libnvml.DeviceResetGpuLockedClocks - DeviceSetMemoryLockedClocks = libnvml.DeviceSetMemoryLockedClocks - DeviceResetMemoryLockedClocks = libnvml.DeviceResetMemoryLockedClocks - DeviceGetClkMonStatus = libnvml.DeviceGetClkMonStatus - DeviceSetApplicationsClocks = libnvml.DeviceSetApplicationsClocks - DeviceSetPowerManagementLimit = libnvml.DeviceSetPowerManagementLimit - DeviceSetGpuOperationMode = libnvml.DeviceSetGpuOperationMode - DeviceSetAPIRestriction = libnvml.DeviceSetAPIRestriction - DeviceSetAccountingMode = libnvml.DeviceSetAccountingMode - DeviceClearAccountingPids = libnvml.DeviceClearAccountingPids - DeviceGetNvLinkState = libnvml.DeviceGetNvLinkState - DeviceGetNvLinkVersion = libnvml.DeviceGetNvLinkVersion - DeviceGetNvLinkCapability = libnvml.DeviceGetNvLinkCapability - DeviceGetNvLinkRemotePciInfo = libnvml.DeviceGetNvLinkRemotePciInfo - DeviceGetNvLinkErrorCounter = libnvml.DeviceGetNvLinkErrorCounter - DeviceResetNvLinkErrorCounters = libnvml.DeviceResetNvLinkErrorCounters - DeviceSetNvLinkUtilizationControl = libnvml.DeviceSetNvLinkUtilizationControl - DeviceGetNvLinkUtilizationControl = libnvml.DeviceGetNvLinkUtilizationControl - DeviceGetNvLinkUtilizationCounter = libnvml.DeviceGetNvLinkUtilizationCounter - DeviceFreezeNvLinkUtilizationCounter = libnvml.DeviceFreezeNvLinkUtilizationCounter - DeviceResetNvLinkUtilizationCounter = libnvml.DeviceResetNvLinkUtilizationCounter - DeviceGetNvLinkRemoteDeviceType = libnvml.DeviceGetNvLinkRemoteDeviceType - DeviceRegisterEvents = libnvml.DeviceRegisterEvents - DeviceGetSupportedEventTypes = libnvml.DeviceGetSupportedEventTypes - DeviceModifyDrainState = libnvml.DeviceModifyDrainState - DeviceQueryDrainState = libnvml.DeviceQueryDrainState - DeviceRemoveGpu = libnvml.DeviceRemoveGpu - DeviceRemoveGpu_v2 = libnvml.DeviceRemoveGpu_v2 - DeviceDiscoverGpus = libnvml.DeviceDiscoverGpus - DeviceGetFieldValues = libnvml.DeviceGetFieldValues - DeviceGetVirtualizationMode = libnvml.DeviceGetVirtualizationMode - DeviceGetHostVgpuMode = libnvml.DeviceGetHostVgpuMode - DeviceSetVirtualizationMode = libnvml.DeviceSetVirtualizationMode - DeviceGetGridLicensableFeatures = libnvml.DeviceGetGridLicensableFeatures - DeviceGetProcessUtilization = libnvml.DeviceGetProcessUtilization - DeviceGetSupportedVgpus = libnvml.DeviceGetSupportedVgpus - DeviceGetCreatableVgpus = libnvml.DeviceGetCreatableVgpus - DeviceGetActiveVgpus = libnvml.DeviceGetActiveVgpus - DeviceGetVgpuMetadata = libnvml.DeviceGetVgpuMetadata - DeviceGetPgpuMetadataString = libnvml.DeviceGetPgpuMetadataString - DeviceGetVgpuUtilization = libnvml.DeviceGetVgpuUtilization - DeviceGetAttributes = libnvml.DeviceGetAttributes - DeviceGetRemappedRows = libnvml.DeviceGetRemappedRows - DeviceGetRowRemapperHistogram = libnvml.DeviceGetRowRemapperHistogram - DeviceGetArchitecture = libnvml.DeviceGetArchitecture - DeviceGetVgpuProcessUtilization = libnvml.DeviceGetVgpuProcessUtilization - GetExcludedDeviceCount = libnvml.GetExcludedDeviceCount - GetExcludedDeviceInfoByIndex = libnvml.GetExcludedDeviceInfoByIndex - DeviceSetMigMode = libnvml.DeviceSetMigMode - DeviceGetMigMode = libnvml.DeviceGetMigMode - DeviceGetGpuInstanceProfileInfo = libnvml.DeviceGetGpuInstanceProfileInfo - DeviceGetGpuInstanceProfileInfoV = libnvml.DeviceGetGpuInstanceProfileInfoV - DeviceGetGpuInstancePossiblePlacements = libnvml.DeviceGetGpuInstancePossiblePlacements - DeviceGetGpuInstanceRemainingCapacity = libnvml.DeviceGetGpuInstanceRemainingCapacity - DeviceCreateGpuInstance = libnvml.DeviceCreateGpuInstance - DeviceCreateGpuInstanceWithPlacement = libnvml.DeviceCreateGpuInstanceWithPlacement - GpuInstanceDestroy = libnvml.GpuInstanceDestroy - DeviceGetGpuInstances = libnvml.DeviceGetGpuInstances - DeviceGetGpuInstanceById = libnvml.DeviceGetGpuInstanceById - GpuInstanceGetInfo = libnvml.GpuInstanceGetInfo - GpuInstanceGetComputeInstanceProfileInfo = libnvml.GpuInstanceGetComputeInstanceProfileInfo - GpuInstanceGetComputeInstanceProfileInfoV = libnvml.GpuInstanceGetComputeInstanceProfileInfoV - GpuInstanceGetComputeInstanceRemainingCapacity = libnvml.GpuInstanceGetComputeInstanceRemainingCapacity - GpuInstanceCreateComputeInstance = libnvml.GpuInstanceCreateComputeInstance - ComputeInstanceDestroy = libnvml.ComputeInstanceDestroy - GpuInstanceGetComputeInstances = libnvml.GpuInstanceGetComputeInstances - GpuInstanceGetComputeInstanceById = libnvml.GpuInstanceGetComputeInstanceById - ComputeInstanceGetInfo = libnvml.ComputeInstanceGetInfo - DeviceIsMigDeviceHandle = libnvml.DeviceIsMigDeviceHandle - DeviceGetGpuInstanceId = libnvml.DeviceGetGpuInstanceId - DeviceGetComputeInstanceId = libnvml.DeviceGetComputeInstanceId - DeviceGetMaxMigDeviceCount = libnvml.DeviceGetMaxMigDeviceCount - DeviceGetMigDeviceHandleByIndex = libnvml.DeviceGetMigDeviceHandleByIndex - DeviceGetDeviceHandleFromMigDeviceHandle = libnvml.DeviceGetDeviceHandleFromMigDeviceHandle - DeviceGetBusType = libnvml.DeviceGetBusType - DeviceSetDefaultFanSpeed_v2 = libnvml.DeviceSetDefaultFanSpeed_v2 - DeviceGetMinMaxFanSpeed = libnvml.DeviceGetMinMaxFanSpeed - DeviceGetThermalSettings = libnvml.DeviceGetThermalSettings - DeviceGetDefaultEccMode = libnvml.DeviceGetDefaultEccMode - DeviceGetPcieSpeed = libnvml.DeviceGetPcieSpeed - DeviceGetGspFirmwareVersion = libnvml.DeviceGetGspFirmwareVersion - DeviceGetGspFirmwareMode = libnvml.DeviceGetGspFirmwareMode - DeviceGetDynamicPstatesInfo = libnvml.DeviceGetDynamicPstatesInfo - DeviceSetFanSpeed_v2 = libnvml.DeviceSetFanSpeed_v2 - DeviceGetGpcClkVfOffset = libnvml.DeviceGetGpcClkVfOffset - DeviceSetGpcClkVfOffset = libnvml.DeviceSetGpcClkVfOffset - DeviceGetMinMaxClockOfPState = libnvml.DeviceGetMinMaxClockOfPState - DeviceGetSupportedPerformanceStates = libnvml.DeviceGetSupportedPerformanceStates - DeviceGetTargetFanSpeed = libnvml.DeviceGetTargetFanSpeed - DeviceGetMemClkVfOffset = libnvml.DeviceGetMemClkVfOffset - DeviceSetMemClkVfOffset = libnvml.DeviceSetMemClkVfOffset - DeviceGetGpcClkMinMaxVfOffset = libnvml.DeviceGetGpcClkMinMaxVfOffset - DeviceGetMemClkMinMaxVfOffset = libnvml.DeviceGetMemClkMinMaxVfOffset - DeviceGetGpuMaxPcieLinkGeneration = libnvml.DeviceGetGpuMaxPcieLinkGeneration - DeviceGetFanControlPolicy_v2 = libnvml.DeviceGetFanControlPolicy_v2 - DeviceSetFanControlPolicy = libnvml.DeviceSetFanControlPolicy - DeviceClearFieldValues = libnvml.DeviceClearFieldValues - DeviceGetVgpuCapabilities = libnvml.DeviceGetVgpuCapabilities - DeviceGetVgpuSchedulerLog = libnvml.DeviceGetVgpuSchedulerLog - DeviceGetVgpuSchedulerState = libnvml.DeviceGetVgpuSchedulerState - DeviceSetVgpuSchedulerState = libnvml.DeviceSetVgpuSchedulerState - DeviceGetVgpuSchedulerCapabilities = libnvml.DeviceGetVgpuSchedulerCapabilities - GpuInstanceGetComputeInstancePossiblePlacements = libnvml.GpuInstanceGetComputeInstancePossiblePlacements - GpuInstanceCreateComputeInstanceWithPlacement = libnvml.GpuInstanceCreateComputeInstanceWithPlacement - DeviceGetGpuFabricInfo = libnvml.DeviceGetGpuFabricInfo - DeviceCcuGetStreamState = libnvml.DeviceCcuGetStreamState - DeviceCcuSetStreamState = libnvml.DeviceCcuSetStreamState - DeviceSetNvLinkDeviceLowPowerThreshold = libnvml.DeviceSetNvLinkDeviceLowPowerThreshold - EventSetCreate = libnvml.EventSetCreate - EventSetWait = libnvml.EventSetWait - EventSetFree = libnvml.EventSetFree - GpmMetricsGetV = libnvml.GpmMetricsGetV - GpmMetricsGet = libnvml.GpmMetricsGet - GpmSampleFree = libnvml.GpmSampleFree - GpmSampleAlloc = libnvml.GpmSampleAlloc - GpmSampleGet = libnvml.GpmSampleGet - GpmQueryDeviceSupportV = libnvml.GpmQueryDeviceSupportV - GpmQueryDeviceSupport = libnvml.GpmQueryDeviceSupport - GpmMigSampleGet = libnvml.GpmMigSampleGet - UnitGetCount = libnvml.UnitGetCount - UnitGetHandleByIndex = libnvml.UnitGetHandleByIndex - UnitGetUnitInfo = libnvml.UnitGetUnitInfo - UnitGetLedState = libnvml.UnitGetLedState - UnitGetPsuInfo = libnvml.UnitGetPsuInfo - UnitGetTemperature = libnvml.UnitGetTemperature - UnitGetFanSpeedInfo = libnvml.UnitGetFanSpeedInfo - UnitGetDevices = libnvml.UnitGetDevices - UnitSetLedState = libnvml.UnitSetLedState - VgpuTypeGetClass = libnvml.VgpuTypeGetClass - VgpuTypeGetName = libnvml.VgpuTypeGetName - VgpuTypeGetGpuInstanceProfileId = libnvml.VgpuTypeGetGpuInstanceProfileId - VgpuTypeGetDeviceID = libnvml.VgpuTypeGetDeviceID - VgpuTypeGetFramebufferSize = libnvml.VgpuTypeGetFramebufferSize - VgpuTypeGetNumDisplayHeads = libnvml.VgpuTypeGetNumDisplayHeads - VgpuTypeGetResolution = libnvml.VgpuTypeGetResolution - VgpuTypeGetLicense = libnvml.VgpuTypeGetLicense - VgpuTypeGetFrameRateLimit = libnvml.VgpuTypeGetFrameRateLimit - VgpuTypeGetMaxInstances = libnvml.VgpuTypeGetMaxInstances - VgpuTypeGetMaxInstancesPerVm = libnvml.VgpuTypeGetMaxInstancesPerVm - VgpuInstanceGetVmID = libnvml.VgpuInstanceGetVmID - VgpuInstanceGetUUID = libnvml.VgpuInstanceGetUUID - VgpuInstanceGetVmDriverVersion = libnvml.VgpuInstanceGetVmDriverVersion - VgpuInstanceGetFbUsage = libnvml.VgpuInstanceGetFbUsage - VgpuInstanceGetLicenseInfo = libnvml.VgpuInstanceGetLicenseInfo - VgpuInstanceGetLicenseStatus = libnvml.VgpuInstanceGetLicenseStatus - VgpuInstanceGetType = libnvml.VgpuInstanceGetType - VgpuInstanceGetFrameRateLimit = libnvml.VgpuInstanceGetFrameRateLimit - VgpuInstanceGetEccMode = libnvml.VgpuInstanceGetEccMode - VgpuInstanceGetEncoderCapacity = libnvml.VgpuInstanceGetEncoderCapacity - VgpuInstanceSetEncoderCapacity = libnvml.VgpuInstanceSetEncoderCapacity - VgpuInstanceGetEncoderStats = libnvml.VgpuInstanceGetEncoderStats - VgpuInstanceGetEncoderSessions = libnvml.VgpuInstanceGetEncoderSessions - VgpuInstanceGetFBCStats = libnvml.VgpuInstanceGetFBCStats - VgpuInstanceGetFBCSessions = libnvml.VgpuInstanceGetFBCSessions - VgpuInstanceGetGpuInstanceId = libnvml.VgpuInstanceGetGpuInstanceId - VgpuInstanceGetGpuPciId = libnvml.VgpuInstanceGetGpuPciId - VgpuInstanceGetMetadata = libnvml.VgpuInstanceGetMetadata - VgpuInstanceGetAccountingMode = libnvml.VgpuInstanceGetAccountingMode - VgpuInstanceGetAccountingPids = libnvml.VgpuInstanceGetAccountingPids - VgpuInstanceGetAccountingStats = libnvml.VgpuInstanceGetAccountingStats - GetVgpuCompatibility = libnvml.GetVgpuCompatibility - GetVgpuVersion = libnvml.GetVgpuVersion - SetVgpuVersion = libnvml.SetVgpuVersion - VgpuInstanceClearAccountingPids = libnvml.VgpuInstanceClearAccountingPids - VgpuInstanceGetMdevUUID = libnvml.VgpuInstanceGetMdevUUID - VgpuTypeGetCapabilities = libnvml.VgpuTypeGetCapabilities - GetVgpuDriverCapabilities = libnvml.GetVgpuDriverCapabilities -) diff --git a/pkg/nvml/zz_generated.api.go b/pkg/nvml/zz_generated.api.go new file mode 100644 index 0000000..1758ead --- /dev/null +++ b/pkg/nvml/zz_generated.api.go @@ -0,0 +1,901 @@ +/** +# 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 + GetExcludedDeviceCount = libnvml.GetExcludedDeviceCount + GetExcludedDeviceInfoByIndex = libnvml.GetExcludedDeviceInfoByIndex + GetLibrary = libnvml.GetLibrary + 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. +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) + GetExcludedDeviceCount() (int, Return) + GetExcludedDeviceInfoByIndex(int) (ExcludedDeviceInfo, Return) + GetLibrary() Library + 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. +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. +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. +type ComputeInstance interface { + Destroy() Return + GetInfo() (ComputeInstanceInfo, Return) +} + +// EventSet represents the interface for the nvmlEventSet type. +type EventSet interface { + Free() Return + Wait(uint32) (EventData, Return) +} + +// GpmSample represents the interface for the nvmlGpmSample type. +type GpmSample interface { + Free() Return + Get(Device) Return + MigGet(Device, int) Return +} + +// Unit represents the interface for the nvmlUnit type. +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. +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. +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) +} From 9a1711ab92d7356e586e47ac3763557abade125a Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 10 Apr 2024 22:46:22 +0000 Subject: [PATCH 19/21] Add mocks for all interfaces under pkg/nvml/mock We should eventually expand this package to include a unified mock server like we have in the go-nvlib testing and mig-parted testing. Signed-off-by: Kevin Klues --- gen/nvml/generateapi.go | 4 +- pkg/nvml/mock/computeinstance.go | 105 + pkg/nvml/mock/device.go | 8283 ++++++++++++++++++ pkg/nvml/mock/eventset.go | 112 + pkg/nvml/mock/gpmsample.go | 162 + pkg/nvml/mock/gpuinstance.go | 475 + pkg/nvml/mock/interface.go | 13588 +++++++++++++++++++++++++++++ pkg/nvml/mock/unit.go | 304 + pkg/nvml/mock/vgpuinstance.go | 896 ++ pkg/nvml/mock/vgputypeid.go | 496 ++ pkg/nvml/zz_generated.api.go | 18 + 11 files changed, 24442 insertions(+), 1 deletion(-) create mode 100644 pkg/nvml/mock/computeinstance.go create mode 100644 pkg/nvml/mock/device.go create mode 100644 pkg/nvml/mock/eventset.go create mode 100644 pkg/nvml/mock/gpmsample.go create mode 100644 pkg/nvml/mock/gpuinstance.go create mode 100644 pkg/nvml/mock/interface.go create mode 100644 pkg/nvml/mock/unit.go create mode 100644 pkg/nvml/mock/vgpuinstance.go create mode 100644 pkg/nvml/mock/vgputypeid.go diff --git a/gen/nvml/generateapi.go b/gen/nvml/generateapi.go index 37f6699..c99fd78 100644 --- a/gen/nvml/generateapi.go +++ b/gen/nvml/generateapi.go @@ -197,11 +197,13 @@ func generatePackageMethodsComment(input GeneratableInterfacePoperties) (string, func generateInterfaceComment(input GeneratableInterfacePoperties) (string, error) { commentFmt := []string{ "// %s represents the interface for the %s type.", + "//", + "//go:generate moq -out mock/%s.go -pkg mock . %s:%s", } var signature strings.Builder comment := strings.Join(commentFmt, "\n") - comment = fmt.Sprintf(comment, input.Interface, input.Type) + comment = fmt.Sprintf(comment, input.Interface, input.Type, strings.ToLower(input.Interface), input.Interface, input.Interface) signature.WriteString(fmt.Sprintf("%s\n", comment)) return signature.String(), nil } diff --git a/pkg/nvml/mock/computeinstance.go b/pkg/nvml/mock/computeinstance.go new file mode 100644 index 0000000..784fa11 --- /dev/null +++ b/pkg/nvml/mock/computeinstance.go @@ -0,0 +1,105 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that ComputeInstance does implement nvml.ComputeInstance. +// If this is not the case, regenerate this file with moq. +var _ nvml.ComputeInstance = &ComputeInstance{} + +// ComputeInstance is a mock implementation of nvml.ComputeInstance. +// +// func TestSomethingThatUsesComputeInstance(t *testing.T) { +// +// // make and configure a mocked nvml.ComputeInstance +// mockedComputeInstance := &ComputeInstance{ +// DestroyFunc: func() nvml.Return { +// panic("mock out the Destroy method") +// }, +// GetInfoFunc: func() (nvml.ComputeInstanceInfo, nvml.Return) { +// panic("mock out the GetInfo method") +// }, +// } +// +// // use mockedComputeInstance in code that requires nvml.ComputeInstance +// // and then make assertions. +// +// } +type ComputeInstance struct { + // DestroyFunc mocks the Destroy method. + DestroyFunc func() nvml.Return + + // GetInfoFunc mocks the GetInfo method. + GetInfoFunc func() (nvml.ComputeInstanceInfo, nvml.Return) + + // calls tracks calls to the methods. + calls struct { + // Destroy holds details about calls to the Destroy method. + Destroy []struct { + } + // GetInfo holds details about calls to the GetInfo method. + GetInfo []struct { + } + } + lockDestroy sync.RWMutex + lockGetInfo sync.RWMutex +} + +// Destroy calls DestroyFunc. +func (mock *ComputeInstance) Destroy() nvml.Return { + if mock.DestroyFunc == nil { + panic("ComputeInstance.DestroyFunc: method is nil but ComputeInstance.Destroy was just called") + } + callInfo := struct { + }{} + mock.lockDestroy.Lock() + mock.calls.Destroy = append(mock.calls.Destroy, callInfo) + mock.lockDestroy.Unlock() + return mock.DestroyFunc() +} + +// DestroyCalls gets all the calls that were made to Destroy. +// Check the length with: +// +// len(mockedComputeInstance.DestroyCalls()) +func (mock *ComputeInstance) DestroyCalls() []struct { +} { + var calls []struct { + } + mock.lockDestroy.RLock() + calls = mock.calls.Destroy + mock.lockDestroy.RUnlock() + return calls +} + +// GetInfo calls GetInfoFunc. +func (mock *ComputeInstance) GetInfo() (nvml.ComputeInstanceInfo, nvml.Return) { + if mock.GetInfoFunc == nil { + panic("ComputeInstance.GetInfoFunc: method is nil but ComputeInstance.GetInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetInfo.Lock() + mock.calls.GetInfo = append(mock.calls.GetInfo, callInfo) + mock.lockGetInfo.Unlock() + return mock.GetInfoFunc() +} + +// GetInfoCalls gets all the calls that were made to GetInfo. +// Check the length with: +// +// len(mockedComputeInstance.GetInfoCalls()) +func (mock *ComputeInstance) GetInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetInfo.RLock() + calls = mock.calls.GetInfo + mock.lockGetInfo.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/device.go b/pkg/nvml/mock/device.go new file mode 100644 index 0000000..cb8f0cf --- /dev/null +++ b/pkg/nvml/mock/device.go @@ -0,0 +1,8283 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that Device does implement nvml.Device. +// If this is not the case, regenerate this file with moq. +var _ nvml.Device = &Device{} + +// Device is a mock implementation of nvml.Device. +// +// func TestSomethingThatUsesDevice(t *testing.T) { +// +// // make and configure a mocked nvml.Device +// mockedDevice := &Device{ +// CcuGetStreamStateFunc: func() (int, nvml.Return) { +// panic("mock out the CcuGetStreamState method") +// }, +// CcuSetStreamStateFunc: func(n int) nvml.Return { +// panic("mock out the CcuSetStreamState method") +// }, +// ClearAccountingPidsFunc: func() nvml.Return { +// panic("mock out the ClearAccountingPids method") +// }, +// ClearCpuAffinityFunc: func() nvml.Return { +// panic("mock out the ClearCpuAffinity method") +// }, +// ClearEccErrorCountsFunc: func(eccCounterType nvml.EccCounterType) nvml.Return { +// panic("mock out the ClearEccErrorCounts method") +// }, +// ClearFieldValuesFunc: func(fieldValues []nvml.FieldValue) nvml.Return { +// panic("mock out the ClearFieldValues method") +// }, +// CreateGpuInstanceFunc: func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (nvml.GpuInstance, nvml.Return) { +// panic("mock out the CreateGpuInstance method") +// }, +// CreateGpuInstanceWithPlacementFunc: func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo, gpuInstancePlacement *nvml.GpuInstancePlacement) (nvml.GpuInstance, nvml.Return) { +// panic("mock out the CreateGpuInstanceWithPlacement method") +// }, +// FreezeNvLinkUtilizationCounterFunc: func(n1 int, n2 int, enableState nvml.EnableState) nvml.Return { +// panic("mock out the FreezeNvLinkUtilizationCounter method") +// }, +// GetAPIRestrictionFunc: func(restrictedAPI nvml.RestrictedAPI) (nvml.EnableState, nvml.Return) { +// panic("mock out the GetAPIRestriction method") +// }, +// GetAccountingBufferSizeFunc: func() (int, nvml.Return) { +// panic("mock out the GetAccountingBufferSize method") +// }, +// GetAccountingModeFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetAccountingMode method") +// }, +// GetAccountingPidsFunc: func() ([]int, nvml.Return) { +// panic("mock out the GetAccountingPids method") +// }, +// GetAccountingStatsFunc: func(v uint32) (nvml.AccountingStats, nvml.Return) { +// panic("mock out the GetAccountingStats method") +// }, +// GetActiveVgpusFunc: func() ([]nvml.VgpuInstance, nvml.Return) { +// panic("mock out the GetActiveVgpus method") +// }, +// GetAdaptiveClockInfoStatusFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetAdaptiveClockInfoStatus method") +// }, +// GetApplicationsClockFunc: func(clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the GetApplicationsClock method") +// }, +// GetArchitectureFunc: func() (nvml.DeviceArchitecture, nvml.Return) { +// panic("mock out the GetArchitecture method") +// }, +// GetAttributesFunc: func() (nvml.DeviceAttributes, nvml.Return) { +// panic("mock out the GetAttributes method") +// }, +// GetAutoBoostedClocksEnabledFunc: func() (nvml.EnableState, nvml.EnableState, nvml.Return) { +// panic("mock out the GetAutoBoostedClocksEnabled method") +// }, +// GetBAR1MemoryInfoFunc: func() (nvml.BAR1Memory, nvml.Return) { +// panic("mock out the GetBAR1MemoryInfo method") +// }, +// GetBoardIdFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetBoardId method") +// }, +// GetBoardPartNumberFunc: func() (string, nvml.Return) { +// panic("mock out the GetBoardPartNumber method") +// }, +// GetBrandFunc: func() (nvml.BrandType, nvml.Return) { +// panic("mock out the GetBrand method") +// }, +// GetBridgeChipInfoFunc: func() (nvml.BridgeChipHierarchy, nvml.Return) { +// panic("mock out the GetBridgeChipInfo method") +// }, +// GetBusTypeFunc: func() (nvml.BusType, nvml.Return) { +// panic("mock out the GetBusType method") +// }, +// GetClkMonStatusFunc: func() (nvml.ClkMonStatus, nvml.Return) { +// panic("mock out the GetClkMonStatus method") +// }, +// GetClockFunc: func(clockType nvml.ClockType, clockId nvml.ClockId) (uint32, nvml.Return) { +// panic("mock out the GetClock method") +// }, +// GetClockInfoFunc: func(clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the GetClockInfo method") +// }, +// GetComputeInstanceIdFunc: func() (int, nvml.Return) { +// panic("mock out the GetComputeInstanceId method") +// }, +// GetComputeModeFunc: func() (nvml.ComputeMode, nvml.Return) { +// panic("mock out the GetComputeMode method") +// }, +// GetComputeRunningProcessesFunc: func() ([]nvml.ProcessInfo, nvml.Return) { +// panic("mock out the GetComputeRunningProcesses method") +// }, +// GetCpuAffinityFunc: func(n int) ([]uint, nvml.Return) { +// panic("mock out the GetCpuAffinity method") +// }, +// GetCpuAffinityWithinScopeFunc: func(n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) { +// panic("mock out the GetCpuAffinityWithinScope method") +// }, +// GetCreatableVgpusFunc: func() ([]nvml.VgpuTypeId, nvml.Return) { +// panic("mock out the GetCreatableVgpus method") +// }, +// GetCudaComputeCapabilityFunc: func() (int, int, nvml.Return) { +// panic("mock out the GetCudaComputeCapability method") +// }, +// GetCurrPcieLinkGenerationFunc: func() (int, nvml.Return) { +// panic("mock out the GetCurrPcieLinkGeneration method") +// }, +// GetCurrPcieLinkWidthFunc: func() (int, nvml.Return) { +// panic("mock out the GetCurrPcieLinkWidth method") +// }, +// GetCurrentClocksThrottleReasonsFunc: func() (uint64, nvml.Return) { +// panic("mock out the GetCurrentClocksThrottleReasons method") +// }, +// GetDecoderUtilizationFunc: func() (uint32, uint32, nvml.Return) { +// panic("mock out the GetDecoderUtilization method") +// }, +// GetDefaultApplicationsClockFunc: func(clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the GetDefaultApplicationsClock method") +// }, +// GetDefaultEccModeFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetDefaultEccMode method") +// }, +// GetDetailedEccErrorsFunc: func(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (nvml.EccErrorCounts, nvml.Return) { +// panic("mock out the GetDetailedEccErrors method") +// }, +// GetDeviceHandleFromMigDeviceHandleFunc: func() (nvml.Device, nvml.Return) { +// panic("mock out the GetDeviceHandleFromMigDeviceHandle method") +// }, +// GetDisplayActiveFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetDisplayActive method") +// }, +// GetDisplayModeFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetDisplayMode method") +// }, +// GetDriverModelFunc: func() (nvml.DriverModel, nvml.DriverModel, nvml.Return) { +// panic("mock out the GetDriverModel method") +// }, +// GetDynamicPstatesInfoFunc: func() (nvml.GpuDynamicPstatesInfo, nvml.Return) { +// panic("mock out the GetDynamicPstatesInfo method") +// }, +// GetEccModeFunc: func() (nvml.EnableState, nvml.EnableState, nvml.Return) { +// panic("mock out the GetEccMode method") +// }, +// GetEncoderCapacityFunc: func(encoderType nvml.EncoderType) (int, nvml.Return) { +// panic("mock out the GetEncoderCapacity method") +// }, +// GetEncoderSessionsFunc: func() ([]nvml.EncoderSessionInfo, nvml.Return) { +// panic("mock out the GetEncoderSessions method") +// }, +// GetEncoderStatsFunc: func() (int, uint32, uint32, nvml.Return) { +// panic("mock out the GetEncoderStats method") +// }, +// GetEncoderUtilizationFunc: func() (uint32, uint32, nvml.Return) { +// panic("mock out the GetEncoderUtilization method") +// }, +// GetEnforcedPowerLimitFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetEnforcedPowerLimit method") +// }, +// GetFBCSessionsFunc: func() ([]nvml.FBCSessionInfo, nvml.Return) { +// panic("mock out the GetFBCSessions method") +// }, +// GetFBCStatsFunc: func() (nvml.FBCStats, nvml.Return) { +// panic("mock out the GetFBCStats method") +// }, +// GetFanControlPolicy_v2Func: func(n int) (nvml.FanControlPolicy, nvml.Return) { +// panic("mock out the GetFanControlPolicy_v2 method") +// }, +// GetFanSpeedFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetFanSpeed method") +// }, +// GetFanSpeed_v2Func: func(n int) (uint32, nvml.Return) { +// panic("mock out the GetFanSpeed_v2 method") +// }, +// GetFieldValuesFunc: func(fieldValues []nvml.FieldValue) nvml.Return { +// panic("mock out the GetFieldValues method") +// }, +// GetGpcClkMinMaxVfOffsetFunc: func() (int, int, nvml.Return) { +// panic("mock out the GetGpcClkMinMaxVfOffset method") +// }, +// GetGpcClkVfOffsetFunc: func() (int, nvml.Return) { +// panic("mock out the GetGpcClkVfOffset method") +// }, +// GetGpuFabricInfoFunc: func() (nvml.GpuFabricInfo, nvml.Return) { +// panic("mock out the GetGpuFabricInfo method") +// }, +// GetGpuInstanceByIdFunc: func(n int) (nvml.GpuInstance, nvml.Return) { +// panic("mock out the GetGpuInstanceById method") +// }, +// GetGpuInstanceIdFunc: func() (int, nvml.Return) { +// panic("mock out the GetGpuInstanceId method") +// }, +// GetGpuInstancePossiblePlacementsFunc: func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstancePlacement, nvml.Return) { +// panic("mock out the GetGpuInstancePossiblePlacements method") +// }, +// GetGpuInstanceProfileInfoFunc: func(n int) (nvml.GpuInstanceProfileInfo, nvml.Return) { +// panic("mock out the GetGpuInstanceProfileInfo method") +// }, +// GetGpuInstanceProfileInfoVFunc: func(n int) nvml.GpuInstanceProfileInfoV { +// panic("mock out the GetGpuInstanceProfileInfoV method") +// }, +// GetGpuInstanceRemainingCapacityFunc: func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (int, nvml.Return) { +// panic("mock out the GetGpuInstanceRemainingCapacity method") +// }, +// GetGpuInstancesFunc: func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstance, nvml.Return) { +// panic("mock out the GetGpuInstances method") +// }, +// GetGpuMaxPcieLinkGenerationFunc: func() (int, nvml.Return) { +// panic("mock out the GetGpuMaxPcieLinkGeneration method") +// }, +// GetGpuOperationModeFunc: func() (nvml.GpuOperationMode, nvml.GpuOperationMode, nvml.Return) { +// panic("mock out the GetGpuOperationMode method") +// }, +// GetGraphicsRunningProcessesFunc: func() ([]nvml.ProcessInfo, nvml.Return) { +// panic("mock out the GetGraphicsRunningProcesses method") +// }, +// GetGridLicensableFeaturesFunc: func() (nvml.GridLicensableFeatures, nvml.Return) { +// panic("mock out the GetGridLicensableFeatures method") +// }, +// GetGspFirmwareModeFunc: func() (bool, bool, nvml.Return) { +// panic("mock out the GetGspFirmwareMode method") +// }, +// GetGspFirmwareVersionFunc: func() (string, nvml.Return) { +// panic("mock out the GetGspFirmwareVersion method") +// }, +// GetHostVgpuModeFunc: func() (nvml.HostVgpuMode, nvml.Return) { +// panic("mock out the GetHostVgpuMode method") +// }, +// GetIndexFunc: func() (int, nvml.Return) { +// panic("mock out the GetIndex method") +// }, +// GetInforomConfigurationChecksumFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetInforomConfigurationChecksum method") +// }, +// GetInforomImageVersionFunc: func() (string, nvml.Return) { +// panic("mock out the GetInforomImageVersion method") +// }, +// GetInforomVersionFunc: func(inforomObject nvml.InforomObject) (string, nvml.Return) { +// panic("mock out the GetInforomVersion method") +// }, +// GetIrqNumFunc: func() (int, nvml.Return) { +// panic("mock out the GetIrqNum method") +// }, +// GetMPSComputeRunningProcessesFunc: func() ([]nvml.ProcessInfo, nvml.Return) { +// panic("mock out the GetMPSComputeRunningProcesses method") +// }, +// GetMaxClockInfoFunc: func(clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the GetMaxClockInfo method") +// }, +// GetMaxCustomerBoostClockFunc: func(clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the GetMaxCustomerBoostClock method") +// }, +// GetMaxMigDeviceCountFunc: func() (int, nvml.Return) { +// panic("mock out the GetMaxMigDeviceCount method") +// }, +// GetMaxPcieLinkGenerationFunc: func() (int, nvml.Return) { +// panic("mock out the GetMaxPcieLinkGeneration method") +// }, +// GetMaxPcieLinkWidthFunc: func() (int, nvml.Return) { +// panic("mock out the GetMaxPcieLinkWidth method") +// }, +// GetMemClkMinMaxVfOffsetFunc: func() (int, int, nvml.Return) { +// panic("mock out the GetMemClkMinMaxVfOffset method") +// }, +// GetMemClkVfOffsetFunc: func() (int, nvml.Return) { +// panic("mock out the GetMemClkVfOffset method") +// }, +// GetMemoryAffinityFunc: func(n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) { +// panic("mock out the GetMemoryAffinity method") +// }, +// GetMemoryBusWidthFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetMemoryBusWidth method") +// }, +// GetMemoryErrorCounterFunc: func(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType, memoryLocation nvml.MemoryLocation) (uint64, nvml.Return) { +// panic("mock out the GetMemoryErrorCounter method") +// }, +// GetMemoryInfoFunc: func() (nvml.Memory, nvml.Return) { +// panic("mock out the GetMemoryInfo method") +// }, +// GetMemoryInfo_v2Func: func() (nvml.Memory_v2, nvml.Return) { +// panic("mock out the GetMemoryInfo_v2 method") +// }, +// GetMigDeviceHandleByIndexFunc: func(n int) (nvml.Device, nvml.Return) { +// panic("mock out the GetMigDeviceHandleByIndex method") +// }, +// GetMigModeFunc: func() (int, int, nvml.Return) { +// panic("mock out the GetMigMode method") +// }, +// GetMinMaxClockOfPStateFunc: func(clockType nvml.ClockType, pstates nvml.Pstates) (uint32, uint32, nvml.Return) { +// panic("mock out the GetMinMaxClockOfPState method") +// }, +// GetMinMaxFanSpeedFunc: func() (int, int, nvml.Return) { +// panic("mock out the GetMinMaxFanSpeed method") +// }, +// GetMinorNumberFunc: func() (int, nvml.Return) { +// panic("mock out the GetMinorNumber method") +// }, +// GetMultiGpuBoardFunc: func() (int, nvml.Return) { +// panic("mock out the GetMultiGpuBoard method") +// }, +// GetNameFunc: func() (string, nvml.Return) { +// panic("mock out the GetName method") +// }, +// GetNumFansFunc: func() (int, nvml.Return) { +// panic("mock out the GetNumFans method") +// }, +// GetNumGpuCoresFunc: func() (int, nvml.Return) { +// panic("mock out the GetNumGpuCores method") +// }, +// GetNvLinkCapabilityFunc: func(n int, nvLinkCapability nvml.NvLinkCapability) (uint32, nvml.Return) { +// panic("mock out the GetNvLinkCapability method") +// }, +// GetNvLinkErrorCounterFunc: func(n int, nvLinkErrorCounter nvml.NvLinkErrorCounter) (uint64, nvml.Return) { +// panic("mock out the GetNvLinkErrorCounter method") +// }, +// GetNvLinkRemoteDeviceTypeFunc: func(n int) (nvml.IntNvLinkDeviceType, nvml.Return) { +// panic("mock out the GetNvLinkRemoteDeviceType method") +// }, +// GetNvLinkRemotePciInfoFunc: func(n int) (nvml.PciInfo, nvml.Return) { +// panic("mock out the GetNvLinkRemotePciInfo method") +// }, +// GetNvLinkStateFunc: func(n int) (nvml.EnableState, nvml.Return) { +// panic("mock out the GetNvLinkState method") +// }, +// GetNvLinkUtilizationControlFunc: func(n1 int, n2 int) (nvml.NvLinkUtilizationControl, nvml.Return) { +// panic("mock out the GetNvLinkUtilizationControl method") +// }, +// GetNvLinkUtilizationCounterFunc: func(n1 int, n2 int) (uint64, uint64, nvml.Return) { +// panic("mock out the GetNvLinkUtilizationCounter method") +// }, +// GetNvLinkVersionFunc: func(n int) (uint32, nvml.Return) { +// panic("mock out the GetNvLinkVersion method") +// }, +// GetP2PStatusFunc: func(device nvml.Device, gpuP2PCapsIndex nvml.GpuP2PCapsIndex) (nvml.GpuP2PStatus, nvml.Return) { +// panic("mock out the GetP2PStatus method") +// }, +// GetPciInfoFunc: func() (nvml.PciInfo, nvml.Return) { +// panic("mock out the GetPciInfo method") +// }, +// GetPcieLinkMaxSpeedFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetPcieLinkMaxSpeed method") +// }, +// GetPcieReplayCounterFunc: func() (int, nvml.Return) { +// panic("mock out the GetPcieReplayCounter method") +// }, +// GetPcieSpeedFunc: func() (int, nvml.Return) { +// panic("mock out the GetPcieSpeed method") +// }, +// GetPcieThroughputFunc: func(pcieUtilCounter nvml.PcieUtilCounter) (uint32, nvml.Return) { +// panic("mock out the GetPcieThroughput method") +// }, +// GetPerformanceStateFunc: func() (nvml.Pstates, nvml.Return) { +// panic("mock out the GetPerformanceState method") +// }, +// GetPersistenceModeFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetPersistenceMode method") +// }, +// GetPgpuMetadataStringFunc: func() (string, nvml.Return) { +// panic("mock out the GetPgpuMetadataString method") +// }, +// GetPowerManagementDefaultLimitFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetPowerManagementDefaultLimit method") +// }, +// GetPowerManagementLimitFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetPowerManagementLimit method") +// }, +// GetPowerManagementLimitConstraintsFunc: func() (uint32, uint32, nvml.Return) { +// panic("mock out the GetPowerManagementLimitConstraints method") +// }, +// GetPowerManagementModeFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetPowerManagementMode method") +// }, +// GetPowerSourceFunc: func() (nvml.PowerSource, nvml.Return) { +// panic("mock out the GetPowerSource method") +// }, +// GetPowerStateFunc: func() (nvml.Pstates, nvml.Return) { +// panic("mock out the GetPowerState method") +// }, +// GetPowerUsageFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetPowerUsage method") +// }, +// GetProcessUtilizationFunc: func(v uint64) ([]nvml.ProcessUtilizationSample, nvml.Return) { +// panic("mock out the GetProcessUtilization method") +// }, +// GetRemappedRowsFunc: func() (int, int, bool, bool, nvml.Return) { +// panic("mock out the GetRemappedRows method") +// }, +// GetRetiredPagesFunc: func(pageRetirementCause nvml.PageRetirementCause) ([]uint64, nvml.Return) { +// panic("mock out the GetRetiredPages method") +// }, +// GetRetiredPagesPendingStatusFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetRetiredPagesPendingStatus method") +// }, +// GetRetiredPages_v2Func: func(pageRetirementCause nvml.PageRetirementCause) ([]uint64, []uint64, nvml.Return) { +// panic("mock out the GetRetiredPages_v2 method") +// }, +// GetRowRemapperHistogramFunc: func() (nvml.RowRemapperHistogramValues, nvml.Return) { +// panic("mock out the GetRowRemapperHistogram method") +// }, +// GetSamplesFunc: func(samplingType nvml.SamplingType, v uint64) (nvml.ValueType, []nvml.Sample, nvml.Return) { +// panic("mock out the GetSamples method") +// }, +// GetSerialFunc: func() (string, nvml.Return) { +// panic("mock out the GetSerial method") +// }, +// GetSupportedClocksThrottleReasonsFunc: func() (uint64, nvml.Return) { +// panic("mock out the GetSupportedClocksThrottleReasons method") +// }, +// GetSupportedEventTypesFunc: func() (uint64, nvml.Return) { +// panic("mock out the GetSupportedEventTypes method") +// }, +// GetSupportedGraphicsClocksFunc: func(n int) (int, uint32, nvml.Return) { +// panic("mock out the GetSupportedGraphicsClocks method") +// }, +// GetSupportedMemoryClocksFunc: func() (int, uint32, nvml.Return) { +// panic("mock out the GetSupportedMemoryClocks method") +// }, +// GetSupportedPerformanceStatesFunc: func() ([]nvml.Pstates, nvml.Return) { +// panic("mock out the GetSupportedPerformanceStates method") +// }, +// GetSupportedVgpusFunc: func() ([]nvml.VgpuTypeId, nvml.Return) { +// panic("mock out the GetSupportedVgpus method") +// }, +// GetTargetFanSpeedFunc: func(n int) (int, nvml.Return) { +// panic("mock out the GetTargetFanSpeed method") +// }, +// GetTemperatureFunc: func(temperatureSensors nvml.TemperatureSensors) (uint32, nvml.Return) { +// panic("mock out the GetTemperature method") +// }, +// GetTemperatureThresholdFunc: func(temperatureThresholds nvml.TemperatureThresholds) (uint32, nvml.Return) { +// panic("mock out the GetTemperatureThreshold method") +// }, +// GetThermalSettingsFunc: func(v uint32) (nvml.GpuThermalSettings, nvml.Return) { +// panic("mock out the GetThermalSettings method") +// }, +// GetTopologyCommonAncestorFunc: func(device nvml.Device) (nvml.GpuTopologyLevel, nvml.Return) { +// panic("mock out the GetTopologyCommonAncestor method") +// }, +// GetTopologyNearestGpusFunc: func(gpuTopologyLevel nvml.GpuTopologyLevel) ([]nvml.Device, nvml.Return) { +// panic("mock out the GetTopologyNearestGpus method") +// }, +// GetTotalEccErrorsFunc: func(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (uint64, nvml.Return) { +// panic("mock out the GetTotalEccErrors method") +// }, +// GetTotalEnergyConsumptionFunc: func() (uint64, nvml.Return) { +// panic("mock out the GetTotalEnergyConsumption method") +// }, +// GetUUIDFunc: func() (string, nvml.Return) { +// panic("mock out the GetUUID method") +// }, +// GetUtilizationRatesFunc: func() (nvml.Utilization, nvml.Return) { +// panic("mock out the GetUtilizationRates method") +// }, +// GetVbiosVersionFunc: func() (string, nvml.Return) { +// panic("mock out the GetVbiosVersion method") +// }, +// GetVgpuCapabilitiesFunc: func(deviceVgpuCapability nvml.DeviceVgpuCapability) (bool, nvml.Return) { +// panic("mock out the GetVgpuCapabilities method") +// }, +// GetVgpuMetadataFunc: func() (nvml.VgpuPgpuMetadata, nvml.Return) { +// panic("mock out the GetVgpuMetadata method") +// }, +// GetVgpuProcessUtilizationFunc: func(v uint64) ([]nvml.VgpuProcessUtilizationSample, nvml.Return) { +// panic("mock out the GetVgpuProcessUtilization method") +// }, +// GetVgpuSchedulerCapabilitiesFunc: func() (nvml.VgpuSchedulerCapabilities, nvml.Return) { +// panic("mock out the GetVgpuSchedulerCapabilities method") +// }, +// GetVgpuSchedulerLogFunc: func() (nvml.VgpuSchedulerLog, nvml.Return) { +// panic("mock out the GetVgpuSchedulerLog method") +// }, +// GetVgpuSchedulerStateFunc: func() (nvml.VgpuSchedulerGetState, nvml.Return) { +// panic("mock out the GetVgpuSchedulerState method") +// }, +// GetVgpuUtilizationFunc: func(v uint64) (nvml.ValueType, []nvml.VgpuInstanceUtilizationSample, nvml.Return) { +// panic("mock out the GetVgpuUtilization method") +// }, +// GetViolationStatusFunc: func(perfPolicyType nvml.PerfPolicyType) (nvml.ViolationTime, nvml.Return) { +// panic("mock out the GetViolationStatus method") +// }, +// GetVirtualizationModeFunc: func() (nvml.GpuVirtualizationMode, nvml.Return) { +// panic("mock out the GetVirtualizationMode method") +// }, +// GpmMigSampleGetFunc: func(n int, gpmSample nvml.GpmSample) nvml.Return { +// panic("mock out the GpmMigSampleGet method") +// }, +// GpmQueryDeviceSupportFunc: func() (nvml.GpmSupport, nvml.Return) { +// panic("mock out the GpmQueryDeviceSupport method") +// }, +// GpmQueryDeviceSupportVFunc: func() nvml.GpmSupportV { +// panic("mock out the GpmQueryDeviceSupportV method") +// }, +// GpmSampleGetFunc: func(gpmSample nvml.GpmSample) nvml.Return { +// panic("mock out the GpmSampleGet method") +// }, +// IsMigDeviceHandleFunc: func() (bool, nvml.Return) { +// panic("mock out the IsMigDeviceHandle method") +// }, +// OnSameBoardFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the OnSameBoard method") +// }, +// RegisterEventsFunc: func(v uint64, eventSet nvml.EventSet) nvml.Return { +// panic("mock out the RegisterEvents method") +// }, +// ResetApplicationsClocksFunc: func() nvml.Return { +// panic("mock out the ResetApplicationsClocks method") +// }, +// ResetGpuLockedClocksFunc: func() nvml.Return { +// panic("mock out the ResetGpuLockedClocks method") +// }, +// ResetMemoryLockedClocksFunc: func() nvml.Return { +// panic("mock out the ResetMemoryLockedClocks method") +// }, +// ResetNvLinkErrorCountersFunc: func(n int) nvml.Return { +// panic("mock out the ResetNvLinkErrorCounters method") +// }, +// ResetNvLinkUtilizationCounterFunc: func(n1 int, n2 int) nvml.Return { +// panic("mock out the ResetNvLinkUtilizationCounter method") +// }, +// SetAPIRestrictionFunc: func(restrictedAPI nvml.RestrictedAPI, enableState nvml.EnableState) nvml.Return { +// panic("mock out the SetAPIRestriction method") +// }, +// SetAccountingModeFunc: func(enableState nvml.EnableState) nvml.Return { +// panic("mock out the SetAccountingMode method") +// }, +// SetApplicationsClocksFunc: func(v1 uint32, v2 uint32) nvml.Return { +// panic("mock out the SetApplicationsClocks method") +// }, +// SetAutoBoostedClocksEnabledFunc: func(enableState nvml.EnableState) nvml.Return { +// panic("mock out the SetAutoBoostedClocksEnabled method") +// }, +// SetComputeModeFunc: func(computeMode nvml.ComputeMode) nvml.Return { +// panic("mock out the SetComputeMode method") +// }, +// SetCpuAffinityFunc: func() nvml.Return { +// panic("mock out the SetCpuAffinity method") +// }, +// SetDefaultAutoBoostedClocksEnabledFunc: func(enableState nvml.EnableState, v uint32) nvml.Return { +// panic("mock out the SetDefaultAutoBoostedClocksEnabled method") +// }, +// SetDefaultFanSpeed_v2Func: func(n int) nvml.Return { +// panic("mock out the SetDefaultFanSpeed_v2 method") +// }, +// SetDriverModelFunc: func(driverModel nvml.DriverModel, v uint32) nvml.Return { +// panic("mock out the SetDriverModel method") +// }, +// SetEccModeFunc: func(enableState nvml.EnableState) nvml.Return { +// panic("mock out the SetEccMode method") +// }, +// SetFanControlPolicyFunc: func(n int, fanControlPolicy nvml.FanControlPolicy) nvml.Return { +// panic("mock out the SetFanControlPolicy method") +// }, +// SetFanSpeed_v2Func: func(n1 int, n2 int) nvml.Return { +// panic("mock out the SetFanSpeed_v2 method") +// }, +// SetGpcClkVfOffsetFunc: func(n int) nvml.Return { +// panic("mock out the SetGpcClkVfOffset method") +// }, +// SetGpuLockedClocksFunc: func(v1 uint32, v2 uint32) nvml.Return { +// panic("mock out the SetGpuLockedClocks method") +// }, +// SetGpuOperationModeFunc: func(gpuOperationMode nvml.GpuOperationMode) nvml.Return { +// panic("mock out the SetGpuOperationMode method") +// }, +// SetMemClkVfOffsetFunc: func(n int) nvml.Return { +// panic("mock out the SetMemClkVfOffset method") +// }, +// SetMemoryLockedClocksFunc: func(v1 uint32, v2 uint32) nvml.Return { +// panic("mock out the SetMemoryLockedClocks method") +// }, +// SetMigModeFunc: func(n int) (nvml.Return, nvml.Return) { +// panic("mock out the SetMigMode method") +// }, +// SetNvLinkDeviceLowPowerThresholdFunc: func(nvLinkPowerThres *nvml.NvLinkPowerThres) nvml.Return { +// panic("mock out the SetNvLinkDeviceLowPowerThreshold method") +// }, +// SetNvLinkUtilizationControlFunc: func(n1 int, n2 int, nvLinkUtilizationControl *nvml.NvLinkUtilizationControl, b bool) nvml.Return { +// panic("mock out the SetNvLinkUtilizationControl method") +// }, +// SetPersistenceModeFunc: func(enableState nvml.EnableState) nvml.Return { +// panic("mock out the SetPersistenceMode method") +// }, +// SetPowerManagementLimitFunc: func(v uint32) nvml.Return { +// panic("mock out the SetPowerManagementLimit method") +// }, +// SetTemperatureThresholdFunc: func(temperatureThresholds nvml.TemperatureThresholds, n int) nvml.Return { +// panic("mock out the SetTemperatureThreshold method") +// }, +// SetVgpuSchedulerStateFunc: func(vgpuSchedulerSetState *nvml.VgpuSchedulerSetState) nvml.Return { +// panic("mock out the SetVgpuSchedulerState method") +// }, +// SetVirtualizationModeFunc: func(gpuVirtualizationMode nvml.GpuVirtualizationMode) nvml.Return { +// panic("mock out the SetVirtualizationMode method") +// }, +// ValidateInforomFunc: func() nvml.Return { +// panic("mock out the ValidateInforom method") +// }, +// VgpuTypeGetMaxInstancesFunc: func(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) { +// panic("mock out the VgpuTypeGetMaxInstances method") +// }, +// } +// +// // use mockedDevice in code that requires nvml.Device +// // and then make assertions. +// +// } +type Device struct { + // CcuGetStreamStateFunc mocks the CcuGetStreamState method. + CcuGetStreamStateFunc func() (int, nvml.Return) + + // CcuSetStreamStateFunc mocks the CcuSetStreamState method. + CcuSetStreamStateFunc func(n int) nvml.Return + + // ClearAccountingPidsFunc mocks the ClearAccountingPids method. + ClearAccountingPidsFunc func() nvml.Return + + // ClearCpuAffinityFunc mocks the ClearCpuAffinity method. + ClearCpuAffinityFunc func() nvml.Return + + // ClearEccErrorCountsFunc mocks the ClearEccErrorCounts method. + ClearEccErrorCountsFunc func(eccCounterType nvml.EccCounterType) nvml.Return + + // ClearFieldValuesFunc mocks the ClearFieldValues method. + ClearFieldValuesFunc func(fieldValues []nvml.FieldValue) nvml.Return + + // CreateGpuInstanceFunc mocks the CreateGpuInstance method. + CreateGpuInstanceFunc func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (nvml.GpuInstance, nvml.Return) + + // CreateGpuInstanceWithPlacementFunc mocks the CreateGpuInstanceWithPlacement method. + CreateGpuInstanceWithPlacementFunc func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo, gpuInstancePlacement *nvml.GpuInstancePlacement) (nvml.GpuInstance, nvml.Return) + + // FreezeNvLinkUtilizationCounterFunc mocks the FreezeNvLinkUtilizationCounter method. + FreezeNvLinkUtilizationCounterFunc func(n1 int, n2 int, enableState nvml.EnableState) nvml.Return + + // GetAPIRestrictionFunc mocks the GetAPIRestriction method. + GetAPIRestrictionFunc func(restrictedAPI nvml.RestrictedAPI) (nvml.EnableState, nvml.Return) + + // GetAccountingBufferSizeFunc mocks the GetAccountingBufferSize method. + GetAccountingBufferSizeFunc func() (int, nvml.Return) + + // GetAccountingModeFunc mocks the GetAccountingMode method. + GetAccountingModeFunc func() (nvml.EnableState, nvml.Return) + + // GetAccountingPidsFunc mocks the GetAccountingPids method. + GetAccountingPidsFunc func() ([]int, nvml.Return) + + // GetAccountingStatsFunc mocks the GetAccountingStats method. + GetAccountingStatsFunc func(v uint32) (nvml.AccountingStats, nvml.Return) + + // GetActiveVgpusFunc mocks the GetActiveVgpus method. + GetActiveVgpusFunc func() ([]nvml.VgpuInstance, nvml.Return) + + // GetAdaptiveClockInfoStatusFunc mocks the GetAdaptiveClockInfoStatus method. + GetAdaptiveClockInfoStatusFunc func() (uint32, nvml.Return) + + // GetApplicationsClockFunc mocks the GetApplicationsClock method. + GetApplicationsClockFunc func(clockType nvml.ClockType) (uint32, nvml.Return) + + // GetArchitectureFunc mocks the GetArchitecture method. + GetArchitectureFunc func() (nvml.DeviceArchitecture, nvml.Return) + + // GetAttributesFunc mocks the GetAttributes method. + GetAttributesFunc func() (nvml.DeviceAttributes, nvml.Return) + + // GetAutoBoostedClocksEnabledFunc mocks the GetAutoBoostedClocksEnabled method. + GetAutoBoostedClocksEnabledFunc func() (nvml.EnableState, nvml.EnableState, nvml.Return) + + // GetBAR1MemoryInfoFunc mocks the GetBAR1MemoryInfo method. + GetBAR1MemoryInfoFunc func() (nvml.BAR1Memory, nvml.Return) + + // GetBoardIdFunc mocks the GetBoardId method. + GetBoardIdFunc func() (uint32, nvml.Return) + + // GetBoardPartNumberFunc mocks the GetBoardPartNumber method. + GetBoardPartNumberFunc func() (string, nvml.Return) + + // GetBrandFunc mocks the GetBrand method. + GetBrandFunc func() (nvml.BrandType, nvml.Return) + + // GetBridgeChipInfoFunc mocks the GetBridgeChipInfo method. + GetBridgeChipInfoFunc func() (nvml.BridgeChipHierarchy, nvml.Return) + + // GetBusTypeFunc mocks the GetBusType method. + GetBusTypeFunc func() (nvml.BusType, nvml.Return) + + // GetClkMonStatusFunc mocks the GetClkMonStatus method. + GetClkMonStatusFunc func() (nvml.ClkMonStatus, nvml.Return) + + // GetClockFunc mocks the GetClock method. + GetClockFunc func(clockType nvml.ClockType, clockId nvml.ClockId) (uint32, nvml.Return) + + // GetClockInfoFunc mocks the GetClockInfo method. + GetClockInfoFunc func(clockType nvml.ClockType) (uint32, nvml.Return) + + // GetComputeInstanceIdFunc mocks the GetComputeInstanceId method. + GetComputeInstanceIdFunc func() (int, nvml.Return) + + // GetComputeModeFunc mocks the GetComputeMode method. + GetComputeModeFunc func() (nvml.ComputeMode, nvml.Return) + + // GetComputeRunningProcessesFunc mocks the GetComputeRunningProcesses method. + GetComputeRunningProcessesFunc func() ([]nvml.ProcessInfo, nvml.Return) + + // GetCpuAffinityFunc mocks the GetCpuAffinity method. + GetCpuAffinityFunc func(n int) ([]uint, nvml.Return) + + // GetCpuAffinityWithinScopeFunc mocks the GetCpuAffinityWithinScope method. + GetCpuAffinityWithinScopeFunc func(n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) + + // GetCreatableVgpusFunc mocks the GetCreatableVgpus method. + GetCreatableVgpusFunc func() ([]nvml.VgpuTypeId, nvml.Return) + + // GetCudaComputeCapabilityFunc mocks the GetCudaComputeCapability method. + GetCudaComputeCapabilityFunc func() (int, int, nvml.Return) + + // GetCurrPcieLinkGenerationFunc mocks the GetCurrPcieLinkGeneration method. + GetCurrPcieLinkGenerationFunc func() (int, nvml.Return) + + // GetCurrPcieLinkWidthFunc mocks the GetCurrPcieLinkWidth method. + GetCurrPcieLinkWidthFunc func() (int, nvml.Return) + + // GetCurrentClocksThrottleReasonsFunc mocks the GetCurrentClocksThrottleReasons method. + GetCurrentClocksThrottleReasonsFunc func() (uint64, nvml.Return) + + // GetDecoderUtilizationFunc mocks the GetDecoderUtilization method. + GetDecoderUtilizationFunc func() (uint32, uint32, nvml.Return) + + // GetDefaultApplicationsClockFunc mocks the GetDefaultApplicationsClock method. + GetDefaultApplicationsClockFunc func(clockType nvml.ClockType) (uint32, nvml.Return) + + // GetDefaultEccModeFunc mocks the GetDefaultEccMode method. + GetDefaultEccModeFunc func() (nvml.EnableState, nvml.Return) + + // GetDetailedEccErrorsFunc mocks the GetDetailedEccErrors method. + GetDetailedEccErrorsFunc func(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (nvml.EccErrorCounts, nvml.Return) + + // GetDeviceHandleFromMigDeviceHandleFunc mocks the GetDeviceHandleFromMigDeviceHandle method. + GetDeviceHandleFromMigDeviceHandleFunc func() (nvml.Device, nvml.Return) + + // GetDisplayActiveFunc mocks the GetDisplayActive method. + GetDisplayActiveFunc func() (nvml.EnableState, nvml.Return) + + // GetDisplayModeFunc mocks the GetDisplayMode method. + GetDisplayModeFunc func() (nvml.EnableState, nvml.Return) + + // GetDriverModelFunc mocks the GetDriverModel method. + GetDriverModelFunc func() (nvml.DriverModel, nvml.DriverModel, nvml.Return) + + // GetDynamicPstatesInfoFunc mocks the GetDynamicPstatesInfo method. + GetDynamicPstatesInfoFunc func() (nvml.GpuDynamicPstatesInfo, nvml.Return) + + // GetEccModeFunc mocks the GetEccMode method. + GetEccModeFunc func() (nvml.EnableState, nvml.EnableState, nvml.Return) + + // GetEncoderCapacityFunc mocks the GetEncoderCapacity method. + GetEncoderCapacityFunc func(encoderType nvml.EncoderType) (int, nvml.Return) + + // GetEncoderSessionsFunc mocks the GetEncoderSessions method. + GetEncoderSessionsFunc func() ([]nvml.EncoderSessionInfo, nvml.Return) + + // GetEncoderStatsFunc mocks the GetEncoderStats method. + GetEncoderStatsFunc func() (int, uint32, uint32, nvml.Return) + + // GetEncoderUtilizationFunc mocks the GetEncoderUtilization method. + GetEncoderUtilizationFunc func() (uint32, uint32, nvml.Return) + + // GetEnforcedPowerLimitFunc mocks the GetEnforcedPowerLimit method. + GetEnforcedPowerLimitFunc func() (uint32, nvml.Return) + + // GetFBCSessionsFunc mocks the GetFBCSessions method. + GetFBCSessionsFunc func() ([]nvml.FBCSessionInfo, nvml.Return) + + // GetFBCStatsFunc mocks the GetFBCStats method. + GetFBCStatsFunc func() (nvml.FBCStats, nvml.Return) + + // GetFanControlPolicy_v2Func mocks the GetFanControlPolicy_v2 method. + GetFanControlPolicy_v2Func func(n int) (nvml.FanControlPolicy, nvml.Return) + + // GetFanSpeedFunc mocks the GetFanSpeed method. + GetFanSpeedFunc func() (uint32, nvml.Return) + + // GetFanSpeed_v2Func mocks the GetFanSpeed_v2 method. + GetFanSpeed_v2Func func(n int) (uint32, nvml.Return) + + // GetFieldValuesFunc mocks the GetFieldValues method. + GetFieldValuesFunc func(fieldValues []nvml.FieldValue) nvml.Return + + // GetGpcClkMinMaxVfOffsetFunc mocks the GetGpcClkMinMaxVfOffset method. + GetGpcClkMinMaxVfOffsetFunc func() (int, int, nvml.Return) + + // GetGpcClkVfOffsetFunc mocks the GetGpcClkVfOffset method. + GetGpcClkVfOffsetFunc func() (int, nvml.Return) + + // GetGpuFabricInfoFunc mocks the GetGpuFabricInfo method. + GetGpuFabricInfoFunc func() (nvml.GpuFabricInfo, nvml.Return) + + // GetGpuInstanceByIdFunc mocks the GetGpuInstanceById method. + GetGpuInstanceByIdFunc func(n int) (nvml.GpuInstance, nvml.Return) + + // GetGpuInstanceIdFunc mocks the GetGpuInstanceId method. + GetGpuInstanceIdFunc func() (int, nvml.Return) + + // GetGpuInstancePossiblePlacementsFunc mocks the GetGpuInstancePossiblePlacements method. + GetGpuInstancePossiblePlacementsFunc func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstancePlacement, nvml.Return) + + // GetGpuInstanceProfileInfoFunc mocks the GetGpuInstanceProfileInfo method. + GetGpuInstanceProfileInfoFunc func(n int) (nvml.GpuInstanceProfileInfo, nvml.Return) + + // GetGpuInstanceProfileInfoVFunc mocks the GetGpuInstanceProfileInfoV method. + GetGpuInstanceProfileInfoVFunc func(n int) nvml.GpuInstanceProfileInfoV + + // GetGpuInstanceRemainingCapacityFunc mocks the GetGpuInstanceRemainingCapacity method. + GetGpuInstanceRemainingCapacityFunc func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (int, nvml.Return) + + // GetGpuInstancesFunc mocks the GetGpuInstances method. + GetGpuInstancesFunc func(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstance, nvml.Return) + + // GetGpuMaxPcieLinkGenerationFunc mocks the GetGpuMaxPcieLinkGeneration method. + GetGpuMaxPcieLinkGenerationFunc func() (int, nvml.Return) + + // GetGpuOperationModeFunc mocks the GetGpuOperationMode method. + GetGpuOperationModeFunc func() (nvml.GpuOperationMode, nvml.GpuOperationMode, nvml.Return) + + // GetGraphicsRunningProcessesFunc mocks the GetGraphicsRunningProcesses method. + GetGraphicsRunningProcessesFunc func() ([]nvml.ProcessInfo, nvml.Return) + + // GetGridLicensableFeaturesFunc mocks the GetGridLicensableFeatures method. + GetGridLicensableFeaturesFunc func() (nvml.GridLicensableFeatures, nvml.Return) + + // GetGspFirmwareModeFunc mocks the GetGspFirmwareMode method. + GetGspFirmwareModeFunc func() (bool, bool, nvml.Return) + + // GetGspFirmwareVersionFunc mocks the GetGspFirmwareVersion method. + GetGspFirmwareVersionFunc func() (string, nvml.Return) + + // GetHostVgpuModeFunc mocks the GetHostVgpuMode method. + GetHostVgpuModeFunc func() (nvml.HostVgpuMode, nvml.Return) + + // GetIndexFunc mocks the GetIndex method. + GetIndexFunc func() (int, nvml.Return) + + // GetInforomConfigurationChecksumFunc mocks the GetInforomConfigurationChecksum method. + GetInforomConfigurationChecksumFunc func() (uint32, nvml.Return) + + // GetInforomImageVersionFunc mocks the GetInforomImageVersion method. + GetInforomImageVersionFunc func() (string, nvml.Return) + + // GetInforomVersionFunc mocks the GetInforomVersion method. + GetInforomVersionFunc func(inforomObject nvml.InforomObject) (string, nvml.Return) + + // GetIrqNumFunc mocks the GetIrqNum method. + GetIrqNumFunc func() (int, nvml.Return) + + // GetMPSComputeRunningProcessesFunc mocks the GetMPSComputeRunningProcesses method. + GetMPSComputeRunningProcessesFunc func() ([]nvml.ProcessInfo, nvml.Return) + + // GetMaxClockInfoFunc mocks the GetMaxClockInfo method. + GetMaxClockInfoFunc func(clockType nvml.ClockType) (uint32, nvml.Return) + + // GetMaxCustomerBoostClockFunc mocks the GetMaxCustomerBoostClock method. + GetMaxCustomerBoostClockFunc func(clockType nvml.ClockType) (uint32, nvml.Return) + + // GetMaxMigDeviceCountFunc mocks the GetMaxMigDeviceCount method. + GetMaxMigDeviceCountFunc func() (int, nvml.Return) + + // GetMaxPcieLinkGenerationFunc mocks the GetMaxPcieLinkGeneration method. + GetMaxPcieLinkGenerationFunc func() (int, nvml.Return) + + // GetMaxPcieLinkWidthFunc mocks the GetMaxPcieLinkWidth method. + GetMaxPcieLinkWidthFunc func() (int, nvml.Return) + + // GetMemClkMinMaxVfOffsetFunc mocks the GetMemClkMinMaxVfOffset method. + GetMemClkMinMaxVfOffsetFunc func() (int, int, nvml.Return) + + // GetMemClkVfOffsetFunc mocks the GetMemClkVfOffset method. + GetMemClkVfOffsetFunc func() (int, nvml.Return) + + // GetMemoryAffinityFunc mocks the GetMemoryAffinity method. + GetMemoryAffinityFunc func(n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) + + // GetMemoryBusWidthFunc mocks the GetMemoryBusWidth method. + GetMemoryBusWidthFunc func() (uint32, nvml.Return) + + // GetMemoryErrorCounterFunc mocks the GetMemoryErrorCounter method. + GetMemoryErrorCounterFunc func(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType, memoryLocation nvml.MemoryLocation) (uint64, nvml.Return) + + // GetMemoryInfoFunc mocks the GetMemoryInfo method. + GetMemoryInfoFunc func() (nvml.Memory, nvml.Return) + + // GetMemoryInfo_v2Func mocks the GetMemoryInfo_v2 method. + GetMemoryInfo_v2Func func() (nvml.Memory_v2, nvml.Return) + + // GetMigDeviceHandleByIndexFunc mocks the GetMigDeviceHandleByIndex method. + GetMigDeviceHandleByIndexFunc func(n int) (nvml.Device, nvml.Return) + + // GetMigModeFunc mocks the GetMigMode method. + GetMigModeFunc func() (int, int, nvml.Return) + + // GetMinMaxClockOfPStateFunc mocks the GetMinMaxClockOfPState method. + GetMinMaxClockOfPStateFunc func(clockType nvml.ClockType, pstates nvml.Pstates) (uint32, uint32, nvml.Return) + + // GetMinMaxFanSpeedFunc mocks the GetMinMaxFanSpeed method. + GetMinMaxFanSpeedFunc func() (int, int, nvml.Return) + + // GetMinorNumberFunc mocks the GetMinorNumber method. + GetMinorNumberFunc func() (int, nvml.Return) + + // GetMultiGpuBoardFunc mocks the GetMultiGpuBoard method. + GetMultiGpuBoardFunc func() (int, nvml.Return) + + // GetNameFunc mocks the GetName method. + GetNameFunc func() (string, nvml.Return) + + // GetNumFansFunc mocks the GetNumFans method. + GetNumFansFunc func() (int, nvml.Return) + + // GetNumGpuCoresFunc mocks the GetNumGpuCores method. + GetNumGpuCoresFunc func() (int, nvml.Return) + + // GetNvLinkCapabilityFunc mocks the GetNvLinkCapability method. + GetNvLinkCapabilityFunc func(n int, nvLinkCapability nvml.NvLinkCapability) (uint32, nvml.Return) + + // GetNvLinkErrorCounterFunc mocks the GetNvLinkErrorCounter method. + GetNvLinkErrorCounterFunc func(n int, nvLinkErrorCounter nvml.NvLinkErrorCounter) (uint64, nvml.Return) + + // GetNvLinkRemoteDeviceTypeFunc mocks the GetNvLinkRemoteDeviceType method. + GetNvLinkRemoteDeviceTypeFunc func(n int) (nvml.IntNvLinkDeviceType, nvml.Return) + + // GetNvLinkRemotePciInfoFunc mocks the GetNvLinkRemotePciInfo method. + GetNvLinkRemotePciInfoFunc func(n int) (nvml.PciInfo, nvml.Return) + + // GetNvLinkStateFunc mocks the GetNvLinkState method. + GetNvLinkStateFunc func(n int) (nvml.EnableState, nvml.Return) + + // GetNvLinkUtilizationControlFunc mocks the GetNvLinkUtilizationControl method. + GetNvLinkUtilizationControlFunc func(n1 int, n2 int) (nvml.NvLinkUtilizationControl, nvml.Return) + + // GetNvLinkUtilizationCounterFunc mocks the GetNvLinkUtilizationCounter method. + GetNvLinkUtilizationCounterFunc func(n1 int, n2 int) (uint64, uint64, nvml.Return) + + // GetNvLinkVersionFunc mocks the GetNvLinkVersion method. + GetNvLinkVersionFunc func(n int) (uint32, nvml.Return) + + // GetP2PStatusFunc mocks the GetP2PStatus method. + GetP2PStatusFunc func(device nvml.Device, gpuP2PCapsIndex nvml.GpuP2PCapsIndex) (nvml.GpuP2PStatus, nvml.Return) + + // GetPciInfoFunc mocks the GetPciInfo method. + GetPciInfoFunc func() (nvml.PciInfo, nvml.Return) + + // GetPcieLinkMaxSpeedFunc mocks the GetPcieLinkMaxSpeed method. + GetPcieLinkMaxSpeedFunc func() (uint32, nvml.Return) + + // GetPcieReplayCounterFunc mocks the GetPcieReplayCounter method. + GetPcieReplayCounterFunc func() (int, nvml.Return) + + // GetPcieSpeedFunc mocks the GetPcieSpeed method. + GetPcieSpeedFunc func() (int, nvml.Return) + + // GetPcieThroughputFunc mocks the GetPcieThroughput method. + GetPcieThroughputFunc func(pcieUtilCounter nvml.PcieUtilCounter) (uint32, nvml.Return) + + // GetPerformanceStateFunc mocks the GetPerformanceState method. + GetPerformanceStateFunc func() (nvml.Pstates, nvml.Return) + + // GetPersistenceModeFunc mocks the GetPersistenceMode method. + GetPersistenceModeFunc func() (nvml.EnableState, nvml.Return) + + // GetPgpuMetadataStringFunc mocks the GetPgpuMetadataString method. + GetPgpuMetadataStringFunc func() (string, nvml.Return) + + // GetPowerManagementDefaultLimitFunc mocks the GetPowerManagementDefaultLimit method. + GetPowerManagementDefaultLimitFunc func() (uint32, nvml.Return) + + // GetPowerManagementLimitFunc mocks the GetPowerManagementLimit method. + GetPowerManagementLimitFunc func() (uint32, nvml.Return) + + // GetPowerManagementLimitConstraintsFunc mocks the GetPowerManagementLimitConstraints method. + GetPowerManagementLimitConstraintsFunc func() (uint32, uint32, nvml.Return) + + // GetPowerManagementModeFunc mocks the GetPowerManagementMode method. + GetPowerManagementModeFunc func() (nvml.EnableState, nvml.Return) + + // GetPowerSourceFunc mocks the GetPowerSource method. + GetPowerSourceFunc func() (nvml.PowerSource, nvml.Return) + + // GetPowerStateFunc mocks the GetPowerState method. + GetPowerStateFunc func() (nvml.Pstates, nvml.Return) + + // GetPowerUsageFunc mocks the GetPowerUsage method. + GetPowerUsageFunc func() (uint32, nvml.Return) + + // GetProcessUtilizationFunc mocks the GetProcessUtilization method. + GetProcessUtilizationFunc func(v uint64) ([]nvml.ProcessUtilizationSample, nvml.Return) + + // GetRemappedRowsFunc mocks the GetRemappedRows method. + GetRemappedRowsFunc func() (int, int, bool, bool, nvml.Return) + + // GetRetiredPagesFunc mocks the GetRetiredPages method. + GetRetiredPagesFunc func(pageRetirementCause nvml.PageRetirementCause) ([]uint64, nvml.Return) + + // GetRetiredPagesPendingStatusFunc mocks the GetRetiredPagesPendingStatus method. + GetRetiredPagesPendingStatusFunc func() (nvml.EnableState, nvml.Return) + + // GetRetiredPages_v2Func mocks the GetRetiredPages_v2 method. + GetRetiredPages_v2Func func(pageRetirementCause nvml.PageRetirementCause) ([]uint64, []uint64, nvml.Return) + + // GetRowRemapperHistogramFunc mocks the GetRowRemapperHistogram method. + GetRowRemapperHistogramFunc func() (nvml.RowRemapperHistogramValues, nvml.Return) + + // GetSamplesFunc mocks the GetSamples method. + GetSamplesFunc func(samplingType nvml.SamplingType, v uint64) (nvml.ValueType, []nvml.Sample, nvml.Return) + + // GetSerialFunc mocks the GetSerial method. + GetSerialFunc func() (string, nvml.Return) + + // GetSupportedClocksThrottleReasonsFunc mocks the GetSupportedClocksThrottleReasons method. + GetSupportedClocksThrottleReasonsFunc func() (uint64, nvml.Return) + + // GetSupportedEventTypesFunc mocks the GetSupportedEventTypes method. + GetSupportedEventTypesFunc func() (uint64, nvml.Return) + + // GetSupportedGraphicsClocksFunc mocks the GetSupportedGraphicsClocks method. + GetSupportedGraphicsClocksFunc func(n int) (int, uint32, nvml.Return) + + // GetSupportedMemoryClocksFunc mocks the GetSupportedMemoryClocks method. + GetSupportedMemoryClocksFunc func() (int, uint32, nvml.Return) + + // GetSupportedPerformanceStatesFunc mocks the GetSupportedPerformanceStates method. + GetSupportedPerformanceStatesFunc func() ([]nvml.Pstates, nvml.Return) + + // GetSupportedVgpusFunc mocks the GetSupportedVgpus method. + GetSupportedVgpusFunc func() ([]nvml.VgpuTypeId, nvml.Return) + + // GetTargetFanSpeedFunc mocks the GetTargetFanSpeed method. + GetTargetFanSpeedFunc func(n int) (int, nvml.Return) + + // GetTemperatureFunc mocks the GetTemperature method. + GetTemperatureFunc func(temperatureSensors nvml.TemperatureSensors) (uint32, nvml.Return) + + // GetTemperatureThresholdFunc mocks the GetTemperatureThreshold method. + GetTemperatureThresholdFunc func(temperatureThresholds nvml.TemperatureThresholds) (uint32, nvml.Return) + + // GetThermalSettingsFunc mocks the GetThermalSettings method. + GetThermalSettingsFunc func(v uint32) (nvml.GpuThermalSettings, nvml.Return) + + // GetTopologyCommonAncestorFunc mocks the GetTopologyCommonAncestor method. + GetTopologyCommonAncestorFunc func(device nvml.Device) (nvml.GpuTopologyLevel, nvml.Return) + + // GetTopologyNearestGpusFunc mocks the GetTopologyNearestGpus method. + GetTopologyNearestGpusFunc func(gpuTopologyLevel nvml.GpuTopologyLevel) ([]nvml.Device, nvml.Return) + + // GetTotalEccErrorsFunc mocks the GetTotalEccErrors method. + GetTotalEccErrorsFunc func(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (uint64, nvml.Return) + + // GetTotalEnergyConsumptionFunc mocks the GetTotalEnergyConsumption method. + GetTotalEnergyConsumptionFunc func() (uint64, nvml.Return) + + // GetUUIDFunc mocks the GetUUID method. + GetUUIDFunc func() (string, nvml.Return) + + // GetUtilizationRatesFunc mocks the GetUtilizationRates method. + GetUtilizationRatesFunc func() (nvml.Utilization, nvml.Return) + + // GetVbiosVersionFunc mocks the GetVbiosVersion method. + GetVbiosVersionFunc func() (string, nvml.Return) + + // GetVgpuCapabilitiesFunc mocks the GetVgpuCapabilities method. + GetVgpuCapabilitiesFunc func(deviceVgpuCapability nvml.DeviceVgpuCapability) (bool, nvml.Return) + + // GetVgpuMetadataFunc mocks the GetVgpuMetadata method. + GetVgpuMetadataFunc func() (nvml.VgpuPgpuMetadata, nvml.Return) + + // GetVgpuProcessUtilizationFunc mocks the GetVgpuProcessUtilization method. + GetVgpuProcessUtilizationFunc func(v uint64) ([]nvml.VgpuProcessUtilizationSample, nvml.Return) + + // GetVgpuSchedulerCapabilitiesFunc mocks the GetVgpuSchedulerCapabilities method. + GetVgpuSchedulerCapabilitiesFunc func() (nvml.VgpuSchedulerCapabilities, nvml.Return) + + // GetVgpuSchedulerLogFunc mocks the GetVgpuSchedulerLog method. + GetVgpuSchedulerLogFunc func() (nvml.VgpuSchedulerLog, nvml.Return) + + // GetVgpuSchedulerStateFunc mocks the GetVgpuSchedulerState method. + GetVgpuSchedulerStateFunc func() (nvml.VgpuSchedulerGetState, nvml.Return) + + // GetVgpuUtilizationFunc mocks the GetVgpuUtilization method. + GetVgpuUtilizationFunc func(v uint64) (nvml.ValueType, []nvml.VgpuInstanceUtilizationSample, nvml.Return) + + // GetViolationStatusFunc mocks the GetViolationStatus method. + GetViolationStatusFunc func(perfPolicyType nvml.PerfPolicyType) (nvml.ViolationTime, nvml.Return) + + // GetVirtualizationModeFunc mocks the GetVirtualizationMode method. + GetVirtualizationModeFunc func() (nvml.GpuVirtualizationMode, nvml.Return) + + // GpmMigSampleGetFunc mocks the GpmMigSampleGet method. + GpmMigSampleGetFunc func(n int, gpmSample nvml.GpmSample) nvml.Return + + // GpmQueryDeviceSupportFunc mocks the GpmQueryDeviceSupport method. + GpmQueryDeviceSupportFunc func() (nvml.GpmSupport, nvml.Return) + + // GpmQueryDeviceSupportVFunc mocks the GpmQueryDeviceSupportV method. + GpmQueryDeviceSupportVFunc func() nvml.GpmSupportV + + // GpmSampleGetFunc mocks the GpmSampleGet method. + GpmSampleGetFunc func(gpmSample nvml.GpmSample) nvml.Return + + // IsMigDeviceHandleFunc mocks the IsMigDeviceHandle method. + IsMigDeviceHandleFunc func() (bool, nvml.Return) + + // OnSameBoardFunc mocks the OnSameBoard method. + OnSameBoardFunc func(device nvml.Device) (int, nvml.Return) + + // RegisterEventsFunc mocks the RegisterEvents method. + RegisterEventsFunc func(v uint64, eventSet nvml.EventSet) nvml.Return + + // ResetApplicationsClocksFunc mocks the ResetApplicationsClocks method. + ResetApplicationsClocksFunc func() nvml.Return + + // ResetGpuLockedClocksFunc mocks the ResetGpuLockedClocks method. + ResetGpuLockedClocksFunc func() nvml.Return + + // ResetMemoryLockedClocksFunc mocks the ResetMemoryLockedClocks method. + ResetMemoryLockedClocksFunc func() nvml.Return + + // ResetNvLinkErrorCountersFunc mocks the ResetNvLinkErrorCounters method. + ResetNvLinkErrorCountersFunc func(n int) nvml.Return + + // ResetNvLinkUtilizationCounterFunc mocks the ResetNvLinkUtilizationCounter method. + ResetNvLinkUtilizationCounterFunc func(n1 int, n2 int) nvml.Return + + // SetAPIRestrictionFunc mocks the SetAPIRestriction method. + SetAPIRestrictionFunc func(restrictedAPI nvml.RestrictedAPI, enableState nvml.EnableState) nvml.Return + + // SetAccountingModeFunc mocks the SetAccountingMode method. + SetAccountingModeFunc func(enableState nvml.EnableState) nvml.Return + + // SetApplicationsClocksFunc mocks the SetApplicationsClocks method. + SetApplicationsClocksFunc func(v1 uint32, v2 uint32) nvml.Return + + // SetAutoBoostedClocksEnabledFunc mocks the SetAutoBoostedClocksEnabled method. + SetAutoBoostedClocksEnabledFunc func(enableState nvml.EnableState) nvml.Return + + // SetComputeModeFunc mocks the SetComputeMode method. + SetComputeModeFunc func(computeMode nvml.ComputeMode) nvml.Return + + // SetCpuAffinityFunc mocks the SetCpuAffinity method. + SetCpuAffinityFunc func() nvml.Return + + // SetDefaultAutoBoostedClocksEnabledFunc mocks the SetDefaultAutoBoostedClocksEnabled method. + SetDefaultAutoBoostedClocksEnabledFunc func(enableState nvml.EnableState, v uint32) nvml.Return + + // SetDefaultFanSpeed_v2Func mocks the SetDefaultFanSpeed_v2 method. + SetDefaultFanSpeed_v2Func func(n int) nvml.Return + + // SetDriverModelFunc mocks the SetDriverModel method. + SetDriverModelFunc func(driverModel nvml.DriverModel, v uint32) nvml.Return + + // SetEccModeFunc mocks the SetEccMode method. + SetEccModeFunc func(enableState nvml.EnableState) nvml.Return + + // SetFanControlPolicyFunc mocks the SetFanControlPolicy method. + SetFanControlPolicyFunc func(n int, fanControlPolicy nvml.FanControlPolicy) nvml.Return + + // SetFanSpeed_v2Func mocks the SetFanSpeed_v2 method. + SetFanSpeed_v2Func func(n1 int, n2 int) nvml.Return + + // SetGpcClkVfOffsetFunc mocks the SetGpcClkVfOffset method. + SetGpcClkVfOffsetFunc func(n int) nvml.Return + + // SetGpuLockedClocksFunc mocks the SetGpuLockedClocks method. + SetGpuLockedClocksFunc func(v1 uint32, v2 uint32) nvml.Return + + // SetGpuOperationModeFunc mocks the SetGpuOperationMode method. + SetGpuOperationModeFunc func(gpuOperationMode nvml.GpuOperationMode) nvml.Return + + // SetMemClkVfOffsetFunc mocks the SetMemClkVfOffset method. + SetMemClkVfOffsetFunc func(n int) nvml.Return + + // SetMemoryLockedClocksFunc mocks the SetMemoryLockedClocks method. + SetMemoryLockedClocksFunc func(v1 uint32, v2 uint32) nvml.Return + + // SetMigModeFunc mocks the SetMigMode method. + SetMigModeFunc func(n int) (nvml.Return, nvml.Return) + + // SetNvLinkDeviceLowPowerThresholdFunc mocks the SetNvLinkDeviceLowPowerThreshold method. + SetNvLinkDeviceLowPowerThresholdFunc func(nvLinkPowerThres *nvml.NvLinkPowerThres) nvml.Return + + // SetNvLinkUtilizationControlFunc mocks the SetNvLinkUtilizationControl method. + SetNvLinkUtilizationControlFunc func(n1 int, n2 int, nvLinkUtilizationControl *nvml.NvLinkUtilizationControl, b bool) nvml.Return + + // SetPersistenceModeFunc mocks the SetPersistenceMode method. + SetPersistenceModeFunc func(enableState nvml.EnableState) nvml.Return + + // SetPowerManagementLimitFunc mocks the SetPowerManagementLimit method. + SetPowerManagementLimitFunc func(v uint32) nvml.Return + + // SetTemperatureThresholdFunc mocks the SetTemperatureThreshold method. + SetTemperatureThresholdFunc func(temperatureThresholds nvml.TemperatureThresholds, n int) nvml.Return + + // SetVgpuSchedulerStateFunc mocks the SetVgpuSchedulerState method. + SetVgpuSchedulerStateFunc func(vgpuSchedulerSetState *nvml.VgpuSchedulerSetState) nvml.Return + + // SetVirtualizationModeFunc mocks the SetVirtualizationMode method. + SetVirtualizationModeFunc func(gpuVirtualizationMode nvml.GpuVirtualizationMode) nvml.Return + + // ValidateInforomFunc mocks the ValidateInforom method. + ValidateInforomFunc func() nvml.Return + + // VgpuTypeGetMaxInstancesFunc mocks the VgpuTypeGetMaxInstances method. + VgpuTypeGetMaxInstancesFunc func(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) + + // calls tracks calls to the methods. + calls struct { + // CcuGetStreamState holds details about calls to the CcuGetStreamState method. + CcuGetStreamState []struct { + } + // CcuSetStreamState holds details about calls to the CcuSetStreamState method. + CcuSetStreamState []struct { + // N is the n argument value. + N int + } + // ClearAccountingPids holds details about calls to the ClearAccountingPids method. + ClearAccountingPids []struct { + } + // ClearCpuAffinity holds details about calls to the ClearCpuAffinity method. + ClearCpuAffinity []struct { + } + // ClearEccErrorCounts holds details about calls to the ClearEccErrorCounts method. + ClearEccErrorCounts []struct { + // EccCounterType is the eccCounterType argument value. + EccCounterType nvml.EccCounterType + } + // ClearFieldValues holds details about calls to the ClearFieldValues method. + ClearFieldValues []struct { + // FieldValues is the fieldValues argument value. + FieldValues []nvml.FieldValue + } + // CreateGpuInstance holds details about calls to the CreateGpuInstance method. + CreateGpuInstance []struct { + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + // CreateGpuInstanceWithPlacement holds details about calls to the CreateGpuInstanceWithPlacement method. + CreateGpuInstanceWithPlacement []struct { + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + // GpuInstancePlacement is the gpuInstancePlacement argument value. + GpuInstancePlacement *nvml.GpuInstancePlacement + } + // FreezeNvLinkUtilizationCounter holds details about calls to the FreezeNvLinkUtilizationCounter method. + FreezeNvLinkUtilizationCounter []struct { + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // GetAPIRestriction holds details about calls to the GetAPIRestriction method. + GetAPIRestriction []struct { + // RestrictedAPI is the restrictedAPI argument value. + RestrictedAPI nvml.RestrictedAPI + } + // GetAccountingBufferSize holds details about calls to the GetAccountingBufferSize method. + GetAccountingBufferSize []struct { + } + // GetAccountingMode holds details about calls to the GetAccountingMode method. + GetAccountingMode []struct { + } + // GetAccountingPids holds details about calls to the GetAccountingPids method. + GetAccountingPids []struct { + } + // GetAccountingStats holds details about calls to the GetAccountingStats method. + GetAccountingStats []struct { + // V is the v argument value. + V uint32 + } + // GetActiveVgpus holds details about calls to the GetActiveVgpus method. + GetActiveVgpus []struct { + } + // GetAdaptiveClockInfoStatus holds details about calls to the GetAdaptiveClockInfoStatus method. + GetAdaptiveClockInfoStatus []struct { + } + // GetApplicationsClock holds details about calls to the GetApplicationsClock method. + GetApplicationsClock []struct { + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // GetArchitecture holds details about calls to the GetArchitecture method. + GetArchitecture []struct { + } + // GetAttributes holds details about calls to the GetAttributes method. + GetAttributes []struct { + } + // GetAutoBoostedClocksEnabled holds details about calls to the GetAutoBoostedClocksEnabled method. + GetAutoBoostedClocksEnabled []struct { + } + // GetBAR1MemoryInfo holds details about calls to the GetBAR1MemoryInfo method. + GetBAR1MemoryInfo []struct { + } + // GetBoardId holds details about calls to the GetBoardId method. + GetBoardId []struct { + } + // GetBoardPartNumber holds details about calls to the GetBoardPartNumber method. + GetBoardPartNumber []struct { + } + // GetBrand holds details about calls to the GetBrand method. + GetBrand []struct { + } + // GetBridgeChipInfo holds details about calls to the GetBridgeChipInfo method. + GetBridgeChipInfo []struct { + } + // GetBusType holds details about calls to the GetBusType method. + GetBusType []struct { + } + // GetClkMonStatus holds details about calls to the GetClkMonStatus method. + GetClkMonStatus []struct { + } + // GetClock holds details about calls to the GetClock method. + GetClock []struct { + // ClockType is the clockType argument value. + ClockType nvml.ClockType + // ClockId is the clockId argument value. + ClockId nvml.ClockId + } + // GetClockInfo holds details about calls to the GetClockInfo method. + GetClockInfo []struct { + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // GetComputeInstanceId holds details about calls to the GetComputeInstanceId method. + GetComputeInstanceId []struct { + } + // GetComputeMode holds details about calls to the GetComputeMode method. + GetComputeMode []struct { + } + // GetComputeRunningProcesses holds details about calls to the GetComputeRunningProcesses method. + GetComputeRunningProcesses []struct { + } + // GetCpuAffinity holds details about calls to the GetCpuAffinity method. + GetCpuAffinity []struct { + // N is the n argument value. + N int + } + // GetCpuAffinityWithinScope holds details about calls to the GetCpuAffinityWithinScope method. + GetCpuAffinityWithinScope []struct { + // N is the n argument value. + N int + // AffinityScope is the affinityScope argument value. + AffinityScope nvml.AffinityScope + } + // GetCreatableVgpus holds details about calls to the GetCreatableVgpus method. + GetCreatableVgpus []struct { + } + // GetCudaComputeCapability holds details about calls to the GetCudaComputeCapability method. + GetCudaComputeCapability []struct { + } + // GetCurrPcieLinkGeneration holds details about calls to the GetCurrPcieLinkGeneration method. + GetCurrPcieLinkGeneration []struct { + } + // GetCurrPcieLinkWidth holds details about calls to the GetCurrPcieLinkWidth method. + GetCurrPcieLinkWidth []struct { + } + // GetCurrentClocksThrottleReasons holds details about calls to the GetCurrentClocksThrottleReasons method. + GetCurrentClocksThrottleReasons []struct { + } + // GetDecoderUtilization holds details about calls to the GetDecoderUtilization method. + GetDecoderUtilization []struct { + } + // GetDefaultApplicationsClock holds details about calls to the GetDefaultApplicationsClock method. + GetDefaultApplicationsClock []struct { + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // GetDefaultEccMode holds details about calls to the GetDefaultEccMode method. + GetDefaultEccMode []struct { + } + // GetDetailedEccErrors holds details about calls to the GetDetailedEccErrors method. + GetDetailedEccErrors []struct { + // MemoryErrorType is the memoryErrorType argument value. + MemoryErrorType nvml.MemoryErrorType + // EccCounterType is the eccCounterType argument value. + EccCounterType nvml.EccCounterType + } + // GetDeviceHandleFromMigDeviceHandle holds details about calls to the GetDeviceHandleFromMigDeviceHandle method. + GetDeviceHandleFromMigDeviceHandle []struct { + } + // GetDisplayActive holds details about calls to the GetDisplayActive method. + GetDisplayActive []struct { + } + // GetDisplayMode holds details about calls to the GetDisplayMode method. + GetDisplayMode []struct { + } + // GetDriverModel holds details about calls to the GetDriverModel method. + GetDriverModel []struct { + } + // GetDynamicPstatesInfo holds details about calls to the GetDynamicPstatesInfo method. + GetDynamicPstatesInfo []struct { + } + // GetEccMode holds details about calls to the GetEccMode method. + GetEccMode []struct { + } + // GetEncoderCapacity holds details about calls to the GetEncoderCapacity method. + GetEncoderCapacity []struct { + // EncoderType is the encoderType argument value. + EncoderType nvml.EncoderType + } + // GetEncoderSessions holds details about calls to the GetEncoderSessions method. + GetEncoderSessions []struct { + } + // GetEncoderStats holds details about calls to the GetEncoderStats method. + GetEncoderStats []struct { + } + // GetEncoderUtilization holds details about calls to the GetEncoderUtilization method. + GetEncoderUtilization []struct { + } + // GetEnforcedPowerLimit holds details about calls to the GetEnforcedPowerLimit method. + GetEnforcedPowerLimit []struct { + } + // GetFBCSessions holds details about calls to the GetFBCSessions method. + GetFBCSessions []struct { + } + // GetFBCStats holds details about calls to the GetFBCStats method. + GetFBCStats []struct { + } + // GetFanControlPolicy_v2 holds details about calls to the GetFanControlPolicy_v2 method. + GetFanControlPolicy_v2 []struct { + // N is the n argument value. + N int + } + // GetFanSpeed holds details about calls to the GetFanSpeed method. + GetFanSpeed []struct { + } + // GetFanSpeed_v2 holds details about calls to the GetFanSpeed_v2 method. + GetFanSpeed_v2 []struct { + // N is the n argument value. + N int + } + // GetFieldValues holds details about calls to the GetFieldValues method. + GetFieldValues []struct { + // FieldValues is the fieldValues argument value. + FieldValues []nvml.FieldValue + } + // GetGpcClkMinMaxVfOffset holds details about calls to the GetGpcClkMinMaxVfOffset method. + GetGpcClkMinMaxVfOffset []struct { + } + // GetGpcClkVfOffset holds details about calls to the GetGpcClkVfOffset method. + GetGpcClkVfOffset []struct { + } + // GetGpuFabricInfo holds details about calls to the GetGpuFabricInfo method. + GetGpuFabricInfo []struct { + } + // GetGpuInstanceById holds details about calls to the GetGpuInstanceById method. + GetGpuInstanceById []struct { + // N is the n argument value. + N int + } + // GetGpuInstanceId holds details about calls to the GetGpuInstanceId method. + GetGpuInstanceId []struct { + } + // GetGpuInstancePossiblePlacements holds details about calls to the GetGpuInstancePossiblePlacements method. + GetGpuInstancePossiblePlacements []struct { + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + // GetGpuInstanceProfileInfo holds details about calls to the GetGpuInstanceProfileInfo method. + GetGpuInstanceProfileInfo []struct { + // N is the n argument value. + N int + } + // GetGpuInstanceProfileInfoV holds details about calls to the GetGpuInstanceProfileInfoV method. + GetGpuInstanceProfileInfoV []struct { + // N is the n argument value. + N int + } + // GetGpuInstanceRemainingCapacity holds details about calls to the GetGpuInstanceRemainingCapacity method. + GetGpuInstanceRemainingCapacity []struct { + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + // GetGpuInstances holds details about calls to the GetGpuInstances method. + GetGpuInstances []struct { + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + // GetGpuMaxPcieLinkGeneration holds details about calls to the GetGpuMaxPcieLinkGeneration method. + GetGpuMaxPcieLinkGeneration []struct { + } + // GetGpuOperationMode holds details about calls to the GetGpuOperationMode method. + GetGpuOperationMode []struct { + } + // GetGraphicsRunningProcesses holds details about calls to the GetGraphicsRunningProcesses method. + GetGraphicsRunningProcesses []struct { + } + // GetGridLicensableFeatures holds details about calls to the GetGridLicensableFeatures method. + GetGridLicensableFeatures []struct { + } + // GetGspFirmwareMode holds details about calls to the GetGspFirmwareMode method. + GetGspFirmwareMode []struct { + } + // GetGspFirmwareVersion holds details about calls to the GetGspFirmwareVersion method. + GetGspFirmwareVersion []struct { + } + // GetHostVgpuMode holds details about calls to the GetHostVgpuMode method. + GetHostVgpuMode []struct { + } + // GetIndex holds details about calls to the GetIndex method. + GetIndex []struct { + } + // GetInforomConfigurationChecksum holds details about calls to the GetInforomConfigurationChecksum method. + GetInforomConfigurationChecksum []struct { + } + // GetInforomImageVersion holds details about calls to the GetInforomImageVersion method. + GetInforomImageVersion []struct { + } + // GetInforomVersion holds details about calls to the GetInforomVersion method. + GetInforomVersion []struct { + // InforomObject is the inforomObject argument value. + InforomObject nvml.InforomObject + } + // GetIrqNum holds details about calls to the GetIrqNum method. + GetIrqNum []struct { + } + // GetMPSComputeRunningProcesses holds details about calls to the GetMPSComputeRunningProcesses method. + GetMPSComputeRunningProcesses []struct { + } + // GetMaxClockInfo holds details about calls to the GetMaxClockInfo method. + GetMaxClockInfo []struct { + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // GetMaxCustomerBoostClock holds details about calls to the GetMaxCustomerBoostClock method. + GetMaxCustomerBoostClock []struct { + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // GetMaxMigDeviceCount holds details about calls to the GetMaxMigDeviceCount method. + GetMaxMigDeviceCount []struct { + } + // GetMaxPcieLinkGeneration holds details about calls to the GetMaxPcieLinkGeneration method. + GetMaxPcieLinkGeneration []struct { + } + // GetMaxPcieLinkWidth holds details about calls to the GetMaxPcieLinkWidth method. + GetMaxPcieLinkWidth []struct { + } + // GetMemClkMinMaxVfOffset holds details about calls to the GetMemClkMinMaxVfOffset method. + GetMemClkMinMaxVfOffset []struct { + } + // GetMemClkVfOffset holds details about calls to the GetMemClkVfOffset method. + GetMemClkVfOffset []struct { + } + // GetMemoryAffinity holds details about calls to the GetMemoryAffinity method. + GetMemoryAffinity []struct { + // N is the n argument value. + N int + // AffinityScope is the affinityScope argument value. + AffinityScope nvml.AffinityScope + } + // GetMemoryBusWidth holds details about calls to the GetMemoryBusWidth method. + GetMemoryBusWidth []struct { + } + // GetMemoryErrorCounter holds details about calls to the GetMemoryErrorCounter method. + GetMemoryErrorCounter []struct { + // MemoryErrorType is the memoryErrorType argument value. + MemoryErrorType nvml.MemoryErrorType + // EccCounterType is the eccCounterType argument value. + EccCounterType nvml.EccCounterType + // MemoryLocation is the memoryLocation argument value. + MemoryLocation nvml.MemoryLocation + } + // GetMemoryInfo holds details about calls to the GetMemoryInfo method. + GetMemoryInfo []struct { + } + // GetMemoryInfo_v2 holds details about calls to the GetMemoryInfo_v2 method. + GetMemoryInfo_v2 []struct { + } + // GetMigDeviceHandleByIndex holds details about calls to the GetMigDeviceHandleByIndex method. + GetMigDeviceHandleByIndex []struct { + // N is the n argument value. + N int + } + // GetMigMode holds details about calls to the GetMigMode method. + GetMigMode []struct { + } + // GetMinMaxClockOfPState holds details about calls to the GetMinMaxClockOfPState method. + GetMinMaxClockOfPState []struct { + // ClockType is the clockType argument value. + ClockType nvml.ClockType + // Pstates is the pstates argument value. + Pstates nvml.Pstates + } + // GetMinMaxFanSpeed holds details about calls to the GetMinMaxFanSpeed method. + GetMinMaxFanSpeed []struct { + } + // GetMinorNumber holds details about calls to the GetMinorNumber method. + GetMinorNumber []struct { + } + // GetMultiGpuBoard holds details about calls to the GetMultiGpuBoard method. + GetMultiGpuBoard []struct { + } + // GetName holds details about calls to the GetName method. + GetName []struct { + } + // GetNumFans holds details about calls to the GetNumFans method. + GetNumFans []struct { + } + // GetNumGpuCores holds details about calls to the GetNumGpuCores method. + GetNumGpuCores []struct { + } + // GetNvLinkCapability holds details about calls to the GetNvLinkCapability method. + GetNvLinkCapability []struct { + // N is the n argument value. + N int + // NvLinkCapability is the nvLinkCapability argument value. + NvLinkCapability nvml.NvLinkCapability + } + // GetNvLinkErrorCounter holds details about calls to the GetNvLinkErrorCounter method. + GetNvLinkErrorCounter []struct { + // N is the n argument value. + N int + // NvLinkErrorCounter is the nvLinkErrorCounter argument value. + NvLinkErrorCounter nvml.NvLinkErrorCounter + } + // GetNvLinkRemoteDeviceType holds details about calls to the GetNvLinkRemoteDeviceType method. + GetNvLinkRemoteDeviceType []struct { + // N is the n argument value. + N int + } + // GetNvLinkRemotePciInfo holds details about calls to the GetNvLinkRemotePciInfo method. + GetNvLinkRemotePciInfo []struct { + // N is the n argument value. + N int + } + // GetNvLinkState holds details about calls to the GetNvLinkState method. + GetNvLinkState []struct { + // N is the n argument value. + N int + } + // GetNvLinkUtilizationControl holds details about calls to the GetNvLinkUtilizationControl method. + GetNvLinkUtilizationControl []struct { + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // GetNvLinkUtilizationCounter holds details about calls to the GetNvLinkUtilizationCounter method. + GetNvLinkUtilizationCounter []struct { + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // GetNvLinkVersion holds details about calls to the GetNvLinkVersion method. + GetNvLinkVersion []struct { + // N is the n argument value. + N int + } + // GetP2PStatus holds details about calls to the GetP2PStatus method. + GetP2PStatus []struct { + // Device is the device argument value. + Device nvml.Device + // GpuP2PCapsIndex is the gpuP2PCapsIndex argument value. + GpuP2PCapsIndex nvml.GpuP2PCapsIndex + } + // GetPciInfo holds details about calls to the GetPciInfo method. + GetPciInfo []struct { + } + // GetPcieLinkMaxSpeed holds details about calls to the GetPcieLinkMaxSpeed method. + GetPcieLinkMaxSpeed []struct { + } + // GetPcieReplayCounter holds details about calls to the GetPcieReplayCounter method. + GetPcieReplayCounter []struct { + } + // GetPcieSpeed holds details about calls to the GetPcieSpeed method. + GetPcieSpeed []struct { + } + // GetPcieThroughput holds details about calls to the GetPcieThroughput method. + GetPcieThroughput []struct { + // PcieUtilCounter is the pcieUtilCounter argument value. + PcieUtilCounter nvml.PcieUtilCounter + } + // GetPerformanceState holds details about calls to the GetPerformanceState method. + GetPerformanceState []struct { + } + // GetPersistenceMode holds details about calls to the GetPersistenceMode method. + GetPersistenceMode []struct { + } + // GetPgpuMetadataString holds details about calls to the GetPgpuMetadataString method. + GetPgpuMetadataString []struct { + } + // GetPowerManagementDefaultLimit holds details about calls to the GetPowerManagementDefaultLimit method. + GetPowerManagementDefaultLimit []struct { + } + // GetPowerManagementLimit holds details about calls to the GetPowerManagementLimit method. + GetPowerManagementLimit []struct { + } + // GetPowerManagementLimitConstraints holds details about calls to the GetPowerManagementLimitConstraints method. + GetPowerManagementLimitConstraints []struct { + } + // GetPowerManagementMode holds details about calls to the GetPowerManagementMode method. + GetPowerManagementMode []struct { + } + // GetPowerSource holds details about calls to the GetPowerSource method. + GetPowerSource []struct { + } + // GetPowerState holds details about calls to the GetPowerState method. + GetPowerState []struct { + } + // GetPowerUsage holds details about calls to the GetPowerUsage method. + GetPowerUsage []struct { + } + // GetProcessUtilization holds details about calls to the GetProcessUtilization method. + GetProcessUtilization []struct { + // V is the v argument value. + V uint64 + } + // GetRemappedRows holds details about calls to the GetRemappedRows method. + GetRemappedRows []struct { + } + // GetRetiredPages holds details about calls to the GetRetiredPages method. + GetRetiredPages []struct { + // PageRetirementCause is the pageRetirementCause argument value. + PageRetirementCause nvml.PageRetirementCause + } + // GetRetiredPagesPendingStatus holds details about calls to the GetRetiredPagesPendingStatus method. + GetRetiredPagesPendingStatus []struct { + } + // GetRetiredPages_v2 holds details about calls to the GetRetiredPages_v2 method. + GetRetiredPages_v2 []struct { + // PageRetirementCause is the pageRetirementCause argument value. + PageRetirementCause nvml.PageRetirementCause + } + // GetRowRemapperHistogram holds details about calls to the GetRowRemapperHistogram method. + GetRowRemapperHistogram []struct { + } + // GetSamples holds details about calls to the GetSamples method. + GetSamples []struct { + // SamplingType is the samplingType argument value. + SamplingType nvml.SamplingType + // V is the v argument value. + V uint64 + } + // GetSerial holds details about calls to the GetSerial method. + GetSerial []struct { + } + // GetSupportedClocksThrottleReasons holds details about calls to the GetSupportedClocksThrottleReasons method. + GetSupportedClocksThrottleReasons []struct { + } + // GetSupportedEventTypes holds details about calls to the GetSupportedEventTypes method. + GetSupportedEventTypes []struct { + } + // GetSupportedGraphicsClocks holds details about calls to the GetSupportedGraphicsClocks method. + GetSupportedGraphicsClocks []struct { + // N is the n argument value. + N int + } + // GetSupportedMemoryClocks holds details about calls to the GetSupportedMemoryClocks method. + GetSupportedMemoryClocks []struct { + } + // GetSupportedPerformanceStates holds details about calls to the GetSupportedPerformanceStates method. + GetSupportedPerformanceStates []struct { + } + // GetSupportedVgpus holds details about calls to the GetSupportedVgpus method. + GetSupportedVgpus []struct { + } + // GetTargetFanSpeed holds details about calls to the GetTargetFanSpeed method. + GetTargetFanSpeed []struct { + // N is the n argument value. + N int + } + // GetTemperature holds details about calls to the GetTemperature method. + GetTemperature []struct { + // TemperatureSensors is the temperatureSensors argument value. + TemperatureSensors nvml.TemperatureSensors + } + // GetTemperatureThreshold holds details about calls to the GetTemperatureThreshold method. + GetTemperatureThreshold []struct { + // TemperatureThresholds is the temperatureThresholds argument value. + TemperatureThresholds nvml.TemperatureThresholds + } + // GetThermalSettings holds details about calls to the GetThermalSettings method. + GetThermalSettings []struct { + // V is the v argument value. + V uint32 + } + // GetTopologyCommonAncestor holds details about calls to the GetTopologyCommonAncestor method. + GetTopologyCommonAncestor []struct { + // Device is the device argument value. + Device nvml.Device + } + // GetTopologyNearestGpus holds details about calls to the GetTopologyNearestGpus method. + GetTopologyNearestGpus []struct { + // GpuTopologyLevel is the gpuTopologyLevel argument value. + GpuTopologyLevel nvml.GpuTopologyLevel + } + // GetTotalEccErrors holds details about calls to the GetTotalEccErrors method. + GetTotalEccErrors []struct { + // MemoryErrorType is the memoryErrorType argument value. + MemoryErrorType nvml.MemoryErrorType + // EccCounterType is the eccCounterType argument value. + EccCounterType nvml.EccCounterType + } + // GetTotalEnergyConsumption holds details about calls to the GetTotalEnergyConsumption method. + GetTotalEnergyConsumption []struct { + } + // GetUUID holds details about calls to the GetUUID method. + GetUUID []struct { + } + // GetUtilizationRates holds details about calls to the GetUtilizationRates method. + GetUtilizationRates []struct { + } + // GetVbiosVersion holds details about calls to the GetVbiosVersion method. + GetVbiosVersion []struct { + } + // GetVgpuCapabilities holds details about calls to the GetVgpuCapabilities method. + GetVgpuCapabilities []struct { + // DeviceVgpuCapability is the deviceVgpuCapability argument value. + DeviceVgpuCapability nvml.DeviceVgpuCapability + } + // GetVgpuMetadata holds details about calls to the GetVgpuMetadata method. + GetVgpuMetadata []struct { + } + // GetVgpuProcessUtilization holds details about calls to the GetVgpuProcessUtilization method. + GetVgpuProcessUtilization []struct { + // V is the v argument value. + V uint64 + } + // GetVgpuSchedulerCapabilities holds details about calls to the GetVgpuSchedulerCapabilities method. + GetVgpuSchedulerCapabilities []struct { + } + // GetVgpuSchedulerLog holds details about calls to the GetVgpuSchedulerLog method. + GetVgpuSchedulerLog []struct { + } + // GetVgpuSchedulerState holds details about calls to the GetVgpuSchedulerState method. + GetVgpuSchedulerState []struct { + } + // GetVgpuUtilization holds details about calls to the GetVgpuUtilization method. + GetVgpuUtilization []struct { + // V is the v argument value. + V uint64 + } + // GetViolationStatus holds details about calls to the GetViolationStatus method. + GetViolationStatus []struct { + // PerfPolicyType is the perfPolicyType argument value. + PerfPolicyType nvml.PerfPolicyType + } + // GetVirtualizationMode holds details about calls to the GetVirtualizationMode method. + GetVirtualizationMode []struct { + } + // GpmMigSampleGet holds details about calls to the GpmMigSampleGet method. + GpmMigSampleGet []struct { + // N is the n argument value. + N int + // GpmSample is the gpmSample argument value. + GpmSample nvml.GpmSample + } + // GpmQueryDeviceSupport holds details about calls to the GpmQueryDeviceSupport method. + GpmQueryDeviceSupport []struct { + } + // GpmQueryDeviceSupportV holds details about calls to the GpmQueryDeviceSupportV method. + GpmQueryDeviceSupportV []struct { + } + // GpmSampleGet holds details about calls to the GpmSampleGet method. + GpmSampleGet []struct { + // GpmSample is the gpmSample argument value. + GpmSample nvml.GpmSample + } + // IsMigDeviceHandle holds details about calls to the IsMigDeviceHandle method. + IsMigDeviceHandle []struct { + } + // OnSameBoard holds details about calls to the OnSameBoard method. + OnSameBoard []struct { + // Device is the device argument value. + Device nvml.Device + } + // RegisterEvents holds details about calls to the RegisterEvents method. + RegisterEvents []struct { + // V is the v argument value. + V uint64 + // EventSet is the eventSet argument value. + EventSet nvml.EventSet + } + // ResetApplicationsClocks holds details about calls to the ResetApplicationsClocks method. + ResetApplicationsClocks []struct { + } + // ResetGpuLockedClocks holds details about calls to the ResetGpuLockedClocks method. + ResetGpuLockedClocks []struct { + } + // ResetMemoryLockedClocks holds details about calls to the ResetMemoryLockedClocks method. + ResetMemoryLockedClocks []struct { + } + // ResetNvLinkErrorCounters holds details about calls to the ResetNvLinkErrorCounters method. + ResetNvLinkErrorCounters []struct { + // N is the n argument value. + N int + } + // ResetNvLinkUtilizationCounter holds details about calls to the ResetNvLinkUtilizationCounter method. + ResetNvLinkUtilizationCounter []struct { + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // SetAPIRestriction holds details about calls to the SetAPIRestriction method. + SetAPIRestriction []struct { + // RestrictedAPI is the restrictedAPI argument value. + RestrictedAPI nvml.RestrictedAPI + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // SetAccountingMode holds details about calls to the SetAccountingMode method. + SetAccountingMode []struct { + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // SetApplicationsClocks holds details about calls to the SetApplicationsClocks method. + SetApplicationsClocks []struct { + // V1 is the v1 argument value. + V1 uint32 + // V2 is the v2 argument value. + V2 uint32 + } + // SetAutoBoostedClocksEnabled holds details about calls to the SetAutoBoostedClocksEnabled method. + SetAutoBoostedClocksEnabled []struct { + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // SetComputeMode holds details about calls to the SetComputeMode method. + SetComputeMode []struct { + // ComputeMode is the computeMode argument value. + ComputeMode nvml.ComputeMode + } + // SetCpuAffinity holds details about calls to the SetCpuAffinity method. + SetCpuAffinity []struct { + } + // SetDefaultAutoBoostedClocksEnabled holds details about calls to the SetDefaultAutoBoostedClocksEnabled method. + SetDefaultAutoBoostedClocksEnabled []struct { + // EnableState is the enableState argument value. + EnableState nvml.EnableState + // V is the v argument value. + V uint32 + } + // SetDefaultFanSpeed_v2 holds details about calls to the SetDefaultFanSpeed_v2 method. + SetDefaultFanSpeed_v2 []struct { + // N is the n argument value. + N int + } + // SetDriverModel holds details about calls to the SetDriverModel method. + SetDriverModel []struct { + // DriverModel is the driverModel argument value. + DriverModel nvml.DriverModel + // V is the v argument value. + V uint32 + } + // SetEccMode holds details about calls to the SetEccMode method. + SetEccMode []struct { + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // SetFanControlPolicy holds details about calls to the SetFanControlPolicy method. + SetFanControlPolicy []struct { + // N is the n argument value. + N int + // FanControlPolicy is the fanControlPolicy argument value. + FanControlPolicy nvml.FanControlPolicy + } + // SetFanSpeed_v2 holds details about calls to the SetFanSpeed_v2 method. + SetFanSpeed_v2 []struct { + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // SetGpcClkVfOffset holds details about calls to the SetGpcClkVfOffset method. + SetGpcClkVfOffset []struct { + // N is the n argument value. + N int + } + // SetGpuLockedClocks holds details about calls to the SetGpuLockedClocks method. + SetGpuLockedClocks []struct { + // V1 is the v1 argument value. + V1 uint32 + // V2 is the v2 argument value. + V2 uint32 + } + // SetGpuOperationMode holds details about calls to the SetGpuOperationMode method. + SetGpuOperationMode []struct { + // GpuOperationMode is the gpuOperationMode argument value. + GpuOperationMode nvml.GpuOperationMode + } + // SetMemClkVfOffset holds details about calls to the SetMemClkVfOffset method. + SetMemClkVfOffset []struct { + // N is the n argument value. + N int + } + // SetMemoryLockedClocks holds details about calls to the SetMemoryLockedClocks method. + SetMemoryLockedClocks []struct { + // V1 is the v1 argument value. + V1 uint32 + // V2 is the v2 argument value. + V2 uint32 + } + // SetMigMode holds details about calls to the SetMigMode method. + SetMigMode []struct { + // N is the n argument value. + N int + } + // SetNvLinkDeviceLowPowerThreshold holds details about calls to the SetNvLinkDeviceLowPowerThreshold method. + SetNvLinkDeviceLowPowerThreshold []struct { + // NvLinkPowerThres is the nvLinkPowerThres argument value. + NvLinkPowerThres *nvml.NvLinkPowerThres + } + // SetNvLinkUtilizationControl holds details about calls to the SetNvLinkUtilizationControl method. + SetNvLinkUtilizationControl []struct { + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + // NvLinkUtilizationControl is the nvLinkUtilizationControl argument value. + NvLinkUtilizationControl *nvml.NvLinkUtilizationControl + // B is the b argument value. + B bool + } + // SetPersistenceMode holds details about calls to the SetPersistenceMode method. + SetPersistenceMode []struct { + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // SetPowerManagementLimit holds details about calls to the SetPowerManagementLimit method. + SetPowerManagementLimit []struct { + // V is the v argument value. + V uint32 + } + // SetTemperatureThreshold holds details about calls to the SetTemperatureThreshold method. + SetTemperatureThreshold []struct { + // TemperatureThresholds is the temperatureThresholds argument value. + TemperatureThresholds nvml.TemperatureThresholds + // N is the n argument value. + N int + } + // SetVgpuSchedulerState holds details about calls to the SetVgpuSchedulerState method. + SetVgpuSchedulerState []struct { + // VgpuSchedulerSetState is the vgpuSchedulerSetState argument value. + VgpuSchedulerSetState *nvml.VgpuSchedulerSetState + } + // SetVirtualizationMode holds details about calls to the SetVirtualizationMode method. + SetVirtualizationMode []struct { + // GpuVirtualizationMode is the gpuVirtualizationMode argument value. + GpuVirtualizationMode nvml.GpuVirtualizationMode + } + // ValidateInforom holds details about calls to the ValidateInforom method. + ValidateInforom []struct { + } + // VgpuTypeGetMaxInstances holds details about calls to the VgpuTypeGetMaxInstances method. + VgpuTypeGetMaxInstances []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + } + lockCcuGetStreamState sync.RWMutex + lockCcuSetStreamState sync.RWMutex + lockClearAccountingPids sync.RWMutex + lockClearCpuAffinity sync.RWMutex + lockClearEccErrorCounts sync.RWMutex + lockClearFieldValues sync.RWMutex + lockCreateGpuInstance sync.RWMutex + lockCreateGpuInstanceWithPlacement sync.RWMutex + lockFreezeNvLinkUtilizationCounter sync.RWMutex + lockGetAPIRestriction sync.RWMutex + lockGetAccountingBufferSize sync.RWMutex + lockGetAccountingMode sync.RWMutex + lockGetAccountingPids sync.RWMutex + lockGetAccountingStats sync.RWMutex + lockGetActiveVgpus sync.RWMutex + lockGetAdaptiveClockInfoStatus sync.RWMutex + lockGetApplicationsClock sync.RWMutex + lockGetArchitecture sync.RWMutex + lockGetAttributes sync.RWMutex + lockGetAutoBoostedClocksEnabled sync.RWMutex + lockGetBAR1MemoryInfo sync.RWMutex + lockGetBoardId sync.RWMutex + lockGetBoardPartNumber sync.RWMutex + lockGetBrand sync.RWMutex + lockGetBridgeChipInfo sync.RWMutex + lockGetBusType sync.RWMutex + lockGetClkMonStatus sync.RWMutex + lockGetClock sync.RWMutex + lockGetClockInfo sync.RWMutex + lockGetComputeInstanceId sync.RWMutex + lockGetComputeMode sync.RWMutex + lockGetComputeRunningProcesses sync.RWMutex + lockGetCpuAffinity sync.RWMutex + lockGetCpuAffinityWithinScope sync.RWMutex + lockGetCreatableVgpus sync.RWMutex + lockGetCudaComputeCapability sync.RWMutex + lockGetCurrPcieLinkGeneration sync.RWMutex + lockGetCurrPcieLinkWidth sync.RWMutex + lockGetCurrentClocksThrottleReasons sync.RWMutex + lockGetDecoderUtilization sync.RWMutex + lockGetDefaultApplicationsClock sync.RWMutex + lockGetDefaultEccMode sync.RWMutex + lockGetDetailedEccErrors sync.RWMutex + lockGetDeviceHandleFromMigDeviceHandle sync.RWMutex + lockGetDisplayActive sync.RWMutex + lockGetDisplayMode sync.RWMutex + lockGetDriverModel sync.RWMutex + lockGetDynamicPstatesInfo sync.RWMutex + lockGetEccMode sync.RWMutex + lockGetEncoderCapacity sync.RWMutex + lockGetEncoderSessions sync.RWMutex + lockGetEncoderStats sync.RWMutex + lockGetEncoderUtilization sync.RWMutex + lockGetEnforcedPowerLimit sync.RWMutex + lockGetFBCSessions sync.RWMutex + lockGetFBCStats sync.RWMutex + lockGetFanControlPolicy_v2 sync.RWMutex + lockGetFanSpeed sync.RWMutex + lockGetFanSpeed_v2 sync.RWMutex + lockGetFieldValues sync.RWMutex + lockGetGpcClkMinMaxVfOffset sync.RWMutex + lockGetGpcClkVfOffset sync.RWMutex + lockGetGpuFabricInfo sync.RWMutex + lockGetGpuInstanceById sync.RWMutex + lockGetGpuInstanceId sync.RWMutex + lockGetGpuInstancePossiblePlacements sync.RWMutex + lockGetGpuInstanceProfileInfo sync.RWMutex + lockGetGpuInstanceProfileInfoV sync.RWMutex + lockGetGpuInstanceRemainingCapacity sync.RWMutex + lockGetGpuInstances sync.RWMutex + lockGetGpuMaxPcieLinkGeneration sync.RWMutex + lockGetGpuOperationMode sync.RWMutex + lockGetGraphicsRunningProcesses sync.RWMutex + lockGetGridLicensableFeatures sync.RWMutex + lockGetGspFirmwareMode sync.RWMutex + lockGetGspFirmwareVersion sync.RWMutex + lockGetHostVgpuMode sync.RWMutex + lockGetIndex sync.RWMutex + lockGetInforomConfigurationChecksum sync.RWMutex + lockGetInforomImageVersion sync.RWMutex + lockGetInforomVersion sync.RWMutex + lockGetIrqNum sync.RWMutex + lockGetMPSComputeRunningProcesses sync.RWMutex + lockGetMaxClockInfo sync.RWMutex + lockGetMaxCustomerBoostClock sync.RWMutex + lockGetMaxMigDeviceCount sync.RWMutex + lockGetMaxPcieLinkGeneration sync.RWMutex + lockGetMaxPcieLinkWidth sync.RWMutex + lockGetMemClkMinMaxVfOffset sync.RWMutex + lockGetMemClkVfOffset sync.RWMutex + lockGetMemoryAffinity sync.RWMutex + lockGetMemoryBusWidth sync.RWMutex + lockGetMemoryErrorCounter sync.RWMutex + lockGetMemoryInfo sync.RWMutex + lockGetMemoryInfo_v2 sync.RWMutex + lockGetMigDeviceHandleByIndex sync.RWMutex + lockGetMigMode sync.RWMutex + lockGetMinMaxClockOfPState sync.RWMutex + lockGetMinMaxFanSpeed sync.RWMutex + lockGetMinorNumber sync.RWMutex + lockGetMultiGpuBoard sync.RWMutex + lockGetName sync.RWMutex + lockGetNumFans sync.RWMutex + lockGetNumGpuCores sync.RWMutex + lockGetNvLinkCapability sync.RWMutex + lockGetNvLinkErrorCounter sync.RWMutex + lockGetNvLinkRemoteDeviceType sync.RWMutex + lockGetNvLinkRemotePciInfo sync.RWMutex + lockGetNvLinkState sync.RWMutex + lockGetNvLinkUtilizationControl sync.RWMutex + lockGetNvLinkUtilizationCounter sync.RWMutex + lockGetNvLinkVersion sync.RWMutex + lockGetP2PStatus sync.RWMutex + lockGetPciInfo sync.RWMutex + lockGetPcieLinkMaxSpeed sync.RWMutex + lockGetPcieReplayCounter sync.RWMutex + lockGetPcieSpeed sync.RWMutex + lockGetPcieThroughput sync.RWMutex + lockGetPerformanceState sync.RWMutex + lockGetPersistenceMode sync.RWMutex + lockGetPgpuMetadataString sync.RWMutex + lockGetPowerManagementDefaultLimit sync.RWMutex + lockGetPowerManagementLimit sync.RWMutex + lockGetPowerManagementLimitConstraints sync.RWMutex + lockGetPowerManagementMode sync.RWMutex + lockGetPowerSource sync.RWMutex + lockGetPowerState sync.RWMutex + lockGetPowerUsage sync.RWMutex + lockGetProcessUtilization sync.RWMutex + lockGetRemappedRows sync.RWMutex + lockGetRetiredPages sync.RWMutex + lockGetRetiredPagesPendingStatus sync.RWMutex + lockGetRetiredPages_v2 sync.RWMutex + lockGetRowRemapperHistogram sync.RWMutex + lockGetSamples sync.RWMutex + lockGetSerial sync.RWMutex + lockGetSupportedClocksThrottleReasons sync.RWMutex + lockGetSupportedEventTypes sync.RWMutex + lockGetSupportedGraphicsClocks sync.RWMutex + lockGetSupportedMemoryClocks sync.RWMutex + lockGetSupportedPerformanceStates sync.RWMutex + lockGetSupportedVgpus sync.RWMutex + lockGetTargetFanSpeed sync.RWMutex + lockGetTemperature sync.RWMutex + lockGetTemperatureThreshold sync.RWMutex + lockGetThermalSettings sync.RWMutex + lockGetTopologyCommonAncestor sync.RWMutex + lockGetTopologyNearestGpus sync.RWMutex + lockGetTotalEccErrors sync.RWMutex + lockGetTotalEnergyConsumption sync.RWMutex + lockGetUUID sync.RWMutex + lockGetUtilizationRates sync.RWMutex + lockGetVbiosVersion sync.RWMutex + lockGetVgpuCapabilities sync.RWMutex + lockGetVgpuMetadata sync.RWMutex + lockGetVgpuProcessUtilization sync.RWMutex + lockGetVgpuSchedulerCapabilities sync.RWMutex + lockGetVgpuSchedulerLog sync.RWMutex + lockGetVgpuSchedulerState sync.RWMutex + lockGetVgpuUtilization sync.RWMutex + lockGetViolationStatus sync.RWMutex + lockGetVirtualizationMode sync.RWMutex + lockGpmMigSampleGet sync.RWMutex + lockGpmQueryDeviceSupport sync.RWMutex + lockGpmQueryDeviceSupportV sync.RWMutex + lockGpmSampleGet sync.RWMutex + lockIsMigDeviceHandle sync.RWMutex + lockOnSameBoard sync.RWMutex + lockRegisterEvents sync.RWMutex + lockResetApplicationsClocks sync.RWMutex + lockResetGpuLockedClocks sync.RWMutex + lockResetMemoryLockedClocks sync.RWMutex + lockResetNvLinkErrorCounters sync.RWMutex + lockResetNvLinkUtilizationCounter sync.RWMutex + lockSetAPIRestriction sync.RWMutex + lockSetAccountingMode sync.RWMutex + lockSetApplicationsClocks sync.RWMutex + lockSetAutoBoostedClocksEnabled sync.RWMutex + lockSetComputeMode sync.RWMutex + lockSetCpuAffinity sync.RWMutex + lockSetDefaultAutoBoostedClocksEnabled sync.RWMutex + lockSetDefaultFanSpeed_v2 sync.RWMutex + lockSetDriverModel sync.RWMutex + lockSetEccMode sync.RWMutex + lockSetFanControlPolicy sync.RWMutex + lockSetFanSpeed_v2 sync.RWMutex + lockSetGpcClkVfOffset sync.RWMutex + lockSetGpuLockedClocks sync.RWMutex + lockSetGpuOperationMode sync.RWMutex + lockSetMemClkVfOffset sync.RWMutex + lockSetMemoryLockedClocks sync.RWMutex + lockSetMigMode sync.RWMutex + lockSetNvLinkDeviceLowPowerThreshold sync.RWMutex + lockSetNvLinkUtilizationControl sync.RWMutex + lockSetPersistenceMode sync.RWMutex + lockSetPowerManagementLimit sync.RWMutex + lockSetTemperatureThreshold sync.RWMutex + lockSetVgpuSchedulerState sync.RWMutex + lockSetVirtualizationMode sync.RWMutex + lockValidateInforom sync.RWMutex + lockVgpuTypeGetMaxInstances sync.RWMutex +} + +// CcuGetStreamState calls CcuGetStreamStateFunc. +func (mock *Device) CcuGetStreamState() (int, nvml.Return) { + if mock.CcuGetStreamStateFunc == nil { + panic("Device.CcuGetStreamStateFunc: method is nil but Device.CcuGetStreamState was just called") + } + callInfo := struct { + }{} + mock.lockCcuGetStreamState.Lock() + mock.calls.CcuGetStreamState = append(mock.calls.CcuGetStreamState, callInfo) + mock.lockCcuGetStreamState.Unlock() + return mock.CcuGetStreamStateFunc() +} + +// CcuGetStreamStateCalls gets all the calls that were made to CcuGetStreamState. +// Check the length with: +// +// len(mockedDevice.CcuGetStreamStateCalls()) +func (mock *Device) CcuGetStreamStateCalls() []struct { +} { + var calls []struct { + } + mock.lockCcuGetStreamState.RLock() + calls = mock.calls.CcuGetStreamState + mock.lockCcuGetStreamState.RUnlock() + return calls +} + +// CcuSetStreamState calls CcuSetStreamStateFunc. +func (mock *Device) CcuSetStreamState(n int) nvml.Return { + if mock.CcuSetStreamStateFunc == nil { + panic("Device.CcuSetStreamStateFunc: method is nil but Device.CcuSetStreamState was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockCcuSetStreamState.Lock() + mock.calls.CcuSetStreamState = append(mock.calls.CcuSetStreamState, callInfo) + mock.lockCcuSetStreamState.Unlock() + return mock.CcuSetStreamStateFunc(n) +} + +// CcuSetStreamStateCalls gets all the calls that were made to CcuSetStreamState. +// Check the length with: +// +// len(mockedDevice.CcuSetStreamStateCalls()) +func (mock *Device) CcuSetStreamStateCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockCcuSetStreamState.RLock() + calls = mock.calls.CcuSetStreamState + mock.lockCcuSetStreamState.RUnlock() + return calls +} + +// ClearAccountingPids calls ClearAccountingPidsFunc. +func (mock *Device) ClearAccountingPids() nvml.Return { + if mock.ClearAccountingPidsFunc == nil { + panic("Device.ClearAccountingPidsFunc: method is nil but Device.ClearAccountingPids was just called") + } + callInfo := struct { + }{} + mock.lockClearAccountingPids.Lock() + mock.calls.ClearAccountingPids = append(mock.calls.ClearAccountingPids, callInfo) + mock.lockClearAccountingPids.Unlock() + return mock.ClearAccountingPidsFunc() +} + +// ClearAccountingPidsCalls gets all the calls that were made to ClearAccountingPids. +// Check the length with: +// +// len(mockedDevice.ClearAccountingPidsCalls()) +func (mock *Device) ClearAccountingPidsCalls() []struct { +} { + var calls []struct { + } + mock.lockClearAccountingPids.RLock() + calls = mock.calls.ClearAccountingPids + mock.lockClearAccountingPids.RUnlock() + return calls +} + +// ClearCpuAffinity calls ClearCpuAffinityFunc. +func (mock *Device) ClearCpuAffinity() nvml.Return { + if mock.ClearCpuAffinityFunc == nil { + panic("Device.ClearCpuAffinityFunc: method is nil but Device.ClearCpuAffinity was just called") + } + callInfo := struct { + }{} + mock.lockClearCpuAffinity.Lock() + mock.calls.ClearCpuAffinity = append(mock.calls.ClearCpuAffinity, callInfo) + mock.lockClearCpuAffinity.Unlock() + return mock.ClearCpuAffinityFunc() +} + +// ClearCpuAffinityCalls gets all the calls that were made to ClearCpuAffinity. +// Check the length with: +// +// len(mockedDevice.ClearCpuAffinityCalls()) +func (mock *Device) ClearCpuAffinityCalls() []struct { +} { + var calls []struct { + } + mock.lockClearCpuAffinity.RLock() + calls = mock.calls.ClearCpuAffinity + mock.lockClearCpuAffinity.RUnlock() + return calls +} + +// ClearEccErrorCounts calls ClearEccErrorCountsFunc. +func (mock *Device) ClearEccErrorCounts(eccCounterType nvml.EccCounterType) nvml.Return { + if mock.ClearEccErrorCountsFunc == nil { + panic("Device.ClearEccErrorCountsFunc: method is nil but Device.ClearEccErrorCounts was just called") + } + callInfo := struct { + EccCounterType nvml.EccCounterType + }{ + EccCounterType: eccCounterType, + } + mock.lockClearEccErrorCounts.Lock() + mock.calls.ClearEccErrorCounts = append(mock.calls.ClearEccErrorCounts, callInfo) + mock.lockClearEccErrorCounts.Unlock() + return mock.ClearEccErrorCountsFunc(eccCounterType) +} + +// ClearEccErrorCountsCalls gets all the calls that were made to ClearEccErrorCounts. +// Check the length with: +// +// len(mockedDevice.ClearEccErrorCountsCalls()) +func (mock *Device) ClearEccErrorCountsCalls() []struct { + EccCounterType nvml.EccCounterType +} { + var calls []struct { + EccCounterType nvml.EccCounterType + } + mock.lockClearEccErrorCounts.RLock() + calls = mock.calls.ClearEccErrorCounts + mock.lockClearEccErrorCounts.RUnlock() + return calls +} + +// ClearFieldValues calls ClearFieldValuesFunc. +func (mock *Device) ClearFieldValues(fieldValues []nvml.FieldValue) nvml.Return { + if mock.ClearFieldValuesFunc == nil { + panic("Device.ClearFieldValuesFunc: method is nil but Device.ClearFieldValues was just called") + } + callInfo := struct { + FieldValues []nvml.FieldValue + }{ + FieldValues: fieldValues, + } + mock.lockClearFieldValues.Lock() + mock.calls.ClearFieldValues = append(mock.calls.ClearFieldValues, callInfo) + mock.lockClearFieldValues.Unlock() + return mock.ClearFieldValuesFunc(fieldValues) +} + +// ClearFieldValuesCalls gets all the calls that were made to ClearFieldValues. +// Check the length with: +// +// len(mockedDevice.ClearFieldValuesCalls()) +func (mock *Device) ClearFieldValuesCalls() []struct { + FieldValues []nvml.FieldValue +} { + var calls []struct { + FieldValues []nvml.FieldValue + } + mock.lockClearFieldValues.RLock() + calls = mock.calls.ClearFieldValues + mock.lockClearFieldValues.RUnlock() + return calls +} + +// CreateGpuInstance calls CreateGpuInstanceFunc. +func (mock *Device) CreateGpuInstance(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (nvml.GpuInstance, nvml.Return) { + if mock.CreateGpuInstanceFunc == nil { + panic("Device.CreateGpuInstanceFunc: method is nil but Device.CreateGpuInstance was just called") + } + callInfo := struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + }{ + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + } + mock.lockCreateGpuInstance.Lock() + mock.calls.CreateGpuInstance = append(mock.calls.CreateGpuInstance, callInfo) + mock.lockCreateGpuInstance.Unlock() + return mock.CreateGpuInstanceFunc(gpuInstanceProfileInfo) +} + +// CreateGpuInstanceCalls gets all the calls that were made to CreateGpuInstance. +// Check the length with: +// +// len(mockedDevice.CreateGpuInstanceCalls()) +func (mock *Device) CreateGpuInstanceCalls() []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo +} { + var calls []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + mock.lockCreateGpuInstance.RLock() + calls = mock.calls.CreateGpuInstance + mock.lockCreateGpuInstance.RUnlock() + return calls +} + +// CreateGpuInstanceWithPlacement calls CreateGpuInstanceWithPlacementFunc. +func (mock *Device) CreateGpuInstanceWithPlacement(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo, gpuInstancePlacement *nvml.GpuInstancePlacement) (nvml.GpuInstance, nvml.Return) { + if mock.CreateGpuInstanceWithPlacementFunc == nil { + panic("Device.CreateGpuInstanceWithPlacementFunc: method is nil but Device.CreateGpuInstanceWithPlacement was just called") + } + callInfo := struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + GpuInstancePlacement *nvml.GpuInstancePlacement + }{ + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + GpuInstancePlacement: gpuInstancePlacement, + } + mock.lockCreateGpuInstanceWithPlacement.Lock() + mock.calls.CreateGpuInstanceWithPlacement = append(mock.calls.CreateGpuInstanceWithPlacement, callInfo) + mock.lockCreateGpuInstanceWithPlacement.Unlock() + return mock.CreateGpuInstanceWithPlacementFunc(gpuInstanceProfileInfo, gpuInstancePlacement) +} + +// CreateGpuInstanceWithPlacementCalls gets all the calls that were made to CreateGpuInstanceWithPlacement. +// Check the length with: +// +// len(mockedDevice.CreateGpuInstanceWithPlacementCalls()) +func (mock *Device) CreateGpuInstanceWithPlacementCalls() []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + GpuInstancePlacement *nvml.GpuInstancePlacement +} { + var calls []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + GpuInstancePlacement *nvml.GpuInstancePlacement + } + mock.lockCreateGpuInstanceWithPlacement.RLock() + calls = mock.calls.CreateGpuInstanceWithPlacement + mock.lockCreateGpuInstanceWithPlacement.RUnlock() + return calls +} + +// FreezeNvLinkUtilizationCounter calls FreezeNvLinkUtilizationCounterFunc. +func (mock *Device) FreezeNvLinkUtilizationCounter(n1 int, n2 int, enableState nvml.EnableState) nvml.Return { + if mock.FreezeNvLinkUtilizationCounterFunc == nil { + panic("Device.FreezeNvLinkUtilizationCounterFunc: method is nil but Device.FreezeNvLinkUtilizationCounter was just called") + } + callInfo := struct { + N1 int + N2 int + EnableState nvml.EnableState + }{ + N1: n1, + N2: n2, + EnableState: enableState, + } + mock.lockFreezeNvLinkUtilizationCounter.Lock() + mock.calls.FreezeNvLinkUtilizationCounter = append(mock.calls.FreezeNvLinkUtilizationCounter, callInfo) + mock.lockFreezeNvLinkUtilizationCounter.Unlock() + return mock.FreezeNvLinkUtilizationCounterFunc(n1, n2, enableState) +} + +// FreezeNvLinkUtilizationCounterCalls gets all the calls that were made to FreezeNvLinkUtilizationCounter. +// Check the length with: +// +// len(mockedDevice.FreezeNvLinkUtilizationCounterCalls()) +func (mock *Device) FreezeNvLinkUtilizationCounterCalls() []struct { + N1 int + N2 int + EnableState nvml.EnableState +} { + var calls []struct { + N1 int + N2 int + EnableState nvml.EnableState + } + mock.lockFreezeNvLinkUtilizationCounter.RLock() + calls = mock.calls.FreezeNvLinkUtilizationCounter + mock.lockFreezeNvLinkUtilizationCounter.RUnlock() + return calls +} + +// GetAPIRestriction calls GetAPIRestrictionFunc. +func (mock *Device) GetAPIRestriction(restrictedAPI nvml.RestrictedAPI) (nvml.EnableState, nvml.Return) { + if mock.GetAPIRestrictionFunc == nil { + panic("Device.GetAPIRestrictionFunc: method is nil but Device.GetAPIRestriction was just called") + } + callInfo := struct { + RestrictedAPI nvml.RestrictedAPI + }{ + RestrictedAPI: restrictedAPI, + } + mock.lockGetAPIRestriction.Lock() + mock.calls.GetAPIRestriction = append(mock.calls.GetAPIRestriction, callInfo) + mock.lockGetAPIRestriction.Unlock() + return mock.GetAPIRestrictionFunc(restrictedAPI) +} + +// GetAPIRestrictionCalls gets all the calls that were made to GetAPIRestriction. +// Check the length with: +// +// len(mockedDevice.GetAPIRestrictionCalls()) +func (mock *Device) GetAPIRestrictionCalls() []struct { + RestrictedAPI nvml.RestrictedAPI +} { + var calls []struct { + RestrictedAPI nvml.RestrictedAPI + } + mock.lockGetAPIRestriction.RLock() + calls = mock.calls.GetAPIRestriction + mock.lockGetAPIRestriction.RUnlock() + return calls +} + +// GetAccountingBufferSize calls GetAccountingBufferSizeFunc. +func (mock *Device) GetAccountingBufferSize() (int, nvml.Return) { + if mock.GetAccountingBufferSizeFunc == nil { + panic("Device.GetAccountingBufferSizeFunc: method is nil but Device.GetAccountingBufferSize was just called") + } + callInfo := struct { + }{} + mock.lockGetAccountingBufferSize.Lock() + mock.calls.GetAccountingBufferSize = append(mock.calls.GetAccountingBufferSize, callInfo) + mock.lockGetAccountingBufferSize.Unlock() + return mock.GetAccountingBufferSizeFunc() +} + +// GetAccountingBufferSizeCalls gets all the calls that were made to GetAccountingBufferSize. +// Check the length with: +// +// len(mockedDevice.GetAccountingBufferSizeCalls()) +func (mock *Device) GetAccountingBufferSizeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetAccountingBufferSize.RLock() + calls = mock.calls.GetAccountingBufferSize + mock.lockGetAccountingBufferSize.RUnlock() + return calls +} + +// GetAccountingMode calls GetAccountingModeFunc. +func (mock *Device) GetAccountingMode() (nvml.EnableState, nvml.Return) { + if mock.GetAccountingModeFunc == nil { + panic("Device.GetAccountingModeFunc: method is nil but Device.GetAccountingMode was just called") + } + callInfo := struct { + }{} + mock.lockGetAccountingMode.Lock() + mock.calls.GetAccountingMode = append(mock.calls.GetAccountingMode, callInfo) + mock.lockGetAccountingMode.Unlock() + return mock.GetAccountingModeFunc() +} + +// GetAccountingModeCalls gets all the calls that were made to GetAccountingMode. +// Check the length with: +// +// len(mockedDevice.GetAccountingModeCalls()) +func (mock *Device) GetAccountingModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetAccountingMode.RLock() + calls = mock.calls.GetAccountingMode + mock.lockGetAccountingMode.RUnlock() + return calls +} + +// GetAccountingPids calls GetAccountingPidsFunc. +func (mock *Device) GetAccountingPids() ([]int, nvml.Return) { + if mock.GetAccountingPidsFunc == nil { + panic("Device.GetAccountingPidsFunc: method is nil but Device.GetAccountingPids was just called") + } + callInfo := struct { + }{} + mock.lockGetAccountingPids.Lock() + mock.calls.GetAccountingPids = append(mock.calls.GetAccountingPids, callInfo) + mock.lockGetAccountingPids.Unlock() + return mock.GetAccountingPidsFunc() +} + +// GetAccountingPidsCalls gets all the calls that were made to GetAccountingPids. +// Check the length with: +// +// len(mockedDevice.GetAccountingPidsCalls()) +func (mock *Device) GetAccountingPidsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetAccountingPids.RLock() + calls = mock.calls.GetAccountingPids + mock.lockGetAccountingPids.RUnlock() + return calls +} + +// GetAccountingStats calls GetAccountingStatsFunc. +func (mock *Device) GetAccountingStats(v uint32) (nvml.AccountingStats, nvml.Return) { + if mock.GetAccountingStatsFunc == nil { + panic("Device.GetAccountingStatsFunc: method is nil but Device.GetAccountingStats was just called") + } + callInfo := struct { + V uint32 + }{ + V: v, + } + mock.lockGetAccountingStats.Lock() + mock.calls.GetAccountingStats = append(mock.calls.GetAccountingStats, callInfo) + mock.lockGetAccountingStats.Unlock() + return mock.GetAccountingStatsFunc(v) +} + +// GetAccountingStatsCalls gets all the calls that were made to GetAccountingStats. +// Check the length with: +// +// len(mockedDevice.GetAccountingStatsCalls()) +func (mock *Device) GetAccountingStatsCalls() []struct { + V uint32 +} { + var calls []struct { + V uint32 + } + mock.lockGetAccountingStats.RLock() + calls = mock.calls.GetAccountingStats + mock.lockGetAccountingStats.RUnlock() + return calls +} + +// GetActiveVgpus calls GetActiveVgpusFunc. +func (mock *Device) GetActiveVgpus() ([]nvml.VgpuInstance, nvml.Return) { + if mock.GetActiveVgpusFunc == nil { + panic("Device.GetActiveVgpusFunc: method is nil but Device.GetActiveVgpus was just called") + } + callInfo := struct { + }{} + mock.lockGetActiveVgpus.Lock() + mock.calls.GetActiveVgpus = append(mock.calls.GetActiveVgpus, callInfo) + mock.lockGetActiveVgpus.Unlock() + return mock.GetActiveVgpusFunc() +} + +// GetActiveVgpusCalls gets all the calls that were made to GetActiveVgpus. +// Check the length with: +// +// len(mockedDevice.GetActiveVgpusCalls()) +func (mock *Device) GetActiveVgpusCalls() []struct { +} { + var calls []struct { + } + mock.lockGetActiveVgpus.RLock() + calls = mock.calls.GetActiveVgpus + mock.lockGetActiveVgpus.RUnlock() + return calls +} + +// GetAdaptiveClockInfoStatus calls GetAdaptiveClockInfoStatusFunc. +func (mock *Device) GetAdaptiveClockInfoStatus() (uint32, nvml.Return) { + if mock.GetAdaptiveClockInfoStatusFunc == nil { + panic("Device.GetAdaptiveClockInfoStatusFunc: method is nil but Device.GetAdaptiveClockInfoStatus was just called") + } + callInfo := struct { + }{} + mock.lockGetAdaptiveClockInfoStatus.Lock() + mock.calls.GetAdaptiveClockInfoStatus = append(mock.calls.GetAdaptiveClockInfoStatus, callInfo) + mock.lockGetAdaptiveClockInfoStatus.Unlock() + return mock.GetAdaptiveClockInfoStatusFunc() +} + +// GetAdaptiveClockInfoStatusCalls gets all the calls that were made to GetAdaptiveClockInfoStatus. +// Check the length with: +// +// len(mockedDevice.GetAdaptiveClockInfoStatusCalls()) +func (mock *Device) GetAdaptiveClockInfoStatusCalls() []struct { +} { + var calls []struct { + } + mock.lockGetAdaptiveClockInfoStatus.RLock() + calls = mock.calls.GetAdaptiveClockInfoStatus + mock.lockGetAdaptiveClockInfoStatus.RUnlock() + return calls +} + +// GetApplicationsClock calls GetApplicationsClockFunc. +func (mock *Device) GetApplicationsClock(clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.GetApplicationsClockFunc == nil { + panic("Device.GetApplicationsClockFunc: method is nil but Device.GetApplicationsClock was just called") + } + callInfo := struct { + ClockType nvml.ClockType + }{ + ClockType: clockType, + } + mock.lockGetApplicationsClock.Lock() + mock.calls.GetApplicationsClock = append(mock.calls.GetApplicationsClock, callInfo) + mock.lockGetApplicationsClock.Unlock() + return mock.GetApplicationsClockFunc(clockType) +} + +// GetApplicationsClockCalls gets all the calls that were made to GetApplicationsClock. +// Check the length with: +// +// len(mockedDevice.GetApplicationsClockCalls()) +func (mock *Device) GetApplicationsClockCalls() []struct { + ClockType nvml.ClockType +} { + var calls []struct { + ClockType nvml.ClockType + } + mock.lockGetApplicationsClock.RLock() + calls = mock.calls.GetApplicationsClock + mock.lockGetApplicationsClock.RUnlock() + return calls +} + +// GetArchitecture calls GetArchitectureFunc. +func (mock *Device) GetArchitecture() (nvml.DeviceArchitecture, nvml.Return) { + if mock.GetArchitectureFunc == nil { + panic("Device.GetArchitectureFunc: method is nil but Device.GetArchitecture was just called") + } + callInfo := struct { + }{} + mock.lockGetArchitecture.Lock() + mock.calls.GetArchitecture = append(mock.calls.GetArchitecture, callInfo) + mock.lockGetArchitecture.Unlock() + return mock.GetArchitectureFunc() +} + +// GetArchitectureCalls gets all the calls that were made to GetArchitecture. +// Check the length with: +// +// len(mockedDevice.GetArchitectureCalls()) +func (mock *Device) GetArchitectureCalls() []struct { +} { + var calls []struct { + } + mock.lockGetArchitecture.RLock() + calls = mock.calls.GetArchitecture + mock.lockGetArchitecture.RUnlock() + return calls +} + +// GetAttributes calls GetAttributesFunc. +func (mock *Device) GetAttributes() (nvml.DeviceAttributes, nvml.Return) { + if mock.GetAttributesFunc == nil { + panic("Device.GetAttributesFunc: method is nil but Device.GetAttributes was just called") + } + callInfo := struct { + }{} + mock.lockGetAttributes.Lock() + mock.calls.GetAttributes = append(mock.calls.GetAttributes, callInfo) + mock.lockGetAttributes.Unlock() + return mock.GetAttributesFunc() +} + +// GetAttributesCalls gets all the calls that were made to GetAttributes. +// Check the length with: +// +// len(mockedDevice.GetAttributesCalls()) +func (mock *Device) GetAttributesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetAttributes.RLock() + calls = mock.calls.GetAttributes + mock.lockGetAttributes.RUnlock() + return calls +} + +// GetAutoBoostedClocksEnabled calls GetAutoBoostedClocksEnabledFunc. +func (mock *Device) GetAutoBoostedClocksEnabled() (nvml.EnableState, nvml.EnableState, nvml.Return) { + if mock.GetAutoBoostedClocksEnabledFunc == nil { + panic("Device.GetAutoBoostedClocksEnabledFunc: method is nil but Device.GetAutoBoostedClocksEnabled was just called") + } + callInfo := struct { + }{} + mock.lockGetAutoBoostedClocksEnabled.Lock() + mock.calls.GetAutoBoostedClocksEnabled = append(mock.calls.GetAutoBoostedClocksEnabled, callInfo) + mock.lockGetAutoBoostedClocksEnabled.Unlock() + return mock.GetAutoBoostedClocksEnabledFunc() +} + +// GetAutoBoostedClocksEnabledCalls gets all the calls that were made to GetAutoBoostedClocksEnabled. +// Check the length with: +// +// len(mockedDevice.GetAutoBoostedClocksEnabledCalls()) +func (mock *Device) GetAutoBoostedClocksEnabledCalls() []struct { +} { + var calls []struct { + } + mock.lockGetAutoBoostedClocksEnabled.RLock() + calls = mock.calls.GetAutoBoostedClocksEnabled + mock.lockGetAutoBoostedClocksEnabled.RUnlock() + return calls +} + +// GetBAR1MemoryInfo calls GetBAR1MemoryInfoFunc. +func (mock *Device) GetBAR1MemoryInfo() (nvml.BAR1Memory, nvml.Return) { + if mock.GetBAR1MemoryInfoFunc == nil { + panic("Device.GetBAR1MemoryInfoFunc: method is nil but Device.GetBAR1MemoryInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetBAR1MemoryInfo.Lock() + mock.calls.GetBAR1MemoryInfo = append(mock.calls.GetBAR1MemoryInfo, callInfo) + mock.lockGetBAR1MemoryInfo.Unlock() + return mock.GetBAR1MemoryInfoFunc() +} + +// GetBAR1MemoryInfoCalls gets all the calls that were made to GetBAR1MemoryInfo. +// Check the length with: +// +// len(mockedDevice.GetBAR1MemoryInfoCalls()) +func (mock *Device) GetBAR1MemoryInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetBAR1MemoryInfo.RLock() + calls = mock.calls.GetBAR1MemoryInfo + mock.lockGetBAR1MemoryInfo.RUnlock() + return calls +} + +// GetBoardId calls GetBoardIdFunc. +func (mock *Device) GetBoardId() (uint32, nvml.Return) { + if mock.GetBoardIdFunc == nil { + panic("Device.GetBoardIdFunc: method is nil but Device.GetBoardId was just called") + } + callInfo := struct { + }{} + mock.lockGetBoardId.Lock() + mock.calls.GetBoardId = append(mock.calls.GetBoardId, callInfo) + mock.lockGetBoardId.Unlock() + return mock.GetBoardIdFunc() +} + +// GetBoardIdCalls gets all the calls that were made to GetBoardId. +// Check the length with: +// +// len(mockedDevice.GetBoardIdCalls()) +func (mock *Device) GetBoardIdCalls() []struct { +} { + var calls []struct { + } + mock.lockGetBoardId.RLock() + calls = mock.calls.GetBoardId + mock.lockGetBoardId.RUnlock() + return calls +} + +// GetBoardPartNumber calls GetBoardPartNumberFunc. +func (mock *Device) GetBoardPartNumber() (string, nvml.Return) { + if mock.GetBoardPartNumberFunc == nil { + panic("Device.GetBoardPartNumberFunc: method is nil but Device.GetBoardPartNumber was just called") + } + callInfo := struct { + }{} + mock.lockGetBoardPartNumber.Lock() + mock.calls.GetBoardPartNumber = append(mock.calls.GetBoardPartNumber, callInfo) + mock.lockGetBoardPartNumber.Unlock() + return mock.GetBoardPartNumberFunc() +} + +// GetBoardPartNumberCalls gets all the calls that were made to GetBoardPartNumber. +// Check the length with: +// +// len(mockedDevice.GetBoardPartNumberCalls()) +func (mock *Device) GetBoardPartNumberCalls() []struct { +} { + var calls []struct { + } + mock.lockGetBoardPartNumber.RLock() + calls = mock.calls.GetBoardPartNumber + mock.lockGetBoardPartNumber.RUnlock() + return calls +} + +// GetBrand calls GetBrandFunc. +func (mock *Device) GetBrand() (nvml.BrandType, nvml.Return) { + if mock.GetBrandFunc == nil { + panic("Device.GetBrandFunc: method is nil but Device.GetBrand was just called") + } + callInfo := struct { + }{} + mock.lockGetBrand.Lock() + mock.calls.GetBrand = append(mock.calls.GetBrand, callInfo) + mock.lockGetBrand.Unlock() + return mock.GetBrandFunc() +} + +// GetBrandCalls gets all the calls that were made to GetBrand. +// Check the length with: +// +// len(mockedDevice.GetBrandCalls()) +func (mock *Device) GetBrandCalls() []struct { +} { + var calls []struct { + } + mock.lockGetBrand.RLock() + calls = mock.calls.GetBrand + mock.lockGetBrand.RUnlock() + return calls +} + +// GetBridgeChipInfo calls GetBridgeChipInfoFunc. +func (mock *Device) GetBridgeChipInfo() (nvml.BridgeChipHierarchy, nvml.Return) { + if mock.GetBridgeChipInfoFunc == nil { + panic("Device.GetBridgeChipInfoFunc: method is nil but Device.GetBridgeChipInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetBridgeChipInfo.Lock() + mock.calls.GetBridgeChipInfo = append(mock.calls.GetBridgeChipInfo, callInfo) + mock.lockGetBridgeChipInfo.Unlock() + return mock.GetBridgeChipInfoFunc() +} + +// GetBridgeChipInfoCalls gets all the calls that were made to GetBridgeChipInfo. +// Check the length with: +// +// len(mockedDevice.GetBridgeChipInfoCalls()) +func (mock *Device) GetBridgeChipInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetBridgeChipInfo.RLock() + calls = mock.calls.GetBridgeChipInfo + mock.lockGetBridgeChipInfo.RUnlock() + return calls +} + +// GetBusType calls GetBusTypeFunc. +func (mock *Device) GetBusType() (nvml.BusType, nvml.Return) { + if mock.GetBusTypeFunc == nil { + panic("Device.GetBusTypeFunc: method is nil but Device.GetBusType was just called") + } + callInfo := struct { + }{} + mock.lockGetBusType.Lock() + mock.calls.GetBusType = append(mock.calls.GetBusType, callInfo) + mock.lockGetBusType.Unlock() + return mock.GetBusTypeFunc() +} + +// GetBusTypeCalls gets all the calls that were made to GetBusType. +// Check the length with: +// +// len(mockedDevice.GetBusTypeCalls()) +func (mock *Device) GetBusTypeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetBusType.RLock() + calls = mock.calls.GetBusType + mock.lockGetBusType.RUnlock() + return calls +} + +// GetClkMonStatus calls GetClkMonStatusFunc. +func (mock *Device) GetClkMonStatus() (nvml.ClkMonStatus, nvml.Return) { + if mock.GetClkMonStatusFunc == nil { + panic("Device.GetClkMonStatusFunc: method is nil but Device.GetClkMonStatus was just called") + } + callInfo := struct { + }{} + mock.lockGetClkMonStatus.Lock() + mock.calls.GetClkMonStatus = append(mock.calls.GetClkMonStatus, callInfo) + mock.lockGetClkMonStatus.Unlock() + return mock.GetClkMonStatusFunc() +} + +// GetClkMonStatusCalls gets all the calls that were made to GetClkMonStatus. +// Check the length with: +// +// len(mockedDevice.GetClkMonStatusCalls()) +func (mock *Device) GetClkMonStatusCalls() []struct { +} { + var calls []struct { + } + mock.lockGetClkMonStatus.RLock() + calls = mock.calls.GetClkMonStatus + mock.lockGetClkMonStatus.RUnlock() + return calls +} + +// GetClock calls GetClockFunc. +func (mock *Device) GetClock(clockType nvml.ClockType, clockId nvml.ClockId) (uint32, nvml.Return) { + if mock.GetClockFunc == nil { + panic("Device.GetClockFunc: method is nil but Device.GetClock was just called") + } + callInfo := struct { + ClockType nvml.ClockType + ClockId nvml.ClockId + }{ + ClockType: clockType, + ClockId: clockId, + } + mock.lockGetClock.Lock() + mock.calls.GetClock = append(mock.calls.GetClock, callInfo) + mock.lockGetClock.Unlock() + return mock.GetClockFunc(clockType, clockId) +} + +// GetClockCalls gets all the calls that were made to GetClock. +// Check the length with: +// +// len(mockedDevice.GetClockCalls()) +func (mock *Device) GetClockCalls() []struct { + ClockType nvml.ClockType + ClockId nvml.ClockId +} { + var calls []struct { + ClockType nvml.ClockType + ClockId nvml.ClockId + } + mock.lockGetClock.RLock() + calls = mock.calls.GetClock + mock.lockGetClock.RUnlock() + return calls +} + +// GetClockInfo calls GetClockInfoFunc. +func (mock *Device) GetClockInfo(clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.GetClockInfoFunc == nil { + panic("Device.GetClockInfoFunc: method is nil but Device.GetClockInfo was just called") + } + callInfo := struct { + ClockType nvml.ClockType + }{ + ClockType: clockType, + } + mock.lockGetClockInfo.Lock() + mock.calls.GetClockInfo = append(mock.calls.GetClockInfo, callInfo) + mock.lockGetClockInfo.Unlock() + return mock.GetClockInfoFunc(clockType) +} + +// GetClockInfoCalls gets all the calls that were made to GetClockInfo. +// Check the length with: +// +// len(mockedDevice.GetClockInfoCalls()) +func (mock *Device) GetClockInfoCalls() []struct { + ClockType nvml.ClockType +} { + var calls []struct { + ClockType nvml.ClockType + } + mock.lockGetClockInfo.RLock() + calls = mock.calls.GetClockInfo + mock.lockGetClockInfo.RUnlock() + return calls +} + +// GetComputeInstanceId calls GetComputeInstanceIdFunc. +func (mock *Device) GetComputeInstanceId() (int, nvml.Return) { + if mock.GetComputeInstanceIdFunc == nil { + panic("Device.GetComputeInstanceIdFunc: method is nil but Device.GetComputeInstanceId was just called") + } + callInfo := struct { + }{} + mock.lockGetComputeInstanceId.Lock() + mock.calls.GetComputeInstanceId = append(mock.calls.GetComputeInstanceId, callInfo) + mock.lockGetComputeInstanceId.Unlock() + return mock.GetComputeInstanceIdFunc() +} + +// GetComputeInstanceIdCalls gets all the calls that were made to GetComputeInstanceId. +// Check the length with: +// +// len(mockedDevice.GetComputeInstanceIdCalls()) +func (mock *Device) GetComputeInstanceIdCalls() []struct { +} { + var calls []struct { + } + mock.lockGetComputeInstanceId.RLock() + calls = mock.calls.GetComputeInstanceId + mock.lockGetComputeInstanceId.RUnlock() + return calls +} + +// GetComputeMode calls GetComputeModeFunc. +func (mock *Device) GetComputeMode() (nvml.ComputeMode, nvml.Return) { + if mock.GetComputeModeFunc == nil { + panic("Device.GetComputeModeFunc: method is nil but Device.GetComputeMode was just called") + } + callInfo := struct { + }{} + mock.lockGetComputeMode.Lock() + mock.calls.GetComputeMode = append(mock.calls.GetComputeMode, callInfo) + mock.lockGetComputeMode.Unlock() + return mock.GetComputeModeFunc() +} + +// GetComputeModeCalls gets all the calls that were made to GetComputeMode. +// Check the length with: +// +// len(mockedDevice.GetComputeModeCalls()) +func (mock *Device) GetComputeModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetComputeMode.RLock() + calls = mock.calls.GetComputeMode + mock.lockGetComputeMode.RUnlock() + return calls +} + +// GetComputeRunningProcesses calls GetComputeRunningProcessesFunc. +func (mock *Device) GetComputeRunningProcesses() ([]nvml.ProcessInfo, nvml.Return) { + if mock.GetComputeRunningProcessesFunc == nil { + panic("Device.GetComputeRunningProcessesFunc: method is nil but Device.GetComputeRunningProcesses was just called") + } + callInfo := struct { + }{} + mock.lockGetComputeRunningProcesses.Lock() + mock.calls.GetComputeRunningProcesses = append(mock.calls.GetComputeRunningProcesses, callInfo) + mock.lockGetComputeRunningProcesses.Unlock() + return mock.GetComputeRunningProcessesFunc() +} + +// GetComputeRunningProcessesCalls gets all the calls that were made to GetComputeRunningProcesses. +// Check the length with: +// +// len(mockedDevice.GetComputeRunningProcessesCalls()) +func (mock *Device) GetComputeRunningProcessesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetComputeRunningProcesses.RLock() + calls = mock.calls.GetComputeRunningProcesses + mock.lockGetComputeRunningProcesses.RUnlock() + return calls +} + +// GetCpuAffinity calls GetCpuAffinityFunc. +func (mock *Device) GetCpuAffinity(n int) ([]uint, nvml.Return) { + if mock.GetCpuAffinityFunc == nil { + panic("Device.GetCpuAffinityFunc: method is nil but Device.GetCpuAffinity was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetCpuAffinity.Lock() + mock.calls.GetCpuAffinity = append(mock.calls.GetCpuAffinity, callInfo) + mock.lockGetCpuAffinity.Unlock() + return mock.GetCpuAffinityFunc(n) +} + +// GetCpuAffinityCalls gets all the calls that were made to GetCpuAffinity. +// Check the length with: +// +// len(mockedDevice.GetCpuAffinityCalls()) +func (mock *Device) GetCpuAffinityCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetCpuAffinity.RLock() + calls = mock.calls.GetCpuAffinity + mock.lockGetCpuAffinity.RUnlock() + return calls +} + +// GetCpuAffinityWithinScope calls GetCpuAffinityWithinScopeFunc. +func (mock *Device) GetCpuAffinityWithinScope(n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) { + if mock.GetCpuAffinityWithinScopeFunc == nil { + panic("Device.GetCpuAffinityWithinScopeFunc: method is nil but Device.GetCpuAffinityWithinScope was just called") + } + callInfo := struct { + N int + AffinityScope nvml.AffinityScope + }{ + N: n, + AffinityScope: affinityScope, + } + mock.lockGetCpuAffinityWithinScope.Lock() + mock.calls.GetCpuAffinityWithinScope = append(mock.calls.GetCpuAffinityWithinScope, callInfo) + mock.lockGetCpuAffinityWithinScope.Unlock() + return mock.GetCpuAffinityWithinScopeFunc(n, affinityScope) +} + +// GetCpuAffinityWithinScopeCalls gets all the calls that were made to GetCpuAffinityWithinScope. +// Check the length with: +// +// len(mockedDevice.GetCpuAffinityWithinScopeCalls()) +func (mock *Device) GetCpuAffinityWithinScopeCalls() []struct { + N int + AffinityScope nvml.AffinityScope +} { + var calls []struct { + N int + AffinityScope nvml.AffinityScope + } + mock.lockGetCpuAffinityWithinScope.RLock() + calls = mock.calls.GetCpuAffinityWithinScope + mock.lockGetCpuAffinityWithinScope.RUnlock() + return calls +} + +// GetCreatableVgpus calls GetCreatableVgpusFunc. +func (mock *Device) GetCreatableVgpus() ([]nvml.VgpuTypeId, nvml.Return) { + if mock.GetCreatableVgpusFunc == nil { + panic("Device.GetCreatableVgpusFunc: method is nil but Device.GetCreatableVgpus was just called") + } + callInfo := struct { + }{} + mock.lockGetCreatableVgpus.Lock() + mock.calls.GetCreatableVgpus = append(mock.calls.GetCreatableVgpus, callInfo) + mock.lockGetCreatableVgpus.Unlock() + return mock.GetCreatableVgpusFunc() +} + +// GetCreatableVgpusCalls gets all the calls that were made to GetCreatableVgpus. +// Check the length with: +// +// len(mockedDevice.GetCreatableVgpusCalls()) +func (mock *Device) GetCreatableVgpusCalls() []struct { +} { + var calls []struct { + } + mock.lockGetCreatableVgpus.RLock() + calls = mock.calls.GetCreatableVgpus + mock.lockGetCreatableVgpus.RUnlock() + return calls +} + +// GetCudaComputeCapability calls GetCudaComputeCapabilityFunc. +func (mock *Device) GetCudaComputeCapability() (int, int, nvml.Return) { + if mock.GetCudaComputeCapabilityFunc == nil { + panic("Device.GetCudaComputeCapabilityFunc: method is nil but Device.GetCudaComputeCapability was just called") + } + callInfo := struct { + }{} + mock.lockGetCudaComputeCapability.Lock() + mock.calls.GetCudaComputeCapability = append(mock.calls.GetCudaComputeCapability, callInfo) + mock.lockGetCudaComputeCapability.Unlock() + return mock.GetCudaComputeCapabilityFunc() +} + +// GetCudaComputeCapabilityCalls gets all the calls that were made to GetCudaComputeCapability. +// Check the length with: +// +// len(mockedDevice.GetCudaComputeCapabilityCalls()) +func (mock *Device) GetCudaComputeCapabilityCalls() []struct { +} { + var calls []struct { + } + mock.lockGetCudaComputeCapability.RLock() + calls = mock.calls.GetCudaComputeCapability + mock.lockGetCudaComputeCapability.RUnlock() + return calls +} + +// GetCurrPcieLinkGeneration calls GetCurrPcieLinkGenerationFunc. +func (mock *Device) GetCurrPcieLinkGeneration() (int, nvml.Return) { + if mock.GetCurrPcieLinkGenerationFunc == nil { + panic("Device.GetCurrPcieLinkGenerationFunc: method is nil but Device.GetCurrPcieLinkGeneration was just called") + } + callInfo := struct { + }{} + mock.lockGetCurrPcieLinkGeneration.Lock() + mock.calls.GetCurrPcieLinkGeneration = append(mock.calls.GetCurrPcieLinkGeneration, callInfo) + mock.lockGetCurrPcieLinkGeneration.Unlock() + return mock.GetCurrPcieLinkGenerationFunc() +} + +// GetCurrPcieLinkGenerationCalls gets all the calls that were made to GetCurrPcieLinkGeneration. +// Check the length with: +// +// len(mockedDevice.GetCurrPcieLinkGenerationCalls()) +func (mock *Device) GetCurrPcieLinkGenerationCalls() []struct { +} { + var calls []struct { + } + mock.lockGetCurrPcieLinkGeneration.RLock() + calls = mock.calls.GetCurrPcieLinkGeneration + mock.lockGetCurrPcieLinkGeneration.RUnlock() + return calls +} + +// GetCurrPcieLinkWidth calls GetCurrPcieLinkWidthFunc. +func (mock *Device) GetCurrPcieLinkWidth() (int, nvml.Return) { + if mock.GetCurrPcieLinkWidthFunc == nil { + panic("Device.GetCurrPcieLinkWidthFunc: method is nil but Device.GetCurrPcieLinkWidth was just called") + } + callInfo := struct { + }{} + mock.lockGetCurrPcieLinkWidth.Lock() + mock.calls.GetCurrPcieLinkWidth = append(mock.calls.GetCurrPcieLinkWidth, callInfo) + mock.lockGetCurrPcieLinkWidth.Unlock() + return mock.GetCurrPcieLinkWidthFunc() +} + +// GetCurrPcieLinkWidthCalls gets all the calls that were made to GetCurrPcieLinkWidth. +// Check the length with: +// +// len(mockedDevice.GetCurrPcieLinkWidthCalls()) +func (mock *Device) GetCurrPcieLinkWidthCalls() []struct { +} { + var calls []struct { + } + mock.lockGetCurrPcieLinkWidth.RLock() + calls = mock.calls.GetCurrPcieLinkWidth + mock.lockGetCurrPcieLinkWidth.RUnlock() + return calls +} + +// GetCurrentClocksThrottleReasons calls GetCurrentClocksThrottleReasonsFunc. +func (mock *Device) GetCurrentClocksThrottleReasons() (uint64, nvml.Return) { + if mock.GetCurrentClocksThrottleReasonsFunc == nil { + panic("Device.GetCurrentClocksThrottleReasonsFunc: method is nil but Device.GetCurrentClocksThrottleReasons was just called") + } + callInfo := struct { + }{} + mock.lockGetCurrentClocksThrottleReasons.Lock() + mock.calls.GetCurrentClocksThrottleReasons = append(mock.calls.GetCurrentClocksThrottleReasons, callInfo) + mock.lockGetCurrentClocksThrottleReasons.Unlock() + return mock.GetCurrentClocksThrottleReasonsFunc() +} + +// GetCurrentClocksThrottleReasonsCalls gets all the calls that were made to GetCurrentClocksThrottleReasons. +// Check the length with: +// +// len(mockedDevice.GetCurrentClocksThrottleReasonsCalls()) +func (mock *Device) GetCurrentClocksThrottleReasonsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetCurrentClocksThrottleReasons.RLock() + calls = mock.calls.GetCurrentClocksThrottleReasons + mock.lockGetCurrentClocksThrottleReasons.RUnlock() + return calls +} + +// GetDecoderUtilization calls GetDecoderUtilizationFunc. +func (mock *Device) GetDecoderUtilization() (uint32, uint32, nvml.Return) { + if mock.GetDecoderUtilizationFunc == nil { + panic("Device.GetDecoderUtilizationFunc: method is nil but Device.GetDecoderUtilization was just called") + } + callInfo := struct { + }{} + mock.lockGetDecoderUtilization.Lock() + mock.calls.GetDecoderUtilization = append(mock.calls.GetDecoderUtilization, callInfo) + mock.lockGetDecoderUtilization.Unlock() + return mock.GetDecoderUtilizationFunc() +} + +// GetDecoderUtilizationCalls gets all the calls that were made to GetDecoderUtilization. +// Check the length with: +// +// len(mockedDevice.GetDecoderUtilizationCalls()) +func (mock *Device) GetDecoderUtilizationCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDecoderUtilization.RLock() + calls = mock.calls.GetDecoderUtilization + mock.lockGetDecoderUtilization.RUnlock() + return calls +} + +// GetDefaultApplicationsClock calls GetDefaultApplicationsClockFunc. +func (mock *Device) GetDefaultApplicationsClock(clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.GetDefaultApplicationsClockFunc == nil { + panic("Device.GetDefaultApplicationsClockFunc: method is nil but Device.GetDefaultApplicationsClock was just called") + } + callInfo := struct { + ClockType nvml.ClockType + }{ + ClockType: clockType, + } + mock.lockGetDefaultApplicationsClock.Lock() + mock.calls.GetDefaultApplicationsClock = append(mock.calls.GetDefaultApplicationsClock, callInfo) + mock.lockGetDefaultApplicationsClock.Unlock() + return mock.GetDefaultApplicationsClockFunc(clockType) +} + +// GetDefaultApplicationsClockCalls gets all the calls that were made to GetDefaultApplicationsClock. +// Check the length with: +// +// len(mockedDevice.GetDefaultApplicationsClockCalls()) +func (mock *Device) GetDefaultApplicationsClockCalls() []struct { + ClockType nvml.ClockType +} { + var calls []struct { + ClockType nvml.ClockType + } + mock.lockGetDefaultApplicationsClock.RLock() + calls = mock.calls.GetDefaultApplicationsClock + mock.lockGetDefaultApplicationsClock.RUnlock() + return calls +} + +// GetDefaultEccMode calls GetDefaultEccModeFunc. +func (mock *Device) GetDefaultEccMode() (nvml.EnableState, nvml.Return) { + if mock.GetDefaultEccModeFunc == nil { + panic("Device.GetDefaultEccModeFunc: method is nil but Device.GetDefaultEccMode was just called") + } + callInfo := struct { + }{} + mock.lockGetDefaultEccMode.Lock() + mock.calls.GetDefaultEccMode = append(mock.calls.GetDefaultEccMode, callInfo) + mock.lockGetDefaultEccMode.Unlock() + return mock.GetDefaultEccModeFunc() +} + +// GetDefaultEccModeCalls gets all the calls that were made to GetDefaultEccMode. +// Check the length with: +// +// len(mockedDevice.GetDefaultEccModeCalls()) +func (mock *Device) GetDefaultEccModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDefaultEccMode.RLock() + calls = mock.calls.GetDefaultEccMode + mock.lockGetDefaultEccMode.RUnlock() + return calls +} + +// GetDetailedEccErrors calls GetDetailedEccErrorsFunc. +func (mock *Device) GetDetailedEccErrors(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (nvml.EccErrorCounts, nvml.Return) { + if mock.GetDetailedEccErrorsFunc == nil { + panic("Device.GetDetailedEccErrorsFunc: method is nil but Device.GetDetailedEccErrors was just called") + } + callInfo := struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + }{ + MemoryErrorType: memoryErrorType, + EccCounterType: eccCounterType, + } + mock.lockGetDetailedEccErrors.Lock() + mock.calls.GetDetailedEccErrors = append(mock.calls.GetDetailedEccErrors, callInfo) + mock.lockGetDetailedEccErrors.Unlock() + return mock.GetDetailedEccErrorsFunc(memoryErrorType, eccCounterType) +} + +// GetDetailedEccErrorsCalls gets all the calls that were made to GetDetailedEccErrors. +// Check the length with: +// +// len(mockedDevice.GetDetailedEccErrorsCalls()) +func (mock *Device) GetDetailedEccErrorsCalls() []struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType +} { + var calls []struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + } + mock.lockGetDetailedEccErrors.RLock() + calls = mock.calls.GetDetailedEccErrors + mock.lockGetDetailedEccErrors.RUnlock() + return calls +} + +// GetDeviceHandleFromMigDeviceHandle calls GetDeviceHandleFromMigDeviceHandleFunc. +func (mock *Device) GetDeviceHandleFromMigDeviceHandle() (nvml.Device, nvml.Return) { + if mock.GetDeviceHandleFromMigDeviceHandleFunc == nil { + panic("Device.GetDeviceHandleFromMigDeviceHandleFunc: method is nil but Device.GetDeviceHandleFromMigDeviceHandle was just called") + } + callInfo := struct { + }{} + mock.lockGetDeviceHandleFromMigDeviceHandle.Lock() + mock.calls.GetDeviceHandleFromMigDeviceHandle = append(mock.calls.GetDeviceHandleFromMigDeviceHandle, callInfo) + mock.lockGetDeviceHandleFromMigDeviceHandle.Unlock() + return mock.GetDeviceHandleFromMigDeviceHandleFunc() +} + +// GetDeviceHandleFromMigDeviceHandleCalls gets all the calls that were made to GetDeviceHandleFromMigDeviceHandle. +// Check the length with: +// +// len(mockedDevice.GetDeviceHandleFromMigDeviceHandleCalls()) +func (mock *Device) GetDeviceHandleFromMigDeviceHandleCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDeviceHandleFromMigDeviceHandle.RLock() + calls = mock.calls.GetDeviceHandleFromMigDeviceHandle + mock.lockGetDeviceHandleFromMigDeviceHandle.RUnlock() + return calls +} + +// GetDisplayActive calls GetDisplayActiveFunc. +func (mock *Device) GetDisplayActive() (nvml.EnableState, nvml.Return) { + if mock.GetDisplayActiveFunc == nil { + panic("Device.GetDisplayActiveFunc: method is nil but Device.GetDisplayActive was just called") + } + callInfo := struct { + }{} + mock.lockGetDisplayActive.Lock() + mock.calls.GetDisplayActive = append(mock.calls.GetDisplayActive, callInfo) + mock.lockGetDisplayActive.Unlock() + return mock.GetDisplayActiveFunc() +} + +// GetDisplayActiveCalls gets all the calls that were made to GetDisplayActive. +// Check the length with: +// +// len(mockedDevice.GetDisplayActiveCalls()) +func (mock *Device) GetDisplayActiveCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDisplayActive.RLock() + calls = mock.calls.GetDisplayActive + mock.lockGetDisplayActive.RUnlock() + return calls +} + +// GetDisplayMode calls GetDisplayModeFunc. +func (mock *Device) GetDisplayMode() (nvml.EnableState, nvml.Return) { + if mock.GetDisplayModeFunc == nil { + panic("Device.GetDisplayModeFunc: method is nil but Device.GetDisplayMode was just called") + } + callInfo := struct { + }{} + mock.lockGetDisplayMode.Lock() + mock.calls.GetDisplayMode = append(mock.calls.GetDisplayMode, callInfo) + mock.lockGetDisplayMode.Unlock() + return mock.GetDisplayModeFunc() +} + +// GetDisplayModeCalls gets all the calls that were made to GetDisplayMode. +// Check the length with: +// +// len(mockedDevice.GetDisplayModeCalls()) +func (mock *Device) GetDisplayModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDisplayMode.RLock() + calls = mock.calls.GetDisplayMode + mock.lockGetDisplayMode.RUnlock() + return calls +} + +// GetDriverModel calls GetDriverModelFunc. +func (mock *Device) GetDriverModel() (nvml.DriverModel, nvml.DriverModel, nvml.Return) { + if mock.GetDriverModelFunc == nil { + panic("Device.GetDriverModelFunc: method is nil but Device.GetDriverModel was just called") + } + callInfo := struct { + }{} + mock.lockGetDriverModel.Lock() + mock.calls.GetDriverModel = append(mock.calls.GetDriverModel, callInfo) + mock.lockGetDriverModel.Unlock() + return mock.GetDriverModelFunc() +} + +// GetDriverModelCalls gets all the calls that were made to GetDriverModel. +// Check the length with: +// +// len(mockedDevice.GetDriverModelCalls()) +func (mock *Device) GetDriverModelCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDriverModel.RLock() + calls = mock.calls.GetDriverModel + mock.lockGetDriverModel.RUnlock() + return calls +} + +// GetDynamicPstatesInfo calls GetDynamicPstatesInfoFunc. +func (mock *Device) GetDynamicPstatesInfo() (nvml.GpuDynamicPstatesInfo, nvml.Return) { + if mock.GetDynamicPstatesInfoFunc == nil { + panic("Device.GetDynamicPstatesInfoFunc: method is nil but Device.GetDynamicPstatesInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetDynamicPstatesInfo.Lock() + mock.calls.GetDynamicPstatesInfo = append(mock.calls.GetDynamicPstatesInfo, callInfo) + mock.lockGetDynamicPstatesInfo.Unlock() + return mock.GetDynamicPstatesInfoFunc() +} + +// GetDynamicPstatesInfoCalls gets all the calls that were made to GetDynamicPstatesInfo. +// Check the length with: +// +// len(mockedDevice.GetDynamicPstatesInfoCalls()) +func (mock *Device) GetDynamicPstatesInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDynamicPstatesInfo.RLock() + calls = mock.calls.GetDynamicPstatesInfo + mock.lockGetDynamicPstatesInfo.RUnlock() + return calls +} + +// GetEccMode calls GetEccModeFunc. +func (mock *Device) GetEccMode() (nvml.EnableState, nvml.EnableState, nvml.Return) { + if mock.GetEccModeFunc == nil { + panic("Device.GetEccModeFunc: method is nil but Device.GetEccMode was just called") + } + callInfo := struct { + }{} + mock.lockGetEccMode.Lock() + mock.calls.GetEccMode = append(mock.calls.GetEccMode, callInfo) + mock.lockGetEccMode.Unlock() + return mock.GetEccModeFunc() +} + +// GetEccModeCalls gets all the calls that were made to GetEccMode. +// Check the length with: +// +// len(mockedDevice.GetEccModeCalls()) +func (mock *Device) GetEccModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEccMode.RLock() + calls = mock.calls.GetEccMode + mock.lockGetEccMode.RUnlock() + return calls +} + +// GetEncoderCapacity calls GetEncoderCapacityFunc. +func (mock *Device) GetEncoderCapacity(encoderType nvml.EncoderType) (int, nvml.Return) { + if mock.GetEncoderCapacityFunc == nil { + panic("Device.GetEncoderCapacityFunc: method is nil but Device.GetEncoderCapacity was just called") + } + callInfo := struct { + EncoderType nvml.EncoderType + }{ + EncoderType: encoderType, + } + mock.lockGetEncoderCapacity.Lock() + mock.calls.GetEncoderCapacity = append(mock.calls.GetEncoderCapacity, callInfo) + mock.lockGetEncoderCapacity.Unlock() + return mock.GetEncoderCapacityFunc(encoderType) +} + +// GetEncoderCapacityCalls gets all the calls that were made to GetEncoderCapacity. +// Check the length with: +// +// len(mockedDevice.GetEncoderCapacityCalls()) +func (mock *Device) GetEncoderCapacityCalls() []struct { + EncoderType nvml.EncoderType +} { + var calls []struct { + EncoderType nvml.EncoderType + } + mock.lockGetEncoderCapacity.RLock() + calls = mock.calls.GetEncoderCapacity + mock.lockGetEncoderCapacity.RUnlock() + return calls +} + +// GetEncoderSessions calls GetEncoderSessionsFunc. +func (mock *Device) GetEncoderSessions() ([]nvml.EncoderSessionInfo, nvml.Return) { + if mock.GetEncoderSessionsFunc == nil { + panic("Device.GetEncoderSessionsFunc: method is nil but Device.GetEncoderSessions was just called") + } + callInfo := struct { + }{} + mock.lockGetEncoderSessions.Lock() + mock.calls.GetEncoderSessions = append(mock.calls.GetEncoderSessions, callInfo) + mock.lockGetEncoderSessions.Unlock() + return mock.GetEncoderSessionsFunc() +} + +// GetEncoderSessionsCalls gets all the calls that were made to GetEncoderSessions. +// Check the length with: +// +// len(mockedDevice.GetEncoderSessionsCalls()) +func (mock *Device) GetEncoderSessionsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEncoderSessions.RLock() + calls = mock.calls.GetEncoderSessions + mock.lockGetEncoderSessions.RUnlock() + return calls +} + +// GetEncoderStats calls GetEncoderStatsFunc. +func (mock *Device) GetEncoderStats() (int, uint32, uint32, nvml.Return) { + if mock.GetEncoderStatsFunc == nil { + panic("Device.GetEncoderStatsFunc: method is nil but Device.GetEncoderStats was just called") + } + callInfo := struct { + }{} + mock.lockGetEncoderStats.Lock() + mock.calls.GetEncoderStats = append(mock.calls.GetEncoderStats, callInfo) + mock.lockGetEncoderStats.Unlock() + return mock.GetEncoderStatsFunc() +} + +// GetEncoderStatsCalls gets all the calls that were made to GetEncoderStats. +// Check the length with: +// +// len(mockedDevice.GetEncoderStatsCalls()) +func (mock *Device) GetEncoderStatsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEncoderStats.RLock() + calls = mock.calls.GetEncoderStats + mock.lockGetEncoderStats.RUnlock() + return calls +} + +// GetEncoderUtilization calls GetEncoderUtilizationFunc. +func (mock *Device) GetEncoderUtilization() (uint32, uint32, nvml.Return) { + if mock.GetEncoderUtilizationFunc == nil { + panic("Device.GetEncoderUtilizationFunc: method is nil but Device.GetEncoderUtilization was just called") + } + callInfo := struct { + }{} + mock.lockGetEncoderUtilization.Lock() + mock.calls.GetEncoderUtilization = append(mock.calls.GetEncoderUtilization, callInfo) + mock.lockGetEncoderUtilization.Unlock() + return mock.GetEncoderUtilizationFunc() +} + +// GetEncoderUtilizationCalls gets all the calls that were made to GetEncoderUtilization. +// Check the length with: +// +// len(mockedDevice.GetEncoderUtilizationCalls()) +func (mock *Device) GetEncoderUtilizationCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEncoderUtilization.RLock() + calls = mock.calls.GetEncoderUtilization + mock.lockGetEncoderUtilization.RUnlock() + return calls +} + +// GetEnforcedPowerLimit calls GetEnforcedPowerLimitFunc. +func (mock *Device) GetEnforcedPowerLimit() (uint32, nvml.Return) { + if mock.GetEnforcedPowerLimitFunc == nil { + panic("Device.GetEnforcedPowerLimitFunc: method is nil but Device.GetEnforcedPowerLimit was just called") + } + callInfo := struct { + }{} + mock.lockGetEnforcedPowerLimit.Lock() + mock.calls.GetEnforcedPowerLimit = append(mock.calls.GetEnforcedPowerLimit, callInfo) + mock.lockGetEnforcedPowerLimit.Unlock() + return mock.GetEnforcedPowerLimitFunc() +} + +// GetEnforcedPowerLimitCalls gets all the calls that were made to GetEnforcedPowerLimit. +// Check the length with: +// +// len(mockedDevice.GetEnforcedPowerLimitCalls()) +func (mock *Device) GetEnforcedPowerLimitCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEnforcedPowerLimit.RLock() + calls = mock.calls.GetEnforcedPowerLimit + mock.lockGetEnforcedPowerLimit.RUnlock() + return calls +} + +// GetFBCSessions calls GetFBCSessionsFunc. +func (mock *Device) GetFBCSessions() ([]nvml.FBCSessionInfo, nvml.Return) { + if mock.GetFBCSessionsFunc == nil { + panic("Device.GetFBCSessionsFunc: method is nil but Device.GetFBCSessions was just called") + } + callInfo := struct { + }{} + mock.lockGetFBCSessions.Lock() + mock.calls.GetFBCSessions = append(mock.calls.GetFBCSessions, callInfo) + mock.lockGetFBCSessions.Unlock() + return mock.GetFBCSessionsFunc() +} + +// GetFBCSessionsCalls gets all the calls that were made to GetFBCSessions. +// Check the length with: +// +// len(mockedDevice.GetFBCSessionsCalls()) +func (mock *Device) GetFBCSessionsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFBCSessions.RLock() + calls = mock.calls.GetFBCSessions + mock.lockGetFBCSessions.RUnlock() + return calls +} + +// GetFBCStats calls GetFBCStatsFunc. +func (mock *Device) GetFBCStats() (nvml.FBCStats, nvml.Return) { + if mock.GetFBCStatsFunc == nil { + panic("Device.GetFBCStatsFunc: method is nil but Device.GetFBCStats was just called") + } + callInfo := struct { + }{} + mock.lockGetFBCStats.Lock() + mock.calls.GetFBCStats = append(mock.calls.GetFBCStats, callInfo) + mock.lockGetFBCStats.Unlock() + return mock.GetFBCStatsFunc() +} + +// GetFBCStatsCalls gets all the calls that were made to GetFBCStats. +// Check the length with: +// +// len(mockedDevice.GetFBCStatsCalls()) +func (mock *Device) GetFBCStatsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFBCStats.RLock() + calls = mock.calls.GetFBCStats + mock.lockGetFBCStats.RUnlock() + return calls +} + +// GetFanControlPolicy_v2 calls GetFanControlPolicy_v2Func. +func (mock *Device) GetFanControlPolicy_v2(n int) (nvml.FanControlPolicy, nvml.Return) { + if mock.GetFanControlPolicy_v2Func == nil { + panic("Device.GetFanControlPolicy_v2Func: method is nil but Device.GetFanControlPolicy_v2 was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetFanControlPolicy_v2.Lock() + mock.calls.GetFanControlPolicy_v2 = append(mock.calls.GetFanControlPolicy_v2, callInfo) + mock.lockGetFanControlPolicy_v2.Unlock() + return mock.GetFanControlPolicy_v2Func(n) +} + +// GetFanControlPolicy_v2Calls gets all the calls that were made to GetFanControlPolicy_v2. +// Check the length with: +// +// len(mockedDevice.GetFanControlPolicy_v2Calls()) +func (mock *Device) GetFanControlPolicy_v2Calls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetFanControlPolicy_v2.RLock() + calls = mock.calls.GetFanControlPolicy_v2 + mock.lockGetFanControlPolicy_v2.RUnlock() + return calls +} + +// GetFanSpeed calls GetFanSpeedFunc. +func (mock *Device) GetFanSpeed() (uint32, nvml.Return) { + if mock.GetFanSpeedFunc == nil { + panic("Device.GetFanSpeedFunc: method is nil but Device.GetFanSpeed was just called") + } + callInfo := struct { + }{} + mock.lockGetFanSpeed.Lock() + mock.calls.GetFanSpeed = append(mock.calls.GetFanSpeed, callInfo) + mock.lockGetFanSpeed.Unlock() + return mock.GetFanSpeedFunc() +} + +// GetFanSpeedCalls gets all the calls that were made to GetFanSpeed. +// Check the length with: +// +// len(mockedDevice.GetFanSpeedCalls()) +func (mock *Device) GetFanSpeedCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFanSpeed.RLock() + calls = mock.calls.GetFanSpeed + mock.lockGetFanSpeed.RUnlock() + return calls +} + +// GetFanSpeed_v2 calls GetFanSpeed_v2Func. +func (mock *Device) GetFanSpeed_v2(n int) (uint32, nvml.Return) { + if mock.GetFanSpeed_v2Func == nil { + panic("Device.GetFanSpeed_v2Func: method is nil but Device.GetFanSpeed_v2 was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetFanSpeed_v2.Lock() + mock.calls.GetFanSpeed_v2 = append(mock.calls.GetFanSpeed_v2, callInfo) + mock.lockGetFanSpeed_v2.Unlock() + return mock.GetFanSpeed_v2Func(n) +} + +// GetFanSpeed_v2Calls gets all the calls that were made to GetFanSpeed_v2. +// Check the length with: +// +// len(mockedDevice.GetFanSpeed_v2Calls()) +func (mock *Device) GetFanSpeed_v2Calls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetFanSpeed_v2.RLock() + calls = mock.calls.GetFanSpeed_v2 + mock.lockGetFanSpeed_v2.RUnlock() + return calls +} + +// GetFieldValues calls GetFieldValuesFunc. +func (mock *Device) GetFieldValues(fieldValues []nvml.FieldValue) nvml.Return { + if mock.GetFieldValuesFunc == nil { + panic("Device.GetFieldValuesFunc: method is nil but Device.GetFieldValues was just called") + } + callInfo := struct { + FieldValues []nvml.FieldValue + }{ + FieldValues: fieldValues, + } + mock.lockGetFieldValues.Lock() + mock.calls.GetFieldValues = append(mock.calls.GetFieldValues, callInfo) + mock.lockGetFieldValues.Unlock() + return mock.GetFieldValuesFunc(fieldValues) +} + +// GetFieldValuesCalls gets all the calls that were made to GetFieldValues. +// Check the length with: +// +// len(mockedDevice.GetFieldValuesCalls()) +func (mock *Device) GetFieldValuesCalls() []struct { + FieldValues []nvml.FieldValue +} { + var calls []struct { + FieldValues []nvml.FieldValue + } + mock.lockGetFieldValues.RLock() + calls = mock.calls.GetFieldValues + mock.lockGetFieldValues.RUnlock() + return calls +} + +// GetGpcClkMinMaxVfOffset calls GetGpcClkMinMaxVfOffsetFunc. +func (mock *Device) GetGpcClkMinMaxVfOffset() (int, int, nvml.Return) { + if mock.GetGpcClkMinMaxVfOffsetFunc == nil { + panic("Device.GetGpcClkMinMaxVfOffsetFunc: method is nil but Device.GetGpcClkMinMaxVfOffset was just called") + } + callInfo := struct { + }{} + mock.lockGetGpcClkMinMaxVfOffset.Lock() + mock.calls.GetGpcClkMinMaxVfOffset = append(mock.calls.GetGpcClkMinMaxVfOffset, callInfo) + mock.lockGetGpcClkMinMaxVfOffset.Unlock() + return mock.GetGpcClkMinMaxVfOffsetFunc() +} + +// GetGpcClkMinMaxVfOffsetCalls gets all the calls that were made to GetGpcClkMinMaxVfOffset. +// Check the length with: +// +// len(mockedDevice.GetGpcClkMinMaxVfOffsetCalls()) +func (mock *Device) GetGpcClkMinMaxVfOffsetCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpcClkMinMaxVfOffset.RLock() + calls = mock.calls.GetGpcClkMinMaxVfOffset + mock.lockGetGpcClkMinMaxVfOffset.RUnlock() + return calls +} + +// GetGpcClkVfOffset calls GetGpcClkVfOffsetFunc. +func (mock *Device) GetGpcClkVfOffset() (int, nvml.Return) { + if mock.GetGpcClkVfOffsetFunc == nil { + panic("Device.GetGpcClkVfOffsetFunc: method is nil but Device.GetGpcClkVfOffset was just called") + } + callInfo := struct { + }{} + mock.lockGetGpcClkVfOffset.Lock() + mock.calls.GetGpcClkVfOffset = append(mock.calls.GetGpcClkVfOffset, callInfo) + mock.lockGetGpcClkVfOffset.Unlock() + return mock.GetGpcClkVfOffsetFunc() +} + +// GetGpcClkVfOffsetCalls gets all the calls that were made to GetGpcClkVfOffset. +// Check the length with: +// +// len(mockedDevice.GetGpcClkVfOffsetCalls()) +func (mock *Device) GetGpcClkVfOffsetCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpcClkVfOffset.RLock() + calls = mock.calls.GetGpcClkVfOffset + mock.lockGetGpcClkVfOffset.RUnlock() + return calls +} + +// GetGpuFabricInfo calls GetGpuFabricInfoFunc. +func (mock *Device) GetGpuFabricInfo() (nvml.GpuFabricInfo, nvml.Return) { + if mock.GetGpuFabricInfoFunc == nil { + panic("Device.GetGpuFabricInfoFunc: method is nil but Device.GetGpuFabricInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetGpuFabricInfo.Lock() + mock.calls.GetGpuFabricInfo = append(mock.calls.GetGpuFabricInfo, callInfo) + mock.lockGetGpuFabricInfo.Unlock() + return mock.GetGpuFabricInfoFunc() +} + +// GetGpuFabricInfoCalls gets all the calls that were made to GetGpuFabricInfo. +// Check the length with: +// +// len(mockedDevice.GetGpuFabricInfoCalls()) +func (mock *Device) GetGpuFabricInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpuFabricInfo.RLock() + calls = mock.calls.GetGpuFabricInfo + mock.lockGetGpuFabricInfo.RUnlock() + return calls +} + +// GetGpuInstanceById calls GetGpuInstanceByIdFunc. +func (mock *Device) GetGpuInstanceById(n int) (nvml.GpuInstance, nvml.Return) { + if mock.GetGpuInstanceByIdFunc == nil { + panic("Device.GetGpuInstanceByIdFunc: method is nil but Device.GetGpuInstanceById was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetGpuInstanceById.Lock() + mock.calls.GetGpuInstanceById = append(mock.calls.GetGpuInstanceById, callInfo) + mock.lockGetGpuInstanceById.Unlock() + return mock.GetGpuInstanceByIdFunc(n) +} + +// GetGpuInstanceByIdCalls gets all the calls that were made to GetGpuInstanceById. +// Check the length with: +// +// len(mockedDevice.GetGpuInstanceByIdCalls()) +func (mock *Device) GetGpuInstanceByIdCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetGpuInstanceById.RLock() + calls = mock.calls.GetGpuInstanceById + mock.lockGetGpuInstanceById.RUnlock() + return calls +} + +// GetGpuInstanceId calls GetGpuInstanceIdFunc. +func (mock *Device) GetGpuInstanceId() (int, nvml.Return) { + if mock.GetGpuInstanceIdFunc == nil { + panic("Device.GetGpuInstanceIdFunc: method is nil but Device.GetGpuInstanceId was just called") + } + callInfo := struct { + }{} + mock.lockGetGpuInstanceId.Lock() + mock.calls.GetGpuInstanceId = append(mock.calls.GetGpuInstanceId, callInfo) + mock.lockGetGpuInstanceId.Unlock() + return mock.GetGpuInstanceIdFunc() +} + +// GetGpuInstanceIdCalls gets all the calls that were made to GetGpuInstanceId. +// Check the length with: +// +// len(mockedDevice.GetGpuInstanceIdCalls()) +func (mock *Device) GetGpuInstanceIdCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpuInstanceId.RLock() + calls = mock.calls.GetGpuInstanceId + mock.lockGetGpuInstanceId.RUnlock() + return calls +} + +// GetGpuInstancePossiblePlacements calls GetGpuInstancePossiblePlacementsFunc. +func (mock *Device) GetGpuInstancePossiblePlacements(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstancePlacement, nvml.Return) { + if mock.GetGpuInstancePossiblePlacementsFunc == nil { + panic("Device.GetGpuInstancePossiblePlacementsFunc: method is nil but Device.GetGpuInstancePossiblePlacements was just called") + } + callInfo := struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + }{ + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + } + mock.lockGetGpuInstancePossiblePlacements.Lock() + mock.calls.GetGpuInstancePossiblePlacements = append(mock.calls.GetGpuInstancePossiblePlacements, callInfo) + mock.lockGetGpuInstancePossiblePlacements.Unlock() + return mock.GetGpuInstancePossiblePlacementsFunc(gpuInstanceProfileInfo) +} + +// GetGpuInstancePossiblePlacementsCalls gets all the calls that were made to GetGpuInstancePossiblePlacements. +// Check the length with: +// +// len(mockedDevice.GetGpuInstancePossiblePlacementsCalls()) +func (mock *Device) GetGpuInstancePossiblePlacementsCalls() []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo +} { + var calls []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + mock.lockGetGpuInstancePossiblePlacements.RLock() + calls = mock.calls.GetGpuInstancePossiblePlacements + mock.lockGetGpuInstancePossiblePlacements.RUnlock() + return calls +} + +// GetGpuInstanceProfileInfo calls GetGpuInstanceProfileInfoFunc. +func (mock *Device) GetGpuInstanceProfileInfo(n int) (nvml.GpuInstanceProfileInfo, nvml.Return) { + if mock.GetGpuInstanceProfileInfoFunc == nil { + panic("Device.GetGpuInstanceProfileInfoFunc: method is nil but Device.GetGpuInstanceProfileInfo was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetGpuInstanceProfileInfo.Lock() + mock.calls.GetGpuInstanceProfileInfo = append(mock.calls.GetGpuInstanceProfileInfo, callInfo) + mock.lockGetGpuInstanceProfileInfo.Unlock() + return mock.GetGpuInstanceProfileInfoFunc(n) +} + +// GetGpuInstanceProfileInfoCalls gets all the calls that were made to GetGpuInstanceProfileInfo. +// Check the length with: +// +// len(mockedDevice.GetGpuInstanceProfileInfoCalls()) +func (mock *Device) GetGpuInstanceProfileInfoCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetGpuInstanceProfileInfo.RLock() + calls = mock.calls.GetGpuInstanceProfileInfo + mock.lockGetGpuInstanceProfileInfo.RUnlock() + return calls +} + +// GetGpuInstanceProfileInfoV calls GetGpuInstanceProfileInfoVFunc. +func (mock *Device) GetGpuInstanceProfileInfoV(n int) nvml.GpuInstanceProfileInfoV { + if mock.GetGpuInstanceProfileInfoVFunc == nil { + panic("Device.GetGpuInstanceProfileInfoVFunc: method is nil but Device.GetGpuInstanceProfileInfoV was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetGpuInstanceProfileInfoV.Lock() + mock.calls.GetGpuInstanceProfileInfoV = append(mock.calls.GetGpuInstanceProfileInfoV, callInfo) + mock.lockGetGpuInstanceProfileInfoV.Unlock() + return mock.GetGpuInstanceProfileInfoVFunc(n) +} + +// GetGpuInstanceProfileInfoVCalls gets all the calls that were made to GetGpuInstanceProfileInfoV. +// Check the length with: +// +// len(mockedDevice.GetGpuInstanceProfileInfoVCalls()) +func (mock *Device) GetGpuInstanceProfileInfoVCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetGpuInstanceProfileInfoV.RLock() + calls = mock.calls.GetGpuInstanceProfileInfoV + mock.lockGetGpuInstanceProfileInfoV.RUnlock() + return calls +} + +// GetGpuInstanceRemainingCapacity calls GetGpuInstanceRemainingCapacityFunc. +func (mock *Device) GetGpuInstanceRemainingCapacity(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (int, nvml.Return) { + if mock.GetGpuInstanceRemainingCapacityFunc == nil { + panic("Device.GetGpuInstanceRemainingCapacityFunc: method is nil but Device.GetGpuInstanceRemainingCapacity was just called") + } + callInfo := struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + }{ + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + } + mock.lockGetGpuInstanceRemainingCapacity.Lock() + mock.calls.GetGpuInstanceRemainingCapacity = append(mock.calls.GetGpuInstanceRemainingCapacity, callInfo) + mock.lockGetGpuInstanceRemainingCapacity.Unlock() + return mock.GetGpuInstanceRemainingCapacityFunc(gpuInstanceProfileInfo) +} + +// GetGpuInstanceRemainingCapacityCalls gets all the calls that were made to GetGpuInstanceRemainingCapacity. +// Check the length with: +// +// len(mockedDevice.GetGpuInstanceRemainingCapacityCalls()) +func (mock *Device) GetGpuInstanceRemainingCapacityCalls() []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo +} { + var calls []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + mock.lockGetGpuInstanceRemainingCapacity.RLock() + calls = mock.calls.GetGpuInstanceRemainingCapacity + mock.lockGetGpuInstanceRemainingCapacity.RUnlock() + return calls +} + +// GetGpuInstances calls GetGpuInstancesFunc. +func (mock *Device) GetGpuInstances(gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstance, nvml.Return) { + if mock.GetGpuInstancesFunc == nil { + panic("Device.GetGpuInstancesFunc: method is nil but Device.GetGpuInstances was just called") + } + callInfo := struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + }{ + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + } + mock.lockGetGpuInstances.Lock() + mock.calls.GetGpuInstances = append(mock.calls.GetGpuInstances, callInfo) + mock.lockGetGpuInstances.Unlock() + return mock.GetGpuInstancesFunc(gpuInstanceProfileInfo) +} + +// GetGpuInstancesCalls gets all the calls that were made to GetGpuInstances. +// Check the length with: +// +// len(mockedDevice.GetGpuInstancesCalls()) +func (mock *Device) GetGpuInstancesCalls() []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo +} { + var calls []struct { + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + mock.lockGetGpuInstances.RLock() + calls = mock.calls.GetGpuInstances + mock.lockGetGpuInstances.RUnlock() + return calls +} + +// GetGpuMaxPcieLinkGeneration calls GetGpuMaxPcieLinkGenerationFunc. +func (mock *Device) GetGpuMaxPcieLinkGeneration() (int, nvml.Return) { + if mock.GetGpuMaxPcieLinkGenerationFunc == nil { + panic("Device.GetGpuMaxPcieLinkGenerationFunc: method is nil but Device.GetGpuMaxPcieLinkGeneration was just called") + } + callInfo := struct { + }{} + mock.lockGetGpuMaxPcieLinkGeneration.Lock() + mock.calls.GetGpuMaxPcieLinkGeneration = append(mock.calls.GetGpuMaxPcieLinkGeneration, callInfo) + mock.lockGetGpuMaxPcieLinkGeneration.Unlock() + return mock.GetGpuMaxPcieLinkGenerationFunc() +} + +// GetGpuMaxPcieLinkGenerationCalls gets all the calls that were made to GetGpuMaxPcieLinkGeneration. +// Check the length with: +// +// len(mockedDevice.GetGpuMaxPcieLinkGenerationCalls()) +func (mock *Device) GetGpuMaxPcieLinkGenerationCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpuMaxPcieLinkGeneration.RLock() + calls = mock.calls.GetGpuMaxPcieLinkGeneration + mock.lockGetGpuMaxPcieLinkGeneration.RUnlock() + return calls +} + +// GetGpuOperationMode calls GetGpuOperationModeFunc. +func (mock *Device) GetGpuOperationMode() (nvml.GpuOperationMode, nvml.GpuOperationMode, nvml.Return) { + if mock.GetGpuOperationModeFunc == nil { + panic("Device.GetGpuOperationModeFunc: method is nil but Device.GetGpuOperationMode was just called") + } + callInfo := struct { + }{} + mock.lockGetGpuOperationMode.Lock() + mock.calls.GetGpuOperationMode = append(mock.calls.GetGpuOperationMode, callInfo) + mock.lockGetGpuOperationMode.Unlock() + return mock.GetGpuOperationModeFunc() +} + +// GetGpuOperationModeCalls gets all the calls that were made to GetGpuOperationMode. +// Check the length with: +// +// len(mockedDevice.GetGpuOperationModeCalls()) +func (mock *Device) GetGpuOperationModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpuOperationMode.RLock() + calls = mock.calls.GetGpuOperationMode + mock.lockGetGpuOperationMode.RUnlock() + return calls +} + +// GetGraphicsRunningProcesses calls GetGraphicsRunningProcessesFunc. +func (mock *Device) GetGraphicsRunningProcesses() ([]nvml.ProcessInfo, nvml.Return) { + if mock.GetGraphicsRunningProcessesFunc == nil { + panic("Device.GetGraphicsRunningProcessesFunc: method is nil but Device.GetGraphicsRunningProcesses was just called") + } + callInfo := struct { + }{} + mock.lockGetGraphicsRunningProcesses.Lock() + mock.calls.GetGraphicsRunningProcesses = append(mock.calls.GetGraphicsRunningProcesses, callInfo) + mock.lockGetGraphicsRunningProcesses.Unlock() + return mock.GetGraphicsRunningProcessesFunc() +} + +// GetGraphicsRunningProcessesCalls gets all the calls that were made to GetGraphicsRunningProcesses. +// Check the length with: +// +// len(mockedDevice.GetGraphicsRunningProcessesCalls()) +func (mock *Device) GetGraphicsRunningProcessesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGraphicsRunningProcesses.RLock() + calls = mock.calls.GetGraphicsRunningProcesses + mock.lockGetGraphicsRunningProcesses.RUnlock() + return calls +} + +// GetGridLicensableFeatures calls GetGridLicensableFeaturesFunc. +func (mock *Device) GetGridLicensableFeatures() (nvml.GridLicensableFeatures, nvml.Return) { + if mock.GetGridLicensableFeaturesFunc == nil { + panic("Device.GetGridLicensableFeaturesFunc: method is nil but Device.GetGridLicensableFeatures was just called") + } + callInfo := struct { + }{} + mock.lockGetGridLicensableFeatures.Lock() + mock.calls.GetGridLicensableFeatures = append(mock.calls.GetGridLicensableFeatures, callInfo) + mock.lockGetGridLicensableFeatures.Unlock() + return mock.GetGridLicensableFeaturesFunc() +} + +// GetGridLicensableFeaturesCalls gets all the calls that were made to GetGridLicensableFeatures. +// Check the length with: +// +// len(mockedDevice.GetGridLicensableFeaturesCalls()) +func (mock *Device) GetGridLicensableFeaturesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGridLicensableFeatures.RLock() + calls = mock.calls.GetGridLicensableFeatures + mock.lockGetGridLicensableFeatures.RUnlock() + return calls +} + +// GetGspFirmwareMode calls GetGspFirmwareModeFunc. +func (mock *Device) GetGspFirmwareMode() (bool, bool, nvml.Return) { + if mock.GetGspFirmwareModeFunc == nil { + panic("Device.GetGspFirmwareModeFunc: method is nil but Device.GetGspFirmwareMode was just called") + } + callInfo := struct { + }{} + mock.lockGetGspFirmwareMode.Lock() + mock.calls.GetGspFirmwareMode = append(mock.calls.GetGspFirmwareMode, callInfo) + mock.lockGetGspFirmwareMode.Unlock() + return mock.GetGspFirmwareModeFunc() +} + +// GetGspFirmwareModeCalls gets all the calls that were made to GetGspFirmwareMode. +// Check the length with: +// +// len(mockedDevice.GetGspFirmwareModeCalls()) +func (mock *Device) GetGspFirmwareModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGspFirmwareMode.RLock() + calls = mock.calls.GetGspFirmwareMode + mock.lockGetGspFirmwareMode.RUnlock() + return calls +} + +// GetGspFirmwareVersion calls GetGspFirmwareVersionFunc. +func (mock *Device) GetGspFirmwareVersion() (string, nvml.Return) { + if mock.GetGspFirmwareVersionFunc == nil { + panic("Device.GetGspFirmwareVersionFunc: method is nil but Device.GetGspFirmwareVersion was just called") + } + callInfo := struct { + }{} + mock.lockGetGspFirmwareVersion.Lock() + mock.calls.GetGspFirmwareVersion = append(mock.calls.GetGspFirmwareVersion, callInfo) + mock.lockGetGspFirmwareVersion.Unlock() + return mock.GetGspFirmwareVersionFunc() +} + +// GetGspFirmwareVersionCalls gets all the calls that were made to GetGspFirmwareVersion. +// Check the length with: +// +// len(mockedDevice.GetGspFirmwareVersionCalls()) +func (mock *Device) GetGspFirmwareVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGspFirmwareVersion.RLock() + calls = mock.calls.GetGspFirmwareVersion + mock.lockGetGspFirmwareVersion.RUnlock() + return calls +} + +// GetHostVgpuMode calls GetHostVgpuModeFunc. +func (mock *Device) GetHostVgpuMode() (nvml.HostVgpuMode, nvml.Return) { + if mock.GetHostVgpuModeFunc == nil { + panic("Device.GetHostVgpuModeFunc: method is nil but Device.GetHostVgpuMode was just called") + } + callInfo := struct { + }{} + mock.lockGetHostVgpuMode.Lock() + mock.calls.GetHostVgpuMode = append(mock.calls.GetHostVgpuMode, callInfo) + mock.lockGetHostVgpuMode.Unlock() + return mock.GetHostVgpuModeFunc() +} + +// GetHostVgpuModeCalls gets all the calls that were made to GetHostVgpuMode. +// Check the length with: +// +// len(mockedDevice.GetHostVgpuModeCalls()) +func (mock *Device) GetHostVgpuModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetHostVgpuMode.RLock() + calls = mock.calls.GetHostVgpuMode + mock.lockGetHostVgpuMode.RUnlock() + return calls +} + +// GetIndex calls GetIndexFunc. +func (mock *Device) GetIndex() (int, nvml.Return) { + if mock.GetIndexFunc == nil { + panic("Device.GetIndexFunc: method is nil but Device.GetIndex was just called") + } + callInfo := struct { + }{} + mock.lockGetIndex.Lock() + mock.calls.GetIndex = append(mock.calls.GetIndex, callInfo) + mock.lockGetIndex.Unlock() + return mock.GetIndexFunc() +} + +// GetIndexCalls gets all the calls that were made to GetIndex. +// Check the length with: +// +// len(mockedDevice.GetIndexCalls()) +func (mock *Device) GetIndexCalls() []struct { +} { + var calls []struct { + } + mock.lockGetIndex.RLock() + calls = mock.calls.GetIndex + mock.lockGetIndex.RUnlock() + return calls +} + +// GetInforomConfigurationChecksum calls GetInforomConfigurationChecksumFunc. +func (mock *Device) GetInforomConfigurationChecksum() (uint32, nvml.Return) { + if mock.GetInforomConfigurationChecksumFunc == nil { + panic("Device.GetInforomConfigurationChecksumFunc: method is nil but Device.GetInforomConfigurationChecksum was just called") + } + callInfo := struct { + }{} + mock.lockGetInforomConfigurationChecksum.Lock() + mock.calls.GetInforomConfigurationChecksum = append(mock.calls.GetInforomConfigurationChecksum, callInfo) + mock.lockGetInforomConfigurationChecksum.Unlock() + return mock.GetInforomConfigurationChecksumFunc() +} + +// GetInforomConfigurationChecksumCalls gets all the calls that were made to GetInforomConfigurationChecksum. +// Check the length with: +// +// len(mockedDevice.GetInforomConfigurationChecksumCalls()) +func (mock *Device) GetInforomConfigurationChecksumCalls() []struct { +} { + var calls []struct { + } + mock.lockGetInforomConfigurationChecksum.RLock() + calls = mock.calls.GetInforomConfigurationChecksum + mock.lockGetInforomConfigurationChecksum.RUnlock() + return calls +} + +// GetInforomImageVersion calls GetInforomImageVersionFunc. +func (mock *Device) GetInforomImageVersion() (string, nvml.Return) { + if mock.GetInforomImageVersionFunc == nil { + panic("Device.GetInforomImageVersionFunc: method is nil but Device.GetInforomImageVersion was just called") + } + callInfo := struct { + }{} + mock.lockGetInforomImageVersion.Lock() + mock.calls.GetInforomImageVersion = append(mock.calls.GetInforomImageVersion, callInfo) + mock.lockGetInforomImageVersion.Unlock() + return mock.GetInforomImageVersionFunc() +} + +// GetInforomImageVersionCalls gets all the calls that were made to GetInforomImageVersion. +// Check the length with: +// +// len(mockedDevice.GetInforomImageVersionCalls()) +func (mock *Device) GetInforomImageVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockGetInforomImageVersion.RLock() + calls = mock.calls.GetInforomImageVersion + mock.lockGetInforomImageVersion.RUnlock() + return calls +} + +// GetInforomVersion calls GetInforomVersionFunc. +func (mock *Device) GetInforomVersion(inforomObject nvml.InforomObject) (string, nvml.Return) { + if mock.GetInforomVersionFunc == nil { + panic("Device.GetInforomVersionFunc: method is nil but Device.GetInforomVersion was just called") + } + callInfo := struct { + InforomObject nvml.InforomObject + }{ + InforomObject: inforomObject, + } + mock.lockGetInforomVersion.Lock() + mock.calls.GetInforomVersion = append(mock.calls.GetInforomVersion, callInfo) + mock.lockGetInforomVersion.Unlock() + return mock.GetInforomVersionFunc(inforomObject) +} + +// GetInforomVersionCalls gets all the calls that were made to GetInforomVersion. +// Check the length with: +// +// len(mockedDevice.GetInforomVersionCalls()) +func (mock *Device) GetInforomVersionCalls() []struct { + InforomObject nvml.InforomObject +} { + var calls []struct { + InforomObject nvml.InforomObject + } + mock.lockGetInforomVersion.RLock() + calls = mock.calls.GetInforomVersion + mock.lockGetInforomVersion.RUnlock() + return calls +} + +// GetIrqNum calls GetIrqNumFunc. +func (mock *Device) GetIrqNum() (int, nvml.Return) { + if mock.GetIrqNumFunc == nil { + panic("Device.GetIrqNumFunc: method is nil but Device.GetIrqNum was just called") + } + callInfo := struct { + }{} + mock.lockGetIrqNum.Lock() + mock.calls.GetIrqNum = append(mock.calls.GetIrqNum, callInfo) + mock.lockGetIrqNum.Unlock() + return mock.GetIrqNumFunc() +} + +// GetIrqNumCalls gets all the calls that were made to GetIrqNum. +// Check the length with: +// +// len(mockedDevice.GetIrqNumCalls()) +func (mock *Device) GetIrqNumCalls() []struct { +} { + var calls []struct { + } + mock.lockGetIrqNum.RLock() + calls = mock.calls.GetIrqNum + mock.lockGetIrqNum.RUnlock() + return calls +} + +// GetMPSComputeRunningProcesses calls GetMPSComputeRunningProcessesFunc. +func (mock *Device) GetMPSComputeRunningProcesses() ([]nvml.ProcessInfo, nvml.Return) { + if mock.GetMPSComputeRunningProcessesFunc == nil { + panic("Device.GetMPSComputeRunningProcessesFunc: method is nil but Device.GetMPSComputeRunningProcesses was just called") + } + callInfo := struct { + }{} + mock.lockGetMPSComputeRunningProcesses.Lock() + mock.calls.GetMPSComputeRunningProcesses = append(mock.calls.GetMPSComputeRunningProcesses, callInfo) + mock.lockGetMPSComputeRunningProcesses.Unlock() + return mock.GetMPSComputeRunningProcessesFunc() +} + +// GetMPSComputeRunningProcessesCalls gets all the calls that were made to GetMPSComputeRunningProcesses. +// Check the length with: +// +// len(mockedDevice.GetMPSComputeRunningProcessesCalls()) +func (mock *Device) GetMPSComputeRunningProcessesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMPSComputeRunningProcesses.RLock() + calls = mock.calls.GetMPSComputeRunningProcesses + mock.lockGetMPSComputeRunningProcesses.RUnlock() + return calls +} + +// GetMaxClockInfo calls GetMaxClockInfoFunc. +func (mock *Device) GetMaxClockInfo(clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.GetMaxClockInfoFunc == nil { + panic("Device.GetMaxClockInfoFunc: method is nil but Device.GetMaxClockInfo was just called") + } + callInfo := struct { + ClockType nvml.ClockType + }{ + ClockType: clockType, + } + mock.lockGetMaxClockInfo.Lock() + mock.calls.GetMaxClockInfo = append(mock.calls.GetMaxClockInfo, callInfo) + mock.lockGetMaxClockInfo.Unlock() + return mock.GetMaxClockInfoFunc(clockType) +} + +// GetMaxClockInfoCalls gets all the calls that were made to GetMaxClockInfo. +// Check the length with: +// +// len(mockedDevice.GetMaxClockInfoCalls()) +func (mock *Device) GetMaxClockInfoCalls() []struct { + ClockType nvml.ClockType +} { + var calls []struct { + ClockType nvml.ClockType + } + mock.lockGetMaxClockInfo.RLock() + calls = mock.calls.GetMaxClockInfo + mock.lockGetMaxClockInfo.RUnlock() + return calls +} + +// GetMaxCustomerBoostClock calls GetMaxCustomerBoostClockFunc. +func (mock *Device) GetMaxCustomerBoostClock(clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.GetMaxCustomerBoostClockFunc == nil { + panic("Device.GetMaxCustomerBoostClockFunc: method is nil but Device.GetMaxCustomerBoostClock was just called") + } + callInfo := struct { + ClockType nvml.ClockType + }{ + ClockType: clockType, + } + mock.lockGetMaxCustomerBoostClock.Lock() + mock.calls.GetMaxCustomerBoostClock = append(mock.calls.GetMaxCustomerBoostClock, callInfo) + mock.lockGetMaxCustomerBoostClock.Unlock() + return mock.GetMaxCustomerBoostClockFunc(clockType) +} + +// GetMaxCustomerBoostClockCalls gets all the calls that were made to GetMaxCustomerBoostClock. +// Check the length with: +// +// len(mockedDevice.GetMaxCustomerBoostClockCalls()) +func (mock *Device) GetMaxCustomerBoostClockCalls() []struct { + ClockType nvml.ClockType +} { + var calls []struct { + ClockType nvml.ClockType + } + mock.lockGetMaxCustomerBoostClock.RLock() + calls = mock.calls.GetMaxCustomerBoostClock + mock.lockGetMaxCustomerBoostClock.RUnlock() + return calls +} + +// GetMaxMigDeviceCount calls GetMaxMigDeviceCountFunc. +func (mock *Device) GetMaxMigDeviceCount() (int, nvml.Return) { + if mock.GetMaxMigDeviceCountFunc == nil { + panic("Device.GetMaxMigDeviceCountFunc: method is nil but Device.GetMaxMigDeviceCount was just called") + } + callInfo := struct { + }{} + mock.lockGetMaxMigDeviceCount.Lock() + mock.calls.GetMaxMigDeviceCount = append(mock.calls.GetMaxMigDeviceCount, callInfo) + mock.lockGetMaxMigDeviceCount.Unlock() + return mock.GetMaxMigDeviceCountFunc() +} + +// GetMaxMigDeviceCountCalls gets all the calls that were made to GetMaxMigDeviceCount. +// Check the length with: +// +// len(mockedDevice.GetMaxMigDeviceCountCalls()) +func (mock *Device) GetMaxMigDeviceCountCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMaxMigDeviceCount.RLock() + calls = mock.calls.GetMaxMigDeviceCount + mock.lockGetMaxMigDeviceCount.RUnlock() + return calls +} + +// GetMaxPcieLinkGeneration calls GetMaxPcieLinkGenerationFunc. +func (mock *Device) GetMaxPcieLinkGeneration() (int, nvml.Return) { + if mock.GetMaxPcieLinkGenerationFunc == nil { + panic("Device.GetMaxPcieLinkGenerationFunc: method is nil but Device.GetMaxPcieLinkGeneration was just called") + } + callInfo := struct { + }{} + mock.lockGetMaxPcieLinkGeneration.Lock() + mock.calls.GetMaxPcieLinkGeneration = append(mock.calls.GetMaxPcieLinkGeneration, callInfo) + mock.lockGetMaxPcieLinkGeneration.Unlock() + return mock.GetMaxPcieLinkGenerationFunc() +} + +// GetMaxPcieLinkGenerationCalls gets all the calls that were made to GetMaxPcieLinkGeneration. +// Check the length with: +// +// len(mockedDevice.GetMaxPcieLinkGenerationCalls()) +func (mock *Device) GetMaxPcieLinkGenerationCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMaxPcieLinkGeneration.RLock() + calls = mock.calls.GetMaxPcieLinkGeneration + mock.lockGetMaxPcieLinkGeneration.RUnlock() + return calls +} + +// GetMaxPcieLinkWidth calls GetMaxPcieLinkWidthFunc. +func (mock *Device) GetMaxPcieLinkWidth() (int, nvml.Return) { + if mock.GetMaxPcieLinkWidthFunc == nil { + panic("Device.GetMaxPcieLinkWidthFunc: method is nil but Device.GetMaxPcieLinkWidth was just called") + } + callInfo := struct { + }{} + mock.lockGetMaxPcieLinkWidth.Lock() + mock.calls.GetMaxPcieLinkWidth = append(mock.calls.GetMaxPcieLinkWidth, callInfo) + mock.lockGetMaxPcieLinkWidth.Unlock() + return mock.GetMaxPcieLinkWidthFunc() +} + +// GetMaxPcieLinkWidthCalls gets all the calls that were made to GetMaxPcieLinkWidth. +// Check the length with: +// +// len(mockedDevice.GetMaxPcieLinkWidthCalls()) +func (mock *Device) GetMaxPcieLinkWidthCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMaxPcieLinkWidth.RLock() + calls = mock.calls.GetMaxPcieLinkWidth + mock.lockGetMaxPcieLinkWidth.RUnlock() + return calls +} + +// GetMemClkMinMaxVfOffset calls GetMemClkMinMaxVfOffsetFunc. +func (mock *Device) GetMemClkMinMaxVfOffset() (int, int, nvml.Return) { + if mock.GetMemClkMinMaxVfOffsetFunc == nil { + panic("Device.GetMemClkMinMaxVfOffsetFunc: method is nil but Device.GetMemClkMinMaxVfOffset was just called") + } + callInfo := struct { + }{} + mock.lockGetMemClkMinMaxVfOffset.Lock() + mock.calls.GetMemClkMinMaxVfOffset = append(mock.calls.GetMemClkMinMaxVfOffset, callInfo) + mock.lockGetMemClkMinMaxVfOffset.Unlock() + return mock.GetMemClkMinMaxVfOffsetFunc() +} + +// GetMemClkMinMaxVfOffsetCalls gets all the calls that were made to GetMemClkMinMaxVfOffset. +// Check the length with: +// +// len(mockedDevice.GetMemClkMinMaxVfOffsetCalls()) +func (mock *Device) GetMemClkMinMaxVfOffsetCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMemClkMinMaxVfOffset.RLock() + calls = mock.calls.GetMemClkMinMaxVfOffset + mock.lockGetMemClkMinMaxVfOffset.RUnlock() + return calls +} + +// GetMemClkVfOffset calls GetMemClkVfOffsetFunc. +func (mock *Device) GetMemClkVfOffset() (int, nvml.Return) { + if mock.GetMemClkVfOffsetFunc == nil { + panic("Device.GetMemClkVfOffsetFunc: method is nil but Device.GetMemClkVfOffset was just called") + } + callInfo := struct { + }{} + mock.lockGetMemClkVfOffset.Lock() + mock.calls.GetMemClkVfOffset = append(mock.calls.GetMemClkVfOffset, callInfo) + mock.lockGetMemClkVfOffset.Unlock() + return mock.GetMemClkVfOffsetFunc() +} + +// GetMemClkVfOffsetCalls gets all the calls that were made to GetMemClkVfOffset. +// Check the length with: +// +// len(mockedDevice.GetMemClkVfOffsetCalls()) +func (mock *Device) GetMemClkVfOffsetCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMemClkVfOffset.RLock() + calls = mock.calls.GetMemClkVfOffset + mock.lockGetMemClkVfOffset.RUnlock() + return calls +} + +// GetMemoryAffinity calls GetMemoryAffinityFunc. +func (mock *Device) GetMemoryAffinity(n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) { + if mock.GetMemoryAffinityFunc == nil { + panic("Device.GetMemoryAffinityFunc: method is nil but Device.GetMemoryAffinity was just called") + } + callInfo := struct { + N int + AffinityScope nvml.AffinityScope + }{ + N: n, + AffinityScope: affinityScope, + } + mock.lockGetMemoryAffinity.Lock() + mock.calls.GetMemoryAffinity = append(mock.calls.GetMemoryAffinity, callInfo) + mock.lockGetMemoryAffinity.Unlock() + return mock.GetMemoryAffinityFunc(n, affinityScope) +} + +// GetMemoryAffinityCalls gets all the calls that were made to GetMemoryAffinity. +// Check the length with: +// +// len(mockedDevice.GetMemoryAffinityCalls()) +func (mock *Device) GetMemoryAffinityCalls() []struct { + N int + AffinityScope nvml.AffinityScope +} { + var calls []struct { + N int + AffinityScope nvml.AffinityScope + } + mock.lockGetMemoryAffinity.RLock() + calls = mock.calls.GetMemoryAffinity + mock.lockGetMemoryAffinity.RUnlock() + return calls +} + +// GetMemoryBusWidth calls GetMemoryBusWidthFunc. +func (mock *Device) GetMemoryBusWidth() (uint32, nvml.Return) { + if mock.GetMemoryBusWidthFunc == nil { + panic("Device.GetMemoryBusWidthFunc: method is nil but Device.GetMemoryBusWidth was just called") + } + callInfo := struct { + }{} + mock.lockGetMemoryBusWidth.Lock() + mock.calls.GetMemoryBusWidth = append(mock.calls.GetMemoryBusWidth, callInfo) + mock.lockGetMemoryBusWidth.Unlock() + return mock.GetMemoryBusWidthFunc() +} + +// GetMemoryBusWidthCalls gets all the calls that were made to GetMemoryBusWidth. +// Check the length with: +// +// len(mockedDevice.GetMemoryBusWidthCalls()) +func (mock *Device) GetMemoryBusWidthCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMemoryBusWidth.RLock() + calls = mock.calls.GetMemoryBusWidth + mock.lockGetMemoryBusWidth.RUnlock() + return calls +} + +// GetMemoryErrorCounter calls GetMemoryErrorCounterFunc. +func (mock *Device) GetMemoryErrorCounter(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType, memoryLocation nvml.MemoryLocation) (uint64, nvml.Return) { + if mock.GetMemoryErrorCounterFunc == nil { + panic("Device.GetMemoryErrorCounterFunc: method is nil but Device.GetMemoryErrorCounter was just called") + } + callInfo := struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + MemoryLocation nvml.MemoryLocation + }{ + MemoryErrorType: memoryErrorType, + EccCounterType: eccCounterType, + MemoryLocation: memoryLocation, + } + mock.lockGetMemoryErrorCounter.Lock() + mock.calls.GetMemoryErrorCounter = append(mock.calls.GetMemoryErrorCounter, callInfo) + mock.lockGetMemoryErrorCounter.Unlock() + return mock.GetMemoryErrorCounterFunc(memoryErrorType, eccCounterType, memoryLocation) +} + +// GetMemoryErrorCounterCalls gets all the calls that were made to GetMemoryErrorCounter. +// Check the length with: +// +// len(mockedDevice.GetMemoryErrorCounterCalls()) +func (mock *Device) GetMemoryErrorCounterCalls() []struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + MemoryLocation nvml.MemoryLocation +} { + var calls []struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + MemoryLocation nvml.MemoryLocation + } + mock.lockGetMemoryErrorCounter.RLock() + calls = mock.calls.GetMemoryErrorCounter + mock.lockGetMemoryErrorCounter.RUnlock() + return calls +} + +// GetMemoryInfo calls GetMemoryInfoFunc. +func (mock *Device) GetMemoryInfo() (nvml.Memory, nvml.Return) { + if mock.GetMemoryInfoFunc == nil { + panic("Device.GetMemoryInfoFunc: method is nil but Device.GetMemoryInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetMemoryInfo.Lock() + mock.calls.GetMemoryInfo = append(mock.calls.GetMemoryInfo, callInfo) + mock.lockGetMemoryInfo.Unlock() + return mock.GetMemoryInfoFunc() +} + +// GetMemoryInfoCalls gets all the calls that were made to GetMemoryInfo. +// Check the length with: +// +// len(mockedDevice.GetMemoryInfoCalls()) +func (mock *Device) GetMemoryInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMemoryInfo.RLock() + calls = mock.calls.GetMemoryInfo + mock.lockGetMemoryInfo.RUnlock() + return calls +} + +// GetMemoryInfo_v2 calls GetMemoryInfo_v2Func. +func (mock *Device) GetMemoryInfo_v2() (nvml.Memory_v2, nvml.Return) { + if mock.GetMemoryInfo_v2Func == nil { + panic("Device.GetMemoryInfo_v2Func: method is nil but Device.GetMemoryInfo_v2 was just called") + } + callInfo := struct { + }{} + mock.lockGetMemoryInfo_v2.Lock() + mock.calls.GetMemoryInfo_v2 = append(mock.calls.GetMemoryInfo_v2, callInfo) + mock.lockGetMemoryInfo_v2.Unlock() + return mock.GetMemoryInfo_v2Func() +} + +// GetMemoryInfo_v2Calls gets all the calls that were made to GetMemoryInfo_v2. +// Check the length with: +// +// len(mockedDevice.GetMemoryInfo_v2Calls()) +func (mock *Device) GetMemoryInfo_v2Calls() []struct { +} { + var calls []struct { + } + mock.lockGetMemoryInfo_v2.RLock() + calls = mock.calls.GetMemoryInfo_v2 + mock.lockGetMemoryInfo_v2.RUnlock() + return calls +} + +// GetMigDeviceHandleByIndex calls GetMigDeviceHandleByIndexFunc. +func (mock *Device) GetMigDeviceHandleByIndex(n int) (nvml.Device, nvml.Return) { + if mock.GetMigDeviceHandleByIndexFunc == nil { + panic("Device.GetMigDeviceHandleByIndexFunc: method is nil but Device.GetMigDeviceHandleByIndex was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetMigDeviceHandleByIndex.Lock() + mock.calls.GetMigDeviceHandleByIndex = append(mock.calls.GetMigDeviceHandleByIndex, callInfo) + mock.lockGetMigDeviceHandleByIndex.Unlock() + return mock.GetMigDeviceHandleByIndexFunc(n) +} + +// GetMigDeviceHandleByIndexCalls gets all the calls that were made to GetMigDeviceHandleByIndex. +// Check the length with: +// +// len(mockedDevice.GetMigDeviceHandleByIndexCalls()) +func (mock *Device) GetMigDeviceHandleByIndexCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetMigDeviceHandleByIndex.RLock() + calls = mock.calls.GetMigDeviceHandleByIndex + mock.lockGetMigDeviceHandleByIndex.RUnlock() + return calls +} + +// GetMigMode calls GetMigModeFunc. +func (mock *Device) GetMigMode() (int, int, nvml.Return) { + if mock.GetMigModeFunc == nil { + panic("Device.GetMigModeFunc: method is nil but Device.GetMigMode was just called") + } + callInfo := struct { + }{} + mock.lockGetMigMode.Lock() + mock.calls.GetMigMode = append(mock.calls.GetMigMode, callInfo) + mock.lockGetMigMode.Unlock() + return mock.GetMigModeFunc() +} + +// GetMigModeCalls gets all the calls that were made to GetMigMode. +// Check the length with: +// +// len(mockedDevice.GetMigModeCalls()) +func (mock *Device) GetMigModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMigMode.RLock() + calls = mock.calls.GetMigMode + mock.lockGetMigMode.RUnlock() + return calls +} + +// GetMinMaxClockOfPState calls GetMinMaxClockOfPStateFunc. +func (mock *Device) GetMinMaxClockOfPState(clockType nvml.ClockType, pstates nvml.Pstates) (uint32, uint32, nvml.Return) { + if mock.GetMinMaxClockOfPStateFunc == nil { + panic("Device.GetMinMaxClockOfPStateFunc: method is nil but Device.GetMinMaxClockOfPState was just called") + } + callInfo := struct { + ClockType nvml.ClockType + Pstates nvml.Pstates + }{ + ClockType: clockType, + Pstates: pstates, + } + mock.lockGetMinMaxClockOfPState.Lock() + mock.calls.GetMinMaxClockOfPState = append(mock.calls.GetMinMaxClockOfPState, callInfo) + mock.lockGetMinMaxClockOfPState.Unlock() + return mock.GetMinMaxClockOfPStateFunc(clockType, pstates) +} + +// GetMinMaxClockOfPStateCalls gets all the calls that were made to GetMinMaxClockOfPState. +// Check the length with: +// +// len(mockedDevice.GetMinMaxClockOfPStateCalls()) +func (mock *Device) GetMinMaxClockOfPStateCalls() []struct { + ClockType nvml.ClockType + Pstates nvml.Pstates +} { + var calls []struct { + ClockType nvml.ClockType + Pstates nvml.Pstates + } + mock.lockGetMinMaxClockOfPState.RLock() + calls = mock.calls.GetMinMaxClockOfPState + mock.lockGetMinMaxClockOfPState.RUnlock() + return calls +} + +// GetMinMaxFanSpeed calls GetMinMaxFanSpeedFunc. +func (mock *Device) GetMinMaxFanSpeed() (int, int, nvml.Return) { + if mock.GetMinMaxFanSpeedFunc == nil { + panic("Device.GetMinMaxFanSpeedFunc: method is nil but Device.GetMinMaxFanSpeed was just called") + } + callInfo := struct { + }{} + mock.lockGetMinMaxFanSpeed.Lock() + mock.calls.GetMinMaxFanSpeed = append(mock.calls.GetMinMaxFanSpeed, callInfo) + mock.lockGetMinMaxFanSpeed.Unlock() + return mock.GetMinMaxFanSpeedFunc() +} + +// GetMinMaxFanSpeedCalls gets all the calls that were made to GetMinMaxFanSpeed. +// Check the length with: +// +// len(mockedDevice.GetMinMaxFanSpeedCalls()) +func (mock *Device) GetMinMaxFanSpeedCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMinMaxFanSpeed.RLock() + calls = mock.calls.GetMinMaxFanSpeed + mock.lockGetMinMaxFanSpeed.RUnlock() + return calls +} + +// GetMinorNumber calls GetMinorNumberFunc. +func (mock *Device) GetMinorNumber() (int, nvml.Return) { + if mock.GetMinorNumberFunc == nil { + panic("Device.GetMinorNumberFunc: method is nil but Device.GetMinorNumber was just called") + } + callInfo := struct { + }{} + mock.lockGetMinorNumber.Lock() + mock.calls.GetMinorNumber = append(mock.calls.GetMinorNumber, callInfo) + mock.lockGetMinorNumber.Unlock() + return mock.GetMinorNumberFunc() +} + +// GetMinorNumberCalls gets all the calls that were made to GetMinorNumber. +// Check the length with: +// +// len(mockedDevice.GetMinorNumberCalls()) +func (mock *Device) GetMinorNumberCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMinorNumber.RLock() + calls = mock.calls.GetMinorNumber + mock.lockGetMinorNumber.RUnlock() + return calls +} + +// GetMultiGpuBoard calls GetMultiGpuBoardFunc. +func (mock *Device) GetMultiGpuBoard() (int, nvml.Return) { + if mock.GetMultiGpuBoardFunc == nil { + panic("Device.GetMultiGpuBoardFunc: method is nil but Device.GetMultiGpuBoard was just called") + } + callInfo := struct { + }{} + mock.lockGetMultiGpuBoard.Lock() + mock.calls.GetMultiGpuBoard = append(mock.calls.GetMultiGpuBoard, callInfo) + mock.lockGetMultiGpuBoard.Unlock() + return mock.GetMultiGpuBoardFunc() +} + +// GetMultiGpuBoardCalls gets all the calls that were made to GetMultiGpuBoard. +// Check the length with: +// +// len(mockedDevice.GetMultiGpuBoardCalls()) +func (mock *Device) GetMultiGpuBoardCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMultiGpuBoard.RLock() + calls = mock.calls.GetMultiGpuBoard + mock.lockGetMultiGpuBoard.RUnlock() + return calls +} + +// GetName calls GetNameFunc. +func (mock *Device) GetName() (string, nvml.Return) { + if mock.GetNameFunc == nil { + panic("Device.GetNameFunc: method is nil but Device.GetName was just called") + } + callInfo := struct { + }{} + mock.lockGetName.Lock() + mock.calls.GetName = append(mock.calls.GetName, callInfo) + mock.lockGetName.Unlock() + return mock.GetNameFunc() +} + +// GetNameCalls gets all the calls that were made to GetName. +// Check the length with: +// +// len(mockedDevice.GetNameCalls()) +func (mock *Device) GetNameCalls() []struct { +} { + var calls []struct { + } + mock.lockGetName.RLock() + calls = mock.calls.GetName + mock.lockGetName.RUnlock() + return calls +} + +// GetNumFans calls GetNumFansFunc. +func (mock *Device) GetNumFans() (int, nvml.Return) { + if mock.GetNumFansFunc == nil { + panic("Device.GetNumFansFunc: method is nil but Device.GetNumFans was just called") + } + callInfo := struct { + }{} + mock.lockGetNumFans.Lock() + mock.calls.GetNumFans = append(mock.calls.GetNumFans, callInfo) + mock.lockGetNumFans.Unlock() + return mock.GetNumFansFunc() +} + +// GetNumFansCalls gets all the calls that were made to GetNumFans. +// Check the length with: +// +// len(mockedDevice.GetNumFansCalls()) +func (mock *Device) GetNumFansCalls() []struct { +} { + var calls []struct { + } + mock.lockGetNumFans.RLock() + calls = mock.calls.GetNumFans + mock.lockGetNumFans.RUnlock() + return calls +} + +// GetNumGpuCores calls GetNumGpuCoresFunc. +func (mock *Device) GetNumGpuCores() (int, nvml.Return) { + if mock.GetNumGpuCoresFunc == nil { + panic("Device.GetNumGpuCoresFunc: method is nil but Device.GetNumGpuCores was just called") + } + callInfo := struct { + }{} + mock.lockGetNumGpuCores.Lock() + mock.calls.GetNumGpuCores = append(mock.calls.GetNumGpuCores, callInfo) + mock.lockGetNumGpuCores.Unlock() + return mock.GetNumGpuCoresFunc() +} + +// GetNumGpuCoresCalls gets all the calls that were made to GetNumGpuCores. +// Check the length with: +// +// len(mockedDevice.GetNumGpuCoresCalls()) +func (mock *Device) GetNumGpuCoresCalls() []struct { +} { + var calls []struct { + } + mock.lockGetNumGpuCores.RLock() + calls = mock.calls.GetNumGpuCores + mock.lockGetNumGpuCores.RUnlock() + return calls +} + +// GetNvLinkCapability calls GetNvLinkCapabilityFunc. +func (mock *Device) GetNvLinkCapability(n int, nvLinkCapability nvml.NvLinkCapability) (uint32, nvml.Return) { + if mock.GetNvLinkCapabilityFunc == nil { + panic("Device.GetNvLinkCapabilityFunc: method is nil but Device.GetNvLinkCapability was just called") + } + callInfo := struct { + N int + NvLinkCapability nvml.NvLinkCapability + }{ + N: n, + NvLinkCapability: nvLinkCapability, + } + mock.lockGetNvLinkCapability.Lock() + mock.calls.GetNvLinkCapability = append(mock.calls.GetNvLinkCapability, callInfo) + mock.lockGetNvLinkCapability.Unlock() + return mock.GetNvLinkCapabilityFunc(n, nvLinkCapability) +} + +// GetNvLinkCapabilityCalls gets all the calls that were made to GetNvLinkCapability. +// Check the length with: +// +// len(mockedDevice.GetNvLinkCapabilityCalls()) +func (mock *Device) GetNvLinkCapabilityCalls() []struct { + N int + NvLinkCapability nvml.NvLinkCapability +} { + var calls []struct { + N int + NvLinkCapability nvml.NvLinkCapability + } + mock.lockGetNvLinkCapability.RLock() + calls = mock.calls.GetNvLinkCapability + mock.lockGetNvLinkCapability.RUnlock() + return calls +} + +// GetNvLinkErrorCounter calls GetNvLinkErrorCounterFunc. +func (mock *Device) GetNvLinkErrorCounter(n int, nvLinkErrorCounter nvml.NvLinkErrorCounter) (uint64, nvml.Return) { + if mock.GetNvLinkErrorCounterFunc == nil { + panic("Device.GetNvLinkErrorCounterFunc: method is nil but Device.GetNvLinkErrorCounter was just called") + } + callInfo := struct { + N int + NvLinkErrorCounter nvml.NvLinkErrorCounter + }{ + N: n, + NvLinkErrorCounter: nvLinkErrorCounter, + } + mock.lockGetNvLinkErrorCounter.Lock() + mock.calls.GetNvLinkErrorCounter = append(mock.calls.GetNvLinkErrorCounter, callInfo) + mock.lockGetNvLinkErrorCounter.Unlock() + return mock.GetNvLinkErrorCounterFunc(n, nvLinkErrorCounter) +} + +// GetNvLinkErrorCounterCalls gets all the calls that were made to GetNvLinkErrorCounter. +// Check the length with: +// +// len(mockedDevice.GetNvLinkErrorCounterCalls()) +func (mock *Device) GetNvLinkErrorCounterCalls() []struct { + N int + NvLinkErrorCounter nvml.NvLinkErrorCounter +} { + var calls []struct { + N int + NvLinkErrorCounter nvml.NvLinkErrorCounter + } + mock.lockGetNvLinkErrorCounter.RLock() + calls = mock.calls.GetNvLinkErrorCounter + mock.lockGetNvLinkErrorCounter.RUnlock() + return calls +} + +// GetNvLinkRemoteDeviceType calls GetNvLinkRemoteDeviceTypeFunc. +func (mock *Device) GetNvLinkRemoteDeviceType(n int) (nvml.IntNvLinkDeviceType, nvml.Return) { + if mock.GetNvLinkRemoteDeviceTypeFunc == nil { + panic("Device.GetNvLinkRemoteDeviceTypeFunc: method is nil but Device.GetNvLinkRemoteDeviceType was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetNvLinkRemoteDeviceType.Lock() + mock.calls.GetNvLinkRemoteDeviceType = append(mock.calls.GetNvLinkRemoteDeviceType, callInfo) + mock.lockGetNvLinkRemoteDeviceType.Unlock() + return mock.GetNvLinkRemoteDeviceTypeFunc(n) +} + +// GetNvLinkRemoteDeviceTypeCalls gets all the calls that were made to GetNvLinkRemoteDeviceType. +// Check the length with: +// +// len(mockedDevice.GetNvLinkRemoteDeviceTypeCalls()) +func (mock *Device) GetNvLinkRemoteDeviceTypeCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetNvLinkRemoteDeviceType.RLock() + calls = mock.calls.GetNvLinkRemoteDeviceType + mock.lockGetNvLinkRemoteDeviceType.RUnlock() + return calls +} + +// GetNvLinkRemotePciInfo calls GetNvLinkRemotePciInfoFunc. +func (mock *Device) GetNvLinkRemotePciInfo(n int) (nvml.PciInfo, nvml.Return) { + if mock.GetNvLinkRemotePciInfoFunc == nil { + panic("Device.GetNvLinkRemotePciInfoFunc: method is nil but Device.GetNvLinkRemotePciInfo was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetNvLinkRemotePciInfo.Lock() + mock.calls.GetNvLinkRemotePciInfo = append(mock.calls.GetNvLinkRemotePciInfo, callInfo) + mock.lockGetNvLinkRemotePciInfo.Unlock() + return mock.GetNvLinkRemotePciInfoFunc(n) +} + +// GetNvLinkRemotePciInfoCalls gets all the calls that were made to GetNvLinkRemotePciInfo. +// Check the length with: +// +// len(mockedDevice.GetNvLinkRemotePciInfoCalls()) +func (mock *Device) GetNvLinkRemotePciInfoCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetNvLinkRemotePciInfo.RLock() + calls = mock.calls.GetNvLinkRemotePciInfo + mock.lockGetNvLinkRemotePciInfo.RUnlock() + return calls +} + +// GetNvLinkState calls GetNvLinkStateFunc. +func (mock *Device) GetNvLinkState(n int) (nvml.EnableState, nvml.Return) { + if mock.GetNvLinkStateFunc == nil { + panic("Device.GetNvLinkStateFunc: method is nil but Device.GetNvLinkState was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetNvLinkState.Lock() + mock.calls.GetNvLinkState = append(mock.calls.GetNvLinkState, callInfo) + mock.lockGetNvLinkState.Unlock() + return mock.GetNvLinkStateFunc(n) +} + +// GetNvLinkStateCalls gets all the calls that were made to GetNvLinkState. +// Check the length with: +// +// len(mockedDevice.GetNvLinkStateCalls()) +func (mock *Device) GetNvLinkStateCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetNvLinkState.RLock() + calls = mock.calls.GetNvLinkState + mock.lockGetNvLinkState.RUnlock() + return calls +} + +// GetNvLinkUtilizationControl calls GetNvLinkUtilizationControlFunc. +func (mock *Device) GetNvLinkUtilizationControl(n1 int, n2 int) (nvml.NvLinkUtilizationControl, nvml.Return) { + if mock.GetNvLinkUtilizationControlFunc == nil { + panic("Device.GetNvLinkUtilizationControlFunc: method is nil but Device.GetNvLinkUtilizationControl was just called") + } + callInfo := struct { + N1 int + N2 int + }{ + N1: n1, + N2: n2, + } + mock.lockGetNvLinkUtilizationControl.Lock() + mock.calls.GetNvLinkUtilizationControl = append(mock.calls.GetNvLinkUtilizationControl, callInfo) + mock.lockGetNvLinkUtilizationControl.Unlock() + return mock.GetNvLinkUtilizationControlFunc(n1, n2) +} + +// GetNvLinkUtilizationControlCalls gets all the calls that were made to GetNvLinkUtilizationControl. +// Check the length with: +// +// len(mockedDevice.GetNvLinkUtilizationControlCalls()) +func (mock *Device) GetNvLinkUtilizationControlCalls() []struct { + N1 int + N2 int +} { + var calls []struct { + N1 int + N2 int + } + mock.lockGetNvLinkUtilizationControl.RLock() + calls = mock.calls.GetNvLinkUtilizationControl + mock.lockGetNvLinkUtilizationControl.RUnlock() + return calls +} + +// GetNvLinkUtilizationCounter calls GetNvLinkUtilizationCounterFunc. +func (mock *Device) GetNvLinkUtilizationCounter(n1 int, n2 int) (uint64, uint64, nvml.Return) { + if mock.GetNvLinkUtilizationCounterFunc == nil { + panic("Device.GetNvLinkUtilizationCounterFunc: method is nil but Device.GetNvLinkUtilizationCounter was just called") + } + callInfo := struct { + N1 int + N2 int + }{ + N1: n1, + N2: n2, + } + mock.lockGetNvLinkUtilizationCounter.Lock() + mock.calls.GetNvLinkUtilizationCounter = append(mock.calls.GetNvLinkUtilizationCounter, callInfo) + mock.lockGetNvLinkUtilizationCounter.Unlock() + return mock.GetNvLinkUtilizationCounterFunc(n1, n2) +} + +// GetNvLinkUtilizationCounterCalls gets all the calls that were made to GetNvLinkUtilizationCounter. +// Check the length with: +// +// len(mockedDevice.GetNvLinkUtilizationCounterCalls()) +func (mock *Device) GetNvLinkUtilizationCounterCalls() []struct { + N1 int + N2 int +} { + var calls []struct { + N1 int + N2 int + } + mock.lockGetNvLinkUtilizationCounter.RLock() + calls = mock.calls.GetNvLinkUtilizationCounter + mock.lockGetNvLinkUtilizationCounter.RUnlock() + return calls +} + +// GetNvLinkVersion calls GetNvLinkVersionFunc. +func (mock *Device) GetNvLinkVersion(n int) (uint32, nvml.Return) { + if mock.GetNvLinkVersionFunc == nil { + panic("Device.GetNvLinkVersionFunc: method is nil but Device.GetNvLinkVersion was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetNvLinkVersion.Lock() + mock.calls.GetNvLinkVersion = append(mock.calls.GetNvLinkVersion, callInfo) + mock.lockGetNvLinkVersion.Unlock() + return mock.GetNvLinkVersionFunc(n) +} + +// GetNvLinkVersionCalls gets all the calls that were made to GetNvLinkVersion. +// Check the length with: +// +// len(mockedDevice.GetNvLinkVersionCalls()) +func (mock *Device) GetNvLinkVersionCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetNvLinkVersion.RLock() + calls = mock.calls.GetNvLinkVersion + mock.lockGetNvLinkVersion.RUnlock() + return calls +} + +// GetP2PStatus calls GetP2PStatusFunc. +func (mock *Device) GetP2PStatus(device nvml.Device, gpuP2PCapsIndex nvml.GpuP2PCapsIndex) (nvml.GpuP2PStatus, nvml.Return) { + if mock.GetP2PStatusFunc == nil { + panic("Device.GetP2PStatusFunc: method is nil but Device.GetP2PStatus was just called") + } + callInfo := struct { + Device nvml.Device + GpuP2PCapsIndex nvml.GpuP2PCapsIndex + }{ + Device: device, + GpuP2PCapsIndex: gpuP2PCapsIndex, + } + mock.lockGetP2PStatus.Lock() + mock.calls.GetP2PStatus = append(mock.calls.GetP2PStatus, callInfo) + mock.lockGetP2PStatus.Unlock() + return mock.GetP2PStatusFunc(device, gpuP2PCapsIndex) +} + +// GetP2PStatusCalls gets all the calls that were made to GetP2PStatus. +// Check the length with: +// +// len(mockedDevice.GetP2PStatusCalls()) +func (mock *Device) GetP2PStatusCalls() []struct { + Device nvml.Device + GpuP2PCapsIndex nvml.GpuP2PCapsIndex +} { + var calls []struct { + Device nvml.Device + GpuP2PCapsIndex nvml.GpuP2PCapsIndex + } + mock.lockGetP2PStatus.RLock() + calls = mock.calls.GetP2PStatus + mock.lockGetP2PStatus.RUnlock() + return calls +} + +// GetPciInfo calls GetPciInfoFunc. +func (mock *Device) GetPciInfo() (nvml.PciInfo, nvml.Return) { + if mock.GetPciInfoFunc == nil { + panic("Device.GetPciInfoFunc: method is nil but Device.GetPciInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetPciInfo.Lock() + mock.calls.GetPciInfo = append(mock.calls.GetPciInfo, callInfo) + mock.lockGetPciInfo.Unlock() + return mock.GetPciInfoFunc() +} + +// GetPciInfoCalls gets all the calls that were made to GetPciInfo. +// Check the length with: +// +// len(mockedDevice.GetPciInfoCalls()) +func (mock *Device) GetPciInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPciInfo.RLock() + calls = mock.calls.GetPciInfo + mock.lockGetPciInfo.RUnlock() + return calls +} + +// GetPcieLinkMaxSpeed calls GetPcieLinkMaxSpeedFunc. +func (mock *Device) GetPcieLinkMaxSpeed() (uint32, nvml.Return) { + if mock.GetPcieLinkMaxSpeedFunc == nil { + panic("Device.GetPcieLinkMaxSpeedFunc: method is nil but Device.GetPcieLinkMaxSpeed was just called") + } + callInfo := struct { + }{} + mock.lockGetPcieLinkMaxSpeed.Lock() + mock.calls.GetPcieLinkMaxSpeed = append(mock.calls.GetPcieLinkMaxSpeed, callInfo) + mock.lockGetPcieLinkMaxSpeed.Unlock() + return mock.GetPcieLinkMaxSpeedFunc() +} + +// GetPcieLinkMaxSpeedCalls gets all the calls that were made to GetPcieLinkMaxSpeed. +// Check the length with: +// +// len(mockedDevice.GetPcieLinkMaxSpeedCalls()) +func (mock *Device) GetPcieLinkMaxSpeedCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPcieLinkMaxSpeed.RLock() + calls = mock.calls.GetPcieLinkMaxSpeed + mock.lockGetPcieLinkMaxSpeed.RUnlock() + return calls +} + +// GetPcieReplayCounter calls GetPcieReplayCounterFunc. +func (mock *Device) GetPcieReplayCounter() (int, nvml.Return) { + if mock.GetPcieReplayCounterFunc == nil { + panic("Device.GetPcieReplayCounterFunc: method is nil but Device.GetPcieReplayCounter was just called") + } + callInfo := struct { + }{} + mock.lockGetPcieReplayCounter.Lock() + mock.calls.GetPcieReplayCounter = append(mock.calls.GetPcieReplayCounter, callInfo) + mock.lockGetPcieReplayCounter.Unlock() + return mock.GetPcieReplayCounterFunc() +} + +// GetPcieReplayCounterCalls gets all the calls that were made to GetPcieReplayCounter. +// Check the length with: +// +// len(mockedDevice.GetPcieReplayCounterCalls()) +func (mock *Device) GetPcieReplayCounterCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPcieReplayCounter.RLock() + calls = mock.calls.GetPcieReplayCounter + mock.lockGetPcieReplayCounter.RUnlock() + return calls +} + +// GetPcieSpeed calls GetPcieSpeedFunc. +func (mock *Device) GetPcieSpeed() (int, nvml.Return) { + if mock.GetPcieSpeedFunc == nil { + panic("Device.GetPcieSpeedFunc: method is nil but Device.GetPcieSpeed was just called") + } + callInfo := struct { + }{} + mock.lockGetPcieSpeed.Lock() + mock.calls.GetPcieSpeed = append(mock.calls.GetPcieSpeed, callInfo) + mock.lockGetPcieSpeed.Unlock() + return mock.GetPcieSpeedFunc() +} + +// GetPcieSpeedCalls gets all the calls that were made to GetPcieSpeed. +// Check the length with: +// +// len(mockedDevice.GetPcieSpeedCalls()) +func (mock *Device) GetPcieSpeedCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPcieSpeed.RLock() + calls = mock.calls.GetPcieSpeed + mock.lockGetPcieSpeed.RUnlock() + return calls +} + +// GetPcieThroughput calls GetPcieThroughputFunc. +func (mock *Device) GetPcieThroughput(pcieUtilCounter nvml.PcieUtilCounter) (uint32, nvml.Return) { + if mock.GetPcieThroughputFunc == nil { + panic("Device.GetPcieThroughputFunc: method is nil but Device.GetPcieThroughput was just called") + } + callInfo := struct { + PcieUtilCounter nvml.PcieUtilCounter + }{ + PcieUtilCounter: pcieUtilCounter, + } + mock.lockGetPcieThroughput.Lock() + mock.calls.GetPcieThroughput = append(mock.calls.GetPcieThroughput, callInfo) + mock.lockGetPcieThroughput.Unlock() + return mock.GetPcieThroughputFunc(pcieUtilCounter) +} + +// GetPcieThroughputCalls gets all the calls that were made to GetPcieThroughput. +// Check the length with: +// +// len(mockedDevice.GetPcieThroughputCalls()) +func (mock *Device) GetPcieThroughputCalls() []struct { + PcieUtilCounter nvml.PcieUtilCounter +} { + var calls []struct { + PcieUtilCounter nvml.PcieUtilCounter + } + mock.lockGetPcieThroughput.RLock() + calls = mock.calls.GetPcieThroughput + mock.lockGetPcieThroughput.RUnlock() + return calls +} + +// GetPerformanceState calls GetPerformanceStateFunc. +func (mock *Device) GetPerformanceState() (nvml.Pstates, nvml.Return) { + if mock.GetPerformanceStateFunc == nil { + panic("Device.GetPerformanceStateFunc: method is nil but Device.GetPerformanceState was just called") + } + callInfo := struct { + }{} + mock.lockGetPerformanceState.Lock() + mock.calls.GetPerformanceState = append(mock.calls.GetPerformanceState, callInfo) + mock.lockGetPerformanceState.Unlock() + return mock.GetPerformanceStateFunc() +} + +// GetPerformanceStateCalls gets all the calls that were made to GetPerformanceState. +// Check the length with: +// +// len(mockedDevice.GetPerformanceStateCalls()) +func (mock *Device) GetPerformanceStateCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPerformanceState.RLock() + calls = mock.calls.GetPerformanceState + mock.lockGetPerformanceState.RUnlock() + return calls +} + +// GetPersistenceMode calls GetPersistenceModeFunc. +func (mock *Device) GetPersistenceMode() (nvml.EnableState, nvml.Return) { + if mock.GetPersistenceModeFunc == nil { + panic("Device.GetPersistenceModeFunc: method is nil but Device.GetPersistenceMode was just called") + } + callInfo := struct { + }{} + mock.lockGetPersistenceMode.Lock() + mock.calls.GetPersistenceMode = append(mock.calls.GetPersistenceMode, callInfo) + mock.lockGetPersistenceMode.Unlock() + return mock.GetPersistenceModeFunc() +} + +// GetPersistenceModeCalls gets all the calls that were made to GetPersistenceMode. +// Check the length with: +// +// len(mockedDevice.GetPersistenceModeCalls()) +func (mock *Device) GetPersistenceModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPersistenceMode.RLock() + calls = mock.calls.GetPersistenceMode + mock.lockGetPersistenceMode.RUnlock() + return calls +} + +// GetPgpuMetadataString calls GetPgpuMetadataStringFunc. +func (mock *Device) GetPgpuMetadataString() (string, nvml.Return) { + if mock.GetPgpuMetadataStringFunc == nil { + panic("Device.GetPgpuMetadataStringFunc: method is nil but Device.GetPgpuMetadataString was just called") + } + callInfo := struct { + }{} + mock.lockGetPgpuMetadataString.Lock() + mock.calls.GetPgpuMetadataString = append(mock.calls.GetPgpuMetadataString, callInfo) + mock.lockGetPgpuMetadataString.Unlock() + return mock.GetPgpuMetadataStringFunc() +} + +// GetPgpuMetadataStringCalls gets all the calls that were made to GetPgpuMetadataString. +// Check the length with: +// +// len(mockedDevice.GetPgpuMetadataStringCalls()) +func (mock *Device) GetPgpuMetadataStringCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPgpuMetadataString.RLock() + calls = mock.calls.GetPgpuMetadataString + mock.lockGetPgpuMetadataString.RUnlock() + return calls +} + +// GetPowerManagementDefaultLimit calls GetPowerManagementDefaultLimitFunc. +func (mock *Device) GetPowerManagementDefaultLimit() (uint32, nvml.Return) { + if mock.GetPowerManagementDefaultLimitFunc == nil { + panic("Device.GetPowerManagementDefaultLimitFunc: method is nil but Device.GetPowerManagementDefaultLimit was just called") + } + callInfo := struct { + }{} + mock.lockGetPowerManagementDefaultLimit.Lock() + mock.calls.GetPowerManagementDefaultLimit = append(mock.calls.GetPowerManagementDefaultLimit, callInfo) + mock.lockGetPowerManagementDefaultLimit.Unlock() + return mock.GetPowerManagementDefaultLimitFunc() +} + +// GetPowerManagementDefaultLimitCalls gets all the calls that were made to GetPowerManagementDefaultLimit. +// Check the length with: +// +// len(mockedDevice.GetPowerManagementDefaultLimitCalls()) +func (mock *Device) GetPowerManagementDefaultLimitCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPowerManagementDefaultLimit.RLock() + calls = mock.calls.GetPowerManagementDefaultLimit + mock.lockGetPowerManagementDefaultLimit.RUnlock() + return calls +} + +// GetPowerManagementLimit calls GetPowerManagementLimitFunc. +func (mock *Device) GetPowerManagementLimit() (uint32, nvml.Return) { + if mock.GetPowerManagementLimitFunc == nil { + panic("Device.GetPowerManagementLimitFunc: method is nil but Device.GetPowerManagementLimit was just called") + } + callInfo := struct { + }{} + mock.lockGetPowerManagementLimit.Lock() + mock.calls.GetPowerManagementLimit = append(mock.calls.GetPowerManagementLimit, callInfo) + mock.lockGetPowerManagementLimit.Unlock() + return mock.GetPowerManagementLimitFunc() +} + +// GetPowerManagementLimitCalls gets all the calls that were made to GetPowerManagementLimit. +// Check the length with: +// +// len(mockedDevice.GetPowerManagementLimitCalls()) +func (mock *Device) GetPowerManagementLimitCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPowerManagementLimit.RLock() + calls = mock.calls.GetPowerManagementLimit + mock.lockGetPowerManagementLimit.RUnlock() + return calls +} + +// GetPowerManagementLimitConstraints calls GetPowerManagementLimitConstraintsFunc. +func (mock *Device) GetPowerManagementLimitConstraints() (uint32, uint32, nvml.Return) { + if mock.GetPowerManagementLimitConstraintsFunc == nil { + panic("Device.GetPowerManagementLimitConstraintsFunc: method is nil but Device.GetPowerManagementLimitConstraints was just called") + } + callInfo := struct { + }{} + mock.lockGetPowerManagementLimitConstraints.Lock() + mock.calls.GetPowerManagementLimitConstraints = append(mock.calls.GetPowerManagementLimitConstraints, callInfo) + mock.lockGetPowerManagementLimitConstraints.Unlock() + return mock.GetPowerManagementLimitConstraintsFunc() +} + +// GetPowerManagementLimitConstraintsCalls gets all the calls that were made to GetPowerManagementLimitConstraints. +// Check the length with: +// +// len(mockedDevice.GetPowerManagementLimitConstraintsCalls()) +func (mock *Device) GetPowerManagementLimitConstraintsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPowerManagementLimitConstraints.RLock() + calls = mock.calls.GetPowerManagementLimitConstraints + mock.lockGetPowerManagementLimitConstraints.RUnlock() + return calls +} + +// GetPowerManagementMode calls GetPowerManagementModeFunc. +func (mock *Device) GetPowerManagementMode() (nvml.EnableState, nvml.Return) { + if mock.GetPowerManagementModeFunc == nil { + panic("Device.GetPowerManagementModeFunc: method is nil but Device.GetPowerManagementMode was just called") + } + callInfo := struct { + }{} + mock.lockGetPowerManagementMode.Lock() + mock.calls.GetPowerManagementMode = append(mock.calls.GetPowerManagementMode, callInfo) + mock.lockGetPowerManagementMode.Unlock() + return mock.GetPowerManagementModeFunc() +} + +// GetPowerManagementModeCalls gets all the calls that were made to GetPowerManagementMode. +// Check the length with: +// +// len(mockedDevice.GetPowerManagementModeCalls()) +func (mock *Device) GetPowerManagementModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPowerManagementMode.RLock() + calls = mock.calls.GetPowerManagementMode + mock.lockGetPowerManagementMode.RUnlock() + return calls +} + +// GetPowerSource calls GetPowerSourceFunc. +func (mock *Device) GetPowerSource() (nvml.PowerSource, nvml.Return) { + if mock.GetPowerSourceFunc == nil { + panic("Device.GetPowerSourceFunc: method is nil but Device.GetPowerSource was just called") + } + callInfo := struct { + }{} + mock.lockGetPowerSource.Lock() + mock.calls.GetPowerSource = append(mock.calls.GetPowerSource, callInfo) + mock.lockGetPowerSource.Unlock() + return mock.GetPowerSourceFunc() +} + +// GetPowerSourceCalls gets all the calls that were made to GetPowerSource. +// Check the length with: +// +// len(mockedDevice.GetPowerSourceCalls()) +func (mock *Device) GetPowerSourceCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPowerSource.RLock() + calls = mock.calls.GetPowerSource + mock.lockGetPowerSource.RUnlock() + return calls +} + +// GetPowerState calls GetPowerStateFunc. +func (mock *Device) GetPowerState() (nvml.Pstates, nvml.Return) { + if mock.GetPowerStateFunc == nil { + panic("Device.GetPowerStateFunc: method is nil but Device.GetPowerState was just called") + } + callInfo := struct { + }{} + mock.lockGetPowerState.Lock() + mock.calls.GetPowerState = append(mock.calls.GetPowerState, callInfo) + mock.lockGetPowerState.Unlock() + return mock.GetPowerStateFunc() +} + +// GetPowerStateCalls gets all the calls that were made to GetPowerState. +// Check the length with: +// +// len(mockedDevice.GetPowerStateCalls()) +func (mock *Device) GetPowerStateCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPowerState.RLock() + calls = mock.calls.GetPowerState + mock.lockGetPowerState.RUnlock() + return calls +} + +// GetPowerUsage calls GetPowerUsageFunc. +func (mock *Device) GetPowerUsage() (uint32, nvml.Return) { + if mock.GetPowerUsageFunc == nil { + panic("Device.GetPowerUsageFunc: method is nil but Device.GetPowerUsage was just called") + } + callInfo := struct { + }{} + mock.lockGetPowerUsage.Lock() + mock.calls.GetPowerUsage = append(mock.calls.GetPowerUsage, callInfo) + mock.lockGetPowerUsage.Unlock() + return mock.GetPowerUsageFunc() +} + +// GetPowerUsageCalls gets all the calls that were made to GetPowerUsage. +// Check the length with: +// +// len(mockedDevice.GetPowerUsageCalls()) +func (mock *Device) GetPowerUsageCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPowerUsage.RLock() + calls = mock.calls.GetPowerUsage + mock.lockGetPowerUsage.RUnlock() + return calls +} + +// GetProcessUtilization calls GetProcessUtilizationFunc. +func (mock *Device) GetProcessUtilization(v uint64) ([]nvml.ProcessUtilizationSample, nvml.Return) { + if mock.GetProcessUtilizationFunc == nil { + panic("Device.GetProcessUtilizationFunc: method is nil but Device.GetProcessUtilization was just called") + } + callInfo := struct { + V uint64 + }{ + V: v, + } + mock.lockGetProcessUtilization.Lock() + mock.calls.GetProcessUtilization = append(mock.calls.GetProcessUtilization, callInfo) + mock.lockGetProcessUtilization.Unlock() + return mock.GetProcessUtilizationFunc(v) +} + +// GetProcessUtilizationCalls gets all the calls that were made to GetProcessUtilization. +// Check the length with: +// +// len(mockedDevice.GetProcessUtilizationCalls()) +func (mock *Device) GetProcessUtilizationCalls() []struct { + V uint64 +} { + var calls []struct { + V uint64 + } + mock.lockGetProcessUtilization.RLock() + calls = mock.calls.GetProcessUtilization + mock.lockGetProcessUtilization.RUnlock() + return calls +} + +// GetRemappedRows calls GetRemappedRowsFunc. +func (mock *Device) GetRemappedRows() (int, int, bool, bool, nvml.Return) { + if mock.GetRemappedRowsFunc == nil { + panic("Device.GetRemappedRowsFunc: method is nil but Device.GetRemappedRows was just called") + } + callInfo := struct { + }{} + mock.lockGetRemappedRows.Lock() + mock.calls.GetRemappedRows = append(mock.calls.GetRemappedRows, callInfo) + mock.lockGetRemappedRows.Unlock() + return mock.GetRemappedRowsFunc() +} + +// GetRemappedRowsCalls gets all the calls that were made to GetRemappedRows. +// Check the length with: +// +// len(mockedDevice.GetRemappedRowsCalls()) +func (mock *Device) GetRemappedRowsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetRemappedRows.RLock() + calls = mock.calls.GetRemappedRows + mock.lockGetRemappedRows.RUnlock() + return calls +} + +// GetRetiredPages calls GetRetiredPagesFunc. +func (mock *Device) GetRetiredPages(pageRetirementCause nvml.PageRetirementCause) ([]uint64, nvml.Return) { + if mock.GetRetiredPagesFunc == nil { + panic("Device.GetRetiredPagesFunc: method is nil but Device.GetRetiredPages was just called") + } + callInfo := struct { + PageRetirementCause nvml.PageRetirementCause + }{ + PageRetirementCause: pageRetirementCause, + } + mock.lockGetRetiredPages.Lock() + mock.calls.GetRetiredPages = append(mock.calls.GetRetiredPages, callInfo) + mock.lockGetRetiredPages.Unlock() + return mock.GetRetiredPagesFunc(pageRetirementCause) +} + +// GetRetiredPagesCalls gets all the calls that were made to GetRetiredPages. +// Check the length with: +// +// len(mockedDevice.GetRetiredPagesCalls()) +func (mock *Device) GetRetiredPagesCalls() []struct { + PageRetirementCause nvml.PageRetirementCause +} { + var calls []struct { + PageRetirementCause nvml.PageRetirementCause + } + mock.lockGetRetiredPages.RLock() + calls = mock.calls.GetRetiredPages + mock.lockGetRetiredPages.RUnlock() + return calls +} + +// GetRetiredPagesPendingStatus calls GetRetiredPagesPendingStatusFunc. +func (mock *Device) GetRetiredPagesPendingStatus() (nvml.EnableState, nvml.Return) { + if mock.GetRetiredPagesPendingStatusFunc == nil { + panic("Device.GetRetiredPagesPendingStatusFunc: method is nil but Device.GetRetiredPagesPendingStatus was just called") + } + callInfo := struct { + }{} + mock.lockGetRetiredPagesPendingStatus.Lock() + mock.calls.GetRetiredPagesPendingStatus = append(mock.calls.GetRetiredPagesPendingStatus, callInfo) + mock.lockGetRetiredPagesPendingStatus.Unlock() + return mock.GetRetiredPagesPendingStatusFunc() +} + +// GetRetiredPagesPendingStatusCalls gets all the calls that were made to GetRetiredPagesPendingStatus. +// Check the length with: +// +// len(mockedDevice.GetRetiredPagesPendingStatusCalls()) +func (mock *Device) GetRetiredPagesPendingStatusCalls() []struct { +} { + var calls []struct { + } + mock.lockGetRetiredPagesPendingStatus.RLock() + calls = mock.calls.GetRetiredPagesPendingStatus + mock.lockGetRetiredPagesPendingStatus.RUnlock() + return calls +} + +// GetRetiredPages_v2 calls GetRetiredPages_v2Func. +func (mock *Device) GetRetiredPages_v2(pageRetirementCause nvml.PageRetirementCause) ([]uint64, []uint64, nvml.Return) { + if mock.GetRetiredPages_v2Func == nil { + panic("Device.GetRetiredPages_v2Func: method is nil but Device.GetRetiredPages_v2 was just called") + } + callInfo := struct { + PageRetirementCause nvml.PageRetirementCause + }{ + PageRetirementCause: pageRetirementCause, + } + mock.lockGetRetiredPages_v2.Lock() + mock.calls.GetRetiredPages_v2 = append(mock.calls.GetRetiredPages_v2, callInfo) + mock.lockGetRetiredPages_v2.Unlock() + return mock.GetRetiredPages_v2Func(pageRetirementCause) +} + +// GetRetiredPages_v2Calls gets all the calls that were made to GetRetiredPages_v2. +// Check the length with: +// +// len(mockedDevice.GetRetiredPages_v2Calls()) +func (mock *Device) GetRetiredPages_v2Calls() []struct { + PageRetirementCause nvml.PageRetirementCause +} { + var calls []struct { + PageRetirementCause nvml.PageRetirementCause + } + mock.lockGetRetiredPages_v2.RLock() + calls = mock.calls.GetRetiredPages_v2 + mock.lockGetRetiredPages_v2.RUnlock() + return calls +} + +// GetRowRemapperHistogram calls GetRowRemapperHistogramFunc. +func (mock *Device) GetRowRemapperHistogram() (nvml.RowRemapperHistogramValues, nvml.Return) { + if mock.GetRowRemapperHistogramFunc == nil { + panic("Device.GetRowRemapperHistogramFunc: method is nil but Device.GetRowRemapperHistogram was just called") + } + callInfo := struct { + }{} + mock.lockGetRowRemapperHistogram.Lock() + mock.calls.GetRowRemapperHistogram = append(mock.calls.GetRowRemapperHistogram, callInfo) + mock.lockGetRowRemapperHistogram.Unlock() + return mock.GetRowRemapperHistogramFunc() +} + +// GetRowRemapperHistogramCalls gets all the calls that were made to GetRowRemapperHistogram. +// Check the length with: +// +// len(mockedDevice.GetRowRemapperHistogramCalls()) +func (mock *Device) GetRowRemapperHistogramCalls() []struct { +} { + var calls []struct { + } + mock.lockGetRowRemapperHistogram.RLock() + calls = mock.calls.GetRowRemapperHistogram + mock.lockGetRowRemapperHistogram.RUnlock() + return calls +} + +// GetSamples calls GetSamplesFunc. +func (mock *Device) GetSamples(samplingType nvml.SamplingType, v uint64) (nvml.ValueType, []nvml.Sample, nvml.Return) { + if mock.GetSamplesFunc == nil { + panic("Device.GetSamplesFunc: method is nil but Device.GetSamples was just called") + } + callInfo := struct { + SamplingType nvml.SamplingType + V uint64 + }{ + SamplingType: samplingType, + V: v, + } + mock.lockGetSamples.Lock() + mock.calls.GetSamples = append(mock.calls.GetSamples, callInfo) + mock.lockGetSamples.Unlock() + return mock.GetSamplesFunc(samplingType, v) +} + +// GetSamplesCalls gets all the calls that were made to GetSamples. +// Check the length with: +// +// len(mockedDevice.GetSamplesCalls()) +func (mock *Device) GetSamplesCalls() []struct { + SamplingType nvml.SamplingType + V uint64 +} { + var calls []struct { + SamplingType nvml.SamplingType + V uint64 + } + mock.lockGetSamples.RLock() + calls = mock.calls.GetSamples + mock.lockGetSamples.RUnlock() + return calls +} + +// GetSerial calls GetSerialFunc. +func (mock *Device) GetSerial() (string, nvml.Return) { + if mock.GetSerialFunc == nil { + panic("Device.GetSerialFunc: method is nil but Device.GetSerial was just called") + } + callInfo := struct { + }{} + mock.lockGetSerial.Lock() + mock.calls.GetSerial = append(mock.calls.GetSerial, callInfo) + mock.lockGetSerial.Unlock() + return mock.GetSerialFunc() +} + +// GetSerialCalls gets all the calls that were made to GetSerial. +// Check the length with: +// +// len(mockedDevice.GetSerialCalls()) +func (mock *Device) GetSerialCalls() []struct { +} { + var calls []struct { + } + mock.lockGetSerial.RLock() + calls = mock.calls.GetSerial + mock.lockGetSerial.RUnlock() + return calls +} + +// GetSupportedClocksThrottleReasons calls GetSupportedClocksThrottleReasonsFunc. +func (mock *Device) GetSupportedClocksThrottleReasons() (uint64, nvml.Return) { + if mock.GetSupportedClocksThrottleReasonsFunc == nil { + panic("Device.GetSupportedClocksThrottleReasonsFunc: method is nil but Device.GetSupportedClocksThrottleReasons was just called") + } + callInfo := struct { + }{} + mock.lockGetSupportedClocksThrottleReasons.Lock() + mock.calls.GetSupportedClocksThrottleReasons = append(mock.calls.GetSupportedClocksThrottleReasons, callInfo) + mock.lockGetSupportedClocksThrottleReasons.Unlock() + return mock.GetSupportedClocksThrottleReasonsFunc() +} + +// GetSupportedClocksThrottleReasonsCalls gets all the calls that were made to GetSupportedClocksThrottleReasons. +// Check the length with: +// +// len(mockedDevice.GetSupportedClocksThrottleReasonsCalls()) +func (mock *Device) GetSupportedClocksThrottleReasonsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetSupportedClocksThrottleReasons.RLock() + calls = mock.calls.GetSupportedClocksThrottleReasons + mock.lockGetSupportedClocksThrottleReasons.RUnlock() + return calls +} + +// GetSupportedEventTypes calls GetSupportedEventTypesFunc. +func (mock *Device) GetSupportedEventTypes() (uint64, nvml.Return) { + if mock.GetSupportedEventTypesFunc == nil { + panic("Device.GetSupportedEventTypesFunc: method is nil but Device.GetSupportedEventTypes was just called") + } + callInfo := struct { + }{} + mock.lockGetSupportedEventTypes.Lock() + mock.calls.GetSupportedEventTypes = append(mock.calls.GetSupportedEventTypes, callInfo) + mock.lockGetSupportedEventTypes.Unlock() + return mock.GetSupportedEventTypesFunc() +} + +// GetSupportedEventTypesCalls gets all the calls that were made to GetSupportedEventTypes. +// Check the length with: +// +// len(mockedDevice.GetSupportedEventTypesCalls()) +func (mock *Device) GetSupportedEventTypesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetSupportedEventTypes.RLock() + calls = mock.calls.GetSupportedEventTypes + mock.lockGetSupportedEventTypes.RUnlock() + return calls +} + +// GetSupportedGraphicsClocks calls GetSupportedGraphicsClocksFunc. +func (mock *Device) GetSupportedGraphicsClocks(n int) (int, uint32, nvml.Return) { + if mock.GetSupportedGraphicsClocksFunc == nil { + panic("Device.GetSupportedGraphicsClocksFunc: method is nil but Device.GetSupportedGraphicsClocks was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetSupportedGraphicsClocks.Lock() + mock.calls.GetSupportedGraphicsClocks = append(mock.calls.GetSupportedGraphicsClocks, callInfo) + mock.lockGetSupportedGraphicsClocks.Unlock() + return mock.GetSupportedGraphicsClocksFunc(n) +} + +// GetSupportedGraphicsClocksCalls gets all the calls that were made to GetSupportedGraphicsClocks. +// Check the length with: +// +// len(mockedDevice.GetSupportedGraphicsClocksCalls()) +func (mock *Device) GetSupportedGraphicsClocksCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetSupportedGraphicsClocks.RLock() + calls = mock.calls.GetSupportedGraphicsClocks + mock.lockGetSupportedGraphicsClocks.RUnlock() + return calls +} + +// GetSupportedMemoryClocks calls GetSupportedMemoryClocksFunc. +func (mock *Device) GetSupportedMemoryClocks() (int, uint32, nvml.Return) { + if mock.GetSupportedMemoryClocksFunc == nil { + panic("Device.GetSupportedMemoryClocksFunc: method is nil but Device.GetSupportedMemoryClocks was just called") + } + callInfo := struct { + }{} + mock.lockGetSupportedMemoryClocks.Lock() + mock.calls.GetSupportedMemoryClocks = append(mock.calls.GetSupportedMemoryClocks, callInfo) + mock.lockGetSupportedMemoryClocks.Unlock() + return mock.GetSupportedMemoryClocksFunc() +} + +// GetSupportedMemoryClocksCalls gets all the calls that were made to GetSupportedMemoryClocks. +// Check the length with: +// +// len(mockedDevice.GetSupportedMemoryClocksCalls()) +func (mock *Device) GetSupportedMemoryClocksCalls() []struct { +} { + var calls []struct { + } + mock.lockGetSupportedMemoryClocks.RLock() + calls = mock.calls.GetSupportedMemoryClocks + mock.lockGetSupportedMemoryClocks.RUnlock() + return calls +} + +// GetSupportedPerformanceStates calls GetSupportedPerformanceStatesFunc. +func (mock *Device) GetSupportedPerformanceStates() ([]nvml.Pstates, nvml.Return) { + if mock.GetSupportedPerformanceStatesFunc == nil { + panic("Device.GetSupportedPerformanceStatesFunc: method is nil but Device.GetSupportedPerformanceStates was just called") + } + callInfo := struct { + }{} + mock.lockGetSupportedPerformanceStates.Lock() + mock.calls.GetSupportedPerformanceStates = append(mock.calls.GetSupportedPerformanceStates, callInfo) + mock.lockGetSupportedPerformanceStates.Unlock() + return mock.GetSupportedPerformanceStatesFunc() +} + +// GetSupportedPerformanceStatesCalls gets all the calls that were made to GetSupportedPerformanceStates. +// Check the length with: +// +// len(mockedDevice.GetSupportedPerformanceStatesCalls()) +func (mock *Device) GetSupportedPerformanceStatesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetSupportedPerformanceStates.RLock() + calls = mock.calls.GetSupportedPerformanceStates + mock.lockGetSupportedPerformanceStates.RUnlock() + return calls +} + +// GetSupportedVgpus calls GetSupportedVgpusFunc. +func (mock *Device) GetSupportedVgpus() ([]nvml.VgpuTypeId, nvml.Return) { + if mock.GetSupportedVgpusFunc == nil { + panic("Device.GetSupportedVgpusFunc: method is nil but Device.GetSupportedVgpus was just called") + } + callInfo := struct { + }{} + mock.lockGetSupportedVgpus.Lock() + mock.calls.GetSupportedVgpus = append(mock.calls.GetSupportedVgpus, callInfo) + mock.lockGetSupportedVgpus.Unlock() + return mock.GetSupportedVgpusFunc() +} + +// GetSupportedVgpusCalls gets all the calls that were made to GetSupportedVgpus. +// Check the length with: +// +// len(mockedDevice.GetSupportedVgpusCalls()) +func (mock *Device) GetSupportedVgpusCalls() []struct { +} { + var calls []struct { + } + mock.lockGetSupportedVgpus.RLock() + calls = mock.calls.GetSupportedVgpus + mock.lockGetSupportedVgpus.RUnlock() + return calls +} + +// GetTargetFanSpeed calls GetTargetFanSpeedFunc. +func (mock *Device) GetTargetFanSpeed(n int) (int, nvml.Return) { + if mock.GetTargetFanSpeedFunc == nil { + panic("Device.GetTargetFanSpeedFunc: method is nil but Device.GetTargetFanSpeed was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetTargetFanSpeed.Lock() + mock.calls.GetTargetFanSpeed = append(mock.calls.GetTargetFanSpeed, callInfo) + mock.lockGetTargetFanSpeed.Unlock() + return mock.GetTargetFanSpeedFunc(n) +} + +// GetTargetFanSpeedCalls gets all the calls that were made to GetTargetFanSpeed. +// Check the length with: +// +// len(mockedDevice.GetTargetFanSpeedCalls()) +func (mock *Device) GetTargetFanSpeedCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetTargetFanSpeed.RLock() + calls = mock.calls.GetTargetFanSpeed + mock.lockGetTargetFanSpeed.RUnlock() + return calls +} + +// GetTemperature calls GetTemperatureFunc. +func (mock *Device) GetTemperature(temperatureSensors nvml.TemperatureSensors) (uint32, nvml.Return) { + if mock.GetTemperatureFunc == nil { + panic("Device.GetTemperatureFunc: method is nil but Device.GetTemperature was just called") + } + callInfo := struct { + TemperatureSensors nvml.TemperatureSensors + }{ + TemperatureSensors: temperatureSensors, + } + mock.lockGetTemperature.Lock() + mock.calls.GetTemperature = append(mock.calls.GetTemperature, callInfo) + mock.lockGetTemperature.Unlock() + return mock.GetTemperatureFunc(temperatureSensors) +} + +// GetTemperatureCalls gets all the calls that were made to GetTemperature. +// Check the length with: +// +// len(mockedDevice.GetTemperatureCalls()) +func (mock *Device) GetTemperatureCalls() []struct { + TemperatureSensors nvml.TemperatureSensors +} { + var calls []struct { + TemperatureSensors nvml.TemperatureSensors + } + mock.lockGetTemperature.RLock() + calls = mock.calls.GetTemperature + mock.lockGetTemperature.RUnlock() + return calls +} + +// GetTemperatureThreshold calls GetTemperatureThresholdFunc. +func (mock *Device) GetTemperatureThreshold(temperatureThresholds nvml.TemperatureThresholds) (uint32, nvml.Return) { + if mock.GetTemperatureThresholdFunc == nil { + panic("Device.GetTemperatureThresholdFunc: method is nil but Device.GetTemperatureThreshold was just called") + } + callInfo := struct { + TemperatureThresholds nvml.TemperatureThresholds + }{ + TemperatureThresholds: temperatureThresholds, + } + mock.lockGetTemperatureThreshold.Lock() + mock.calls.GetTemperatureThreshold = append(mock.calls.GetTemperatureThreshold, callInfo) + mock.lockGetTemperatureThreshold.Unlock() + return mock.GetTemperatureThresholdFunc(temperatureThresholds) +} + +// GetTemperatureThresholdCalls gets all the calls that were made to GetTemperatureThreshold. +// Check the length with: +// +// len(mockedDevice.GetTemperatureThresholdCalls()) +func (mock *Device) GetTemperatureThresholdCalls() []struct { + TemperatureThresholds nvml.TemperatureThresholds +} { + var calls []struct { + TemperatureThresholds nvml.TemperatureThresholds + } + mock.lockGetTemperatureThreshold.RLock() + calls = mock.calls.GetTemperatureThreshold + mock.lockGetTemperatureThreshold.RUnlock() + return calls +} + +// GetThermalSettings calls GetThermalSettingsFunc. +func (mock *Device) GetThermalSettings(v uint32) (nvml.GpuThermalSettings, nvml.Return) { + if mock.GetThermalSettingsFunc == nil { + panic("Device.GetThermalSettingsFunc: method is nil but Device.GetThermalSettings was just called") + } + callInfo := struct { + V uint32 + }{ + V: v, + } + mock.lockGetThermalSettings.Lock() + mock.calls.GetThermalSettings = append(mock.calls.GetThermalSettings, callInfo) + mock.lockGetThermalSettings.Unlock() + return mock.GetThermalSettingsFunc(v) +} + +// GetThermalSettingsCalls gets all the calls that were made to GetThermalSettings. +// Check the length with: +// +// len(mockedDevice.GetThermalSettingsCalls()) +func (mock *Device) GetThermalSettingsCalls() []struct { + V uint32 +} { + var calls []struct { + V uint32 + } + mock.lockGetThermalSettings.RLock() + calls = mock.calls.GetThermalSettings + mock.lockGetThermalSettings.RUnlock() + return calls +} + +// GetTopologyCommonAncestor calls GetTopologyCommonAncestorFunc. +func (mock *Device) GetTopologyCommonAncestor(device nvml.Device) (nvml.GpuTopologyLevel, nvml.Return) { + if mock.GetTopologyCommonAncestorFunc == nil { + panic("Device.GetTopologyCommonAncestorFunc: method is nil but Device.GetTopologyCommonAncestor was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockGetTopologyCommonAncestor.Lock() + mock.calls.GetTopologyCommonAncestor = append(mock.calls.GetTopologyCommonAncestor, callInfo) + mock.lockGetTopologyCommonAncestor.Unlock() + return mock.GetTopologyCommonAncestorFunc(device) +} + +// GetTopologyCommonAncestorCalls gets all the calls that were made to GetTopologyCommonAncestor. +// Check the length with: +// +// len(mockedDevice.GetTopologyCommonAncestorCalls()) +func (mock *Device) GetTopologyCommonAncestorCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockGetTopologyCommonAncestor.RLock() + calls = mock.calls.GetTopologyCommonAncestor + mock.lockGetTopologyCommonAncestor.RUnlock() + return calls +} + +// GetTopologyNearestGpus calls GetTopologyNearestGpusFunc. +func (mock *Device) GetTopologyNearestGpus(gpuTopologyLevel nvml.GpuTopologyLevel) ([]nvml.Device, nvml.Return) { + if mock.GetTopologyNearestGpusFunc == nil { + panic("Device.GetTopologyNearestGpusFunc: method is nil but Device.GetTopologyNearestGpus was just called") + } + callInfo := struct { + GpuTopologyLevel nvml.GpuTopologyLevel + }{ + GpuTopologyLevel: gpuTopologyLevel, + } + mock.lockGetTopologyNearestGpus.Lock() + mock.calls.GetTopologyNearestGpus = append(mock.calls.GetTopologyNearestGpus, callInfo) + mock.lockGetTopologyNearestGpus.Unlock() + return mock.GetTopologyNearestGpusFunc(gpuTopologyLevel) +} + +// GetTopologyNearestGpusCalls gets all the calls that were made to GetTopologyNearestGpus. +// Check the length with: +// +// len(mockedDevice.GetTopologyNearestGpusCalls()) +func (mock *Device) GetTopologyNearestGpusCalls() []struct { + GpuTopologyLevel nvml.GpuTopologyLevel +} { + var calls []struct { + GpuTopologyLevel nvml.GpuTopologyLevel + } + mock.lockGetTopologyNearestGpus.RLock() + calls = mock.calls.GetTopologyNearestGpus + mock.lockGetTopologyNearestGpus.RUnlock() + return calls +} + +// GetTotalEccErrors calls GetTotalEccErrorsFunc. +func (mock *Device) GetTotalEccErrors(memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (uint64, nvml.Return) { + if mock.GetTotalEccErrorsFunc == nil { + panic("Device.GetTotalEccErrorsFunc: method is nil but Device.GetTotalEccErrors was just called") + } + callInfo := struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + }{ + MemoryErrorType: memoryErrorType, + EccCounterType: eccCounterType, + } + mock.lockGetTotalEccErrors.Lock() + mock.calls.GetTotalEccErrors = append(mock.calls.GetTotalEccErrors, callInfo) + mock.lockGetTotalEccErrors.Unlock() + return mock.GetTotalEccErrorsFunc(memoryErrorType, eccCounterType) +} + +// GetTotalEccErrorsCalls gets all the calls that were made to GetTotalEccErrors. +// Check the length with: +// +// len(mockedDevice.GetTotalEccErrorsCalls()) +func (mock *Device) GetTotalEccErrorsCalls() []struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType +} { + var calls []struct { + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + } + mock.lockGetTotalEccErrors.RLock() + calls = mock.calls.GetTotalEccErrors + mock.lockGetTotalEccErrors.RUnlock() + return calls +} + +// GetTotalEnergyConsumption calls GetTotalEnergyConsumptionFunc. +func (mock *Device) GetTotalEnergyConsumption() (uint64, nvml.Return) { + if mock.GetTotalEnergyConsumptionFunc == nil { + panic("Device.GetTotalEnergyConsumptionFunc: method is nil but Device.GetTotalEnergyConsumption was just called") + } + callInfo := struct { + }{} + mock.lockGetTotalEnergyConsumption.Lock() + mock.calls.GetTotalEnergyConsumption = append(mock.calls.GetTotalEnergyConsumption, callInfo) + mock.lockGetTotalEnergyConsumption.Unlock() + return mock.GetTotalEnergyConsumptionFunc() +} + +// GetTotalEnergyConsumptionCalls gets all the calls that were made to GetTotalEnergyConsumption. +// Check the length with: +// +// len(mockedDevice.GetTotalEnergyConsumptionCalls()) +func (mock *Device) GetTotalEnergyConsumptionCalls() []struct { +} { + var calls []struct { + } + mock.lockGetTotalEnergyConsumption.RLock() + calls = mock.calls.GetTotalEnergyConsumption + mock.lockGetTotalEnergyConsumption.RUnlock() + return calls +} + +// GetUUID calls GetUUIDFunc. +func (mock *Device) GetUUID() (string, nvml.Return) { + if mock.GetUUIDFunc == nil { + panic("Device.GetUUIDFunc: method is nil but Device.GetUUID was just called") + } + callInfo := struct { + }{} + mock.lockGetUUID.Lock() + mock.calls.GetUUID = append(mock.calls.GetUUID, callInfo) + mock.lockGetUUID.Unlock() + return mock.GetUUIDFunc() +} + +// GetUUIDCalls gets all the calls that were made to GetUUID. +// Check the length with: +// +// len(mockedDevice.GetUUIDCalls()) +func (mock *Device) GetUUIDCalls() []struct { +} { + var calls []struct { + } + mock.lockGetUUID.RLock() + calls = mock.calls.GetUUID + mock.lockGetUUID.RUnlock() + return calls +} + +// GetUtilizationRates calls GetUtilizationRatesFunc. +func (mock *Device) GetUtilizationRates() (nvml.Utilization, nvml.Return) { + if mock.GetUtilizationRatesFunc == nil { + panic("Device.GetUtilizationRatesFunc: method is nil but Device.GetUtilizationRates was just called") + } + callInfo := struct { + }{} + mock.lockGetUtilizationRates.Lock() + mock.calls.GetUtilizationRates = append(mock.calls.GetUtilizationRates, callInfo) + mock.lockGetUtilizationRates.Unlock() + return mock.GetUtilizationRatesFunc() +} + +// GetUtilizationRatesCalls gets all the calls that were made to GetUtilizationRates. +// Check the length with: +// +// len(mockedDevice.GetUtilizationRatesCalls()) +func (mock *Device) GetUtilizationRatesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetUtilizationRates.RLock() + calls = mock.calls.GetUtilizationRates + mock.lockGetUtilizationRates.RUnlock() + return calls +} + +// GetVbiosVersion calls GetVbiosVersionFunc. +func (mock *Device) GetVbiosVersion() (string, nvml.Return) { + if mock.GetVbiosVersionFunc == nil { + panic("Device.GetVbiosVersionFunc: method is nil but Device.GetVbiosVersion was just called") + } + callInfo := struct { + }{} + mock.lockGetVbiosVersion.Lock() + mock.calls.GetVbiosVersion = append(mock.calls.GetVbiosVersion, callInfo) + mock.lockGetVbiosVersion.Unlock() + return mock.GetVbiosVersionFunc() +} + +// GetVbiosVersionCalls gets all the calls that were made to GetVbiosVersion. +// Check the length with: +// +// len(mockedDevice.GetVbiosVersionCalls()) +func (mock *Device) GetVbiosVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVbiosVersion.RLock() + calls = mock.calls.GetVbiosVersion + mock.lockGetVbiosVersion.RUnlock() + return calls +} + +// GetVgpuCapabilities calls GetVgpuCapabilitiesFunc. +func (mock *Device) GetVgpuCapabilities(deviceVgpuCapability nvml.DeviceVgpuCapability) (bool, nvml.Return) { + if mock.GetVgpuCapabilitiesFunc == nil { + panic("Device.GetVgpuCapabilitiesFunc: method is nil but Device.GetVgpuCapabilities was just called") + } + callInfo := struct { + DeviceVgpuCapability nvml.DeviceVgpuCapability + }{ + DeviceVgpuCapability: deviceVgpuCapability, + } + mock.lockGetVgpuCapabilities.Lock() + mock.calls.GetVgpuCapabilities = append(mock.calls.GetVgpuCapabilities, callInfo) + mock.lockGetVgpuCapabilities.Unlock() + return mock.GetVgpuCapabilitiesFunc(deviceVgpuCapability) +} + +// GetVgpuCapabilitiesCalls gets all the calls that were made to GetVgpuCapabilities. +// Check the length with: +// +// len(mockedDevice.GetVgpuCapabilitiesCalls()) +func (mock *Device) GetVgpuCapabilitiesCalls() []struct { + DeviceVgpuCapability nvml.DeviceVgpuCapability +} { + var calls []struct { + DeviceVgpuCapability nvml.DeviceVgpuCapability + } + mock.lockGetVgpuCapabilities.RLock() + calls = mock.calls.GetVgpuCapabilities + mock.lockGetVgpuCapabilities.RUnlock() + return calls +} + +// GetVgpuMetadata calls GetVgpuMetadataFunc. +func (mock *Device) GetVgpuMetadata() (nvml.VgpuPgpuMetadata, nvml.Return) { + if mock.GetVgpuMetadataFunc == nil { + panic("Device.GetVgpuMetadataFunc: method is nil but Device.GetVgpuMetadata was just called") + } + callInfo := struct { + }{} + mock.lockGetVgpuMetadata.Lock() + mock.calls.GetVgpuMetadata = append(mock.calls.GetVgpuMetadata, callInfo) + mock.lockGetVgpuMetadata.Unlock() + return mock.GetVgpuMetadataFunc() +} + +// GetVgpuMetadataCalls gets all the calls that were made to GetVgpuMetadata. +// Check the length with: +// +// len(mockedDevice.GetVgpuMetadataCalls()) +func (mock *Device) GetVgpuMetadataCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVgpuMetadata.RLock() + calls = mock.calls.GetVgpuMetadata + mock.lockGetVgpuMetadata.RUnlock() + return calls +} + +// GetVgpuProcessUtilization calls GetVgpuProcessUtilizationFunc. +func (mock *Device) GetVgpuProcessUtilization(v uint64) ([]nvml.VgpuProcessUtilizationSample, nvml.Return) { + if mock.GetVgpuProcessUtilizationFunc == nil { + panic("Device.GetVgpuProcessUtilizationFunc: method is nil but Device.GetVgpuProcessUtilization was just called") + } + callInfo := struct { + V uint64 + }{ + V: v, + } + mock.lockGetVgpuProcessUtilization.Lock() + mock.calls.GetVgpuProcessUtilization = append(mock.calls.GetVgpuProcessUtilization, callInfo) + mock.lockGetVgpuProcessUtilization.Unlock() + return mock.GetVgpuProcessUtilizationFunc(v) +} + +// GetVgpuProcessUtilizationCalls gets all the calls that were made to GetVgpuProcessUtilization. +// Check the length with: +// +// len(mockedDevice.GetVgpuProcessUtilizationCalls()) +func (mock *Device) GetVgpuProcessUtilizationCalls() []struct { + V uint64 +} { + var calls []struct { + V uint64 + } + mock.lockGetVgpuProcessUtilization.RLock() + calls = mock.calls.GetVgpuProcessUtilization + mock.lockGetVgpuProcessUtilization.RUnlock() + return calls +} + +// GetVgpuSchedulerCapabilities calls GetVgpuSchedulerCapabilitiesFunc. +func (mock *Device) GetVgpuSchedulerCapabilities() (nvml.VgpuSchedulerCapabilities, nvml.Return) { + if mock.GetVgpuSchedulerCapabilitiesFunc == nil { + panic("Device.GetVgpuSchedulerCapabilitiesFunc: method is nil but Device.GetVgpuSchedulerCapabilities was just called") + } + callInfo := struct { + }{} + mock.lockGetVgpuSchedulerCapabilities.Lock() + mock.calls.GetVgpuSchedulerCapabilities = append(mock.calls.GetVgpuSchedulerCapabilities, callInfo) + mock.lockGetVgpuSchedulerCapabilities.Unlock() + return mock.GetVgpuSchedulerCapabilitiesFunc() +} + +// GetVgpuSchedulerCapabilitiesCalls gets all the calls that were made to GetVgpuSchedulerCapabilities. +// Check the length with: +// +// len(mockedDevice.GetVgpuSchedulerCapabilitiesCalls()) +func (mock *Device) GetVgpuSchedulerCapabilitiesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVgpuSchedulerCapabilities.RLock() + calls = mock.calls.GetVgpuSchedulerCapabilities + mock.lockGetVgpuSchedulerCapabilities.RUnlock() + return calls +} + +// GetVgpuSchedulerLog calls GetVgpuSchedulerLogFunc. +func (mock *Device) GetVgpuSchedulerLog() (nvml.VgpuSchedulerLog, nvml.Return) { + if mock.GetVgpuSchedulerLogFunc == nil { + panic("Device.GetVgpuSchedulerLogFunc: method is nil but Device.GetVgpuSchedulerLog was just called") + } + callInfo := struct { + }{} + mock.lockGetVgpuSchedulerLog.Lock() + mock.calls.GetVgpuSchedulerLog = append(mock.calls.GetVgpuSchedulerLog, callInfo) + mock.lockGetVgpuSchedulerLog.Unlock() + return mock.GetVgpuSchedulerLogFunc() +} + +// GetVgpuSchedulerLogCalls gets all the calls that were made to GetVgpuSchedulerLog. +// Check the length with: +// +// len(mockedDevice.GetVgpuSchedulerLogCalls()) +func (mock *Device) GetVgpuSchedulerLogCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVgpuSchedulerLog.RLock() + calls = mock.calls.GetVgpuSchedulerLog + mock.lockGetVgpuSchedulerLog.RUnlock() + return calls +} + +// GetVgpuSchedulerState calls GetVgpuSchedulerStateFunc. +func (mock *Device) GetVgpuSchedulerState() (nvml.VgpuSchedulerGetState, nvml.Return) { + if mock.GetVgpuSchedulerStateFunc == nil { + panic("Device.GetVgpuSchedulerStateFunc: method is nil but Device.GetVgpuSchedulerState was just called") + } + callInfo := struct { + }{} + mock.lockGetVgpuSchedulerState.Lock() + mock.calls.GetVgpuSchedulerState = append(mock.calls.GetVgpuSchedulerState, callInfo) + mock.lockGetVgpuSchedulerState.Unlock() + return mock.GetVgpuSchedulerStateFunc() +} + +// GetVgpuSchedulerStateCalls gets all the calls that were made to GetVgpuSchedulerState. +// Check the length with: +// +// len(mockedDevice.GetVgpuSchedulerStateCalls()) +func (mock *Device) GetVgpuSchedulerStateCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVgpuSchedulerState.RLock() + calls = mock.calls.GetVgpuSchedulerState + mock.lockGetVgpuSchedulerState.RUnlock() + return calls +} + +// GetVgpuUtilization calls GetVgpuUtilizationFunc. +func (mock *Device) GetVgpuUtilization(v uint64) (nvml.ValueType, []nvml.VgpuInstanceUtilizationSample, nvml.Return) { + if mock.GetVgpuUtilizationFunc == nil { + panic("Device.GetVgpuUtilizationFunc: method is nil but Device.GetVgpuUtilization was just called") + } + callInfo := struct { + V uint64 + }{ + V: v, + } + mock.lockGetVgpuUtilization.Lock() + mock.calls.GetVgpuUtilization = append(mock.calls.GetVgpuUtilization, callInfo) + mock.lockGetVgpuUtilization.Unlock() + return mock.GetVgpuUtilizationFunc(v) +} + +// GetVgpuUtilizationCalls gets all the calls that were made to GetVgpuUtilization. +// Check the length with: +// +// len(mockedDevice.GetVgpuUtilizationCalls()) +func (mock *Device) GetVgpuUtilizationCalls() []struct { + V uint64 +} { + var calls []struct { + V uint64 + } + mock.lockGetVgpuUtilization.RLock() + calls = mock.calls.GetVgpuUtilization + mock.lockGetVgpuUtilization.RUnlock() + return calls +} + +// GetViolationStatus calls GetViolationStatusFunc. +func (mock *Device) GetViolationStatus(perfPolicyType nvml.PerfPolicyType) (nvml.ViolationTime, nvml.Return) { + if mock.GetViolationStatusFunc == nil { + panic("Device.GetViolationStatusFunc: method is nil but Device.GetViolationStatus was just called") + } + callInfo := struct { + PerfPolicyType nvml.PerfPolicyType + }{ + PerfPolicyType: perfPolicyType, + } + mock.lockGetViolationStatus.Lock() + mock.calls.GetViolationStatus = append(mock.calls.GetViolationStatus, callInfo) + mock.lockGetViolationStatus.Unlock() + return mock.GetViolationStatusFunc(perfPolicyType) +} + +// GetViolationStatusCalls gets all the calls that were made to GetViolationStatus. +// Check the length with: +// +// len(mockedDevice.GetViolationStatusCalls()) +func (mock *Device) GetViolationStatusCalls() []struct { + PerfPolicyType nvml.PerfPolicyType +} { + var calls []struct { + PerfPolicyType nvml.PerfPolicyType + } + mock.lockGetViolationStatus.RLock() + calls = mock.calls.GetViolationStatus + mock.lockGetViolationStatus.RUnlock() + return calls +} + +// GetVirtualizationMode calls GetVirtualizationModeFunc. +func (mock *Device) GetVirtualizationMode() (nvml.GpuVirtualizationMode, nvml.Return) { + if mock.GetVirtualizationModeFunc == nil { + panic("Device.GetVirtualizationModeFunc: method is nil but Device.GetVirtualizationMode was just called") + } + callInfo := struct { + }{} + mock.lockGetVirtualizationMode.Lock() + mock.calls.GetVirtualizationMode = append(mock.calls.GetVirtualizationMode, callInfo) + mock.lockGetVirtualizationMode.Unlock() + return mock.GetVirtualizationModeFunc() +} + +// GetVirtualizationModeCalls gets all the calls that were made to GetVirtualizationMode. +// Check the length with: +// +// len(mockedDevice.GetVirtualizationModeCalls()) +func (mock *Device) GetVirtualizationModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVirtualizationMode.RLock() + calls = mock.calls.GetVirtualizationMode + mock.lockGetVirtualizationMode.RUnlock() + return calls +} + +// GpmMigSampleGet calls GpmMigSampleGetFunc. +func (mock *Device) GpmMigSampleGet(n int, gpmSample nvml.GpmSample) nvml.Return { + if mock.GpmMigSampleGetFunc == nil { + panic("Device.GpmMigSampleGetFunc: method is nil but Device.GpmMigSampleGet was just called") + } + callInfo := struct { + N int + GpmSample nvml.GpmSample + }{ + N: n, + GpmSample: gpmSample, + } + mock.lockGpmMigSampleGet.Lock() + mock.calls.GpmMigSampleGet = append(mock.calls.GpmMigSampleGet, callInfo) + mock.lockGpmMigSampleGet.Unlock() + return mock.GpmMigSampleGetFunc(n, gpmSample) +} + +// GpmMigSampleGetCalls gets all the calls that were made to GpmMigSampleGet. +// Check the length with: +// +// len(mockedDevice.GpmMigSampleGetCalls()) +func (mock *Device) GpmMigSampleGetCalls() []struct { + N int + GpmSample nvml.GpmSample +} { + var calls []struct { + N int + GpmSample nvml.GpmSample + } + mock.lockGpmMigSampleGet.RLock() + calls = mock.calls.GpmMigSampleGet + mock.lockGpmMigSampleGet.RUnlock() + return calls +} + +// GpmQueryDeviceSupport calls GpmQueryDeviceSupportFunc. +func (mock *Device) GpmQueryDeviceSupport() (nvml.GpmSupport, nvml.Return) { + if mock.GpmQueryDeviceSupportFunc == nil { + panic("Device.GpmQueryDeviceSupportFunc: method is nil but Device.GpmQueryDeviceSupport was just called") + } + callInfo := struct { + }{} + mock.lockGpmQueryDeviceSupport.Lock() + mock.calls.GpmQueryDeviceSupport = append(mock.calls.GpmQueryDeviceSupport, callInfo) + mock.lockGpmQueryDeviceSupport.Unlock() + return mock.GpmQueryDeviceSupportFunc() +} + +// GpmQueryDeviceSupportCalls gets all the calls that were made to GpmQueryDeviceSupport. +// Check the length with: +// +// len(mockedDevice.GpmQueryDeviceSupportCalls()) +func (mock *Device) GpmQueryDeviceSupportCalls() []struct { +} { + var calls []struct { + } + mock.lockGpmQueryDeviceSupport.RLock() + calls = mock.calls.GpmQueryDeviceSupport + mock.lockGpmQueryDeviceSupport.RUnlock() + return calls +} + +// GpmQueryDeviceSupportV calls GpmQueryDeviceSupportVFunc. +func (mock *Device) GpmQueryDeviceSupportV() nvml.GpmSupportV { + if mock.GpmQueryDeviceSupportVFunc == nil { + panic("Device.GpmQueryDeviceSupportVFunc: method is nil but Device.GpmQueryDeviceSupportV was just called") + } + callInfo := struct { + }{} + mock.lockGpmQueryDeviceSupportV.Lock() + mock.calls.GpmQueryDeviceSupportV = append(mock.calls.GpmQueryDeviceSupportV, callInfo) + mock.lockGpmQueryDeviceSupportV.Unlock() + return mock.GpmQueryDeviceSupportVFunc() +} + +// GpmQueryDeviceSupportVCalls gets all the calls that were made to GpmQueryDeviceSupportV. +// Check the length with: +// +// len(mockedDevice.GpmQueryDeviceSupportVCalls()) +func (mock *Device) GpmQueryDeviceSupportVCalls() []struct { +} { + var calls []struct { + } + mock.lockGpmQueryDeviceSupportV.RLock() + calls = mock.calls.GpmQueryDeviceSupportV + mock.lockGpmQueryDeviceSupportV.RUnlock() + return calls +} + +// GpmSampleGet calls GpmSampleGetFunc. +func (mock *Device) GpmSampleGet(gpmSample nvml.GpmSample) nvml.Return { + if mock.GpmSampleGetFunc == nil { + panic("Device.GpmSampleGetFunc: method is nil but Device.GpmSampleGet was just called") + } + callInfo := struct { + GpmSample nvml.GpmSample + }{ + GpmSample: gpmSample, + } + mock.lockGpmSampleGet.Lock() + mock.calls.GpmSampleGet = append(mock.calls.GpmSampleGet, callInfo) + mock.lockGpmSampleGet.Unlock() + return mock.GpmSampleGetFunc(gpmSample) +} + +// GpmSampleGetCalls gets all the calls that were made to GpmSampleGet. +// Check the length with: +// +// len(mockedDevice.GpmSampleGetCalls()) +func (mock *Device) GpmSampleGetCalls() []struct { + GpmSample nvml.GpmSample +} { + var calls []struct { + GpmSample nvml.GpmSample + } + mock.lockGpmSampleGet.RLock() + calls = mock.calls.GpmSampleGet + mock.lockGpmSampleGet.RUnlock() + return calls +} + +// IsMigDeviceHandle calls IsMigDeviceHandleFunc. +func (mock *Device) IsMigDeviceHandle() (bool, nvml.Return) { + if mock.IsMigDeviceHandleFunc == nil { + panic("Device.IsMigDeviceHandleFunc: method is nil but Device.IsMigDeviceHandle was just called") + } + callInfo := struct { + }{} + mock.lockIsMigDeviceHandle.Lock() + mock.calls.IsMigDeviceHandle = append(mock.calls.IsMigDeviceHandle, callInfo) + mock.lockIsMigDeviceHandle.Unlock() + return mock.IsMigDeviceHandleFunc() +} + +// IsMigDeviceHandleCalls gets all the calls that were made to IsMigDeviceHandle. +// Check the length with: +// +// len(mockedDevice.IsMigDeviceHandleCalls()) +func (mock *Device) IsMigDeviceHandleCalls() []struct { +} { + var calls []struct { + } + mock.lockIsMigDeviceHandle.RLock() + calls = mock.calls.IsMigDeviceHandle + mock.lockIsMigDeviceHandle.RUnlock() + return calls +} + +// OnSameBoard calls OnSameBoardFunc. +func (mock *Device) OnSameBoard(device nvml.Device) (int, nvml.Return) { + if mock.OnSameBoardFunc == nil { + panic("Device.OnSameBoardFunc: method is nil but Device.OnSameBoard was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockOnSameBoard.Lock() + mock.calls.OnSameBoard = append(mock.calls.OnSameBoard, callInfo) + mock.lockOnSameBoard.Unlock() + return mock.OnSameBoardFunc(device) +} + +// OnSameBoardCalls gets all the calls that were made to OnSameBoard. +// Check the length with: +// +// len(mockedDevice.OnSameBoardCalls()) +func (mock *Device) OnSameBoardCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockOnSameBoard.RLock() + calls = mock.calls.OnSameBoard + mock.lockOnSameBoard.RUnlock() + return calls +} + +// RegisterEvents calls RegisterEventsFunc. +func (mock *Device) RegisterEvents(v uint64, eventSet nvml.EventSet) nvml.Return { + if mock.RegisterEventsFunc == nil { + panic("Device.RegisterEventsFunc: method is nil but Device.RegisterEvents was just called") + } + callInfo := struct { + V uint64 + EventSet nvml.EventSet + }{ + V: v, + EventSet: eventSet, + } + mock.lockRegisterEvents.Lock() + mock.calls.RegisterEvents = append(mock.calls.RegisterEvents, callInfo) + mock.lockRegisterEvents.Unlock() + return mock.RegisterEventsFunc(v, eventSet) +} + +// RegisterEventsCalls gets all the calls that were made to RegisterEvents. +// Check the length with: +// +// len(mockedDevice.RegisterEventsCalls()) +func (mock *Device) RegisterEventsCalls() []struct { + V uint64 + EventSet nvml.EventSet +} { + var calls []struct { + V uint64 + EventSet nvml.EventSet + } + mock.lockRegisterEvents.RLock() + calls = mock.calls.RegisterEvents + mock.lockRegisterEvents.RUnlock() + return calls +} + +// ResetApplicationsClocks calls ResetApplicationsClocksFunc. +func (mock *Device) ResetApplicationsClocks() nvml.Return { + if mock.ResetApplicationsClocksFunc == nil { + panic("Device.ResetApplicationsClocksFunc: method is nil but Device.ResetApplicationsClocks was just called") + } + callInfo := struct { + }{} + mock.lockResetApplicationsClocks.Lock() + mock.calls.ResetApplicationsClocks = append(mock.calls.ResetApplicationsClocks, callInfo) + mock.lockResetApplicationsClocks.Unlock() + return mock.ResetApplicationsClocksFunc() +} + +// ResetApplicationsClocksCalls gets all the calls that were made to ResetApplicationsClocks. +// Check the length with: +// +// len(mockedDevice.ResetApplicationsClocksCalls()) +func (mock *Device) ResetApplicationsClocksCalls() []struct { +} { + var calls []struct { + } + mock.lockResetApplicationsClocks.RLock() + calls = mock.calls.ResetApplicationsClocks + mock.lockResetApplicationsClocks.RUnlock() + return calls +} + +// ResetGpuLockedClocks calls ResetGpuLockedClocksFunc. +func (mock *Device) ResetGpuLockedClocks() nvml.Return { + if mock.ResetGpuLockedClocksFunc == nil { + panic("Device.ResetGpuLockedClocksFunc: method is nil but Device.ResetGpuLockedClocks was just called") + } + callInfo := struct { + }{} + mock.lockResetGpuLockedClocks.Lock() + mock.calls.ResetGpuLockedClocks = append(mock.calls.ResetGpuLockedClocks, callInfo) + mock.lockResetGpuLockedClocks.Unlock() + return mock.ResetGpuLockedClocksFunc() +} + +// ResetGpuLockedClocksCalls gets all the calls that were made to ResetGpuLockedClocks. +// Check the length with: +// +// len(mockedDevice.ResetGpuLockedClocksCalls()) +func (mock *Device) ResetGpuLockedClocksCalls() []struct { +} { + var calls []struct { + } + mock.lockResetGpuLockedClocks.RLock() + calls = mock.calls.ResetGpuLockedClocks + mock.lockResetGpuLockedClocks.RUnlock() + return calls +} + +// ResetMemoryLockedClocks calls ResetMemoryLockedClocksFunc. +func (mock *Device) ResetMemoryLockedClocks() nvml.Return { + if mock.ResetMemoryLockedClocksFunc == nil { + panic("Device.ResetMemoryLockedClocksFunc: method is nil but Device.ResetMemoryLockedClocks was just called") + } + callInfo := struct { + }{} + mock.lockResetMemoryLockedClocks.Lock() + mock.calls.ResetMemoryLockedClocks = append(mock.calls.ResetMemoryLockedClocks, callInfo) + mock.lockResetMemoryLockedClocks.Unlock() + return mock.ResetMemoryLockedClocksFunc() +} + +// ResetMemoryLockedClocksCalls gets all the calls that were made to ResetMemoryLockedClocks. +// Check the length with: +// +// len(mockedDevice.ResetMemoryLockedClocksCalls()) +func (mock *Device) ResetMemoryLockedClocksCalls() []struct { +} { + var calls []struct { + } + mock.lockResetMemoryLockedClocks.RLock() + calls = mock.calls.ResetMemoryLockedClocks + mock.lockResetMemoryLockedClocks.RUnlock() + return calls +} + +// ResetNvLinkErrorCounters calls ResetNvLinkErrorCountersFunc. +func (mock *Device) ResetNvLinkErrorCounters(n int) nvml.Return { + if mock.ResetNvLinkErrorCountersFunc == nil { + panic("Device.ResetNvLinkErrorCountersFunc: method is nil but Device.ResetNvLinkErrorCounters was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockResetNvLinkErrorCounters.Lock() + mock.calls.ResetNvLinkErrorCounters = append(mock.calls.ResetNvLinkErrorCounters, callInfo) + mock.lockResetNvLinkErrorCounters.Unlock() + return mock.ResetNvLinkErrorCountersFunc(n) +} + +// ResetNvLinkErrorCountersCalls gets all the calls that were made to ResetNvLinkErrorCounters. +// Check the length with: +// +// len(mockedDevice.ResetNvLinkErrorCountersCalls()) +func (mock *Device) ResetNvLinkErrorCountersCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockResetNvLinkErrorCounters.RLock() + calls = mock.calls.ResetNvLinkErrorCounters + mock.lockResetNvLinkErrorCounters.RUnlock() + return calls +} + +// ResetNvLinkUtilizationCounter calls ResetNvLinkUtilizationCounterFunc. +func (mock *Device) ResetNvLinkUtilizationCounter(n1 int, n2 int) nvml.Return { + if mock.ResetNvLinkUtilizationCounterFunc == nil { + panic("Device.ResetNvLinkUtilizationCounterFunc: method is nil but Device.ResetNvLinkUtilizationCounter was just called") + } + callInfo := struct { + N1 int + N2 int + }{ + N1: n1, + N2: n2, + } + mock.lockResetNvLinkUtilizationCounter.Lock() + mock.calls.ResetNvLinkUtilizationCounter = append(mock.calls.ResetNvLinkUtilizationCounter, callInfo) + mock.lockResetNvLinkUtilizationCounter.Unlock() + return mock.ResetNvLinkUtilizationCounterFunc(n1, n2) +} + +// ResetNvLinkUtilizationCounterCalls gets all the calls that were made to ResetNvLinkUtilizationCounter. +// Check the length with: +// +// len(mockedDevice.ResetNvLinkUtilizationCounterCalls()) +func (mock *Device) ResetNvLinkUtilizationCounterCalls() []struct { + N1 int + N2 int +} { + var calls []struct { + N1 int + N2 int + } + mock.lockResetNvLinkUtilizationCounter.RLock() + calls = mock.calls.ResetNvLinkUtilizationCounter + mock.lockResetNvLinkUtilizationCounter.RUnlock() + return calls +} + +// SetAPIRestriction calls SetAPIRestrictionFunc. +func (mock *Device) SetAPIRestriction(restrictedAPI nvml.RestrictedAPI, enableState nvml.EnableState) nvml.Return { + if mock.SetAPIRestrictionFunc == nil { + panic("Device.SetAPIRestrictionFunc: method is nil but Device.SetAPIRestriction was just called") + } + callInfo := struct { + RestrictedAPI nvml.RestrictedAPI + EnableState nvml.EnableState + }{ + RestrictedAPI: restrictedAPI, + EnableState: enableState, + } + mock.lockSetAPIRestriction.Lock() + mock.calls.SetAPIRestriction = append(mock.calls.SetAPIRestriction, callInfo) + mock.lockSetAPIRestriction.Unlock() + return mock.SetAPIRestrictionFunc(restrictedAPI, enableState) +} + +// SetAPIRestrictionCalls gets all the calls that were made to SetAPIRestriction. +// Check the length with: +// +// len(mockedDevice.SetAPIRestrictionCalls()) +func (mock *Device) SetAPIRestrictionCalls() []struct { + RestrictedAPI nvml.RestrictedAPI + EnableState nvml.EnableState +} { + var calls []struct { + RestrictedAPI nvml.RestrictedAPI + EnableState nvml.EnableState + } + mock.lockSetAPIRestriction.RLock() + calls = mock.calls.SetAPIRestriction + mock.lockSetAPIRestriction.RUnlock() + return calls +} + +// SetAccountingMode calls SetAccountingModeFunc. +func (mock *Device) SetAccountingMode(enableState nvml.EnableState) nvml.Return { + if mock.SetAccountingModeFunc == nil { + panic("Device.SetAccountingModeFunc: method is nil but Device.SetAccountingMode was just called") + } + callInfo := struct { + EnableState nvml.EnableState + }{ + EnableState: enableState, + } + mock.lockSetAccountingMode.Lock() + mock.calls.SetAccountingMode = append(mock.calls.SetAccountingMode, callInfo) + mock.lockSetAccountingMode.Unlock() + return mock.SetAccountingModeFunc(enableState) +} + +// SetAccountingModeCalls gets all the calls that were made to SetAccountingMode. +// Check the length with: +// +// len(mockedDevice.SetAccountingModeCalls()) +func (mock *Device) SetAccountingModeCalls() []struct { + EnableState nvml.EnableState +} { + var calls []struct { + EnableState nvml.EnableState + } + mock.lockSetAccountingMode.RLock() + calls = mock.calls.SetAccountingMode + mock.lockSetAccountingMode.RUnlock() + return calls +} + +// SetApplicationsClocks calls SetApplicationsClocksFunc. +func (mock *Device) SetApplicationsClocks(v1 uint32, v2 uint32) nvml.Return { + if mock.SetApplicationsClocksFunc == nil { + panic("Device.SetApplicationsClocksFunc: method is nil but Device.SetApplicationsClocks was just called") + } + callInfo := struct { + V1 uint32 + V2 uint32 + }{ + V1: v1, + V2: v2, + } + mock.lockSetApplicationsClocks.Lock() + mock.calls.SetApplicationsClocks = append(mock.calls.SetApplicationsClocks, callInfo) + mock.lockSetApplicationsClocks.Unlock() + return mock.SetApplicationsClocksFunc(v1, v2) +} + +// SetApplicationsClocksCalls gets all the calls that were made to SetApplicationsClocks. +// Check the length with: +// +// len(mockedDevice.SetApplicationsClocksCalls()) +func (mock *Device) SetApplicationsClocksCalls() []struct { + V1 uint32 + V2 uint32 +} { + var calls []struct { + V1 uint32 + V2 uint32 + } + mock.lockSetApplicationsClocks.RLock() + calls = mock.calls.SetApplicationsClocks + mock.lockSetApplicationsClocks.RUnlock() + return calls +} + +// SetAutoBoostedClocksEnabled calls SetAutoBoostedClocksEnabledFunc. +func (mock *Device) SetAutoBoostedClocksEnabled(enableState nvml.EnableState) nvml.Return { + if mock.SetAutoBoostedClocksEnabledFunc == nil { + panic("Device.SetAutoBoostedClocksEnabledFunc: method is nil but Device.SetAutoBoostedClocksEnabled was just called") + } + callInfo := struct { + EnableState nvml.EnableState + }{ + EnableState: enableState, + } + mock.lockSetAutoBoostedClocksEnabled.Lock() + mock.calls.SetAutoBoostedClocksEnabled = append(mock.calls.SetAutoBoostedClocksEnabled, callInfo) + mock.lockSetAutoBoostedClocksEnabled.Unlock() + return mock.SetAutoBoostedClocksEnabledFunc(enableState) +} + +// SetAutoBoostedClocksEnabledCalls gets all the calls that were made to SetAutoBoostedClocksEnabled. +// Check the length with: +// +// len(mockedDevice.SetAutoBoostedClocksEnabledCalls()) +func (mock *Device) SetAutoBoostedClocksEnabledCalls() []struct { + EnableState nvml.EnableState +} { + var calls []struct { + EnableState nvml.EnableState + } + mock.lockSetAutoBoostedClocksEnabled.RLock() + calls = mock.calls.SetAutoBoostedClocksEnabled + mock.lockSetAutoBoostedClocksEnabled.RUnlock() + return calls +} + +// SetComputeMode calls SetComputeModeFunc. +func (mock *Device) SetComputeMode(computeMode nvml.ComputeMode) nvml.Return { + if mock.SetComputeModeFunc == nil { + panic("Device.SetComputeModeFunc: method is nil but Device.SetComputeMode was just called") + } + callInfo := struct { + ComputeMode nvml.ComputeMode + }{ + ComputeMode: computeMode, + } + mock.lockSetComputeMode.Lock() + mock.calls.SetComputeMode = append(mock.calls.SetComputeMode, callInfo) + mock.lockSetComputeMode.Unlock() + return mock.SetComputeModeFunc(computeMode) +} + +// SetComputeModeCalls gets all the calls that were made to SetComputeMode. +// Check the length with: +// +// len(mockedDevice.SetComputeModeCalls()) +func (mock *Device) SetComputeModeCalls() []struct { + ComputeMode nvml.ComputeMode +} { + var calls []struct { + ComputeMode nvml.ComputeMode + } + mock.lockSetComputeMode.RLock() + calls = mock.calls.SetComputeMode + mock.lockSetComputeMode.RUnlock() + return calls +} + +// SetCpuAffinity calls SetCpuAffinityFunc. +func (mock *Device) SetCpuAffinity() nvml.Return { + if mock.SetCpuAffinityFunc == nil { + panic("Device.SetCpuAffinityFunc: method is nil but Device.SetCpuAffinity was just called") + } + callInfo := struct { + }{} + mock.lockSetCpuAffinity.Lock() + mock.calls.SetCpuAffinity = append(mock.calls.SetCpuAffinity, callInfo) + mock.lockSetCpuAffinity.Unlock() + return mock.SetCpuAffinityFunc() +} + +// SetCpuAffinityCalls gets all the calls that were made to SetCpuAffinity. +// Check the length with: +// +// len(mockedDevice.SetCpuAffinityCalls()) +func (mock *Device) SetCpuAffinityCalls() []struct { +} { + var calls []struct { + } + mock.lockSetCpuAffinity.RLock() + calls = mock.calls.SetCpuAffinity + mock.lockSetCpuAffinity.RUnlock() + return calls +} + +// SetDefaultAutoBoostedClocksEnabled calls SetDefaultAutoBoostedClocksEnabledFunc. +func (mock *Device) SetDefaultAutoBoostedClocksEnabled(enableState nvml.EnableState, v uint32) nvml.Return { + if mock.SetDefaultAutoBoostedClocksEnabledFunc == nil { + panic("Device.SetDefaultAutoBoostedClocksEnabledFunc: method is nil but Device.SetDefaultAutoBoostedClocksEnabled was just called") + } + callInfo := struct { + EnableState nvml.EnableState + V uint32 + }{ + EnableState: enableState, + V: v, + } + mock.lockSetDefaultAutoBoostedClocksEnabled.Lock() + mock.calls.SetDefaultAutoBoostedClocksEnabled = append(mock.calls.SetDefaultAutoBoostedClocksEnabled, callInfo) + mock.lockSetDefaultAutoBoostedClocksEnabled.Unlock() + return mock.SetDefaultAutoBoostedClocksEnabledFunc(enableState, v) +} + +// SetDefaultAutoBoostedClocksEnabledCalls gets all the calls that were made to SetDefaultAutoBoostedClocksEnabled. +// Check the length with: +// +// len(mockedDevice.SetDefaultAutoBoostedClocksEnabledCalls()) +func (mock *Device) SetDefaultAutoBoostedClocksEnabledCalls() []struct { + EnableState nvml.EnableState + V uint32 +} { + var calls []struct { + EnableState nvml.EnableState + V uint32 + } + mock.lockSetDefaultAutoBoostedClocksEnabled.RLock() + calls = mock.calls.SetDefaultAutoBoostedClocksEnabled + mock.lockSetDefaultAutoBoostedClocksEnabled.RUnlock() + return calls +} + +// SetDefaultFanSpeed_v2 calls SetDefaultFanSpeed_v2Func. +func (mock *Device) SetDefaultFanSpeed_v2(n int) nvml.Return { + if mock.SetDefaultFanSpeed_v2Func == nil { + panic("Device.SetDefaultFanSpeed_v2Func: method is nil but Device.SetDefaultFanSpeed_v2 was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockSetDefaultFanSpeed_v2.Lock() + mock.calls.SetDefaultFanSpeed_v2 = append(mock.calls.SetDefaultFanSpeed_v2, callInfo) + mock.lockSetDefaultFanSpeed_v2.Unlock() + return mock.SetDefaultFanSpeed_v2Func(n) +} + +// SetDefaultFanSpeed_v2Calls gets all the calls that were made to SetDefaultFanSpeed_v2. +// Check the length with: +// +// len(mockedDevice.SetDefaultFanSpeed_v2Calls()) +func (mock *Device) SetDefaultFanSpeed_v2Calls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockSetDefaultFanSpeed_v2.RLock() + calls = mock.calls.SetDefaultFanSpeed_v2 + mock.lockSetDefaultFanSpeed_v2.RUnlock() + return calls +} + +// SetDriverModel calls SetDriverModelFunc. +func (mock *Device) SetDriverModel(driverModel nvml.DriverModel, v uint32) nvml.Return { + if mock.SetDriverModelFunc == nil { + panic("Device.SetDriverModelFunc: method is nil but Device.SetDriverModel was just called") + } + callInfo := struct { + DriverModel nvml.DriverModel + V uint32 + }{ + DriverModel: driverModel, + V: v, + } + mock.lockSetDriverModel.Lock() + mock.calls.SetDriverModel = append(mock.calls.SetDriverModel, callInfo) + mock.lockSetDriverModel.Unlock() + return mock.SetDriverModelFunc(driverModel, v) +} + +// SetDriverModelCalls gets all the calls that were made to SetDriverModel. +// Check the length with: +// +// len(mockedDevice.SetDriverModelCalls()) +func (mock *Device) SetDriverModelCalls() []struct { + DriverModel nvml.DriverModel + V uint32 +} { + var calls []struct { + DriverModel nvml.DriverModel + V uint32 + } + mock.lockSetDriverModel.RLock() + calls = mock.calls.SetDriverModel + mock.lockSetDriverModel.RUnlock() + return calls +} + +// SetEccMode calls SetEccModeFunc. +func (mock *Device) SetEccMode(enableState nvml.EnableState) nvml.Return { + if mock.SetEccModeFunc == nil { + panic("Device.SetEccModeFunc: method is nil but Device.SetEccMode was just called") + } + callInfo := struct { + EnableState nvml.EnableState + }{ + EnableState: enableState, + } + mock.lockSetEccMode.Lock() + mock.calls.SetEccMode = append(mock.calls.SetEccMode, callInfo) + mock.lockSetEccMode.Unlock() + return mock.SetEccModeFunc(enableState) +} + +// SetEccModeCalls gets all the calls that were made to SetEccMode. +// Check the length with: +// +// len(mockedDevice.SetEccModeCalls()) +func (mock *Device) SetEccModeCalls() []struct { + EnableState nvml.EnableState +} { + var calls []struct { + EnableState nvml.EnableState + } + mock.lockSetEccMode.RLock() + calls = mock.calls.SetEccMode + mock.lockSetEccMode.RUnlock() + return calls +} + +// SetFanControlPolicy calls SetFanControlPolicyFunc. +func (mock *Device) SetFanControlPolicy(n int, fanControlPolicy nvml.FanControlPolicy) nvml.Return { + if mock.SetFanControlPolicyFunc == nil { + panic("Device.SetFanControlPolicyFunc: method is nil but Device.SetFanControlPolicy was just called") + } + callInfo := struct { + N int + FanControlPolicy nvml.FanControlPolicy + }{ + N: n, + FanControlPolicy: fanControlPolicy, + } + mock.lockSetFanControlPolicy.Lock() + mock.calls.SetFanControlPolicy = append(mock.calls.SetFanControlPolicy, callInfo) + mock.lockSetFanControlPolicy.Unlock() + return mock.SetFanControlPolicyFunc(n, fanControlPolicy) +} + +// SetFanControlPolicyCalls gets all the calls that were made to SetFanControlPolicy. +// Check the length with: +// +// len(mockedDevice.SetFanControlPolicyCalls()) +func (mock *Device) SetFanControlPolicyCalls() []struct { + N int + FanControlPolicy nvml.FanControlPolicy +} { + var calls []struct { + N int + FanControlPolicy nvml.FanControlPolicy + } + mock.lockSetFanControlPolicy.RLock() + calls = mock.calls.SetFanControlPolicy + mock.lockSetFanControlPolicy.RUnlock() + return calls +} + +// SetFanSpeed_v2 calls SetFanSpeed_v2Func. +func (mock *Device) SetFanSpeed_v2(n1 int, n2 int) nvml.Return { + if mock.SetFanSpeed_v2Func == nil { + panic("Device.SetFanSpeed_v2Func: method is nil but Device.SetFanSpeed_v2 was just called") + } + callInfo := struct { + N1 int + N2 int + }{ + N1: n1, + N2: n2, + } + mock.lockSetFanSpeed_v2.Lock() + mock.calls.SetFanSpeed_v2 = append(mock.calls.SetFanSpeed_v2, callInfo) + mock.lockSetFanSpeed_v2.Unlock() + return mock.SetFanSpeed_v2Func(n1, n2) +} + +// SetFanSpeed_v2Calls gets all the calls that were made to SetFanSpeed_v2. +// Check the length with: +// +// len(mockedDevice.SetFanSpeed_v2Calls()) +func (mock *Device) SetFanSpeed_v2Calls() []struct { + N1 int + N2 int +} { + var calls []struct { + N1 int + N2 int + } + mock.lockSetFanSpeed_v2.RLock() + calls = mock.calls.SetFanSpeed_v2 + mock.lockSetFanSpeed_v2.RUnlock() + return calls +} + +// SetGpcClkVfOffset calls SetGpcClkVfOffsetFunc. +func (mock *Device) SetGpcClkVfOffset(n int) nvml.Return { + if mock.SetGpcClkVfOffsetFunc == nil { + panic("Device.SetGpcClkVfOffsetFunc: method is nil but Device.SetGpcClkVfOffset was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockSetGpcClkVfOffset.Lock() + mock.calls.SetGpcClkVfOffset = append(mock.calls.SetGpcClkVfOffset, callInfo) + mock.lockSetGpcClkVfOffset.Unlock() + return mock.SetGpcClkVfOffsetFunc(n) +} + +// SetGpcClkVfOffsetCalls gets all the calls that were made to SetGpcClkVfOffset. +// Check the length with: +// +// len(mockedDevice.SetGpcClkVfOffsetCalls()) +func (mock *Device) SetGpcClkVfOffsetCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockSetGpcClkVfOffset.RLock() + calls = mock.calls.SetGpcClkVfOffset + mock.lockSetGpcClkVfOffset.RUnlock() + return calls +} + +// SetGpuLockedClocks calls SetGpuLockedClocksFunc. +func (mock *Device) SetGpuLockedClocks(v1 uint32, v2 uint32) nvml.Return { + if mock.SetGpuLockedClocksFunc == nil { + panic("Device.SetGpuLockedClocksFunc: method is nil but Device.SetGpuLockedClocks was just called") + } + callInfo := struct { + V1 uint32 + V2 uint32 + }{ + V1: v1, + V2: v2, + } + mock.lockSetGpuLockedClocks.Lock() + mock.calls.SetGpuLockedClocks = append(mock.calls.SetGpuLockedClocks, callInfo) + mock.lockSetGpuLockedClocks.Unlock() + return mock.SetGpuLockedClocksFunc(v1, v2) +} + +// SetGpuLockedClocksCalls gets all the calls that were made to SetGpuLockedClocks. +// Check the length with: +// +// len(mockedDevice.SetGpuLockedClocksCalls()) +func (mock *Device) SetGpuLockedClocksCalls() []struct { + V1 uint32 + V2 uint32 +} { + var calls []struct { + V1 uint32 + V2 uint32 + } + mock.lockSetGpuLockedClocks.RLock() + calls = mock.calls.SetGpuLockedClocks + mock.lockSetGpuLockedClocks.RUnlock() + return calls +} + +// SetGpuOperationMode calls SetGpuOperationModeFunc. +func (mock *Device) SetGpuOperationMode(gpuOperationMode nvml.GpuOperationMode) nvml.Return { + if mock.SetGpuOperationModeFunc == nil { + panic("Device.SetGpuOperationModeFunc: method is nil but Device.SetGpuOperationMode was just called") + } + callInfo := struct { + GpuOperationMode nvml.GpuOperationMode + }{ + GpuOperationMode: gpuOperationMode, + } + mock.lockSetGpuOperationMode.Lock() + mock.calls.SetGpuOperationMode = append(mock.calls.SetGpuOperationMode, callInfo) + mock.lockSetGpuOperationMode.Unlock() + return mock.SetGpuOperationModeFunc(gpuOperationMode) +} + +// SetGpuOperationModeCalls gets all the calls that were made to SetGpuOperationMode. +// Check the length with: +// +// len(mockedDevice.SetGpuOperationModeCalls()) +func (mock *Device) SetGpuOperationModeCalls() []struct { + GpuOperationMode nvml.GpuOperationMode +} { + var calls []struct { + GpuOperationMode nvml.GpuOperationMode + } + mock.lockSetGpuOperationMode.RLock() + calls = mock.calls.SetGpuOperationMode + mock.lockSetGpuOperationMode.RUnlock() + return calls +} + +// SetMemClkVfOffset calls SetMemClkVfOffsetFunc. +func (mock *Device) SetMemClkVfOffset(n int) nvml.Return { + if mock.SetMemClkVfOffsetFunc == nil { + panic("Device.SetMemClkVfOffsetFunc: method is nil but Device.SetMemClkVfOffset was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockSetMemClkVfOffset.Lock() + mock.calls.SetMemClkVfOffset = append(mock.calls.SetMemClkVfOffset, callInfo) + mock.lockSetMemClkVfOffset.Unlock() + return mock.SetMemClkVfOffsetFunc(n) +} + +// SetMemClkVfOffsetCalls gets all the calls that were made to SetMemClkVfOffset. +// Check the length with: +// +// len(mockedDevice.SetMemClkVfOffsetCalls()) +func (mock *Device) SetMemClkVfOffsetCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockSetMemClkVfOffset.RLock() + calls = mock.calls.SetMemClkVfOffset + mock.lockSetMemClkVfOffset.RUnlock() + return calls +} + +// SetMemoryLockedClocks calls SetMemoryLockedClocksFunc. +func (mock *Device) SetMemoryLockedClocks(v1 uint32, v2 uint32) nvml.Return { + if mock.SetMemoryLockedClocksFunc == nil { + panic("Device.SetMemoryLockedClocksFunc: method is nil but Device.SetMemoryLockedClocks was just called") + } + callInfo := struct { + V1 uint32 + V2 uint32 + }{ + V1: v1, + V2: v2, + } + mock.lockSetMemoryLockedClocks.Lock() + mock.calls.SetMemoryLockedClocks = append(mock.calls.SetMemoryLockedClocks, callInfo) + mock.lockSetMemoryLockedClocks.Unlock() + return mock.SetMemoryLockedClocksFunc(v1, v2) +} + +// SetMemoryLockedClocksCalls gets all the calls that were made to SetMemoryLockedClocks. +// Check the length with: +// +// len(mockedDevice.SetMemoryLockedClocksCalls()) +func (mock *Device) SetMemoryLockedClocksCalls() []struct { + V1 uint32 + V2 uint32 +} { + var calls []struct { + V1 uint32 + V2 uint32 + } + mock.lockSetMemoryLockedClocks.RLock() + calls = mock.calls.SetMemoryLockedClocks + mock.lockSetMemoryLockedClocks.RUnlock() + return calls +} + +// SetMigMode calls SetMigModeFunc. +func (mock *Device) SetMigMode(n int) (nvml.Return, nvml.Return) { + if mock.SetMigModeFunc == nil { + panic("Device.SetMigModeFunc: method is nil but Device.SetMigMode was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockSetMigMode.Lock() + mock.calls.SetMigMode = append(mock.calls.SetMigMode, callInfo) + mock.lockSetMigMode.Unlock() + return mock.SetMigModeFunc(n) +} + +// SetMigModeCalls gets all the calls that were made to SetMigMode. +// Check the length with: +// +// len(mockedDevice.SetMigModeCalls()) +func (mock *Device) SetMigModeCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockSetMigMode.RLock() + calls = mock.calls.SetMigMode + mock.lockSetMigMode.RUnlock() + return calls +} + +// SetNvLinkDeviceLowPowerThreshold calls SetNvLinkDeviceLowPowerThresholdFunc. +func (mock *Device) SetNvLinkDeviceLowPowerThreshold(nvLinkPowerThres *nvml.NvLinkPowerThres) nvml.Return { + if mock.SetNvLinkDeviceLowPowerThresholdFunc == nil { + panic("Device.SetNvLinkDeviceLowPowerThresholdFunc: method is nil but Device.SetNvLinkDeviceLowPowerThreshold was just called") + } + callInfo := struct { + NvLinkPowerThres *nvml.NvLinkPowerThres + }{ + NvLinkPowerThres: nvLinkPowerThres, + } + mock.lockSetNvLinkDeviceLowPowerThreshold.Lock() + mock.calls.SetNvLinkDeviceLowPowerThreshold = append(mock.calls.SetNvLinkDeviceLowPowerThreshold, callInfo) + mock.lockSetNvLinkDeviceLowPowerThreshold.Unlock() + return mock.SetNvLinkDeviceLowPowerThresholdFunc(nvLinkPowerThres) +} + +// SetNvLinkDeviceLowPowerThresholdCalls gets all the calls that were made to SetNvLinkDeviceLowPowerThreshold. +// Check the length with: +// +// len(mockedDevice.SetNvLinkDeviceLowPowerThresholdCalls()) +func (mock *Device) SetNvLinkDeviceLowPowerThresholdCalls() []struct { + NvLinkPowerThres *nvml.NvLinkPowerThres +} { + var calls []struct { + NvLinkPowerThres *nvml.NvLinkPowerThres + } + mock.lockSetNvLinkDeviceLowPowerThreshold.RLock() + calls = mock.calls.SetNvLinkDeviceLowPowerThreshold + mock.lockSetNvLinkDeviceLowPowerThreshold.RUnlock() + return calls +} + +// SetNvLinkUtilizationControl calls SetNvLinkUtilizationControlFunc. +func (mock *Device) SetNvLinkUtilizationControl(n1 int, n2 int, nvLinkUtilizationControl *nvml.NvLinkUtilizationControl, b bool) nvml.Return { + if mock.SetNvLinkUtilizationControlFunc == nil { + panic("Device.SetNvLinkUtilizationControlFunc: method is nil but Device.SetNvLinkUtilizationControl was just called") + } + callInfo := struct { + N1 int + N2 int + NvLinkUtilizationControl *nvml.NvLinkUtilizationControl + B bool + }{ + N1: n1, + N2: n2, + NvLinkUtilizationControl: nvLinkUtilizationControl, + B: b, + } + mock.lockSetNvLinkUtilizationControl.Lock() + mock.calls.SetNvLinkUtilizationControl = append(mock.calls.SetNvLinkUtilizationControl, callInfo) + mock.lockSetNvLinkUtilizationControl.Unlock() + return mock.SetNvLinkUtilizationControlFunc(n1, n2, nvLinkUtilizationControl, b) +} + +// SetNvLinkUtilizationControlCalls gets all the calls that were made to SetNvLinkUtilizationControl. +// Check the length with: +// +// len(mockedDevice.SetNvLinkUtilizationControlCalls()) +func (mock *Device) SetNvLinkUtilizationControlCalls() []struct { + N1 int + N2 int + NvLinkUtilizationControl *nvml.NvLinkUtilizationControl + B bool +} { + var calls []struct { + N1 int + N2 int + NvLinkUtilizationControl *nvml.NvLinkUtilizationControl + B bool + } + mock.lockSetNvLinkUtilizationControl.RLock() + calls = mock.calls.SetNvLinkUtilizationControl + mock.lockSetNvLinkUtilizationControl.RUnlock() + return calls +} + +// SetPersistenceMode calls SetPersistenceModeFunc. +func (mock *Device) SetPersistenceMode(enableState nvml.EnableState) nvml.Return { + if mock.SetPersistenceModeFunc == nil { + panic("Device.SetPersistenceModeFunc: method is nil but Device.SetPersistenceMode was just called") + } + callInfo := struct { + EnableState nvml.EnableState + }{ + EnableState: enableState, + } + mock.lockSetPersistenceMode.Lock() + mock.calls.SetPersistenceMode = append(mock.calls.SetPersistenceMode, callInfo) + mock.lockSetPersistenceMode.Unlock() + return mock.SetPersistenceModeFunc(enableState) +} + +// SetPersistenceModeCalls gets all the calls that were made to SetPersistenceMode. +// Check the length with: +// +// len(mockedDevice.SetPersistenceModeCalls()) +func (mock *Device) SetPersistenceModeCalls() []struct { + EnableState nvml.EnableState +} { + var calls []struct { + EnableState nvml.EnableState + } + mock.lockSetPersistenceMode.RLock() + calls = mock.calls.SetPersistenceMode + mock.lockSetPersistenceMode.RUnlock() + return calls +} + +// SetPowerManagementLimit calls SetPowerManagementLimitFunc. +func (mock *Device) SetPowerManagementLimit(v uint32) nvml.Return { + if mock.SetPowerManagementLimitFunc == nil { + panic("Device.SetPowerManagementLimitFunc: method is nil but Device.SetPowerManagementLimit was just called") + } + callInfo := struct { + V uint32 + }{ + V: v, + } + mock.lockSetPowerManagementLimit.Lock() + mock.calls.SetPowerManagementLimit = append(mock.calls.SetPowerManagementLimit, callInfo) + mock.lockSetPowerManagementLimit.Unlock() + return mock.SetPowerManagementLimitFunc(v) +} + +// SetPowerManagementLimitCalls gets all the calls that were made to SetPowerManagementLimit. +// Check the length with: +// +// len(mockedDevice.SetPowerManagementLimitCalls()) +func (mock *Device) SetPowerManagementLimitCalls() []struct { + V uint32 +} { + var calls []struct { + V uint32 + } + mock.lockSetPowerManagementLimit.RLock() + calls = mock.calls.SetPowerManagementLimit + mock.lockSetPowerManagementLimit.RUnlock() + return calls +} + +// SetTemperatureThreshold calls SetTemperatureThresholdFunc. +func (mock *Device) SetTemperatureThreshold(temperatureThresholds nvml.TemperatureThresholds, n int) nvml.Return { + if mock.SetTemperatureThresholdFunc == nil { + panic("Device.SetTemperatureThresholdFunc: method is nil but Device.SetTemperatureThreshold was just called") + } + callInfo := struct { + TemperatureThresholds nvml.TemperatureThresholds + N int + }{ + TemperatureThresholds: temperatureThresholds, + N: n, + } + mock.lockSetTemperatureThreshold.Lock() + mock.calls.SetTemperatureThreshold = append(mock.calls.SetTemperatureThreshold, callInfo) + mock.lockSetTemperatureThreshold.Unlock() + return mock.SetTemperatureThresholdFunc(temperatureThresholds, n) +} + +// SetTemperatureThresholdCalls gets all the calls that were made to SetTemperatureThreshold. +// Check the length with: +// +// len(mockedDevice.SetTemperatureThresholdCalls()) +func (mock *Device) SetTemperatureThresholdCalls() []struct { + TemperatureThresholds nvml.TemperatureThresholds + N int +} { + var calls []struct { + TemperatureThresholds nvml.TemperatureThresholds + N int + } + mock.lockSetTemperatureThreshold.RLock() + calls = mock.calls.SetTemperatureThreshold + mock.lockSetTemperatureThreshold.RUnlock() + return calls +} + +// SetVgpuSchedulerState calls SetVgpuSchedulerStateFunc. +func (mock *Device) SetVgpuSchedulerState(vgpuSchedulerSetState *nvml.VgpuSchedulerSetState) nvml.Return { + if mock.SetVgpuSchedulerStateFunc == nil { + panic("Device.SetVgpuSchedulerStateFunc: method is nil but Device.SetVgpuSchedulerState was just called") + } + callInfo := struct { + VgpuSchedulerSetState *nvml.VgpuSchedulerSetState + }{ + VgpuSchedulerSetState: vgpuSchedulerSetState, + } + mock.lockSetVgpuSchedulerState.Lock() + mock.calls.SetVgpuSchedulerState = append(mock.calls.SetVgpuSchedulerState, callInfo) + mock.lockSetVgpuSchedulerState.Unlock() + return mock.SetVgpuSchedulerStateFunc(vgpuSchedulerSetState) +} + +// SetVgpuSchedulerStateCalls gets all the calls that were made to SetVgpuSchedulerState. +// Check the length with: +// +// len(mockedDevice.SetVgpuSchedulerStateCalls()) +func (mock *Device) SetVgpuSchedulerStateCalls() []struct { + VgpuSchedulerSetState *nvml.VgpuSchedulerSetState +} { + var calls []struct { + VgpuSchedulerSetState *nvml.VgpuSchedulerSetState + } + mock.lockSetVgpuSchedulerState.RLock() + calls = mock.calls.SetVgpuSchedulerState + mock.lockSetVgpuSchedulerState.RUnlock() + return calls +} + +// SetVirtualizationMode calls SetVirtualizationModeFunc. +func (mock *Device) SetVirtualizationMode(gpuVirtualizationMode nvml.GpuVirtualizationMode) nvml.Return { + if mock.SetVirtualizationModeFunc == nil { + panic("Device.SetVirtualizationModeFunc: method is nil but Device.SetVirtualizationMode was just called") + } + callInfo := struct { + GpuVirtualizationMode nvml.GpuVirtualizationMode + }{ + GpuVirtualizationMode: gpuVirtualizationMode, + } + mock.lockSetVirtualizationMode.Lock() + mock.calls.SetVirtualizationMode = append(mock.calls.SetVirtualizationMode, callInfo) + mock.lockSetVirtualizationMode.Unlock() + return mock.SetVirtualizationModeFunc(gpuVirtualizationMode) +} + +// SetVirtualizationModeCalls gets all the calls that were made to SetVirtualizationMode. +// Check the length with: +// +// len(mockedDevice.SetVirtualizationModeCalls()) +func (mock *Device) SetVirtualizationModeCalls() []struct { + GpuVirtualizationMode nvml.GpuVirtualizationMode +} { + var calls []struct { + GpuVirtualizationMode nvml.GpuVirtualizationMode + } + mock.lockSetVirtualizationMode.RLock() + calls = mock.calls.SetVirtualizationMode + mock.lockSetVirtualizationMode.RUnlock() + return calls +} + +// ValidateInforom calls ValidateInforomFunc. +func (mock *Device) ValidateInforom() nvml.Return { + if mock.ValidateInforomFunc == nil { + panic("Device.ValidateInforomFunc: method is nil but Device.ValidateInforom was just called") + } + callInfo := struct { + }{} + mock.lockValidateInforom.Lock() + mock.calls.ValidateInforom = append(mock.calls.ValidateInforom, callInfo) + mock.lockValidateInforom.Unlock() + return mock.ValidateInforomFunc() +} + +// ValidateInforomCalls gets all the calls that were made to ValidateInforom. +// Check the length with: +// +// len(mockedDevice.ValidateInforomCalls()) +func (mock *Device) ValidateInforomCalls() []struct { +} { + var calls []struct { + } + mock.lockValidateInforom.RLock() + calls = mock.calls.ValidateInforom + mock.lockValidateInforom.RUnlock() + return calls +} + +// VgpuTypeGetMaxInstances calls VgpuTypeGetMaxInstancesFunc. +func (mock *Device) VgpuTypeGetMaxInstances(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) { + if mock.VgpuTypeGetMaxInstancesFunc == nil { + panic("Device.VgpuTypeGetMaxInstancesFunc: method is nil but Device.VgpuTypeGetMaxInstances was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetMaxInstances.Lock() + mock.calls.VgpuTypeGetMaxInstances = append(mock.calls.VgpuTypeGetMaxInstances, callInfo) + mock.lockVgpuTypeGetMaxInstances.Unlock() + return mock.VgpuTypeGetMaxInstancesFunc(vgpuTypeId) +} + +// VgpuTypeGetMaxInstancesCalls gets all the calls that were made to VgpuTypeGetMaxInstances. +// Check the length with: +// +// len(mockedDevice.VgpuTypeGetMaxInstancesCalls()) +func (mock *Device) VgpuTypeGetMaxInstancesCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetMaxInstances.RLock() + calls = mock.calls.VgpuTypeGetMaxInstances + mock.lockVgpuTypeGetMaxInstances.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/eventset.go b/pkg/nvml/mock/eventset.go new file mode 100644 index 0000000..d452c4d --- /dev/null +++ b/pkg/nvml/mock/eventset.go @@ -0,0 +1,112 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that EventSet does implement nvml.EventSet. +// If this is not the case, regenerate this file with moq. +var _ nvml.EventSet = &EventSet{} + +// EventSet is a mock implementation of nvml.EventSet. +// +// func TestSomethingThatUsesEventSet(t *testing.T) { +// +// // make and configure a mocked nvml.EventSet +// mockedEventSet := &EventSet{ +// FreeFunc: func() nvml.Return { +// panic("mock out the Free method") +// }, +// WaitFunc: func(v uint32) (nvml.EventData, nvml.Return) { +// panic("mock out the Wait method") +// }, +// } +// +// // use mockedEventSet in code that requires nvml.EventSet +// // and then make assertions. +// +// } +type EventSet struct { + // FreeFunc mocks the Free method. + FreeFunc func() nvml.Return + + // WaitFunc mocks the Wait method. + WaitFunc func(v uint32) (nvml.EventData, nvml.Return) + + // calls tracks calls to the methods. + calls struct { + // Free holds details about calls to the Free method. + Free []struct { + } + // Wait holds details about calls to the Wait method. + Wait []struct { + // V is the v argument value. + V uint32 + } + } + lockFree sync.RWMutex + lockWait sync.RWMutex +} + +// Free calls FreeFunc. +func (mock *EventSet) Free() nvml.Return { + if mock.FreeFunc == nil { + panic("EventSet.FreeFunc: method is nil but EventSet.Free was just called") + } + callInfo := struct { + }{} + mock.lockFree.Lock() + mock.calls.Free = append(mock.calls.Free, callInfo) + mock.lockFree.Unlock() + return mock.FreeFunc() +} + +// FreeCalls gets all the calls that were made to Free. +// Check the length with: +// +// len(mockedEventSet.FreeCalls()) +func (mock *EventSet) FreeCalls() []struct { +} { + var calls []struct { + } + mock.lockFree.RLock() + calls = mock.calls.Free + mock.lockFree.RUnlock() + return calls +} + +// Wait calls WaitFunc. +func (mock *EventSet) Wait(v uint32) (nvml.EventData, nvml.Return) { + if mock.WaitFunc == nil { + panic("EventSet.WaitFunc: method is nil but EventSet.Wait was just called") + } + callInfo := struct { + V uint32 + }{ + V: v, + } + mock.lockWait.Lock() + mock.calls.Wait = append(mock.calls.Wait, callInfo) + mock.lockWait.Unlock() + return mock.WaitFunc(v) +} + +// WaitCalls gets all the calls that were made to Wait. +// Check the length with: +// +// len(mockedEventSet.WaitCalls()) +func (mock *EventSet) WaitCalls() []struct { + V uint32 +} { + var calls []struct { + V uint32 + } + mock.lockWait.RLock() + calls = mock.calls.Wait + mock.lockWait.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/gpmsample.go b/pkg/nvml/mock/gpmsample.go new file mode 100644 index 0000000..1023c34 --- /dev/null +++ b/pkg/nvml/mock/gpmsample.go @@ -0,0 +1,162 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that GpmSample does implement nvml.GpmSample. +// If this is not the case, regenerate this file with moq. +var _ nvml.GpmSample = &GpmSample{} + +// GpmSample is a mock implementation of nvml.GpmSample. +// +// func TestSomethingThatUsesGpmSample(t *testing.T) { +// +// // make and configure a mocked nvml.GpmSample +// mockedGpmSample := &GpmSample{ +// FreeFunc: func() nvml.Return { +// panic("mock out the Free method") +// }, +// GetFunc: func(device nvml.Device) nvml.Return { +// panic("mock out the Get method") +// }, +// MigGetFunc: func(device nvml.Device, n int) nvml.Return { +// panic("mock out the MigGet method") +// }, +// } +// +// // use mockedGpmSample in code that requires nvml.GpmSample +// // and then make assertions. +// +// } +type GpmSample struct { + // FreeFunc mocks the Free method. + FreeFunc func() nvml.Return + + // GetFunc mocks the Get method. + GetFunc func(device nvml.Device) nvml.Return + + // MigGetFunc mocks the MigGet method. + MigGetFunc func(device nvml.Device, n int) nvml.Return + + // calls tracks calls to the methods. + calls struct { + // Free holds details about calls to the Free method. + Free []struct { + } + // Get holds details about calls to the Get method. + Get []struct { + // Device is the device argument value. + Device nvml.Device + } + // MigGet holds details about calls to the MigGet method. + MigGet []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + } + lockFree sync.RWMutex + lockGet sync.RWMutex + lockMigGet sync.RWMutex +} + +// Free calls FreeFunc. +func (mock *GpmSample) Free() nvml.Return { + if mock.FreeFunc == nil { + panic("GpmSample.FreeFunc: method is nil but GpmSample.Free was just called") + } + callInfo := struct { + }{} + mock.lockFree.Lock() + mock.calls.Free = append(mock.calls.Free, callInfo) + mock.lockFree.Unlock() + return mock.FreeFunc() +} + +// FreeCalls gets all the calls that were made to Free. +// Check the length with: +// +// len(mockedGpmSample.FreeCalls()) +func (mock *GpmSample) FreeCalls() []struct { +} { + var calls []struct { + } + mock.lockFree.RLock() + calls = mock.calls.Free + mock.lockFree.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *GpmSample) Get(device nvml.Device) nvml.Return { + if mock.GetFunc == nil { + panic("GpmSample.GetFunc: method is nil but GpmSample.Get was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + mock.lockGet.Unlock() + return mock.GetFunc(device) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// +// len(mockedGpmSample.GetCalls()) +func (mock *GpmSample) GetCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockGet.RLock() + calls = mock.calls.Get + mock.lockGet.RUnlock() + return calls +} + +// MigGet calls MigGetFunc. +func (mock *GpmSample) MigGet(device nvml.Device, n int) nvml.Return { + if mock.MigGetFunc == nil { + panic("GpmSample.MigGetFunc: method is nil but GpmSample.MigGet was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockMigGet.Lock() + mock.calls.MigGet = append(mock.calls.MigGet, callInfo) + mock.lockMigGet.Unlock() + return mock.MigGetFunc(device, n) +} + +// MigGetCalls gets all the calls that were made to MigGet. +// Check the length with: +// +// len(mockedGpmSample.MigGetCalls()) +func (mock *GpmSample) MigGetCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockMigGet.RLock() + calls = mock.calls.MigGet + mock.lockMigGet.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/gpuinstance.go b/pkg/nvml/mock/gpuinstance.go new file mode 100644 index 0000000..e084df2 --- /dev/null +++ b/pkg/nvml/mock/gpuinstance.go @@ -0,0 +1,475 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that GpuInstance does implement nvml.GpuInstance. +// If this is not the case, regenerate this file with moq. +var _ nvml.GpuInstance = &GpuInstance{} + +// GpuInstance is a mock implementation of nvml.GpuInstance. +// +// func TestSomethingThatUsesGpuInstance(t *testing.T) { +// +// // make and configure a mocked nvml.GpuInstance +// mockedGpuInstance := &GpuInstance{ +// CreateComputeInstanceFunc: func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (nvml.ComputeInstance, nvml.Return) { +// panic("mock out the CreateComputeInstance method") +// }, +// CreateComputeInstanceWithPlacementFunc: func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo, computeInstancePlacement *nvml.ComputeInstancePlacement) (nvml.ComputeInstance, nvml.Return) { +// panic("mock out the CreateComputeInstanceWithPlacement method") +// }, +// DestroyFunc: func() nvml.Return { +// panic("mock out the Destroy method") +// }, +// GetComputeInstanceByIdFunc: func(n int) (nvml.ComputeInstance, nvml.Return) { +// panic("mock out the GetComputeInstanceById method") +// }, +// GetComputeInstancePossiblePlacementsFunc: func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstancePlacement, nvml.Return) { +// panic("mock out the GetComputeInstancePossiblePlacements method") +// }, +// GetComputeInstanceProfileInfoFunc: func(n1 int, n2 int) (nvml.ComputeInstanceProfileInfo, nvml.Return) { +// panic("mock out the GetComputeInstanceProfileInfo method") +// }, +// GetComputeInstanceProfileInfoVFunc: func(n1 int, n2 int) nvml.ComputeInstanceProfileInfoV { +// panic("mock out the GetComputeInstanceProfileInfoV method") +// }, +// GetComputeInstanceRemainingCapacityFunc: func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (int, nvml.Return) { +// panic("mock out the GetComputeInstanceRemainingCapacity method") +// }, +// GetComputeInstancesFunc: func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstance, nvml.Return) { +// panic("mock out the GetComputeInstances method") +// }, +// GetInfoFunc: func() (nvml.GpuInstanceInfo, nvml.Return) { +// panic("mock out the GetInfo method") +// }, +// } +// +// // use mockedGpuInstance in code that requires nvml.GpuInstance +// // and then make assertions. +// +// } +type GpuInstance struct { + // CreateComputeInstanceFunc mocks the CreateComputeInstance method. + CreateComputeInstanceFunc func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (nvml.ComputeInstance, nvml.Return) + + // CreateComputeInstanceWithPlacementFunc mocks the CreateComputeInstanceWithPlacement method. + CreateComputeInstanceWithPlacementFunc func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo, computeInstancePlacement *nvml.ComputeInstancePlacement) (nvml.ComputeInstance, nvml.Return) + + // DestroyFunc mocks the Destroy method. + DestroyFunc func() nvml.Return + + // GetComputeInstanceByIdFunc mocks the GetComputeInstanceById method. + GetComputeInstanceByIdFunc func(n int) (nvml.ComputeInstance, nvml.Return) + + // GetComputeInstancePossiblePlacementsFunc mocks the GetComputeInstancePossiblePlacements method. + GetComputeInstancePossiblePlacementsFunc func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstancePlacement, nvml.Return) + + // GetComputeInstanceProfileInfoFunc mocks the GetComputeInstanceProfileInfo method. + GetComputeInstanceProfileInfoFunc func(n1 int, n2 int) (nvml.ComputeInstanceProfileInfo, nvml.Return) + + // GetComputeInstanceProfileInfoVFunc mocks the GetComputeInstanceProfileInfoV method. + GetComputeInstanceProfileInfoVFunc func(n1 int, n2 int) nvml.ComputeInstanceProfileInfoV + + // GetComputeInstanceRemainingCapacityFunc mocks the GetComputeInstanceRemainingCapacity method. + GetComputeInstanceRemainingCapacityFunc func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (int, nvml.Return) + + // GetComputeInstancesFunc mocks the GetComputeInstances method. + GetComputeInstancesFunc func(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstance, nvml.Return) + + // GetInfoFunc mocks the GetInfo method. + GetInfoFunc func() (nvml.GpuInstanceInfo, nvml.Return) + + // calls tracks calls to the methods. + calls struct { + // CreateComputeInstance holds details about calls to the CreateComputeInstance method. + CreateComputeInstance []struct { + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + // CreateComputeInstanceWithPlacement holds details about calls to the CreateComputeInstanceWithPlacement method. + CreateComputeInstanceWithPlacement []struct { + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + // ComputeInstancePlacement is the computeInstancePlacement argument value. + ComputeInstancePlacement *nvml.ComputeInstancePlacement + } + // Destroy holds details about calls to the Destroy method. + Destroy []struct { + } + // GetComputeInstanceById holds details about calls to the GetComputeInstanceById method. + GetComputeInstanceById []struct { + // N is the n argument value. + N int + } + // GetComputeInstancePossiblePlacements holds details about calls to the GetComputeInstancePossiblePlacements method. + GetComputeInstancePossiblePlacements []struct { + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + // GetComputeInstanceProfileInfo holds details about calls to the GetComputeInstanceProfileInfo method. + GetComputeInstanceProfileInfo []struct { + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // GetComputeInstanceProfileInfoV holds details about calls to the GetComputeInstanceProfileInfoV method. + GetComputeInstanceProfileInfoV []struct { + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // GetComputeInstanceRemainingCapacity holds details about calls to the GetComputeInstanceRemainingCapacity method. + GetComputeInstanceRemainingCapacity []struct { + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + // GetComputeInstances holds details about calls to the GetComputeInstances method. + GetComputeInstances []struct { + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + // GetInfo holds details about calls to the GetInfo method. + GetInfo []struct { + } + } + lockCreateComputeInstance sync.RWMutex + lockCreateComputeInstanceWithPlacement sync.RWMutex + lockDestroy sync.RWMutex + lockGetComputeInstanceById sync.RWMutex + lockGetComputeInstancePossiblePlacements sync.RWMutex + lockGetComputeInstanceProfileInfo sync.RWMutex + lockGetComputeInstanceProfileInfoV sync.RWMutex + lockGetComputeInstanceRemainingCapacity sync.RWMutex + lockGetComputeInstances sync.RWMutex + lockGetInfo sync.RWMutex +} + +// CreateComputeInstance calls CreateComputeInstanceFunc. +func (mock *GpuInstance) CreateComputeInstance(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (nvml.ComputeInstance, nvml.Return) { + if mock.CreateComputeInstanceFunc == nil { + panic("GpuInstance.CreateComputeInstanceFunc: method is nil but GpuInstance.CreateComputeInstance was just called") + } + callInfo := struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + }{ + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + } + mock.lockCreateComputeInstance.Lock() + mock.calls.CreateComputeInstance = append(mock.calls.CreateComputeInstance, callInfo) + mock.lockCreateComputeInstance.Unlock() + return mock.CreateComputeInstanceFunc(computeInstanceProfileInfo) +} + +// CreateComputeInstanceCalls gets all the calls that were made to CreateComputeInstance. +// Check the length with: +// +// len(mockedGpuInstance.CreateComputeInstanceCalls()) +func (mock *GpuInstance) CreateComputeInstanceCalls() []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo +} { + var calls []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + mock.lockCreateComputeInstance.RLock() + calls = mock.calls.CreateComputeInstance + mock.lockCreateComputeInstance.RUnlock() + return calls +} + +// CreateComputeInstanceWithPlacement calls CreateComputeInstanceWithPlacementFunc. +func (mock *GpuInstance) CreateComputeInstanceWithPlacement(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo, computeInstancePlacement *nvml.ComputeInstancePlacement) (nvml.ComputeInstance, nvml.Return) { + if mock.CreateComputeInstanceWithPlacementFunc == nil { + panic("GpuInstance.CreateComputeInstanceWithPlacementFunc: method is nil but GpuInstance.CreateComputeInstanceWithPlacement was just called") + } + callInfo := struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + ComputeInstancePlacement *nvml.ComputeInstancePlacement + }{ + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + ComputeInstancePlacement: computeInstancePlacement, + } + mock.lockCreateComputeInstanceWithPlacement.Lock() + mock.calls.CreateComputeInstanceWithPlacement = append(mock.calls.CreateComputeInstanceWithPlacement, callInfo) + mock.lockCreateComputeInstanceWithPlacement.Unlock() + return mock.CreateComputeInstanceWithPlacementFunc(computeInstanceProfileInfo, computeInstancePlacement) +} + +// CreateComputeInstanceWithPlacementCalls gets all the calls that were made to CreateComputeInstanceWithPlacement. +// Check the length with: +// +// len(mockedGpuInstance.CreateComputeInstanceWithPlacementCalls()) +func (mock *GpuInstance) CreateComputeInstanceWithPlacementCalls() []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + ComputeInstancePlacement *nvml.ComputeInstancePlacement +} { + var calls []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + ComputeInstancePlacement *nvml.ComputeInstancePlacement + } + mock.lockCreateComputeInstanceWithPlacement.RLock() + calls = mock.calls.CreateComputeInstanceWithPlacement + mock.lockCreateComputeInstanceWithPlacement.RUnlock() + return calls +} + +// Destroy calls DestroyFunc. +func (mock *GpuInstance) Destroy() nvml.Return { + if mock.DestroyFunc == nil { + panic("GpuInstance.DestroyFunc: method is nil but GpuInstance.Destroy was just called") + } + callInfo := struct { + }{} + mock.lockDestroy.Lock() + mock.calls.Destroy = append(mock.calls.Destroy, callInfo) + mock.lockDestroy.Unlock() + return mock.DestroyFunc() +} + +// DestroyCalls gets all the calls that were made to Destroy. +// Check the length with: +// +// len(mockedGpuInstance.DestroyCalls()) +func (mock *GpuInstance) DestroyCalls() []struct { +} { + var calls []struct { + } + mock.lockDestroy.RLock() + calls = mock.calls.Destroy + mock.lockDestroy.RUnlock() + return calls +} + +// GetComputeInstanceById calls GetComputeInstanceByIdFunc. +func (mock *GpuInstance) GetComputeInstanceById(n int) (nvml.ComputeInstance, nvml.Return) { + if mock.GetComputeInstanceByIdFunc == nil { + panic("GpuInstance.GetComputeInstanceByIdFunc: method is nil but GpuInstance.GetComputeInstanceById was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetComputeInstanceById.Lock() + mock.calls.GetComputeInstanceById = append(mock.calls.GetComputeInstanceById, callInfo) + mock.lockGetComputeInstanceById.Unlock() + return mock.GetComputeInstanceByIdFunc(n) +} + +// GetComputeInstanceByIdCalls gets all the calls that were made to GetComputeInstanceById. +// Check the length with: +// +// len(mockedGpuInstance.GetComputeInstanceByIdCalls()) +func (mock *GpuInstance) GetComputeInstanceByIdCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetComputeInstanceById.RLock() + calls = mock.calls.GetComputeInstanceById + mock.lockGetComputeInstanceById.RUnlock() + return calls +} + +// GetComputeInstancePossiblePlacements calls GetComputeInstancePossiblePlacementsFunc. +func (mock *GpuInstance) GetComputeInstancePossiblePlacements(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstancePlacement, nvml.Return) { + if mock.GetComputeInstancePossiblePlacementsFunc == nil { + panic("GpuInstance.GetComputeInstancePossiblePlacementsFunc: method is nil but GpuInstance.GetComputeInstancePossiblePlacements was just called") + } + callInfo := struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + }{ + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + } + mock.lockGetComputeInstancePossiblePlacements.Lock() + mock.calls.GetComputeInstancePossiblePlacements = append(mock.calls.GetComputeInstancePossiblePlacements, callInfo) + mock.lockGetComputeInstancePossiblePlacements.Unlock() + return mock.GetComputeInstancePossiblePlacementsFunc(computeInstanceProfileInfo) +} + +// GetComputeInstancePossiblePlacementsCalls gets all the calls that were made to GetComputeInstancePossiblePlacements. +// Check the length with: +// +// len(mockedGpuInstance.GetComputeInstancePossiblePlacementsCalls()) +func (mock *GpuInstance) GetComputeInstancePossiblePlacementsCalls() []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo +} { + var calls []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + mock.lockGetComputeInstancePossiblePlacements.RLock() + calls = mock.calls.GetComputeInstancePossiblePlacements + mock.lockGetComputeInstancePossiblePlacements.RUnlock() + return calls +} + +// GetComputeInstanceProfileInfo calls GetComputeInstanceProfileInfoFunc. +func (mock *GpuInstance) GetComputeInstanceProfileInfo(n1 int, n2 int) (nvml.ComputeInstanceProfileInfo, nvml.Return) { + if mock.GetComputeInstanceProfileInfoFunc == nil { + panic("GpuInstance.GetComputeInstanceProfileInfoFunc: method is nil but GpuInstance.GetComputeInstanceProfileInfo was just called") + } + callInfo := struct { + N1 int + N2 int + }{ + N1: n1, + N2: n2, + } + mock.lockGetComputeInstanceProfileInfo.Lock() + mock.calls.GetComputeInstanceProfileInfo = append(mock.calls.GetComputeInstanceProfileInfo, callInfo) + mock.lockGetComputeInstanceProfileInfo.Unlock() + return mock.GetComputeInstanceProfileInfoFunc(n1, n2) +} + +// GetComputeInstanceProfileInfoCalls gets all the calls that were made to GetComputeInstanceProfileInfo. +// Check the length with: +// +// len(mockedGpuInstance.GetComputeInstanceProfileInfoCalls()) +func (mock *GpuInstance) GetComputeInstanceProfileInfoCalls() []struct { + N1 int + N2 int +} { + var calls []struct { + N1 int + N2 int + } + mock.lockGetComputeInstanceProfileInfo.RLock() + calls = mock.calls.GetComputeInstanceProfileInfo + mock.lockGetComputeInstanceProfileInfo.RUnlock() + return calls +} + +// GetComputeInstanceProfileInfoV calls GetComputeInstanceProfileInfoVFunc. +func (mock *GpuInstance) GetComputeInstanceProfileInfoV(n1 int, n2 int) nvml.ComputeInstanceProfileInfoV { + if mock.GetComputeInstanceProfileInfoVFunc == nil { + panic("GpuInstance.GetComputeInstanceProfileInfoVFunc: method is nil but GpuInstance.GetComputeInstanceProfileInfoV was just called") + } + callInfo := struct { + N1 int + N2 int + }{ + N1: n1, + N2: n2, + } + mock.lockGetComputeInstanceProfileInfoV.Lock() + mock.calls.GetComputeInstanceProfileInfoV = append(mock.calls.GetComputeInstanceProfileInfoV, callInfo) + mock.lockGetComputeInstanceProfileInfoV.Unlock() + return mock.GetComputeInstanceProfileInfoVFunc(n1, n2) +} + +// GetComputeInstanceProfileInfoVCalls gets all the calls that were made to GetComputeInstanceProfileInfoV. +// Check the length with: +// +// len(mockedGpuInstance.GetComputeInstanceProfileInfoVCalls()) +func (mock *GpuInstance) GetComputeInstanceProfileInfoVCalls() []struct { + N1 int + N2 int +} { + var calls []struct { + N1 int + N2 int + } + mock.lockGetComputeInstanceProfileInfoV.RLock() + calls = mock.calls.GetComputeInstanceProfileInfoV + mock.lockGetComputeInstanceProfileInfoV.RUnlock() + return calls +} + +// GetComputeInstanceRemainingCapacity calls GetComputeInstanceRemainingCapacityFunc. +func (mock *GpuInstance) GetComputeInstanceRemainingCapacity(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (int, nvml.Return) { + if mock.GetComputeInstanceRemainingCapacityFunc == nil { + panic("GpuInstance.GetComputeInstanceRemainingCapacityFunc: method is nil but GpuInstance.GetComputeInstanceRemainingCapacity was just called") + } + callInfo := struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + }{ + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + } + mock.lockGetComputeInstanceRemainingCapacity.Lock() + mock.calls.GetComputeInstanceRemainingCapacity = append(mock.calls.GetComputeInstanceRemainingCapacity, callInfo) + mock.lockGetComputeInstanceRemainingCapacity.Unlock() + return mock.GetComputeInstanceRemainingCapacityFunc(computeInstanceProfileInfo) +} + +// GetComputeInstanceRemainingCapacityCalls gets all the calls that were made to GetComputeInstanceRemainingCapacity. +// Check the length with: +// +// len(mockedGpuInstance.GetComputeInstanceRemainingCapacityCalls()) +func (mock *GpuInstance) GetComputeInstanceRemainingCapacityCalls() []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo +} { + var calls []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + mock.lockGetComputeInstanceRemainingCapacity.RLock() + calls = mock.calls.GetComputeInstanceRemainingCapacity + mock.lockGetComputeInstanceRemainingCapacity.RUnlock() + return calls +} + +// GetComputeInstances calls GetComputeInstancesFunc. +func (mock *GpuInstance) GetComputeInstances(computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstance, nvml.Return) { + if mock.GetComputeInstancesFunc == nil { + panic("GpuInstance.GetComputeInstancesFunc: method is nil but GpuInstance.GetComputeInstances was just called") + } + callInfo := struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + }{ + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + } + mock.lockGetComputeInstances.Lock() + mock.calls.GetComputeInstances = append(mock.calls.GetComputeInstances, callInfo) + mock.lockGetComputeInstances.Unlock() + return mock.GetComputeInstancesFunc(computeInstanceProfileInfo) +} + +// GetComputeInstancesCalls gets all the calls that were made to GetComputeInstances. +// Check the length with: +// +// len(mockedGpuInstance.GetComputeInstancesCalls()) +func (mock *GpuInstance) GetComputeInstancesCalls() []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo +} { + var calls []struct { + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + mock.lockGetComputeInstances.RLock() + calls = mock.calls.GetComputeInstances + mock.lockGetComputeInstances.RUnlock() + return calls +} + +// GetInfo calls GetInfoFunc. +func (mock *GpuInstance) GetInfo() (nvml.GpuInstanceInfo, nvml.Return) { + if mock.GetInfoFunc == nil { + panic("GpuInstance.GetInfoFunc: method is nil but GpuInstance.GetInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetInfo.Lock() + mock.calls.GetInfo = append(mock.calls.GetInfo, callInfo) + mock.lockGetInfo.Unlock() + return mock.GetInfoFunc() +} + +// GetInfoCalls gets all the calls that were made to GetInfo. +// Check the length with: +// +// len(mockedGpuInstance.GetInfoCalls()) +func (mock *GpuInstance) GetInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetInfo.RLock() + calls = mock.calls.GetInfo + mock.lockGetInfo.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/interface.go b/pkg/nvml/mock/interface.go new file mode 100644 index 0000000..6e2f3d5 --- /dev/null +++ b/pkg/nvml/mock/interface.go @@ -0,0 +1,13588 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that Interface does implement nvml.Interface. +// If this is not the case, regenerate this file with moq. +var _ nvml.Interface = &Interface{} + +// Interface is a mock implementation of nvml.Interface. +// +// func TestSomethingThatUsesInterface(t *testing.T) { +// +// // make and configure a mocked nvml.Interface +// mockedInterface := &Interface{ +// ComputeInstanceDestroyFunc: func(computeInstance nvml.ComputeInstance) nvml.Return { +// panic("mock out the ComputeInstanceDestroy method") +// }, +// ComputeInstanceGetInfoFunc: func(computeInstance nvml.ComputeInstance) (nvml.ComputeInstanceInfo, nvml.Return) { +// panic("mock out the ComputeInstanceGetInfo method") +// }, +// DeviceCcuGetStreamStateFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceCcuGetStreamState method") +// }, +// DeviceCcuSetStreamStateFunc: func(device nvml.Device, n int) nvml.Return { +// panic("mock out the DeviceCcuSetStreamState method") +// }, +// DeviceClearAccountingPidsFunc: func(device nvml.Device) nvml.Return { +// panic("mock out the DeviceClearAccountingPids method") +// }, +// DeviceClearCpuAffinityFunc: func(device nvml.Device) nvml.Return { +// panic("mock out the DeviceClearCpuAffinity method") +// }, +// DeviceClearEccErrorCountsFunc: func(device nvml.Device, eccCounterType nvml.EccCounterType) nvml.Return { +// panic("mock out the DeviceClearEccErrorCounts method") +// }, +// DeviceClearFieldValuesFunc: func(device nvml.Device, fieldValues []nvml.FieldValue) nvml.Return { +// panic("mock out the DeviceClearFieldValues method") +// }, +// DeviceCreateGpuInstanceFunc: func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (nvml.GpuInstance, nvml.Return) { +// panic("mock out the DeviceCreateGpuInstance method") +// }, +// DeviceCreateGpuInstanceWithPlacementFunc: func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo, gpuInstancePlacement *nvml.GpuInstancePlacement) (nvml.GpuInstance, nvml.Return) { +// panic("mock out the DeviceCreateGpuInstanceWithPlacement method") +// }, +// DeviceDiscoverGpusFunc: func() (nvml.PciInfo, nvml.Return) { +// panic("mock out the DeviceDiscoverGpus method") +// }, +// DeviceFreezeNvLinkUtilizationCounterFunc: func(device nvml.Device, n1 int, n2 int, enableState nvml.EnableState) nvml.Return { +// panic("mock out the DeviceFreezeNvLinkUtilizationCounter method") +// }, +// DeviceGetAPIRestrictionFunc: func(device nvml.Device, restrictedAPI nvml.RestrictedAPI) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetAPIRestriction method") +// }, +// DeviceGetAccountingBufferSizeFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetAccountingBufferSize method") +// }, +// DeviceGetAccountingModeFunc: func(device nvml.Device) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetAccountingMode method") +// }, +// DeviceGetAccountingPidsFunc: func(device nvml.Device) ([]int, nvml.Return) { +// panic("mock out the DeviceGetAccountingPids method") +// }, +// DeviceGetAccountingStatsFunc: func(device nvml.Device, v uint32) (nvml.AccountingStats, nvml.Return) { +// panic("mock out the DeviceGetAccountingStats method") +// }, +// DeviceGetActiveVgpusFunc: func(device nvml.Device) ([]nvml.VgpuInstance, nvml.Return) { +// panic("mock out the DeviceGetActiveVgpus method") +// }, +// DeviceGetAdaptiveClockInfoStatusFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetAdaptiveClockInfoStatus method") +// }, +// DeviceGetApplicationsClockFunc: func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the DeviceGetApplicationsClock method") +// }, +// DeviceGetArchitectureFunc: func(device nvml.Device) (nvml.DeviceArchitecture, nvml.Return) { +// panic("mock out the DeviceGetArchitecture method") +// }, +// DeviceGetAttributesFunc: func(device nvml.Device) (nvml.DeviceAttributes, nvml.Return) { +// panic("mock out the DeviceGetAttributes method") +// }, +// DeviceGetAutoBoostedClocksEnabledFunc: func(device nvml.Device) (nvml.EnableState, nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetAutoBoostedClocksEnabled method") +// }, +// DeviceGetBAR1MemoryInfoFunc: func(device nvml.Device) (nvml.BAR1Memory, nvml.Return) { +// panic("mock out the DeviceGetBAR1MemoryInfo method") +// }, +// DeviceGetBoardIdFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetBoardId method") +// }, +// DeviceGetBoardPartNumberFunc: func(device nvml.Device) (string, nvml.Return) { +// panic("mock out the DeviceGetBoardPartNumber method") +// }, +// DeviceGetBrandFunc: func(device nvml.Device) (nvml.BrandType, nvml.Return) { +// panic("mock out the DeviceGetBrand method") +// }, +// DeviceGetBridgeChipInfoFunc: func(device nvml.Device) (nvml.BridgeChipHierarchy, nvml.Return) { +// panic("mock out the DeviceGetBridgeChipInfo method") +// }, +// DeviceGetBusTypeFunc: func(device nvml.Device) (nvml.BusType, nvml.Return) { +// panic("mock out the DeviceGetBusType method") +// }, +// DeviceGetClkMonStatusFunc: func(device nvml.Device) (nvml.ClkMonStatus, nvml.Return) { +// panic("mock out the DeviceGetClkMonStatus method") +// }, +// DeviceGetClockFunc: func(device nvml.Device, clockType nvml.ClockType, clockId nvml.ClockId) (uint32, nvml.Return) { +// panic("mock out the DeviceGetClock method") +// }, +// DeviceGetClockInfoFunc: func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the DeviceGetClockInfo method") +// }, +// DeviceGetComputeInstanceIdFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetComputeInstanceId method") +// }, +// DeviceGetComputeModeFunc: func(device nvml.Device) (nvml.ComputeMode, nvml.Return) { +// panic("mock out the DeviceGetComputeMode method") +// }, +// DeviceGetComputeRunningProcessesFunc: func(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) { +// panic("mock out the DeviceGetComputeRunningProcesses method") +// }, +// DeviceGetCountFunc: func() (int, nvml.Return) { +// panic("mock out the DeviceGetCount method") +// }, +// DeviceGetCpuAffinityFunc: func(device nvml.Device, n int) ([]uint, nvml.Return) { +// panic("mock out the DeviceGetCpuAffinity method") +// }, +// DeviceGetCpuAffinityWithinScopeFunc: func(device nvml.Device, n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) { +// panic("mock out the DeviceGetCpuAffinityWithinScope method") +// }, +// DeviceGetCreatableVgpusFunc: func(device nvml.Device) ([]nvml.VgpuTypeId, nvml.Return) { +// panic("mock out the DeviceGetCreatableVgpus method") +// }, +// DeviceGetCudaComputeCapabilityFunc: func(device nvml.Device) (int, int, nvml.Return) { +// panic("mock out the DeviceGetCudaComputeCapability method") +// }, +// DeviceGetCurrPcieLinkGenerationFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetCurrPcieLinkGeneration method") +// }, +// DeviceGetCurrPcieLinkWidthFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetCurrPcieLinkWidth method") +// }, +// DeviceGetCurrentClocksThrottleReasonsFunc: func(device nvml.Device) (uint64, nvml.Return) { +// panic("mock out the DeviceGetCurrentClocksThrottleReasons method") +// }, +// DeviceGetDecoderUtilizationFunc: func(device nvml.Device) (uint32, uint32, nvml.Return) { +// panic("mock out the DeviceGetDecoderUtilization method") +// }, +// DeviceGetDefaultApplicationsClockFunc: func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the DeviceGetDefaultApplicationsClock method") +// }, +// DeviceGetDefaultEccModeFunc: func(device nvml.Device) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetDefaultEccMode method") +// }, +// DeviceGetDetailedEccErrorsFunc: func(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (nvml.EccErrorCounts, nvml.Return) { +// panic("mock out the DeviceGetDetailedEccErrors method") +// }, +// DeviceGetDeviceHandleFromMigDeviceHandleFunc: func(device nvml.Device) (nvml.Device, nvml.Return) { +// panic("mock out the DeviceGetDeviceHandleFromMigDeviceHandle method") +// }, +// DeviceGetDisplayActiveFunc: func(device nvml.Device) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetDisplayActive method") +// }, +// DeviceGetDisplayModeFunc: func(device nvml.Device) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetDisplayMode method") +// }, +// DeviceGetDriverModelFunc: func(device nvml.Device) (nvml.DriverModel, nvml.DriverModel, nvml.Return) { +// panic("mock out the DeviceGetDriverModel method") +// }, +// DeviceGetDynamicPstatesInfoFunc: func(device nvml.Device) (nvml.GpuDynamicPstatesInfo, nvml.Return) { +// panic("mock out the DeviceGetDynamicPstatesInfo method") +// }, +// DeviceGetEccModeFunc: func(device nvml.Device) (nvml.EnableState, nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetEccMode method") +// }, +// DeviceGetEncoderCapacityFunc: func(device nvml.Device, encoderType nvml.EncoderType) (int, nvml.Return) { +// panic("mock out the DeviceGetEncoderCapacity method") +// }, +// DeviceGetEncoderSessionsFunc: func(device nvml.Device) ([]nvml.EncoderSessionInfo, nvml.Return) { +// panic("mock out the DeviceGetEncoderSessions method") +// }, +// DeviceGetEncoderStatsFunc: func(device nvml.Device) (int, uint32, uint32, nvml.Return) { +// panic("mock out the DeviceGetEncoderStats method") +// }, +// DeviceGetEncoderUtilizationFunc: func(device nvml.Device) (uint32, uint32, nvml.Return) { +// panic("mock out the DeviceGetEncoderUtilization method") +// }, +// DeviceGetEnforcedPowerLimitFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetEnforcedPowerLimit method") +// }, +// DeviceGetFBCSessionsFunc: func(device nvml.Device) ([]nvml.FBCSessionInfo, nvml.Return) { +// panic("mock out the DeviceGetFBCSessions method") +// }, +// DeviceGetFBCStatsFunc: func(device nvml.Device) (nvml.FBCStats, nvml.Return) { +// panic("mock out the DeviceGetFBCStats method") +// }, +// DeviceGetFanControlPolicy_v2Func: func(device nvml.Device, n int) (nvml.FanControlPolicy, nvml.Return) { +// panic("mock out the DeviceGetFanControlPolicy_v2 method") +// }, +// DeviceGetFanSpeedFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetFanSpeed method") +// }, +// DeviceGetFanSpeed_v2Func: func(device nvml.Device, n int) (uint32, nvml.Return) { +// panic("mock out the DeviceGetFanSpeed_v2 method") +// }, +// DeviceGetFieldValuesFunc: func(device nvml.Device, fieldValues []nvml.FieldValue) nvml.Return { +// panic("mock out the DeviceGetFieldValues method") +// }, +// DeviceGetGpcClkMinMaxVfOffsetFunc: func(device nvml.Device) (int, int, nvml.Return) { +// panic("mock out the DeviceGetGpcClkMinMaxVfOffset method") +// }, +// DeviceGetGpcClkVfOffsetFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetGpcClkVfOffset method") +// }, +// DeviceGetGpuFabricInfoFunc: func(device nvml.Device) (nvml.GpuFabricInfo, nvml.Return) { +// panic("mock out the DeviceGetGpuFabricInfo method") +// }, +// DeviceGetGpuInstanceByIdFunc: func(device nvml.Device, n int) (nvml.GpuInstance, nvml.Return) { +// panic("mock out the DeviceGetGpuInstanceById method") +// }, +// DeviceGetGpuInstanceIdFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetGpuInstanceId method") +// }, +// DeviceGetGpuInstancePossiblePlacementsFunc: func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstancePlacement, nvml.Return) { +// panic("mock out the DeviceGetGpuInstancePossiblePlacements method") +// }, +// DeviceGetGpuInstanceProfileInfoFunc: func(device nvml.Device, n int) (nvml.GpuInstanceProfileInfo, nvml.Return) { +// panic("mock out the DeviceGetGpuInstanceProfileInfo method") +// }, +// DeviceGetGpuInstanceProfileInfoVFunc: func(device nvml.Device, n int) nvml.GpuInstanceProfileInfoV { +// panic("mock out the DeviceGetGpuInstanceProfileInfoV method") +// }, +// DeviceGetGpuInstanceRemainingCapacityFunc: func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (int, nvml.Return) { +// panic("mock out the DeviceGetGpuInstanceRemainingCapacity method") +// }, +// DeviceGetGpuInstancesFunc: func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstance, nvml.Return) { +// panic("mock out the DeviceGetGpuInstances method") +// }, +// DeviceGetGpuMaxPcieLinkGenerationFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetGpuMaxPcieLinkGeneration method") +// }, +// DeviceGetGpuOperationModeFunc: func(device nvml.Device) (nvml.GpuOperationMode, nvml.GpuOperationMode, nvml.Return) { +// panic("mock out the DeviceGetGpuOperationMode method") +// }, +// DeviceGetGraphicsRunningProcessesFunc: func(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) { +// panic("mock out the DeviceGetGraphicsRunningProcesses method") +// }, +// DeviceGetGridLicensableFeaturesFunc: func(device nvml.Device) (nvml.GridLicensableFeatures, nvml.Return) { +// panic("mock out the DeviceGetGridLicensableFeatures method") +// }, +// DeviceGetGspFirmwareModeFunc: func(device nvml.Device) (bool, bool, nvml.Return) { +// panic("mock out the DeviceGetGspFirmwareMode method") +// }, +// DeviceGetGspFirmwareVersionFunc: func(device nvml.Device) (string, nvml.Return) { +// panic("mock out the DeviceGetGspFirmwareVersion method") +// }, +// DeviceGetHandleByIndexFunc: func(n int) (nvml.Device, nvml.Return) { +// panic("mock out the DeviceGetHandleByIndex method") +// }, +// DeviceGetHandleByPciBusIdFunc: func(s string) (nvml.Device, nvml.Return) { +// panic("mock out the DeviceGetHandleByPciBusId method") +// }, +// DeviceGetHandleBySerialFunc: func(s string) (nvml.Device, nvml.Return) { +// panic("mock out the DeviceGetHandleBySerial method") +// }, +// DeviceGetHandleByUUIDFunc: func(s string) (nvml.Device, nvml.Return) { +// panic("mock out the DeviceGetHandleByUUID method") +// }, +// DeviceGetHostVgpuModeFunc: func(device nvml.Device) (nvml.HostVgpuMode, nvml.Return) { +// panic("mock out the DeviceGetHostVgpuMode method") +// }, +// DeviceGetIndexFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetIndex method") +// }, +// DeviceGetInforomConfigurationChecksumFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetInforomConfigurationChecksum method") +// }, +// DeviceGetInforomImageVersionFunc: func(device nvml.Device) (string, nvml.Return) { +// panic("mock out the DeviceGetInforomImageVersion method") +// }, +// DeviceGetInforomVersionFunc: func(device nvml.Device, inforomObject nvml.InforomObject) (string, nvml.Return) { +// panic("mock out the DeviceGetInforomVersion method") +// }, +// DeviceGetIrqNumFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetIrqNum method") +// }, +// DeviceGetMPSComputeRunningProcessesFunc: func(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) { +// panic("mock out the DeviceGetMPSComputeRunningProcesses method") +// }, +// DeviceGetMaxClockInfoFunc: func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the DeviceGetMaxClockInfo method") +// }, +// DeviceGetMaxCustomerBoostClockFunc: func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { +// panic("mock out the DeviceGetMaxCustomerBoostClock method") +// }, +// DeviceGetMaxMigDeviceCountFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetMaxMigDeviceCount method") +// }, +// DeviceGetMaxPcieLinkGenerationFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetMaxPcieLinkGeneration method") +// }, +// DeviceGetMaxPcieLinkWidthFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetMaxPcieLinkWidth method") +// }, +// DeviceGetMemClkMinMaxVfOffsetFunc: func(device nvml.Device) (int, int, nvml.Return) { +// panic("mock out the DeviceGetMemClkMinMaxVfOffset method") +// }, +// DeviceGetMemClkVfOffsetFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetMemClkVfOffset method") +// }, +// DeviceGetMemoryAffinityFunc: func(device nvml.Device, n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) { +// panic("mock out the DeviceGetMemoryAffinity method") +// }, +// DeviceGetMemoryBusWidthFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetMemoryBusWidth method") +// }, +// DeviceGetMemoryErrorCounterFunc: func(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType, memoryLocation nvml.MemoryLocation) (uint64, nvml.Return) { +// panic("mock out the DeviceGetMemoryErrorCounter method") +// }, +// DeviceGetMemoryInfoFunc: func(device nvml.Device) (nvml.Memory, nvml.Return) { +// panic("mock out the DeviceGetMemoryInfo method") +// }, +// DeviceGetMemoryInfo_v2Func: func(device nvml.Device) (nvml.Memory_v2, nvml.Return) { +// panic("mock out the DeviceGetMemoryInfo_v2 method") +// }, +// DeviceGetMigDeviceHandleByIndexFunc: func(device nvml.Device, n int) (nvml.Device, nvml.Return) { +// panic("mock out the DeviceGetMigDeviceHandleByIndex method") +// }, +// DeviceGetMigModeFunc: func(device nvml.Device) (int, int, nvml.Return) { +// panic("mock out the DeviceGetMigMode method") +// }, +// DeviceGetMinMaxClockOfPStateFunc: func(device nvml.Device, clockType nvml.ClockType, pstates nvml.Pstates) (uint32, uint32, nvml.Return) { +// panic("mock out the DeviceGetMinMaxClockOfPState method") +// }, +// DeviceGetMinMaxFanSpeedFunc: func(device nvml.Device) (int, int, nvml.Return) { +// panic("mock out the DeviceGetMinMaxFanSpeed method") +// }, +// DeviceGetMinorNumberFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetMinorNumber method") +// }, +// DeviceGetMultiGpuBoardFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetMultiGpuBoard method") +// }, +// DeviceGetNameFunc: func(device nvml.Device) (string, nvml.Return) { +// panic("mock out the DeviceGetName method") +// }, +// DeviceGetNumFansFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetNumFans method") +// }, +// DeviceGetNumGpuCoresFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetNumGpuCores method") +// }, +// DeviceGetNvLinkCapabilityFunc: func(device nvml.Device, n int, nvLinkCapability nvml.NvLinkCapability) (uint32, nvml.Return) { +// panic("mock out the DeviceGetNvLinkCapability method") +// }, +// DeviceGetNvLinkErrorCounterFunc: func(device nvml.Device, n int, nvLinkErrorCounter nvml.NvLinkErrorCounter) (uint64, nvml.Return) { +// panic("mock out the DeviceGetNvLinkErrorCounter method") +// }, +// DeviceGetNvLinkRemoteDeviceTypeFunc: func(device nvml.Device, n int) (nvml.IntNvLinkDeviceType, nvml.Return) { +// panic("mock out the DeviceGetNvLinkRemoteDeviceType method") +// }, +// DeviceGetNvLinkRemotePciInfoFunc: func(device nvml.Device, n int) (nvml.PciInfo, nvml.Return) { +// panic("mock out the DeviceGetNvLinkRemotePciInfo method") +// }, +// DeviceGetNvLinkStateFunc: func(device nvml.Device, n int) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetNvLinkState method") +// }, +// DeviceGetNvLinkUtilizationControlFunc: func(device nvml.Device, n1 int, n2 int) (nvml.NvLinkUtilizationControl, nvml.Return) { +// panic("mock out the DeviceGetNvLinkUtilizationControl method") +// }, +// DeviceGetNvLinkUtilizationCounterFunc: func(device nvml.Device, n1 int, n2 int) (uint64, uint64, nvml.Return) { +// panic("mock out the DeviceGetNvLinkUtilizationCounter method") +// }, +// DeviceGetNvLinkVersionFunc: func(device nvml.Device, n int) (uint32, nvml.Return) { +// panic("mock out the DeviceGetNvLinkVersion method") +// }, +// DeviceGetP2PStatusFunc: func(device1 nvml.Device, device2 nvml.Device, gpuP2PCapsIndex nvml.GpuP2PCapsIndex) (nvml.GpuP2PStatus, nvml.Return) { +// panic("mock out the DeviceGetP2PStatus method") +// }, +// DeviceGetPciInfoFunc: func(device nvml.Device) (nvml.PciInfo, nvml.Return) { +// panic("mock out the DeviceGetPciInfo method") +// }, +// DeviceGetPcieLinkMaxSpeedFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetPcieLinkMaxSpeed method") +// }, +// DeviceGetPcieReplayCounterFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetPcieReplayCounter method") +// }, +// DeviceGetPcieSpeedFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceGetPcieSpeed method") +// }, +// DeviceGetPcieThroughputFunc: func(device nvml.Device, pcieUtilCounter nvml.PcieUtilCounter) (uint32, nvml.Return) { +// panic("mock out the DeviceGetPcieThroughput method") +// }, +// DeviceGetPerformanceStateFunc: func(device nvml.Device) (nvml.Pstates, nvml.Return) { +// panic("mock out the DeviceGetPerformanceState method") +// }, +// DeviceGetPersistenceModeFunc: func(device nvml.Device) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetPersistenceMode method") +// }, +// DeviceGetPgpuMetadataStringFunc: func(device nvml.Device) (string, nvml.Return) { +// panic("mock out the DeviceGetPgpuMetadataString method") +// }, +// DeviceGetPowerManagementDefaultLimitFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetPowerManagementDefaultLimit method") +// }, +// DeviceGetPowerManagementLimitFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetPowerManagementLimit method") +// }, +// DeviceGetPowerManagementLimitConstraintsFunc: func(device nvml.Device) (uint32, uint32, nvml.Return) { +// panic("mock out the DeviceGetPowerManagementLimitConstraints method") +// }, +// DeviceGetPowerManagementModeFunc: func(device nvml.Device) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetPowerManagementMode method") +// }, +// DeviceGetPowerSourceFunc: func(device nvml.Device) (nvml.PowerSource, nvml.Return) { +// panic("mock out the DeviceGetPowerSource method") +// }, +// DeviceGetPowerStateFunc: func(device nvml.Device) (nvml.Pstates, nvml.Return) { +// panic("mock out the DeviceGetPowerState method") +// }, +// DeviceGetPowerUsageFunc: func(device nvml.Device) (uint32, nvml.Return) { +// panic("mock out the DeviceGetPowerUsage method") +// }, +// DeviceGetProcessUtilizationFunc: func(device nvml.Device, v uint64) ([]nvml.ProcessUtilizationSample, nvml.Return) { +// panic("mock out the DeviceGetProcessUtilization method") +// }, +// DeviceGetRemappedRowsFunc: func(device nvml.Device) (int, int, bool, bool, nvml.Return) { +// panic("mock out the DeviceGetRemappedRows method") +// }, +// DeviceGetRetiredPagesFunc: func(device nvml.Device, pageRetirementCause nvml.PageRetirementCause) ([]uint64, nvml.Return) { +// panic("mock out the DeviceGetRetiredPages method") +// }, +// DeviceGetRetiredPagesPendingStatusFunc: func(device nvml.Device) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceGetRetiredPagesPendingStatus method") +// }, +// DeviceGetRetiredPages_v2Func: func(device nvml.Device, pageRetirementCause nvml.PageRetirementCause) ([]uint64, []uint64, nvml.Return) { +// panic("mock out the DeviceGetRetiredPages_v2 method") +// }, +// DeviceGetRowRemapperHistogramFunc: func(device nvml.Device) (nvml.RowRemapperHistogramValues, nvml.Return) { +// panic("mock out the DeviceGetRowRemapperHistogram method") +// }, +// DeviceGetSamplesFunc: func(device nvml.Device, samplingType nvml.SamplingType, v uint64) (nvml.ValueType, []nvml.Sample, nvml.Return) { +// panic("mock out the DeviceGetSamples method") +// }, +// DeviceGetSerialFunc: func(device nvml.Device) (string, nvml.Return) { +// panic("mock out the DeviceGetSerial method") +// }, +// DeviceGetSupportedClocksThrottleReasonsFunc: func(device nvml.Device) (uint64, nvml.Return) { +// panic("mock out the DeviceGetSupportedClocksThrottleReasons method") +// }, +// DeviceGetSupportedEventTypesFunc: func(device nvml.Device) (uint64, nvml.Return) { +// panic("mock out the DeviceGetSupportedEventTypes method") +// }, +// DeviceGetSupportedGraphicsClocksFunc: func(device nvml.Device, n int) (int, uint32, nvml.Return) { +// panic("mock out the DeviceGetSupportedGraphicsClocks method") +// }, +// DeviceGetSupportedMemoryClocksFunc: func(device nvml.Device) (int, uint32, nvml.Return) { +// panic("mock out the DeviceGetSupportedMemoryClocks method") +// }, +// DeviceGetSupportedPerformanceStatesFunc: func(device nvml.Device) ([]nvml.Pstates, nvml.Return) { +// panic("mock out the DeviceGetSupportedPerformanceStates method") +// }, +// DeviceGetSupportedVgpusFunc: func(device nvml.Device) ([]nvml.VgpuTypeId, nvml.Return) { +// panic("mock out the DeviceGetSupportedVgpus method") +// }, +// DeviceGetTargetFanSpeedFunc: func(device nvml.Device, n int) (int, nvml.Return) { +// panic("mock out the DeviceGetTargetFanSpeed method") +// }, +// DeviceGetTemperatureFunc: func(device nvml.Device, temperatureSensors nvml.TemperatureSensors) (uint32, nvml.Return) { +// panic("mock out the DeviceGetTemperature method") +// }, +// DeviceGetTemperatureThresholdFunc: func(device nvml.Device, temperatureThresholds nvml.TemperatureThresholds) (uint32, nvml.Return) { +// panic("mock out the DeviceGetTemperatureThreshold method") +// }, +// DeviceGetThermalSettingsFunc: func(device nvml.Device, v uint32) (nvml.GpuThermalSettings, nvml.Return) { +// panic("mock out the DeviceGetThermalSettings method") +// }, +// DeviceGetTopologyCommonAncestorFunc: func(device1 nvml.Device, device2 nvml.Device) (nvml.GpuTopologyLevel, nvml.Return) { +// panic("mock out the DeviceGetTopologyCommonAncestor method") +// }, +// DeviceGetTopologyNearestGpusFunc: func(device nvml.Device, gpuTopologyLevel nvml.GpuTopologyLevel) ([]nvml.Device, nvml.Return) { +// panic("mock out the DeviceGetTopologyNearestGpus method") +// }, +// DeviceGetTotalEccErrorsFunc: func(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (uint64, nvml.Return) { +// panic("mock out the DeviceGetTotalEccErrors method") +// }, +// DeviceGetTotalEnergyConsumptionFunc: func(device nvml.Device) (uint64, nvml.Return) { +// panic("mock out the DeviceGetTotalEnergyConsumption method") +// }, +// DeviceGetUUIDFunc: func(device nvml.Device) (string, nvml.Return) { +// panic("mock out the DeviceGetUUID method") +// }, +// DeviceGetUtilizationRatesFunc: func(device nvml.Device) (nvml.Utilization, nvml.Return) { +// panic("mock out the DeviceGetUtilizationRates method") +// }, +// DeviceGetVbiosVersionFunc: func(device nvml.Device) (string, nvml.Return) { +// panic("mock out the DeviceGetVbiosVersion method") +// }, +// DeviceGetVgpuCapabilitiesFunc: func(device nvml.Device, deviceVgpuCapability nvml.DeviceVgpuCapability) (bool, nvml.Return) { +// panic("mock out the DeviceGetVgpuCapabilities method") +// }, +// DeviceGetVgpuMetadataFunc: func(device nvml.Device) (nvml.VgpuPgpuMetadata, nvml.Return) { +// panic("mock out the DeviceGetVgpuMetadata method") +// }, +// DeviceGetVgpuProcessUtilizationFunc: func(device nvml.Device, v uint64) ([]nvml.VgpuProcessUtilizationSample, nvml.Return) { +// panic("mock out the DeviceGetVgpuProcessUtilization method") +// }, +// DeviceGetVgpuSchedulerCapabilitiesFunc: func(device nvml.Device) (nvml.VgpuSchedulerCapabilities, nvml.Return) { +// panic("mock out the DeviceGetVgpuSchedulerCapabilities method") +// }, +// DeviceGetVgpuSchedulerLogFunc: func(device nvml.Device) (nvml.VgpuSchedulerLog, nvml.Return) { +// panic("mock out the DeviceGetVgpuSchedulerLog method") +// }, +// DeviceGetVgpuSchedulerStateFunc: func(device nvml.Device) (nvml.VgpuSchedulerGetState, nvml.Return) { +// panic("mock out the DeviceGetVgpuSchedulerState method") +// }, +// DeviceGetVgpuUtilizationFunc: func(device nvml.Device, v uint64) (nvml.ValueType, []nvml.VgpuInstanceUtilizationSample, nvml.Return) { +// panic("mock out the DeviceGetVgpuUtilization method") +// }, +// DeviceGetViolationStatusFunc: func(device nvml.Device, perfPolicyType nvml.PerfPolicyType) (nvml.ViolationTime, nvml.Return) { +// panic("mock out the DeviceGetViolationStatus method") +// }, +// DeviceGetVirtualizationModeFunc: func(device nvml.Device) (nvml.GpuVirtualizationMode, nvml.Return) { +// panic("mock out the DeviceGetVirtualizationMode method") +// }, +// DeviceIsMigDeviceHandleFunc: func(device nvml.Device) (bool, nvml.Return) { +// panic("mock out the DeviceIsMigDeviceHandle method") +// }, +// DeviceModifyDrainStateFunc: func(pciInfo *nvml.PciInfo, enableState nvml.EnableState) nvml.Return { +// panic("mock out the DeviceModifyDrainState method") +// }, +// DeviceOnSameBoardFunc: func(device1 nvml.Device, device2 nvml.Device) (int, nvml.Return) { +// panic("mock out the DeviceOnSameBoard method") +// }, +// DeviceQueryDrainStateFunc: func(pciInfo *nvml.PciInfo) (nvml.EnableState, nvml.Return) { +// panic("mock out the DeviceQueryDrainState method") +// }, +// DeviceRegisterEventsFunc: func(device nvml.Device, v uint64, eventSet nvml.EventSet) nvml.Return { +// panic("mock out the DeviceRegisterEvents method") +// }, +// DeviceRemoveGpuFunc: func(pciInfo *nvml.PciInfo) nvml.Return { +// panic("mock out the DeviceRemoveGpu method") +// }, +// DeviceRemoveGpu_v2Func: func(pciInfo *nvml.PciInfo, detachGpuState nvml.DetachGpuState, pcieLinkState nvml.PcieLinkState) nvml.Return { +// panic("mock out the DeviceRemoveGpu_v2 method") +// }, +// DeviceResetApplicationsClocksFunc: func(device nvml.Device) nvml.Return { +// panic("mock out the DeviceResetApplicationsClocks method") +// }, +// DeviceResetGpuLockedClocksFunc: func(device nvml.Device) nvml.Return { +// panic("mock out the DeviceResetGpuLockedClocks method") +// }, +// DeviceResetMemoryLockedClocksFunc: func(device nvml.Device) nvml.Return { +// panic("mock out the DeviceResetMemoryLockedClocks method") +// }, +// DeviceResetNvLinkErrorCountersFunc: func(device nvml.Device, n int) nvml.Return { +// panic("mock out the DeviceResetNvLinkErrorCounters method") +// }, +// DeviceResetNvLinkUtilizationCounterFunc: func(device nvml.Device, n1 int, n2 int) nvml.Return { +// panic("mock out the DeviceResetNvLinkUtilizationCounter method") +// }, +// DeviceSetAPIRestrictionFunc: func(device nvml.Device, restrictedAPI nvml.RestrictedAPI, enableState nvml.EnableState) nvml.Return { +// panic("mock out the DeviceSetAPIRestriction method") +// }, +// DeviceSetAccountingModeFunc: func(device nvml.Device, enableState nvml.EnableState) nvml.Return { +// panic("mock out the DeviceSetAccountingMode method") +// }, +// DeviceSetApplicationsClocksFunc: func(device nvml.Device, v1 uint32, v2 uint32) nvml.Return { +// panic("mock out the DeviceSetApplicationsClocks method") +// }, +// DeviceSetAutoBoostedClocksEnabledFunc: func(device nvml.Device, enableState nvml.EnableState) nvml.Return { +// panic("mock out the DeviceSetAutoBoostedClocksEnabled method") +// }, +// DeviceSetComputeModeFunc: func(device nvml.Device, computeMode nvml.ComputeMode) nvml.Return { +// panic("mock out the DeviceSetComputeMode method") +// }, +// DeviceSetCpuAffinityFunc: func(device nvml.Device) nvml.Return { +// panic("mock out the DeviceSetCpuAffinity method") +// }, +// DeviceSetDefaultAutoBoostedClocksEnabledFunc: func(device nvml.Device, enableState nvml.EnableState, v uint32) nvml.Return { +// panic("mock out the DeviceSetDefaultAutoBoostedClocksEnabled method") +// }, +// DeviceSetDefaultFanSpeed_v2Func: func(device nvml.Device, n int) nvml.Return { +// panic("mock out the DeviceSetDefaultFanSpeed_v2 method") +// }, +// DeviceSetDriverModelFunc: func(device nvml.Device, driverModel nvml.DriverModel, v uint32) nvml.Return { +// panic("mock out the DeviceSetDriverModel method") +// }, +// DeviceSetEccModeFunc: func(device nvml.Device, enableState nvml.EnableState) nvml.Return { +// panic("mock out the DeviceSetEccMode method") +// }, +// DeviceSetFanControlPolicyFunc: func(device nvml.Device, n int, fanControlPolicy nvml.FanControlPolicy) nvml.Return { +// panic("mock out the DeviceSetFanControlPolicy method") +// }, +// DeviceSetFanSpeed_v2Func: func(device nvml.Device, n1 int, n2 int) nvml.Return { +// panic("mock out the DeviceSetFanSpeed_v2 method") +// }, +// DeviceSetGpcClkVfOffsetFunc: func(device nvml.Device, n int) nvml.Return { +// panic("mock out the DeviceSetGpcClkVfOffset method") +// }, +// DeviceSetGpuLockedClocksFunc: func(device nvml.Device, v1 uint32, v2 uint32) nvml.Return { +// panic("mock out the DeviceSetGpuLockedClocks method") +// }, +// DeviceSetGpuOperationModeFunc: func(device nvml.Device, gpuOperationMode nvml.GpuOperationMode) nvml.Return { +// panic("mock out the DeviceSetGpuOperationMode method") +// }, +// DeviceSetMemClkVfOffsetFunc: func(device nvml.Device, n int) nvml.Return { +// panic("mock out the DeviceSetMemClkVfOffset method") +// }, +// DeviceSetMemoryLockedClocksFunc: func(device nvml.Device, v1 uint32, v2 uint32) nvml.Return { +// panic("mock out the DeviceSetMemoryLockedClocks method") +// }, +// DeviceSetMigModeFunc: func(device nvml.Device, n int) (nvml.Return, nvml.Return) { +// panic("mock out the DeviceSetMigMode method") +// }, +// DeviceSetNvLinkDeviceLowPowerThresholdFunc: func(device nvml.Device, nvLinkPowerThres *nvml.NvLinkPowerThres) nvml.Return { +// panic("mock out the DeviceSetNvLinkDeviceLowPowerThreshold method") +// }, +// DeviceSetNvLinkUtilizationControlFunc: func(device nvml.Device, n1 int, n2 int, nvLinkUtilizationControl *nvml.NvLinkUtilizationControl, b bool) nvml.Return { +// panic("mock out the DeviceSetNvLinkUtilizationControl method") +// }, +// DeviceSetPersistenceModeFunc: func(device nvml.Device, enableState nvml.EnableState) nvml.Return { +// panic("mock out the DeviceSetPersistenceMode method") +// }, +// DeviceSetPowerManagementLimitFunc: func(device nvml.Device, v uint32) nvml.Return { +// panic("mock out the DeviceSetPowerManagementLimit method") +// }, +// DeviceSetTemperatureThresholdFunc: func(device nvml.Device, temperatureThresholds nvml.TemperatureThresholds, n int) nvml.Return { +// panic("mock out the DeviceSetTemperatureThreshold method") +// }, +// DeviceSetVgpuSchedulerStateFunc: func(device nvml.Device, vgpuSchedulerSetState *nvml.VgpuSchedulerSetState) nvml.Return { +// panic("mock out the DeviceSetVgpuSchedulerState method") +// }, +// DeviceSetVirtualizationModeFunc: func(device nvml.Device, gpuVirtualizationMode nvml.GpuVirtualizationMode) nvml.Return { +// panic("mock out the DeviceSetVirtualizationMode method") +// }, +// DeviceValidateInforomFunc: func(device nvml.Device) nvml.Return { +// panic("mock out the DeviceValidateInforom method") +// }, +// ErrorStringFunc: func(returnMoqParam nvml.Return) string { +// panic("mock out the ErrorString method") +// }, +// EventSetCreateFunc: func() (nvml.EventSet, nvml.Return) { +// panic("mock out the EventSetCreate method") +// }, +// EventSetFreeFunc: func(eventSet nvml.EventSet) nvml.Return { +// panic("mock out the EventSetFree method") +// }, +// EventSetWaitFunc: func(eventSet nvml.EventSet, v uint32) (nvml.EventData, nvml.Return) { +// panic("mock out the EventSetWait method") +// }, +// GetExcludedDeviceCountFunc: func() (int, nvml.Return) { +// panic("mock out the GetExcludedDeviceCount method") +// }, +// GetExcludedDeviceInfoByIndexFunc: func(n int) (nvml.ExcludedDeviceInfo, nvml.Return) { +// panic("mock out the GetExcludedDeviceInfoByIndex method") +// }, +// GetLibraryFunc: func() nvml.Library { +// panic("mock out the GetLibrary method") +// }, +// GetVgpuCompatibilityFunc: func(vgpuMetadata *nvml.VgpuMetadata, vgpuPgpuMetadata *nvml.VgpuPgpuMetadata) (nvml.VgpuPgpuCompatibility, nvml.Return) { +// panic("mock out the GetVgpuCompatibility method") +// }, +// GetVgpuDriverCapabilitiesFunc: func(vgpuDriverCapability nvml.VgpuDriverCapability) (bool, nvml.Return) { +// panic("mock out the GetVgpuDriverCapabilities method") +// }, +// GetVgpuVersionFunc: func() (nvml.VgpuVersion, nvml.VgpuVersion, nvml.Return) { +// panic("mock out the GetVgpuVersion method") +// }, +// GpmMetricsGetFunc: func(gpmMetricsGetType *nvml.GpmMetricsGetType) nvml.Return { +// panic("mock out the GpmMetricsGet method") +// }, +// GpmMetricsGetVFunc: func(gpmMetricsGetType *nvml.GpmMetricsGetType) nvml.GpmMetricsGetVType { +// panic("mock out the GpmMetricsGetV method") +// }, +// GpmMigSampleGetFunc: func(device nvml.Device, n int, gpmSample nvml.GpmSample) nvml.Return { +// panic("mock out the GpmMigSampleGet method") +// }, +// GpmQueryDeviceSupportFunc: func(device nvml.Device) (nvml.GpmSupport, nvml.Return) { +// panic("mock out the GpmQueryDeviceSupport method") +// }, +// GpmQueryDeviceSupportVFunc: func(device nvml.Device) nvml.GpmSupportV { +// panic("mock out the GpmQueryDeviceSupportV method") +// }, +// GpmSampleAllocFunc: func() (nvml.GpmSample, nvml.Return) { +// panic("mock out the GpmSampleAlloc method") +// }, +// GpmSampleFreeFunc: func(gpmSample nvml.GpmSample) nvml.Return { +// panic("mock out the GpmSampleFree method") +// }, +// GpmSampleGetFunc: func(device nvml.Device, gpmSample nvml.GpmSample) nvml.Return { +// panic("mock out the GpmSampleGet method") +// }, +// GpuInstanceCreateComputeInstanceFunc: func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (nvml.ComputeInstance, nvml.Return) { +// panic("mock out the GpuInstanceCreateComputeInstance method") +// }, +// GpuInstanceCreateComputeInstanceWithPlacementFunc: func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo, computeInstancePlacement *nvml.ComputeInstancePlacement) (nvml.ComputeInstance, nvml.Return) { +// panic("mock out the GpuInstanceCreateComputeInstanceWithPlacement method") +// }, +// GpuInstanceDestroyFunc: func(gpuInstance nvml.GpuInstance) nvml.Return { +// panic("mock out the GpuInstanceDestroy method") +// }, +// GpuInstanceGetComputeInstanceByIdFunc: func(gpuInstance nvml.GpuInstance, n int) (nvml.ComputeInstance, nvml.Return) { +// panic("mock out the GpuInstanceGetComputeInstanceById method") +// }, +// GpuInstanceGetComputeInstancePossiblePlacementsFunc: func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstancePlacement, nvml.Return) { +// panic("mock out the GpuInstanceGetComputeInstancePossiblePlacements method") +// }, +// GpuInstanceGetComputeInstanceProfileInfoFunc: func(gpuInstance nvml.GpuInstance, n1 int, n2 int) (nvml.ComputeInstanceProfileInfo, nvml.Return) { +// panic("mock out the GpuInstanceGetComputeInstanceProfileInfo method") +// }, +// GpuInstanceGetComputeInstanceProfileInfoVFunc: func(gpuInstance nvml.GpuInstance, n1 int, n2 int) nvml.ComputeInstanceProfileInfoV { +// panic("mock out the GpuInstanceGetComputeInstanceProfileInfoV method") +// }, +// GpuInstanceGetComputeInstanceRemainingCapacityFunc: func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (int, nvml.Return) { +// panic("mock out the GpuInstanceGetComputeInstanceRemainingCapacity method") +// }, +// GpuInstanceGetComputeInstancesFunc: func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstance, nvml.Return) { +// panic("mock out the GpuInstanceGetComputeInstances method") +// }, +// GpuInstanceGetInfoFunc: func(gpuInstance nvml.GpuInstance) (nvml.GpuInstanceInfo, nvml.Return) { +// panic("mock out the GpuInstanceGetInfo method") +// }, +// InitFunc: func() nvml.Return { +// panic("mock out the Init method") +// }, +// InitWithFlagsFunc: func(v uint32) nvml.Return { +// panic("mock out the InitWithFlags method") +// }, +// SetVgpuVersionFunc: func(vgpuVersion *nvml.VgpuVersion) nvml.Return { +// panic("mock out the SetVgpuVersion method") +// }, +// ShutdownFunc: func() nvml.Return { +// panic("mock out the Shutdown method") +// }, +// SystemGetCudaDriverVersionFunc: func() (int, nvml.Return) { +// panic("mock out the SystemGetCudaDriverVersion method") +// }, +// SystemGetCudaDriverVersion_v2Func: func() (int, nvml.Return) { +// panic("mock out the SystemGetCudaDriverVersion_v2 method") +// }, +// SystemGetDriverVersionFunc: func() (string, nvml.Return) { +// panic("mock out the SystemGetDriverVersion method") +// }, +// SystemGetHicVersionFunc: func() ([]nvml.HwbcEntry, nvml.Return) { +// panic("mock out the SystemGetHicVersion method") +// }, +// SystemGetNVMLVersionFunc: func() (string, nvml.Return) { +// panic("mock out the SystemGetNVMLVersion method") +// }, +// SystemGetProcessNameFunc: func(n int) (string, nvml.Return) { +// panic("mock out the SystemGetProcessName method") +// }, +// SystemGetTopologyGpuSetFunc: func(n int) ([]nvml.Device, nvml.Return) { +// panic("mock out the SystemGetTopologyGpuSet method") +// }, +// UnitGetCountFunc: func() (int, nvml.Return) { +// panic("mock out the UnitGetCount method") +// }, +// UnitGetDevicesFunc: func(unit nvml.Unit) ([]nvml.Device, nvml.Return) { +// panic("mock out the UnitGetDevices method") +// }, +// UnitGetFanSpeedInfoFunc: func(unit nvml.Unit) (nvml.UnitFanSpeeds, nvml.Return) { +// panic("mock out the UnitGetFanSpeedInfo method") +// }, +// UnitGetHandleByIndexFunc: func(n int) (nvml.Unit, nvml.Return) { +// panic("mock out the UnitGetHandleByIndex method") +// }, +// UnitGetLedStateFunc: func(unit nvml.Unit) (nvml.LedState, nvml.Return) { +// panic("mock out the UnitGetLedState method") +// }, +// UnitGetPsuInfoFunc: func(unit nvml.Unit) (nvml.PSUInfo, nvml.Return) { +// panic("mock out the UnitGetPsuInfo method") +// }, +// UnitGetTemperatureFunc: func(unit nvml.Unit, n int) (uint32, nvml.Return) { +// panic("mock out the UnitGetTemperature method") +// }, +// UnitGetUnitInfoFunc: func(unit nvml.Unit) (nvml.UnitInfo, nvml.Return) { +// panic("mock out the UnitGetUnitInfo method") +// }, +// UnitSetLedStateFunc: func(unit nvml.Unit, ledColor nvml.LedColor) nvml.Return { +// panic("mock out the UnitSetLedState method") +// }, +// VgpuInstanceClearAccountingPidsFunc: func(vgpuInstance nvml.VgpuInstance) nvml.Return { +// panic("mock out the VgpuInstanceClearAccountingPids method") +// }, +// VgpuInstanceGetAccountingModeFunc: func(vgpuInstance nvml.VgpuInstance) (nvml.EnableState, nvml.Return) { +// panic("mock out the VgpuInstanceGetAccountingMode method") +// }, +// VgpuInstanceGetAccountingPidsFunc: func(vgpuInstance nvml.VgpuInstance) ([]int, nvml.Return) { +// panic("mock out the VgpuInstanceGetAccountingPids method") +// }, +// VgpuInstanceGetAccountingStatsFunc: func(vgpuInstance nvml.VgpuInstance, n int) (nvml.AccountingStats, nvml.Return) { +// panic("mock out the VgpuInstanceGetAccountingStats method") +// }, +// VgpuInstanceGetEccModeFunc: func(vgpuInstance nvml.VgpuInstance) (nvml.EnableState, nvml.Return) { +// panic("mock out the VgpuInstanceGetEccMode method") +// }, +// VgpuInstanceGetEncoderCapacityFunc: func(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) { +// panic("mock out the VgpuInstanceGetEncoderCapacity method") +// }, +// VgpuInstanceGetEncoderSessionsFunc: func(vgpuInstance nvml.VgpuInstance) (int, nvml.EncoderSessionInfo, nvml.Return) { +// panic("mock out the VgpuInstanceGetEncoderSessions method") +// }, +// VgpuInstanceGetEncoderStatsFunc: func(vgpuInstance nvml.VgpuInstance) (int, uint32, uint32, nvml.Return) { +// panic("mock out the VgpuInstanceGetEncoderStats method") +// }, +// VgpuInstanceGetFBCSessionsFunc: func(vgpuInstance nvml.VgpuInstance) (int, nvml.FBCSessionInfo, nvml.Return) { +// panic("mock out the VgpuInstanceGetFBCSessions method") +// }, +// VgpuInstanceGetFBCStatsFunc: func(vgpuInstance nvml.VgpuInstance) (nvml.FBCStats, nvml.Return) { +// panic("mock out the VgpuInstanceGetFBCStats method") +// }, +// VgpuInstanceGetFbUsageFunc: func(vgpuInstance nvml.VgpuInstance) (uint64, nvml.Return) { +// panic("mock out the VgpuInstanceGetFbUsage method") +// }, +// VgpuInstanceGetFrameRateLimitFunc: func(vgpuInstance nvml.VgpuInstance) (uint32, nvml.Return) { +// panic("mock out the VgpuInstanceGetFrameRateLimit method") +// }, +// VgpuInstanceGetGpuInstanceIdFunc: func(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) { +// panic("mock out the VgpuInstanceGetGpuInstanceId method") +// }, +// VgpuInstanceGetGpuPciIdFunc: func(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) { +// panic("mock out the VgpuInstanceGetGpuPciId method") +// }, +// VgpuInstanceGetLicenseInfoFunc: func(vgpuInstance nvml.VgpuInstance) (nvml.VgpuLicenseInfo, nvml.Return) { +// panic("mock out the VgpuInstanceGetLicenseInfo method") +// }, +// VgpuInstanceGetLicenseStatusFunc: func(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) { +// panic("mock out the VgpuInstanceGetLicenseStatus method") +// }, +// VgpuInstanceGetMdevUUIDFunc: func(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) { +// panic("mock out the VgpuInstanceGetMdevUUID method") +// }, +// VgpuInstanceGetMetadataFunc: func(vgpuInstance nvml.VgpuInstance) (nvml.VgpuMetadata, nvml.Return) { +// panic("mock out the VgpuInstanceGetMetadata method") +// }, +// VgpuInstanceGetTypeFunc: func(vgpuInstance nvml.VgpuInstance) (nvml.VgpuTypeId, nvml.Return) { +// panic("mock out the VgpuInstanceGetType method") +// }, +// VgpuInstanceGetUUIDFunc: func(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) { +// panic("mock out the VgpuInstanceGetUUID method") +// }, +// VgpuInstanceGetVmDriverVersionFunc: func(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) { +// panic("mock out the VgpuInstanceGetVmDriverVersion method") +// }, +// VgpuInstanceGetVmIDFunc: func(vgpuInstance nvml.VgpuInstance) (string, nvml.VgpuVmIdType, nvml.Return) { +// panic("mock out the VgpuInstanceGetVmID method") +// }, +// VgpuInstanceSetEncoderCapacityFunc: func(vgpuInstance nvml.VgpuInstance, n int) nvml.Return { +// panic("mock out the VgpuInstanceSetEncoderCapacity method") +// }, +// VgpuTypeGetCapabilitiesFunc: func(vgpuTypeId nvml.VgpuTypeId, vgpuCapability nvml.VgpuCapability) (bool, nvml.Return) { +// panic("mock out the VgpuTypeGetCapabilities method") +// }, +// VgpuTypeGetClassFunc: func(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) { +// panic("mock out the VgpuTypeGetClass method") +// }, +// VgpuTypeGetDeviceIDFunc: func(vgpuTypeId nvml.VgpuTypeId) (uint64, uint64, nvml.Return) { +// panic("mock out the VgpuTypeGetDeviceID method") +// }, +// VgpuTypeGetFrameRateLimitFunc: func(vgpuTypeId nvml.VgpuTypeId) (uint32, nvml.Return) { +// panic("mock out the VgpuTypeGetFrameRateLimit method") +// }, +// VgpuTypeGetFramebufferSizeFunc: func(vgpuTypeId nvml.VgpuTypeId) (uint64, nvml.Return) { +// panic("mock out the VgpuTypeGetFramebufferSize method") +// }, +// VgpuTypeGetGpuInstanceProfileIdFunc: func(vgpuTypeId nvml.VgpuTypeId) (uint32, nvml.Return) { +// panic("mock out the VgpuTypeGetGpuInstanceProfileId method") +// }, +// VgpuTypeGetLicenseFunc: func(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) { +// panic("mock out the VgpuTypeGetLicense method") +// }, +// VgpuTypeGetMaxInstancesFunc: func(device nvml.Device, vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) { +// panic("mock out the VgpuTypeGetMaxInstances method") +// }, +// VgpuTypeGetMaxInstancesPerVmFunc: func(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) { +// panic("mock out the VgpuTypeGetMaxInstancesPerVm method") +// }, +// VgpuTypeGetNameFunc: func(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) { +// panic("mock out the VgpuTypeGetName method") +// }, +// VgpuTypeGetNumDisplayHeadsFunc: func(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) { +// panic("mock out the VgpuTypeGetNumDisplayHeads method") +// }, +// VgpuTypeGetResolutionFunc: func(vgpuTypeId nvml.VgpuTypeId, n int) (uint32, uint32, nvml.Return) { +// panic("mock out the VgpuTypeGetResolution method") +// }, +// } +// +// // use mockedInterface in code that requires nvml.Interface +// // and then make assertions. +// +// } +type Interface struct { + // ComputeInstanceDestroyFunc mocks the ComputeInstanceDestroy method. + ComputeInstanceDestroyFunc func(computeInstance nvml.ComputeInstance) nvml.Return + + // ComputeInstanceGetInfoFunc mocks the ComputeInstanceGetInfo method. + ComputeInstanceGetInfoFunc func(computeInstance nvml.ComputeInstance) (nvml.ComputeInstanceInfo, nvml.Return) + + // DeviceCcuGetStreamStateFunc mocks the DeviceCcuGetStreamState method. + DeviceCcuGetStreamStateFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceCcuSetStreamStateFunc mocks the DeviceCcuSetStreamState method. + DeviceCcuSetStreamStateFunc func(device nvml.Device, n int) nvml.Return + + // DeviceClearAccountingPidsFunc mocks the DeviceClearAccountingPids method. + DeviceClearAccountingPidsFunc func(device nvml.Device) nvml.Return + + // DeviceClearCpuAffinityFunc mocks the DeviceClearCpuAffinity method. + DeviceClearCpuAffinityFunc func(device nvml.Device) nvml.Return + + // DeviceClearEccErrorCountsFunc mocks the DeviceClearEccErrorCounts method. + DeviceClearEccErrorCountsFunc func(device nvml.Device, eccCounterType nvml.EccCounterType) nvml.Return + + // DeviceClearFieldValuesFunc mocks the DeviceClearFieldValues method. + DeviceClearFieldValuesFunc func(device nvml.Device, fieldValues []nvml.FieldValue) nvml.Return + + // DeviceCreateGpuInstanceFunc mocks the DeviceCreateGpuInstance method. + DeviceCreateGpuInstanceFunc func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (nvml.GpuInstance, nvml.Return) + + // DeviceCreateGpuInstanceWithPlacementFunc mocks the DeviceCreateGpuInstanceWithPlacement method. + DeviceCreateGpuInstanceWithPlacementFunc func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo, gpuInstancePlacement *nvml.GpuInstancePlacement) (nvml.GpuInstance, nvml.Return) + + // DeviceDiscoverGpusFunc mocks the DeviceDiscoverGpus method. + DeviceDiscoverGpusFunc func() (nvml.PciInfo, nvml.Return) + + // DeviceFreezeNvLinkUtilizationCounterFunc mocks the DeviceFreezeNvLinkUtilizationCounter method. + DeviceFreezeNvLinkUtilizationCounterFunc func(device nvml.Device, n1 int, n2 int, enableState nvml.EnableState) nvml.Return + + // DeviceGetAPIRestrictionFunc mocks the DeviceGetAPIRestriction method. + DeviceGetAPIRestrictionFunc func(device nvml.Device, restrictedAPI nvml.RestrictedAPI) (nvml.EnableState, nvml.Return) + + // DeviceGetAccountingBufferSizeFunc mocks the DeviceGetAccountingBufferSize method. + DeviceGetAccountingBufferSizeFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetAccountingModeFunc mocks the DeviceGetAccountingMode method. + DeviceGetAccountingModeFunc func(device nvml.Device) (nvml.EnableState, nvml.Return) + + // DeviceGetAccountingPidsFunc mocks the DeviceGetAccountingPids method. + DeviceGetAccountingPidsFunc func(device nvml.Device) ([]int, nvml.Return) + + // DeviceGetAccountingStatsFunc mocks the DeviceGetAccountingStats method. + DeviceGetAccountingStatsFunc func(device nvml.Device, v uint32) (nvml.AccountingStats, nvml.Return) + + // DeviceGetActiveVgpusFunc mocks the DeviceGetActiveVgpus method. + DeviceGetActiveVgpusFunc func(device nvml.Device) ([]nvml.VgpuInstance, nvml.Return) + + // DeviceGetAdaptiveClockInfoStatusFunc mocks the DeviceGetAdaptiveClockInfoStatus method. + DeviceGetAdaptiveClockInfoStatusFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetApplicationsClockFunc mocks the DeviceGetApplicationsClock method. + DeviceGetApplicationsClockFunc func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) + + // DeviceGetArchitectureFunc mocks the DeviceGetArchitecture method. + DeviceGetArchitectureFunc func(device nvml.Device) (nvml.DeviceArchitecture, nvml.Return) + + // DeviceGetAttributesFunc mocks the DeviceGetAttributes method. + DeviceGetAttributesFunc func(device nvml.Device) (nvml.DeviceAttributes, nvml.Return) + + // DeviceGetAutoBoostedClocksEnabledFunc mocks the DeviceGetAutoBoostedClocksEnabled method. + DeviceGetAutoBoostedClocksEnabledFunc func(device nvml.Device) (nvml.EnableState, nvml.EnableState, nvml.Return) + + // DeviceGetBAR1MemoryInfoFunc mocks the DeviceGetBAR1MemoryInfo method. + DeviceGetBAR1MemoryInfoFunc func(device nvml.Device) (nvml.BAR1Memory, nvml.Return) + + // DeviceGetBoardIdFunc mocks the DeviceGetBoardId method. + DeviceGetBoardIdFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetBoardPartNumberFunc mocks the DeviceGetBoardPartNumber method. + DeviceGetBoardPartNumberFunc func(device nvml.Device) (string, nvml.Return) + + // DeviceGetBrandFunc mocks the DeviceGetBrand method. + DeviceGetBrandFunc func(device nvml.Device) (nvml.BrandType, nvml.Return) + + // DeviceGetBridgeChipInfoFunc mocks the DeviceGetBridgeChipInfo method. + DeviceGetBridgeChipInfoFunc func(device nvml.Device) (nvml.BridgeChipHierarchy, nvml.Return) + + // DeviceGetBusTypeFunc mocks the DeviceGetBusType method. + DeviceGetBusTypeFunc func(device nvml.Device) (nvml.BusType, nvml.Return) + + // DeviceGetClkMonStatusFunc mocks the DeviceGetClkMonStatus method. + DeviceGetClkMonStatusFunc func(device nvml.Device) (nvml.ClkMonStatus, nvml.Return) + + // DeviceGetClockFunc mocks the DeviceGetClock method. + DeviceGetClockFunc func(device nvml.Device, clockType nvml.ClockType, clockId nvml.ClockId) (uint32, nvml.Return) + + // DeviceGetClockInfoFunc mocks the DeviceGetClockInfo method. + DeviceGetClockInfoFunc func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) + + // DeviceGetComputeInstanceIdFunc mocks the DeviceGetComputeInstanceId method. + DeviceGetComputeInstanceIdFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetComputeModeFunc mocks the DeviceGetComputeMode method. + DeviceGetComputeModeFunc func(device nvml.Device) (nvml.ComputeMode, nvml.Return) + + // DeviceGetComputeRunningProcessesFunc mocks the DeviceGetComputeRunningProcesses method. + DeviceGetComputeRunningProcessesFunc func(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) + + // DeviceGetCountFunc mocks the DeviceGetCount method. + DeviceGetCountFunc func() (int, nvml.Return) + + // DeviceGetCpuAffinityFunc mocks the DeviceGetCpuAffinity method. + DeviceGetCpuAffinityFunc func(device nvml.Device, n int) ([]uint, nvml.Return) + + // DeviceGetCpuAffinityWithinScopeFunc mocks the DeviceGetCpuAffinityWithinScope method. + DeviceGetCpuAffinityWithinScopeFunc func(device nvml.Device, n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) + + // DeviceGetCreatableVgpusFunc mocks the DeviceGetCreatableVgpus method. + DeviceGetCreatableVgpusFunc func(device nvml.Device) ([]nvml.VgpuTypeId, nvml.Return) + + // DeviceGetCudaComputeCapabilityFunc mocks the DeviceGetCudaComputeCapability method. + DeviceGetCudaComputeCapabilityFunc func(device nvml.Device) (int, int, nvml.Return) + + // DeviceGetCurrPcieLinkGenerationFunc mocks the DeviceGetCurrPcieLinkGeneration method. + DeviceGetCurrPcieLinkGenerationFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetCurrPcieLinkWidthFunc mocks the DeviceGetCurrPcieLinkWidth method. + DeviceGetCurrPcieLinkWidthFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetCurrentClocksThrottleReasonsFunc mocks the DeviceGetCurrentClocksThrottleReasons method. + DeviceGetCurrentClocksThrottleReasonsFunc func(device nvml.Device) (uint64, nvml.Return) + + // DeviceGetDecoderUtilizationFunc mocks the DeviceGetDecoderUtilization method. + DeviceGetDecoderUtilizationFunc func(device nvml.Device) (uint32, uint32, nvml.Return) + + // DeviceGetDefaultApplicationsClockFunc mocks the DeviceGetDefaultApplicationsClock method. + DeviceGetDefaultApplicationsClockFunc func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) + + // DeviceGetDefaultEccModeFunc mocks the DeviceGetDefaultEccMode method. + DeviceGetDefaultEccModeFunc func(device nvml.Device) (nvml.EnableState, nvml.Return) + + // DeviceGetDetailedEccErrorsFunc mocks the DeviceGetDetailedEccErrors method. + DeviceGetDetailedEccErrorsFunc func(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (nvml.EccErrorCounts, nvml.Return) + + // DeviceGetDeviceHandleFromMigDeviceHandleFunc mocks the DeviceGetDeviceHandleFromMigDeviceHandle method. + DeviceGetDeviceHandleFromMigDeviceHandleFunc func(device nvml.Device) (nvml.Device, nvml.Return) + + // DeviceGetDisplayActiveFunc mocks the DeviceGetDisplayActive method. + DeviceGetDisplayActiveFunc func(device nvml.Device) (nvml.EnableState, nvml.Return) + + // DeviceGetDisplayModeFunc mocks the DeviceGetDisplayMode method. + DeviceGetDisplayModeFunc func(device nvml.Device) (nvml.EnableState, nvml.Return) + + // DeviceGetDriverModelFunc mocks the DeviceGetDriverModel method. + DeviceGetDriverModelFunc func(device nvml.Device) (nvml.DriverModel, nvml.DriverModel, nvml.Return) + + // DeviceGetDynamicPstatesInfoFunc mocks the DeviceGetDynamicPstatesInfo method. + DeviceGetDynamicPstatesInfoFunc func(device nvml.Device) (nvml.GpuDynamicPstatesInfo, nvml.Return) + + // DeviceGetEccModeFunc mocks the DeviceGetEccMode method. + DeviceGetEccModeFunc func(device nvml.Device) (nvml.EnableState, nvml.EnableState, nvml.Return) + + // DeviceGetEncoderCapacityFunc mocks the DeviceGetEncoderCapacity method. + DeviceGetEncoderCapacityFunc func(device nvml.Device, encoderType nvml.EncoderType) (int, nvml.Return) + + // DeviceGetEncoderSessionsFunc mocks the DeviceGetEncoderSessions method. + DeviceGetEncoderSessionsFunc func(device nvml.Device) ([]nvml.EncoderSessionInfo, nvml.Return) + + // DeviceGetEncoderStatsFunc mocks the DeviceGetEncoderStats method. + DeviceGetEncoderStatsFunc func(device nvml.Device) (int, uint32, uint32, nvml.Return) + + // DeviceGetEncoderUtilizationFunc mocks the DeviceGetEncoderUtilization method. + DeviceGetEncoderUtilizationFunc func(device nvml.Device) (uint32, uint32, nvml.Return) + + // DeviceGetEnforcedPowerLimitFunc mocks the DeviceGetEnforcedPowerLimit method. + DeviceGetEnforcedPowerLimitFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetFBCSessionsFunc mocks the DeviceGetFBCSessions method. + DeviceGetFBCSessionsFunc func(device nvml.Device) ([]nvml.FBCSessionInfo, nvml.Return) + + // DeviceGetFBCStatsFunc mocks the DeviceGetFBCStats method. + DeviceGetFBCStatsFunc func(device nvml.Device) (nvml.FBCStats, nvml.Return) + + // DeviceGetFanControlPolicy_v2Func mocks the DeviceGetFanControlPolicy_v2 method. + DeviceGetFanControlPolicy_v2Func func(device nvml.Device, n int) (nvml.FanControlPolicy, nvml.Return) + + // DeviceGetFanSpeedFunc mocks the DeviceGetFanSpeed method. + DeviceGetFanSpeedFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetFanSpeed_v2Func mocks the DeviceGetFanSpeed_v2 method. + DeviceGetFanSpeed_v2Func func(device nvml.Device, n int) (uint32, nvml.Return) + + // DeviceGetFieldValuesFunc mocks the DeviceGetFieldValues method. + DeviceGetFieldValuesFunc func(device nvml.Device, fieldValues []nvml.FieldValue) nvml.Return + + // DeviceGetGpcClkMinMaxVfOffsetFunc mocks the DeviceGetGpcClkMinMaxVfOffset method. + DeviceGetGpcClkMinMaxVfOffsetFunc func(device nvml.Device) (int, int, nvml.Return) + + // DeviceGetGpcClkVfOffsetFunc mocks the DeviceGetGpcClkVfOffset method. + DeviceGetGpcClkVfOffsetFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetGpuFabricInfoFunc mocks the DeviceGetGpuFabricInfo method. + DeviceGetGpuFabricInfoFunc func(device nvml.Device) (nvml.GpuFabricInfo, nvml.Return) + + // DeviceGetGpuInstanceByIdFunc mocks the DeviceGetGpuInstanceById method. + DeviceGetGpuInstanceByIdFunc func(device nvml.Device, n int) (nvml.GpuInstance, nvml.Return) + + // DeviceGetGpuInstanceIdFunc mocks the DeviceGetGpuInstanceId method. + DeviceGetGpuInstanceIdFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetGpuInstancePossiblePlacementsFunc mocks the DeviceGetGpuInstancePossiblePlacements method. + DeviceGetGpuInstancePossiblePlacementsFunc func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstancePlacement, nvml.Return) + + // DeviceGetGpuInstanceProfileInfoFunc mocks the DeviceGetGpuInstanceProfileInfo method. + DeviceGetGpuInstanceProfileInfoFunc func(device nvml.Device, n int) (nvml.GpuInstanceProfileInfo, nvml.Return) + + // DeviceGetGpuInstanceProfileInfoVFunc mocks the DeviceGetGpuInstanceProfileInfoV method. + DeviceGetGpuInstanceProfileInfoVFunc func(device nvml.Device, n int) nvml.GpuInstanceProfileInfoV + + // DeviceGetGpuInstanceRemainingCapacityFunc mocks the DeviceGetGpuInstanceRemainingCapacity method. + DeviceGetGpuInstanceRemainingCapacityFunc func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (int, nvml.Return) + + // DeviceGetGpuInstancesFunc mocks the DeviceGetGpuInstances method. + DeviceGetGpuInstancesFunc func(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstance, nvml.Return) + + // DeviceGetGpuMaxPcieLinkGenerationFunc mocks the DeviceGetGpuMaxPcieLinkGeneration method. + DeviceGetGpuMaxPcieLinkGenerationFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetGpuOperationModeFunc mocks the DeviceGetGpuOperationMode method. + DeviceGetGpuOperationModeFunc func(device nvml.Device) (nvml.GpuOperationMode, nvml.GpuOperationMode, nvml.Return) + + // DeviceGetGraphicsRunningProcessesFunc mocks the DeviceGetGraphicsRunningProcesses method. + DeviceGetGraphicsRunningProcessesFunc func(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) + + // DeviceGetGridLicensableFeaturesFunc mocks the DeviceGetGridLicensableFeatures method. + DeviceGetGridLicensableFeaturesFunc func(device nvml.Device) (nvml.GridLicensableFeatures, nvml.Return) + + // DeviceGetGspFirmwareModeFunc mocks the DeviceGetGspFirmwareMode method. + DeviceGetGspFirmwareModeFunc func(device nvml.Device) (bool, bool, nvml.Return) + + // DeviceGetGspFirmwareVersionFunc mocks the DeviceGetGspFirmwareVersion method. + DeviceGetGspFirmwareVersionFunc func(device nvml.Device) (string, nvml.Return) + + // DeviceGetHandleByIndexFunc mocks the DeviceGetHandleByIndex method. + DeviceGetHandleByIndexFunc func(n int) (nvml.Device, nvml.Return) + + // DeviceGetHandleByPciBusIdFunc mocks the DeviceGetHandleByPciBusId method. + DeviceGetHandleByPciBusIdFunc func(s string) (nvml.Device, nvml.Return) + + // DeviceGetHandleBySerialFunc mocks the DeviceGetHandleBySerial method. + DeviceGetHandleBySerialFunc func(s string) (nvml.Device, nvml.Return) + + // DeviceGetHandleByUUIDFunc mocks the DeviceGetHandleByUUID method. + DeviceGetHandleByUUIDFunc func(s string) (nvml.Device, nvml.Return) + + // DeviceGetHostVgpuModeFunc mocks the DeviceGetHostVgpuMode method. + DeviceGetHostVgpuModeFunc func(device nvml.Device) (nvml.HostVgpuMode, nvml.Return) + + // DeviceGetIndexFunc mocks the DeviceGetIndex method. + DeviceGetIndexFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetInforomConfigurationChecksumFunc mocks the DeviceGetInforomConfigurationChecksum method. + DeviceGetInforomConfigurationChecksumFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetInforomImageVersionFunc mocks the DeviceGetInforomImageVersion method. + DeviceGetInforomImageVersionFunc func(device nvml.Device) (string, nvml.Return) + + // DeviceGetInforomVersionFunc mocks the DeviceGetInforomVersion method. + DeviceGetInforomVersionFunc func(device nvml.Device, inforomObject nvml.InforomObject) (string, nvml.Return) + + // DeviceGetIrqNumFunc mocks the DeviceGetIrqNum method. + DeviceGetIrqNumFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetMPSComputeRunningProcessesFunc mocks the DeviceGetMPSComputeRunningProcesses method. + DeviceGetMPSComputeRunningProcessesFunc func(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) + + // DeviceGetMaxClockInfoFunc mocks the DeviceGetMaxClockInfo method. + DeviceGetMaxClockInfoFunc func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) + + // DeviceGetMaxCustomerBoostClockFunc mocks the DeviceGetMaxCustomerBoostClock method. + DeviceGetMaxCustomerBoostClockFunc func(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) + + // DeviceGetMaxMigDeviceCountFunc mocks the DeviceGetMaxMigDeviceCount method. + DeviceGetMaxMigDeviceCountFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetMaxPcieLinkGenerationFunc mocks the DeviceGetMaxPcieLinkGeneration method. + DeviceGetMaxPcieLinkGenerationFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetMaxPcieLinkWidthFunc mocks the DeviceGetMaxPcieLinkWidth method. + DeviceGetMaxPcieLinkWidthFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetMemClkMinMaxVfOffsetFunc mocks the DeviceGetMemClkMinMaxVfOffset method. + DeviceGetMemClkMinMaxVfOffsetFunc func(device nvml.Device) (int, int, nvml.Return) + + // DeviceGetMemClkVfOffsetFunc mocks the DeviceGetMemClkVfOffset method. + DeviceGetMemClkVfOffsetFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetMemoryAffinityFunc mocks the DeviceGetMemoryAffinity method. + DeviceGetMemoryAffinityFunc func(device nvml.Device, n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) + + // DeviceGetMemoryBusWidthFunc mocks the DeviceGetMemoryBusWidth method. + DeviceGetMemoryBusWidthFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetMemoryErrorCounterFunc mocks the DeviceGetMemoryErrorCounter method. + DeviceGetMemoryErrorCounterFunc func(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType, memoryLocation nvml.MemoryLocation) (uint64, nvml.Return) + + // DeviceGetMemoryInfoFunc mocks the DeviceGetMemoryInfo method. + DeviceGetMemoryInfoFunc func(device nvml.Device) (nvml.Memory, nvml.Return) + + // DeviceGetMemoryInfo_v2Func mocks the DeviceGetMemoryInfo_v2 method. + DeviceGetMemoryInfo_v2Func func(device nvml.Device) (nvml.Memory_v2, nvml.Return) + + // DeviceGetMigDeviceHandleByIndexFunc mocks the DeviceGetMigDeviceHandleByIndex method. + DeviceGetMigDeviceHandleByIndexFunc func(device nvml.Device, n int) (nvml.Device, nvml.Return) + + // DeviceGetMigModeFunc mocks the DeviceGetMigMode method. + DeviceGetMigModeFunc func(device nvml.Device) (int, int, nvml.Return) + + // DeviceGetMinMaxClockOfPStateFunc mocks the DeviceGetMinMaxClockOfPState method. + DeviceGetMinMaxClockOfPStateFunc func(device nvml.Device, clockType nvml.ClockType, pstates nvml.Pstates) (uint32, uint32, nvml.Return) + + // DeviceGetMinMaxFanSpeedFunc mocks the DeviceGetMinMaxFanSpeed method. + DeviceGetMinMaxFanSpeedFunc func(device nvml.Device) (int, int, nvml.Return) + + // DeviceGetMinorNumberFunc mocks the DeviceGetMinorNumber method. + DeviceGetMinorNumberFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetMultiGpuBoardFunc mocks the DeviceGetMultiGpuBoard method. + DeviceGetMultiGpuBoardFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetNameFunc mocks the DeviceGetName method. + DeviceGetNameFunc func(device nvml.Device) (string, nvml.Return) + + // DeviceGetNumFansFunc mocks the DeviceGetNumFans method. + DeviceGetNumFansFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetNumGpuCoresFunc mocks the DeviceGetNumGpuCores method. + DeviceGetNumGpuCoresFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetNvLinkCapabilityFunc mocks the DeviceGetNvLinkCapability method. + DeviceGetNvLinkCapabilityFunc func(device nvml.Device, n int, nvLinkCapability nvml.NvLinkCapability) (uint32, nvml.Return) + + // DeviceGetNvLinkErrorCounterFunc mocks the DeviceGetNvLinkErrorCounter method. + DeviceGetNvLinkErrorCounterFunc func(device nvml.Device, n int, nvLinkErrorCounter nvml.NvLinkErrorCounter) (uint64, nvml.Return) + + // DeviceGetNvLinkRemoteDeviceTypeFunc mocks the DeviceGetNvLinkRemoteDeviceType method. + DeviceGetNvLinkRemoteDeviceTypeFunc func(device nvml.Device, n int) (nvml.IntNvLinkDeviceType, nvml.Return) + + // DeviceGetNvLinkRemotePciInfoFunc mocks the DeviceGetNvLinkRemotePciInfo method. + DeviceGetNvLinkRemotePciInfoFunc func(device nvml.Device, n int) (nvml.PciInfo, nvml.Return) + + // DeviceGetNvLinkStateFunc mocks the DeviceGetNvLinkState method. + DeviceGetNvLinkStateFunc func(device nvml.Device, n int) (nvml.EnableState, nvml.Return) + + // DeviceGetNvLinkUtilizationControlFunc mocks the DeviceGetNvLinkUtilizationControl method. + DeviceGetNvLinkUtilizationControlFunc func(device nvml.Device, n1 int, n2 int) (nvml.NvLinkUtilizationControl, nvml.Return) + + // DeviceGetNvLinkUtilizationCounterFunc mocks the DeviceGetNvLinkUtilizationCounter method. + DeviceGetNvLinkUtilizationCounterFunc func(device nvml.Device, n1 int, n2 int) (uint64, uint64, nvml.Return) + + // DeviceGetNvLinkVersionFunc mocks the DeviceGetNvLinkVersion method. + DeviceGetNvLinkVersionFunc func(device nvml.Device, n int) (uint32, nvml.Return) + + // DeviceGetP2PStatusFunc mocks the DeviceGetP2PStatus method. + DeviceGetP2PStatusFunc func(device1 nvml.Device, device2 nvml.Device, gpuP2PCapsIndex nvml.GpuP2PCapsIndex) (nvml.GpuP2PStatus, nvml.Return) + + // DeviceGetPciInfoFunc mocks the DeviceGetPciInfo method. + DeviceGetPciInfoFunc func(device nvml.Device) (nvml.PciInfo, nvml.Return) + + // DeviceGetPcieLinkMaxSpeedFunc mocks the DeviceGetPcieLinkMaxSpeed method. + DeviceGetPcieLinkMaxSpeedFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetPcieReplayCounterFunc mocks the DeviceGetPcieReplayCounter method. + DeviceGetPcieReplayCounterFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetPcieSpeedFunc mocks the DeviceGetPcieSpeed method. + DeviceGetPcieSpeedFunc func(device nvml.Device) (int, nvml.Return) + + // DeviceGetPcieThroughputFunc mocks the DeviceGetPcieThroughput method. + DeviceGetPcieThroughputFunc func(device nvml.Device, pcieUtilCounter nvml.PcieUtilCounter) (uint32, nvml.Return) + + // DeviceGetPerformanceStateFunc mocks the DeviceGetPerformanceState method. + DeviceGetPerformanceStateFunc func(device nvml.Device) (nvml.Pstates, nvml.Return) + + // DeviceGetPersistenceModeFunc mocks the DeviceGetPersistenceMode method. + DeviceGetPersistenceModeFunc func(device nvml.Device) (nvml.EnableState, nvml.Return) + + // DeviceGetPgpuMetadataStringFunc mocks the DeviceGetPgpuMetadataString method. + DeviceGetPgpuMetadataStringFunc func(device nvml.Device) (string, nvml.Return) + + // DeviceGetPowerManagementDefaultLimitFunc mocks the DeviceGetPowerManagementDefaultLimit method. + DeviceGetPowerManagementDefaultLimitFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetPowerManagementLimitFunc mocks the DeviceGetPowerManagementLimit method. + DeviceGetPowerManagementLimitFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetPowerManagementLimitConstraintsFunc mocks the DeviceGetPowerManagementLimitConstraints method. + DeviceGetPowerManagementLimitConstraintsFunc func(device nvml.Device) (uint32, uint32, nvml.Return) + + // DeviceGetPowerManagementModeFunc mocks the DeviceGetPowerManagementMode method. + DeviceGetPowerManagementModeFunc func(device nvml.Device) (nvml.EnableState, nvml.Return) + + // DeviceGetPowerSourceFunc mocks the DeviceGetPowerSource method. + DeviceGetPowerSourceFunc func(device nvml.Device) (nvml.PowerSource, nvml.Return) + + // DeviceGetPowerStateFunc mocks the DeviceGetPowerState method. + DeviceGetPowerStateFunc func(device nvml.Device) (nvml.Pstates, nvml.Return) + + // DeviceGetPowerUsageFunc mocks the DeviceGetPowerUsage method. + DeviceGetPowerUsageFunc func(device nvml.Device) (uint32, nvml.Return) + + // DeviceGetProcessUtilizationFunc mocks the DeviceGetProcessUtilization method. + DeviceGetProcessUtilizationFunc func(device nvml.Device, v uint64) ([]nvml.ProcessUtilizationSample, nvml.Return) + + // DeviceGetRemappedRowsFunc mocks the DeviceGetRemappedRows method. + DeviceGetRemappedRowsFunc func(device nvml.Device) (int, int, bool, bool, nvml.Return) + + // DeviceGetRetiredPagesFunc mocks the DeviceGetRetiredPages method. + DeviceGetRetiredPagesFunc func(device nvml.Device, pageRetirementCause nvml.PageRetirementCause) ([]uint64, nvml.Return) + + // DeviceGetRetiredPagesPendingStatusFunc mocks the DeviceGetRetiredPagesPendingStatus method. + DeviceGetRetiredPagesPendingStatusFunc func(device nvml.Device) (nvml.EnableState, nvml.Return) + + // DeviceGetRetiredPages_v2Func mocks the DeviceGetRetiredPages_v2 method. + DeviceGetRetiredPages_v2Func func(device nvml.Device, pageRetirementCause nvml.PageRetirementCause) ([]uint64, []uint64, nvml.Return) + + // DeviceGetRowRemapperHistogramFunc mocks the DeviceGetRowRemapperHistogram method. + DeviceGetRowRemapperHistogramFunc func(device nvml.Device) (nvml.RowRemapperHistogramValues, nvml.Return) + + // DeviceGetSamplesFunc mocks the DeviceGetSamples method. + DeviceGetSamplesFunc func(device nvml.Device, samplingType nvml.SamplingType, v uint64) (nvml.ValueType, []nvml.Sample, nvml.Return) + + // DeviceGetSerialFunc mocks the DeviceGetSerial method. + DeviceGetSerialFunc func(device nvml.Device) (string, nvml.Return) + + // DeviceGetSupportedClocksThrottleReasonsFunc mocks the DeviceGetSupportedClocksThrottleReasons method. + DeviceGetSupportedClocksThrottleReasonsFunc func(device nvml.Device) (uint64, nvml.Return) + + // DeviceGetSupportedEventTypesFunc mocks the DeviceGetSupportedEventTypes method. + DeviceGetSupportedEventTypesFunc func(device nvml.Device) (uint64, nvml.Return) + + // DeviceGetSupportedGraphicsClocksFunc mocks the DeviceGetSupportedGraphicsClocks method. + DeviceGetSupportedGraphicsClocksFunc func(device nvml.Device, n int) (int, uint32, nvml.Return) + + // DeviceGetSupportedMemoryClocksFunc mocks the DeviceGetSupportedMemoryClocks method. + DeviceGetSupportedMemoryClocksFunc func(device nvml.Device) (int, uint32, nvml.Return) + + // DeviceGetSupportedPerformanceStatesFunc mocks the DeviceGetSupportedPerformanceStates method. + DeviceGetSupportedPerformanceStatesFunc func(device nvml.Device) ([]nvml.Pstates, nvml.Return) + + // DeviceGetSupportedVgpusFunc mocks the DeviceGetSupportedVgpus method. + DeviceGetSupportedVgpusFunc func(device nvml.Device) ([]nvml.VgpuTypeId, nvml.Return) + + // DeviceGetTargetFanSpeedFunc mocks the DeviceGetTargetFanSpeed method. + DeviceGetTargetFanSpeedFunc func(device nvml.Device, n int) (int, nvml.Return) + + // DeviceGetTemperatureFunc mocks the DeviceGetTemperature method. + DeviceGetTemperatureFunc func(device nvml.Device, temperatureSensors nvml.TemperatureSensors) (uint32, nvml.Return) + + // DeviceGetTemperatureThresholdFunc mocks the DeviceGetTemperatureThreshold method. + DeviceGetTemperatureThresholdFunc func(device nvml.Device, temperatureThresholds nvml.TemperatureThresholds) (uint32, nvml.Return) + + // DeviceGetThermalSettingsFunc mocks the DeviceGetThermalSettings method. + DeviceGetThermalSettingsFunc func(device nvml.Device, v uint32) (nvml.GpuThermalSettings, nvml.Return) + + // DeviceGetTopologyCommonAncestorFunc mocks the DeviceGetTopologyCommonAncestor method. + DeviceGetTopologyCommonAncestorFunc func(device1 nvml.Device, device2 nvml.Device) (nvml.GpuTopologyLevel, nvml.Return) + + // DeviceGetTopologyNearestGpusFunc mocks the DeviceGetTopologyNearestGpus method. + DeviceGetTopologyNearestGpusFunc func(device nvml.Device, gpuTopologyLevel nvml.GpuTopologyLevel) ([]nvml.Device, nvml.Return) + + // DeviceGetTotalEccErrorsFunc mocks the DeviceGetTotalEccErrors method. + DeviceGetTotalEccErrorsFunc func(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (uint64, nvml.Return) + + // DeviceGetTotalEnergyConsumptionFunc mocks the DeviceGetTotalEnergyConsumption method. + DeviceGetTotalEnergyConsumptionFunc func(device nvml.Device) (uint64, nvml.Return) + + // DeviceGetUUIDFunc mocks the DeviceGetUUID method. + DeviceGetUUIDFunc func(device nvml.Device) (string, nvml.Return) + + // DeviceGetUtilizationRatesFunc mocks the DeviceGetUtilizationRates method. + DeviceGetUtilizationRatesFunc func(device nvml.Device) (nvml.Utilization, nvml.Return) + + // DeviceGetVbiosVersionFunc mocks the DeviceGetVbiosVersion method. + DeviceGetVbiosVersionFunc func(device nvml.Device) (string, nvml.Return) + + // DeviceGetVgpuCapabilitiesFunc mocks the DeviceGetVgpuCapabilities method. + DeviceGetVgpuCapabilitiesFunc func(device nvml.Device, deviceVgpuCapability nvml.DeviceVgpuCapability) (bool, nvml.Return) + + // DeviceGetVgpuMetadataFunc mocks the DeviceGetVgpuMetadata method. + DeviceGetVgpuMetadataFunc func(device nvml.Device) (nvml.VgpuPgpuMetadata, nvml.Return) + + // DeviceGetVgpuProcessUtilizationFunc mocks the DeviceGetVgpuProcessUtilization method. + DeviceGetVgpuProcessUtilizationFunc func(device nvml.Device, v uint64) ([]nvml.VgpuProcessUtilizationSample, nvml.Return) + + // DeviceGetVgpuSchedulerCapabilitiesFunc mocks the DeviceGetVgpuSchedulerCapabilities method. + DeviceGetVgpuSchedulerCapabilitiesFunc func(device nvml.Device) (nvml.VgpuSchedulerCapabilities, nvml.Return) + + // DeviceGetVgpuSchedulerLogFunc mocks the DeviceGetVgpuSchedulerLog method. + DeviceGetVgpuSchedulerLogFunc func(device nvml.Device) (nvml.VgpuSchedulerLog, nvml.Return) + + // DeviceGetVgpuSchedulerStateFunc mocks the DeviceGetVgpuSchedulerState method. + DeviceGetVgpuSchedulerStateFunc func(device nvml.Device) (nvml.VgpuSchedulerGetState, nvml.Return) + + // DeviceGetVgpuUtilizationFunc mocks the DeviceGetVgpuUtilization method. + DeviceGetVgpuUtilizationFunc func(device nvml.Device, v uint64) (nvml.ValueType, []nvml.VgpuInstanceUtilizationSample, nvml.Return) + + // DeviceGetViolationStatusFunc mocks the DeviceGetViolationStatus method. + DeviceGetViolationStatusFunc func(device nvml.Device, perfPolicyType nvml.PerfPolicyType) (nvml.ViolationTime, nvml.Return) + + // DeviceGetVirtualizationModeFunc mocks the DeviceGetVirtualizationMode method. + DeviceGetVirtualizationModeFunc func(device nvml.Device) (nvml.GpuVirtualizationMode, nvml.Return) + + // DeviceIsMigDeviceHandleFunc mocks the DeviceIsMigDeviceHandle method. + DeviceIsMigDeviceHandleFunc func(device nvml.Device) (bool, nvml.Return) + + // DeviceModifyDrainStateFunc mocks the DeviceModifyDrainState method. + DeviceModifyDrainStateFunc func(pciInfo *nvml.PciInfo, enableState nvml.EnableState) nvml.Return + + // DeviceOnSameBoardFunc mocks the DeviceOnSameBoard method. + DeviceOnSameBoardFunc func(device1 nvml.Device, device2 nvml.Device) (int, nvml.Return) + + // DeviceQueryDrainStateFunc mocks the DeviceQueryDrainState method. + DeviceQueryDrainStateFunc func(pciInfo *nvml.PciInfo) (nvml.EnableState, nvml.Return) + + // DeviceRegisterEventsFunc mocks the DeviceRegisterEvents method. + DeviceRegisterEventsFunc func(device nvml.Device, v uint64, eventSet nvml.EventSet) nvml.Return + + // DeviceRemoveGpuFunc mocks the DeviceRemoveGpu method. + DeviceRemoveGpuFunc func(pciInfo *nvml.PciInfo) nvml.Return + + // DeviceRemoveGpu_v2Func mocks the DeviceRemoveGpu_v2 method. + DeviceRemoveGpu_v2Func func(pciInfo *nvml.PciInfo, detachGpuState nvml.DetachGpuState, pcieLinkState nvml.PcieLinkState) nvml.Return + + // DeviceResetApplicationsClocksFunc mocks the DeviceResetApplicationsClocks method. + DeviceResetApplicationsClocksFunc func(device nvml.Device) nvml.Return + + // DeviceResetGpuLockedClocksFunc mocks the DeviceResetGpuLockedClocks method. + DeviceResetGpuLockedClocksFunc func(device nvml.Device) nvml.Return + + // DeviceResetMemoryLockedClocksFunc mocks the DeviceResetMemoryLockedClocks method. + DeviceResetMemoryLockedClocksFunc func(device nvml.Device) nvml.Return + + // DeviceResetNvLinkErrorCountersFunc mocks the DeviceResetNvLinkErrorCounters method. + DeviceResetNvLinkErrorCountersFunc func(device nvml.Device, n int) nvml.Return + + // DeviceResetNvLinkUtilizationCounterFunc mocks the DeviceResetNvLinkUtilizationCounter method. + DeviceResetNvLinkUtilizationCounterFunc func(device nvml.Device, n1 int, n2 int) nvml.Return + + // DeviceSetAPIRestrictionFunc mocks the DeviceSetAPIRestriction method. + DeviceSetAPIRestrictionFunc func(device nvml.Device, restrictedAPI nvml.RestrictedAPI, enableState nvml.EnableState) nvml.Return + + // DeviceSetAccountingModeFunc mocks the DeviceSetAccountingMode method. + DeviceSetAccountingModeFunc func(device nvml.Device, enableState nvml.EnableState) nvml.Return + + // DeviceSetApplicationsClocksFunc mocks the DeviceSetApplicationsClocks method. + DeviceSetApplicationsClocksFunc func(device nvml.Device, v1 uint32, v2 uint32) nvml.Return + + // DeviceSetAutoBoostedClocksEnabledFunc mocks the DeviceSetAutoBoostedClocksEnabled method. + DeviceSetAutoBoostedClocksEnabledFunc func(device nvml.Device, enableState nvml.EnableState) nvml.Return + + // DeviceSetComputeModeFunc mocks the DeviceSetComputeMode method. + DeviceSetComputeModeFunc func(device nvml.Device, computeMode nvml.ComputeMode) nvml.Return + + // DeviceSetCpuAffinityFunc mocks the DeviceSetCpuAffinity method. + DeviceSetCpuAffinityFunc func(device nvml.Device) nvml.Return + + // DeviceSetDefaultAutoBoostedClocksEnabledFunc mocks the DeviceSetDefaultAutoBoostedClocksEnabled method. + DeviceSetDefaultAutoBoostedClocksEnabledFunc func(device nvml.Device, enableState nvml.EnableState, v uint32) nvml.Return + + // DeviceSetDefaultFanSpeed_v2Func mocks the DeviceSetDefaultFanSpeed_v2 method. + DeviceSetDefaultFanSpeed_v2Func func(device nvml.Device, n int) nvml.Return + + // DeviceSetDriverModelFunc mocks the DeviceSetDriverModel method. + DeviceSetDriverModelFunc func(device nvml.Device, driverModel nvml.DriverModel, v uint32) nvml.Return + + // DeviceSetEccModeFunc mocks the DeviceSetEccMode method. + DeviceSetEccModeFunc func(device nvml.Device, enableState nvml.EnableState) nvml.Return + + // DeviceSetFanControlPolicyFunc mocks the DeviceSetFanControlPolicy method. + DeviceSetFanControlPolicyFunc func(device nvml.Device, n int, fanControlPolicy nvml.FanControlPolicy) nvml.Return + + // DeviceSetFanSpeed_v2Func mocks the DeviceSetFanSpeed_v2 method. + DeviceSetFanSpeed_v2Func func(device nvml.Device, n1 int, n2 int) nvml.Return + + // DeviceSetGpcClkVfOffsetFunc mocks the DeviceSetGpcClkVfOffset method. + DeviceSetGpcClkVfOffsetFunc func(device nvml.Device, n int) nvml.Return + + // DeviceSetGpuLockedClocksFunc mocks the DeviceSetGpuLockedClocks method. + DeviceSetGpuLockedClocksFunc func(device nvml.Device, v1 uint32, v2 uint32) nvml.Return + + // DeviceSetGpuOperationModeFunc mocks the DeviceSetGpuOperationMode method. + DeviceSetGpuOperationModeFunc func(device nvml.Device, gpuOperationMode nvml.GpuOperationMode) nvml.Return + + // DeviceSetMemClkVfOffsetFunc mocks the DeviceSetMemClkVfOffset method. + DeviceSetMemClkVfOffsetFunc func(device nvml.Device, n int) nvml.Return + + // DeviceSetMemoryLockedClocksFunc mocks the DeviceSetMemoryLockedClocks method. + DeviceSetMemoryLockedClocksFunc func(device nvml.Device, v1 uint32, v2 uint32) nvml.Return + + // DeviceSetMigModeFunc mocks the DeviceSetMigMode method. + DeviceSetMigModeFunc func(device nvml.Device, n int) (nvml.Return, nvml.Return) + + // DeviceSetNvLinkDeviceLowPowerThresholdFunc mocks the DeviceSetNvLinkDeviceLowPowerThreshold method. + DeviceSetNvLinkDeviceLowPowerThresholdFunc func(device nvml.Device, nvLinkPowerThres *nvml.NvLinkPowerThres) nvml.Return + + // DeviceSetNvLinkUtilizationControlFunc mocks the DeviceSetNvLinkUtilizationControl method. + DeviceSetNvLinkUtilizationControlFunc func(device nvml.Device, n1 int, n2 int, nvLinkUtilizationControl *nvml.NvLinkUtilizationControl, b bool) nvml.Return + + // DeviceSetPersistenceModeFunc mocks the DeviceSetPersistenceMode method. + DeviceSetPersistenceModeFunc func(device nvml.Device, enableState nvml.EnableState) nvml.Return + + // DeviceSetPowerManagementLimitFunc mocks the DeviceSetPowerManagementLimit method. + DeviceSetPowerManagementLimitFunc func(device nvml.Device, v uint32) nvml.Return + + // DeviceSetTemperatureThresholdFunc mocks the DeviceSetTemperatureThreshold method. + DeviceSetTemperatureThresholdFunc func(device nvml.Device, temperatureThresholds nvml.TemperatureThresholds, n int) nvml.Return + + // DeviceSetVgpuSchedulerStateFunc mocks the DeviceSetVgpuSchedulerState method. + DeviceSetVgpuSchedulerStateFunc func(device nvml.Device, vgpuSchedulerSetState *nvml.VgpuSchedulerSetState) nvml.Return + + // DeviceSetVirtualizationModeFunc mocks the DeviceSetVirtualizationMode method. + DeviceSetVirtualizationModeFunc func(device nvml.Device, gpuVirtualizationMode nvml.GpuVirtualizationMode) nvml.Return + + // DeviceValidateInforomFunc mocks the DeviceValidateInforom method. + DeviceValidateInforomFunc func(device nvml.Device) nvml.Return + + // ErrorStringFunc mocks the ErrorString method. + ErrorStringFunc func(returnMoqParam nvml.Return) string + + // EventSetCreateFunc mocks the EventSetCreate method. + EventSetCreateFunc func() (nvml.EventSet, nvml.Return) + + // EventSetFreeFunc mocks the EventSetFree method. + EventSetFreeFunc func(eventSet nvml.EventSet) nvml.Return + + // EventSetWaitFunc mocks the EventSetWait method. + EventSetWaitFunc func(eventSet nvml.EventSet, v uint32) (nvml.EventData, nvml.Return) + + // GetExcludedDeviceCountFunc mocks the GetExcludedDeviceCount method. + GetExcludedDeviceCountFunc func() (int, nvml.Return) + + // GetExcludedDeviceInfoByIndexFunc mocks the GetExcludedDeviceInfoByIndex method. + GetExcludedDeviceInfoByIndexFunc func(n int) (nvml.ExcludedDeviceInfo, nvml.Return) + + // GetLibraryFunc mocks the GetLibrary method. + GetLibraryFunc func() nvml.Library + + // GetVgpuCompatibilityFunc mocks the GetVgpuCompatibility method. + GetVgpuCompatibilityFunc func(vgpuMetadata *nvml.VgpuMetadata, vgpuPgpuMetadata *nvml.VgpuPgpuMetadata) (nvml.VgpuPgpuCompatibility, nvml.Return) + + // GetVgpuDriverCapabilitiesFunc mocks the GetVgpuDriverCapabilities method. + GetVgpuDriverCapabilitiesFunc func(vgpuDriverCapability nvml.VgpuDriverCapability) (bool, nvml.Return) + + // GetVgpuVersionFunc mocks the GetVgpuVersion method. + GetVgpuVersionFunc func() (nvml.VgpuVersion, nvml.VgpuVersion, nvml.Return) + + // GpmMetricsGetFunc mocks the GpmMetricsGet method. + GpmMetricsGetFunc func(gpmMetricsGetType *nvml.GpmMetricsGetType) nvml.Return + + // GpmMetricsGetVFunc mocks the GpmMetricsGetV method. + GpmMetricsGetVFunc func(gpmMetricsGetType *nvml.GpmMetricsGetType) nvml.GpmMetricsGetVType + + // GpmMigSampleGetFunc mocks the GpmMigSampleGet method. + GpmMigSampleGetFunc func(device nvml.Device, n int, gpmSample nvml.GpmSample) nvml.Return + + // GpmQueryDeviceSupportFunc mocks the GpmQueryDeviceSupport method. + GpmQueryDeviceSupportFunc func(device nvml.Device) (nvml.GpmSupport, nvml.Return) + + // GpmQueryDeviceSupportVFunc mocks the GpmQueryDeviceSupportV method. + GpmQueryDeviceSupportVFunc func(device nvml.Device) nvml.GpmSupportV + + // GpmSampleAllocFunc mocks the GpmSampleAlloc method. + GpmSampleAllocFunc func() (nvml.GpmSample, nvml.Return) + + // GpmSampleFreeFunc mocks the GpmSampleFree method. + GpmSampleFreeFunc func(gpmSample nvml.GpmSample) nvml.Return + + // GpmSampleGetFunc mocks the GpmSampleGet method. + GpmSampleGetFunc func(device nvml.Device, gpmSample nvml.GpmSample) nvml.Return + + // GpuInstanceCreateComputeInstanceFunc mocks the GpuInstanceCreateComputeInstance method. + GpuInstanceCreateComputeInstanceFunc func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (nvml.ComputeInstance, nvml.Return) + + // GpuInstanceCreateComputeInstanceWithPlacementFunc mocks the GpuInstanceCreateComputeInstanceWithPlacement method. + GpuInstanceCreateComputeInstanceWithPlacementFunc func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo, computeInstancePlacement *nvml.ComputeInstancePlacement) (nvml.ComputeInstance, nvml.Return) + + // GpuInstanceDestroyFunc mocks the GpuInstanceDestroy method. + GpuInstanceDestroyFunc func(gpuInstance nvml.GpuInstance) nvml.Return + + // GpuInstanceGetComputeInstanceByIdFunc mocks the GpuInstanceGetComputeInstanceById method. + GpuInstanceGetComputeInstanceByIdFunc func(gpuInstance nvml.GpuInstance, n int) (nvml.ComputeInstance, nvml.Return) + + // GpuInstanceGetComputeInstancePossiblePlacementsFunc mocks the GpuInstanceGetComputeInstancePossiblePlacements method. + GpuInstanceGetComputeInstancePossiblePlacementsFunc func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstancePlacement, nvml.Return) + + // GpuInstanceGetComputeInstanceProfileInfoFunc mocks the GpuInstanceGetComputeInstanceProfileInfo method. + GpuInstanceGetComputeInstanceProfileInfoFunc func(gpuInstance nvml.GpuInstance, n1 int, n2 int) (nvml.ComputeInstanceProfileInfo, nvml.Return) + + // GpuInstanceGetComputeInstanceProfileInfoVFunc mocks the GpuInstanceGetComputeInstanceProfileInfoV method. + GpuInstanceGetComputeInstanceProfileInfoVFunc func(gpuInstance nvml.GpuInstance, n1 int, n2 int) nvml.ComputeInstanceProfileInfoV + + // GpuInstanceGetComputeInstanceRemainingCapacityFunc mocks the GpuInstanceGetComputeInstanceRemainingCapacity method. + GpuInstanceGetComputeInstanceRemainingCapacityFunc func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (int, nvml.Return) + + // GpuInstanceGetComputeInstancesFunc mocks the GpuInstanceGetComputeInstances method. + GpuInstanceGetComputeInstancesFunc func(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstance, nvml.Return) + + // GpuInstanceGetInfoFunc mocks the GpuInstanceGetInfo method. + GpuInstanceGetInfoFunc func(gpuInstance nvml.GpuInstance) (nvml.GpuInstanceInfo, nvml.Return) + + // InitFunc mocks the Init method. + InitFunc func() nvml.Return + + // InitWithFlagsFunc mocks the InitWithFlags method. + InitWithFlagsFunc func(v uint32) nvml.Return + + // SetVgpuVersionFunc mocks the SetVgpuVersion method. + SetVgpuVersionFunc func(vgpuVersion *nvml.VgpuVersion) nvml.Return + + // ShutdownFunc mocks the Shutdown method. + ShutdownFunc func() nvml.Return + + // SystemGetCudaDriverVersionFunc mocks the SystemGetCudaDriverVersion method. + SystemGetCudaDriverVersionFunc func() (int, nvml.Return) + + // SystemGetCudaDriverVersion_v2Func mocks the SystemGetCudaDriverVersion_v2 method. + SystemGetCudaDriverVersion_v2Func func() (int, nvml.Return) + + // SystemGetDriverVersionFunc mocks the SystemGetDriverVersion method. + SystemGetDriverVersionFunc func() (string, nvml.Return) + + // SystemGetHicVersionFunc mocks the SystemGetHicVersion method. + SystemGetHicVersionFunc func() ([]nvml.HwbcEntry, nvml.Return) + + // SystemGetNVMLVersionFunc mocks the SystemGetNVMLVersion method. + SystemGetNVMLVersionFunc func() (string, nvml.Return) + + // SystemGetProcessNameFunc mocks the SystemGetProcessName method. + SystemGetProcessNameFunc func(n int) (string, nvml.Return) + + // SystemGetTopologyGpuSetFunc mocks the SystemGetTopologyGpuSet method. + SystemGetTopologyGpuSetFunc func(n int) ([]nvml.Device, nvml.Return) + + // UnitGetCountFunc mocks the UnitGetCount method. + UnitGetCountFunc func() (int, nvml.Return) + + // UnitGetDevicesFunc mocks the UnitGetDevices method. + UnitGetDevicesFunc func(unit nvml.Unit) ([]nvml.Device, nvml.Return) + + // UnitGetFanSpeedInfoFunc mocks the UnitGetFanSpeedInfo method. + UnitGetFanSpeedInfoFunc func(unit nvml.Unit) (nvml.UnitFanSpeeds, nvml.Return) + + // UnitGetHandleByIndexFunc mocks the UnitGetHandleByIndex method. + UnitGetHandleByIndexFunc func(n int) (nvml.Unit, nvml.Return) + + // UnitGetLedStateFunc mocks the UnitGetLedState method. + UnitGetLedStateFunc func(unit nvml.Unit) (nvml.LedState, nvml.Return) + + // UnitGetPsuInfoFunc mocks the UnitGetPsuInfo method. + UnitGetPsuInfoFunc func(unit nvml.Unit) (nvml.PSUInfo, nvml.Return) + + // UnitGetTemperatureFunc mocks the UnitGetTemperature method. + UnitGetTemperatureFunc func(unit nvml.Unit, n int) (uint32, nvml.Return) + + // UnitGetUnitInfoFunc mocks the UnitGetUnitInfo method. + UnitGetUnitInfoFunc func(unit nvml.Unit) (nvml.UnitInfo, nvml.Return) + + // UnitSetLedStateFunc mocks the UnitSetLedState method. + UnitSetLedStateFunc func(unit nvml.Unit, ledColor nvml.LedColor) nvml.Return + + // VgpuInstanceClearAccountingPidsFunc mocks the VgpuInstanceClearAccountingPids method. + VgpuInstanceClearAccountingPidsFunc func(vgpuInstance nvml.VgpuInstance) nvml.Return + + // VgpuInstanceGetAccountingModeFunc mocks the VgpuInstanceGetAccountingMode method. + VgpuInstanceGetAccountingModeFunc func(vgpuInstance nvml.VgpuInstance) (nvml.EnableState, nvml.Return) + + // VgpuInstanceGetAccountingPidsFunc mocks the VgpuInstanceGetAccountingPids method. + VgpuInstanceGetAccountingPidsFunc func(vgpuInstance nvml.VgpuInstance) ([]int, nvml.Return) + + // VgpuInstanceGetAccountingStatsFunc mocks the VgpuInstanceGetAccountingStats method. + VgpuInstanceGetAccountingStatsFunc func(vgpuInstance nvml.VgpuInstance, n int) (nvml.AccountingStats, nvml.Return) + + // VgpuInstanceGetEccModeFunc mocks the VgpuInstanceGetEccMode method. + VgpuInstanceGetEccModeFunc func(vgpuInstance nvml.VgpuInstance) (nvml.EnableState, nvml.Return) + + // VgpuInstanceGetEncoderCapacityFunc mocks the VgpuInstanceGetEncoderCapacity method. + VgpuInstanceGetEncoderCapacityFunc func(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) + + // VgpuInstanceGetEncoderSessionsFunc mocks the VgpuInstanceGetEncoderSessions method. + VgpuInstanceGetEncoderSessionsFunc func(vgpuInstance nvml.VgpuInstance) (int, nvml.EncoderSessionInfo, nvml.Return) + + // VgpuInstanceGetEncoderStatsFunc mocks the VgpuInstanceGetEncoderStats method. + VgpuInstanceGetEncoderStatsFunc func(vgpuInstance nvml.VgpuInstance) (int, uint32, uint32, nvml.Return) + + // VgpuInstanceGetFBCSessionsFunc mocks the VgpuInstanceGetFBCSessions method. + VgpuInstanceGetFBCSessionsFunc func(vgpuInstance nvml.VgpuInstance) (int, nvml.FBCSessionInfo, nvml.Return) + + // VgpuInstanceGetFBCStatsFunc mocks the VgpuInstanceGetFBCStats method. + VgpuInstanceGetFBCStatsFunc func(vgpuInstance nvml.VgpuInstance) (nvml.FBCStats, nvml.Return) + + // VgpuInstanceGetFbUsageFunc mocks the VgpuInstanceGetFbUsage method. + VgpuInstanceGetFbUsageFunc func(vgpuInstance nvml.VgpuInstance) (uint64, nvml.Return) + + // VgpuInstanceGetFrameRateLimitFunc mocks the VgpuInstanceGetFrameRateLimit method. + VgpuInstanceGetFrameRateLimitFunc func(vgpuInstance nvml.VgpuInstance) (uint32, nvml.Return) + + // VgpuInstanceGetGpuInstanceIdFunc mocks the VgpuInstanceGetGpuInstanceId method. + VgpuInstanceGetGpuInstanceIdFunc func(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) + + // VgpuInstanceGetGpuPciIdFunc mocks the VgpuInstanceGetGpuPciId method. + VgpuInstanceGetGpuPciIdFunc func(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) + + // VgpuInstanceGetLicenseInfoFunc mocks the VgpuInstanceGetLicenseInfo method. + VgpuInstanceGetLicenseInfoFunc func(vgpuInstance nvml.VgpuInstance) (nvml.VgpuLicenseInfo, nvml.Return) + + // VgpuInstanceGetLicenseStatusFunc mocks the VgpuInstanceGetLicenseStatus method. + VgpuInstanceGetLicenseStatusFunc func(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) + + // VgpuInstanceGetMdevUUIDFunc mocks the VgpuInstanceGetMdevUUID method. + VgpuInstanceGetMdevUUIDFunc func(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) + + // VgpuInstanceGetMetadataFunc mocks the VgpuInstanceGetMetadata method. + VgpuInstanceGetMetadataFunc func(vgpuInstance nvml.VgpuInstance) (nvml.VgpuMetadata, nvml.Return) + + // VgpuInstanceGetTypeFunc mocks the VgpuInstanceGetType method. + VgpuInstanceGetTypeFunc func(vgpuInstance nvml.VgpuInstance) (nvml.VgpuTypeId, nvml.Return) + + // VgpuInstanceGetUUIDFunc mocks the VgpuInstanceGetUUID method. + VgpuInstanceGetUUIDFunc func(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) + + // VgpuInstanceGetVmDriverVersionFunc mocks the VgpuInstanceGetVmDriverVersion method. + VgpuInstanceGetVmDriverVersionFunc func(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) + + // VgpuInstanceGetVmIDFunc mocks the VgpuInstanceGetVmID method. + VgpuInstanceGetVmIDFunc func(vgpuInstance nvml.VgpuInstance) (string, nvml.VgpuVmIdType, nvml.Return) + + // VgpuInstanceSetEncoderCapacityFunc mocks the VgpuInstanceSetEncoderCapacity method. + VgpuInstanceSetEncoderCapacityFunc func(vgpuInstance nvml.VgpuInstance, n int) nvml.Return + + // VgpuTypeGetCapabilitiesFunc mocks the VgpuTypeGetCapabilities method. + VgpuTypeGetCapabilitiesFunc func(vgpuTypeId nvml.VgpuTypeId, vgpuCapability nvml.VgpuCapability) (bool, nvml.Return) + + // VgpuTypeGetClassFunc mocks the VgpuTypeGetClass method. + VgpuTypeGetClassFunc func(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) + + // VgpuTypeGetDeviceIDFunc mocks the VgpuTypeGetDeviceID method. + VgpuTypeGetDeviceIDFunc func(vgpuTypeId nvml.VgpuTypeId) (uint64, uint64, nvml.Return) + + // VgpuTypeGetFrameRateLimitFunc mocks the VgpuTypeGetFrameRateLimit method. + VgpuTypeGetFrameRateLimitFunc func(vgpuTypeId nvml.VgpuTypeId) (uint32, nvml.Return) + + // VgpuTypeGetFramebufferSizeFunc mocks the VgpuTypeGetFramebufferSize method. + VgpuTypeGetFramebufferSizeFunc func(vgpuTypeId nvml.VgpuTypeId) (uint64, nvml.Return) + + // VgpuTypeGetGpuInstanceProfileIdFunc mocks the VgpuTypeGetGpuInstanceProfileId method. + VgpuTypeGetGpuInstanceProfileIdFunc func(vgpuTypeId nvml.VgpuTypeId) (uint32, nvml.Return) + + // VgpuTypeGetLicenseFunc mocks the VgpuTypeGetLicense method. + VgpuTypeGetLicenseFunc func(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) + + // VgpuTypeGetMaxInstancesFunc mocks the VgpuTypeGetMaxInstances method. + VgpuTypeGetMaxInstancesFunc func(device nvml.Device, vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) + + // VgpuTypeGetMaxInstancesPerVmFunc mocks the VgpuTypeGetMaxInstancesPerVm method. + VgpuTypeGetMaxInstancesPerVmFunc func(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) + + // VgpuTypeGetNameFunc mocks the VgpuTypeGetName method. + VgpuTypeGetNameFunc func(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) + + // VgpuTypeGetNumDisplayHeadsFunc mocks the VgpuTypeGetNumDisplayHeads method. + VgpuTypeGetNumDisplayHeadsFunc func(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) + + // VgpuTypeGetResolutionFunc mocks the VgpuTypeGetResolution method. + VgpuTypeGetResolutionFunc func(vgpuTypeId nvml.VgpuTypeId, n int) (uint32, uint32, nvml.Return) + + // calls tracks calls to the methods. + calls struct { + // ComputeInstanceDestroy holds details about calls to the ComputeInstanceDestroy method. + ComputeInstanceDestroy []struct { + // ComputeInstance is the computeInstance argument value. + ComputeInstance nvml.ComputeInstance + } + // ComputeInstanceGetInfo holds details about calls to the ComputeInstanceGetInfo method. + ComputeInstanceGetInfo []struct { + // ComputeInstance is the computeInstance argument value. + ComputeInstance nvml.ComputeInstance + } + // DeviceCcuGetStreamState holds details about calls to the DeviceCcuGetStreamState method. + DeviceCcuGetStreamState []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceCcuSetStreamState holds details about calls to the DeviceCcuSetStreamState method. + DeviceCcuSetStreamState []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceClearAccountingPids holds details about calls to the DeviceClearAccountingPids method. + DeviceClearAccountingPids []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceClearCpuAffinity holds details about calls to the DeviceClearCpuAffinity method. + DeviceClearCpuAffinity []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceClearEccErrorCounts holds details about calls to the DeviceClearEccErrorCounts method. + DeviceClearEccErrorCounts []struct { + // Device is the device argument value. + Device nvml.Device + // EccCounterType is the eccCounterType argument value. + EccCounterType nvml.EccCounterType + } + // DeviceClearFieldValues holds details about calls to the DeviceClearFieldValues method. + DeviceClearFieldValues []struct { + // Device is the device argument value. + Device nvml.Device + // FieldValues is the fieldValues argument value. + FieldValues []nvml.FieldValue + } + // DeviceCreateGpuInstance holds details about calls to the DeviceCreateGpuInstance method. + DeviceCreateGpuInstance []struct { + // Device is the device argument value. + Device nvml.Device + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + // DeviceCreateGpuInstanceWithPlacement holds details about calls to the DeviceCreateGpuInstanceWithPlacement method. + DeviceCreateGpuInstanceWithPlacement []struct { + // Device is the device argument value. + Device nvml.Device + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + // GpuInstancePlacement is the gpuInstancePlacement argument value. + GpuInstancePlacement *nvml.GpuInstancePlacement + } + // DeviceDiscoverGpus holds details about calls to the DeviceDiscoverGpus method. + DeviceDiscoverGpus []struct { + } + // DeviceFreezeNvLinkUtilizationCounter holds details about calls to the DeviceFreezeNvLinkUtilizationCounter method. + DeviceFreezeNvLinkUtilizationCounter []struct { + // Device is the device argument value. + Device nvml.Device + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // DeviceGetAPIRestriction holds details about calls to the DeviceGetAPIRestriction method. + DeviceGetAPIRestriction []struct { + // Device is the device argument value. + Device nvml.Device + // RestrictedAPI is the restrictedAPI argument value. + RestrictedAPI nvml.RestrictedAPI + } + // DeviceGetAccountingBufferSize holds details about calls to the DeviceGetAccountingBufferSize method. + DeviceGetAccountingBufferSize []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetAccountingMode holds details about calls to the DeviceGetAccountingMode method. + DeviceGetAccountingMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetAccountingPids holds details about calls to the DeviceGetAccountingPids method. + DeviceGetAccountingPids []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetAccountingStats holds details about calls to the DeviceGetAccountingStats method. + DeviceGetAccountingStats []struct { + // Device is the device argument value. + Device nvml.Device + // V is the v argument value. + V uint32 + } + // DeviceGetActiveVgpus holds details about calls to the DeviceGetActiveVgpus method. + DeviceGetActiveVgpus []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetAdaptiveClockInfoStatus holds details about calls to the DeviceGetAdaptiveClockInfoStatus method. + DeviceGetAdaptiveClockInfoStatus []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetApplicationsClock holds details about calls to the DeviceGetApplicationsClock method. + DeviceGetApplicationsClock []struct { + // Device is the device argument value. + Device nvml.Device + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // DeviceGetArchitecture holds details about calls to the DeviceGetArchitecture method. + DeviceGetArchitecture []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetAttributes holds details about calls to the DeviceGetAttributes method. + DeviceGetAttributes []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetAutoBoostedClocksEnabled holds details about calls to the DeviceGetAutoBoostedClocksEnabled method. + DeviceGetAutoBoostedClocksEnabled []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetBAR1MemoryInfo holds details about calls to the DeviceGetBAR1MemoryInfo method. + DeviceGetBAR1MemoryInfo []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetBoardId holds details about calls to the DeviceGetBoardId method. + DeviceGetBoardId []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetBoardPartNumber holds details about calls to the DeviceGetBoardPartNumber method. + DeviceGetBoardPartNumber []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetBrand holds details about calls to the DeviceGetBrand method. + DeviceGetBrand []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetBridgeChipInfo holds details about calls to the DeviceGetBridgeChipInfo method. + DeviceGetBridgeChipInfo []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetBusType holds details about calls to the DeviceGetBusType method. + DeviceGetBusType []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetClkMonStatus holds details about calls to the DeviceGetClkMonStatus method. + DeviceGetClkMonStatus []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetClock holds details about calls to the DeviceGetClock method. + DeviceGetClock []struct { + // Device is the device argument value. + Device nvml.Device + // ClockType is the clockType argument value. + ClockType nvml.ClockType + // ClockId is the clockId argument value. + ClockId nvml.ClockId + } + // DeviceGetClockInfo holds details about calls to the DeviceGetClockInfo method. + DeviceGetClockInfo []struct { + // Device is the device argument value. + Device nvml.Device + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // DeviceGetComputeInstanceId holds details about calls to the DeviceGetComputeInstanceId method. + DeviceGetComputeInstanceId []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetComputeMode holds details about calls to the DeviceGetComputeMode method. + DeviceGetComputeMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetComputeRunningProcesses holds details about calls to the DeviceGetComputeRunningProcesses method. + DeviceGetComputeRunningProcesses []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetCount holds details about calls to the DeviceGetCount method. + DeviceGetCount []struct { + } + // DeviceGetCpuAffinity holds details about calls to the DeviceGetCpuAffinity method. + DeviceGetCpuAffinity []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetCpuAffinityWithinScope holds details about calls to the DeviceGetCpuAffinityWithinScope method. + DeviceGetCpuAffinityWithinScope []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + // AffinityScope is the affinityScope argument value. + AffinityScope nvml.AffinityScope + } + // DeviceGetCreatableVgpus holds details about calls to the DeviceGetCreatableVgpus method. + DeviceGetCreatableVgpus []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetCudaComputeCapability holds details about calls to the DeviceGetCudaComputeCapability method. + DeviceGetCudaComputeCapability []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetCurrPcieLinkGeneration holds details about calls to the DeviceGetCurrPcieLinkGeneration method. + DeviceGetCurrPcieLinkGeneration []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetCurrPcieLinkWidth holds details about calls to the DeviceGetCurrPcieLinkWidth method. + DeviceGetCurrPcieLinkWidth []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetCurrentClocksThrottleReasons holds details about calls to the DeviceGetCurrentClocksThrottleReasons method. + DeviceGetCurrentClocksThrottleReasons []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetDecoderUtilization holds details about calls to the DeviceGetDecoderUtilization method. + DeviceGetDecoderUtilization []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetDefaultApplicationsClock holds details about calls to the DeviceGetDefaultApplicationsClock method. + DeviceGetDefaultApplicationsClock []struct { + // Device is the device argument value. + Device nvml.Device + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // DeviceGetDefaultEccMode holds details about calls to the DeviceGetDefaultEccMode method. + DeviceGetDefaultEccMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetDetailedEccErrors holds details about calls to the DeviceGetDetailedEccErrors method. + DeviceGetDetailedEccErrors []struct { + // Device is the device argument value. + Device nvml.Device + // MemoryErrorType is the memoryErrorType argument value. + MemoryErrorType nvml.MemoryErrorType + // EccCounterType is the eccCounterType argument value. + EccCounterType nvml.EccCounterType + } + // DeviceGetDeviceHandleFromMigDeviceHandle holds details about calls to the DeviceGetDeviceHandleFromMigDeviceHandle method. + DeviceGetDeviceHandleFromMigDeviceHandle []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetDisplayActive holds details about calls to the DeviceGetDisplayActive method. + DeviceGetDisplayActive []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetDisplayMode holds details about calls to the DeviceGetDisplayMode method. + DeviceGetDisplayMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetDriverModel holds details about calls to the DeviceGetDriverModel method. + DeviceGetDriverModel []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetDynamicPstatesInfo holds details about calls to the DeviceGetDynamicPstatesInfo method. + DeviceGetDynamicPstatesInfo []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetEccMode holds details about calls to the DeviceGetEccMode method. + DeviceGetEccMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetEncoderCapacity holds details about calls to the DeviceGetEncoderCapacity method. + DeviceGetEncoderCapacity []struct { + // Device is the device argument value. + Device nvml.Device + // EncoderType is the encoderType argument value. + EncoderType nvml.EncoderType + } + // DeviceGetEncoderSessions holds details about calls to the DeviceGetEncoderSessions method. + DeviceGetEncoderSessions []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetEncoderStats holds details about calls to the DeviceGetEncoderStats method. + DeviceGetEncoderStats []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetEncoderUtilization holds details about calls to the DeviceGetEncoderUtilization method. + DeviceGetEncoderUtilization []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetEnforcedPowerLimit holds details about calls to the DeviceGetEnforcedPowerLimit method. + DeviceGetEnforcedPowerLimit []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetFBCSessions holds details about calls to the DeviceGetFBCSessions method. + DeviceGetFBCSessions []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetFBCStats holds details about calls to the DeviceGetFBCStats method. + DeviceGetFBCStats []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetFanControlPolicy_v2 holds details about calls to the DeviceGetFanControlPolicy_v2 method. + DeviceGetFanControlPolicy_v2 []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetFanSpeed holds details about calls to the DeviceGetFanSpeed method. + DeviceGetFanSpeed []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetFanSpeed_v2 holds details about calls to the DeviceGetFanSpeed_v2 method. + DeviceGetFanSpeed_v2 []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetFieldValues holds details about calls to the DeviceGetFieldValues method. + DeviceGetFieldValues []struct { + // Device is the device argument value. + Device nvml.Device + // FieldValues is the fieldValues argument value. + FieldValues []nvml.FieldValue + } + // DeviceGetGpcClkMinMaxVfOffset holds details about calls to the DeviceGetGpcClkMinMaxVfOffset method. + DeviceGetGpcClkMinMaxVfOffset []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGpcClkVfOffset holds details about calls to the DeviceGetGpcClkVfOffset method. + DeviceGetGpcClkVfOffset []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGpuFabricInfo holds details about calls to the DeviceGetGpuFabricInfo method. + DeviceGetGpuFabricInfo []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGpuInstanceById holds details about calls to the DeviceGetGpuInstanceById method. + DeviceGetGpuInstanceById []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetGpuInstanceId holds details about calls to the DeviceGetGpuInstanceId method. + DeviceGetGpuInstanceId []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGpuInstancePossiblePlacements holds details about calls to the DeviceGetGpuInstancePossiblePlacements method. + DeviceGetGpuInstancePossiblePlacements []struct { + // Device is the device argument value. + Device nvml.Device + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + // DeviceGetGpuInstanceProfileInfo holds details about calls to the DeviceGetGpuInstanceProfileInfo method. + DeviceGetGpuInstanceProfileInfo []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetGpuInstanceProfileInfoV holds details about calls to the DeviceGetGpuInstanceProfileInfoV method. + DeviceGetGpuInstanceProfileInfoV []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetGpuInstanceRemainingCapacity holds details about calls to the DeviceGetGpuInstanceRemainingCapacity method. + DeviceGetGpuInstanceRemainingCapacity []struct { + // Device is the device argument value. + Device nvml.Device + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + // DeviceGetGpuInstances holds details about calls to the DeviceGetGpuInstances method. + DeviceGetGpuInstances []struct { + // Device is the device argument value. + Device nvml.Device + // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + // DeviceGetGpuMaxPcieLinkGeneration holds details about calls to the DeviceGetGpuMaxPcieLinkGeneration method. + DeviceGetGpuMaxPcieLinkGeneration []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGpuOperationMode holds details about calls to the DeviceGetGpuOperationMode method. + DeviceGetGpuOperationMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGraphicsRunningProcesses holds details about calls to the DeviceGetGraphicsRunningProcesses method. + DeviceGetGraphicsRunningProcesses []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGridLicensableFeatures holds details about calls to the DeviceGetGridLicensableFeatures method. + DeviceGetGridLicensableFeatures []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGspFirmwareMode holds details about calls to the DeviceGetGspFirmwareMode method. + DeviceGetGspFirmwareMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetGspFirmwareVersion holds details about calls to the DeviceGetGspFirmwareVersion method. + DeviceGetGspFirmwareVersion []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetHandleByIndex holds details about calls to the DeviceGetHandleByIndex method. + DeviceGetHandleByIndex []struct { + // N is the n argument value. + N int + } + // DeviceGetHandleByPciBusId holds details about calls to the DeviceGetHandleByPciBusId method. + DeviceGetHandleByPciBusId []struct { + // S is the s argument value. + S string + } + // DeviceGetHandleBySerial holds details about calls to the DeviceGetHandleBySerial method. + DeviceGetHandleBySerial []struct { + // S is the s argument value. + S string + } + // DeviceGetHandleByUUID holds details about calls to the DeviceGetHandleByUUID method. + DeviceGetHandleByUUID []struct { + // S is the s argument value. + S string + } + // DeviceGetHostVgpuMode holds details about calls to the DeviceGetHostVgpuMode method. + DeviceGetHostVgpuMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetIndex holds details about calls to the DeviceGetIndex method. + DeviceGetIndex []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetInforomConfigurationChecksum holds details about calls to the DeviceGetInforomConfigurationChecksum method. + DeviceGetInforomConfigurationChecksum []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetInforomImageVersion holds details about calls to the DeviceGetInforomImageVersion method. + DeviceGetInforomImageVersion []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetInforomVersion holds details about calls to the DeviceGetInforomVersion method. + DeviceGetInforomVersion []struct { + // Device is the device argument value. + Device nvml.Device + // InforomObject is the inforomObject argument value. + InforomObject nvml.InforomObject + } + // DeviceGetIrqNum holds details about calls to the DeviceGetIrqNum method. + DeviceGetIrqNum []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMPSComputeRunningProcesses holds details about calls to the DeviceGetMPSComputeRunningProcesses method. + DeviceGetMPSComputeRunningProcesses []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMaxClockInfo holds details about calls to the DeviceGetMaxClockInfo method. + DeviceGetMaxClockInfo []struct { + // Device is the device argument value. + Device nvml.Device + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // DeviceGetMaxCustomerBoostClock holds details about calls to the DeviceGetMaxCustomerBoostClock method. + DeviceGetMaxCustomerBoostClock []struct { + // Device is the device argument value. + Device nvml.Device + // ClockType is the clockType argument value. + ClockType nvml.ClockType + } + // DeviceGetMaxMigDeviceCount holds details about calls to the DeviceGetMaxMigDeviceCount method. + DeviceGetMaxMigDeviceCount []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMaxPcieLinkGeneration holds details about calls to the DeviceGetMaxPcieLinkGeneration method. + DeviceGetMaxPcieLinkGeneration []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMaxPcieLinkWidth holds details about calls to the DeviceGetMaxPcieLinkWidth method. + DeviceGetMaxPcieLinkWidth []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMemClkMinMaxVfOffset holds details about calls to the DeviceGetMemClkMinMaxVfOffset method. + DeviceGetMemClkMinMaxVfOffset []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMemClkVfOffset holds details about calls to the DeviceGetMemClkVfOffset method. + DeviceGetMemClkVfOffset []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMemoryAffinity holds details about calls to the DeviceGetMemoryAffinity method. + DeviceGetMemoryAffinity []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + // AffinityScope is the affinityScope argument value. + AffinityScope nvml.AffinityScope + } + // DeviceGetMemoryBusWidth holds details about calls to the DeviceGetMemoryBusWidth method. + DeviceGetMemoryBusWidth []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMemoryErrorCounter holds details about calls to the DeviceGetMemoryErrorCounter method. + DeviceGetMemoryErrorCounter []struct { + // Device is the device argument value. + Device nvml.Device + // MemoryErrorType is the memoryErrorType argument value. + MemoryErrorType nvml.MemoryErrorType + // EccCounterType is the eccCounterType argument value. + EccCounterType nvml.EccCounterType + // MemoryLocation is the memoryLocation argument value. + MemoryLocation nvml.MemoryLocation + } + // DeviceGetMemoryInfo holds details about calls to the DeviceGetMemoryInfo method. + DeviceGetMemoryInfo []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMemoryInfo_v2 holds details about calls to the DeviceGetMemoryInfo_v2 method. + DeviceGetMemoryInfo_v2 []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMigDeviceHandleByIndex holds details about calls to the DeviceGetMigDeviceHandleByIndex method. + DeviceGetMigDeviceHandleByIndex []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetMigMode holds details about calls to the DeviceGetMigMode method. + DeviceGetMigMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMinMaxClockOfPState holds details about calls to the DeviceGetMinMaxClockOfPState method. + DeviceGetMinMaxClockOfPState []struct { + // Device is the device argument value. + Device nvml.Device + // ClockType is the clockType argument value. + ClockType nvml.ClockType + // Pstates is the pstates argument value. + Pstates nvml.Pstates + } + // DeviceGetMinMaxFanSpeed holds details about calls to the DeviceGetMinMaxFanSpeed method. + DeviceGetMinMaxFanSpeed []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMinorNumber holds details about calls to the DeviceGetMinorNumber method. + DeviceGetMinorNumber []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetMultiGpuBoard holds details about calls to the DeviceGetMultiGpuBoard method. + DeviceGetMultiGpuBoard []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetName holds details about calls to the DeviceGetName method. + DeviceGetName []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetNumFans holds details about calls to the DeviceGetNumFans method. + DeviceGetNumFans []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetNumGpuCores holds details about calls to the DeviceGetNumGpuCores method. + DeviceGetNumGpuCores []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetNvLinkCapability holds details about calls to the DeviceGetNvLinkCapability method. + DeviceGetNvLinkCapability []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + // NvLinkCapability is the nvLinkCapability argument value. + NvLinkCapability nvml.NvLinkCapability + } + // DeviceGetNvLinkErrorCounter holds details about calls to the DeviceGetNvLinkErrorCounter method. + DeviceGetNvLinkErrorCounter []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + // NvLinkErrorCounter is the nvLinkErrorCounter argument value. + NvLinkErrorCounter nvml.NvLinkErrorCounter + } + // DeviceGetNvLinkRemoteDeviceType holds details about calls to the DeviceGetNvLinkRemoteDeviceType method. + DeviceGetNvLinkRemoteDeviceType []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetNvLinkRemotePciInfo holds details about calls to the DeviceGetNvLinkRemotePciInfo method. + DeviceGetNvLinkRemotePciInfo []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetNvLinkState holds details about calls to the DeviceGetNvLinkState method. + DeviceGetNvLinkState []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetNvLinkUtilizationControl holds details about calls to the DeviceGetNvLinkUtilizationControl method. + DeviceGetNvLinkUtilizationControl []struct { + // Device is the device argument value. + Device nvml.Device + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // DeviceGetNvLinkUtilizationCounter holds details about calls to the DeviceGetNvLinkUtilizationCounter method. + DeviceGetNvLinkUtilizationCounter []struct { + // Device is the device argument value. + Device nvml.Device + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // DeviceGetNvLinkVersion holds details about calls to the DeviceGetNvLinkVersion method. + DeviceGetNvLinkVersion []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetP2PStatus holds details about calls to the DeviceGetP2PStatus method. + DeviceGetP2PStatus []struct { + // Device1 is the device1 argument value. + Device1 nvml.Device + // Device2 is the device2 argument value. + Device2 nvml.Device + // GpuP2PCapsIndex is the gpuP2PCapsIndex argument value. + GpuP2PCapsIndex nvml.GpuP2PCapsIndex + } + // DeviceGetPciInfo holds details about calls to the DeviceGetPciInfo method. + DeviceGetPciInfo []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPcieLinkMaxSpeed holds details about calls to the DeviceGetPcieLinkMaxSpeed method. + DeviceGetPcieLinkMaxSpeed []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPcieReplayCounter holds details about calls to the DeviceGetPcieReplayCounter method. + DeviceGetPcieReplayCounter []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPcieSpeed holds details about calls to the DeviceGetPcieSpeed method. + DeviceGetPcieSpeed []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPcieThroughput holds details about calls to the DeviceGetPcieThroughput method. + DeviceGetPcieThroughput []struct { + // Device is the device argument value. + Device nvml.Device + // PcieUtilCounter is the pcieUtilCounter argument value. + PcieUtilCounter nvml.PcieUtilCounter + } + // DeviceGetPerformanceState holds details about calls to the DeviceGetPerformanceState method. + DeviceGetPerformanceState []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPersistenceMode holds details about calls to the DeviceGetPersistenceMode method. + DeviceGetPersistenceMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPgpuMetadataString holds details about calls to the DeviceGetPgpuMetadataString method. + DeviceGetPgpuMetadataString []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPowerManagementDefaultLimit holds details about calls to the DeviceGetPowerManagementDefaultLimit method. + DeviceGetPowerManagementDefaultLimit []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPowerManagementLimit holds details about calls to the DeviceGetPowerManagementLimit method. + DeviceGetPowerManagementLimit []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPowerManagementLimitConstraints holds details about calls to the DeviceGetPowerManagementLimitConstraints method. + DeviceGetPowerManagementLimitConstraints []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPowerManagementMode holds details about calls to the DeviceGetPowerManagementMode method. + DeviceGetPowerManagementMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPowerSource holds details about calls to the DeviceGetPowerSource method. + DeviceGetPowerSource []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPowerState holds details about calls to the DeviceGetPowerState method. + DeviceGetPowerState []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetPowerUsage holds details about calls to the DeviceGetPowerUsage method. + DeviceGetPowerUsage []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetProcessUtilization holds details about calls to the DeviceGetProcessUtilization method. + DeviceGetProcessUtilization []struct { + // Device is the device argument value. + Device nvml.Device + // V is the v argument value. + V uint64 + } + // DeviceGetRemappedRows holds details about calls to the DeviceGetRemappedRows method. + DeviceGetRemappedRows []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetRetiredPages holds details about calls to the DeviceGetRetiredPages method. + DeviceGetRetiredPages []struct { + // Device is the device argument value. + Device nvml.Device + // PageRetirementCause is the pageRetirementCause argument value. + PageRetirementCause nvml.PageRetirementCause + } + // DeviceGetRetiredPagesPendingStatus holds details about calls to the DeviceGetRetiredPagesPendingStatus method. + DeviceGetRetiredPagesPendingStatus []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetRetiredPages_v2 holds details about calls to the DeviceGetRetiredPages_v2 method. + DeviceGetRetiredPages_v2 []struct { + // Device is the device argument value. + Device nvml.Device + // PageRetirementCause is the pageRetirementCause argument value. + PageRetirementCause nvml.PageRetirementCause + } + // DeviceGetRowRemapperHistogram holds details about calls to the DeviceGetRowRemapperHistogram method. + DeviceGetRowRemapperHistogram []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetSamples holds details about calls to the DeviceGetSamples method. + DeviceGetSamples []struct { + // Device is the device argument value. + Device nvml.Device + // SamplingType is the samplingType argument value. + SamplingType nvml.SamplingType + // V is the v argument value. + V uint64 + } + // DeviceGetSerial holds details about calls to the DeviceGetSerial method. + DeviceGetSerial []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetSupportedClocksThrottleReasons holds details about calls to the DeviceGetSupportedClocksThrottleReasons method. + DeviceGetSupportedClocksThrottleReasons []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetSupportedEventTypes holds details about calls to the DeviceGetSupportedEventTypes method. + DeviceGetSupportedEventTypes []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetSupportedGraphicsClocks holds details about calls to the DeviceGetSupportedGraphicsClocks method. + DeviceGetSupportedGraphicsClocks []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetSupportedMemoryClocks holds details about calls to the DeviceGetSupportedMemoryClocks method. + DeviceGetSupportedMemoryClocks []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetSupportedPerformanceStates holds details about calls to the DeviceGetSupportedPerformanceStates method. + DeviceGetSupportedPerformanceStates []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetSupportedVgpus holds details about calls to the DeviceGetSupportedVgpus method. + DeviceGetSupportedVgpus []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetTargetFanSpeed holds details about calls to the DeviceGetTargetFanSpeed method. + DeviceGetTargetFanSpeed []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceGetTemperature holds details about calls to the DeviceGetTemperature method. + DeviceGetTemperature []struct { + // Device is the device argument value. + Device nvml.Device + // TemperatureSensors is the temperatureSensors argument value. + TemperatureSensors nvml.TemperatureSensors + } + // DeviceGetTemperatureThreshold holds details about calls to the DeviceGetTemperatureThreshold method. + DeviceGetTemperatureThreshold []struct { + // Device is the device argument value. + Device nvml.Device + // TemperatureThresholds is the temperatureThresholds argument value. + TemperatureThresholds nvml.TemperatureThresholds + } + // DeviceGetThermalSettings holds details about calls to the DeviceGetThermalSettings method. + DeviceGetThermalSettings []struct { + // Device is the device argument value. + Device nvml.Device + // V is the v argument value. + V uint32 + } + // DeviceGetTopologyCommonAncestor holds details about calls to the DeviceGetTopologyCommonAncestor method. + DeviceGetTopologyCommonAncestor []struct { + // Device1 is the device1 argument value. + Device1 nvml.Device + // Device2 is the device2 argument value. + Device2 nvml.Device + } + // DeviceGetTopologyNearestGpus holds details about calls to the DeviceGetTopologyNearestGpus method. + DeviceGetTopologyNearestGpus []struct { + // Device is the device argument value. + Device nvml.Device + // GpuTopologyLevel is the gpuTopologyLevel argument value. + GpuTopologyLevel nvml.GpuTopologyLevel + } + // DeviceGetTotalEccErrors holds details about calls to the DeviceGetTotalEccErrors method. + DeviceGetTotalEccErrors []struct { + // Device is the device argument value. + Device nvml.Device + // MemoryErrorType is the memoryErrorType argument value. + MemoryErrorType nvml.MemoryErrorType + // EccCounterType is the eccCounterType argument value. + EccCounterType nvml.EccCounterType + } + // DeviceGetTotalEnergyConsumption holds details about calls to the DeviceGetTotalEnergyConsumption method. + DeviceGetTotalEnergyConsumption []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetUUID holds details about calls to the DeviceGetUUID method. + DeviceGetUUID []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetUtilizationRates holds details about calls to the DeviceGetUtilizationRates method. + DeviceGetUtilizationRates []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetVbiosVersion holds details about calls to the DeviceGetVbiosVersion method. + DeviceGetVbiosVersion []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetVgpuCapabilities holds details about calls to the DeviceGetVgpuCapabilities method. + DeviceGetVgpuCapabilities []struct { + // Device is the device argument value. + Device nvml.Device + // DeviceVgpuCapability is the deviceVgpuCapability argument value. + DeviceVgpuCapability nvml.DeviceVgpuCapability + } + // DeviceGetVgpuMetadata holds details about calls to the DeviceGetVgpuMetadata method. + DeviceGetVgpuMetadata []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetVgpuProcessUtilization holds details about calls to the DeviceGetVgpuProcessUtilization method. + DeviceGetVgpuProcessUtilization []struct { + // Device is the device argument value. + Device nvml.Device + // V is the v argument value. + V uint64 + } + // DeviceGetVgpuSchedulerCapabilities holds details about calls to the DeviceGetVgpuSchedulerCapabilities method. + DeviceGetVgpuSchedulerCapabilities []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetVgpuSchedulerLog holds details about calls to the DeviceGetVgpuSchedulerLog method. + DeviceGetVgpuSchedulerLog []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetVgpuSchedulerState holds details about calls to the DeviceGetVgpuSchedulerState method. + DeviceGetVgpuSchedulerState []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceGetVgpuUtilization holds details about calls to the DeviceGetVgpuUtilization method. + DeviceGetVgpuUtilization []struct { + // Device is the device argument value. + Device nvml.Device + // V is the v argument value. + V uint64 + } + // DeviceGetViolationStatus holds details about calls to the DeviceGetViolationStatus method. + DeviceGetViolationStatus []struct { + // Device is the device argument value. + Device nvml.Device + // PerfPolicyType is the perfPolicyType argument value. + PerfPolicyType nvml.PerfPolicyType + } + // DeviceGetVirtualizationMode holds details about calls to the DeviceGetVirtualizationMode method. + DeviceGetVirtualizationMode []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceIsMigDeviceHandle holds details about calls to the DeviceIsMigDeviceHandle method. + DeviceIsMigDeviceHandle []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceModifyDrainState holds details about calls to the DeviceModifyDrainState method. + DeviceModifyDrainState []struct { + // PciInfo is the pciInfo argument value. + PciInfo *nvml.PciInfo + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // DeviceOnSameBoard holds details about calls to the DeviceOnSameBoard method. + DeviceOnSameBoard []struct { + // Device1 is the device1 argument value. + Device1 nvml.Device + // Device2 is the device2 argument value. + Device2 nvml.Device + } + // DeviceQueryDrainState holds details about calls to the DeviceQueryDrainState method. + DeviceQueryDrainState []struct { + // PciInfo is the pciInfo argument value. + PciInfo *nvml.PciInfo + } + // DeviceRegisterEvents holds details about calls to the DeviceRegisterEvents method. + DeviceRegisterEvents []struct { + // Device is the device argument value. + Device nvml.Device + // V is the v argument value. + V uint64 + // EventSet is the eventSet argument value. + EventSet nvml.EventSet + } + // DeviceRemoveGpu holds details about calls to the DeviceRemoveGpu method. + DeviceRemoveGpu []struct { + // PciInfo is the pciInfo argument value. + PciInfo *nvml.PciInfo + } + // DeviceRemoveGpu_v2 holds details about calls to the DeviceRemoveGpu_v2 method. + DeviceRemoveGpu_v2 []struct { + // PciInfo is the pciInfo argument value. + PciInfo *nvml.PciInfo + // DetachGpuState is the detachGpuState argument value. + DetachGpuState nvml.DetachGpuState + // PcieLinkState is the pcieLinkState argument value. + PcieLinkState nvml.PcieLinkState + } + // DeviceResetApplicationsClocks holds details about calls to the DeviceResetApplicationsClocks method. + DeviceResetApplicationsClocks []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceResetGpuLockedClocks holds details about calls to the DeviceResetGpuLockedClocks method. + DeviceResetGpuLockedClocks []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceResetMemoryLockedClocks holds details about calls to the DeviceResetMemoryLockedClocks method. + DeviceResetMemoryLockedClocks []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceResetNvLinkErrorCounters holds details about calls to the DeviceResetNvLinkErrorCounters method. + DeviceResetNvLinkErrorCounters []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceResetNvLinkUtilizationCounter holds details about calls to the DeviceResetNvLinkUtilizationCounter method. + DeviceResetNvLinkUtilizationCounter []struct { + // Device is the device argument value. + Device nvml.Device + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // DeviceSetAPIRestriction holds details about calls to the DeviceSetAPIRestriction method. + DeviceSetAPIRestriction []struct { + // Device is the device argument value. + Device nvml.Device + // RestrictedAPI is the restrictedAPI argument value. + RestrictedAPI nvml.RestrictedAPI + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // DeviceSetAccountingMode holds details about calls to the DeviceSetAccountingMode method. + DeviceSetAccountingMode []struct { + // Device is the device argument value. + Device nvml.Device + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // DeviceSetApplicationsClocks holds details about calls to the DeviceSetApplicationsClocks method. + DeviceSetApplicationsClocks []struct { + // Device is the device argument value. + Device nvml.Device + // V1 is the v1 argument value. + V1 uint32 + // V2 is the v2 argument value. + V2 uint32 + } + // DeviceSetAutoBoostedClocksEnabled holds details about calls to the DeviceSetAutoBoostedClocksEnabled method. + DeviceSetAutoBoostedClocksEnabled []struct { + // Device is the device argument value. + Device nvml.Device + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // DeviceSetComputeMode holds details about calls to the DeviceSetComputeMode method. + DeviceSetComputeMode []struct { + // Device is the device argument value. + Device nvml.Device + // ComputeMode is the computeMode argument value. + ComputeMode nvml.ComputeMode + } + // DeviceSetCpuAffinity holds details about calls to the DeviceSetCpuAffinity method. + DeviceSetCpuAffinity []struct { + // Device is the device argument value. + Device nvml.Device + } + // DeviceSetDefaultAutoBoostedClocksEnabled holds details about calls to the DeviceSetDefaultAutoBoostedClocksEnabled method. + DeviceSetDefaultAutoBoostedClocksEnabled []struct { + // Device is the device argument value. + Device nvml.Device + // EnableState is the enableState argument value. + EnableState nvml.EnableState + // V is the v argument value. + V uint32 + } + // DeviceSetDefaultFanSpeed_v2 holds details about calls to the DeviceSetDefaultFanSpeed_v2 method. + DeviceSetDefaultFanSpeed_v2 []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceSetDriverModel holds details about calls to the DeviceSetDriverModel method. + DeviceSetDriverModel []struct { + // Device is the device argument value. + Device nvml.Device + // DriverModel is the driverModel argument value. + DriverModel nvml.DriverModel + // V is the v argument value. + V uint32 + } + // DeviceSetEccMode holds details about calls to the DeviceSetEccMode method. + DeviceSetEccMode []struct { + // Device is the device argument value. + Device nvml.Device + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // DeviceSetFanControlPolicy holds details about calls to the DeviceSetFanControlPolicy method. + DeviceSetFanControlPolicy []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + // FanControlPolicy is the fanControlPolicy argument value. + FanControlPolicy nvml.FanControlPolicy + } + // DeviceSetFanSpeed_v2 holds details about calls to the DeviceSetFanSpeed_v2 method. + DeviceSetFanSpeed_v2 []struct { + // Device is the device argument value. + Device nvml.Device + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // DeviceSetGpcClkVfOffset holds details about calls to the DeviceSetGpcClkVfOffset method. + DeviceSetGpcClkVfOffset []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceSetGpuLockedClocks holds details about calls to the DeviceSetGpuLockedClocks method. + DeviceSetGpuLockedClocks []struct { + // Device is the device argument value. + Device nvml.Device + // V1 is the v1 argument value. + V1 uint32 + // V2 is the v2 argument value. + V2 uint32 + } + // DeviceSetGpuOperationMode holds details about calls to the DeviceSetGpuOperationMode method. + DeviceSetGpuOperationMode []struct { + // Device is the device argument value. + Device nvml.Device + // GpuOperationMode is the gpuOperationMode argument value. + GpuOperationMode nvml.GpuOperationMode + } + // DeviceSetMemClkVfOffset holds details about calls to the DeviceSetMemClkVfOffset method. + DeviceSetMemClkVfOffset []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceSetMemoryLockedClocks holds details about calls to the DeviceSetMemoryLockedClocks method. + DeviceSetMemoryLockedClocks []struct { + // Device is the device argument value. + Device nvml.Device + // V1 is the v1 argument value. + V1 uint32 + // V2 is the v2 argument value. + V2 uint32 + } + // DeviceSetMigMode holds details about calls to the DeviceSetMigMode method. + DeviceSetMigMode []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + } + // DeviceSetNvLinkDeviceLowPowerThreshold holds details about calls to the DeviceSetNvLinkDeviceLowPowerThreshold method. + DeviceSetNvLinkDeviceLowPowerThreshold []struct { + // Device is the device argument value. + Device nvml.Device + // NvLinkPowerThres is the nvLinkPowerThres argument value. + NvLinkPowerThres *nvml.NvLinkPowerThres + } + // DeviceSetNvLinkUtilizationControl holds details about calls to the DeviceSetNvLinkUtilizationControl method. + DeviceSetNvLinkUtilizationControl []struct { + // Device is the device argument value. + Device nvml.Device + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + // NvLinkUtilizationControl is the nvLinkUtilizationControl argument value. + NvLinkUtilizationControl *nvml.NvLinkUtilizationControl + // B is the b argument value. + B bool + } + // DeviceSetPersistenceMode holds details about calls to the DeviceSetPersistenceMode method. + DeviceSetPersistenceMode []struct { + // Device is the device argument value. + Device nvml.Device + // EnableState is the enableState argument value. + EnableState nvml.EnableState + } + // DeviceSetPowerManagementLimit holds details about calls to the DeviceSetPowerManagementLimit method. + DeviceSetPowerManagementLimit []struct { + // Device is the device argument value. + Device nvml.Device + // V is the v argument value. + V uint32 + } + // DeviceSetTemperatureThreshold holds details about calls to the DeviceSetTemperatureThreshold method. + DeviceSetTemperatureThreshold []struct { + // Device is the device argument value. + Device nvml.Device + // TemperatureThresholds is the temperatureThresholds argument value. + TemperatureThresholds nvml.TemperatureThresholds + // N is the n argument value. + N int + } + // DeviceSetVgpuSchedulerState holds details about calls to the DeviceSetVgpuSchedulerState method. + DeviceSetVgpuSchedulerState []struct { + // Device is the device argument value. + Device nvml.Device + // VgpuSchedulerSetState is the vgpuSchedulerSetState argument value. + VgpuSchedulerSetState *nvml.VgpuSchedulerSetState + } + // DeviceSetVirtualizationMode holds details about calls to the DeviceSetVirtualizationMode method. + DeviceSetVirtualizationMode []struct { + // Device is the device argument value. + Device nvml.Device + // GpuVirtualizationMode is the gpuVirtualizationMode argument value. + GpuVirtualizationMode nvml.GpuVirtualizationMode + } + // DeviceValidateInforom holds details about calls to the DeviceValidateInforom method. + DeviceValidateInforom []struct { + // Device is the device argument value. + Device nvml.Device + } + // ErrorString holds details about calls to the ErrorString method. + ErrorString []struct { + // ReturnMoqParam is the returnMoqParam argument value. + ReturnMoqParam nvml.Return + } + // EventSetCreate holds details about calls to the EventSetCreate method. + EventSetCreate []struct { + } + // EventSetFree holds details about calls to the EventSetFree method. + EventSetFree []struct { + // EventSet is the eventSet argument value. + EventSet nvml.EventSet + } + // EventSetWait holds details about calls to the EventSetWait method. + EventSetWait []struct { + // EventSet is the eventSet argument value. + EventSet nvml.EventSet + // V is the v argument value. + V uint32 + } + // GetExcludedDeviceCount holds details about calls to the GetExcludedDeviceCount method. + GetExcludedDeviceCount []struct { + } + // GetExcludedDeviceInfoByIndex holds details about calls to the GetExcludedDeviceInfoByIndex method. + GetExcludedDeviceInfoByIndex []struct { + // N is the n argument value. + N int + } + // GetLibrary holds details about calls to the GetLibrary method. + GetLibrary []struct { + } + // GetVgpuCompatibility holds details about calls to the GetVgpuCompatibility method. + GetVgpuCompatibility []struct { + // VgpuMetadata is the vgpuMetadata argument value. + VgpuMetadata *nvml.VgpuMetadata + // VgpuPgpuMetadata is the vgpuPgpuMetadata argument value. + VgpuPgpuMetadata *nvml.VgpuPgpuMetadata + } + // GetVgpuDriverCapabilities holds details about calls to the GetVgpuDriverCapabilities method. + GetVgpuDriverCapabilities []struct { + // VgpuDriverCapability is the vgpuDriverCapability argument value. + VgpuDriverCapability nvml.VgpuDriverCapability + } + // GetVgpuVersion holds details about calls to the GetVgpuVersion method. + GetVgpuVersion []struct { + } + // GpmMetricsGet holds details about calls to the GpmMetricsGet method. + GpmMetricsGet []struct { + // GpmMetricsGetType is the gpmMetricsGetType argument value. + GpmMetricsGetType *nvml.GpmMetricsGetType + } + // GpmMetricsGetV holds details about calls to the GpmMetricsGetV method. + GpmMetricsGetV []struct { + // GpmMetricsGetType is the gpmMetricsGetType argument value. + GpmMetricsGetType *nvml.GpmMetricsGetType + } + // GpmMigSampleGet holds details about calls to the GpmMigSampleGet method. + GpmMigSampleGet []struct { + // Device is the device argument value. + Device nvml.Device + // N is the n argument value. + N int + // GpmSample is the gpmSample argument value. + GpmSample nvml.GpmSample + } + // GpmQueryDeviceSupport holds details about calls to the GpmQueryDeviceSupport method. + GpmQueryDeviceSupport []struct { + // Device is the device argument value. + Device nvml.Device + } + // GpmQueryDeviceSupportV holds details about calls to the GpmQueryDeviceSupportV method. + GpmQueryDeviceSupportV []struct { + // Device is the device argument value. + Device nvml.Device + } + // GpmSampleAlloc holds details about calls to the GpmSampleAlloc method. + GpmSampleAlloc []struct { + } + // GpmSampleFree holds details about calls to the GpmSampleFree method. + GpmSampleFree []struct { + // GpmSample is the gpmSample argument value. + GpmSample nvml.GpmSample + } + // GpmSampleGet holds details about calls to the GpmSampleGet method. + GpmSampleGet []struct { + // Device is the device argument value. + Device nvml.Device + // GpmSample is the gpmSample argument value. + GpmSample nvml.GpmSample + } + // GpuInstanceCreateComputeInstance holds details about calls to the GpuInstanceCreateComputeInstance method. + GpuInstanceCreateComputeInstance []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + // GpuInstanceCreateComputeInstanceWithPlacement holds details about calls to the GpuInstanceCreateComputeInstanceWithPlacement method. + GpuInstanceCreateComputeInstanceWithPlacement []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + // ComputeInstancePlacement is the computeInstancePlacement argument value. + ComputeInstancePlacement *nvml.ComputeInstancePlacement + } + // GpuInstanceDestroy holds details about calls to the GpuInstanceDestroy method. + GpuInstanceDestroy []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + } + // GpuInstanceGetComputeInstanceById holds details about calls to the GpuInstanceGetComputeInstanceById method. + GpuInstanceGetComputeInstanceById []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + // N is the n argument value. + N int + } + // GpuInstanceGetComputeInstancePossiblePlacements holds details about calls to the GpuInstanceGetComputeInstancePossiblePlacements method. + GpuInstanceGetComputeInstancePossiblePlacements []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + // GpuInstanceGetComputeInstanceProfileInfo holds details about calls to the GpuInstanceGetComputeInstanceProfileInfo method. + GpuInstanceGetComputeInstanceProfileInfo []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // GpuInstanceGetComputeInstanceProfileInfoV holds details about calls to the GpuInstanceGetComputeInstanceProfileInfoV method. + GpuInstanceGetComputeInstanceProfileInfoV []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + // N1 is the n1 argument value. + N1 int + // N2 is the n2 argument value. + N2 int + } + // GpuInstanceGetComputeInstanceRemainingCapacity holds details about calls to the GpuInstanceGetComputeInstanceRemainingCapacity method. + GpuInstanceGetComputeInstanceRemainingCapacity []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + // GpuInstanceGetComputeInstances holds details about calls to the GpuInstanceGetComputeInstances method. + GpuInstanceGetComputeInstances []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + // ComputeInstanceProfileInfo is the computeInstanceProfileInfo argument value. + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + // GpuInstanceGetInfo holds details about calls to the GpuInstanceGetInfo method. + GpuInstanceGetInfo []struct { + // GpuInstance is the gpuInstance argument value. + GpuInstance nvml.GpuInstance + } + // Init holds details about calls to the Init method. + Init []struct { + } + // InitWithFlags holds details about calls to the InitWithFlags method. + InitWithFlags []struct { + // V is the v argument value. + V uint32 + } + // SetVgpuVersion holds details about calls to the SetVgpuVersion method. + SetVgpuVersion []struct { + // VgpuVersion is the vgpuVersion argument value. + VgpuVersion *nvml.VgpuVersion + } + // Shutdown holds details about calls to the Shutdown method. + Shutdown []struct { + } + // SystemGetCudaDriverVersion holds details about calls to the SystemGetCudaDriverVersion method. + SystemGetCudaDriverVersion []struct { + } + // SystemGetCudaDriverVersion_v2 holds details about calls to the SystemGetCudaDriverVersion_v2 method. + SystemGetCudaDriverVersion_v2 []struct { + } + // SystemGetDriverVersion holds details about calls to the SystemGetDriverVersion method. + SystemGetDriverVersion []struct { + } + // SystemGetHicVersion holds details about calls to the SystemGetHicVersion method. + SystemGetHicVersion []struct { + } + // SystemGetNVMLVersion holds details about calls to the SystemGetNVMLVersion method. + SystemGetNVMLVersion []struct { + } + // SystemGetProcessName holds details about calls to the SystemGetProcessName method. + SystemGetProcessName []struct { + // N is the n argument value. + N int + } + // SystemGetTopologyGpuSet holds details about calls to the SystemGetTopologyGpuSet method. + SystemGetTopologyGpuSet []struct { + // N is the n argument value. + N int + } + // UnitGetCount holds details about calls to the UnitGetCount method. + UnitGetCount []struct { + } + // UnitGetDevices holds details about calls to the UnitGetDevices method. + UnitGetDevices []struct { + // Unit is the unit argument value. + Unit nvml.Unit + } + // UnitGetFanSpeedInfo holds details about calls to the UnitGetFanSpeedInfo method. + UnitGetFanSpeedInfo []struct { + // Unit is the unit argument value. + Unit nvml.Unit + } + // UnitGetHandleByIndex holds details about calls to the UnitGetHandleByIndex method. + UnitGetHandleByIndex []struct { + // N is the n argument value. + N int + } + // UnitGetLedState holds details about calls to the UnitGetLedState method. + UnitGetLedState []struct { + // Unit is the unit argument value. + Unit nvml.Unit + } + // UnitGetPsuInfo holds details about calls to the UnitGetPsuInfo method. + UnitGetPsuInfo []struct { + // Unit is the unit argument value. + Unit nvml.Unit + } + // UnitGetTemperature holds details about calls to the UnitGetTemperature method. + UnitGetTemperature []struct { + // Unit is the unit argument value. + Unit nvml.Unit + // N is the n argument value. + N int + } + // UnitGetUnitInfo holds details about calls to the UnitGetUnitInfo method. + UnitGetUnitInfo []struct { + // Unit is the unit argument value. + Unit nvml.Unit + } + // UnitSetLedState holds details about calls to the UnitSetLedState method. + UnitSetLedState []struct { + // Unit is the unit argument value. + Unit nvml.Unit + // LedColor is the ledColor argument value. + LedColor nvml.LedColor + } + // VgpuInstanceClearAccountingPids holds details about calls to the VgpuInstanceClearAccountingPids method. + VgpuInstanceClearAccountingPids []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetAccountingMode holds details about calls to the VgpuInstanceGetAccountingMode method. + VgpuInstanceGetAccountingMode []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetAccountingPids holds details about calls to the VgpuInstanceGetAccountingPids method. + VgpuInstanceGetAccountingPids []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetAccountingStats holds details about calls to the VgpuInstanceGetAccountingStats method. + VgpuInstanceGetAccountingStats []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + // N is the n argument value. + N int + } + // VgpuInstanceGetEccMode holds details about calls to the VgpuInstanceGetEccMode method. + VgpuInstanceGetEccMode []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetEncoderCapacity holds details about calls to the VgpuInstanceGetEncoderCapacity method. + VgpuInstanceGetEncoderCapacity []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetEncoderSessions holds details about calls to the VgpuInstanceGetEncoderSessions method. + VgpuInstanceGetEncoderSessions []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetEncoderStats holds details about calls to the VgpuInstanceGetEncoderStats method. + VgpuInstanceGetEncoderStats []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetFBCSessions holds details about calls to the VgpuInstanceGetFBCSessions method. + VgpuInstanceGetFBCSessions []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetFBCStats holds details about calls to the VgpuInstanceGetFBCStats method. + VgpuInstanceGetFBCStats []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetFbUsage holds details about calls to the VgpuInstanceGetFbUsage method. + VgpuInstanceGetFbUsage []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetFrameRateLimit holds details about calls to the VgpuInstanceGetFrameRateLimit method. + VgpuInstanceGetFrameRateLimit []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetGpuInstanceId holds details about calls to the VgpuInstanceGetGpuInstanceId method. + VgpuInstanceGetGpuInstanceId []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetGpuPciId holds details about calls to the VgpuInstanceGetGpuPciId method. + VgpuInstanceGetGpuPciId []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetLicenseInfo holds details about calls to the VgpuInstanceGetLicenseInfo method. + VgpuInstanceGetLicenseInfo []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetLicenseStatus holds details about calls to the VgpuInstanceGetLicenseStatus method. + VgpuInstanceGetLicenseStatus []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetMdevUUID holds details about calls to the VgpuInstanceGetMdevUUID method. + VgpuInstanceGetMdevUUID []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetMetadata holds details about calls to the VgpuInstanceGetMetadata method. + VgpuInstanceGetMetadata []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetType holds details about calls to the VgpuInstanceGetType method. + VgpuInstanceGetType []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetUUID holds details about calls to the VgpuInstanceGetUUID method. + VgpuInstanceGetUUID []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetVmDriverVersion holds details about calls to the VgpuInstanceGetVmDriverVersion method. + VgpuInstanceGetVmDriverVersion []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceGetVmID holds details about calls to the VgpuInstanceGetVmID method. + VgpuInstanceGetVmID []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + } + // VgpuInstanceSetEncoderCapacity holds details about calls to the VgpuInstanceSetEncoderCapacity method. + VgpuInstanceSetEncoderCapacity []struct { + // VgpuInstance is the vgpuInstance argument value. + VgpuInstance nvml.VgpuInstance + // N is the n argument value. + N int + } + // VgpuTypeGetCapabilities holds details about calls to the VgpuTypeGetCapabilities method. + VgpuTypeGetCapabilities []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + // VgpuCapability is the vgpuCapability argument value. + VgpuCapability nvml.VgpuCapability + } + // VgpuTypeGetClass holds details about calls to the VgpuTypeGetClass method. + VgpuTypeGetClass []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetDeviceID holds details about calls to the VgpuTypeGetDeviceID method. + VgpuTypeGetDeviceID []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetFrameRateLimit holds details about calls to the VgpuTypeGetFrameRateLimit method. + VgpuTypeGetFrameRateLimit []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetFramebufferSize holds details about calls to the VgpuTypeGetFramebufferSize method. + VgpuTypeGetFramebufferSize []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetGpuInstanceProfileId holds details about calls to the VgpuTypeGetGpuInstanceProfileId method. + VgpuTypeGetGpuInstanceProfileId []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetLicense holds details about calls to the VgpuTypeGetLicense method. + VgpuTypeGetLicense []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetMaxInstances holds details about calls to the VgpuTypeGetMaxInstances method. + VgpuTypeGetMaxInstances []struct { + // Device is the device argument value. + Device nvml.Device + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetMaxInstancesPerVm holds details about calls to the VgpuTypeGetMaxInstancesPerVm method. + VgpuTypeGetMaxInstancesPerVm []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetName holds details about calls to the VgpuTypeGetName method. + VgpuTypeGetName []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetNumDisplayHeads holds details about calls to the VgpuTypeGetNumDisplayHeads method. + VgpuTypeGetNumDisplayHeads []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + } + // VgpuTypeGetResolution holds details about calls to the VgpuTypeGetResolution method. + VgpuTypeGetResolution []struct { + // VgpuTypeId is the vgpuTypeId argument value. + VgpuTypeId nvml.VgpuTypeId + // N is the n argument value. + N int + } + } + lockComputeInstanceDestroy sync.RWMutex + lockComputeInstanceGetInfo sync.RWMutex + lockDeviceCcuGetStreamState sync.RWMutex + lockDeviceCcuSetStreamState sync.RWMutex + lockDeviceClearAccountingPids sync.RWMutex + lockDeviceClearCpuAffinity sync.RWMutex + lockDeviceClearEccErrorCounts sync.RWMutex + lockDeviceClearFieldValues sync.RWMutex + lockDeviceCreateGpuInstance sync.RWMutex + lockDeviceCreateGpuInstanceWithPlacement sync.RWMutex + lockDeviceDiscoverGpus sync.RWMutex + lockDeviceFreezeNvLinkUtilizationCounter sync.RWMutex + lockDeviceGetAPIRestriction sync.RWMutex + lockDeviceGetAccountingBufferSize sync.RWMutex + lockDeviceGetAccountingMode sync.RWMutex + lockDeviceGetAccountingPids sync.RWMutex + lockDeviceGetAccountingStats sync.RWMutex + lockDeviceGetActiveVgpus sync.RWMutex + lockDeviceGetAdaptiveClockInfoStatus sync.RWMutex + lockDeviceGetApplicationsClock sync.RWMutex + lockDeviceGetArchitecture sync.RWMutex + lockDeviceGetAttributes sync.RWMutex + lockDeviceGetAutoBoostedClocksEnabled sync.RWMutex + lockDeviceGetBAR1MemoryInfo sync.RWMutex + lockDeviceGetBoardId sync.RWMutex + lockDeviceGetBoardPartNumber sync.RWMutex + lockDeviceGetBrand sync.RWMutex + lockDeviceGetBridgeChipInfo sync.RWMutex + lockDeviceGetBusType sync.RWMutex + lockDeviceGetClkMonStatus sync.RWMutex + lockDeviceGetClock sync.RWMutex + lockDeviceGetClockInfo sync.RWMutex + lockDeviceGetComputeInstanceId sync.RWMutex + lockDeviceGetComputeMode sync.RWMutex + lockDeviceGetComputeRunningProcesses sync.RWMutex + lockDeviceGetCount sync.RWMutex + lockDeviceGetCpuAffinity sync.RWMutex + lockDeviceGetCpuAffinityWithinScope sync.RWMutex + lockDeviceGetCreatableVgpus sync.RWMutex + lockDeviceGetCudaComputeCapability sync.RWMutex + lockDeviceGetCurrPcieLinkGeneration sync.RWMutex + lockDeviceGetCurrPcieLinkWidth sync.RWMutex + lockDeviceGetCurrentClocksThrottleReasons sync.RWMutex + lockDeviceGetDecoderUtilization sync.RWMutex + lockDeviceGetDefaultApplicationsClock sync.RWMutex + lockDeviceGetDefaultEccMode sync.RWMutex + lockDeviceGetDetailedEccErrors sync.RWMutex + lockDeviceGetDeviceHandleFromMigDeviceHandle sync.RWMutex + lockDeviceGetDisplayActive sync.RWMutex + lockDeviceGetDisplayMode sync.RWMutex + lockDeviceGetDriverModel sync.RWMutex + lockDeviceGetDynamicPstatesInfo sync.RWMutex + lockDeviceGetEccMode sync.RWMutex + lockDeviceGetEncoderCapacity sync.RWMutex + lockDeviceGetEncoderSessions sync.RWMutex + lockDeviceGetEncoderStats sync.RWMutex + lockDeviceGetEncoderUtilization sync.RWMutex + lockDeviceGetEnforcedPowerLimit sync.RWMutex + lockDeviceGetFBCSessions sync.RWMutex + lockDeviceGetFBCStats sync.RWMutex + lockDeviceGetFanControlPolicy_v2 sync.RWMutex + lockDeviceGetFanSpeed sync.RWMutex + lockDeviceGetFanSpeed_v2 sync.RWMutex + lockDeviceGetFieldValues sync.RWMutex + lockDeviceGetGpcClkMinMaxVfOffset sync.RWMutex + lockDeviceGetGpcClkVfOffset sync.RWMutex + lockDeviceGetGpuFabricInfo sync.RWMutex + lockDeviceGetGpuInstanceById sync.RWMutex + lockDeviceGetGpuInstanceId sync.RWMutex + lockDeviceGetGpuInstancePossiblePlacements sync.RWMutex + lockDeviceGetGpuInstanceProfileInfo sync.RWMutex + lockDeviceGetGpuInstanceProfileInfoV sync.RWMutex + lockDeviceGetGpuInstanceRemainingCapacity sync.RWMutex + lockDeviceGetGpuInstances sync.RWMutex + lockDeviceGetGpuMaxPcieLinkGeneration sync.RWMutex + lockDeviceGetGpuOperationMode sync.RWMutex + lockDeviceGetGraphicsRunningProcesses sync.RWMutex + lockDeviceGetGridLicensableFeatures sync.RWMutex + lockDeviceGetGspFirmwareMode sync.RWMutex + lockDeviceGetGspFirmwareVersion sync.RWMutex + lockDeviceGetHandleByIndex sync.RWMutex + lockDeviceGetHandleByPciBusId sync.RWMutex + lockDeviceGetHandleBySerial sync.RWMutex + lockDeviceGetHandleByUUID sync.RWMutex + lockDeviceGetHostVgpuMode sync.RWMutex + lockDeviceGetIndex sync.RWMutex + lockDeviceGetInforomConfigurationChecksum sync.RWMutex + lockDeviceGetInforomImageVersion sync.RWMutex + lockDeviceGetInforomVersion sync.RWMutex + lockDeviceGetIrqNum sync.RWMutex + lockDeviceGetMPSComputeRunningProcesses sync.RWMutex + lockDeviceGetMaxClockInfo sync.RWMutex + lockDeviceGetMaxCustomerBoostClock sync.RWMutex + lockDeviceGetMaxMigDeviceCount sync.RWMutex + lockDeviceGetMaxPcieLinkGeneration sync.RWMutex + lockDeviceGetMaxPcieLinkWidth sync.RWMutex + lockDeviceGetMemClkMinMaxVfOffset sync.RWMutex + lockDeviceGetMemClkVfOffset sync.RWMutex + lockDeviceGetMemoryAffinity sync.RWMutex + lockDeviceGetMemoryBusWidth sync.RWMutex + lockDeviceGetMemoryErrorCounter sync.RWMutex + lockDeviceGetMemoryInfo sync.RWMutex + lockDeviceGetMemoryInfo_v2 sync.RWMutex + lockDeviceGetMigDeviceHandleByIndex sync.RWMutex + lockDeviceGetMigMode sync.RWMutex + lockDeviceGetMinMaxClockOfPState sync.RWMutex + lockDeviceGetMinMaxFanSpeed sync.RWMutex + lockDeviceGetMinorNumber sync.RWMutex + lockDeviceGetMultiGpuBoard sync.RWMutex + lockDeviceGetName sync.RWMutex + lockDeviceGetNumFans sync.RWMutex + lockDeviceGetNumGpuCores sync.RWMutex + lockDeviceGetNvLinkCapability sync.RWMutex + lockDeviceGetNvLinkErrorCounter sync.RWMutex + lockDeviceGetNvLinkRemoteDeviceType sync.RWMutex + lockDeviceGetNvLinkRemotePciInfo sync.RWMutex + lockDeviceGetNvLinkState sync.RWMutex + lockDeviceGetNvLinkUtilizationControl sync.RWMutex + lockDeviceGetNvLinkUtilizationCounter sync.RWMutex + lockDeviceGetNvLinkVersion sync.RWMutex + lockDeviceGetP2PStatus sync.RWMutex + lockDeviceGetPciInfo sync.RWMutex + lockDeviceGetPcieLinkMaxSpeed sync.RWMutex + lockDeviceGetPcieReplayCounter sync.RWMutex + lockDeviceGetPcieSpeed sync.RWMutex + lockDeviceGetPcieThroughput sync.RWMutex + lockDeviceGetPerformanceState sync.RWMutex + lockDeviceGetPersistenceMode sync.RWMutex + lockDeviceGetPgpuMetadataString sync.RWMutex + lockDeviceGetPowerManagementDefaultLimit sync.RWMutex + lockDeviceGetPowerManagementLimit sync.RWMutex + lockDeviceGetPowerManagementLimitConstraints sync.RWMutex + lockDeviceGetPowerManagementMode sync.RWMutex + lockDeviceGetPowerSource sync.RWMutex + lockDeviceGetPowerState sync.RWMutex + lockDeviceGetPowerUsage sync.RWMutex + lockDeviceGetProcessUtilization sync.RWMutex + lockDeviceGetRemappedRows sync.RWMutex + lockDeviceGetRetiredPages sync.RWMutex + lockDeviceGetRetiredPagesPendingStatus sync.RWMutex + lockDeviceGetRetiredPages_v2 sync.RWMutex + lockDeviceGetRowRemapperHistogram sync.RWMutex + lockDeviceGetSamples sync.RWMutex + lockDeviceGetSerial sync.RWMutex + lockDeviceGetSupportedClocksThrottleReasons sync.RWMutex + lockDeviceGetSupportedEventTypes sync.RWMutex + lockDeviceGetSupportedGraphicsClocks sync.RWMutex + lockDeviceGetSupportedMemoryClocks sync.RWMutex + lockDeviceGetSupportedPerformanceStates sync.RWMutex + lockDeviceGetSupportedVgpus sync.RWMutex + lockDeviceGetTargetFanSpeed sync.RWMutex + lockDeviceGetTemperature sync.RWMutex + lockDeviceGetTemperatureThreshold sync.RWMutex + lockDeviceGetThermalSettings sync.RWMutex + lockDeviceGetTopologyCommonAncestor sync.RWMutex + lockDeviceGetTopologyNearestGpus sync.RWMutex + lockDeviceGetTotalEccErrors sync.RWMutex + lockDeviceGetTotalEnergyConsumption sync.RWMutex + lockDeviceGetUUID sync.RWMutex + lockDeviceGetUtilizationRates sync.RWMutex + lockDeviceGetVbiosVersion sync.RWMutex + lockDeviceGetVgpuCapabilities sync.RWMutex + lockDeviceGetVgpuMetadata sync.RWMutex + lockDeviceGetVgpuProcessUtilization sync.RWMutex + lockDeviceGetVgpuSchedulerCapabilities sync.RWMutex + lockDeviceGetVgpuSchedulerLog sync.RWMutex + lockDeviceGetVgpuSchedulerState sync.RWMutex + lockDeviceGetVgpuUtilization sync.RWMutex + lockDeviceGetViolationStatus sync.RWMutex + lockDeviceGetVirtualizationMode sync.RWMutex + lockDeviceIsMigDeviceHandle sync.RWMutex + lockDeviceModifyDrainState sync.RWMutex + lockDeviceOnSameBoard sync.RWMutex + lockDeviceQueryDrainState sync.RWMutex + lockDeviceRegisterEvents sync.RWMutex + lockDeviceRemoveGpu sync.RWMutex + lockDeviceRemoveGpu_v2 sync.RWMutex + lockDeviceResetApplicationsClocks sync.RWMutex + lockDeviceResetGpuLockedClocks sync.RWMutex + lockDeviceResetMemoryLockedClocks sync.RWMutex + lockDeviceResetNvLinkErrorCounters sync.RWMutex + lockDeviceResetNvLinkUtilizationCounter sync.RWMutex + lockDeviceSetAPIRestriction sync.RWMutex + lockDeviceSetAccountingMode sync.RWMutex + lockDeviceSetApplicationsClocks sync.RWMutex + lockDeviceSetAutoBoostedClocksEnabled sync.RWMutex + lockDeviceSetComputeMode sync.RWMutex + lockDeviceSetCpuAffinity sync.RWMutex + lockDeviceSetDefaultAutoBoostedClocksEnabled sync.RWMutex + lockDeviceSetDefaultFanSpeed_v2 sync.RWMutex + lockDeviceSetDriverModel sync.RWMutex + lockDeviceSetEccMode sync.RWMutex + lockDeviceSetFanControlPolicy sync.RWMutex + lockDeviceSetFanSpeed_v2 sync.RWMutex + lockDeviceSetGpcClkVfOffset sync.RWMutex + lockDeviceSetGpuLockedClocks sync.RWMutex + lockDeviceSetGpuOperationMode sync.RWMutex + lockDeviceSetMemClkVfOffset sync.RWMutex + lockDeviceSetMemoryLockedClocks sync.RWMutex + lockDeviceSetMigMode sync.RWMutex + lockDeviceSetNvLinkDeviceLowPowerThreshold sync.RWMutex + lockDeviceSetNvLinkUtilizationControl sync.RWMutex + lockDeviceSetPersistenceMode sync.RWMutex + lockDeviceSetPowerManagementLimit sync.RWMutex + lockDeviceSetTemperatureThreshold sync.RWMutex + lockDeviceSetVgpuSchedulerState sync.RWMutex + lockDeviceSetVirtualizationMode sync.RWMutex + lockDeviceValidateInforom sync.RWMutex + lockErrorString sync.RWMutex + lockEventSetCreate sync.RWMutex + lockEventSetFree sync.RWMutex + lockEventSetWait sync.RWMutex + lockGetExcludedDeviceCount sync.RWMutex + lockGetExcludedDeviceInfoByIndex sync.RWMutex + lockGetLibrary sync.RWMutex + lockGetVgpuCompatibility sync.RWMutex + lockGetVgpuDriverCapabilities sync.RWMutex + lockGetVgpuVersion sync.RWMutex + lockGpmMetricsGet sync.RWMutex + lockGpmMetricsGetV sync.RWMutex + lockGpmMigSampleGet sync.RWMutex + lockGpmQueryDeviceSupport sync.RWMutex + lockGpmQueryDeviceSupportV sync.RWMutex + lockGpmSampleAlloc sync.RWMutex + lockGpmSampleFree sync.RWMutex + lockGpmSampleGet sync.RWMutex + lockGpuInstanceCreateComputeInstance sync.RWMutex + lockGpuInstanceCreateComputeInstanceWithPlacement sync.RWMutex + lockGpuInstanceDestroy sync.RWMutex + lockGpuInstanceGetComputeInstanceById sync.RWMutex + lockGpuInstanceGetComputeInstancePossiblePlacements sync.RWMutex + lockGpuInstanceGetComputeInstanceProfileInfo sync.RWMutex + lockGpuInstanceGetComputeInstanceProfileInfoV sync.RWMutex + lockGpuInstanceGetComputeInstanceRemainingCapacity sync.RWMutex + lockGpuInstanceGetComputeInstances sync.RWMutex + lockGpuInstanceGetInfo sync.RWMutex + lockInit sync.RWMutex + lockInitWithFlags sync.RWMutex + lockSetVgpuVersion sync.RWMutex + lockShutdown sync.RWMutex + lockSystemGetCudaDriverVersion sync.RWMutex + lockSystemGetCudaDriverVersion_v2 sync.RWMutex + lockSystemGetDriverVersion sync.RWMutex + lockSystemGetHicVersion sync.RWMutex + lockSystemGetNVMLVersion sync.RWMutex + lockSystemGetProcessName sync.RWMutex + lockSystemGetTopologyGpuSet sync.RWMutex + lockUnitGetCount sync.RWMutex + lockUnitGetDevices sync.RWMutex + lockUnitGetFanSpeedInfo sync.RWMutex + lockUnitGetHandleByIndex sync.RWMutex + lockUnitGetLedState sync.RWMutex + lockUnitGetPsuInfo sync.RWMutex + lockUnitGetTemperature sync.RWMutex + lockUnitGetUnitInfo sync.RWMutex + lockUnitSetLedState sync.RWMutex + lockVgpuInstanceClearAccountingPids sync.RWMutex + lockVgpuInstanceGetAccountingMode sync.RWMutex + lockVgpuInstanceGetAccountingPids sync.RWMutex + lockVgpuInstanceGetAccountingStats sync.RWMutex + lockVgpuInstanceGetEccMode sync.RWMutex + lockVgpuInstanceGetEncoderCapacity sync.RWMutex + lockVgpuInstanceGetEncoderSessions sync.RWMutex + lockVgpuInstanceGetEncoderStats sync.RWMutex + lockVgpuInstanceGetFBCSessions sync.RWMutex + lockVgpuInstanceGetFBCStats sync.RWMutex + lockVgpuInstanceGetFbUsage sync.RWMutex + lockVgpuInstanceGetFrameRateLimit sync.RWMutex + lockVgpuInstanceGetGpuInstanceId sync.RWMutex + lockVgpuInstanceGetGpuPciId sync.RWMutex + lockVgpuInstanceGetLicenseInfo sync.RWMutex + lockVgpuInstanceGetLicenseStatus sync.RWMutex + lockVgpuInstanceGetMdevUUID sync.RWMutex + lockVgpuInstanceGetMetadata sync.RWMutex + lockVgpuInstanceGetType sync.RWMutex + lockVgpuInstanceGetUUID sync.RWMutex + lockVgpuInstanceGetVmDriverVersion sync.RWMutex + lockVgpuInstanceGetVmID sync.RWMutex + lockVgpuInstanceSetEncoderCapacity sync.RWMutex + lockVgpuTypeGetCapabilities sync.RWMutex + lockVgpuTypeGetClass sync.RWMutex + lockVgpuTypeGetDeviceID sync.RWMutex + lockVgpuTypeGetFrameRateLimit sync.RWMutex + lockVgpuTypeGetFramebufferSize sync.RWMutex + lockVgpuTypeGetGpuInstanceProfileId sync.RWMutex + lockVgpuTypeGetLicense sync.RWMutex + lockVgpuTypeGetMaxInstances sync.RWMutex + lockVgpuTypeGetMaxInstancesPerVm sync.RWMutex + lockVgpuTypeGetName sync.RWMutex + lockVgpuTypeGetNumDisplayHeads sync.RWMutex + lockVgpuTypeGetResolution sync.RWMutex +} + +// ComputeInstanceDestroy calls ComputeInstanceDestroyFunc. +func (mock *Interface) ComputeInstanceDestroy(computeInstance nvml.ComputeInstance) nvml.Return { + if mock.ComputeInstanceDestroyFunc == nil { + panic("Interface.ComputeInstanceDestroyFunc: method is nil but Interface.ComputeInstanceDestroy was just called") + } + callInfo := struct { + ComputeInstance nvml.ComputeInstance + }{ + ComputeInstance: computeInstance, + } + mock.lockComputeInstanceDestroy.Lock() + mock.calls.ComputeInstanceDestroy = append(mock.calls.ComputeInstanceDestroy, callInfo) + mock.lockComputeInstanceDestroy.Unlock() + return mock.ComputeInstanceDestroyFunc(computeInstance) +} + +// ComputeInstanceDestroyCalls gets all the calls that were made to ComputeInstanceDestroy. +// Check the length with: +// +// len(mockedInterface.ComputeInstanceDestroyCalls()) +func (mock *Interface) ComputeInstanceDestroyCalls() []struct { + ComputeInstance nvml.ComputeInstance +} { + var calls []struct { + ComputeInstance nvml.ComputeInstance + } + mock.lockComputeInstanceDestroy.RLock() + calls = mock.calls.ComputeInstanceDestroy + mock.lockComputeInstanceDestroy.RUnlock() + return calls +} + +// ComputeInstanceGetInfo calls ComputeInstanceGetInfoFunc. +func (mock *Interface) ComputeInstanceGetInfo(computeInstance nvml.ComputeInstance) (nvml.ComputeInstanceInfo, nvml.Return) { + if mock.ComputeInstanceGetInfoFunc == nil { + panic("Interface.ComputeInstanceGetInfoFunc: method is nil but Interface.ComputeInstanceGetInfo was just called") + } + callInfo := struct { + ComputeInstance nvml.ComputeInstance + }{ + ComputeInstance: computeInstance, + } + mock.lockComputeInstanceGetInfo.Lock() + mock.calls.ComputeInstanceGetInfo = append(mock.calls.ComputeInstanceGetInfo, callInfo) + mock.lockComputeInstanceGetInfo.Unlock() + return mock.ComputeInstanceGetInfoFunc(computeInstance) +} + +// ComputeInstanceGetInfoCalls gets all the calls that were made to ComputeInstanceGetInfo. +// Check the length with: +// +// len(mockedInterface.ComputeInstanceGetInfoCalls()) +func (mock *Interface) ComputeInstanceGetInfoCalls() []struct { + ComputeInstance nvml.ComputeInstance +} { + var calls []struct { + ComputeInstance nvml.ComputeInstance + } + mock.lockComputeInstanceGetInfo.RLock() + calls = mock.calls.ComputeInstanceGetInfo + mock.lockComputeInstanceGetInfo.RUnlock() + return calls +} + +// DeviceCcuGetStreamState calls DeviceCcuGetStreamStateFunc. +func (mock *Interface) DeviceCcuGetStreamState(device nvml.Device) (int, nvml.Return) { + if mock.DeviceCcuGetStreamStateFunc == nil { + panic("Interface.DeviceCcuGetStreamStateFunc: method is nil but Interface.DeviceCcuGetStreamState was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceCcuGetStreamState.Lock() + mock.calls.DeviceCcuGetStreamState = append(mock.calls.DeviceCcuGetStreamState, callInfo) + mock.lockDeviceCcuGetStreamState.Unlock() + return mock.DeviceCcuGetStreamStateFunc(device) +} + +// DeviceCcuGetStreamStateCalls gets all the calls that were made to DeviceCcuGetStreamState. +// Check the length with: +// +// len(mockedInterface.DeviceCcuGetStreamStateCalls()) +func (mock *Interface) DeviceCcuGetStreamStateCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceCcuGetStreamState.RLock() + calls = mock.calls.DeviceCcuGetStreamState + mock.lockDeviceCcuGetStreamState.RUnlock() + return calls +} + +// DeviceCcuSetStreamState calls DeviceCcuSetStreamStateFunc. +func (mock *Interface) DeviceCcuSetStreamState(device nvml.Device, n int) nvml.Return { + if mock.DeviceCcuSetStreamStateFunc == nil { + panic("Interface.DeviceCcuSetStreamStateFunc: method is nil but Interface.DeviceCcuSetStreamState was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceCcuSetStreamState.Lock() + mock.calls.DeviceCcuSetStreamState = append(mock.calls.DeviceCcuSetStreamState, callInfo) + mock.lockDeviceCcuSetStreamState.Unlock() + return mock.DeviceCcuSetStreamStateFunc(device, n) +} + +// DeviceCcuSetStreamStateCalls gets all the calls that were made to DeviceCcuSetStreamState. +// Check the length with: +// +// len(mockedInterface.DeviceCcuSetStreamStateCalls()) +func (mock *Interface) DeviceCcuSetStreamStateCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceCcuSetStreamState.RLock() + calls = mock.calls.DeviceCcuSetStreamState + mock.lockDeviceCcuSetStreamState.RUnlock() + return calls +} + +// DeviceClearAccountingPids calls DeviceClearAccountingPidsFunc. +func (mock *Interface) DeviceClearAccountingPids(device nvml.Device) nvml.Return { + if mock.DeviceClearAccountingPidsFunc == nil { + panic("Interface.DeviceClearAccountingPidsFunc: method is nil but Interface.DeviceClearAccountingPids was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceClearAccountingPids.Lock() + mock.calls.DeviceClearAccountingPids = append(mock.calls.DeviceClearAccountingPids, callInfo) + mock.lockDeviceClearAccountingPids.Unlock() + return mock.DeviceClearAccountingPidsFunc(device) +} + +// DeviceClearAccountingPidsCalls gets all the calls that were made to DeviceClearAccountingPids. +// Check the length with: +// +// len(mockedInterface.DeviceClearAccountingPidsCalls()) +func (mock *Interface) DeviceClearAccountingPidsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceClearAccountingPids.RLock() + calls = mock.calls.DeviceClearAccountingPids + mock.lockDeviceClearAccountingPids.RUnlock() + return calls +} + +// DeviceClearCpuAffinity calls DeviceClearCpuAffinityFunc. +func (mock *Interface) DeviceClearCpuAffinity(device nvml.Device) nvml.Return { + if mock.DeviceClearCpuAffinityFunc == nil { + panic("Interface.DeviceClearCpuAffinityFunc: method is nil but Interface.DeviceClearCpuAffinity was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceClearCpuAffinity.Lock() + mock.calls.DeviceClearCpuAffinity = append(mock.calls.DeviceClearCpuAffinity, callInfo) + mock.lockDeviceClearCpuAffinity.Unlock() + return mock.DeviceClearCpuAffinityFunc(device) +} + +// DeviceClearCpuAffinityCalls gets all the calls that were made to DeviceClearCpuAffinity. +// Check the length with: +// +// len(mockedInterface.DeviceClearCpuAffinityCalls()) +func (mock *Interface) DeviceClearCpuAffinityCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceClearCpuAffinity.RLock() + calls = mock.calls.DeviceClearCpuAffinity + mock.lockDeviceClearCpuAffinity.RUnlock() + return calls +} + +// DeviceClearEccErrorCounts calls DeviceClearEccErrorCountsFunc. +func (mock *Interface) DeviceClearEccErrorCounts(device nvml.Device, eccCounterType nvml.EccCounterType) nvml.Return { + if mock.DeviceClearEccErrorCountsFunc == nil { + panic("Interface.DeviceClearEccErrorCountsFunc: method is nil but Interface.DeviceClearEccErrorCounts was just called") + } + callInfo := struct { + Device nvml.Device + EccCounterType nvml.EccCounterType + }{ + Device: device, + EccCounterType: eccCounterType, + } + mock.lockDeviceClearEccErrorCounts.Lock() + mock.calls.DeviceClearEccErrorCounts = append(mock.calls.DeviceClearEccErrorCounts, callInfo) + mock.lockDeviceClearEccErrorCounts.Unlock() + return mock.DeviceClearEccErrorCountsFunc(device, eccCounterType) +} + +// DeviceClearEccErrorCountsCalls gets all the calls that were made to DeviceClearEccErrorCounts. +// Check the length with: +// +// len(mockedInterface.DeviceClearEccErrorCountsCalls()) +func (mock *Interface) DeviceClearEccErrorCountsCalls() []struct { + Device nvml.Device + EccCounterType nvml.EccCounterType +} { + var calls []struct { + Device nvml.Device + EccCounterType nvml.EccCounterType + } + mock.lockDeviceClearEccErrorCounts.RLock() + calls = mock.calls.DeviceClearEccErrorCounts + mock.lockDeviceClearEccErrorCounts.RUnlock() + return calls +} + +// DeviceClearFieldValues calls DeviceClearFieldValuesFunc. +func (mock *Interface) DeviceClearFieldValues(device nvml.Device, fieldValues []nvml.FieldValue) nvml.Return { + if mock.DeviceClearFieldValuesFunc == nil { + panic("Interface.DeviceClearFieldValuesFunc: method is nil but Interface.DeviceClearFieldValues was just called") + } + callInfo := struct { + Device nvml.Device + FieldValues []nvml.FieldValue + }{ + Device: device, + FieldValues: fieldValues, + } + mock.lockDeviceClearFieldValues.Lock() + mock.calls.DeviceClearFieldValues = append(mock.calls.DeviceClearFieldValues, callInfo) + mock.lockDeviceClearFieldValues.Unlock() + return mock.DeviceClearFieldValuesFunc(device, fieldValues) +} + +// DeviceClearFieldValuesCalls gets all the calls that were made to DeviceClearFieldValues. +// Check the length with: +// +// len(mockedInterface.DeviceClearFieldValuesCalls()) +func (mock *Interface) DeviceClearFieldValuesCalls() []struct { + Device nvml.Device + FieldValues []nvml.FieldValue +} { + var calls []struct { + Device nvml.Device + FieldValues []nvml.FieldValue + } + mock.lockDeviceClearFieldValues.RLock() + calls = mock.calls.DeviceClearFieldValues + mock.lockDeviceClearFieldValues.RUnlock() + return calls +} + +// DeviceCreateGpuInstance calls DeviceCreateGpuInstanceFunc. +func (mock *Interface) DeviceCreateGpuInstance(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (nvml.GpuInstance, nvml.Return) { + if mock.DeviceCreateGpuInstanceFunc == nil { + panic("Interface.DeviceCreateGpuInstanceFunc: method is nil but Interface.DeviceCreateGpuInstance was just called") + } + callInfo := struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + }{ + Device: device, + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + } + mock.lockDeviceCreateGpuInstance.Lock() + mock.calls.DeviceCreateGpuInstance = append(mock.calls.DeviceCreateGpuInstance, callInfo) + mock.lockDeviceCreateGpuInstance.Unlock() + return mock.DeviceCreateGpuInstanceFunc(device, gpuInstanceProfileInfo) +} + +// DeviceCreateGpuInstanceCalls gets all the calls that were made to DeviceCreateGpuInstance. +// Check the length with: +// +// len(mockedInterface.DeviceCreateGpuInstanceCalls()) +func (mock *Interface) DeviceCreateGpuInstanceCalls() []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo +} { + var calls []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + mock.lockDeviceCreateGpuInstance.RLock() + calls = mock.calls.DeviceCreateGpuInstance + mock.lockDeviceCreateGpuInstance.RUnlock() + return calls +} + +// DeviceCreateGpuInstanceWithPlacement calls DeviceCreateGpuInstanceWithPlacementFunc. +func (mock *Interface) DeviceCreateGpuInstanceWithPlacement(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo, gpuInstancePlacement *nvml.GpuInstancePlacement) (nvml.GpuInstance, nvml.Return) { + if mock.DeviceCreateGpuInstanceWithPlacementFunc == nil { + panic("Interface.DeviceCreateGpuInstanceWithPlacementFunc: method is nil but Interface.DeviceCreateGpuInstanceWithPlacement was just called") + } + callInfo := struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + GpuInstancePlacement *nvml.GpuInstancePlacement + }{ + Device: device, + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + GpuInstancePlacement: gpuInstancePlacement, + } + mock.lockDeviceCreateGpuInstanceWithPlacement.Lock() + mock.calls.DeviceCreateGpuInstanceWithPlacement = append(mock.calls.DeviceCreateGpuInstanceWithPlacement, callInfo) + mock.lockDeviceCreateGpuInstanceWithPlacement.Unlock() + return mock.DeviceCreateGpuInstanceWithPlacementFunc(device, gpuInstanceProfileInfo, gpuInstancePlacement) +} + +// DeviceCreateGpuInstanceWithPlacementCalls gets all the calls that were made to DeviceCreateGpuInstanceWithPlacement. +// Check the length with: +// +// len(mockedInterface.DeviceCreateGpuInstanceWithPlacementCalls()) +func (mock *Interface) DeviceCreateGpuInstanceWithPlacementCalls() []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + GpuInstancePlacement *nvml.GpuInstancePlacement +} { + var calls []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + GpuInstancePlacement *nvml.GpuInstancePlacement + } + mock.lockDeviceCreateGpuInstanceWithPlacement.RLock() + calls = mock.calls.DeviceCreateGpuInstanceWithPlacement + mock.lockDeviceCreateGpuInstanceWithPlacement.RUnlock() + return calls +} + +// DeviceDiscoverGpus calls DeviceDiscoverGpusFunc. +func (mock *Interface) DeviceDiscoverGpus() (nvml.PciInfo, nvml.Return) { + if mock.DeviceDiscoverGpusFunc == nil { + panic("Interface.DeviceDiscoverGpusFunc: method is nil but Interface.DeviceDiscoverGpus was just called") + } + callInfo := struct { + }{} + mock.lockDeviceDiscoverGpus.Lock() + mock.calls.DeviceDiscoverGpus = append(mock.calls.DeviceDiscoverGpus, callInfo) + mock.lockDeviceDiscoverGpus.Unlock() + return mock.DeviceDiscoverGpusFunc() +} + +// DeviceDiscoverGpusCalls gets all the calls that were made to DeviceDiscoverGpus. +// Check the length with: +// +// len(mockedInterface.DeviceDiscoverGpusCalls()) +func (mock *Interface) DeviceDiscoverGpusCalls() []struct { +} { + var calls []struct { + } + mock.lockDeviceDiscoverGpus.RLock() + calls = mock.calls.DeviceDiscoverGpus + mock.lockDeviceDiscoverGpus.RUnlock() + return calls +} + +// DeviceFreezeNvLinkUtilizationCounter calls DeviceFreezeNvLinkUtilizationCounterFunc. +func (mock *Interface) DeviceFreezeNvLinkUtilizationCounter(device nvml.Device, n1 int, n2 int, enableState nvml.EnableState) nvml.Return { + if mock.DeviceFreezeNvLinkUtilizationCounterFunc == nil { + panic("Interface.DeviceFreezeNvLinkUtilizationCounterFunc: method is nil but Interface.DeviceFreezeNvLinkUtilizationCounter was just called") + } + callInfo := struct { + Device nvml.Device + N1 int + N2 int + EnableState nvml.EnableState + }{ + Device: device, + N1: n1, + N2: n2, + EnableState: enableState, + } + mock.lockDeviceFreezeNvLinkUtilizationCounter.Lock() + mock.calls.DeviceFreezeNvLinkUtilizationCounter = append(mock.calls.DeviceFreezeNvLinkUtilizationCounter, callInfo) + mock.lockDeviceFreezeNvLinkUtilizationCounter.Unlock() + return mock.DeviceFreezeNvLinkUtilizationCounterFunc(device, n1, n2, enableState) +} + +// DeviceFreezeNvLinkUtilizationCounterCalls gets all the calls that were made to DeviceFreezeNvLinkUtilizationCounter. +// Check the length with: +// +// len(mockedInterface.DeviceFreezeNvLinkUtilizationCounterCalls()) +func (mock *Interface) DeviceFreezeNvLinkUtilizationCounterCalls() []struct { + Device nvml.Device + N1 int + N2 int + EnableState nvml.EnableState +} { + var calls []struct { + Device nvml.Device + N1 int + N2 int + EnableState nvml.EnableState + } + mock.lockDeviceFreezeNvLinkUtilizationCounter.RLock() + calls = mock.calls.DeviceFreezeNvLinkUtilizationCounter + mock.lockDeviceFreezeNvLinkUtilizationCounter.RUnlock() + return calls +} + +// DeviceGetAPIRestriction calls DeviceGetAPIRestrictionFunc. +func (mock *Interface) DeviceGetAPIRestriction(device nvml.Device, restrictedAPI nvml.RestrictedAPI) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetAPIRestrictionFunc == nil { + panic("Interface.DeviceGetAPIRestrictionFunc: method is nil but Interface.DeviceGetAPIRestriction was just called") + } + callInfo := struct { + Device nvml.Device + RestrictedAPI nvml.RestrictedAPI + }{ + Device: device, + RestrictedAPI: restrictedAPI, + } + mock.lockDeviceGetAPIRestriction.Lock() + mock.calls.DeviceGetAPIRestriction = append(mock.calls.DeviceGetAPIRestriction, callInfo) + mock.lockDeviceGetAPIRestriction.Unlock() + return mock.DeviceGetAPIRestrictionFunc(device, restrictedAPI) +} + +// DeviceGetAPIRestrictionCalls gets all the calls that were made to DeviceGetAPIRestriction. +// Check the length with: +// +// len(mockedInterface.DeviceGetAPIRestrictionCalls()) +func (mock *Interface) DeviceGetAPIRestrictionCalls() []struct { + Device nvml.Device + RestrictedAPI nvml.RestrictedAPI +} { + var calls []struct { + Device nvml.Device + RestrictedAPI nvml.RestrictedAPI + } + mock.lockDeviceGetAPIRestriction.RLock() + calls = mock.calls.DeviceGetAPIRestriction + mock.lockDeviceGetAPIRestriction.RUnlock() + return calls +} + +// DeviceGetAccountingBufferSize calls DeviceGetAccountingBufferSizeFunc. +func (mock *Interface) DeviceGetAccountingBufferSize(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetAccountingBufferSizeFunc == nil { + panic("Interface.DeviceGetAccountingBufferSizeFunc: method is nil but Interface.DeviceGetAccountingBufferSize was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetAccountingBufferSize.Lock() + mock.calls.DeviceGetAccountingBufferSize = append(mock.calls.DeviceGetAccountingBufferSize, callInfo) + mock.lockDeviceGetAccountingBufferSize.Unlock() + return mock.DeviceGetAccountingBufferSizeFunc(device) +} + +// DeviceGetAccountingBufferSizeCalls gets all the calls that were made to DeviceGetAccountingBufferSize. +// Check the length with: +// +// len(mockedInterface.DeviceGetAccountingBufferSizeCalls()) +func (mock *Interface) DeviceGetAccountingBufferSizeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetAccountingBufferSize.RLock() + calls = mock.calls.DeviceGetAccountingBufferSize + mock.lockDeviceGetAccountingBufferSize.RUnlock() + return calls +} + +// DeviceGetAccountingMode calls DeviceGetAccountingModeFunc. +func (mock *Interface) DeviceGetAccountingMode(device nvml.Device) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetAccountingModeFunc == nil { + panic("Interface.DeviceGetAccountingModeFunc: method is nil but Interface.DeviceGetAccountingMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetAccountingMode.Lock() + mock.calls.DeviceGetAccountingMode = append(mock.calls.DeviceGetAccountingMode, callInfo) + mock.lockDeviceGetAccountingMode.Unlock() + return mock.DeviceGetAccountingModeFunc(device) +} + +// DeviceGetAccountingModeCalls gets all the calls that were made to DeviceGetAccountingMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetAccountingModeCalls()) +func (mock *Interface) DeviceGetAccountingModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetAccountingMode.RLock() + calls = mock.calls.DeviceGetAccountingMode + mock.lockDeviceGetAccountingMode.RUnlock() + return calls +} + +// DeviceGetAccountingPids calls DeviceGetAccountingPidsFunc. +func (mock *Interface) DeviceGetAccountingPids(device nvml.Device) ([]int, nvml.Return) { + if mock.DeviceGetAccountingPidsFunc == nil { + panic("Interface.DeviceGetAccountingPidsFunc: method is nil but Interface.DeviceGetAccountingPids was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetAccountingPids.Lock() + mock.calls.DeviceGetAccountingPids = append(mock.calls.DeviceGetAccountingPids, callInfo) + mock.lockDeviceGetAccountingPids.Unlock() + return mock.DeviceGetAccountingPidsFunc(device) +} + +// DeviceGetAccountingPidsCalls gets all the calls that were made to DeviceGetAccountingPids. +// Check the length with: +// +// len(mockedInterface.DeviceGetAccountingPidsCalls()) +func (mock *Interface) DeviceGetAccountingPidsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetAccountingPids.RLock() + calls = mock.calls.DeviceGetAccountingPids + mock.lockDeviceGetAccountingPids.RUnlock() + return calls +} + +// DeviceGetAccountingStats calls DeviceGetAccountingStatsFunc. +func (mock *Interface) DeviceGetAccountingStats(device nvml.Device, v uint32) (nvml.AccountingStats, nvml.Return) { + if mock.DeviceGetAccountingStatsFunc == nil { + panic("Interface.DeviceGetAccountingStatsFunc: method is nil but Interface.DeviceGetAccountingStats was just called") + } + callInfo := struct { + Device nvml.Device + V uint32 + }{ + Device: device, + V: v, + } + mock.lockDeviceGetAccountingStats.Lock() + mock.calls.DeviceGetAccountingStats = append(mock.calls.DeviceGetAccountingStats, callInfo) + mock.lockDeviceGetAccountingStats.Unlock() + return mock.DeviceGetAccountingStatsFunc(device, v) +} + +// DeviceGetAccountingStatsCalls gets all the calls that were made to DeviceGetAccountingStats. +// Check the length with: +// +// len(mockedInterface.DeviceGetAccountingStatsCalls()) +func (mock *Interface) DeviceGetAccountingStatsCalls() []struct { + Device nvml.Device + V uint32 +} { + var calls []struct { + Device nvml.Device + V uint32 + } + mock.lockDeviceGetAccountingStats.RLock() + calls = mock.calls.DeviceGetAccountingStats + mock.lockDeviceGetAccountingStats.RUnlock() + return calls +} + +// DeviceGetActiveVgpus calls DeviceGetActiveVgpusFunc. +func (mock *Interface) DeviceGetActiveVgpus(device nvml.Device) ([]nvml.VgpuInstance, nvml.Return) { + if mock.DeviceGetActiveVgpusFunc == nil { + panic("Interface.DeviceGetActiveVgpusFunc: method is nil but Interface.DeviceGetActiveVgpus was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetActiveVgpus.Lock() + mock.calls.DeviceGetActiveVgpus = append(mock.calls.DeviceGetActiveVgpus, callInfo) + mock.lockDeviceGetActiveVgpus.Unlock() + return mock.DeviceGetActiveVgpusFunc(device) +} + +// DeviceGetActiveVgpusCalls gets all the calls that were made to DeviceGetActiveVgpus. +// Check the length with: +// +// len(mockedInterface.DeviceGetActiveVgpusCalls()) +func (mock *Interface) DeviceGetActiveVgpusCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetActiveVgpus.RLock() + calls = mock.calls.DeviceGetActiveVgpus + mock.lockDeviceGetActiveVgpus.RUnlock() + return calls +} + +// DeviceGetAdaptiveClockInfoStatus calls DeviceGetAdaptiveClockInfoStatusFunc. +func (mock *Interface) DeviceGetAdaptiveClockInfoStatus(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetAdaptiveClockInfoStatusFunc == nil { + panic("Interface.DeviceGetAdaptiveClockInfoStatusFunc: method is nil but Interface.DeviceGetAdaptiveClockInfoStatus was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetAdaptiveClockInfoStatus.Lock() + mock.calls.DeviceGetAdaptiveClockInfoStatus = append(mock.calls.DeviceGetAdaptiveClockInfoStatus, callInfo) + mock.lockDeviceGetAdaptiveClockInfoStatus.Unlock() + return mock.DeviceGetAdaptiveClockInfoStatusFunc(device) +} + +// DeviceGetAdaptiveClockInfoStatusCalls gets all the calls that were made to DeviceGetAdaptiveClockInfoStatus. +// Check the length with: +// +// len(mockedInterface.DeviceGetAdaptiveClockInfoStatusCalls()) +func (mock *Interface) DeviceGetAdaptiveClockInfoStatusCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetAdaptiveClockInfoStatus.RLock() + calls = mock.calls.DeviceGetAdaptiveClockInfoStatus + mock.lockDeviceGetAdaptiveClockInfoStatus.RUnlock() + return calls +} + +// DeviceGetApplicationsClock calls DeviceGetApplicationsClockFunc. +func (mock *Interface) DeviceGetApplicationsClock(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.DeviceGetApplicationsClockFunc == nil { + panic("Interface.DeviceGetApplicationsClockFunc: method is nil but Interface.DeviceGetApplicationsClock was just called") + } + callInfo := struct { + Device nvml.Device + ClockType nvml.ClockType + }{ + Device: device, + ClockType: clockType, + } + mock.lockDeviceGetApplicationsClock.Lock() + mock.calls.DeviceGetApplicationsClock = append(mock.calls.DeviceGetApplicationsClock, callInfo) + mock.lockDeviceGetApplicationsClock.Unlock() + return mock.DeviceGetApplicationsClockFunc(device, clockType) +} + +// DeviceGetApplicationsClockCalls gets all the calls that were made to DeviceGetApplicationsClock. +// Check the length with: +// +// len(mockedInterface.DeviceGetApplicationsClockCalls()) +func (mock *Interface) DeviceGetApplicationsClockCalls() []struct { + Device nvml.Device + ClockType nvml.ClockType +} { + var calls []struct { + Device nvml.Device + ClockType nvml.ClockType + } + mock.lockDeviceGetApplicationsClock.RLock() + calls = mock.calls.DeviceGetApplicationsClock + mock.lockDeviceGetApplicationsClock.RUnlock() + return calls +} + +// DeviceGetArchitecture calls DeviceGetArchitectureFunc. +func (mock *Interface) DeviceGetArchitecture(device nvml.Device) (nvml.DeviceArchitecture, nvml.Return) { + if mock.DeviceGetArchitectureFunc == nil { + panic("Interface.DeviceGetArchitectureFunc: method is nil but Interface.DeviceGetArchitecture was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetArchitecture.Lock() + mock.calls.DeviceGetArchitecture = append(mock.calls.DeviceGetArchitecture, callInfo) + mock.lockDeviceGetArchitecture.Unlock() + return mock.DeviceGetArchitectureFunc(device) +} + +// DeviceGetArchitectureCalls gets all the calls that were made to DeviceGetArchitecture. +// Check the length with: +// +// len(mockedInterface.DeviceGetArchitectureCalls()) +func (mock *Interface) DeviceGetArchitectureCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetArchitecture.RLock() + calls = mock.calls.DeviceGetArchitecture + mock.lockDeviceGetArchitecture.RUnlock() + return calls +} + +// DeviceGetAttributes calls DeviceGetAttributesFunc. +func (mock *Interface) DeviceGetAttributes(device nvml.Device) (nvml.DeviceAttributes, nvml.Return) { + if mock.DeviceGetAttributesFunc == nil { + panic("Interface.DeviceGetAttributesFunc: method is nil but Interface.DeviceGetAttributes was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetAttributes.Lock() + mock.calls.DeviceGetAttributes = append(mock.calls.DeviceGetAttributes, callInfo) + mock.lockDeviceGetAttributes.Unlock() + return mock.DeviceGetAttributesFunc(device) +} + +// DeviceGetAttributesCalls gets all the calls that were made to DeviceGetAttributes. +// Check the length with: +// +// len(mockedInterface.DeviceGetAttributesCalls()) +func (mock *Interface) DeviceGetAttributesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetAttributes.RLock() + calls = mock.calls.DeviceGetAttributes + mock.lockDeviceGetAttributes.RUnlock() + return calls +} + +// DeviceGetAutoBoostedClocksEnabled calls DeviceGetAutoBoostedClocksEnabledFunc. +func (mock *Interface) DeviceGetAutoBoostedClocksEnabled(device nvml.Device) (nvml.EnableState, nvml.EnableState, nvml.Return) { + if mock.DeviceGetAutoBoostedClocksEnabledFunc == nil { + panic("Interface.DeviceGetAutoBoostedClocksEnabledFunc: method is nil but Interface.DeviceGetAutoBoostedClocksEnabled was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetAutoBoostedClocksEnabled.Lock() + mock.calls.DeviceGetAutoBoostedClocksEnabled = append(mock.calls.DeviceGetAutoBoostedClocksEnabled, callInfo) + mock.lockDeviceGetAutoBoostedClocksEnabled.Unlock() + return mock.DeviceGetAutoBoostedClocksEnabledFunc(device) +} + +// DeviceGetAutoBoostedClocksEnabledCalls gets all the calls that were made to DeviceGetAutoBoostedClocksEnabled. +// Check the length with: +// +// len(mockedInterface.DeviceGetAutoBoostedClocksEnabledCalls()) +func (mock *Interface) DeviceGetAutoBoostedClocksEnabledCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetAutoBoostedClocksEnabled.RLock() + calls = mock.calls.DeviceGetAutoBoostedClocksEnabled + mock.lockDeviceGetAutoBoostedClocksEnabled.RUnlock() + return calls +} + +// DeviceGetBAR1MemoryInfo calls DeviceGetBAR1MemoryInfoFunc. +func (mock *Interface) DeviceGetBAR1MemoryInfo(device nvml.Device) (nvml.BAR1Memory, nvml.Return) { + if mock.DeviceGetBAR1MemoryInfoFunc == nil { + panic("Interface.DeviceGetBAR1MemoryInfoFunc: method is nil but Interface.DeviceGetBAR1MemoryInfo was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetBAR1MemoryInfo.Lock() + mock.calls.DeviceGetBAR1MemoryInfo = append(mock.calls.DeviceGetBAR1MemoryInfo, callInfo) + mock.lockDeviceGetBAR1MemoryInfo.Unlock() + return mock.DeviceGetBAR1MemoryInfoFunc(device) +} + +// DeviceGetBAR1MemoryInfoCalls gets all the calls that were made to DeviceGetBAR1MemoryInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetBAR1MemoryInfoCalls()) +func (mock *Interface) DeviceGetBAR1MemoryInfoCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetBAR1MemoryInfo.RLock() + calls = mock.calls.DeviceGetBAR1MemoryInfo + mock.lockDeviceGetBAR1MemoryInfo.RUnlock() + return calls +} + +// DeviceGetBoardId calls DeviceGetBoardIdFunc. +func (mock *Interface) DeviceGetBoardId(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetBoardIdFunc == nil { + panic("Interface.DeviceGetBoardIdFunc: method is nil but Interface.DeviceGetBoardId was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetBoardId.Lock() + mock.calls.DeviceGetBoardId = append(mock.calls.DeviceGetBoardId, callInfo) + mock.lockDeviceGetBoardId.Unlock() + return mock.DeviceGetBoardIdFunc(device) +} + +// DeviceGetBoardIdCalls gets all the calls that were made to DeviceGetBoardId. +// Check the length with: +// +// len(mockedInterface.DeviceGetBoardIdCalls()) +func (mock *Interface) DeviceGetBoardIdCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetBoardId.RLock() + calls = mock.calls.DeviceGetBoardId + mock.lockDeviceGetBoardId.RUnlock() + return calls +} + +// DeviceGetBoardPartNumber calls DeviceGetBoardPartNumberFunc. +func (mock *Interface) DeviceGetBoardPartNumber(device nvml.Device) (string, nvml.Return) { + if mock.DeviceGetBoardPartNumberFunc == nil { + panic("Interface.DeviceGetBoardPartNumberFunc: method is nil but Interface.DeviceGetBoardPartNumber was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetBoardPartNumber.Lock() + mock.calls.DeviceGetBoardPartNumber = append(mock.calls.DeviceGetBoardPartNumber, callInfo) + mock.lockDeviceGetBoardPartNumber.Unlock() + return mock.DeviceGetBoardPartNumberFunc(device) +} + +// DeviceGetBoardPartNumberCalls gets all the calls that were made to DeviceGetBoardPartNumber. +// Check the length with: +// +// len(mockedInterface.DeviceGetBoardPartNumberCalls()) +func (mock *Interface) DeviceGetBoardPartNumberCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetBoardPartNumber.RLock() + calls = mock.calls.DeviceGetBoardPartNumber + mock.lockDeviceGetBoardPartNumber.RUnlock() + return calls +} + +// DeviceGetBrand calls DeviceGetBrandFunc. +func (mock *Interface) DeviceGetBrand(device nvml.Device) (nvml.BrandType, nvml.Return) { + if mock.DeviceGetBrandFunc == nil { + panic("Interface.DeviceGetBrandFunc: method is nil but Interface.DeviceGetBrand was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetBrand.Lock() + mock.calls.DeviceGetBrand = append(mock.calls.DeviceGetBrand, callInfo) + mock.lockDeviceGetBrand.Unlock() + return mock.DeviceGetBrandFunc(device) +} + +// DeviceGetBrandCalls gets all the calls that were made to DeviceGetBrand. +// Check the length with: +// +// len(mockedInterface.DeviceGetBrandCalls()) +func (mock *Interface) DeviceGetBrandCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetBrand.RLock() + calls = mock.calls.DeviceGetBrand + mock.lockDeviceGetBrand.RUnlock() + return calls +} + +// DeviceGetBridgeChipInfo calls DeviceGetBridgeChipInfoFunc. +func (mock *Interface) DeviceGetBridgeChipInfo(device nvml.Device) (nvml.BridgeChipHierarchy, nvml.Return) { + if mock.DeviceGetBridgeChipInfoFunc == nil { + panic("Interface.DeviceGetBridgeChipInfoFunc: method is nil but Interface.DeviceGetBridgeChipInfo was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetBridgeChipInfo.Lock() + mock.calls.DeviceGetBridgeChipInfo = append(mock.calls.DeviceGetBridgeChipInfo, callInfo) + mock.lockDeviceGetBridgeChipInfo.Unlock() + return mock.DeviceGetBridgeChipInfoFunc(device) +} + +// DeviceGetBridgeChipInfoCalls gets all the calls that were made to DeviceGetBridgeChipInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetBridgeChipInfoCalls()) +func (mock *Interface) DeviceGetBridgeChipInfoCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetBridgeChipInfo.RLock() + calls = mock.calls.DeviceGetBridgeChipInfo + mock.lockDeviceGetBridgeChipInfo.RUnlock() + return calls +} + +// DeviceGetBusType calls DeviceGetBusTypeFunc. +func (mock *Interface) DeviceGetBusType(device nvml.Device) (nvml.BusType, nvml.Return) { + if mock.DeviceGetBusTypeFunc == nil { + panic("Interface.DeviceGetBusTypeFunc: method is nil but Interface.DeviceGetBusType was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetBusType.Lock() + mock.calls.DeviceGetBusType = append(mock.calls.DeviceGetBusType, callInfo) + mock.lockDeviceGetBusType.Unlock() + return mock.DeviceGetBusTypeFunc(device) +} + +// DeviceGetBusTypeCalls gets all the calls that were made to DeviceGetBusType. +// Check the length with: +// +// len(mockedInterface.DeviceGetBusTypeCalls()) +func (mock *Interface) DeviceGetBusTypeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetBusType.RLock() + calls = mock.calls.DeviceGetBusType + mock.lockDeviceGetBusType.RUnlock() + return calls +} + +// DeviceGetClkMonStatus calls DeviceGetClkMonStatusFunc. +func (mock *Interface) DeviceGetClkMonStatus(device nvml.Device) (nvml.ClkMonStatus, nvml.Return) { + if mock.DeviceGetClkMonStatusFunc == nil { + panic("Interface.DeviceGetClkMonStatusFunc: method is nil but Interface.DeviceGetClkMonStatus was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetClkMonStatus.Lock() + mock.calls.DeviceGetClkMonStatus = append(mock.calls.DeviceGetClkMonStatus, callInfo) + mock.lockDeviceGetClkMonStatus.Unlock() + return mock.DeviceGetClkMonStatusFunc(device) +} + +// DeviceGetClkMonStatusCalls gets all the calls that were made to DeviceGetClkMonStatus. +// Check the length with: +// +// len(mockedInterface.DeviceGetClkMonStatusCalls()) +func (mock *Interface) DeviceGetClkMonStatusCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetClkMonStatus.RLock() + calls = mock.calls.DeviceGetClkMonStatus + mock.lockDeviceGetClkMonStatus.RUnlock() + return calls +} + +// DeviceGetClock calls DeviceGetClockFunc. +func (mock *Interface) DeviceGetClock(device nvml.Device, clockType nvml.ClockType, clockId nvml.ClockId) (uint32, nvml.Return) { + if mock.DeviceGetClockFunc == nil { + panic("Interface.DeviceGetClockFunc: method is nil but Interface.DeviceGetClock was just called") + } + callInfo := struct { + Device nvml.Device + ClockType nvml.ClockType + ClockId nvml.ClockId + }{ + Device: device, + ClockType: clockType, + ClockId: clockId, + } + mock.lockDeviceGetClock.Lock() + mock.calls.DeviceGetClock = append(mock.calls.DeviceGetClock, callInfo) + mock.lockDeviceGetClock.Unlock() + return mock.DeviceGetClockFunc(device, clockType, clockId) +} + +// DeviceGetClockCalls gets all the calls that were made to DeviceGetClock. +// Check the length with: +// +// len(mockedInterface.DeviceGetClockCalls()) +func (mock *Interface) DeviceGetClockCalls() []struct { + Device nvml.Device + ClockType nvml.ClockType + ClockId nvml.ClockId +} { + var calls []struct { + Device nvml.Device + ClockType nvml.ClockType + ClockId nvml.ClockId + } + mock.lockDeviceGetClock.RLock() + calls = mock.calls.DeviceGetClock + mock.lockDeviceGetClock.RUnlock() + return calls +} + +// DeviceGetClockInfo calls DeviceGetClockInfoFunc. +func (mock *Interface) DeviceGetClockInfo(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.DeviceGetClockInfoFunc == nil { + panic("Interface.DeviceGetClockInfoFunc: method is nil but Interface.DeviceGetClockInfo was just called") + } + callInfo := struct { + Device nvml.Device + ClockType nvml.ClockType + }{ + Device: device, + ClockType: clockType, + } + mock.lockDeviceGetClockInfo.Lock() + mock.calls.DeviceGetClockInfo = append(mock.calls.DeviceGetClockInfo, callInfo) + mock.lockDeviceGetClockInfo.Unlock() + return mock.DeviceGetClockInfoFunc(device, clockType) +} + +// DeviceGetClockInfoCalls gets all the calls that were made to DeviceGetClockInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetClockInfoCalls()) +func (mock *Interface) DeviceGetClockInfoCalls() []struct { + Device nvml.Device + ClockType nvml.ClockType +} { + var calls []struct { + Device nvml.Device + ClockType nvml.ClockType + } + mock.lockDeviceGetClockInfo.RLock() + calls = mock.calls.DeviceGetClockInfo + mock.lockDeviceGetClockInfo.RUnlock() + return calls +} + +// DeviceGetComputeInstanceId calls DeviceGetComputeInstanceIdFunc. +func (mock *Interface) DeviceGetComputeInstanceId(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetComputeInstanceIdFunc == nil { + panic("Interface.DeviceGetComputeInstanceIdFunc: method is nil but Interface.DeviceGetComputeInstanceId was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetComputeInstanceId.Lock() + mock.calls.DeviceGetComputeInstanceId = append(mock.calls.DeviceGetComputeInstanceId, callInfo) + mock.lockDeviceGetComputeInstanceId.Unlock() + return mock.DeviceGetComputeInstanceIdFunc(device) +} + +// DeviceGetComputeInstanceIdCalls gets all the calls that were made to DeviceGetComputeInstanceId. +// Check the length with: +// +// len(mockedInterface.DeviceGetComputeInstanceIdCalls()) +func (mock *Interface) DeviceGetComputeInstanceIdCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetComputeInstanceId.RLock() + calls = mock.calls.DeviceGetComputeInstanceId + mock.lockDeviceGetComputeInstanceId.RUnlock() + return calls +} + +// DeviceGetComputeMode calls DeviceGetComputeModeFunc. +func (mock *Interface) DeviceGetComputeMode(device nvml.Device) (nvml.ComputeMode, nvml.Return) { + if mock.DeviceGetComputeModeFunc == nil { + panic("Interface.DeviceGetComputeModeFunc: method is nil but Interface.DeviceGetComputeMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetComputeMode.Lock() + mock.calls.DeviceGetComputeMode = append(mock.calls.DeviceGetComputeMode, callInfo) + mock.lockDeviceGetComputeMode.Unlock() + return mock.DeviceGetComputeModeFunc(device) +} + +// DeviceGetComputeModeCalls gets all the calls that were made to DeviceGetComputeMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetComputeModeCalls()) +func (mock *Interface) DeviceGetComputeModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetComputeMode.RLock() + calls = mock.calls.DeviceGetComputeMode + mock.lockDeviceGetComputeMode.RUnlock() + return calls +} + +// DeviceGetComputeRunningProcesses calls DeviceGetComputeRunningProcessesFunc. +func (mock *Interface) DeviceGetComputeRunningProcesses(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) { + if mock.DeviceGetComputeRunningProcessesFunc == nil { + panic("Interface.DeviceGetComputeRunningProcessesFunc: method is nil but Interface.DeviceGetComputeRunningProcesses was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetComputeRunningProcesses.Lock() + mock.calls.DeviceGetComputeRunningProcesses = append(mock.calls.DeviceGetComputeRunningProcesses, callInfo) + mock.lockDeviceGetComputeRunningProcesses.Unlock() + return mock.DeviceGetComputeRunningProcessesFunc(device) +} + +// DeviceGetComputeRunningProcessesCalls gets all the calls that were made to DeviceGetComputeRunningProcesses. +// Check the length with: +// +// len(mockedInterface.DeviceGetComputeRunningProcessesCalls()) +func (mock *Interface) DeviceGetComputeRunningProcessesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetComputeRunningProcesses.RLock() + calls = mock.calls.DeviceGetComputeRunningProcesses + mock.lockDeviceGetComputeRunningProcesses.RUnlock() + return calls +} + +// DeviceGetCount calls DeviceGetCountFunc. +func (mock *Interface) DeviceGetCount() (int, nvml.Return) { + if mock.DeviceGetCountFunc == nil { + panic("Interface.DeviceGetCountFunc: method is nil but Interface.DeviceGetCount was just called") + } + callInfo := struct { + }{} + mock.lockDeviceGetCount.Lock() + mock.calls.DeviceGetCount = append(mock.calls.DeviceGetCount, callInfo) + mock.lockDeviceGetCount.Unlock() + return mock.DeviceGetCountFunc() +} + +// DeviceGetCountCalls gets all the calls that were made to DeviceGetCount. +// Check the length with: +// +// len(mockedInterface.DeviceGetCountCalls()) +func (mock *Interface) DeviceGetCountCalls() []struct { +} { + var calls []struct { + } + mock.lockDeviceGetCount.RLock() + calls = mock.calls.DeviceGetCount + mock.lockDeviceGetCount.RUnlock() + return calls +} + +// DeviceGetCpuAffinity calls DeviceGetCpuAffinityFunc. +func (mock *Interface) DeviceGetCpuAffinity(device nvml.Device, n int) ([]uint, nvml.Return) { + if mock.DeviceGetCpuAffinityFunc == nil { + panic("Interface.DeviceGetCpuAffinityFunc: method is nil but Interface.DeviceGetCpuAffinity was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetCpuAffinity.Lock() + mock.calls.DeviceGetCpuAffinity = append(mock.calls.DeviceGetCpuAffinity, callInfo) + mock.lockDeviceGetCpuAffinity.Unlock() + return mock.DeviceGetCpuAffinityFunc(device, n) +} + +// DeviceGetCpuAffinityCalls gets all the calls that were made to DeviceGetCpuAffinity. +// Check the length with: +// +// len(mockedInterface.DeviceGetCpuAffinityCalls()) +func (mock *Interface) DeviceGetCpuAffinityCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetCpuAffinity.RLock() + calls = mock.calls.DeviceGetCpuAffinity + mock.lockDeviceGetCpuAffinity.RUnlock() + return calls +} + +// DeviceGetCpuAffinityWithinScope calls DeviceGetCpuAffinityWithinScopeFunc. +func (mock *Interface) DeviceGetCpuAffinityWithinScope(device nvml.Device, n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) { + if mock.DeviceGetCpuAffinityWithinScopeFunc == nil { + panic("Interface.DeviceGetCpuAffinityWithinScopeFunc: method is nil but Interface.DeviceGetCpuAffinityWithinScope was just called") + } + callInfo := struct { + Device nvml.Device + N int + AffinityScope nvml.AffinityScope + }{ + Device: device, + N: n, + AffinityScope: affinityScope, + } + mock.lockDeviceGetCpuAffinityWithinScope.Lock() + mock.calls.DeviceGetCpuAffinityWithinScope = append(mock.calls.DeviceGetCpuAffinityWithinScope, callInfo) + mock.lockDeviceGetCpuAffinityWithinScope.Unlock() + return mock.DeviceGetCpuAffinityWithinScopeFunc(device, n, affinityScope) +} + +// DeviceGetCpuAffinityWithinScopeCalls gets all the calls that were made to DeviceGetCpuAffinityWithinScope. +// Check the length with: +// +// len(mockedInterface.DeviceGetCpuAffinityWithinScopeCalls()) +func (mock *Interface) DeviceGetCpuAffinityWithinScopeCalls() []struct { + Device nvml.Device + N int + AffinityScope nvml.AffinityScope +} { + var calls []struct { + Device nvml.Device + N int + AffinityScope nvml.AffinityScope + } + mock.lockDeviceGetCpuAffinityWithinScope.RLock() + calls = mock.calls.DeviceGetCpuAffinityWithinScope + mock.lockDeviceGetCpuAffinityWithinScope.RUnlock() + return calls +} + +// DeviceGetCreatableVgpus calls DeviceGetCreatableVgpusFunc. +func (mock *Interface) DeviceGetCreatableVgpus(device nvml.Device) ([]nvml.VgpuTypeId, nvml.Return) { + if mock.DeviceGetCreatableVgpusFunc == nil { + panic("Interface.DeviceGetCreatableVgpusFunc: method is nil but Interface.DeviceGetCreatableVgpus was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetCreatableVgpus.Lock() + mock.calls.DeviceGetCreatableVgpus = append(mock.calls.DeviceGetCreatableVgpus, callInfo) + mock.lockDeviceGetCreatableVgpus.Unlock() + return mock.DeviceGetCreatableVgpusFunc(device) +} + +// DeviceGetCreatableVgpusCalls gets all the calls that were made to DeviceGetCreatableVgpus. +// Check the length with: +// +// len(mockedInterface.DeviceGetCreatableVgpusCalls()) +func (mock *Interface) DeviceGetCreatableVgpusCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetCreatableVgpus.RLock() + calls = mock.calls.DeviceGetCreatableVgpus + mock.lockDeviceGetCreatableVgpus.RUnlock() + return calls +} + +// DeviceGetCudaComputeCapability calls DeviceGetCudaComputeCapabilityFunc. +func (mock *Interface) DeviceGetCudaComputeCapability(device nvml.Device) (int, int, nvml.Return) { + if mock.DeviceGetCudaComputeCapabilityFunc == nil { + panic("Interface.DeviceGetCudaComputeCapabilityFunc: method is nil but Interface.DeviceGetCudaComputeCapability was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetCudaComputeCapability.Lock() + mock.calls.DeviceGetCudaComputeCapability = append(mock.calls.DeviceGetCudaComputeCapability, callInfo) + mock.lockDeviceGetCudaComputeCapability.Unlock() + return mock.DeviceGetCudaComputeCapabilityFunc(device) +} + +// DeviceGetCudaComputeCapabilityCalls gets all the calls that were made to DeviceGetCudaComputeCapability. +// Check the length with: +// +// len(mockedInterface.DeviceGetCudaComputeCapabilityCalls()) +func (mock *Interface) DeviceGetCudaComputeCapabilityCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetCudaComputeCapability.RLock() + calls = mock.calls.DeviceGetCudaComputeCapability + mock.lockDeviceGetCudaComputeCapability.RUnlock() + return calls +} + +// DeviceGetCurrPcieLinkGeneration calls DeviceGetCurrPcieLinkGenerationFunc. +func (mock *Interface) DeviceGetCurrPcieLinkGeneration(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetCurrPcieLinkGenerationFunc == nil { + panic("Interface.DeviceGetCurrPcieLinkGenerationFunc: method is nil but Interface.DeviceGetCurrPcieLinkGeneration was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetCurrPcieLinkGeneration.Lock() + mock.calls.DeviceGetCurrPcieLinkGeneration = append(mock.calls.DeviceGetCurrPcieLinkGeneration, callInfo) + mock.lockDeviceGetCurrPcieLinkGeneration.Unlock() + return mock.DeviceGetCurrPcieLinkGenerationFunc(device) +} + +// DeviceGetCurrPcieLinkGenerationCalls gets all the calls that were made to DeviceGetCurrPcieLinkGeneration. +// Check the length with: +// +// len(mockedInterface.DeviceGetCurrPcieLinkGenerationCalls()) +func (mock *Interface) DeviceGetCurrPcieLinkGenerationCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetCurrPcieLinkGeneration.RLock() + calls = mock.calls.DeviceGetCurrPcieLinkGeneration + mock.lockDeviceGetCurrPcieLinkGeneration.RUnlock() + return calls +} + +// DeviceGetCurrPcieLinkWidth calls DeviceGetCurrPcieLinkWidthFunc. +func (mock *Interface) DeviceGetCurrPcieLinkWidth(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetCurrPcieLinkWidthFunc == nil { + panic("Interface.DeviceGetCurrPcieLinkWidthFunc: method is nil but Interface.DeviceGetCurrPcieLinkWidth was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetCurrPcieLinkWidth.Lock() + mock.calls.DeviceGetCurrPcieLinkWidth = append(mock.calls.DeviceGetCurrPcieLinkWidth, callInfo) + mock.lockDeviceGetCurrPcieLinkWidth.Unlock() + return mock.DeviceGetCurrPcieLinkWidthFunc(device) +} + +// DeviceGetCurrPcieLinkWidthCalls gets all the calls that were made to DeviceGetCurrPcieLinkWidth. +// Check the length with: +// +// len(mockedInterface.DeviceGetCurrPcieLinkWidthCalls()) +func (mock *Interface) DeviceGetCurrPcieLinkWidthCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetCurrPcieLinkWidth.RLock() + calls = mock.calls.DeviceGetCurrPcieLinkWidth + mock.lockDeviceGetCurrPcieLinkWidth.RUnlock() + return calls +} + +// DeviceGetCurrentClocksThrottleReasons calls DeviceGetCurrentClocksThrottleReasonsFunc. +func (mock *Interface) DeviceGetCurrentClocksThrottleReasons(device nvml.Device) (uint64, nvml.Return) { + if mock.DeviceGetCurrentClocksThrottleReasonsFunc == nil { + panic("Interface.DeviceGetCurrentClocksThrottleReasonsFunc: method is nil but Interface.DeviceGetCurrentClocksThrottleReasons was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetCurrentClocksThrottleReasons.Lock() + mock.calls.DeviceGetCurrentClocksThrottleReasons = append(mock.calls.DeviceGetCurrentClocksThrottleReasons, callInfo) + mock.lockDeviceGetCurrentClocksThrottleReasons.Unlock() + return mock.DeviceGetCurrentClocksThrottleReasonsFunc(device) +} + +// DeviceGetCurrentClocksThrottleReasonsCalls gets all the calls that were made to DeviceGetCurrentClocksThrottleReasons. +// Check the length with: +// +// len(mockedInterface.DeviceGetCurrentClocksThrottleReasonsCalls()) +func (mock *Interface) DeviceGetCurrentClocksThrottleReasonsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetCurrentClocksThrottleReasons.RLock() + calls = mock.calls.DeviceGetCurrentClocksThrottleReasons + mock.lockDeviceGetCurrentClocksThrottleReasons.RUnlock() + return calls +} + +// DeviceGetDecoderUtilization calls DeviceGetDecoderUtilizationFunc. +func (mock *Interface) DeviceGetDecoderUtilization(device nvml.Device) (uint32, uint32, nvml.Return) { + if mock.DeviceGetDecoderUtilizationFunc == nil { + panic("Interface.DeviceGetDecoderUtilizationFunc: method is nil but Interface.DeviceGetDecoderUtilization was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetDecoderUtilization.Lock() + mock.calls.DeviceGetDecoderUtilization = append(mock.calls.DeviceGetDecoderUtilization, callInfo) + mock.lockDeviceGetDecoderUtilization.Unlock() + return mock.DeviceGetDecoderUtilizationFunc(device) +} + +// DeviceGetDecoderUtilizationCalls gets all the calls that were made to DeviceGetDecoderUtilization. +// Check the length with: +// +// len(mockedInterface.DeviceGetDecoderUtilizationCalls()) +func (mock *Interface) DeviceGetDecoderUtilizationCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetDecoderUtilization.RLock() + calls = mock.calls.DeviceGetDecoderUtilization + mock.lockDeviceGetDecoderUtilization.RUnlock() + return calls +} + +// DeviceGetDefaultApplicationsClock calls DeviceGetDefaultApplicationsClockFunc. +func (mock *Interface) DeviceGetDefaultApplicationsClock(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.DeviceGetDefaultApplicationsClockFunc == nil { + panic("Interface.DeviceGetDefaultApplicationsClockFunc: method is nil but Interface.DeviceGetDefaultApplicationsClock was just called") + } + callInfo := struct { + Device nvml.Device + ClockType nvml.ClockType + }{ + Device: device, + ClockType: clockType, + } + mock.lockDeviceGetDefaultApplicationsClock.Lock() + mock.calls.DeviceGetDefaultApplicationsClock = append(mock.calls.DeviceGetDefaultApplicationsClock, callInfo) + mock.lockDeviceGetDefaultApplicationsClock.Unlock() + return mock.DeviceGetDefaultApplicationsClockFunc(device, clockType) +} + +// DeviceGetDefaultApplicationsClockCalls gets all the calls that were made to DeviceGetDefaultApplicationsClock. +// Check the length with: +// +// len(mockedInterface.DeviceGetDefaultApplicationsClockCalls()) +func (mock *Interface) DeviceGetDefaultApplicationsClockCalls() []struct { + Device nvml.Device + ClockType nvml.ClockType +} { + var calls []struct { + Device nvml.Device + ClockType nvml.ClockType + } + mock.lockDeviceGetDefaultApplicationsClock.RLock() + calls = mock.calls.DeviceGetDefaultApplicationsClock + mock.lockDeviceGetDefaultApplicationsClock.RUnlock() + return calls +} + +// DeviceGetDefaultEccMode calls DeviceGetDefaultEccModeFunc. +func (mock *Interface) DeviceGetDefaultEccMode(device nvml.Device) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetDefaultEccModeFunc == nil { + panic("Interface.DeviceGetDefaultEccModeFunc: method is nil but Interface.DeviceGetDefaultEccMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetDefaultEccMode.Lock() + mock.calls.DeviceGetDefaultEccMode = append(mock.calls.DeviceGetDefaultEccMode, callInfo) + mock.lockDeviceGetDefaultEccMode.Unlock() + return mock.DeviceGetDefaultEccModeFunc(device) +} + +// DeviceGetDefaultEccModeCalls gets all the calls that were made to DeviceGetDefaultEccMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetDefaultEccModeCalls()) +func (mock *Interface) DeviceGetDefaultEccModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetDefaultEccMode.RLock() + calls = mock.calls.DeviceGetDefaultEccMode + mock.lockDeviceGetDefaultEccMode.RUnlock() + return calls +} + +// DeviceGetDetailedEccErrors calls DeviceGetDetailedEccErrorsFunc. +func (mock *Interface) DeviceGetDetailedEccErrors(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (nvml.EccErrorCounts, nvml.Return) { + if mock.DeviceGetDetailedEccErrorsFunc == nil { + panic("Interface.DeviceGetDetailedEccErrorsFunc: method is nil but Interface.DeviceGetDetailedEccErrors was just called") + } + callInfo := struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + }{ + Device: device, + MemoryErrorType: memoryErrorType, + EccCounterType: eccCounterType, + } + mock.lockDeviceGetDetailedEccErrors.Lock() + mock.calls.DeviceGetDetailedEccErrors = append(mock.calls.DeviceGetDetailedEccErrors, callInfo) + mock.lockDeviceGetDetailedEccErrors.Unlock() + return mock.DeviceGetDetailedEccErrorsFunc(device, memoryErrorType, eccCounterType) +} + +// DeviceGetDetailedEccErrorsCalls gets all the calls that were made to DeviceGetDetailedEccErrors. +// Check the length with: +// +// len(mockedInterface.DeviceGetDetailedEccErrorsCalls()) +func (mock *Interface) DeviceGetDetailedEccErrorsCalls() []struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType +} { + var calls []struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + } + mock.lockDeviceGetDetailedEccErrors.RLock() + calls = mock.calls.DeviceGetDetailedEccErrors + mock.lockDeviceGetDetailedEccErrors.RUnlock() + return calls +} + +// DeviceGetDeviceHandleFromMigDeviceHandle calls DeviceGetDeviceHandleFromMigDeviceHandleFunc. +func (mock *Interface) DeviceGetDeviceHandleFromMigDeviceHandle(device nvml.Device) (nvml.Device, nvml.Return) { + if mock.DeviceGetDeviceHandleFromMigDeviceHandleFunc == nil { + panic("Interface.DeviceGetDeviceHandleFromMigDeviceHandleFunc: method is nil but Interface.DeviceGetDeviceHandleFromMigDeviceHandle was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetDeviceHandleFromMigDeviceHandle.Lock() + mock.calls.DeviceGetDeviceHandleFromMigDeviceHandle = append(mock.calls.DeviceGetDeviceHandleFromMigDeviceHandle, callInfo) + mock.lockDeviceGetDeviceHandleFromMigDeviceHandle.Unlock() + return mock.DeviceGetDeviceHandleFromMigDeviceHandleFunc(device) +} + +// DeviceGetDeviceHandleFromMigDeviceHandleCalls gets all the calls that were made to DeviceGetDeviceHandleFromMigDeviceHandle. +// Check the length with: +// +// len(mockedInterface.DeviceGetDeviceHandleFromMigDeviceHandleCalls()) +func (mock *Interface) DeviceGetDeviceHandleFromMigDeviceHandleCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetDeviceHandleFromMigDeviceHandle.RLock() + calls = mock.calls.DeviceGetDeviceHandleFromMigDeviceHandle + mock.lockDeviceGetDeviceHandleFromMigDeviceHandle.RUnlock() + return calls +} + +// DeviceGetDisplayActive calls DeviceGetDisplayActiveFunc. +func (mock *Interface) DeviceGetDisplayActive(device nvml.Device) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetDisplayActiveFunc == nil { + panic("Interface.DeviceGetDisplayActiveFunc: method is nil but Interface.DeviceGetDisplayActive was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetDisplayActive.Lock() + mock.calls.DeviceGetDisplayActive = append(mock.calls.DeviceGetDisplayActive, callInfo) + mock.lockDeviceGetDisplayActive.Unlock() + return mock.DeviceGetDisplayActiveFunc(device) +} + +// DeviceGetDisplayActiveCalls gets all the calls that were made to DeviceGetDisplayActive. +// Check the length with: +// +// len(mockedInterface.DeviceGetDisplayActiveCalls()) +func (mock *Interface) DeviceGetDisplayActiveCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetDisplayActive.RLock() + calls = mock.calls.DeviceGetDisplayActive + mock.lockDeviceGetDisplayActive.RUnlock() + return calls +} + +// DeviceGetDisplayMode calls DeviceGetDisplayModeFunc. +func (mock *Interface) DeviceGetDisplayMode(device nvml.Device) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetDisplayModeFunc == nil { + panic("Interface.DeviceGetDisplayModeFunc: method is nil but Interface.DeviceGetDisplayMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetDisplayMode.Lock() + mock.calls.DeviceGetDisplayMode = append(mock.calls.DeviceGetDisplayMode, callInfo) + mock.lockDeviceGetDisplayMode.Unlock() + return mock.DeviceGetDisplayModeFunc(device) +} + +// DeviceGetDisplayModeCalls gets all the calls that were made to DeviceGetDisplayMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetDisplayModeCalls()) +func (mock *Interface) DeviceGetDisplayModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetDisplayMode.RLock() + calls = mock.calls.DeviceGetDisplayMode + mock.lockDeviceGetDisplayMode.RUnlock() + return calls +} + +// DeviceGetDriverModel calls DeviceGetDriverModelFunc. +func (mock *Interface) DeviceGetDriverModel(device nvml.Device) (nvml.DriverModel, nvml.DriverModel, nvml.Return) { + if mock.DeviceGetDriverModelFunc == nil { + panic("Interface.DeviceGetDriverModelFunc: method is nil but Interface.DeviceGetDriverModel was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetDriverModel.Lock() + mock.calls.DeviceGetDriverModel = append(mock.calls.DeviceGetDriverModel, callInfo) + mock.lockDeviceGetDriverModel.Unlock() + return mock.DeviceGetDriverModelFunc(device) +} + +// DeviceGetDriverModelCalls gets all the calls that were made to DeviceGetDriverModel. +// Check the length with: +// +// len(mockedInterface.DeviceGetDriverModelCalls()) +func (mock *Interface) DeviceGetDriverModelCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetDriverModel.RLock() + calls = mock.calls.DeviceGetDriverModel + mock.lockDeviceGetDriverModel.RUnlock() + return calls +} + +// DeviceGetDynamicPstatesInfo calls DeviceGetDynamicPstatesInfoFunc. +func (mock *Interface) DeviceGetDynamicPstatesInfo(device nvml.Device) (nvml.GpuDynamicPstatesInfo, nvml.Return) { + if mock.DeviceGetDynamicPstatesInfoFunc == nil { + panic("Interface.DeviceGetDynamicPstatesInfoFunc: method is nil but Interface.DeviceGetDynamicPstatesInfo was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetDynamicPstatesInfo.Lock() + mock.calls.DeviceGetDynamicPstatesInfo = append(mock.calls.DeviceGetDynamicPstatesInfo, callInfo) + mock.lockDeviceGetDynamicPstatesInfo.Unlock() + return mock.DeviceGetDynamicPstatesInfoFunc(device) +} + +// DeviceGetDynamicPstatesInfoCalls gets all the calls that were made to DeviceGetDynamicPstatesInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetDynamicPstatesInfoCalls()) +func (mock *Interface) DeviceGetDynamicPstatesInfoCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetDynamicPstatesInfo.RLock() + calls = mock.calls.DeviceGetDynamicPstatesInfo + mock.lockDeviceGetDynamicPstatesInfo.RUnlock() + return calls +} + +// DeviceGetEccMode calls DeviceGetEccModeFunc. +func (mock *Interface) DeviceGetEccMode(device nvml.Device) (nvml.EnableState, nvml.EnableState, nvml.Return) { + if mock.DeviceGetEccModeFunc == nil { + panic("Interface.DeviceGetEccModeFunc: method is nil but Interface.DeviceGetEccMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetEccMode.Lock() + mock.calls.DeviceGetEccMode = append(mock.calls.DeviceGetEccMode, callInfo) + mock.lockDeviceGetEccMode.Unlock() + return mock.DeviceGetEccModeFunc(device) +} + +// DeviceGetEccModeCalls gets all the calls that were made to DeviceGetEccMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetEccModeCalls()) +func (mock *Interface) DeviceGetEccModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetEccMode.RLock() + calls = mock.calls.DeviceGetEccMode + mock.lockDeviceGetEccMode.RUnlock() + return calls +} + +// DeviceGetEncoderCapacity calls DeviceGetEncoderCapacityFunc. +func (mock *Interface) DeviceGetEncoderCapacity(device nvml.Device, encoderType nvml.EncoderType) (int, nvml.Return) { + if mock.DeviceGetEncoderCapacityFunc == nil { + panic("Interface.DeviceGetEncoderCapacityFunc: method is nil but Interface.DeviceGetEncoderCapacity was just called") + } + callInfo := struct { + Device nvml.Device + EncoderType nvml.EncoderType + }{ + Device: device, + EncoderType: encoderType, + } + mock.lockDeviceGetEncoderCapacity.Lock() + mock.calls.DeviceGetEncoderCapacity = append(mock.calls.DeviceGetEncoderCapacity, callInfo) + mock.lockDeviceGetEncoderCapacity.Unlock() + return mock.DeviceGetEncoderCapacityFunc(device, encoderType) +} + +// DeviceGetEncoderCapacityCalls gets all the calls that were made to DeviceGetEncoderCapacity. +// Check the length with: +// +// len(mockedInterface.DeviceGetEncoderCapacityCalls()) +func (mock *Interface) DeviceGetEncoderCapacityCalls() []struct { + Device nvml.Device + EncoderType nvml.EncoderType +} { + var calls []struct { + Device nvml.Device + EncoderType nvml.EncoderType + } + mock.lockDeviceGetEncoderCapacity.RLock() + calls = mock.calls.DeviceGetEncoderCapacity + mock.lockDeviceGetEncoderCapacity.RUnlock() + return calls +} + +// DeviceGetEncoderSessions calls DeviceGetEncoderSessionsFunc. +func (mock *Interface) DeviceGetEncoderSessions(device nvml.Device) ([]nvml.EncoderSessionInfo, nvml.Return) { + if mock.DeviceGetEncoderSessionsFunc == nil { + panic("Interface.DeviceGetEncoderSessionsFunc: method is nil but Interface.DeviceGetEncoderSessions was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetEncoderSessions.Lock() + mock.calls.DeviceGetEncoderSessions = append(mock.calls.DeviceGetEncoderSessions, callInfo) + mock.lockDeviceGetEncoderSessions.Unlock() + return mock.DeviceGetEncoderSessionsFunc(device) +} + +// DeviceGetEncoderSessionsCalls gets all the calls that were made to DeviceGetEncoderSessions. +// Check the length with: +// +// len(mockedInterface.DeviceGetEncoderSessionsCalls()) +func (mock *Interface) DeviceGetEncoderSessionsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetEncoderSessions.RLock() + calls = mock.calls.DeviceGetEncoderSessions + mock.lockDeviceGetEncoderSessions.RUnlock() + return calls +} + +// DeviceGetEncoderStats calls DeviceGetEncoderStatsFunc. +func (mock *Interface) DeviceGetEncoderStats(device nvml.Device) (int, uint32, uint32, nvml.Return) { + if mock.DeviceGetEncoderStatsFunc == nil { + panic("Interface.DeviceGetEncoderStatsFunc: method is nil but Interface.DeviceGetEncoderStats was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetEncoderStats.Lock() + mock.calls.DeviceGetEncoderStats = append(mock.calls.DeviceGetEncoderStats, callInfo) + mock.lockDeviceGetEncoderStats.Unlock() + return mock.DeviceGetEncoderStatsFunc(device) +} + +// DeviceGetEncoderStatsCalls gets all the calls that were made to DeviceGetEncoderStats. +// Check the length with: +// +// len(mockedInterface.DeviceGetEncoderStatsCalls()) +func (mock *Interface) DeviceGetEncoderStatsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetEncoderStats.RLock() + calls = mock.calls.DeviceGetEncoderStats + mock.lockDeviceGetEncoderStats.RUnlock() + return calls +} + +// DeviceGetEncoderUtilization calls DeviceGetEncoderUtilizationFunc. +func (mock *Interface) DeviceGetEncoderUtilization(device nvml.Device) (uint32, uint32, nvml.Return) { + if mock.DeviceGetEncoderUtilizationFunc == nil { + panic("Interface.DeviceGetEncoderUtilizationFunc: method is nil but Interface.DeviceGetEncoderUtilization was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetEncoderUtilization.Lock() + mock.calls.DeviceGetEncoderUtilization = append(mock.calls.DeviceGetEncoderUtilization, callInfo) + mock.lockDeviceGetEncoderUtilization.Unlock() + return mock.DeviceGetEncoderUtilizationFunc(device) +} + +// DeviceGetEncoderUtilizationCalls gets all the calls that were made to DeviceGetEncoderUtilization. +// Check the length with: +// +// len(mockedInterface.DeviceGetEncoderUtilizationCalls()) +func (mock *Interface) DeviceGetEncoderUtilizationCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetEncoderUtilization.RLock() + calls = mock.calls.DeviceGetEncoderUtilization + mock.lockDeviceGetEncoderUtilization.RUnlock() + return calls +} + +// DeviceGetEnforcedPowerLimit calls DeviceGetEnforcedPowerLimitFunc. +func (mock *Interface) DeviceGetEnforcedPowerLimit(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetEnforcedPowerLimitFunc == nil { + panic("Interface.DeviceGetEnforcedPowerLimitFunc: method is nil but Interface.DeviceGetEnforcedPowerLimit was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetEnforcedPowerLimit.Lock() + mock.calls.DeviceGetEnforcedPowerLimit = append(mock.calls.DeviceGetEnforcedPowerLimit, callInfo) + mock.lockDeviceGetEnforcedPowerLimit.Unlock() + return mock.DeviceGetEnforcedPowerLimitFunc(device) +} + +// DeviceGetEnforcedPowerLimitCalls gets all the calls that were made to DeviceGetEnforcedPowerLimit. +// Check the length with: +// +// len(mockedInterface.DeviceGetEnforcedPowerLimitCalls()) +func (mock *Interface) DeviceGetEnforcedPowerLimitCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetEnforcedPowerLimit.RLock() + calls = mock.calls.DeviceGetEnforcedPowerLimit + mock.lockDeviceGetEnforcedPowerLimit.RUnlock() + return calls +} + +// DeviceGetFBCSessions calls DeviceGetFBCSessionsFunc. +func (mock *Interface) DeviceGetFBCSessions(device nvml.Device) ([]nvml.FBCSessionInfo, nvml.Return) { + if mock.DeviceGetFBCSessionsFunc == nil { + panic("Interface.DeviceGetFBCSessionsFunc: method is nil but Interface.DeviceGetFBCSessions was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetFBCSessions.Lock() + mock.calls.DeviceGetFBCSessions = append(mock.calls.DeviceGetFBCSessions, callInfo) + mock.lockDeviceGetFBCSessions.Unlock() + return mock.DeviceGetFBCSessionsFunc(device) +} + +// DeviceGetFBCSessionsCalls gets all the calls that were made to DeviceGetFBCSessions. +// Check the length with: +// +// len(mockedInterface.DeviceGetFBCSessionsCalls()) +func (mock *Interface) DeviceGetFBCSessionsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetFBCSessions.RLock() + calls = mock.calls.DeviceGetFBCSessions + mock.lockDeviceGetFBCSessions.RUnlock() + return calls +} + +// DeviceGetFBCStats calls DeviceGetFBCStatsFunc. +func (mock *Interface) DeviceGetFBCStats(device nvml.Device) (nvml.FBCStats, nvml.Return) { + if mock.DeviceGetFBCStatsFunc == nil { + panic("Interface.DeviceGetFBCStatsFunc: method is nil but Interface.DeviceGetFBCStats was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetFBCStats.Lock() + mock.calls.DeviceGetFBCStats = append(mock.calls.DeviceGetFBCStats, callInfo) + mock.lockDeviceGetFBCStats.Unlock() + return mock.DeviceGetFBCStatsFunc(device) +} + +// DeviceGetFBCStatsCalls gets all the calls that were made to DeviceGetFBCStats. +// Check the length with: +// +// len(mockedInterface.DeviceGetFBCStatsCalls()) +func (mock *Interface) DeviceGetFBCStatsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetFBCStats.RLock() + calls = mock.calls.DeviceGetFBCStats + mock.lockDeviceGetFBCStats.RUnlock() + return calls +} + +// DeviceGetFanControlPolicy_v2 calls DeviceGetFanControlPolicy_v2Func. +func (mock *Interface) DeviceGetFanControlPolicy_v2(device nvml.Device, n int) (nvml.FanControlPolicy, nvml.Return) { + if mock.DeviceGetFanControlPolicy_v2Func == nil { + panic("Interface.DeviceGetFanControlPolicy_v2Func: method is nil but Interface.DeviceGetFanControlPolicy_v2 was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetFanControlPolicy_v2.Lock() + mock.calls.DeviceGetFanControlPolicy_v2 = append(mock.calls.DeviceGetFanControlPolicy_v2, callInfo) + mock.lockDeviceGetFanControlPolicy_v2.Unlock() + return mock.DeviceGetFanControlPolicy_v2Func(device, n) +} + +// DeviceGetFanControlPolicy_v2Calls gets all the calls that were made to DeviceGetFanControlPolicy_v2. +// Check the length with: +// +// len(mockedInterface.DeviceGetFanControlPolicy_v2Calls()) +func (mock *Interface) DeviceGetFanControlPolicy_v2Calls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetFanControlPolicy_v2.RLock() + calls = mock.calls.DeviceGetFanControlPolicy_v2 + mock.lockDeviceGetFanControlPolicy_v2.RUnlock() + return calls +} + +// DeviceGetFanSpeed calls DeviceGetFanSpeedFunc. +func (mock *Interface) DeviceGetFanSpeed(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetFanSpeedFunc == nil { + panic("Interface.DeviceGetFanSpeedFunc: method is nil but Interface.DeviceGetFanSpeed was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetFanSpeed.Lock() + mock.calls.DeviceGetFanSpeed = append(mock.calls.DeviceGetFanSpeed, callInfo) + mock.lockDeviceGetFanSpeed.Unlock() + return mock.DeviceGetFanSpeedFunc(device) +} + +// DeviceGetFanSpeedCalls gets all the calls that were made to DeviceGetFanSpeed. +// Check the length with: +// +// len(mockedInterface.DeviceGetFanSpeedCalls()) +func (mock *Interface) DeviceGetFanSpeedCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetFanSpeed.RLock() + calls = mock.calls.DeviceGetFanSpeed + mock.lockDeviceGetFanSpeed.RUnlock() + return calls +} + +// DeviceGetFanSpeed_v2 calls DeviceGetFanSpeed_v2Func. +func (mock *Interface) DeviceGetFanSpeed_v2(device nvml.Device, n int) (uint32, nvml.Return) { + if mock.DeviceGetFanSpeed_v2Func == nil { + panic("Interface.DeviceGetFanSpeed_v2Func: method is nil but Interface.DeviceGetFanSpeed_v2 was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetFanSpeed_v2.Lock() + mock.calls.DeviceGetFanSpeed_v2 = append(mock.calls.DeviceGetFanSpeed_v2, callInfo) + mock.lockDeviceGetFanSpeed_v2.Unlock() + return mock.DeviceGetFanSpeed_v2Func(device, n) +} + +// DeviceGetFanSpeed_v2Calls gets all the calls that were made to DeviceGetFanSpeed_v2. +// Check the length with: +// +// len(mockedInterface.DeviceGetFanSpeed_v2Calls()) +func (mock *Interface) DeviceGetFanSpeed_v2Calls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetFanSpeed_v2.RLock() + calls = mock.calls.DeviceGetFanSpeed_v2 + mock.lockDeviceGetFanSpeed_v2.RUnlock() + return calls +} + +// DeviceGetFieldValues calls DeviceGetFieldValuesFunc. +func (mock *Interface) DeviceGetFieldValues(device nvml.Device, fieldValues []nvml.FieldValue) nvml.Return { + if mock.DeviceGetFieldValuesFunc == nil { + panic("Interface.DeviceGetFieldValuesFunc: method is nil but Interface.DeviceGetFieldValues was just called") + } + callInfo := struct { + Device nvml.Device + FieldValues []nvml.FieldValue + }{ + Device: device, + FieldValues: fieldValues, + } + mock.lockDeviceGetFieldValues.Lock() + mock.calls.DeviceGetFieldValues = append(mock.calls.DeviceGetFieldValues, callInfo) + mock.lockDeviceGetFieldValues.Unlock() + return mock.DeviceGetFieldValuesFunc(device, fieldValues) +} + +// DeviceGetFieldValuesCalls gets all the calls that were made to DeviceGetFieldValues. +// Check the length with: +// +// len(mockedInterface.DeviceGetFieldValuesCalls()) +func (mock *Interface) DeviceGetFieldValuesCalls() []struct { + Device nvml.Device + FieldValues []nvml.FieldValue +} { + var calls []struct { + Device nvml.Device + FieldValues []nvml.FieldValue + } + mock.lockDeviceGetFieldValues.RLock() + calls = mock.calls.DeviceGetFieldValues + mock.lockDeviceGetFieldValues.RUnlock() + return calls +} + +// DeviceGetGpcClkMinMaxVfOffset calls DeviceGetGpcClkMinMaxVfOffsetFunc. +func (mock *Interface) DeviceGetGpcClkMinMaxVfOffset(device nvml.Device) (int, int, nvml.Return) { + if mock.DeviceGetGpcClkMinMaxVfOffsetFunc == nil { + panic("Interface.DeviceGetGpcClkMinMaxVfOffsetFunc: method is nil but Interface.DeviceGetGpcClkMinMaxVfOffset was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGpcClkMinMaxVfOffset.Lock() + mock.calls.DeviceGetGpcClkMinMaxVfOffset = append(mock.calls.DeviceGetGpcClkMinMaxVfOffset, callInfo) + mock.lockDeviceGetGpcClkMinMaxVfOffset.Unlock() + return mock.DeviceGetGpcClkMinMaxVfOffsetFunc(device) +} + +// DeviceGetGpcClkMinMaxVfOffsetCalls gets all the calls that were made to DeviceGetGpcClkMinMaxVfOffset. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpcClkMinMaxVfOffsetCalls()) +func (mock *Interface) DeviceGetGpcClkMinMaxVfOffsetCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGpcClkMinMaxVfOffset.RLock() + calls = mock.calls.DeviceGetGpcClkMinMaxVfOffset + mock.lockDeviceGetGpcClkMinMaxVfOffset.RUnlock() + return calls +} + +// DeviceGetGpcClkVfOffset calls DeviceGetGpcClkVfOffsetFunc. +func (mock *Interface) DeviceGetGpcClkVfOffset(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetGpcClkVfOffsetFunc == nil { + panic("Interface.DeviceGetGpcClkVfOffsetFunc: method is nil but Interface.DeviceGetGpcClkVfOffset was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGpcClkVfOffset.Lock() + mock.calls.DeviceGetGpcClkVfOffset = append(mock.calls.DeviceGetGpcClkVfOffset, callInfo) + mock.lockDeviceGetGpcClkVfOffset.Unlock() + return mock.DeviceGetGpcClkVfOffsetFunc(device) +} + +// DeviceGetGpcClkVfOffsetCalls gets all the calls that were made to DeviceGetGpcClkVfOffset. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpcClkVfOffsetCalls()) +func (mock *Interface) DeviceGetGpcClkVfOffsetCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGpcClkVfOffset.RLock() + calls = mock.calls.DeviceGetGpcClkVfOffset + mock.lockDeviceGetGpcClkVfOffset.RUnlock() + return calls +} + +// DeviceGetGpuFabricInfo calls DeviceGetGpuFabricInfoFunc. +func (mock *Interface) DeviceGetGpuFabricInfo(device nvml.Device) (nvml.GpuFabricInfo, nvml.Return) { + if mock.DeviceGetGpuFabricInfoFunc == nil { + panic("Interface.DeviceGetGpuFabricInfoFunc: method is nil but Interface.DeviceGetGpuFabricInfo was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGpuFabricInfo.Lock() + mock.calls.DeviceGetGpuFabricInfo = append(mock.calls.DeviceGetGpuFabricInfo, callInfo) + mock.lockDeviceGetGpuFabricInfo.Unlock() + return mock.DeviceGetGpuFabricInfoFunc(device) +} + +// DeviceGetGpuFabricInfoCalls gets all the calls that were made to DeviceGetGpuFabricInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuFabricInfoCalls()) +func (mock *Interface) DeviceGetGpuFabricInfoCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGpuFabricInfo.RLock() + calls = mock.calls.DeviceGetGpuFabricInfo + mock.lockDeviceGetGpuFabricInfo.RUnlock() + return calls +} + +// DeviceGetGpuInstanceById calls DeviceGetGpuInstanceByIdFunc. +func (mock *Interface) DeviceGetGpuInstanceById(device nvml.Device, n int) (nvml.GpuInstance, nvml.Return) { + if mock.DeviceGetGpuInstanceByIdFunc == nil { + panic("Interface.DeviceGetGpuInstanceByIdFunc: method is nil but Interface.DeviceGetGpuInstanceById was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetGpuInstanceById.Lock() + mock.calls.DeviceGetGpuInstanceById = append(mock.calls.DeviceGetGpuInstanceById, callInfo) + mock.lockDeviceGetGpuInstanceById.Unlock() + return mock.DeviceGetGpuInstanceByIdFunc(device, n) +} + +// DeviceGetGpuInstanceByIdCalls gets all the calls that were made to DeviceGetGpuInstanceById. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuInstanceByIdCalls()) +func (mock *Interface) DeviceGetGpuInstanceByIdCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetGpuInstanceById.RLock() + calls = mock.calls.DeviceGetGpuInstanceById + mock.lockDeviceGetGpuInstanceById.RUnlock() + return calls +} + +// DeviceGetGpuInstanceId calls DeviceGetGpuInstanceIdFunc. +func (mock *Interface) DeviceGetGpuInstanceId(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetGpuInstanceIdFunc == nil { + panic("Interface.DeviceGetGpuInstanceIdFunc: method is nil but Interface.DeviceGetGpuInstanceId was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGpuInstanceId.Lock() + mock.calls.DeviceGetGpuInstanceId = append(mock.calls.DeviceGetGpuInstanceId, callInfo) + mock.lockDeviceGetGpuInstanceId.Unlock() + return mock.DeviceGetGpuInstanceIdFunc(device) +} + +// DeviceGetGpuInstanceIdCalls gets all the calls that were made to DeviceGetGpuInstanceId. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuInstanceIdCalls()) +func (mock *Interface) DeviceGetGpuInstanceIdCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGpuInstanceId.RLock() + calls = mock.calls.DeviceGetGpuInstanceId + mock.lockDeviceGetGpuInstanceId.RUnlock() + return calls +} + +// DeviceGetGpuInstancePossiblePlacements calls DeviceGetGpuInstancePossiblePlacementsFunc. +func (mock *Interface) DeviceGetGpuInstancePossiblePlacements(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstancePlacement, nvml.Return) { + if mock.DeviceGetGpuInstancePossiblePlacementsFunc == nil { + panic("Interface.DeviceGetGpuInstancePossiblePlacementsFunc: method is nil but Interface.DeviceGetGpuInstancePossiblePlacements was just called") + } + callInfo := struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + }{ + Device: device, + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + } + mock.lockDeviceGetGpuInstancePossiblePlacements.Lock() + mock.calls.DeviceGetGpuInstancePossiblePlacements = append(mock.calls.DeviceGetGpuInstancePossiblePlacements, callInfo) + mock.lockDeviceGetGpuInstancePossiblePlacements.Unlock() + return mock.DeviceGetGpuInstancePossiblePlacementsFunc(device, gpuInstanceProfileInfo) +} + +// DeviceGetGpuInstancePossiblePlacementsCalls gets all the calls that were made to DeviceGetGpuInstancePossiblePlacements. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuInstancePossiblePlacementsCalls()) +func (mock *Interface) DeviceGetGpuInstancePossiblePlacementsCalls() []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo +} { + var calls []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + mock.lockDeviceGetGpuInstancePossiblePlacements.RLock() + calls = mock.calls.DeviceGetGpuInstancePossiblePlacements + mock.lockDeviceGetGpuInstancePossiblePlacements.RUnlock() + return calls +} + +// DeviceGetGpuInstanceProfileInfo calls DeviceGetGpuInstanceProfileInfoFunc. +func (mock *Interface) DeviceGetGpuInstanceProfileInfo(device nvml.Device, n int) (nvml.GpuInstanceProfileInfo, nvml.Return) { + if mock.DeviceGetGpuInstanceProfileInfoFunc == nil { + panic("Interface.DeviceGetGpuInstanceProfileInfoFunc: method is nil but Interface.DeviceGetGpuInstanceProfileInfo was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetGpuInstanceProfileInfo.Lock() + mock.calls.DeviceGetGpuInstanceProfileInfo = append(mock.calls.DeviceGetGpuInstanceProfileInfo, callInfo) + mock.lockDeviceGetGpuInstanceProfileInfo.Unlock() + return mock.DeviceGetGpuInstanceProfileInfoFunc(device, n) +} + +// DeviceGetGpuInstanceProfileInfoCalls gets all the calls that were made to DeviceGetGpuInstanceProfileInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuInstanceProfileInfoCalls()) +func (mock *Interface) DeviceGetGpuInstanceProfileInfoCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetGpuInstanceProfileInfo.RLock() + calls = mock.calls.DeviceGetGpuInstanceProfileInfo + mock.lockDeviceGetGpuInstanceProfileInfo.RUnlock() + return calls +} + +// DeviceGetGpuInstanceProfileInfoV calls DeviceGetGpuInstanceProfileInfoVFunc. +func (mock *Interface) DeviceGetGpuInstanceProfileInfoV(device nvml.Device, n int) nvml.GpuInstanceProfileInfoV { + if mock.DeviceGetGpuInstanceProfileInfoVFunc == nil { + panic("Interface.DeviceGetGpuInstanceProfileInfoVFunc: method is nil but Interface.DeviceGetGpuInstanceProfileInfoV was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetGpuInstanceProfileInfoV.Lock() + mock.calls.DeviceGetGpuInstanceProfileInfoV = append(mock.calls.DeviceGetGpuInstanceProfileInfoV, callInfo) + mock.lockDeviceGetGpuInstanceProfileInfoV.Unlock() + return mock.DeviceGetGpuInstanceProfileInfoVFunc(device, n) +} + +// DeviceGetGpuInstanceProfileInfoVCalls gets all the calls that were made to DeviceGetGpuInstanceProfileInfoV. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuInstanceProfileInfoVCalls()) +func (mock *Interface) DeviceGetGpuInstanceProfileInfoVCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetGpuInstanceProfileInfoV.RLock() + calls = mock.calls.DeviceGetGpuInstanceProfileInfoV + mock.lockDeviceGetGpuInstanceProfileInfoV.RUnlock() + return calls +} + +// DeviceGetGpuInstanceRemainingCapacity calls DeviceGetGpuInstanceRemainingCapacityFunc. +func (mock *Interface) DeviceGetGpuInstanceRemainingCapacity(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) (int, nvml.Return) { + if mock.DeviceGetGpuInstanceRemainingCapacityFunc == nil { + panic("Interface.DeviceGetGpuInstanceRemainingCapacityFunc: method is nil but Interface.DeviceGetGpuInstanceRemainingCapacity was just called") + } + callInfo := struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + }{ + Device: device, + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + } + mock.lockDeviceGetGpuInstanceRemainingCapacity.Lock() + mock.calls.DeviceGetGpuInstanceRemainingCapacity = append(mock.calls.DeviceGetGpuInstanceRemainingCapacity, callInfo) + mock.lockDeviceGetGpuInstanceRemainingCapacity.Unlock() + return mock.DeviceGetGpuInstanceRemainingCapacityFunc(device, gpuInstanceProfileInfo) +} + +// DeviceGetGpuInstanceRemainingCapacityCalls gets all the calls that were made to DeviceGetGpuInstanceRemainingCapacity. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuInstanceRemainingCapacityCalls()) +func (mock *Interface) DeviceGetGpuInstanceRemainingCapacityCalls() []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo +} { + var calls []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + mock.lockDeviceGetGpuInstanceRemainingCapacity.RLock() + calls = mock.calls.DeviceGetGpuInstanceRemainingCapacity + mock.lockDeviceGetGpuInstanceRemainingCapacity.RUnlock() + return calls +} + +// DeviceGetGpuInstances calls DeviceGetGpuInstancesFunc. +func (mock *Interface) DeviceGetGpuInstances(device nvml.Device, gpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstance, nvml.Return) { + if mock.DeviceGetGpuInstancesFunc == nil { + panic("Interface.DeviceGetGpuInstancesFunc: method is nil but Interface.DeviceGetGpuInstances was just called") + } + callInfo := struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + }{ + Device: device, + GpuInstanceProfileInfo: gpuInstanceProfileInfo, + } + mock.lockDeviceGetGpuInstances.Lock() + mock.calls.DeviceGetGpuInstances = append(mock.calls.DeviceGetGpuInstances, callInfo) + mock.lockDeviceGetGpuInstances.Unlock() + return mock.DeviceGetGpuInstancesFunc(device, gpuInstanceProfileInfo) +} + +// DeviceGetGpuInstancesCalls gets all the calls that were made to DeviceGetGpuInstances. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuInstancesCalls()) +func (mock *Interface) DeviceGetGpuInstancesCalls() []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo +} { + var calls []struct { + Device nvml.Device + GpuInstanceProfileInfo *nvml.GpuInstanceProfileInfo + } + mock.lockDeviceGetGpuInstances.RLock() + calls = mock.calls.DeviceGetGpuInstances + mock.lockDeviceGetGpuInstances.RUnlock() + return calls +} + +// DeviceGetGpuMaxPcieLinkGeneration calls DeviceGetGpuMaxPcieLinkGenerationFunc. +func (mock *Interface) DeviceGetGpuMaxPcieLinkGeneration(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetGpuMaxPcieLinkGenerationFunc == nil { + panic("Interface.DeviceGetGpuMaxPcieLinkGenerationFunc: method is nil but Interface.DeviceGetGpuMaxPcieLinkGeneration was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGpuMaxPcieLinkGeneration.Lock() + mock.calls.DeviceGetGpuMaxPcieLinkGeneration = append(mock.calls.DeviceGetGpuMaxPcieLinkGeneration, callInfo) + mock.lockDeviceGetGpuMaxPcieLinkGeneration.Unlock() + return mock.DeviceGetGpuMaxPcieLinkGenerationFunc(device) +} + +// DeviceGetGpuMaxPcieLinkGenerationCalls gets all the calls that were made to DeviceGetGpuMaxPcieLinkGeneration. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuMaxPcieLinkGenerationCalls()) +func (mock *Interface) DeviceGetGpuMaxPcieLinkGenerationCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGpuMaxPcieLinkGeneration.RLock() + calls = mock.calls.DeviceGetGpuMaxPcieLinkGeneration + mock.lockDeviceGetGpuMaxPcieLinkGeneration.RUnlock() + return calls +} + +// DeviceGetGpuOperationMode calls DeviceGetGpuOperationModeFunc. +func (mock *Interface) DeviceGetGpuOperationMode(device nvml.Device) (nvml.GpuOperationMode, nvml.GpuOperationMode, nvml.Return) { + if mock.DeviceGetGpuOperationModeFunc == nil { + panic("Interface.DeviceGetGpuOperationModeFunc: method is nil but Interface.DeviceGetGpuOperationMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGpuOperationMode.Lock() + mock.calls.DeviceGetGpuOperationMode = append(mock.calls.DeviceGetGpuOperationMode, callInfo) + mock.lockDeviceGetGpuOperationMode.Unlock() + return mock.DeviceGetGpuOperationModeFunc(device) +} + +// DeviceGetGpuOperationModeCalls gets all the calls that were made to DeviceGetGpuOperationMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetGpuOperationModeCalls()) +func (mock *Interface) DeviceGetGpuOperationModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGpuOperationMode.RLock() + calls = mock.calls.DeviceGetGpuOperationMode + mock.lockDeviceGetGpuOperationMode.RUnlock() + return calls +} + +// DeviceGetGraphicsRunningProcesses calls DeviceGetGraphicsRunningProcessesFunc. +func (mock *Interface) DeviceGetGraphicsRunningProcesses(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) { + if mock.DeviceGetGraphicsRunningProcessesFunc == nil { + panic("Interface.DeviceGetGraphicsRunningProcessesFunc: method is nil but Interface.DeviceGetGraphicsRunningProcesses was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGraphicsRunningProcesses.Lock() + mock.calls.DeviceGetGraphicsRunningProcesses = append(mock.calls.DeviceGetGraphicsRunningProcesses, callInfo) + mock.lockDeviceGetGraphicsRunningProcesses.Unlock() + return mock.DeviceGetGraphicsRunningProcessesFunc(device) +} + +// DeviceGetGraphicsRunningProcessesCalls gets all the calls that were made to DeviceGetGraphicsRunningProcesses. +// Check the length with: +// +// len(mockedInterface.DeviceGetGraphicsRunningProcessesCalls()) +func (mock *Interface) DeviceGetGraphicsRunningProcessesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGraphicsRunningProcesses.RLock() + calls = mock.calls.DeviceGetGraphicsRunningProcesses + mock.lockDeviceGetGraphicsRunningProcesses.RUnlock() + return calls +} + +// DeviceGetGridLicensableFeatures calls DeviceGetGridLicensableFeaturesFunc. +func (mock *Interface) DeviceGetGridLicensableFeatures(device nvml.Device) (nvml.GridLicensableFeatures, nvml.Return) { + if mock.DeviceGetGridLicensableFeaturesFunc == nil { + panic("Interface.DeviceGetGridLicensableFeaturesFunc: method is nil but Interface.DeviceGetGridLicensableFeatures was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGridLicensableFeatures.Lock() + mock.calls.DeviceGetGridLicensableFeatures = append(mock.calls.DeviceGetGridLicensableFeatures, callInfo) + mock.lockDeviceGetGridLicensableFeatures.Unlock() + return mock.DeviceGetGridLicensableFeaturesFunc(device) +} + +// DeviceGetGridLicensableFeaturesCalls gets all the calls that were made to DeviceGetGridLicensableFeatures. +// Check the length with: +// +// len(mockedInterface.DeviceGetGridLicensableFeaturesCalls()) +func (mock *Interface) DeviceGetGridLicensableFeaturesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGridLicensableFeatures.RLock() + calls = mock.calls.DeviceGetGridLicensableFeatures + mock.lockDeviceGetGridLicensableFeatures.RUnlock() + return calls +} + +// DeviceGetGspFirmwareMode calls DeviceGetGspFirmwareModeFunc. +func (mock *Interface) DeviceGetGspFirmwareMode(device nvml.Device) (bool, bool, nvml.Return) { + if mock.DeviceGetGspFirmwareModeFunc == nil { + panic("Interface.DeviceGetGspFirmwareModeFunc: method is nil but Interface.DeviceGetGspFirmwareMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGspFirmwareMode.Lock() + mock.calls.DeviceGetGspFirmwareMode = append(mock.calls.DeviceGetGspFirmwareMode, callInfo) + mock.lockDeviceGetGspFirmwareMode.Unlock() + return mock.DeviceGetGspFirmwareModeFunc(device) +} + +// DeviceGetGspFirmwareModeCalls gets all the calls that were made to DeviceGetGspFirmwareMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetGspFirmwareModeCalls()) +func (mock *Interface) DeviceGetGspFirmwareModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGspFirmwareMode.RLock() + calls = mock.calls.DeviceGetGspFirmwareMode + mock.lockDeviceGetGspFirmwareMode.RUnlock() + return calls +} + +// DeviceGetGspFirmwareVersion calls DeviceGetGspFirmwareVersionFunc. +func (mock *Interface) DeviceGetGspFirmwareVersion(device nvml.Device) (string, nvml.Return) { + if mock.DeviceGetGspFirmwareVersionFunc == nil { + panic("Interface.DeviceGetGspFirmwareVersionFunc: method is nil but Interface.DeviceGetGspFirmwareVersion was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetGspFirmwareVersion.Lock() + mock.calls.DeviceGetGspFirmwareVersion = append(mock.calls.DeviceGetGspFirmwareVersion, callInfo) + mock.lockDeviceGetGspFirmwareVersion.Unlock() + return mock.DeviceGetGspFirmwareVersionFunc(device) +} + +// DeviceGetGspFirmwareVersionCalls gets all the calls that were made to DeviceGetGspFirmwareVersion. +// Check the length with: +// +// len(mockedInterface.DeviceGetGspFirmwareVersionCalls()) +func (mock *Interface) DeviceGetGspFirmwareVersionCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetGspFirmwareVersion.RLock() + calls = mock.calls.DeviceGetGspFirmwareVersion + mock.lockDeviceGetGspFirmwareVersion.RUnlock() + return calls +} + +// DeviceGetHandleByIndex calls DeviceGetHandleByIndexFunc. +func (mock *Interface) DeviceGetHandleByIndex(n int) (nvml.Device, nvml.Return) { + if mock.DeviceGetHandleByIndexFunc == nil { + panic("Interface.DeviceGetHandleByIndexFunc: method is nil but Interface.DeviceGetHandleByIndex was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockDeviceGetHandleByIndex.Lock() + mock.calls.DeviceGetHandleByIndex = append(mock.calls.DeviceGetHandleByIndex, callInfo) + mock.lockDeviceGetHandleByIndex.Unlock() + return mock.DeviceGetHandleByIndexFunc(n) +} + +// DeviceGetHandleByIndexCalls gets all the calls that were made to DeviceGetHandleByIndex. +// Check the length with: +// +// len(mockedInterface.DeviceGetHandleByIndexCalls()) +func (mock *Interface) DeviceGetHandleByIndexCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockDeviceGetHandleByIndex.RLock() + calls = mock.calls.DeviceGetHandleByIndex + mock.lockDeviceGetHandleByIndex.RUnlock() + return calls +} + +// DeviceGetHandleByPciBusId calls DeviceGetHandleByPciBusIdFunc. +func (mock *Interface) DeviceGetHandleByPciBusId(s string) (nvml.Device, nvml.Return) { + if mock.DeviceGetHandleByPciBusIdFunc == nil { + panic("Interface.DeviceGetHandleByPciBusIdFunc: method is nil but Interface.DeviceGetHandleByPciBusId was just called") + } + callInfo := struct { + S string + }{ + S: s, + } + mock.lockDeviceGetHandleByPciBusId.Lock() + mock.calls.DeviceGetHandleByPciBusId = append(mock.calls.DeviceGetHandleByPciBusId, callInfo) + mock.lockDeviceGetHandleByPciBusId.Unlock() + return mock.DeviceGetHandleByPciBusIdFunc(s) +} + +// DeviceGetHandleByPciBusIdCalls gets all the calls that were made to DeviceGetHandleByPciBusId. +// Check the length with: +// +// len(mockedInterface.DeviceGetHandleByPciBusIdCalls()) +func (mock *Interface) DeviceGetHandleByPciBusIdCalls() []struct { + S string +} { + var calls []struct { + S string + } + mock.lockDeviceGetHandleByPciBusId.RLock() + calls = mock.calls.DeviceGetHandleByPciBusId + mock.lockDeviceGetHandleByPciBusId.RUnlock() + return calls +} + +// DeviceGetHandleBySerial calls DeviceGetHandleBySerialFunc. +func (mock *Interface) DeviceGetHandleBySerial(s string) (nvml.Device, nvml.Return) { + if mock.DeviceGetHandleBySerialFunc == nil { + panic("Interface.DeviceGetHandleBySerialFunc: method is nil but Interface.DeviceGetHandleBySerial was just called") + } + callInfo := struct { + S string + }{ + S: s, + } + mock.lockDeviceGetHandleBySerial.Lock() + mock.calls.DeviceGetHandleBySerial = append(mock.calls.DeviceGetHandleBySerial, callInfo) + mock.lockDeviceGetHandleBySerial.Unlock() + return mock.DeviceGetHandleBySerialFunc(s) +} + +// DeviceGetHandleBySerialCalls gets all the calls that were made to DeviceGetHandleBySerial. +// Check the length with: +// +// len(mockedInterface.DeviceGetHandleBySerialCalls()) +func (mock *Interface) DeviceGetHandleBySerialCalls() []struct { + S string +} { + var calls []struct { + S string + } + mock.lockDeviceGetHandleBySerial.RLock() + calls = mock.calls.DeviceGetHandleBySerial + mock.lockDeviceGetHandleBySerial.RUnlock() + return calls +} + +// DeviceGetHandleByUUID calls DeviceGetHandleByUUIDFunc. +func (mock *Interface) DeviceGetHandleByUUID(s string) (nvml.Device, nvml.Return) { + if mock.DeviceGetHandleByUUIDFunc == nil { + panic("Interface.DeviceGetHandleByUUIDFunc: method is nil but Interface.DeviceGetHandleByUUID was just called") + } + callInfo := struct { + S string + }{ + S: s, + } + mock.lockDeviceGetHandleByUUID.Lock() + mock.calls.DeviceGetHandleByUUID = append(mock.calls.DeviceGetHandleByUUID, callInfo) + mock.lockDeviceGetHandleByUUID.Unlock() + return mock.DeviceGetHandleByUUIDFunc(s) +} + +// DeviceGetHandleByUUIDCalls gets all the calls that were made to DeviceGetHandleByUUID. +// Check the length with: +// +// len(mockedInterface.DeviceGetHandleByUUIDCalls()) +func (mock *Interface) DeviceGetHandleByUUIDCalls() []struct { + S string +} { + var calls []struct { + S string + } + mock.lockDeviceGetHandleByUUID.RLock() + calls = mock.calls.DeviceGetHandleByUUID + mock.lockDeviceGetHandleByUUID.RUnlock() + return calls +} + +// DeviceGetHostVgpuMode calls DeviceGetHostVgpuModeFunc. +func (mock *Interface) DeviceGetHostVgpuMode(device nvml.Device) (nvml.HostVgpuMode, nvml.Return) { + if mock.DeviceGetHostVgpuModeFunc == nil { + panic("Interface.DeviceGetHostVgpuModeFunc: method is nil but Interface.DeviceGetHostVgpuMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetHostVgpuMode.Lock() + mock.calls.DeviceGetHostVgpuMode = append(mock.calls.DeviceGetHostVgpuMode, callInfo) + mock.lockDeviceGetHostVgpuMode.Unlock() + return mock.DeviceGetHostVgpuModeFunc(device) +} + +// DeviceGetHostVgpuModeCalls gets all the calls that were made to DeviceGetHostVgpuMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetHostVgpuModeCalls()) +func (mock *Interface) DeviceGetHostVgpuModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetHostVgpuMode.RLock() + calls = mock.calls.DeviceGetHostVgpuMode + mock.lockDeviceGetHostVgpuMode.RUnlock() + return calls +} + +// DeviceGetIndex calls DeviceGetIndexFunc. +func (mock *Interface) DeviceGetIndex(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetIndexFunc == nil { + panic("Interface.DeviceGetIndexFunc: method is nil but Interface.DeviceGetIndex was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetIndex.Lock() + mock.calls.DeviceGetIndex = append(mock.calls.DeviceGetIndex, callInfo) + mock.lockDeviceGetIndex.Unlock() + return mock.DeviceGetIndexFunc(device) +} + +// DeviceGetIndexCalls gets all the calls that were made to DeviceGetIndex. +// Check the length with: +// +// len(mockedInterface.DeviceGetIndexCalls()) +func (mock *Interface) DeviceGetIndexCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetIndex.RLock() + calls = mock.calls.DeviceGetIndex + mock.lockDeviceGetIndex.RUnlock() + return calls +} + +// DeviceGetInforomConfigurationChecksum calls DeviceGetInforomConfigurationChecksumFunc. +func (mock *Interface) DeviceGetInforomConfigurationChecksum(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetInforomConfigurationChecksumFunc == nil { + panic("Interface.DeviceGetInforomConfigurationChecksumFunc: method is nil but Interface.DeviceGetInforomConfigurationChecksum was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetInforomConfigurationChecksum.Lock() + mock.calls.DeviceGetInforomConfigurationChecksum = append(mock.calls.DeviceGetInforomConfigurationChecksum, callInfo) + mock.lockDeviceGetInforomConfigurationChecksum.Unlock() + return mock.DeviceGetInforomConfigurationChecksumFunc(device) +} + +// DeviceGetInforomConfigurationChecksumCalls gets all the calls that were made to DeviceGetInforomConfigurationChecksum. +// Check the length with: +// +// len(mockedInterface.DeviceGetInforomConfigurationChecksumCalls()) +func (mock *Interface) DeviceGetInforomConfigurationChecksumCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetInforomConfigurationChecksum.RLock() + calls = mock.calls.DeviceGetInforomConfigurationChecksum + mock.lockDeviceGetInforomConfigurationChecksum.RUnlock() + return calls +} + +// DeviceGetInforomImageVersion calls DeviceGetInforomImageVersionFunc. +func (mock *Interface) DeviceGetInforomImageVersion(device nvml.Device) (string, nvml.Return) { + if mock.DeviceGetInforomImageVersionFunc == nil { + panic("Interface.DeviceGetInforomImageVersionFunc: method is nil but Interface.DeviceGetInforomImageVersion was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetInforomImageVersion.Lock() + mock.calls.DeviceGetInforomImageVersion = append(mock.calls.DeviceGetInforomImageVersion, callInfo) + mock.lockDeviceGetInforomImageVersion.Unlock() + return mock.DeviceGetInforomImageVersionFunc(device) +} + +// DeviceGetInforomImageVersionCalls gets all the calls that were made to DeviceGetInforomImageVersion. +// Check the length with: +// +// len(mockedInterface.DeviceGetInforomImageVersionCalls()) +func (mock *Interface) DeviceGetInforomImageVersionCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetInforomImageVersion.RLock() + calls = mock.calls.DeviceGetInforomImageVersion + mock.lockDeviceGetInforomImageVersion.RUnlock() + return calls +} + +// DeviceGetInforomVersion calls DeviceGetInforomVersionFunc. +func (mock *Interface) DeviceGetInforomVersion(device nvml.Device, inforomObject nvml.InforomObject) (string, nvml.Return) { + if mock.DeviceGetInforomVersionFunc == nil { + panic("Interface.DeviceGetInforomVersionFunc: method is nil but Interface.DeviceGetInforomVersion was just called") + } + callInfo := struct { + Device nvml.Device + InforomObject nvml.InforomObject + }{ + Device: device, + InforomObject: inforomObject, + } + mock.lockDeviceGetInforomVersion.Lock() + mock.calls.DeviceGetInforomVersion = append(mock.calls.DeviceGetInforomVersion, callInfo) + mock.lockDeviceGetInforomVersion.Unlock() + return mock.DeviceGetInforomVersionFunc(device, inforomObject) +} + +// DeviceGetInforomVersionCalls gets all the calls that were made to DeviceGetInforomVersion. +// Check the length with: +// +// len(mockedInterface.DeviceGetInforomVersionCalls()) +func (mock *Interface) DeviceGetInforomVersionCalls() []struct { + Device nvml.Device + InforomObject nvml.InforomObject +} { + var calls []struct { + Device nvml.Device + InforomObject nvml.InforomObject + } + mock.lockDeviceGetInforomVersion.RLock() + calls = mock.calls.DeviceGetInforomVersion + mock.lockDeviceGetInforomVersion.RUnlock() + return calls +} + +// DeviceGetIrqNum calls DeviceGetIrqNumFunc. +func (mock *Interface) DeviceGetIrqNum(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetIrqNumFunc == nil { + panic("Interface.DeviceGetIrqNumFunc: method is nil but Interface.DeviceGetIrqNum was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetIrqNum.Lock() + mock.calls.DeviceGetIrqNum = append(mock.calls.DeviceGetIrqNum, callInfo) + mock.lockDeviceGetIrqNum.Unlock() + return mock.DeviceGetIrqNumFunc(device) +} + +// DeviceGetIrqNumCalls gets all the calls that were made to DeviceGetIrqNum. +// Check the length with: +// +// len(mockedInterface.DeviceGetIrqNumCalls()) +func (mock *Interface) DeviceGetIrqNumCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetIrqNum.RLock() + calls = mock.calls.DeviceGetIrqNum + mock.lockDeviceGetIrqNum.RUnlock() + return calls +} + +// DeviceGetMPSComputeRunningProcesses calls DeviceGetMPSComputeRunningProcessesFunc. +func (mock *Interface) DeviceGetMPSComputeRunningProcesses(device nvml.Device) ([]nvml.ProcessInfo, nvml.Return) { + if mock.DeviceGetMPSComputeRunningProcessesFunc == nil { + panic("Interface.DeviceGetMPSComputeRunningProcessesFunc: method is nil but Interface.DeviceGetMPSComputeRunningProcesses was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMPSComputeRunningProcesses.Lock() + mock.calls.DeviceGetMPSComputeRunningProcesses = append(mock.calls.DeviceGetMPSComputeRunningProcesses, callInfo) + mock.lockDeviceGetMPSComputeRunningProcesses.Unlock() + return mock.DeviceGetMPSComputeRunningProcessesFunc(device) +} + +// DeviceGetMPSComputeRunningProcessesCalls gets all the calls that were made to DeviceGetMPSComputeRunningProcesses. +// Check the length with: +// +// len(mockedInterface.DeviceGetMPSComputeRunningProcessesCalls()) +func (mock *Interface) DeviceGetMPSComputeRunningProcessesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMPSComputeRunningProcesses.RLock() + calls = mock.calls.DeviceGetMPSComputeRunningProcesses + mock.lockDeviceGetMPSComputeRunningProcesses.RUnlock() + return calls +} + +// DeviceGetMaxClockInfo calls DeviceGetMaxClockInfoFunc. +func (mock *Interface) DeviceGetMaxClockInfo(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.DeviceGetMaxClockInfoFunc == nil { + panic("Interface.DeviceGetMaxClockInfoFunc: method is nil but Interface.DeviceGetMaxClockInfo was just called") + } + callInfo := struct { + Device nvml.Device + ClockType nvml.ClockType + }{ + Device: device, + ClockType: clockType, + } + mock.lockDeviceGetMaxClockInfo.Lock() + mock.calls.DeviceGetMaxClockInfo = append(mock.calls.DeviceGetMaxClockInfo, callInfo) + mock.lockDeviceGetMaxClockInfo.Unlock() + return mock.DeviceGetMaxClockInfoFunc(device, clockType) +} + +// DeviceGetMaxClockInfoCalls gets all the calls that were made to DeviceGetMaxClockInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetMaxClockInfoCalls()) +func (mock *Interface) DeviceGetMaxClockInfoCalls() []struct { + Device nvml.Device + ClockType nvml.ClockType +} { + var calls []struct { + Device nvml.Device + ClockType nvml.ClockType + } + mock.lockDeviceGetMaxClockInfo.RLock() + calls = mock.calls.DeviceGetMaxClockInfo + mock.lockDeviceGetMaxClockInfo.RUnlock() + return calls +} + +// DeviceGetMaxCustomerBoostClock calls DeviceGetMaxCustomerBoostClockFunc. +func (mock *Interface) DeviceGetMaxCustomerBoostClock(device nvml.Device, clockType nvml.ClockType) (uint32, nvml.Return) { + if mock.DeviceGetMaxCustomerBoostClockFunc == nil { + panic("Interface.DeviceGetMaxCustomerBoostClockFunc: method is nil but Interface.DeviceGetMaxCustomerBoostClock was just called") + } + callInfo := struct { + Device nvml.Device + ClockType nvml.ClockType + }{ + Device: device, + ClockType: clockType, + } + mock.lockDeviceGetMaxCustomerBoostClock.Lock() + mock.calls.DeviceGetMaxCustomerBoostClock = append(mock.calls.DeviceGetMaxCustomerBoostClock, callInfo) + mock.lockDeviceGetMaxCustomerBoostClock.Unlock() + return mock.DeviceGetMaxCustomerBoostClockFunc(device, clockType) +} + +// DeviceGetMaxCustomerBoostClockCalls gets all the calls that were made to DeviceGetMaxCustomerBoostClock. +// Check the length with: +// +// len(mockedInterface.DeviceGetMaxCustomerBoostClockCalls()) +func (mock *Interface) DeviceGetMaxCustomerBoostClockCalls() []struct { + Device nvml.Device + ClockType nvml.ClockType +} { + var calls []struct { + Device nvml.Device + ClockType nvml.ClockType + } + mock.lockDeviceGetMaxCustomerBoostClock.RLock() + calls = mock.calls.DeviceGetMaxCustomerBoostClock + mock.lockDeviceGetMaxCustomerBoostClock.RUnlock() + return calls +} + +// DeviceGetMaxMigDeviceCount calls DeviceGetMaxMigDeviceCountFunc. +func (mock *Interface) DeviceGetMaxMigDeviceCount(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetMaxMigDeviceCountFunc == nil { + panic("Interface.DeviceGetMaxMigDeviceCountFunc: method is nil but Interface.DeviceGetMaxMigDeviceCount was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMaxMigDeviceCount.Lock() + mock.calls.DeviceGetMaxMigDeviceCount = append(mock.calls.DeviceGetMaxMigDeviceCount, callInfo) + mock.lockDeviceGetMaxMigDeviceCount.Unlock() + return mock.DeviceGetMaxMigDeviceCountFunc(device) +} + +// DeviceGetMaxMigDeviceCountCalls gets all the calls that were made to DeviceGetMaxMigDeviceCount. +// Check the length with: +// +// len(mockedInterface.DeviceGetMaxMigDeviceCountCalls()) +func (mock *Interface) DeviceGetMaxMigDeviceCountCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMaxMigDeviceCount.RLock() + calls = mock.calls.DeviceGetMaxMigDeviceCount + mock.lockDeviceGetMaxMigDeviceCount.RUnlock() + return calls +} + +// DeviceGetMaxPcieLinkGeneration calls DeviceGetMaxPcieLinkGenerationFunc. +func (mock *Interface) DeviceGetMaxPcieLinkGeneration(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetMaxPcieLinkGenerationFunc == nil { + panic("Interface.DeviceGetMaxPcieLinkGenerationFunc: method is nil but Interface.DeviceGetMaxPcieLinkGeneration was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMaxPcieLinkGeneration.Lock() + mock.calls.DeviceGetMaxPcieLinkGeneration = append(mock.calls.DeviceGetMaxPcieLinkGeneration, callInfo) + mock.lockDeviceGetMaxPcieLinkGeneration.Unlock() + return mock.DeviceGetMaxPcieLinkGenerationFunc(device) +} + +// DeviceGetMaxPcieLinkGenerationCalls gets all the calls that were made to DeviceGetMaxPcieLinkGeneration. +// Check the length with: +// +// len(mockedInterface.DeviceGetMaxPcieLinkGenerationCalls()) +func (mock *Interface) DeviceGetMaxPcieLinkGenerationCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMaxPcieLinkGeneration.RLock() + calls = mock.calls.DeviceGetMaxPcieLinkGeneration + mock.lockDeviceGetMaxPcieLinkGeneration.RUnlock() + return calls +} + +// DeviceGetMaxPcieLinkWidth calls DeviceGetMaxPcieLinkWidthFunc. +func (mock *Interface) DeviceGetMaxPcieLinkWidth(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetMaxPcieLinkWidthFunc == nil { + panic("Interface.DeviceGetMaxPcieLinkWidthFunc: method is nil but Interface.DeviceGetMaxPcieLinkWidth was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMaxPcieLinkWidth.Lock() + mock.calls.DeviceGetMaxPcieLinkWidth = append(mock.calls.DeviceGetMaxPcieLinkWidth, callInfo) + mock.lockDeviceGetMaxPcieLinkWidth.Unlock() + return mock.DeviceGetMaxPcieLinkWidthFunc(device) +} + +// DeviceGetMaxPcieLinkWidthCalls gets all the calls that were made to DeviceGetMaxPcieLinkWidth. +// Check the length with: +// +// len(mockedInterface.DeviceGetMaxPcieLinkWidthCalls()) +func (mock *Interface) DeviceGetMaxPcieLinkWidthCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMaxPcieLinkWidth.RLock() + calls = mock.calls.DeviceGetMaxPcieLinkWidth + mock.lockDeviceGetMaxPcieLinkWidth.RUnlock() + return calls +} + +// DeviceGetMemClkMinMaxVfOffset calls DeviceGetMemClkMinMaxVfOffsetFunc. +func (mock *Interface) DeviceGetMemClkMinMaxVfOffset(device nvml.Device) (int, int, nvml.Return) { + if mock.DeviceGetMemClkMinMaxVfOffsetFunc == nil { + panic("Interface.DeviceGetMemClkMinMaxVfOffsetFunc: method is nil but Interface.DeviceGetMemClkMinMaxVfOffset was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMemClkMinMaxVfOffset.Lock() + mock.calls.DeviceGetMemClkMinMaxVfOffset = append(mock.calls.DeviceGetMemClkMinMaxVfOffset, callInfo) + mock.lockDeviceGetMemClkMinMaxVfOffset.Unlock() + return mock.DeviceGetMemClkMinMaxVfOffsetFunc(device) +} + +// DeviceGetMemClkMinMaxVfOffsetCalls gets all the calls that were made to DeviceGetMemClkMinMaxVfOffset. +// Check the length with: +// +// len(mockedInterface.DeviceGetMemClkMinMaxVfOffsetCalls()) +func (mock *Interface) DeviceGetMemClkMinMaxVfOffsetCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMemClkMinMaxVfOffset.RLock() + calls = mock.calls.DeviceGetMemClkMinMaxVfOffset + mock.lockDeviceGetMemClkMinMaxVfOffset.RUnlock() + return calls +} + +// DeviceGetMemClkVfOffset calls DeviceGetMemClkVfOffsetFunc. +func (mock *Interface) DeviceGetMemClkVfOffset(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetMemClkVfOffsetFunc == nil { + panic("Interface.DeviceGetMemClkVfOffsetFunc: method is nil but Interface.DeviceGetMemClkVfOffset was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMemClkVfOffset.Lock() + mock.calls.DeviceGetMemClkVfOffset = append(mock.calls.DeviceGetMemClkVfOffset, callInfo) + mock.lockDeviceGetMemClkVfOffset.Unlock() + return mock.DeviceGetMemClkVfOffsetFunc(device) +} + +// DeviceGetMemClkVfOffsetCalls gets all the calls that were made to DeviceGetMemClkVfOffset. +// Check the length with: +// +// len(mockedInterface.DeviceGetMemClkVfOffsetCalls()) +func (mock *Interface) DeviceGetMemClkVfOffsetCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMemClkVfOffset.RLock() + calls = mock.calls.DeviceGetMemClkVfOffset + mock.lockDeviceGetMemClkVfOffset.RUnlock() + return calls +} + +// DeviceGetMemoryAffinity calls DeviceGetMemoryAffinityFunc. +func (mock *Interface) DeviceGetMemoryAffinity(device nvml.Device, n int, affinityScope nvml.AffinityScope) ([]uint, nvml.Return) { + if mock.DeviceGetMemoryAffinityFunc == nil { + panic("Interface.DeviceGetMemoryAffinityFunc: method is nil but Interface.DeviceGetMemoryAffinity was just called") + } + callInfo := struct { + Device nvml.Device + N int + AffinityScope nvml.AffinityScope + }{ + Device: device, + N: n, + AffinityScope: affinityScope, + } + mock.lockDeviceGetMemoryAffinity.Lock() + mock.calls.DeviceGetMemoryAffinity = append(mock.calls.DeviceGetMemoryAffinity, callInfo) + mock.lockDeviceGetMemoryAffinity.Unlock() + return mock.DeviceGetMemoryAffinityFunc(device, n, affinityScope) +} + +// DeviceGetMemoryAffinityCalls gets all the calls that were made to DeviceGetMemoryAffinity. +// Check the length with: +// +// len(mockedInterface.DeviceGetMemoryAffinityCalls()) +func (mock *Interface) DeviceGetMemoryAffinityCalls() []struct { + Device nvml.Device + N int + AffinityScope nvml.AffinityScope +} { + var calls []struct { + Device nvml.Device + N int + AffinityScope nvml.AffinityScope + } + mock.lockDeviceGetMemoryAffinity.RLock() + calls = mock.calls.DeviceGetMemoryAffinity + mock.lockDeviceGetMemoryAffinity.RUnlock() + return calls +} + +// DeviceGetMemoryBusWidth calls DeviceGetMemoryBusWidthFunc. +func (mock *Interface) DeviceGetMemoryBusWidth(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetMemoryBusWidthFunc == nil { + panic("Interface.DeviceGetMemoryBusWidthFunc: method is nil but Interface.DeviceGetMemoryBusWidth was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMemoryBusWidth.Lock() + mock.calls.DeviceGetMemoryBusWidth = append(mock.calls.DeviceGetMemoryBusWidth, callInfo) + mock.lockDeviceGetMemoryBusWidth.Unlock() + return mock.DeviceGetMemoryBusWidthFunc(device) +} + +// DeviceGetMemoryBusWidthCalls gets all the calls that were made to DeviceGetMemoryBusWidth. +// Check the length with: +// +// len(mockedInterface.DeviceGetMemoryBusWidthCalls()) +func (mock *Interface) DeviceGetMemoryBusWidthCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMemoryBusWidth.RLock() + calls = mock.calls.DeviceGetMemoryBusWidth + mock.lockDeviceGetMemoryBusWidth.RUnlock() + return calls +} + +// DeviceGetMemoryErrorCounter calls DeviceGetMemoryErrorCounterFunc. +func (mock *Interface) DeviceGetMemoryErrorCounter(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType, memoryLocation nvml.MemoryLocation) (uint64, nvml.Return) { + if mock.DeviceGetMemoryErrorCounterFunc == nil { + panic("Interface.DeviceGetMemoryErrorCounterFunc: method is nil but Interface.DeviceGetMemoryErrorCounter was just called") + } + callInfo := struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + MemoryLocation nvml.MemoryLocation + }{ + Device: device, + MemoryErrorType: memoryErrorType, + EccCounterType: eccCounterType, + MemoryLocation: memoryLocation, + } + mock.lockDeviceGetMemoryErrorCounter.Lock() + mock.calls.DeviceGetMemoryErrorCounter = append(mock.calls.DeviceGetMemoryErrorCounter, callInfo) + mock.lockDeviceGetMemoryErrorCounter.Unlock() + return mock.DeviceGetMemoryErrorCounterFunc(device, memoryErrorType, eccCounterType, memoryLocation) +} + +// DeviceGetMemoryErrorCounterCalls gets all the calls that were made to DeviceGetMemoryErrorCounter. +// Check the length with: +// +// len(mockedInterface.DeviceGetMemoryErrorCounterCalls()) +func (mock *Interface) DeviceGetMemoryErrorCounterCalls() []struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + MemoryLocation nvml.MemoryLocation +} { + var calls []struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + MemoryLocation nvml.MemoryLocation + } + mock.lockDeviceGetMemoryErrorCounter.RLock() + calls = mock.calls.DeviceGetMemoryErrorCounter + mock.lockDeviceGetMemoryErrorCounter.RUnlock() + return calls +} + +// DeviceGetMemoryInfo calls DeviceGetMemoryInfoFunc. +func (mock *Interface) DeviceGetMemoryInfo(device nvml.Device) (nvml.Memory, nvml.Return) { + if mock.DeviceGetMemoryInfoFunc == nil { + panic("Interface.DeviceGetMemoryInfoFunc: method is nil but Interface.DeviceGetMemoryInfo was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMemoryInfo.Lock() + mock.calls.DeviceGetMemoryInfo = append(mock.calls.DeviceGetMemoryInfo, callInfo) + mock.lockDeviceGetMemoryInfo.Unlock() + return mock.DeviceGetMemoryInfoFunc(device) +} + +// DeviceGetMemoryInfoCalls gets all the calls that were made to DeviceGetMemoryInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetMemoryInfoCalls()) +func (mock *Interface) DeviceGetMemoryInfoCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMemoryInfo.RLock() + calls = mock.calls.DeviceGetMemoryInfo + mock.lockDeviceGetMemoryInfo.RUnlock() + return calls +} + +// DeviceGetMemoryInfo_v2 calls DeviceGetMemoryInfo_v2Func. +func (mock *Interface) DeviceGetMemoryInfo_v2(device nvml.Device) (nvml.Memory_v2, nvml.Return) { + if mock.DeviceGetMemoryInfo_v2Func == nil { + panic("Interface.DeviceGetMemoryInfo_v2Func: method is nil but Interface.DeviceGetMemoryInfo_v2 was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMemoryInfo_v2.Lock() + mock.calls.DeviceGetMemoryInfo_v2 = append(mock.calls.DeviceGetMemoryInfo_v2, callInfo) + mock.lockDeviceGetMemoryInfo_v2.Unlock() + return mock.DeviceGetMemoryInfo_v2Func(device) +} + +// DeviceGetMemoryInfo_v2Calls gets all the calls that were made to DeviceGetMemoryInfo_v2. +// Check the length with: +// +// len(mockedInterface.DeviceGetMemoryInfo_v2Calls()) +func (mock *Interface) DeviceGetMemoryInfo_v2Calls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMemoryInfo_v2.RLock() + calls = mock.calls.DeviceGetMemoryInfo_v2 + mock.lockDeviceGetMemoryInfo_v2.RUnlock() + return calls +} + +// DeviceGetMigDeviceHandleByIndex calls DeviceGetMigDeviceHandleByIndexFunc. +func (mock *Interface) DeviceGetMigDeviceHandleByIndex(device nvml.Device, n int) (nvml.Device, nvml.Return) { + if mock.DeviceGetMigDeviceHandleByIndexFunc == nil { + panic("Interface.DeviceGetMigDeviceHandleByIndexFunc: method is nil but Interface.DeviceGetMigDeviceHandleByIndex was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetMigDeviceHandleByIndex.Lock() + mock.calls.DeviceGetMigDeviceHandleByIndex = append(mock.calls.DeviceGetMigDeviceHandleByIndex, callInfo) + mock.lockDeviceGetMigDeviceHandleByIndex.Unlock() + return mock.DeviceGetMigDeviceHandleByIndexFunc(device, n) +} + +// DeviceGetMigDeviceHandleByIndexCalls gets all the calls that were made to DeviceGetMigDeviceHandleByIndex. +// Check the length with: +// +// len(mockedInterface.DeviceGetMigDeviceHandleByIndexCalls()) +func (mock *Interface) DeviceGetMigDeviceHandleByIndexCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetMigDeviceHandleByIndex.RLock() + calls = mock.calls.DeviceGetMigDeviceHandleByIndex + mock.lockDeviceGetMigDeviceHandleByIndex.RUnlock() + return calls +} + +// DeviceGetMigMode calls DeviceGetMigModeFunc. +func (mock *Interface) DeviceGetMigMode(device nvml.Device) (int, int, nvml.Return) { + if mock.DeviceGetMigModeFunc == nil { + panic("Interface.DeviceGetMigModeFunc: method is nil but Interface.DeviceGetMigMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMigMode.Lock() + mock.calls.DeviceGetMigMode = append(mock.calls.DeviceGetMigMode, callInfo) + mock.lockDeviceGetMigMode.Unlock() + return mock.DeviceGetMigModeFunc(device) +} + +// DeviceGetMigModeCalls gets all the calls that were made to DeviceGetMigMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetMigModeCalls()) +func (mock *Interface) DeviceGetMigModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMigMode.RLock() + calls = mock.calls.DeviceGetMigMode + mock.lockDeviceGetMigMode.RUnlock() + return calls +} + +// DeviceGetMinMaxClockOfPState calls DeviceGetMinMaxClockOfPStateFunc. +func (mock *Interface) DeviceGetMinMaxClockOfPState(device nvml.Device, clockType nvml.ClockType, pstates nvml.Pstates) (uint32, uint32, nvml.Return) { + if mock.DeviceGetMinMaxClockOfPStateFunc == nil { + panic("Interface.DeviceGetMinMaxClockOfPStateFunc: method is nil but Interface.DeviceGetMinMaxClockOfPState was just called") + } + callInfo := struct { + Device nvml.Device + ClockType nvml.ClockType + Pstates nvml.Pstates + }{ + Device: device, + ClockType: clockType, + Pstates: pstates, + } + mock.lockDeviceGetMinMaxClockOfPState.Lock() + mock.calls.DeviceGetMinMaxClockOfPState = append(mock.calls.DeviceGetMinMaxClockOfPState, callInfo) + mock.lockDeviceGetMinMaxClockOfPState.Unlock() + return mock.DeviceGetMinMaxClockOfPStateFunc(device, clockType, pstates) +} + +// DeviceGetMinMaxClockOfPStateCalls gets all the calls that were made to DeviceGetMinMaxClockOfPState. +// Check the length with: +// +// len(mockedInterface.DeviceGetMinMaxClockOfPStateCalls()) +func (mock *Interface) DeviceGetMinMaxClockOfPStateCalls() []struct { + Device nvml.Device + ClockType nvml.ClockType + Pstates nvml.Pstates +} { + var calls []struct { + Device nvml.Device + ClockType nvml.ClockType + Pstates nvml.Pstates + } + mock.lockDeviceGetMinMaxClockOfPState.RLock() + calls = mock.calls.DeviceGetMinMaxClockOfPState + mock.lockDeviceGetMinMaxClockOfPState.RUnlock() + return calls +} + +// DeviceGetMinMaxFanSpeed calls DeviceGetMinMaxFanSpeedFunc. +func (mock *Interface) DeviceGetMinMaxFanSpeed(device nvml.Device) (int, int, nvml.Return) { + if mock.DeviceGetMinMaxFanSpeedFunc == nil { + panic("Interface.DeviceGetMinMaxFanSpeedFunc: method is nil but Interface.DeviceGetMinMaxFanSpeed was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMinMaxFanSpeed.Lock() + mock.calls.DeviceGetMinMaxFanSpeed = append(mock.calls.DeviceGetMinMaxFanSpeed, callInfo) + mock.lockDeviceGetMinMaxFanSpeed.Unlock() + return mock.DeviceGetMinMaxFanSpeedFunc(device) +} + +// DeviceGetMinMaxFanSpeedCalls gets all the calls that were made to DeviceGetMinMaxFanSpeed. +// Check the length with: +// +// len(mockedInterface.DeviceGetMinMaxFanSpeedCalls()) +func (mock *Interface) DeviceGetMinMaxFanSpeedCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMinMaxFanSpeed.RLock() + calls = mock.calls.DeviceGetMinMaxFanSpeed + mock.lockDeviceGetMinMaxFanSpeed.RUnlock() + return calls +} + +// DeviceGetMinorNumber calls DeviceGetMinorNumberFunc. +func (mock *Interface) DeviceGetMinorNumber(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetMinorNumberFunc == nil { + panic("Interface.DeviceGetMinorNumberFunc: method is nil but Interface.DeviceGetMinorNumber was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMinorNumber.Lock() + mock.calls.DeviceGetMinorNumber = append(mock.calls.DeviceGetMinorNumber, callInfo) + mock.lockDeviceGetMinorNumber.Unlock() + return mock.DeviceGetMinorNumberFunc(device) +} + +// DeviceGetMinorNumberCalls gets all the calls that were made to DeviceGetMinorNumber. +// Check the length with: +// +// len(mockedInterface.DeviceGetMinorNumberCalls()) +func (mock *Interface) DeviceGetMinorNumberCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMinorNumber.RLock() + calls = mock.calls.DeviceGetMinorNumber + mock.lockDeviceGetMinorNumber.RUnlock() + return calls +} + +// DeviceGetMultiGpuBoard calls DeviceGetMultiGpuBoardFunc. +func (mock *Interface) DeviceGetMultiGpuBoard(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetMultiGpuBoardFunc == nil { + panic("Interface.DeviceGetMultiGpuBoardFunc: method is nil but Interface.DeviceGetMultiGpuBoard was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetMultiGpuBoard.Lock() + mock.calls.DeviceGetMultiGpuBoard = append(mock.calls.DeviceGetMultiGpuBoard, callInfo) + mock.lockDeviceGetMultiGpuBoard.Unlock() + return mock.DeviceGetMultiGpuBoardFunc(device) +} + +// DeviceGetMultiGpuBoardCalls gets all the calls that were made to DeviceGetMultiGpuBoard. +// Check the length with: +// +// len(mockedInterface.DeviceGetMultiGpuBoardCalls()) +func (mock *Interface) DeviceGetMultiGpuBoardCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetMultiGpuBoard.RLock() + calls = mock.calls.DeviceGetMultiGpuBoard + mock.lockDeviceGetMultiGpuBoard.RUnlock() + return calls +} + +// DeviceGetName calls DeviceGetNameFunc. +func (mock *Interface) DeviceGetName(device nvml.Device) (string, nvml.Return) { + if mock.DeviceGetNameFunc == nil { + panic("Interface.DeviceGetNameFunc: method is nil but Interface.DeviceGetName was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetName.Lock() + mock.calls.DeviceGetName = append(mock.calls.DeviceGetName, callInfo) + mock.lockDeviceGetName.Unlock() + return mock.DeviceGetNameFunc(device) +} + +// DeviceGetNameCalls gets all the calls that were made to DeviceGetName. +// Check the length with: +// +// len(mockedInterface.DeviceGetNameCalls()) +func (mock *Interface) DeviceGetNameCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetName.RLock() + calls = mock.calls.DeviceGetName + mock.lockDeviceGetName.RUnlock() + return calls +} + +// DeviceGetNumFans calls DeviceGetNumFansFunc. +func (mock *Interface) DeviceGetNumFans(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetNumFansFunc == nil { + panic("Interface.DeviceGetNumFansFunc: method is nil but Interface.DeviceGetNumFans was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetNumFans.Lock() + mock.calls.DeviceGetNumFans = append(mock.calls.DeviceGetNumFans, callInfo) + mock.lockDeviceGetNumFans.Unlock() + return mock.DeviceGetNumFansFunc(device) +} + +// DeviceGetNumFansCalls gets all the calls that were made to DeviceGetNumFans. +// Check the length with: +// +// len(mockedInterface.DeviceGetNumFansCalls()) +func (mock *Interface) DeviceGetNumFansCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetNumFans.RLock() + calls = mock.calls.DeviceGetNumFans + mock.lockDeviceGetNumFans.RUnlock() + return calls +} + +// DeviceGetNumGpuCores calls DeviceGetNumGpuCoresFunc. +func (mock *Interface) DeviceGetNumGpuCores(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetNumGpuCoresFunc == nil { + panic("Interface.DeviceGetNumGpuCoresFunc: method is nil but Interface.DeviceGetNumGpuCores was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetNumGpuCores.Lock() + mock.calls.DeviceGetNumGpuCores = append(mock.calls.DeviceGetNumGpuCores, callInfo) + mock.lockDeviceGetNumGpuCores.Unlock() + return mock.DeviceGetNumGpuCoresFunc(device) +} + +// DeviceGetNumGpuCoresCalls gets all the calls that were made to DeviceGetNumGpuCores. +// Check the length with: +// +// len(mockedInterface.DeviceGetNumGpuCoresCalls()) +func (mock *Interface) DeviceGetNumGpuCoresCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetNumGpuCores.RLock() + calls = mock.calls.DeviceGetNumGpuCores + mock.lockDeviceGetNumGpuCores.RUnlock() + return calls +} + +// DeviceGetNvLinkCapability calls DeviceGetNvLinkCapabilityFunc. +func (mock *Interface) DeviceGetNvLinkCapability(device nvml.Device, n int, nvLinkCapability nvml.NvLinkCapability) (uint32, nvml.Return) { + if mock.DeviceGetNvLinkCapabilityFunc == nil { + panic("Interface.DeviceGetNvLinkCapabilityFunc: method is nil but Interface.DeviceGetNvLinkCapability was just called") + } + callInfo := struct { + Device nvml.Device + N int + NvLinkCapability nvml.NvLinkCapability + }{ + Device: device, + N: n, + NvLinkCapability: nvLinkCapability, + } + mock.lockDeviceGetNvLinkCapability.Lock() + mock.calls.DeviceGetNvLinkCapability = append(mock.calls.DeviceGetNvLinkCapability, callInfo) + mock.lockDeviceGetNvLinkCapability.Unlock() + return mock.DeviceGetNvLinkCapabilityFunc(device, n, nvLinkCapability) +} + +// DeviceGetNvLinkCapabilityCalls gets all the calls that were made to DeviceGetNvLinkCapability. +// Check the length with: +// +// len(mockedInterface.DeviceGetNvLinkCapabilityCalls()) +func (mock *Interface) DeviceGetNvLinkCapabilityCalls() []struct { + Device nvml.Device + N int + NvLinkCapability nvml.NvLinkCapability +} { + var calls []struct { + Device nvml.Device + N int + NvLinkCapability nvml.NvLinkCapability + } + mock.lockDeviceGetNvLinkCapability.RLock() + calls = mock.calls.DeviceGetNvLinkCapability + mock.lockDeviceGetNvLinkCapability.RUnlock() + return calls +} + +// DeviceGetNvLinkErrorCounter calls DeviceGetNvLinkErrorCounterFunc. +func (mock *Interface) DeviceGetNvLinkErrorCounter(device nvml.Device, n int, nvLinkErrorCounter nvml.NvLinkErrorCounter) (uint64, nvml.Return) { + if mock.DeviceGetNvLinkErrorCounterFunc == nil { + panic("Interface.DeviceGetNvLinkErrorCounterFunc: method is nil but Interface.DeviceGetNvLinkErrorCounter was just called") + } + callInfo := struct { + Device nvml.Device + N int + NvLinkErrorCounter nvml.NvLinkErrorCounter + }{ + Device: device, + N: n, + NvLinkErrorCounter: nvLinkErrorCounter, + } + mock.lockDeviceGetNvLinkErrorCounter.Lock() + mock.calls.DeviceGetNvLinkErrorCounter = append(mock.calls.DeviceGetNvLinkErrorCounter, callInfo) + mock.lockDeviceGetNvLinkErrorCounter.Unlock() + return mock.DeviceGetNvLinkErrorCounterFunc(device, n, nvLinkErrorCounter) +} + +// DeviceGetNvLinkErrorCounterCalls gets all the calls that were made to DeviceGetNvLinkErrorCounter. +// Check the length with: +// +// len(mockedInterface.DeviceGetNvLinkErrorCounterCalls()) +func (mock *Interface) DeviceGetNvLinkErrorCounterCalls() []struct { + Device nvml.Device + N int + NvLinkErrorCounter nvml.NvLinkErrorCounter +} { + var calls []struct { + Device nvml.Device + N int + NvLinkErrorCounter nvml.NvLinkErrorCounter + } + mock.lockDeviceGetNvLinkErrorCounter.RLock() + calls = mock.calls.DeviceGetNvLinkErrorCounter + mock.lockDeviceGetNvLinkErrorCounter.RUnlock() + return calls +} + +// DeviceGetNvLinkRemoteDeviceType calls DeviceGetNvLinkRemoteDeviceTypeFunc. +func (mock *Interface) DeviceGetNvLinkRemoteDeviceType(device nvml.Device, n int) (nvml.IntNvLinkDeviceType, nvml.Return) { + if mock.DeviceGetNvLinkRemoteDeviceTypeFunc == nil { + panic("Interface.DeviceGetNvLinkRemoteDeviceTypeFunc: method is nil but Interface.DeviceGetNvLinkRemoteDeviceType was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetNvLinkRemoteDeviceType.Lock() + mock.calls.DeviceGetNvLinkRemoteDeviceType = append(mock.calls.DeviceGetNvLinkRemoteDeviceType, callInfo) + mock.lockDeviceGetNvLinkRemoteDeviceType.Unlock() + return mock.DeviceGetNvLinkRemoteDeviceTypeFunc(device, n) +} + +// DeviceGetNvLinkRemoteDeviceTypeCalls gets all the calls that were made to DeviceGetNvLinkRemoteDeviceType. +// Check the length with: +// +// len(mockedInterface.DeviceGetNvLinkRemoteDeviceTypeCalls()) +func (mock *Interface) DeviceGetNvLinkRemoteDeviceTypeCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetNvLinkRemoteDeviceType.RLock() + calls = mock.calls.DeviceGetNvLinkRemoteDeviceType + mock.lockDeviceGetNvLinkRemoteDeviceType.RUnlock() + return calls +} + +// DeviceGetNvLinkRemotePciInfo calls DeviceGetNvLinkRemotePciInfoFunc. +func (mock *Interface) DeviceGetNvLinkRemotePciInfo(device nvml.Device, n int) (nvml.PciInfo, nvml.Return) { + if mock.DeviceGetNvLinkRemotePciInfoFunc == nil { + panic("Interface.DeviceGetNvLinkRemotePciInfoFunc: method is nil but Interface.DeviceGetNvLinkRemotePciInfo was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetNvLinkRemotePciInfo.Lock() + mock.calls.DeviceGetNvLinkRemotePciInfo = append(mock.calls.DeviceGetNvLinkRemotePciInfo, callInfo) + mock.lockDeviceGetNvLinkRemotePciInfo.Unlock() + return mock.DeviceGetNvLinkRemotePciInfoFunc(device, n) +} + +// DeviceGetNvLinkRemotePciInfoCalls gets all the calls that were made to DeviceGetNvLinkRemotePciInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetNvLinkRemotePciInfoCalls()) +func (mock *Interface) DeviceGetNvLinkRemotePciInfoCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetNvLinkRemotePciInfo.RLock() + calls = mock.calls.DeviceGetNvLinkRemotePciInfo + mock.lockDeviceGetNvLinkRemotePciInfo.RUnlock() + return calls +} + +// DeviceGetNvLinkState calls DeviceGetNvLinkStateFunc. +func (mock *Interface) DeviceGetNvLinkState(device nvml.Device, n int) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetNvLinkStateFunc == nil { + panic("Interface.DeviceGetNvLinkStateFunc: method is nil but Interface.DeviceGetNvLinkState was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetNvLinkState.Lock() + mock.calls.DeviceGetNvLinkState = append(mock.calls.DeviceGetNvLinkState, callInfo) + mock.lockDeviceGetNvLinkState.Unlock() + return mock.DeviceGetNvLinkStateFunc(device, n) +} + +// DeviceGetNvLinkStateCalls gets all the calls that were made to DeviceGetNvLinkState. +// Check the length with: +// +// len(mockedInterface.DeviceGetNvLinkStateCalls()) +func (mock *Interface) DeviceGetNvLinkStateCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetNvLinkState.RLock() + calls = mock.calls.DeviceGetNvLinkState + mock.lockDeviceGetNvLinkState.RUnlock() + return calls +} + +// DeviceGetNvLinkUtilizationControl calls DeviceGetNvLinkUtilizationControlFunc. +func (mock *Interface) DeviceGetNvLinkUtilizationControl(device nvml.Device, n1 int, n2 int) (nvml.NvLinkUtilizationControl, nvml.Return) { + if mock.DeviceGetNvLinkUtilizationControlFunc == nil { + panic("Interface.DeviceGetNvLinkUtilizationControlFunc: method is nil but Interface.DeviceGetNvLinkUtilizationControl was just called") + } + callInfo := struct { + Device nvml.Device + N1 int + N2 int + }{ + Device: device, + N1: n1, + N2: n2, + } + mock.lockDeviceGetNvLinkUtilizationControl.Lock() + mock.calls.DeviceGetNvLinkUtilizationControl = append(mock.calls.DeviceGetNvLinkUtilizationControl, callInfo) + mock.lockDeviceGetNvLinkUtilizationControl.Unlock() + return mock.DeviceGetNvLinkUtilizationControlFunc(device, n1, n2) +} + +// DeviceGetNvLinkUtilizationControlCalls gets all the calls that were made to DeviceGetNvLinkUtilizationControl. +// Check the length with: +// +// len(mockedInterface.DeviceGetNvLinkUtilizationControlCalls()) +func (mock *Interface) DeviceGetNvLinkUtilizationControlCalls() []struct { + Device nvml.Device + N1 int + N2 int +} { + var calls []struct { + Device nvml.Device + N1 int + N2 int + } + mock.lockDeviceGetNvLinkUtilizationControl.RLock() + calls = mock.calls.DeviceGetNvLinkUtilizationControl + mock.lockDeviceGetNvLinkUtilizationControl.RUnlock() + return calls +} + +// DeviceGetNvLinkUtilizationCounter calls DeviceGetNvLinkUtilizationCounterFunc. +func (mock *Interface) DeviceGetNvLinkUtilizationCounter(device nvml.Device, n1 int, n2 int) (uint64, uint64, nvml.Return) { + if mock.DeviceGetNvLinkUtilizationCounterFunc == nil { + panic("Interface.DeviceGetNvLinkUtilizationCounterFunc: method is nil but Interface.DeviceGetNvLinkUtilizationCounter was just called") + } + callInfo := struct { + Device nvml.Device + N1 int + N2 int + }{ + Device: device, + N1: n1, + N2: n2, + } + mock.lockDeviceGetNvLinkUtilizationCounter.Lock() + mock.calls.DeviceGetNvLinkUtilizationCounter = append(mock.calls.DeviceGetNvLinkUtilizationCounter, callInfo) + mock.lockDeviceGetNvLinkUtilizationCounter.Unlock() + return mock.DeviceGetNvLinkUtilizationCounterFunc(device, n1, n2) +} + +// DeviceGetNvLinkUtilizationCounterCalls gets all the calls that were made to DeviceGetNvLinkUtilizationCounter. +// Check the length with: +// +// len(mockedInterface.DeviceGetNvLinkUtilizationCounterCalls()) +func (mock *Interface) DeviceGetNvLinkUtilizationCounterCalls() []struct { + Device nvml.Device + N1 int + N2 int +} { + var calls []struct { + Device nvml.Device + N1 int + N2 int + } + mock.lockDeviceGetNvLinkUtilizationCounter.RLock() + calls = mock.calls.DeviceGetNvLinkUtilizationCounter + mock.lockDeviceGetNvLinkUtilizationCounter.RUnlock() + return calls +} + +// DeviceGetNvLinkVersion calls DeviceGetNvLinkVersionFunc. +func (mock *Interface) DeviceGetNvLinkVersion(device nvml.Device, n int) (uint32, nvml.Return) { + if mock.DeviceGetNvLinkVersionFunc == nil { + panic("Interface.DeviceGetNvLinkVersionFunc: method is nil but Interface.DeviceGetNvLinkVersion was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetNvLinkVersion.Lock() + mock.calls.DeviceGetNvLinkVersion = append(mock.calls.DeviceGetNvLinkVersion, callInfo) + mock.lockDeviceGetNvLinkVersion.Unlock() + return mock.DeviceGetNvLinkVersionFunc(device, n) +} + +// DeviceGetNvLinkVersionCalls gets all the calls that were made to DeviceGetNvLinkVersion. +// Check the length with: +// +// len(mockedInterface.DeviceGetNvLinkVersionCalls()) +func (mock *Interface) DeviceGetNvLinkVersionCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetNvLinkVersion.RLock() + calls = mock.calls.DeviceGetNvLinkVersion + mock.lockDeviceGetNvLinkVersion.RUnlock() + return calls +} + +// DeviceGetP2PStatus calls DeviceGetP2PStatusFunc. +func (mock *Interface) DeviceGetP2PStatus(device1 nvml.Device, device2 nvml.Device, gpuP2PCapsIndex nvml.GpuP2PCapsIndex) (nvml.GpuP2PStatus, nvml.Return) { + if mock.DeviceGetP2PStatusFunc == nil { + panic("Interface.DeviceGetP2PStatusFunc: method is nil but Interface.DeviceGetP2PStatus was just called") + } + callInfo := struct { + Device1 nvml.Device + Device2 nvml.Device + GpuP2PCapsIndex nvml.GpuP2PCapsIndex + }{ + Device1: device1, + Device2: device2, + GpuP2PCapsIndex: gpuP2PCapsIndex, + } + mock.lockDeviceGetP2PStatus.Lock() + mock.calls.DeviceGetP2PStatus = append(mock.calls.DeviceGetP2PStatus, callInfo) + mock.lockDeviceGetP2PStatus.Unlock() + return mock.DeviceGetP2PStatusFunc(device1, device2, gpuP2PCapsIndex) +} + +// DeviceGetP2PStatusCalls gets all the calls that were made to DeviceGetP2PStatus. +// Check the length with: +// +// len(mockedInterface.DeviceGetP2PStatusCalls()) +func (mock *Interface) DeviceGetP2PStatusCalls() []struct { + Device1 nvml.Device + Device2 nvml.Device + GpuP2PCapsIndex nvml.GpuP2PCapsIndex +} { + var calls []struct { + Device1 nvml.Device + Device2 nvml.Device + GpuP2PCapsIndex nvml.GpuP2PCapsIndex + } + mock.lockDeviceGetP2PStatus.RLock() + calls = mock.calls.DeviceGetP2PStatus + mock.lockDeviceGetP2PStatus.RUnlock() + return calls +} + +// DeviceGetPciInfo calls DeviceGetPciInfoFunc. +func (mock *Interface) DeviceGetPciInfo(device nvml.Device) (nvml.PciInfo, nvml.Return) { + if mock.DeviceGetPciInfoFunc == nil { + panic("Interface.DeviceGetPciInfoFunc: method is nil but Interface.DeviceGetPciInfo was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPciInfo.Lock() + mock.calls.DeviceGetPciInfo = append(mock.calls.DeviceGetPciInfo, callInfo) + mock.lockDeviceGetPciInfo.Unlock() + return mock.DeviceGetPciInfoFunc(device) +} + +// DeviceGetPciInfoCalls gets all the calls that were made to DeviceGetPciInfo. +// Check the length with: +// +// len(mockedInterface.DeviceGetPciInfoCalls()) +func (mock *Interface) DeviceGetPciInfoCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPciInfo.RLock() + calls = mock.calls.DeviceGetPciInfo + mock.lockDeviceGetPciInfo.RUnlock() + return calls +} + +// DeviceGetPcieLinkMaxSpeed calls DeviceGetPcieLinkMaxSpeedFunc. +func (mock *Interface) DeviceGetPcieLinkMaxSpeed(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetPcieLinkMaxSpeedFunc == nil { + panic("Interface.DeviceGetPcieLinkMaxSpeedFunc: method is nil but Interface.DeviceGetPcieLinkMaxSpeed was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPcieLinkMaxSpeed.Lock() + mock.calls.DeviceGetPcieLinkMaxSpeed = append(mock.calls.DeviceGetPcieLinkMaxSpeed, callInfo) + mock.lockDeviceGetPcieLinkMaxSpeed.Unlock() + return mock.DeviceGetPcieLinkMaxSpeedFunc(device) +} + +// DeviceGetPcieLinkMaxSpeedCalls gets all the calls that were made to DeviceGetPcieLinkMaxSpeed. +// Check the length with: +// +// len(mockedInterface.DeviceGetPcieLinkMaxSpeedCalls()) +func (mock *Interface) DeviceGetPcieLinkMaxSpeedCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPcieLinkMaxSpeed.RLock() + calls = mock.calls.DeviceGetPcieLinkMaxSpeed + mock.lockDeviceGetPcieLinkMaxSpeed.RUnlock() + return calls +} + +// DeviceGetPcieReplayCounter calls DeviceGetPcieReplayCounterFunc. +func (mock *Interface) DeviceGetPcieReplayCounter(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetPcieReplayCounterFunc == nil { + panic("Interface.DeviceGetPcieReplayCounterFunc: method is nil but Interface.DeviceGetPcieReplayCounter was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPcieReplayCounter.Lock() + mock.calls.DeviceGetPcieReplayCounter = append(mock.calls.DeviceGetPcieReplayCounter, callInfo) + mock.lockDeviceGetPcieReplayCounter.Unlock() + return mock.DeviceGetPcieReplayCounterFunc(device) +} + +// DeviceGetPcieReplayCounterCalls gets all the calls that were made to DeviceGetPcieReplayCounter. +// Check the length with: +// +// len(mockedInterface.DeviceGetPcieReplayCounterCalls()) +func (mock *Interface) DeviceGetPcieReplayCounterCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPcieReplayCounter.RLock() + calls = mock.calls.DeviceGetPcieReplayCounter + mock.lockDeviceGetPcieReplayCounter.RUnlock() + return calls +} + +// DeviceGetPcieSpeed calls DeviceGetPcieSpeedFunc. +func (mock *Interface) DeviceGetPcieSpeed(device nvml.Device) (int, nvml.Return) { + if mock.DeviceGetPcieSpeedFunc == nil { + panic("Interface.DeviceGetPcieSpeedFunc: method is nil but Interface.DeviceGetPcieSpeed was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPcieSpeed.Lock() + mock.calls.DeviceGetPcieSpeed = append(mock.calls.DeviceGetPcieSpeed, callInfo) + mock.lockDeviceGetPcieSpeed.Unlock() + return mock.DeviceGetPcieSpeedFunc(device) +} + +// DeviceGetPcieSpeedCalls gets all the calls that were made to DeviceGetPcieSpeed. +// Check the length with: +// +// len(mockedInterface.DeviceGetPcieSpeedCalls()) +func (mock *Interface) DeviceGetPcieSpeedCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPcieSpeed.RLock() + calls = mock.calls.DeviceGetPcieSpeed + mock.lockDeviceGetPcieSpeed.RUnlock() + return calls +} + +// DeviceGetPcieThroughput calls DeviceGetPcieThroughputFunc. +func (mock *Interface) DeviceGetPcieThroughput(device nvml.Device, pcieUtilCounter nvml.PcieUtilCounter) (uint32, nvml.Return) { + if mock.DeviceGetPcieThroughputFunc == nil { + panic("Interface.DeviceGetPcieThroughputFunc: method is nil but Interface.DeviceGetPcieThroughput was just called") + } + callInfo := struct { + Device nvml.Device + PcieUtilCounter nvml.PcieUtilCounter + }{ + Device: device, + PcieUtilCounter: pcieUtilCounter, + } + mock.lockDeviceGetPcieThroughput.Lock() + mock.calls.DeviceGetPcieThroughput = append(mock.calls.DeviceGetPcieThroughput, callInfo) + mock.lockDeviceGetPcieThroughput.Unlock() + return mock.DeviceGetPcieThroughputFunc(device, pcieUtilCounter) +} + +// DeviceGetPcieThroughputCalls gets all the calls that were made to DeviceGetPcieThroughput. +// Check the length with: +// +// len(mockedInterface.DeviceGetPcieThroughputCalls()) +func (mock *Interface) DeviceGetPcieThroughputCalls() []struct { + Device nvml.Device + PcieUtilCounter nvml.PcieUtilCounter +} { + var calls []struct { + Device nvml.Device + PcieUtilCounter nvml.PcieUtilCounter + } + mock.lockDeviceGetPcieThroughput.RLock() + calls = mock.calls.DeviceGetPcieThroughput + mock.lockDeviceGetPcieThroughput.RUnlock() + return calls +} + +// DeviceGetPerformanceState calls DeviceGetPerformanceStateFunc. +func (mock *Interface) DeviceGetPerformanceState(device nvml.Device) (nvml.Pstates, nvml.Return) { + if mock.DeviceGetPerformanceStateFunc == nil { + panic("Interface.DeviceGetPerformanceStateFunc: method is nil but Interface.DeviceGetPerformanceState was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPerformanceState.Lock() + mock.calls.DeviceGetPerformanceState = append(mock.calls.DeviceGetPerformanceState, callInfo) + mock.lockDeviceGetPerformanceState.Unlock() + return mock.DeviceGetPerformanceStateFunc(device) +} + +// DeviceGetPerformanceStateCalls gets all the calls that were made to DeviceGetPerformanceState. +// Check the length with: +// +// len(mockedInterface.DeviceGetPerformanceStateCalls()) +func (mock *Interface) DeviceGetPerformanceStateCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPerformanceState.RLock() + calls = mock.calls.DeviceGetPerformanceState + mock.lockDeviceGetPerformanceState.RUnlock() + return calls +} + +// DeviceGetPersistenceMode calls DeviceGetPersistenceModeFunc. +func (mock *Interface) DeviceGetPersistenceMode(device nvml.Device) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetPersistenceModeFunc == nil { + panic("Interface.DeviceGetPersistenceModeFunc: method is nil but Interface.DeviceGetPersistenceMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPersistenceMode.Lock() + mock.calls.DeviceGetPersistenceMode = append(mock.calls.DeviceGetPersistenceMode, callInfo) + mock.lockDeviceGetPersistenceMode.Unlock() + return mock.DeviceGetPersistenceModeFunc(device) +} + +// DeviceGetPersistenceModeCalls gets all the calls that were made to DeviceGetPersistenceMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetPersistenceModeCalls()) +func (mock *Interface) DeviceGetPersistenceModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPersistenceMode.RLock() + calls = mock.calls.DeviceGetPersistenceMode + mock.lockDeviceGetPersistenceMode.RUnlock() + return calls +} + +// DeviceGetPgpuMetadataString calls DeviceGetPgpuMetadataStringFunc. +func (mock *Interface) DeviceGetPgpuMetadataString(device nvml.Device) (string, nvml.Return) { + if mock.DeviceGetPgpuMetadataStringFunc == nil { + panic("Interface.DeviceGetPgpuMetadataStringFunc: method is nil but Interface.DeviceGetPgpuMetadataString was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPgpuMetadataString.Lock() + mock.calls.DeviceGetPgpuMetadataString = append(mock.calls.DeviceGetPgpuMetadataString, callInfo) + mock.lockDeviceGetPgpuMetadataString.Unlock() + return mock.DeviceGetPgpuMetadataStringFunc(device) +} + +// DeviceGetPgpuMetadataStringCalls gets all the calls that were made to DeviceGetPgpuMetadataString. +// Check the length with: +// +// len(mockedInterface.DeviceGetPgpuMetadataStringCalls()) +func (mock *Interface) DeviceGetPgpuMetadataStringCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPgpuMetadataString.RLock() + calls = mock.calls.DeviceGetPgpuMetadataString + mock.lockDeviceGetPgpuMetadataString.RUnlock() + return calls +} + +// DeviceGetPowerManagementDefaultLimit calls DeviceGetPowerManagementDefaultLimitFunc. +func (mock *Interface) DeviceGetPowerManagementDefaultLimit(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetPowerManagementDefaultLimitFunc == nil { + panic("Interface.DeviceGetPowerManagementDefaultLimitFunc: method is nil but Interface.DeviceGetPowerManagementDefaultLimit was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPowerManagementDefaultLimit.Lock() + mock.calls.DeviceGetPowerManagementDefaultLimit = append(mock.calls.DeviceGetPowerManagementDefaultLimit, callInfo) + mock.lockDeviceGetPowerManagementDefaultLimit.Unlock() + return mock.DeviceGetPowerManagementDefaultLimitFunc(device) +} + +// DeviceGetPowerManagementDefaultLimitCalls gets all the calls that were made to DeviceGetPowerManagementDefaultLimit. +// Check the length with: +// +// len(mockedInterface.DeviceGetPowerManagementDefaultLimitCalls()) +func (mock *Interface) DeviceGetPowerManagementDefaultLimitCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPowerManagementDefaultLimit.RLock() + calls = mock.calls.DeviceGetPowerManagementDefaultLimit + mock.lockDeviceGetPowerManagementDefaultLimit.RUnlock() + return calls +} + +// DeviceGetPowerManagementLimit calls DeviceGetPowerManagementLimitFunc. +func (mock *Interface) DeviceGetPowerManagementLimit(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetPowerManagementLimitFunc == nil { + panic("Interface.DeviceGetPowerManagementLimitFunc: method is nil but Interface.DeviceGetPowerManagementLimit was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPowerManagementLimit.Lock() + mock.calls.DeviceGetPowerManagementLimit = append(mock.calls.DeviceGetPowerManagementLimit, callInfo) + mock.lockDeviceGetPowerManagementLimit.Unlock() + return mock.DeviceGetPowerManagementLimitFunc(device) +} + +// DeviceGetPowerManagementLimitCalls gets all the calls that were made to DeviceGetPowerManagementLimit. +// Check the length with: +// +// len(mockedInterface.DeviceGetPowerManagementLimitCalls()) +func (mock *Interface) DeviceGetPowerManagementLimitCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPowerManagementLimit.RLock() + calls = mock.calls.DeviceGetPowerManagementLimit + mock.lockDeviceGetPowerManagementLimit.RUnlock() + return calls +} + +// DeviceGetPowerManagementLimitConstraints calls DeviceGetPowerManagementLimitConstraintsFunc. +func (mock *Interface) DeviceGetPowerManagementLimitConstraints(device nvml.Device) (uint32, uint32, nvml.Return) { + if mock.DeviceGetPowerManagementLimitConstraintsFunc == nil { + panic("Interface.DeviceGetPowerManagementLimitConstraintsFunc: method is nil but Interface.DeviceGetPowerManagementLimitConstraints was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPowerManagementLimitConstraints.Lock() + mock.calls.DeviceGetPowerManagementLimitConstraints = append(mock.calls.DeviceGetPowerManagementLimitConstraints, callInfo) + mock.lockDeviceGetPowerManagementLimitConstraints.Unlock() + return mock.DeviceGetPowerManagementLimitConstraintsFunc(device) +} + +// DeviceGetPowerManagementLimitConstraintsCalls gets all the calls that were made to DeviceGetPowerManagementLimitConstraints. +// Check the length with: +// +// len(mockedInterface.DeviceGetPowerManagementLimitConstraintsCalls()) +func (mock *Interface) DeviceGetPowerManagementLimitConstraintsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPowerManagementLimitConstraints.RLock() + calls = mock.calls.DeviceGetPowerManagementLimitConstraints + mock.lockDeviceGetPowerManagementLimitConstraints.RUnlock() + return calls +} + +// DeviceGetPowerManagementMode calls DeviceGetPowerManagementModeFunc. +func (mock *Interface) DeviceGetPowerManagementMode(device nvml.Device) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetPowerManagementModeFunc == nil { + panic("Interface.DeviceGetPowerManagementModeFunc: method is nil but Interface.DeviceGetPowerManagementMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPowerManagementMode.Lock() + mock.calls.DeviceGetPowerManagementMode = append(mock.calls.DeviceGetPowerManagementMode, callInfo) + mock.lockDeviceGetPowerManagementMode.Unlock() + return mock.DeviceGetPowerManagementModeFunc(device) +} + +// DeviceGetPowerManagementModeCalls gets all the calls that were made to DeviceGetPowerManagementMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetPowerManagementModeCalls()) +func (mock *Interface) DeviceGetPowerManagementModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPowerManagementMode.RLock() + calls = mock.calls.DeviceGetPowerManagementMode + mock.lockDeviceGetPowerManagementMode.RUnlock() + return calls +} + +// DeviceGetPowerSource calls DeviceGetPowerSourceFunc. +func (mock *Interface) DeviceGetPowerSource(device nvml.Device) (nvml.PowerSource, nvml.Return) { + if mock.DeviceGetPowerSourceFunc == nil { + panic("Interface.DeviceGetPowerSourceFunc: method is nil but Interface.DeviceGetPowerSource was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPowerSource.Lock() + mock.calls.DeviceGetPowerSource = append(mock.calls.DeviceGetPowerSource, callInfo) + mock.lockDeviceGetPowerSource.Unlock() + return mock.DeviceGetPowerSourceFunc(device) +} + +// DeviceGetPowerSourceCalls gets all the calls that were made to DeviceGetPowerSource. +// Check the length with: +// +// len(mockedInterface.DeviceGetPowerSourceCalls()) +func (mock *Interface) DeviceGetPowerSourceCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPowerSource.RLock() + calls = mock.calls.DeviceGetPowerSource + mock.lockDeviceGetPowerSource.RUnlock() + return calls +} + +// DeviceGetPowerState calls DeviceGetPowerStateFunc. +func (mock *Interface) DeviceGetPowerState(device nvml.Device) (nvml.Pstates, nvml.Return) { + if mock.DeviceGetPowerStateFunc == nil { + panic("Interface.DeviceGetPowerStateFunc: method is nil but Interface.DeviceGetPowerState was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPowerState.Lock() + mock.calls.DeviceGetPowerState = append(mock.calls.DeviceGetPowerState, callInfo) + mock.lockDeviceGetPowerState.Unlock() + return mock.DeviceGetPowerStateFunc(device) +} + +// DeviceGetPowerStateCalls gets all the calls that were made to DeviceGetPowerState. +// Check the length with: +// +// len(mockedInterface.DeviceGetPowerStateCalls()) +func (mock *Interface) DeviceGetPowerStateCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPowerState.RLock() + calls = mock.calls.DeviceGetPowerState + mock.lockDeviceGetPowerState.RUnlock() + return calls +} + +// DeviceGetPowerUsage calls DeviceGetPowerUsageFunc. +func (mock *Interface) DeviceGetPowerUsage(device nvml.Device) (uint32, nvml.Return) { + if mock.DeviceGetPowerUsageFunc == nil { + panic("Interface.DeviceGetPowerUsageFunc: method is nil but Interface.DeviceGetPowerUsage was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetPowerUsage.Lock() + mock.calls.DeviceGetPowerUsage = append(mock.calls.DeviceGetPowerUsage, callInfo) + mock.lockDeviceGetPowerUsage.Unlock() + return mock.DeviceGetPowerUsageFunc(device) +} + +// DeviceGetPowerUsageCalls gets all the calls that were made to DeviceGetPowerUsage. +// Check the length with: +// +// len(mockedInterface.DeviceGetPowerUsageCalls()) +func (mock *Interface) DeviceGetPowerUsageCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetPowerUsage.RLock() + calls = mock.calls.DeviceGetPowerUsage + mock.lockDeviceGetPowerUsage.RUnlock() + return calls +} + +// DeviceGetProcessUtilization calls DeviceGetProcessUtilizationFunc. +func (mock *Interface) DeviceGetProcessUtilization(device nvml.Device, v uint64) ([]nvml.ProcessUtilizationSample, nvml.Return) { + if mock.DeviceGetProcessUtilizationFunc == nil { + panic("Interface.DeviceGetProcessUtilizationFunc: method is nil but Interface.DeviceGetProcessUtilization was just called") + } + callInfo := struct { + Device nvml.Device + V uint64 + }{ + Device: device, + V: v, + } + mock.lockDeviceGetProcessUtilization.Lock() + mock.calls.DeviceGetProcessUtilization = append(mock.calls.DeviceGetProcessUtilization, callInfo) + mock.lockDeviceGetProcessUtilization.Unlock() + return mock.DeviceGetProcessUtilizationFunc(device, v) +} + +// DeviceGetProcessUtilizationCalls gets all the calls that were made to DeviceGetProcessUtilization. +// Check the length with: +// +// len(mockedInterface.DeviceGetProcessUtilizationCalls()) +func (mock *Interface) DeviceGetProcessUtilizationCalls() []struct { + Device nvml.Device + V uint64 +} { + var calls []struct { + Device nvml.Device + V uint64 + } + mock.lockDeviceGetProcessUtilization.RLock() + calls = mock.calls.DeviceGetProcessUtilization + mock.lockDeviceGetProcessUtilization.RUnlock() + return calls +} + +// DeviceGetRemappedRows calls DeviceGetRemappedRowsFunc. +func (mock *Interface) DeviceGetRemappedRows(device nvml.Device) (int, int, bool, bool, nvml.Return) { + if mock.DeviceGetRemappedRowsFunc == nil { + panic("Interface.DeviceGetRemappedRowsFunc: method is nil but Interface.DeviceGetRemappedRows was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetRemappedRows.Lock() + mock.calls.DeviceGetRemappedRows = append(mock.calls.DeviceGetRemappedRows, callInfo) + mock.lockDeviceGetRemappedRows.Unlock() + return mock.DeviceGetRemappedRowsFunc(device) +} + +// DeviceGetRemappedRowsCalls gets all the calls that were made to DeviceGetRemappedRows. +// Check the length with: +// +// len(mockedInterface.DeviceGetRemappedRowsCalls()) +func (mock *Interface) DeviceGetRemappedRowsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetRemappedRows.RLock() + calls = mock.calls.DeviceGetRemappedRows + mock.lockDeviceGetRemappedRows.RUnlock() + return calls +} + +// DeviceGetRetiredPages calls DeviceGetRetiredPagesFunc. +func (mock *Interface) DeviceGetRetiredPages(device nvml.Device, pageRetirementCause nvml.PageRetirementCause) ([]uint64, nvml.Return) { + if mock.DeviceGetRetiredPagesFunc == nil { + panic("Interface.DeviceGetRetiredPagesFunc: method is nil but Interface.DeviceGetRetiredPages was just called") + } + callInfo := struct { + Device nvml.Device + PageRetirementCause nvml.PageRetirementCause + }{ + Device: device, + PageRetirementCause: pageRetirementCause, + } + mock.lockDeviceGetRetiredPages.Lock() + mock.calls.DeviceGetRetiredPages = append(mock.calls.DeviceGetRetiredPages, callInfo) + mock.lockDeviceGetRetiredPages.Unlock() + return mock.DeviceGetRetiredPagesFunc(device, pageRetirementCause) +} + +// DeviceGetRetiredPagesCalls gets all the calls that were made to DeviceGetRetiredPages. +// Check the length with: +// +// len(mockedInterface.DeviceGetRetiredPagesCalls()) +func (mock *Interface) DeviceGetRetiredPagesCalls() []struct { + Device nvml.Device + PageRetirementCause nvml.PageRetirementCause +} { + var calls []struct { + Device nvml.Device + PageRetirementCause nvml.PageRetirementCause + } + mock.lockDeviceGetRetiredPages.RLock() + calls = mock.calls.DeviceGetRetiredPages + mock.lockDeviceGetRetiredPages.RUnlock() + return calls +} + +// DeviceGetRetiredPagesPendingStatus calls DeviceGetRetiredPagesPendingStatusFunc. +func (mock *Interface) DeviceGetRetiredPagesPendingStatus(device nvml.Device) (nvml.EnableState, nvml.Return) { + if mock.DeviceGetRetiredPagesPendingStatusFunc == nil { + panic("Interface.DeviceGetRetiredPagesPendingStatusFunc: method is nil but Interface.DeviceGetRetiredPagesPendingStatus was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetRetiredPagesPendingStatus.Lock() + mock.calls.DeviceGetRetiredPagesPendingStatus = append(mock.calls.DeviceGetRetiredPagesPendingStatus, callInfo) + mock.lockDeviceGetRetiredPagesPendingStatus.Unlock() + return mock.DeviceGetRetiredPagesPendingStatusFunc(device) +} + +// DeviceGetRetiredPagesPendingStatusCalls gets all the calls that were made to DeviceGetRetiredPagesPendingStatus. +// Check the length with: +// +// len(mockedInterface.DeviceGetRetiredPagesPendingStatusCalls()) +func (mock *Interface) DeviceGetRetiredPagesPendingStatusCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetRetiredPagesPendingStatus.RLock() + calls = mock.calls.DeviceGetRetiredPagesPendingStatus + mock.lockDeviceGetRetiredPagesPendingStatus.RUnlock() + return calls +} + +// DeviceGetRetiredPages_v2 calls DeviceGetRetiredPages_v2Func. +func (mock *Interface) DeviceGetRetiredPages_v2(device nvml.Device, pageRetirementCause nvml.PageRetirementCause) ([]uint64, []uint64, nvml.Return) { + if mock.DeviceGetRetiredPages_v2Func == nil { + panic("Interface.DeviceGetRetiredPages_v2Func: method is nil but Interface.DeviceGetRetiredPages_v2 was just called") + } + callInfo := struct { + Device nvml.Device + PageRetirementCause nvml.PageRetirementCause + }{ + Device: device, + PageRetirementCause: pageRetirementCause, + } + mock.lockDeviceGetRetiredPages_v2.Lock() + mock.calls.DeviceGetRetiredPages_v2 = append(mock.calls.DeviceGetRetiredPages_v2, callInfo) + mock.lockDeviceGetRetiredPages_v2.Unlock() + return mock.DeviceGetRetiredPages_v2Func(device, pageRetirementCause) +} + +// DeviceGetRetiredPages_v2Calls gets all the calls that were made to DeviceGetRetiredPages_v2. +// Check the length with: +// +// len(mockedInterface.DeviceGetRetiredPages_v2Calls()) +func (mock *Interface) DeviceGetRetiredPages_v2Calls() []struct { + Device nvml.Device + PageRetirementCause nvml.PageRetirementCause +} { + var calls []struct { + Device nvml.Device + PageRetirementCause nvml.PageRetirementCause + } + mock.lockDeviceGetRetiredPages_v2.RLock() + calls = mock.calls.DeviceGetRetiredPages_v2 + mock.lockDeviceGetRetiredPages_v2.RUnlock() + return calls +} + +// DeviceGetRowRemapperHistogram calls DeviceGetRowRemapperHistogramFunc. +func (mock *Interface) DeviceGetRowRemapperHistogram(device nvml.Device) (nvml.RowRemapperHistogramValues, nvml.Return) { + if mock.DeviceGetRowRemapperHistogramFunc == nil { + panic("Interface.DeviceGetRowRemapperHistogramFunc: method is nil but Interface.DeviceGetRowRemapperHistogram was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetRowRemapperHistogram.Lock() + mock.calls.DeviceGetRowRemapperHistogram = append(mock.calls.DeviceGetRowRemapperHistogram, callInfo) + mock.lockDeviceGetRowRemapperHistogram.Unlock() + return mock.DeviceGetRowRemapperHistogramFunc(device) +} + +// DeviceGetRowRemapperHistogramCalls gets all the calls that were made to DeviceGetRowRemapperHistogram. +// Check the length with: +// +// len(mockedInterface.DeviceGetRowRemapperHistogramCalls()) +func (mock *Interface) DeviceGetRowRemapperHistogramCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetRowRemapperHistogram.RLock() + calls = mock.calls.DeviceGetRowRemapperHistogram + mock.lockDeviceGetRowRemapperHistogram.RUnlock() + return calls +} + +// DeviceGetSamples calls DeviceGetSamplesFunc. +func (mock *Interface) DeviceGetSamples(device nvml.Device, samplingType nvml.SamplingType, v uint64) (nvml.ValueType, []nvml.Sample, nvml.Return) { + if mock.DeviceGetSamplesFunc == nil { + panic("Interface.DeviceGetSamplesFunc: method is nil but Interface.DeviceGetSamples was just called") + } + callInfo := struct { + Device nvml.Device + SamplingType nvml.SamplingType + V uint64 + }{ + Device: device, + SamplingType: samplingType, + V: v, + } + mock.lockDeviceGetSamples.Lock() + mock.calls.DeviceGetSamples = append(mock.calls.DeviceGetSamples, callInfo) + mock.lockDeviceGetSamples.Unlock() + return mock.DeviceGetSamplesFunc(device, samplingType, v) +} + +// DeviceGetSamplesCalls gets all the calls that were made to DeviceGetSamples. +// Check the length with: +// +// len(mockedInterface.DeviceGetSamplesCalls()) +func (mock *Interface) DeviceGetSamplesCalls() []struct { + Device nvml.Device + SamplingType nvml.SamplingType + V uint64 +} { + var calls []struct { + Device nvml.Device + SamplingType nvml.SamplingType + V uint64 + } + mock.lockDeviceGetSamples.RLock() + calls = mock.calls.DeviceGetSamples + mock.lockDeviceGetSamples.RUnlock() + return calls +} + +// DeviceGetSerial calls DeviceGetSerialFunc. +func (mock *Interface) DeviceGetSerial(device nvml.Device) (string, nvml.Return) { + if mock.DeviceGetSerialFunc == nil { + panic("Interface.DeviceGetSerialFunc: method is nil but Interface.DeviceGetSerial was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetSerial.Lock() + mock.calls.DeviceGetSerial = append(mock.calls.DeviceGetSerial, callInfo) + mock.lockDeviceGetSerial.Unlock() + return mock.DeviceGetSerialFunc(device) +} + +// DeviceGetSerialCalls gets all the calls that were made to DeviceGetSerial. +// Check the length with: +// +// len(mockedInterface.DeviceGetSerialCalls()) +func (mock *Interface) DeviceGetSerialCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetSerial.RLock() + calls = mock.calls.DeviceGetSerial + mock.lockDeviceGetSerial.RUnlock() + return calls +} + +// DeviceGetSupportedClocksThrottleReasons calls DeviceGetSupportedClocksThrottleReasonsFunc. +func (mock *Interface) DeviceGetSupportedClocksThrottleReasons(device nvml.Device) (uint64, nvml.Return) { + if mock.DeviceGetSupportedClocksThrottleReasonsFunc == nil { + panic("Interface.DeviceGetSupportedClocksThrottleReasonsFunc: method is nil but Interface.DeviceGetSupportedClocksThrottleReasons was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetSupportedClocksThrottleReasons.Lock() + mock.calls.DeviceGetSupportedClocksThrottleReasons = append(mock.calls.DeviceGetSupportedClocksThrottleReasons, callInfo) + mock.lockDeviceGetSupportedClocksThrottleReasons.Unlock() + return mock.DeviceGetSupportedClocksThrottleReasonsFunc(device) +} + +// DeviceGetSupportedClocksThrottleReasonsCalls gets all the calls that were made to DeviceGetSupportedClocksThrottleReasons. +// Check the length with: +// +// len(mockedInterface.DeviceGetSupportedClocksThrottleReasonsCalls()) +func (mock *Interface) DeviceGetSupportedClocksThrottleReasonsCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetSupportedClocksThrottleReasons.RLock() + calls = mock.calls.DeviceGetSupportedClocksThrottleReasons + mock.lockDeviceGetSupportedClocksThrottleReasons.RUnlock() + return calls +} + +// DeviceGetSupportedEventTypes calls DeviceGetSupportedEventTypesFunc. +func (mock *Interface) DeviceGetSupportedEventTypes(device nvml.Device) (uint64, nvml.Return) { + if mock.DeviceGetSupportedEventTypesFunc == nil { + panic("Interface.DeviceGetSupportedEventTypesFunc: method is nil but Interface.DeviceGetSupportedEventTypes was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetSupportedEventTypes.Lock() + mock.calls.DeviceGetSupportedEventTypes = append(mock.calls.DeviceGetSupportedEventTypes, callInfo) + mock.lockDeviceGetSupportedEventTypes.Unlock() + return mock.DeviceGetSupportedEventTypesFunc(device) +} + +// DeviceGetSupportedEventTypesCalls gets all the calls that were made to DeviceGetSupportedEventTypes. +// Check the length with: +// +// len(mockedInterface.DeviceGetSupportedEventTypesCalls()) +func (mock *Interface) DeviceGetSupportedEventTypesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetSupportedEventTypes.RLock() + calls = mock.calls.DeviceGetSupportedEventTypes + mock.lockDeviceGetSupportedEventTypes.RUnlock() + return calls +} + +// DeviceGetSupportedGraphicsClocks calls DeviceGetSupportedGraphicsClocksFunc. +func (mock *Interface) DeviceGetSupportedGraphicsClocks(device nvml.Device, n int) (int, uint32, nvml.Return) { + if mock.DeviceGetSupportedGraphicsClocksFunc == nil { + panic("Interface.DeviceGetSupportedGraphicsClocksFunc: method is nil but Interface.DeviceGetSupportedGraphicsClocks was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetSupportedGraphicsClocks.Lock() + mock.calls.DeviceGetSupportedGraphicsClocks = append(mock.calls.DeviceGetSupportedGraphicsClocks, callInfo) + mock.lockDeviceGetSupportedGraphicsClocks.Unlock() + return mock.DeviceGetSupportedGraphicsClocksFunc(device, n) +} + +// DeviceGetSupportedGraphicsClocksCalls gets all the calls that were made to DeviceGetSupportedGraphicsClocks. +// Check the length with: +// +// len(mockedInterface.DeviceGetSupportedGraphicsClocksCalls()) +func (mock *Interface) DeviceGetSupportedGraphicsClocksCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetSupportedGraphicsClocks.RLock() + calls = mock.calls.DeviceGetSupportedGraphicsClocks + mock.lockDeviceGetSupportedGraphicsClocks.RUnlock() + return calls +} + +// DeviceGetSupportedMemoryClocks calls DeviceGetSupportedMemoryClocksFunc. +func (mock *Interface) DeviceGetSupportedMemoryClocks(device nvml.Device) (int, uint32, nvml.Return) { + if mock.DeviceGetSupportedMemoryClocksFunc == nil { + panic("Interface.DeviceGetSupportedMemoryClocksFunc: method is nil but Interface.DeviceGetSupportedMemoryClocks was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetSupportedMemoryClocks.Lock() + mock.calls.DeviceGetSupportedMemoryClocks = append(mock.calls.DeviceGetSupportedMemoryClocks, callInfo) + mock.lockDeviceGetSupportedMemoryClocks.Unlock() + return mock.DeviceGetSupportedMemoryClocksFunc(device) +} + +// DeviceGetSupportedMemoryClocksCalls gets all the calls that were made to DeviceGetSupportedMemoryClocks. +// Check the length with: +// +// len(mockedInterface.DeviceGetSupportedMemoryClocksCalls()) +func (mock *Interface) DeviceGetSupportedMemoryClocksCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetSupportedMemoryClocks.RLock() + calls = mock.calls.DeviceGetSupportedMemoryClocks + mock.lockDeviceGetSupportedMemoryClocks.RUnlock() + return calls +} + +// DeviceGetSupportedPerformanceStates calls DeviceGetSupportedPerformanceStatesFunc. +func (mock *Interface) DeviceGetSupportedPerformanceStates(device nvml.Device) ([]nvml.Pstates, nvml.Return) { + if mock.DeviceGetSupportedPerformanceStatesFunc == nil { + panic("Interface.DeviceGetSupportedPerformanceStatesFunc: method is nil but Interface.DeviceGetSupportedPerformanceStates was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetSupportedPerformanceStates.Lock() + mock.calls.DeviceGetSupportedPerformanceStates = append(mock.calls.DeviceGetSupportedPerformanceStates, callInfo) + mock.lockDeviceGetSupportedPerformanceStates.Unlock() + return mock.DeviceGetSupportedPerformanceStatesFunc(device) +} + +// DeviceGetSupportedPerformanceStatesCalls gets all the calls that were made to DeviceGetSupportedPerformanceStates. +// Check the length with: +// +// len(mockedInterface.DeviceGetSupportedPerformanceStatesCalls()) +func (mock *Interface) DeviceGetSupportedPerformanceStatesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetSupportedPerformanceStates.RLock() + calls = mock.calls.DeviceGetSupportedPerformanceStates + mock.lockDeviceGetSupportedPerformanceStates.RUnlock() + return calls +} + +// DeviceGetSupportedVgpus calls DeviceGetSupportedVgpusFunc. +func (mock *Interface) DeviceGetSupportedVgpus(device nvml.Device) ([]nvml.VgpuTypeId, nvml.Return) { + if mock.DeviceGetSupportedVgpusFunc == nil { + panic("Interface.DeviceGetSupportedVgpusFunc: method is nil but Interface.DeviceGetSupportedVgpus was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetSupportedVgpus.Lock() + mock.calls.DeviceGetSupportedVgpus = append(mock.calls.DeviceGetSupportedVgpus, callInfo) + mock.lockDeviceGetSupportedVgpus.Unlock() + return mock.DeviceGetSupportedVgpusFunc(device) +} + +// DeviceGetSupportedVgpusCalls gets all the calls that were made to DeviceGetSupportedVgpus. +// Check the length with: +// +// len(mockedInterface.DeviceGetSupportedVgpusCalls()) +func (mock *Interface) DeviceGetSupportedVgpusCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetSupportedVgpus.RLock() + calls = mock.calls.DeviceGetSupportedVgpus + mock.lockDeviceGetSupportedVgpus.RUnlock() + return calls +} + +// DeviceGetTargetFanSpeed calls DeviceGetTargetFanSpeedFunc. +func (mock *Interface) DeviceGetTargetFanSpeed(device nvml.Device, n int) (int, nvml.Return) { + if mock.DeviceGetTargetFanSpeedFunc == nil { + panic("Interface.DeviceGetTargetFanSpeedFunc: method is nil but Interface.DeviceGetTargetFanSpeed was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceGetTargetFanSpeed.Lock() + mock.calls.DeviceGetTargetFanSpeed = append(mock.calls.DeviceGetTargetFanSpeed, callInfo) + mock.lockDeviceGetTargetFanSpeed.Unlock() + return mock.DeviceGetTargetFanSpeedFunc(device, n) +} + +// DeviceGetTargetFanSpeedCalls gets all the calls that were made to DeviceGetTargetFanSpeed. +// Check the length with: +// +// len(mockedInterface.DeviceGetTargetFanSpeedCalls()) +func (mock *Interface) DeviceGetTargetFanSpeedCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceGetTargetFanSpeed.RLock() + calls = mock.calls.DeviceGetTargetFanSpeed + mock.lockDeviceGetTargetFanSpeed.RUnlock() + return calls +} + +// DeviceGetTemperature calls DeviceGetTemperatureFunc. +func (mock *Interface) DeviceGetTemperature(device nvml.Device, temperatureSensors nvml.TemperatureSensors) (uint32, nvml.Return) { + if mock.DeviceGetTemperatureFunc == nil { + panic("Interface.DeviceGetTemperatureFunc: method is nil but Interface.DeviceGetTemperature was just called") + } + callInfo := struct { + Device nvml.Device + TemperatureSensors nvml.TemperatureSensors + }{ + Device: device, + TemperatureSensors: temperatureSensors, + } + mock.lockDeviceGetTemperature.Lock() + mock.calls.DeviceGetTemperature = append(mock.calls.DeviceGetTemperature, callInfo) + mock.lockDeviceGetTemperature.Unlock() + return mock.DeviceGetTemperatureFunc(device, temperatureSensors) +} + +// DeviceGetTemperatureCalls gets all the calls that were made to DeviceGetTemperature. +// Check the length with: +// +// len(mockedInterface.DeviceGetTemperatureCalls()) +func (mock *Interface) DeviceGetTemperatureCalls() []struct { + Device nvml.Device + TemperatureSensors nvml.TemperatureSensors +} { + var calls []struct { + Device nvml.Device + TemperatureSensors nvml.TemperatureSensors + } + mock.lockDeviceGetTemperature.RLock() + calls = mock.calls.DeviceGetTemperature + mock.lockDeviceGetTemperature.RUnlock() + return calls +} + +// DeviceGetTemperatureThreshold calls DeviceGetTemperatureThresholdFunc. +func (mock *Interface) DeviceGetTemperatureThreshold(device nvml.Device, temperatureThresholds nvml.TemperatureThresholds) (uint32, nvml.Return) { + if mock.DeviceGetTemperatureThresholdFunc == nil { + panic("Interface.DeviceGetTemperatureThresholdFunc: method is nil but Interface.DeviceGetTemperatureThreshold was just called") + } + callInfo := struct { + Device nvml.Device + TemperatureThresholds nvml.TemperatureThresholds + }{ + Device: device, + TemperatureThresholds: temperatureThresholds, + } + mock.lockDeviceGetTemperatureThreshold.Lock() + mock.calls.DeviceGetTemperatureThreshold = append(mock.calls.DeviceGetTemperatureThreshold, callInfo) + mock.lockDeviceGetTemperatureThreshold.Unlock() + return mock.DeviceGetTemperatureThresholdFunc(device, temperatureThresholds) +} + +// DeviceGetTemperatureThresholdCalls gets all the calls that were made to DeviceGetTemperatureThreshold. +// Check the length with: +// +// len(mockedInterface.DeviceGetTemperatureThresholdCalls()) +func (mock *Interface) DeviceGetTemperatureThresholdCalls() []struct { + Device nvml.Device + TemperatureThresholds nvml.TemperatureThresholds +} { + var calls []struct { + Device nvml.Device + TemperatureThresholds nvml.TemperatureThresholds + } + mock.lockDeviceGetTemperatureThreshold.RLock() + calls = mock.calls.DeviceGetTemperatureThreshold + mock.lockDeviceGetTemperatureThreshold.RUnlock() + return calls +} + +// DeviceGetThermalSettings calls DeviceGetThermalSettingsFunc. +func (mock *Interface) DeviceGetThermalSettings(device nvml.Device, v uint32) (nvml.GpuThermalSettings, nvml.Return) { + if mock.DeviceGetThermalSettingsFunc == nil { + panic("Interface.DeviceGetThermalSettingsFunc: method is nil but Interface.DeviceGetThermalSettings was just called") + } + callInfo := struct { + Device nvml.Device + V uint32 + }{ + Device: device, + V: v, + } + mock.lockDeviceGetThermalSettings.Lock() + mock.calls.DeviceGetThermalSettings = append(mock.calls.DeviceGetThermalSettings, callInfo) + mock.lockDeviceGetThermalSettings.Unlock() + return mock.DeviceGetThermalSettingsFunc(device, v) +} + +// DeviceGetThermalSettingsCalls gets all the calls that were made to DeviceGetThermalSettings. +// Check the length with: +// +// len(mockedInterface.DeviceGetThermalSettingsCalls()) +func (mock *Interface) DeviceGetThermalSettingsCalls() []struct { + Device nvml.Device + V uint32 +} { + var calls []struct { + Device nvml.Device + V uint32 + } + mock.lockDeviceGetThermalSettings.RLock() + calls = mock.calls.DeviceGetThermalSettings + mock.lockDeviceGetThermalSettings.RUnlock() + return calls +} + +// DeviceGetTopologyCommonAncestor calls DeviceGetTopologyCommonAncestorFunc. +func (mock *Interface) DeviceGetTopologyCommonAncestor(device1 nvml.Device, device2 nvml.Device) (nvml.GpuTopologyLevel, nvml.Return) { + if mock.DeviceGetTopologyCommonAncestorFunc == nil { + panic("Interface.DeviceGetTopologyCommonAncestorFunc: method is nil but Interface.DeviceGetTopologyCommonAncestor was just called") + } + callInfo := struct { + Device1 nvml.Device + Device2 nvml.Device + }{ + Device1: device1, + Device2: device2, + } + mock.lockDeviceGetTopologyCommonAncestor.Lock() + mock.calls.DeviceGetTopologyCommonAncestor = append(mock.calls.DeviceGetTopologyCommonAncestor, callInfo) + mock.lockDeviceGetTopologyCommonAncestor.Unlock() + return mock.DeviceGetTopologyCommonAncestorFunc(device1, device2) +} + +// DeviceGetTopologyCommonAncestorCalls gets all the calls that were made to DeviceGetTopologyCommonAncestor. +// Check the length with: +// +// len(mockedInterface.DeviceGetTopologyCommonAncestorCalls()) +func (mock *Interface) DeviceGetTopologyCommonAncestorCalls() []struct { + Device1 nvml.Device + Device2 nvml.Device +} { + var calls []struct { + Device1 nvml.Device + Device2 nvml.Device + } + mock.lockDeviceGetTopologyCommonAncestor.RLock() + calls = mock.calls.DeviceGetTopologyCommonAncestor + mock.lockDeviceGetTopologyCommonAncestor.RUnlock() + return calls +} + +// DeviceGetTopologyNearestGpus calls DeviceGetTopologyNearestGpusFunc. +func (mock *Interface) DeviceGetTopologyNearestGpus(device nvml.Device, gpuTopologyLevel nvml.GpuTopologyLevel) ([]nvml.Device, nvml.Return) { + if mock.DeviceGetTopologyNearestGpusFunc == nil { + panic("Interface.DeviceGetTopologyNearestGpusFunc: method is nil but Interface.DeviceGetTopologyNearestGpus was just called") + } + callInfo := struct { + Device nvml.Device + GpuTopologyLevel nvml.GpuTopologyLevel + }{ + Device: device, + GpuTopologyLevel: gpuTopologyLevel, + } + mock.lockDeviceGetTopologyNearestGpus.Lock() + mock.calls.DeviceGetTopologyNearestGpus = append(mock.calls.DeviceGetTopologyNearestGpus, callInfo) + mock.lockDeviceGetTopologyNearestGpus.Unlock() + return mock.DeviceGetTopologyNearestGpusFunc(device, gpuTopologyLevel) +} + +// DeviceGetTopologyNearestGpusCalls gets all the calls that were made to DeviceGetTopologyNearestGpus. +// Check the length with: +// +// len(mockedInterface.DeviceGetTopologyNearestGpusCalls()) +func (mock *Interface) DeviceGetTopologyNearestGpusCalls() []struct { + Device nvml.Device + GpuTopologyLevel nvml.GpuTopologyLevel +} { + var calls []struct { + Device nvml.Device + GpuTopologyLevel nvml.GpuTopologyLevel + } + mock.lockDeviceGetTopologyNearestGpus.RLock() + calls = mock.calls.DeviceGetTopologyNearestGpus + mock.lockDeviceGetTopologyNearestGpus.RUnlock() + return calls +} + +// DeviceGetTotalEccErrors calls DeviceGetTotalEccErrorsFunc. +func (mock *Interface) DeviceGetTotalEccErrors(device nvml.Device, memoryErrorType nvml.MemoryErrorType, eccCounterType nvml.EccCounterType) (uint64, nvml.Return) { + if mock.DeviceGetTotalEccErrorsFunc == nil { + panic("Interface.DeviceGetTotalEccErrorsFunc: method is nil but Interface.DeviceGetTotalEccErrors was just called") + } + callInfo := struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + }{ + Device: device, + MemoryErrorType: memoryErrorType, + EccCounterType: eccCounterType, + } + mock.lockDeviceGetTotalEccErrors.Lock() + mock.calls.DeviceGetTotalEccErrors = append(mock.calls.DeviceGetTotalEccErrors, callInfo) + mock.lockDeviceGetTotalEccErrors.Unlock() + return mock.DeviceGetTotalEccErrorsFunc(device, memoryErrorType, eccCounterType) +} + +// DeviceGetTotalEccErrorsCalls gets all the calls that were made to DeviceGetTotalEccErrors. +// Check the length with: +// +// len(mockedInterface.DeviceGetTotalEccErrorsCalls()) +func (mock *Interface) DeviceGetTotalEccErrorsCalls() []struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType +} { + var calls []struct { + Device nvml.Device + MemoryErrorType nvml.MemoryErrorType + EccCounterType nvml.EccCounterType + } + mock.lockDeviceGetTotalEccErrors.RLock() + calls = mock.calls.DeviceGetTotalEccErrors + mock.lockDeviceGetTotalEccErrors.RUnlock() + return calls +} + +// DeviceGetTotalEnergyConsumption calls DeviceGetTotalEnergyConsumptionFunc. +func (mock *Interface) DeviceGetTotalEnergyConsumption(device nvml.Device) (uint64, nvml.Return) { + if mock.DeviceGetTotalEnergyConsumptionFunc == nil { + panic("Interface.DeviceGetTotalEnergyConsumptionFunc: method is nil but Interface.DeviceGetTotalEnergyConsumption was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetTotalEnergyConsumption.Lock() + mock.calls.DeviceGetTotalEnergyConsumption = append(mock.calls.DeviceGetTotalEnergyConsumption, callInfo) + mock.lockDeviceGetTotalEnergyConsumption.Unlock() + return mock.DeviceGetTotalEnergyConsumptionFunc(device) +} + +// DeviceGetTotalEnergyConsumptionCalls gets all the calls that were made to DeviceGetTotalEnergyConsumption. +// Check the length with: +// +// len(mockedInterface.DeviceGetTotalEnergyConsumptionCalls()) +func (mock *Interface) DeviceGetTotalEnergyConsumptionCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetTotalEnergyConsumption.RLock() + calls = mock.calls.DeviceGetTotalEnergyConsumption + mock.lockDeviceGetTotalEnergyConsumption.RUnlock() + return calls +} + +// DeviceGetUUID calls DeviceGetUUIDFunc. +func (mock *Interface) DeviceGetUUID(device nvml.Device) (string, nvml.Return) { + if mock.DeviceGetUUIDFunc == nil { + panic("Interface.DeviceGetUUIDFunc: method is nil but Interface.DeviceGetUUID was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetUUID.Lock() + mock.calls.DeviceGetUUID = append(mock.calls.DeviceGetUUID, callInfo) + mock.lockDeviceGetUUID.Unlock() + return mock.DeviceGetUUIDFunc(device) +} + +// DeviceGetUUIDCalls gets all the calls that were made to DeviceGetUUID. +// Check the length with: +// +// len(mockedInterface.DeviceGetUUIDCalls()) +func (mock *Interface) DeviceGetUUIDCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetUUID.RLock() + calls = mock.calls.DeviceGetUUID + mock.lockDeviceGetUUID.RUnlock() + return calls +} + +// DeviceGetUtilizationRates calls DeviceGetUtilizationRatesFunc. +func (mock *Interface) DeviceGetUtilizationRates(device nvml.Device) (nvml.Utilization, nvml.Return) { + if mock.DeviceGetUtilizationRatesFunc == nil { + panic("Interface.DeviceGetUtilizationRatesFunc: method is nil but Interface.DeviceGetUtilizationRates was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetUtilizationRates.Lock() + mock.calls.DeviceGetUtilizationRates = append(mock.calls.DeviceGetUtilizationRates, callInfo) + mock.lockDeviceGetUtilizationRates.Unlock() + return mock.DeviceGetUtilizationRatesFunc(device) +} + +// DeviceGetUtilizationRatesCalls gets all the calls that were made to DeviceGetUtilizationRates. +// Check the length with: +// +// len(mockedInterface.DeviceGetUtilizationRatesCalls()) +func (mock *Interface) DeviceGetUtilizationRatesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetUtilizationRates.RLock() + calls = mock.calls.DeviceGetUtilizationRates + mock.lockDeviceGetUtilizationRates.RUnlock() + return calls +} + +// DeviceGetVbiosVersion calls DeviceGetVbiosVersionFunc. +func (mock *Interface) DeviceGetVbiosVersion(device nvml.Device) (string, nvml.Return) { + if mock.DeviceGetVbiosVersionFunc == nil { + panic("Interface.DeviceGetVbiosVersionFunc: method is nil but Interface.DeviceGetVbiosVersion was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetVbiosVersion.Lock() + mock.calls.DeviceGetVbiosVersion = append(mock.calls.DeviceGetVbiosVersion, callInfo) + mock.lockDeviceGetVbiosVersion.Unlock() + return mock.DeviceGetVbiosVersionFunc(device) +} + +// DeviceGetVbiosVersionCalls gets all the calls that were made to DeviceGetVbiosVersion. +// Check the length with: +// +// len(mockedInterface.DeviceGetVbiosVersionCalls()) +func (mock *Interface) DeviceGetVbiosVersionCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetVbiosVersion.RLock() + calls = mock.calls.DeviceGetVbiosVersion + mock.lockDeviceGetVbiosVersion.RUnlock() + return calls +} + +// DeviceGetVgpuCapabilities calls DeviceGetVgpuCapabilitiesFunc. +func (mock *Interface) DeviceGetVgpuCapabilities(device nvml.Device, deviceVgpuCapability nvml.DeviceVgpuCapability) (bool, nvml.Return) { + if mock.DeviceGetVgpuCapabilitiesFunc == nil { + panic("Interface.DeviceGetVgpuCapabilitiesFunc: method is nil but Interface.DeviceGetVgpuCapabilities was just called") + } + callInfo := struct { + Device nvml.Device + DeviceVgpuCapability nvml.DeviceVgpuCapability + }{ + Device: device, + DeviceVgpuCapability: deviceVgpuCapability, + } + mock.lockDeviceGetVgpuCapabilities.Lock() + mock.calls.DeviceGetVgpuCapabilities = append(mock.calls.DeviceGetVgpuCapabilities, callInfo) + mock.lockDeviceGetVgpuCapabilities.Unlock() + return mock.DeviceGetVgpuCapabilitiesFunc(device, deviceVgpuCapability) +} + +// DeviceGetVgpuCapabilitiesCalls gets all the calls that were made to DeviceGetVgpuCapabilities. +// Check the length with: +// +// len(mockedInterface.DeviceGetVgpuCapabilitiesCalls()) +func (mock *Interface) DeviceGetVgpuCapabilitiesCalls() []struct { + Device nvml.Device + DeviceVgpuCapability nvml.DeviceVgpuCapability +} { + var calls []struct { + Device nvml.Device + DeviceVgpuCapability nvml.DeviceVgpuCapability + } + mock.lockDeviceGetVgpuCapabilities.RLock() + calls = mock.calls.DeviceGetVgpuCapabilities + mock.lockDeviceGetVgpuCapabilities.RUnlock() + return calls +} + +// DeviceGetVgpuMetadata calls DeviceGetVgpuMetadataFunc. +func (mock *Interface) DeviceGetVgpuMetadata(device nvml.Device) (nvml.VgpuPgpuMetadata, nvml.Return) { + if mock.DeviceGetVgpuMetadataFunc == nil { + panic("Interface.DeviceGetVgpuMetadataFunc: method is nil but Interface.DeviceGetVgpuMetadata was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetVgpuMetadata.Lock() + mock.calls.DeviceGetVgpuMetadata = append(mock.calls.DeviceGetVgpuMetadata, callInfo) + mock.lockDeviceGetVgpuMetadata.Unlock() + return mock.DeviceGetVgpuMetadataFunc(device) +} + +// DeviceGetVgpuMetadataCalls gets all the calls that were made to DeviceGetVgpuMetadata. +// Check the length with: +// +// len(mockedInterface.DeviceGetVgpuMetadataCalls()) +func (mock *Interface) DeviceGetVgpuMetadataCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetVgpuMetadata.RLock() + calls = mock.calls.DeviceGetVgpuMetadata + mock.lockDeviceGetVgpuMetadata.RUnlock() + return calls +} + +// DeviceGetVgpuProcessUtilization calls DeviceGetVgpuProcessUtilizationFunc. +func (mock *Interface) DeviceGetVgpuProcessUtilization(device nvml.Device, v uint64) ([]nvml.VgpuProcessUtilizationSample, nvml.Return) { + if mock.DeviceGetVgpuProcessUtilizationFunc == nil { + panic("Interface.DeviceGetVgpuProcessUtilizationFunc: method is nil but Interface.DeviceGetVgpuProcessUtilization was just called") + } + callInfo := struct { + Device nvml.Device + V uint64 + }{ + Device: device, + V: v, + } + mock.lockDeviceGetVgpuProcessUtilization.Lock() + mock.calls.DeviceGetVgpuProcessUtilization = append(mock.calls.DeviceGetVgpuProcessUtilization, callInfo) + mock.lockDeviceGetVgpuProcessUtilization.Unlock() + return mock.DeviceGetVgpuProcessUtilizationFunc(device, v) +} + +// DeviceGetVgpuProcessUtilizationCalls gets all the calls that were made to DeviceGetVgpuProcessUtilization. +// Check the length with: +// +// len(mockedInterface.DeviceGetVgpuProcessUtilizationCalls()) +func (mock *Interface) DeviceGetVgpuProcessUtilizationCalls() []struct { + Device nvml.Device + V uint64 +} { + var calls []struct { + Device nvml.Device + V uint64 + } + mock.lockDeviceGetVgpuProcessUtilization.RLock() + calls = mock.calls.DeviceGetVgpuProcessUtilization + mock.lockDeviceGetVgpuProcessUtilization.RUnlock() + return calls +} + +// DeviceGetVgpuSchedulerCapabilities calls DeviceGetVgpuSchedulerCapabilitiesFunc. +func (mock *Interface) DeviceGetVgpuSchedulerCapabilities(device nvml.Device) (nvml.VgpuSchedulerCapabilities, nvml.Return) { + if mock.DeviceGetVgpuSchedulerCapabilitiesFunc == nil { + panic("Interface.DeviceGetVgpuSchedulerCapabilitiesFunc: method is nil but Interface.DeviceGetVgpuSchedulerCapabilities was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetVgpuSchedulerCapabilities.Lock() + mock.calls.DeviceGetVgpuSchedulerCapabilities = append(mock.calls.DeviceGetVgpuSchedulerCapabilities, callInfo) + mock.lockDeviceGetVgpuSchedulerCapabilities.Unlock() + return mock.DeviceGetVgpuSchedulerCapabilitiesFunc(device) +} + +// DeviceGetVgpuSchedulerCapabilitiesCalls gets all the calls that were made to DeviceGetVgpuSchedulerCapabilities. +// Check the length with: +// +// len(mockedInterface.DeviceGetVgpuSchedulerCapabilitiesCalls()) +func (mock *Interface) DeviceGetVgpuSchedulerCapabilitiesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetVgpuSchedulerCapabilities.RLock() + calls = mock.calls.DeviceGetVgpuSchedulerCapabilities + mock.lockDeviceGetVgpuSchedulerCapabilities.RUnlock() + return calls +} + +// DeviceGetVgpuSchedulerLog calls DeviceGetVgpuSchedulerLogFunc. +func (mock *Interface) DeviceGetVgpuSchedulerLog(device nvml.Device) (nvml.VgpuSchedulerLog, nvml.Return) { + if mock.DeviceGetVgpuSchedulerLogFunc == nil { + panic("Interface.DeviceGetVgpuSchedulerLogFunc: method is nil but Interface.DeviceGetVgpuSchedulerLog was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetVgpuSchedulerLog.Lock() + mock.calls.DeviceGetVgpuSchedulerLog = append(mock.calls.DeviceGetVgpuSchedulerLog, callInfo) + mock.lockDeviceGetVgpuSchedulerLog.Unlock() + return mock.DeviceGetVgpuSchedulerLogFunc(device) +} + +// DeviceGetVgpuSchedulerLogCalls gets all the calls that were made to DeviceGetVgpuSchedulerLog. +// Check the length with: +// +// len(mockedInterface.DeviceGetVgpuSchedulerLogCalls()) +func (mock *Interface) DeviceGetVgpuSchedulerLogCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetVgpuSchedulerLog.RLock() + calls = mock.calls.DeviceGetVgpuSchedulerLog + mock.lockDeviceGetVgpuSchedulerLog.RUnlock() + return calls +} + +// DeviceGetVgpuSchedulerState calls DeviceGetVgpuSchedulerStateFunc. +func (mock *Interface) DeviceGetVgpuSchedulerState(device nvml.Device) (nvml.VgpuSchedulerGetState, nvml.Return) { + if mock.DeviceGetVgpuSchedulerStateFunc == nil { + panic("Interface.DeviceGetVgpuSchedulerStateFunc: method is nil but Interface.DeviceGetVgpuSchedulerState was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetVgpuSchedulerState.Lock() + mock.calls.DeviceGetVgpuSchedulerState = append(mock.calls.DeviceGetVgpuSchedulerState, callInfo) + mock.lockDeviceGetVgpuSchedulerState.Unlock() + return mock.DeviceGetVgpuSchedulerStateFunc(device) +} + +// DeviceGetVgpuSchedulerStateCalls gets all the calls that were made to DeviceGetVgpuSchedulerState. +// Check the length with: +// +// len(mockedInterface.DeviceGetVgpuSchedulerStateCalls()) +func (mock *Interface) DeviceGetVgpuSchedulerStateCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetVgpuSchedulerState.RLock() + calls = mock.calls.DeviceGetVgpuSchedulerState + mock.lockDeviceGetVgpuSchedulerState.RUnlock() + return calls +} + +// DeviceGetVgpuUtilization calls DeviceGetVgpuUtilizationFunc. +func (mock *Interface) DeviceGetVgpuUtilization(device nvml.Device, v uint64) (nvml.ValueType, []nvml.VgpuInstanceUtilizationSample, nvml.Return) { + if mock.DeviceGetVgpuUtilizationFunc == nil { + panic("Interface.DeviceGetVgpuUtilizationFunc: method is nil but Interface.DeviceGetVgpuUtilization was just called") + } + callInfo := struct { + Device nvml.Device + V uint64 + }{ + Device: device, + V: v, + } + mock.lockDeviceGetVgpuUtilization.Lock() + mock.calls.DeviceGetVgpuUtilization = append(mock.calls.DeviceGetVgpuUtilization, callInfo) + mock.lockDeviceGetVgpuUtilization.Unlock() + return mock.DeviceGetVgpuUtilizationFunc(device, v) +} + +// DeviceGetVgpuUtilizationCalls gets all the calls that were made to DeviceGetVgpuUtilization. +// Check the length with: +// +// len(mockedInterface.DeviceGetVgpuUtilizationCalls()) +func (mock *Interface) DeviceGetVgpuUtilizationCalls() []struct { + Device nvml.Device + V uint64 +} { + var calls []struct { + Device nvml.Device + V uint64 + } + mock.lockDeviceGetVgpuUtilization.RLock() + calls = mock.calls.DeviceGetVgpuUtilization + mock.lockDeviceGetVgpuUtilization.RUnlock() + return calls +} + +// DeviceGetViolationStatus calls DeviceGetViolationStatusFunc. +func (mock *Interface) DeviceGetViolationStatus(device nvml.Device, perfPolicyType nvml.PerfPolicyType) (nvml.ViolationTime, nvml.Return) { + if mock.DeviceGetViolationStatusFunc == nil { + panic("Interface.DeviceGetViolationStatusFunc: method is nil but Interface.DeviceGetViolationStatus was just called") + } + callInfo := struct { + Device nvml.Device + PerfPolicyType nvml.PerfPolicyType + }{ + Device: device, + PerfPolicyType: perfPolicyType, + } + mock.lockDeviceGetViolationStatus.Lock() + mock.calls.DeviceGetViolationStatus = append(mock.calls.DeviceGetViolationStatus, callInfo) + mock.lockDeviceGetViolationStatus.Unlock() + return mock.DeviceGetViolationStatusFunc(device, perfPolicyType) +} + +// DeviceGetViolationStatusCalls gets all the calls that were made to DeviceGetViolationStatus. +// Check the length with: +// +// len(mockedInterface.DeviceGetViolationStatusCalls()) +func (mock *Interface) DeviceGetViolationStatusCalls() []struct { + Device nvml.Device + PerfPolicyType nvml.PerfPolicyType +} { + var calls []struct { + Device nvml.Device + PerfPolicyType nvml.PerfPolicyType + } + mock.lockDeviceGetViolationStatus.RLock() + calls = mock.calls.DeviceGetViolationStatus + mock.lockDeviceGetViolationStatus.RUnlock() + return calls +} + +// DeviceGetVirtualizationMode calls DeviceGetVirtualizationModeFunc. +func (mock *Interface) DeviceGetVirtualizationMode(device nvml.Device) (nvml.GpuVirtualizationMode, nvml.Return) { + if mock.DeviceGetVirtualizationModeFunc == nil { + panic("Interface.DeviceGetVirtualizationModeFunc: method is nil but Interface.DeviceGetVirtualizationMode was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceGetVirtualizationMode.Lock() + mock.calls.DeviceGetVirtualizationMode = append(mock.calls.DeviceGetVirtualizationMode, callInfo) + mock.lockDeviceGetVirtualizationMode.Unlock() + return mock.DeviceGetVirtualizationModeFunc(device) +} + +// DeviceGetVirtualizationModeCalls gets all the calls that were made to DeviceGetVirtualizationMode. +// Check the length with: +// +// len(mockedInterface.DeviceGetVirtualizationModeCalls()) +func (mock *Interface) DeviceGetVirtualizationModeCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceGetVirtualizationMode.RLock() + calls = mock.calls.DeviceGetVirtualizationMode + mock.lockDeviceGetVirtualizationMode.RUnlock() + return calls +} + +// DeviceIsMigDeviceHandle calls DeviceIsMigDeviceHandleFunc. +func (mock *Interface) DeviceIsMigDeviceHandle(device nvml.Device) (bool, nvml.Return) { + if mock.DeviceIsMigDeviceHandleFunc == nil { + panic("Interface.DeviceIsMigDeviceHandleFunc: method is nil but Interface.DeviceIsMigDeviceHandle was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceIsMigDeviceHandle.Lock() + mock.calls.DeviceIsMigDeviceHandle = append(mock.calls.DeviceIsMigDeviceHandle, callInfo) + mock.lockDeviceIsMigDeviceHandle.Unlock() + return mock.DeviceIsMigDeviceHandleFunc(device) +} + +// DeviceIsMigDeviceHandleCalls gets all the calls that were made to DeviceIsMigDeviceHandle. +// Check the length with: +// +// len(mockedInterface.DeviceIsMigDeviceHandleCalls()) +func (mock *Interface) DeviceIsMigDeviceHandleCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceIsMigDeviceHandle.RLock() + calls = mock.calls.DeviceIsMigDeviceHandle + mock.lockDeviceIsMigDeviceHandle.RUnlock() + return calls +} + +// DeviceModifyDrainState calls DeviceModifyDrainStateFunc. +func (mock *Interface) DeviceModifyDrainState(pciInfo *nvml.PciInfo, enableState nvml.EnableState) nvml.Return { + if mock.DeviceModifyDrainStateFunc == nil { + panic("Interface.DeviceModifyDrainStateFunc: method is nil but Interface.DeviceModifyDrainState was just called") + } + callInfo := struct { + PciInfo *nvml.PciInfo + EnableState nvml.EnableState + }{ + PciInfo: pciInfo, + EnableState: enableState, + } + mock.lockDeviceModifyDrainState.Lock() + mock.calls.DeviceModifyDrainState = append(mock.calls.DeviceModifyDrainState, callInfo) + mock.lockDeviceModifyDrainState.Unlock() + return mock.DeviceModifyDrainStateFunc(pciInfo, enableState) +} + +// DeviceModifyDrainStateCalls gets all the calls that were made to DeviceModifyDrainState. +// Check the length with: +// +// len(mockedInterface.DeviceModifyDrainStateCalls()) +func (mock *Interface) DeviceModifyDrainStateCalls() []struct { + PciInfo *nvml.PciInfo + EnableState nvml.EnableState +} { + var calls []struct { + PciInfo *nvml.PciInfo + EnableState nvml.EnableState + } + mock.lockDeviceModifyDrainState.RLock() + calls = mock.calls.DeviceModifyDrainState + mock.lockDeviceModifyDrainState.RUnlock() + return calls +} + +// DeviceOnSameBoard calls DeviceOnSameBoardFunc. +func (mock *Interface) DeviceOnSameBoard(device1 nvml.Device, device2 nvml.Device) (int, nvml.Return) { + if mock.DeviceOnSameBoardFunc == nil { + panic("Interface.DeviceOnSameBoardFunc: method is nil but Interface.DeviceOnSameBoard was just called") + } + callInfo := struct { + Device1 nvml.Device + Device2 nvml.Device + }{ + Device1: device1, + Device2: device2, + } + mock.lockDeviceOnSameBoard.Lock() + mock.calls.DeviceOnSameBoard = append(mock.calls.DeviceOnSameBoard, callInfo) + mock.lockDeviceOnSameBoard.Unlock() + return mock.DeviceOnSameBoardFunc(device1, device2) +} + +// DeviceOnSameBoardCalls gets all the calls that were made to DeviceOnSameBoard. +// Check the length with: +// +// len(mockedInterface.DeviceOnSameBoardCalls()) +func (mock *Interface) DeviceOnSameBoardCalls() []struct { + Device1 nvml.Device + Device2 nvml.Device +} { + var calls []struct { + Device1 nvml.Device + Device2 nvml.Device + } + mock.lockDeviceOnSameBoard.RLock() + calls = mock.calls.DeviceOnSameBoard + mock.lockDeviceOnSameBoard.RUnlock() + return calls +} + +// DeviceQueryDrainState calls DeviceQueryDrainStateFunc. +func (mock *Interface) DeviceQueryDrainState(pciInfo *nvml.PciInfo) (nvml.EnableState, nvml.Return) { + if mock.DeviceQueryDrainStateFunc == nil { + panic("Interface.DeviceQueryDrainStateFunc: method is nil but Interface.DeviceQueryDrainState was just called") + } + callInfo := struct { + PciInfo *nvml.PciInfo + }{ + PciInfo: pciInfo, + } + mock.lockDeviceQueryDrainState.Lock() + mock.calls.DeviceQueryDrainState = append(mock.calls.DeviceQueryDrainState, callInfo) + mock.lockDeviceQueryDrainState.Unlock() + return mock.DeviceQueryDrainStateFunc(pciInfo) +} + +// DeviceQueryDrainStateCalls gets all the calls that were made to DeviceQueryDrainState. +// Check the length with: +// +// len(mockedInterface.DeviceQueryDrainStateCalls()) +func (mock *Interface) DeviceQueryDrainStateCalls() []struct { + PciInfo *nvml.PciInfo +} { + var calls []struct { + PciInfo *nvml.PciInfo + } + mock.lockDeviceQueryDrainState.RLock() + calls = mock.calls.DeviceQueryDrainState + mock.lockDeviceQueryDrainState.RUnlock() + return calls +} + +// DeviceRegisterEvents calls DeviceRegisterEventsFunc. +func (mock *Interface) DeviceRegisterEvents(device nvml.Device, v uint64, eventSet nvml.EventSet) nvml.Return { + if mock.DeviceRegisterEventsFunc == nil { + panic("Interface.DeviceRegisterEventsFunc: method is nil but Interface.DeviceRegisterEvents was just called") + } + callInfo := struct { + Device nvml.Device + V uint64 + EventSet nvml.EventSet + }{ + Device: device, + V: v, + EventSet: eventSet, + } + mock.lockDeviceRegisterEvents.Lock() + mock.calls.DeviceRegisterEvents = append(mock.calls.DeviceRegisterEvents, callInfo) + mock.lockDeviceRegisterEvents.Unlock() + return mock.DeviceRegisterEventsFunc(device, v, eventSet) +} + +// DeviceRegisterEventsCalls gets all the calls that were made to DeviceRegisterEvents. +// Check the length with: +// +// len(mockedInterface.DeviceRegisterEventsCalls()) +func (mock *Interface) DeviceRegisterEventsCalls() []struct { + Device nvml.Device + V uint64 + EventSet nvml.EventSet +} { + var calls []struct { + Device nvml.Device + V uint64 + EventSet nvml.EventSet + } + mock.lockDeviceRegisterEvents.RLock() + calls = mock.calls.DeviceRegisterEvents + mock.lockDeviceRegisterEvents.RUnlock() + return calls +} + +// DeviceRemoveGpu calls DeviceRemoveGpuFunc. +func (mock *Interface) DeviceRemoveGpu(pciInfo *nvml.PciInfo) nvml.Return { + if mock.DeviceRemoveGpuFunc == nil { + panic("Interface.DeviceRemoveGpuFunc: method is nil but Interface.DeviceRemoveGpu was just called") + } + callInfo := struct { + PciInfo *nvml.PciInfo + }{ + PciInfo: pciInfo, + } + mock.lockDeviceRemoveGpu.Lock() + mock.calls.DeviceRemoveGpu = append(mock.calls.DeviceRemoveGpu, callInfo) + mock.lockDeviceRemoveGpu.Unlock() + return mock.DeviceRemoveGpuFunc(pciInfo) +} + +// DeviceRemoveGpuCalls gets all the calls that were made to DeviceRemoveGpu. +// Check the length with: +// +// len(mockedInterface.DeviceRemoveGpuCalls()) +func (mock *Interface) DeviceRemoveGpuCalls() []struct { + PciInfo *nvml.PciInfo +} { + var calls []struct { + PciInfo *nvml.PciInfo + } + mock.lockDeviceRemoveGpu.RLock() + calls = mock.calls.DeviceRemoveGpu + mock.lockDeviceRemoveGpu.RUnlock() + return calls +} + +// DeviceRemoveGpu_v2 calls DeviceRemoveGpu_v2Func. +func (mock *Interface) DeviceRemoveGpu_v2(pciInfo *nvml.PciInfo, detachGpuState nvml.DetachGpuState, pcieLinkState nvml.PcieLinkState) nvml.Return { + if mock.DeviceRemoveGpu_v2Func == nil { + panic("Interface.DeviceRemoveGpu_v2Func: method is nil but Interface.DeviceRemoveGpu_v2 was just called") + } + callInfo := struct { + PciInfo *nvml.PciInfo + DetachGpuState nvml.DetachGpuState + PcieLinkState nvml.PcieLinkState + }{ + PciInfo: pciInfo, + DetachGpuState: detachGpuState, + PcieLinkState: pcieLinkState, + } + mock.lockDeviceRemoveGpu_v2.Lock() + mock.calls.DeviceRemoveGpu_v2 = append(mock.calls.DeviceRemoveGpu_v2, callInfo) + mock.lockDeviceRemoveGpu_v2.Unlock() + return mock.DeviceRemoveGpu_v2Func(pciInfo, detachGpuState, pcieLinkState) +} + +// DeviceRemoveGpu_v2Calls gets all the calls that were made to DeviceRemoveGpu_v2. +// Check the length with: +// +// len(mockedInterface.DeviceRemoveGpu_v2Calls()) +func (mock *Interface) DeviceRemoveGpu_v2Calls() []struct { + PciInfo *nvml.PciInfo + DetachGpuState nvml.DetachGpuState + PcieLinkState nvml.PcieLinkState +} { + var calls []struct { + PciInfo *nvml.PciInfo + DetachGpuState nvml.DetachGpuState + PcieLinkState nvml.PcieLinkState + } + mock.lockDeviceRemoveGpu_v2.RLock() + calls = mock.calls.DeviceRemoveGpu_v2 + mock.lockDeviceRemoveGpu_v2.RUnlock() + return calls +} + +// DeviceResetApplicationsClocks calls DeviceResetApplicationsClocksFunc. +func (mock *Interface) DeviceResetApplicationsClocks(device nvml.Device) nvml.Return { + if mock.DeviceResetApplicationsClocksFunc == nil { + panic("Interface.DeviceResetApplicationsClocksFunc: method is nil but Interface.DeviceResetApplicationsClocks was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceResetApplicationsClocks.Lock() + mock.calls.DeviceResetApplicationsClocks = append(mock.calls.DeviceResetApplicationsClocks, callInfo) + mock.lockDeviceResetApplicationsClocks.Unlock() + return mock.DeviceResetApplicationsClocksFunc(device) +} + +// DeviceResetApplicationsClocksCalls gets all the calls that were made to DeviceResetApplicationsClocks. +// Check the length with: +// +// len(mockedInterface.DeviceResetApplicationsClocksCalls()) +func (mock *Interface) DeviceResetApplicationsClocksCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceResetApplicationsClocks.RLock() + calls = mock.calls.DeviceResetApplicationsClocks + mock.lockDeviceResetApplicationsClocks.RUnlock() + return calls +} + +// DeviceResetGpuLockedClocks calls DeviceResetGpuLockedClocksFunc. +func (mock *Interface) DeviceResetGpuLockedClocks(device nvml.Device) nvml.Return { + if mock.DeviceResetGpuLockedClocksFunc == nil { + panic("Interface.DeviceResetGpuLockedClocksFunc: method is nil but Interface.DeviceResetGpuLockedClocks was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceResetGpuLockedClocks.Lock() + mock.calls.DeviceResetGpuLockedClocks = append(mock.calls.DeviceResetGpuLockedClocks, callInfo) + mock.lockDeviceResetGpuLockedClocks.Unlock() + return mock.DeviceResetGpuLockedClocksFunc(device) +} + +// DeviceResetGpuLockedClocksCalls gets all the calls that were made to DeviceResetGpuLockedClocks. +// Check the length with: +// +// len(mockedInterface.DeviceResetGpuLockedClocksCalls()) +func (mock *Interface) DeviceResetGpuLockedClocksCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceResetGpuLockedClocks.RLock() + calls = mock.calls.DeviceResetGpuLockedClocks + mock.lockDeviceResetGpuLockedClocks.RUnlock() + return calls +} + +// DeviceResetMemoryLockedClocks calls DeviceResetMemoryLockedClocksFunc. +func (mock *Interface) DeviceResetMemoryLockedClocks(device nvml.Device) nvml.Return { + if mock.DeviceResetMemoryLockedClocksFunc == nil { + panic("Interface.DeviceResetMemoryLockedClocksFunc: method is nil but Interface.DeviceResetMemoryLockedClocks was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceResetMemoryLockedClocks.Lock() + mock.calls.DeviceResetMemoryLockedClocks = append(mock.calls.DeviceResetMemoryLockedClocks, callInfo) + mock.lockDeviceResetMemoryLockedClocks.Unlock() + return mock.DeviceResetMemoryLockedClocksFunc(device) +} + +// DeviceResetMemoryLockedClocksCalls gets all the calls that were made to DeviceResetMemoryLockedClocks. +// Check the length with: +// +// len(mockedInterface.DeviceResetMemoryLockedClocksCalls()) +func (mock *Interface) DeviceResetMemoryLockedClocksCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceResetMemoryLockedClocks.RLock() + calls = mock.calls.DeviceResetMemoryLockedClocks + mock.lockDeviceResetMemoryLockedClocks.RUnlock() + return calls +} + +// DeviceResetNvLinkErrorCounters calls DeviceResetNvLinkErrorCountersFunc. +func (mock *Interface) DeviceResetNvLinkErrorCounters(device nvml.Device, n int) nvml.Return { + if mock.DeviceResetNvLinkErrorCountersFunc == nil { + panic("Interface.DeviceResetNvLinkErrorCountersFunc: method is nil but Interface.DeviceResetNvLinkErrorCounters was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceResetNvLinkErrorCounters.Lock() + mock.calls.DeviceResetNvLinkErrorCounters = append(mock.calls.DeviceResetNvLinkErrorCounters, callInfo) + mock.lockDeviceResetNvLinkErrorCounters.Unlock() + return mock.DeviceResetNvLinkErrorCountersFunc(device, n) +} + +// DeviceResetNvLinkErrorCountersCalls gets all the calls that were made to DeviceResetNvLinkErrorCounters. +// Check the length with: +// +// len(mockedInterface.DeviceResetNvLinkErrorCountersCalls()) +func (mock *Interface) DeviceResetNvLinkErrorCountersCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceResetNvLinkErrorCounters.RLock() + calls = mock.calls.DeviceResetNvLinkErrorCounters + mock.lockDeviceResetNvLinkErrorCounters.RUnlock() + return calls +} + +// DeviceResetNvLinkUtilizationCounter calls DeviceResetNvLinkUtilizationCounterFunc. +func (mock *Interface) DeviceResetNvLinkUtilizationCounter(device nvml.Device, n1 int, n2 int) nvml.Return { + if mock.DeviceResetNvLinkUtilizationCounterFunc == nil { + panic("Interface.DeviceResetNvLinkUtilizationCounterFunc: method is nil but Interface.DeviceResetNvLinkUtilizationCounter was just called") + } + callInfo := struct { + Device nvml.Device + N1 int + N2 int + }{ + Device: device, + N1: n1, + N2: n2, + } + mock.lockDeviceResetNvLinkUtilizationCounter.Lock() + mock.calls.DeviceResetNvLinkUtilizationCounter = append(mock.calls.DeviceResetNvLinkUtilizationCounter, callInfo) + mock.lockDeviceResetNvLinkUtilizationCounter.Unlock() + return mock.DeviceResetNvLinkUtilizationCounterFunc(device, n1, n2) +} + +// DeviceResetNvLinkUtilizationCounterCalls gets all the calls that were made to DeviceResetNvLinkUtilizationCounter. +// Check the length with: +// +// len(mockedInterface.DeviceResetNvLinkUtilizationCounterCalls()) +func (mock *Interface) DeviceResetNvLinkUtilizationCounterCalls() []struct { + Device nvml.Device + N1 int + N2 int +} { + var calls []struct { + Device nvml.Device + N1 int + N2 int + } + mock.lockDeviceResetNvLinkUtilizationCounter.RLock() + calls = mock.calls.DeviceResetNvLinkUtilizationCounter + mock.lockDeviceResetNvLinkUtilizationCounter.RUnlock() + return calls +} + +// DeviceSetAPIRestriction calls DeviceSetAPIRestrictionFunc. +func (mock *Interface) DeviceSetAPIRestriction(device nvml.Device, restrictedAPI nvml.RestrictedAPI, enableState nvml.EnableState) nvml.Return { + if mock.DeviceSetAPIRestrictionFunc == nil { + panic("Interface.DeviceSetAPIRestrictionFunc: method is nil but Interface.DeviceSetAPIRestriction was just called") + } + callInfo := struct { + Device nvml.Device + RestrictedAPI nvml.RestrictedAPI + EnableState nvml.EnableState + }{ + Device: device, + RestrictedAPI: restrictedAPI, + EnableState: enableState, + } + mock.lockDeviceSetAPIRestriction.Lock() + mock.calls.DeviceSetAPIRestriction = append(mock.calls.DeviceSetAPIRestriction, callInfo) + mock.lockDeviceSetAPIRestriction.Unlock() + return mock.DeviceSetAPIRestrictionFunc(device, restrictedAPI, enableState) +} + +// DeviceSetAPIRestrictionCalls gets all the calls that were made to DeviceSetAPIRestriction. +// Check the length with: +// +// len(mockedInterface.DeviceSetAPIRestrictionCalls()) +func (mock *Interface) DeviceSetAPIRestrictionCalls() []struct { + Device nvml.Device + RestrictedAPI nvml.RestrictedAPI + EnableState nvml.EnableState +} { + var calls []struct { + Device nvml.Device + RestrictedAPI nvml.RestrictedAPI + EnableState nvml.EnableState + } + mock.lockDeviceSetAPIRestriction.RLock() + calls = mock.calls.DeviceSetAPIRestriction + mock.lockDeviceSetAPIRestriction.RUnlock() + return calls +} + +// DeviceSetAccountingMode calls DeviceSetAccountingModeFunc. +func (mock *Interface) DeviceSetAccountingMode(device nvml.Device, enableState nvml.EnableState) nvml.Return { + if mock.DeviceSetAccountingModeFunc == nil { + panic("Interface.DeviceSetAccountingModeFunc: method is nil but Interface.DeviceSetAccountingMode was just called") + } + callInfo := struct { + Device nvml.Device + EnableState nvml.EnableState + }{ + Device: device, + EnableState: enableState, + } + mock.lockDeviceSetAccountingMode.Lock() + mock.calls.DeviceSetAccountingMode = append(mock.calls.DeviceSetAccountingMode, callInfo) + mock.lockDeviceSetAccountingMode.Unlock() + return mock.DeviceSetAccountingModeFunc(device, enableState) +} + +// DeviceSetAccountingModeCalls gets all the calls that were made to DeviceSetAccountingMode. +// Check the length with: +// +// len(mockedInterface.DeviceSetAccountingModeCalls()) +func (mock *Interface) DeviceSetAccountingModeCalls() []struct { + Device nvml.Device + EnableState nvml.EnableState +} { + var calls []struct { + Device nvml.Device + EnableState nvml.EnableState + } + mock.lockDeviceSetAccountingMode.RLock() + calls = mock.calls.DeviceSetAccountingMode + mock.lockDeviceSetAccountingMode.RUnlock() + return calls +} + +// DeviceSetApplicationsClocks calls DeviceSetApplicationsClocksFunc. +func (mock *Interface) DeviceSetApplicationsClocks(device nvml.Device, v1 uint32, v2 uint32) nvml.Return { + if mock.DeviceSetApplicationsClocksFunc == nil { + panic("Interface.DeviceSetApplicationsClocksFunc: method is nil but Interface.DeviceSetApplicationsClocks was just called") + } + callInfo := struct { + Device nvml.Device + V1 uint32 + V2 uint32 + }{ + Device: device, + V1: v1, + V2: v2, + } + mock.lockDeviceSetApplicationsClocks.Lock() + mock.calls.DeviceSetApplicationsClocks = append(mock.calls.DeviceSetApplicationsClocks, callInfo) + mock.lockDeviceSetApplicationsClocks.Unlock() + return mock.DeviceSetApplicationsClocksFunc(device, v1, v2) +} + +// DeviceSetApplicationsClocksCalls gets all the calls that were made to DeviceSetApplicationsClocks. +// Check the length with: +// +// len(mockedInterface.DeviceSetApplicationsClocksCalls()) +func (mock *Interface) DeviceSetApplicationsClocksCalls() []struct { + Device nvml.Device + V1 uint32 + V2 uint32 +} { + var calls []struct { + Device nvml.Device + V1 uint32 + V2 uint32 + } + mock.lockDeviceSetApplicationsClocks.RLock() + calls = mock.calls.DeviceSetApplicationsClocks + mock.lockDeviceSetApplicationsClocks.RUnlock() + return calls +} + +// DeviceSetAutoBoostedClocksEnabled calls DeviceSetAutoBoostedClocksEnabledFunc. +func (mock *Interface) DeviceSetAutoBoostedClocksEnabled(device nvml.Device, enableState nvml.EnableState) nvml.Return { + if mock.DeviceSetAutoBoostedClocksEnabledFunc == nil { + panic("Interface.DeviceSetAutoBoostedClocksEnabledFunc: method is nil but Interface.DeviceSetAutoBoostedClocksEnabled was just called") + } + callInfo := struct { + Device nvml.Device + EnableState nvml.EnableState + }{ + Device: device, + EnableState: enableState, + } + mock.lockDeviceSetAutoBoostedClocksEnabled.Lock() + mock.calls.DeviceSetAutoBoostedClocksEnabled = append(mock.calls.DeviceSetAutoBoostedClocksEnabled, callInfo) + mock.lockDeviceSetAutoBoostedClocksEnabled.Unlock() + return mock.DeviceSetAutoBoostedClocksEnabledFunc(device, enableState) +} + +// DeviceSetAutoBoostedClocksEnabledCalls gets all the calls that were made to DeviceSetAutoBoostedClocksEnabled. +// Check the length with: +// +// len(mockedInterface.DeviceSetAutoBoostedClocksEnabledCalls()) +func (mock *Interface) DeviceSetAutoBoostedClocksEnabledCalls() []struct { + Device nvml.Device + EnableState nvml.EnableState +} { + var calls []struct { + Device nvml.Device + EnableState nvml.EnableState + } + mock.lockDeviceSetAutoBoostedClocksEnabled.RLock() + calls = mock.calls.DeviceSetAutoBoostedClocksEnabled + mock.lockDeviceSetAutoBoostedClocksEnabled.RUnlock() + return calls +} + +// DeviceSetComputeMode calls DeviceSetComputeModeFunc. +func (mock *Interface) DeviceSetComputeMode(device nvml.Device, computeMode nvml.ComputeMode) nvml.Return { + if mock.DeviceSetComputeModeFunc == nil { + panic("Interface.DeviceSetComputeModeFunc: method is nil but Interface.DeviceSetComputeMode was just called") + } + callInfo := struct { + Device nvml.Device + ComputeMode nvml.ComputeMode + }{ + Device: device, + ComputeMode: computeMode, + } + mock.lockDeviceSetComputeMode.Lock() + mock.calls.DeviceSetComputeMode = append(mock.calls.DeviceSetComputeMode, callInfo) + mock.lockDeviceSetComputeMode.Unlock() + return mock.DeviceSetComputeModeFunc(device, computeMode) +} + +// DeviceSetComputeModeCalls gets all the calls that were made to DeviceSetComputeMode. +// Check the length with: +// +// len(mockedInterface.DeviceSetComputeModeCalls()) +func (mock *Interface) DeviceSetComputeModeCalls() []struct { + Device nvml.Device + ComputeMode nvml.ComputeMode +} { + var calls []struct { + Device nvml.Device + ComputeMode nvml.ComputeMode + } + mock.lockDeviceSetComputeMode.RLock() + calls = mock.calls.DeviceSetComputeMode + mock.lockDeviceSetComputeMode.RUnlock() + return calls +} + +// DeviceSetCpuAffinity calls DeviceSetCpuAffinityFunc. +func (mock *Interface) DeviceSetCpuAffinity(device nvml.Device) nvml.Return { + if mock.DeviceSetCpuAffinityFunc == nil { + panic("Interface.DeviceSetCpuAffinityFunc: method is nil but Interface.DeviceSetCpuAffinity was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceSetCpuAffinity.Lock() + mock.calls.DeviceSetCpuAffinity = append(mock.calls.DeviceSetCpuAffinity, callInfo) + mock.lockDeviceSetCpuAffinity.Unlock() + return mock.DeviceSetCpuAffinityFunc(device) +} + +// DeviceSetCpuAffinityCalls gets all the calls that were made to DeviceSetCpuAffinity. +// Check the length with: +// +// len(mockedInterface.DeviceSetCpuAffinityCalls()) +func (mock *Interface) DeviceSetCpuAffinityCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceSetCpuAffinity.RLock() + calls = mock.calls.DeviceSetCpuAffinity + mock.lockDeviceSetCpuAffinity.RUnlock() + return calls +} + +// DeviceSetDefaultAutoBoostedClocksEnabled calls DeviceSetDefaultAutoBoostedClocksEnabledFunc. +func (mock *Interface) DeviceSetDefaultAutoBoostedClocksEnabled(device nvml.Device, enableState nvml.EnableState, v uint32) nvml.Return { + if mock.DeviceSetDefaultAutoBoostedClocksEnabledFunc == nil { + panic("Interface.DeviceSetDefaultAutoBoostedClocksEnabledFunc: method is nil but Interface.DeviceSetDefaultAutoBoostedClocksEnabled was just called") + } + callInfo := struct { + Device nvml.Device + EnableState nvml.EnableState + V uint32 + }{ + Device: device, + EnableState: enableState, + V: v, + } + mock.lockDeviceSetDefaultAutoBoostedClocksEnabled.Lock() + mock.calls.DeviceSetDefaultAutoBoostedClocksEnabled = append(mock.calls.DeviceSetDefaultAutoBoostedClocksEnabled, callInfo) + mock.lockDeviceSetDefaultAutoBoostedClocksEnabled.Unlock() + return mock.DeviceSetDefaultAutoBoostedClocksEnabledFunc(device, enableState, v) +} + +// DeviceSetDefaultAutoBoostedClocksEnabledCalls gets all the calls that were made to DeviceSetDefaultAutoBoostedClocksEnabled. +// Check the length with: +// +// len(mockedInterface.DeviceSetDefaultAutoBoostedClocksEnabledCalls()) +func (mock *Interface) DeviceSetDefaultAutoBoostedClocksEnabledCalls() []struct { + Device nvml.Device + EnableState nvml.EnableState + V uint32 +} { + var calls []struct { + Device nvml.Device + EnableState nvml.EnableState + V uint32 + } + mock.lockDeviceSetDefaultAutoBoostedClocksEnabled.RLock() + calls = mock.calls.DeviceSetDefaultAutoBoostedClocksEnabled + mock.lockDeviceSetDefaultAutoBoostedClocksEnabled.RUnlock() + return calls +} + +// DeviceSetDefaultFanSpeed_v2 calls DeviceSetDefaultFanSpeed_v2Func. +func (mock *Interface) DeviceSetDefaultFanSpeed_v2(device nvml.Device, n int) nvml.Return { + if mock.DeviceSetDefaultFanSpeed_v2Func == nil { + panic("Interface.DeviceSetDefaultFanSpeed_v2Func: method is nil but Interface.DeviceSetDefaultFanSpeed_v2 was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceSetDefaultFanSpeed_v2.Lock() + mock.calls.DeviceSetDefaultFanSpeed_v2 = append(mock.calls.DeviceSetDefaultFanSpeed_v2, callInfo) + mock.lockDeviceSetDefaultFanSpeed_v2.Unlock() + return mock.DeviceSetDefaultFanSpeed_v2Func(device, n) +} + +// DeviceSetDefaultFanSpeed_v2Calls gets all the calls that were made to DeviceSetDefaultFanSpeed_v2. +// Check the length with: +// +// len(mockedInterface.DeviceSetDefaultFanSpeed_v2Calls()) +func (mock *Interface) DeviceSetDefaultFanSpeed_v2Calls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceSetDefaultFanSpeed_v2.RLock() + calls = mock.calls.DeviceSetDefaultFanSpeed_v2 + mock.lockDeviceSetDefaultFanSpeed_v2.RUnlock() + return calls +} + +// DeviceSetDriverModel calls DeviceSetDriverModelFunc. +func (mock *Interface) DeviceSetDriverModel(device nvml.Device, driverModel nvml.DriverModel, v uint32) nvml.Return { + if mock.DeviceSetDriverModelFunc == nil { + panic("Interface.DeviceSetDriverModelFunc: method is nil but Interface.DeviceSetDriverModel was just called") + } + callInfo := struct { + Device nvml.Device + DriverModel nvml.DriverModel + V uint32 + }{ + Device: device, + DriverModel: driverModel, + V: v, + } + mock.lockDeviceSetDriverModel.Lock() + mock.calls.DeviceSetDriverModel = append(mock.calls.DeviceSetDriverModel, callInfo) + mock.lockDeviceSetDriverModel.Unlock() + return mock.DeviceSetDriverModelFunc(device, driverModel, v) +} + +// DeviceSetDriverModelCalls gets all the calls that were made to DeviceSetDriverModel. +// Check the length with: +// +// len(mockedInterface.DeviceSetDriverModelCalls()) +func (mock *Interface) DeviceSetDriverModelCalls() []struct { + Device nvml.Device + DriverModel nvml.DriverModel + V uint32 +} { + var calls []struct { + Device nvml.Device + DriverModel nvml.DriverModel + V uint32 + } + mock.lockDeviceSetDriverModel.RLock() + calls = mock.calls.DeviceSetDriverModel + mock.lockDeviceSetDriverModel.RUnlock() + return calls +} + +// DeviceSetEccMode calls DeviceSetEccModeFunc. +func (mock *Interface) DeviceSetEccMode(device nvml.Device, enableState nvml.EnableState) nvml.Return { + if mock.DeviceSetEccModeFunc == nil { + panic("Interface.DeviceSetEccModeFunc: method is nil but Interface.DeviceSetEccMode was just called") + } + callInfo := struct { + Device nvml.Device + EnableState nvml.EnableState + }{ + Device: device, + EnableState: enableState, + } + mock.lockDeviceSetEccMode.Lock() + mock.calls.DeviceSetEccMode = append(mock.calls.DeviceSetEccMode, callInfo) + mock.lockDeviceSetEccMode.Unlock() + return mock.DeviceSetEccModeFunc(device, enableState) +} + +// DeviceSetEccModeCalls gets all the calls that were made to DeviceSetEccMode. +// Check the length with: +// +// len(mockedInterface.DeviceSetEccModeCalls()) +func (mock *Interface) DeviceSetEccModeCalls() []struct { + Device nvml.Device + EnableState nvml.EnableState +} { + var calls []struct { + Device nvml.Device + EnableState nvml.EnableState + } + mock.lockDeviceSetEccMode.RLock() + calls = mock.calls.DeviceSetEccMode + mock.lockDeviceSetEccMode.RUnlock() + return calls +} + +// DeviceSetFanControlPolicy calls DeviceSetFanControlPolicyFunc. +func (mock *Interface) DeviceSetFanControlPolicy(device nvml.Device, n int, fanControlPolicy nvml.FanControlPolicy) nvml.Return { + if mock.DeviceSetFanControlPolicyFunc == nil { + panic("Interface.DeviceSetFanControlPolicyFunc: method is nil but Interface.DeviceSetFanControlPolicy was just called") + } + callInfo := struct { + Device nvml.Device + N int + FanControlPolicy nvml.FanControlPolicy + }{ + Device: device, + N: n, + FanControlPolicy: fanControlPolicy, + } + mock.lockDeviceSetFanControlPolicy.Lock() + mock.calls.DeviceSetFanControlPolicy = append(mock.calls.DeviceSetFanControlPolicy, callInfo) + mock.lockDeviceSetFanControlPolicy.Unlock() + return mock.DeviceSetFanControlPolicyFunc(device, n, fanControlPolicy) +} + +// DeviceSetFanControlPolicyCalls gets all the calls that were made to DeviceSetFanControlPolicy. +// Check the length with: +// +// len(mockedInterface.DeviceSetFanControlPolicyCalls()) +func (mock *Interface) DeviceSetFanControlPolicyCalls() []struct { + Device nvml.Device + N int + FanControlPolicy nvml.FanControlPolicy +} { + var calls []struct { + Device nvml.Device + N int + FanControlPolicy nvml.FanControlPolicy + } + mock.lockDeviceSetFanControlPolicy.RLock() + calls = mock.calls.DeviceSetFanControlPolicy + mock.lockDeviceSetFanControlPolicy.RUnlock() + return calls +} + +// DeviceSetFanSpeed_v2 calls DeviceSetFanSpeed_v2Func. +func (mock *Interface) DeviceSetFanSpeed_v2(device nvml.Device, n1 int, n2 int) nvml.Return { + if mock.DeviceSetFanSpeed_v2Func == nil { + panic("Interface.DeviceSetFanSpeed_v2Func: method is nil but Interface.DeviceSetFanSpeed_v2 was just called") + } + callInfo := struct { + Device nvml.Device + N1 int + N2 int + }{ + Device: device, + N1: n1, + N2: n2, + } + mock.lockDeviceSetFanSpeed_v2.Lock() + mock.calls.DeviceSetFanSpeed_v2 = append(mock.calls.DeviceSetFanSpeed_v2, callInfo) + mock.lockDeviceSetFanSpeed_v2.Unlock() + return mock.DeviceSetFanSpeed_v2Func(device, n1, n2) +} + +// DeviceSetFanSpeed_v2Calls gets all the calls that were made to DeviceSetFanSpeed_v2. +// Check the length with: +// +// len(mockedInterface.DeviceSetFanSpeed_v2Calls()) +func (mock *Interface) DeviceSetFanSpeed_v2Calls() []struct { + Device nvml.Device + N1 int + N2 int +} { + var calls []struct { + Device nvml.Device + N1 int + N2 int + } + mock.lockDeviceSetFanSpeed_v2.RLock() + calls = mock.calls.DeviceSetFanSpeed_v2 + mock.lockDeviceSetFanSpeed_v2.RUnlock() + return calls +} + +// DeviceSetGpcClkVfOffset calls DeviceSetGpcClkVfOffsetFunc. +func (mock *Interface) DeviceSetGpcClkVfOffset(device nvml.Device, n int) nvml.Return { + if mock.DeviceSetGpcClkVfOffsetFunc == nil { + panic("Interface.DeviceSetGpcClkVfOffsetFunc: method is nil but Interface.DeviceSetGpcClkVfOffset was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceSetGpcClkVfOffset.Lock() + mock.calls.DeviceSetGpcClkVfOffset = append(mock.calls.DeviceSetGpcClkVfOffset, callInfo) + mock.lockDeviceSetGpcClkVfOffset.Unlock() + return mock.DeviceSetGpcClkVfOffsetFunc(device, n) +} + +// DeviceSetGpcClkVfOffsetCalls gets all the calls that were made to DeviceSetGpcClkVfOffset. +// Check the length with: +// +// len(mockedInterface.DeviceSetGpcClkVfOffsetCalls()) +func (mock *Interface) DeviceSetGpcClkVfOffsetCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceSetGpcClkVfOffset.RLock() + calls = mock.calls.DeviceSetGpcClkVfOffset + mock.lockDeviceSetGpcClkVfOffset.RUnlock() + return calls +} + +// DeviceSetGpuLockedClocks calls DeviceSetGpuLockedClocksFunc. +func (mock *Interface) DeviceSetGpuLockedClocks(device nvml.Device, v1 uint32, v2 uint32) nvml.Return { + if mock.DeviceSetGpuLockedClocksFunc == nil { + panic("Interface.DeviceSetGpuLockedClocksFunc: method is nil but Interface.DeviceSetGpuLockedClocks was just called") + } + callInfo := struct { + Device nvml.Device + V1 uint32 + V2 uint32 + }{ + Device: device, + V1: v1, + V2: v2, + } + mock.lockDeviceSetGpuLockedClocks.Lock() + mock.calls.DeviceSetGpuLockedClocks = append(mock.calls.DeviceSetGpuLockedClocks, callInfo) + mock.lockDeviceSetGpuLockedClocks.Unlock() + return mock.DeviceSetGpuLockedClocksFunc(device, v1, v2) +} + +// DeviceSetGpuLockedClocksCalls gets all the calls that were made to DeviceSetGpuLockedClocks. +// Check the length with: +// +// len(mockedInterface.DeviceSetGpuLockedClocksCalls()) +func (mock *Interface) DeviceSetGpuLockedClocksCalls() []struct { + Device nvml.Device + V1 uint32 + V2 uint32 +} { + var calls []struct { + Device nvml.Device + V1 uint32 + V2 uint32 + } + mock.lockDeviceSetGpuLockedClocks.RLock() + calls = mock.calls.DeviceSetGpuLockedClocks + mock.lockDeviceSetGpuLockedClocks.RUnlock() + return calls +} + +// DeviceSetGpuOperationMode calls DeviceSetGpuOperationModeFunc. +func (mock *Interface) DeviceSetGpuOperationMode(device nvml.Device, gpuOperationMode nvml.GpuOperationMode) nvml.Return { + if mock.DeviceSetGpuOperationModeFunc == nil { + panic("Interface.DeviceSetGpuOperationModeFunc: method is nil but Interface.DeviceSetGpuOperationMode was just called") + } + callInfo := struct { + Device nvml.Device + GpuOperationMode nvml.GpuOperationMode + }{ + Device: device, + GpuOperationMode: gpuOperationMode, + } + mock.lockDeviceSetGpuOperationMode.Lock() + mock.calls.DeviceSetGpuOperationMode = append(mock.calls.DeviceSetGpuOperationMode, callInfo) + mock.lockDeviceSetGpuOperationMode.Unlock() + return mock.DeviceSetGpuOperationModeFunc(device, gpuOperationMode) +} + +// DeviceSetGpuOperationModeCalls gets all the calls that were made to DeviceSetGpuOperationMode. +// Check the length with: +// +// len(mockedInterface.DeviceSetGpuOperationModeCalls()) +func (mock *Interface) DeviceSetGpuOperationModeCalls() []struct { + Device nvml.Device + GpuOperationMode nvml.GpuOperationMode +} { + var calls []struct { + Device nvml.Device + GpuOperationMode nvml.GpuOperationMode + } + mock.lockDeviceSetGpuOperationMode.RLock() + calls = mock.calls.DeviceSetGpuOperationMode + mock.lockDeviceSetGpuOperationMode.RUnlock() + return calls +} + +// DeviceSetMemClkVfOffset calls DeviceSetMemClkVfOffsetFunc. +func (mock *Interface) DeviceSetMemClkVfOffset(device nvml.Device, n int) nvml.Return { + if mock.DeviceSetMemClkVfOffsetFunc == nil { + panic("Interface.DeviceSetMemClkVfOffsetFunc: method is nil but Interface.DeviceSetMemClkVfOffset was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceSetMemClkVfOffset.Lock() + mock.calls.DeviceSetMemClkVfOffset = append(mock.calls.DeviceSetMemClkVfOffset, callInfo) + mock.lockDeviceSetMemClkVfOffset.Unlock() + return mock.DeviceSetMemClkVfOffsetFunc(device, n) +} + +// DeviceSetMemClkVfOffsetCalls gets all the calls that were made to DeviceSetMemClkVfOffset. +// Check the length with: +// +// len(mockedInterface.DeviceSetMemClkVfOffsetCalls()) +func (mock *Interface) DeviceSetMemClkVfOffsetCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceSetMemClkVfOffset.RLock() + calls = mock.calls.DeviceSetMemClkVfOffset + mock.lockDeviceSetMemClkVfOffset.RUnlock() + return calls +} + +// DeviceSetMemoryLockedClocks calls DeviceSetMemoryLockedClocksFunc. +func (mock *Interface) DeviceSetMemoryLockedClocks(device nvml.Device, v1 uint32, v2 uint32) nvml.Return { + if mock.DeviceSetMemoryLockedClocksFunc == nil { + panic("Interface.DeviceSetMemoryLockedClocksFunc: method is nil but Interface.DeviceSetMemoryLockedClocks was just called") + } + callInfo := struct { + Device nvml.Device + V1 uint32 + V2 uint32 + }{ + Device: device, + V1: v1, + V2: v2, + } + mock.lockDeviceSetMemoryLockedClocks.Lock() + mock.calls.DeviceSetMemoryLockedClocks = append(mock.calls.DeviceSetMemoryLockedClocks, callInfo) + mock.lockDeviceSetMemoryLockedClocks.Unlock() + return mock.DeviceSetMemoryLockedClocksFunc(device, v1, v2) +} + +// DeviceSetMemoryLockedClocksCalls gets all the calls that were made to DeviceSetMemoryLockedClocks. +// Check the length with: +// +// len(mockedInterface.DeviceSetMemoryLockedClocksCalls()) +func (mock *Interface) DeviceSetMemoryLockedClocksCalls() []struct { + Device nvml.Device + V1 uint32 + V2 uint32 +} { + var calls []struct { + Device nvml.Device + V1 uint32 + V2 uint32 + } + mock.lockDeviceSetMemoryLockedClocks.RLock() + calls = mock.calls.DeviceSetMemoryLockedClocks + mock.lockDeviceSetMemoryLockedClocks.RUnlock() + return calls +} + +// DeviceSetMigMode calls DeviceSetMigModeFunc. +func (mock *Interface) DeviceSetMigMode(device nvml.Device, n int) (nvml.Return, nvml.Return) { + if mock.DeviceSetMigModeFunc == nil { + panic("Interface.DeviceSetMigModeFunc: method is nil but Interface.DeviceSetMigMode was just called") + } + callInfo := struct { + Device nvml.Device + N int + }{ + Device: device, + N: n, + } + mock.lockDeviceSetMigMode.Lock() + mock.calls.DeviceSetMigMode = append(mock.calls.DeviceSetMigMode, callInfo) + mock.lockDeviceSetMigMode.Unlock() + return mock.DeviceSetMigModeFunc(device, n) +} + +// DeviceSetMigModeCalls gets all the calls that were made to DeviceSetMigMode. +// Check the length with: +// +// len(mockedInterface.DeviceSetMigModeCalls()) +func (mock *Interface) DeviceSetMigModeCalls() []struct { + Device nvml.Device + N int +} { + var calls []struct { + Device nvml.Device + N int + } + mock.lockDeviceSetMigMode.RLock() + calls = mock.calls.DeviceSetMigMode + mock.lockDeviceSetMigMode.RUnlock() + return calls +} + +// DeviceSetNvLinkDeviceLowPowerThreshold calls DeviceSetNvLinkDeviceLowPowerThresholdFunc. +func (mock *Interface) DeviceSetNvLinkDeviceLowPowerThreshold(device nvml.Device, nvLinkPowerThres *nvml.NvLinkPowerThres) nvml.Return { + if mock.DeviceSetNvLinkDeviceLowPowerThresholdFunc == nil { + panic("Interface.DeviceSetNvLinkDeviceLowPowerThresholdFunc: method is nil but Interface.DeviceSetNvLinkDeviceLowPowerThreshold was just called") + } + callInfo := struct { + Device nvml.Device + NvLinkPowerThres *nvml.NvLinkPowerThres + }{ + Device: device, + NvLinkPowerThres: nvLinkPowerThres, + } + mock.lockDeviceSetNvLinkDeviceLowPowerThreshold.Lock() + mock.calls.DeviceSetNvLinkDeviceLowPowerThreshold = append(mock.calls.DeviceSetNvLinkDeviceLowPowerThreshold, callInfo) + mock.lockDeviceSetNvLinkDeviceLowPowerThreshold.Unlock() + return mock.DeviceSetNvLinkDeviceLowPowerThresholdFunc(device, nvLinkPowerThres) +} + +// DeviceSetNvLinkDeviceLowPowerThresholdCalls gets all the calls that were made to DeviceSetNvLinkDeviceLowPowerThreshold. +// Check the length with: +// +// len(mockedInterface.DeviceSetNvLinkDeviceLowPowerThresholdCalls()) +func (mock *Interface) DeviceSetNvLinkDeviceLowPowerThresholdCalls() []struct { + Device nvml.Device + NvLinkPowerThres *nvml.NvLinkPowerThres +} { + var calls []struct { + Device nvml.Device + NvLinkPowerThres *nvml.NvLinkPowerThres + } + mock.lockDeviceSetNvLinkDeviceLowPowerThreshold.RLock() + calls = mock.calls.DeviceSetNvLinkDeviceLowPowerThreshold + mock.lockDeviceSetNvLinkDeviceLowPowerThreshold.RUnlock() + return calls +} + +// DeviceSetNvLinkUtilizationControl calls DeviceSetNvLinkUtilizationControlFunc. +func (mock *Interface) DeviceSetNvLinkUtilizationControl(device nvml.Device, n1 int, n2 int, nvLinkUtilizationControl *nvml.NvLinkUtilizationControl, b bool) nvml.Return { + if mock.DeviceSetNvLinkUtilizationControlFunc == nil { + panic("Interface.DeviceSetNvLinkUtilizationControlFunc: method is nil but Interface.DeviceSetNvLinkUtilizationControl was just called") + } + callInfo := struct { + Device nvml.Device + N1 int + N2 int + NvLinkUtilizationControl *nvml.NvLinkUtilizationControl + B bool + }{ + Device: device, + N1: n1, + N2: n2, + NvLinkUtilizationControl: nvLinkUtilizationControl, + B: b, + } + mock.lockDeviceSetNvLinkUtilizationControl.Lock() + mock.calls.DeviceSetNvLinkUtilizationControl = append(mock.calls.DeviceSetNvLinkUtilizationControl, callInfo) + mock.lockDeviceSetNvLinkUtilizationControl.Unlock() + return mock.DeviceSetNvLinkUtilizationControlFunc(device, n1, n2, nvLinkUtilizationControl, b) +} + +// DeviceSetNvLinkUtilizationControlCalls gets all the calls that were made to DeviceSetNvLinkUtilizationControl. +// Check the length with: +// +// len(mockedInterface.DeviceSetNvLinkUtilizationControlCalls()) +func (mock *Interface) DeviceSetNvLinkUtilizationControlCalls() []struct { + Device nvml.Device + N1 int + N2 int + NvLinkUtilizationControl *nvml.NvLinkUtilizationControl + B bool +} { + var calls []struct { + Device nvml.Device + N1 int + N2 int + NvLinkUtilizationControl *nvml.NvLinkUtilizationControl + B bool + } + mock.lockDeviceSetNvLinkUtilizationControl.RLock() + calls = mock.calls.DeviceSetNvLinkUtilizationControl + mock.lockDeviceSetNvLinkUtilizationControl.RUnlock() + return calls +} + +// DeviceSetPersistenceMode calls DeviceSetPersistenceModeFunc. +func (mock *Interface) DeviceSetPersistenceMode(device nvml.Device, enableState nvml.EnableState) nvml.Return { + if mock.DeviceSetPersistenceModeFunc == nil { + panic("Interface.DeviceSetPersistenceModeFunc: method is nil but Interface.DeviceSetPersistenceMode was just called") + } + callInfo := struct { + Device nvml.Device + EnableState nvml.EnableState + }{ + Device: device, + EnableState: enableState, + } + mock.lockDeviceSetPersistenceMode.Lock() + mock.calls.DeviceSetPersistenceMode = append(mock.calls.DeviceSetPersistenceMode, callInfo) + mock.lockDeviceSetPersistenceMode.Unlock() + return mock.DeviceSetPersistenceModeFunc(device, enableState) +} + +// DeviceSetPersistenceModeCalls gets all the calls that were made to DeviceSetPersistenceMode. +// Check the length with: +// +// len(mockedInterface.DeviceSetPersistenceModeCalls()) +func (mock *Interface) DeviceSetPersistenceModeCalls() []struct { + Device nvml.Device + EnableState nvml.EnableState +} { + var calls []struct { + Device nvml.Device + EnableState nvml.EnableState + } + mock.lockDeviceSetPersistenceMode.RLock() + calls = mock.calls.DeviceSetPersistenceMode + mock.lockDeviceSetPersistenceMode.RUnlock() + return calls +} + +// DeviceSetPowerManagementLimit calls DeviceSetPowerManagementLimitFunc. +func (mock *Interface) DeviceSetPowerManagementLimit(device nvml.Device, v uint32) nvml.Return { + if mock.DeviceSetPowerManagementLimitFunc == nil { + panic("Interface.DeviceSetPowerManagementLimitFunc: method is nil but Interface.DeviceSetPowerManagementLimit was just called") + } + callInfo := struct { + Device nvml.Device + V uint32 + }{ + Device: device, + V: v, + } + mock.lockDeviceSetPowerManagementLimit.Lock() + mock.calls.DeviceSetPowerManagementLimit = append(mock.calls.DeviceSetPowerManagementLimit, callInfo) + mock.lockDeviceSetPowerManagementLimit.Unlock() + return mock.DeviceSetPowerManagementLimitFunc(device, v) +} + +// DeviceSetPowerManagementLimitCalls gets all the calls that were made to DeviceSetPowerManagementLimit. +// Check the length with: +// +// len(mockedInterface.DeviceSetPowerManagementLimitCalls()) +func (mock *Interface) DeviceSetPowerManagementLimitCalls() []struct { + Device nvml.Device + V uint32 +} { + var calls []struct { + Device nvml.Device + V uint32 + } + mock.lockDeviceSetPowerManagementLimit.RLock() + calls = mock.calls.DeviceSetPowerManagementLimit + mock.lockDeviceSetPowerManagementLimit.RUnlock() + return calls +} + +// DeviceSetTemperatureThreshold calls DeviceSetTemperatureThresholdFunc. +func (mock *Interface) DeviceSetTemperatureThreshold(device nvml.Device, temperatureThresholds nvml.TemperatureThresholds, n int) nvml.Return { + if mock.DeviceSetTemperatureThresholdFunc == nil { + panic("Interface.DeviceSetTemperatureThresholdFunc: method is nil but Interface.DeviceSetTemperatureThreshold was just called") + } + callInfo := struct { + Device nvml.Device + TemperatureThresholds nvml.TemperatureThresholds + N int + }{ + Device: device, + TemperatureThresholds: temperatureThresholds, + N: n, + } + mock.lockDeviceSetTemperatureThreshold.Lock() + mock.calls.DeviceSetTemperatureThreshold = append(mock.calls.DeviceSetTemperatureThreshold, callInfo) + mock.lockDeviceSetTemperatureThreshold.Unlock() + return mock.DeviceSetTemperatureThresholdFunc(device, temperatureThresholds, n) +} + +// DeviceSetTemperatureThresholdCalls gets all the calls that were made to DeviceSetTemperatureThreshold. +// Check the length with: +// +// len(mockedInterface.DeviceSetTemperatureThresholdCalls()) +func (mock *Interface) DeviceSetTemperatureThresholdCalls() []struct { + Device nvml.Device + TemperatureThresholds nvml.TemperatureThresholds + N int +} { + var calls []struct { + Device nvml.Device + TemperatureThresholds nvml.TemperatureThresholds + N int + } + mock.lockDeviceSetTemperatureThreshold.RLock() + calls = mock.calls.DeviceSetTemperatureThreshold + mock.lockDeviceSetTemperatureThreshold.RUnlock() + return calls +} + +// DeviceSetVgpuSchedulerState calls DeviceSetVgpuSchedulerStateFunc. +func (mock *Interface) DeviceSetVgpuSchedulerState(device nvml.Device, vgpuSchedulerSetState *nvml.VgpuSchedulerSetState) nvml.Return { + if mock.DeviceSetVgpuSchedulerStateFunc == nil { + panic("Interface.DeviceSetVgpuSchedulerStateFunc: method is nil but Interface.DeviceSetVgpuSchedulerState was just called") + } + callInfo := struct { + Device nvml.Device + VgpuSchedulerSetState *nvml.VgpuSchedulerSetState + }{ + Device: device, + VgpuSchedulerSetState: vgpuSchedulerSetState, + } + mock.lockDeviceSetVgpuSchedulerState.Lock() + mock.calls.DeviceSetVgpuSchedulerState = append(mock.calls.DeviceSetVgpuSchedulerState, callInfo) + mock.lockDeviceSetVgpuSchedulerState.Unlock() + return mock.DeviceSetVgpuSchedulerStateFunc(device, vgpuSchedulerSetState) +} + +// DeviceSetVgpuSchedulerStateCalls gets all the calls that were made to DeviceSetVgpuSchedulerState. +// Check the length with: +// +// len(mockedInterface.DeviceSetVgpuSchedulerStateCalls()) +func (mock *Interface) DeviceSetVgpuSchedulerStateCalls() []struct { + Device nvml.Device + VgpuSchedulerSetState *nvml.VgpuSchedulerSetState +} { + var calls []struct { + Device nvml.Device + VgpuSchedulerSetState *nvml.VgpuSchedulerSetState + } + mock.lockDeviceSetVgpuSchedulerState.RLock() + calls = mock.calls.DeviceSetVgpuSchedulerState + mock.lockDeviceSetVgpuSchedulerState.RUnlock() + return calls +} + +// DeviceSetVirtualizationMode calls DeviceSetVirtualizationModeFunc. +func (mock *Interface) DeviceSetVirtualizationMode(device nvml.Device, gpuVirtualizationMode nvml.GpuVirtualizationMode) nvml.Return { + if mock.DeviceSetVirtualizationModeFunc == nil { + panic("Interface.DeviceSetVirtualizationModeFunc: method is nil but Interface.DeviceSetVirtualizationMode was just called") + } + callInfo := struct { + Device nvml.Device + GpuVirtualizationMode nvml.GpuVirtualizationMode + }{ + Device: device, + GpuVirtualizationMode: gpuVirtualizationMode, + } + mock.lockDeviceSetVirtualizationMode.Lock() + mock.calls.DeviceSetVirtualizationMode = append(mock.calls.DeviceSetVirtualizationMode, callInfo) + mock.lockDeviceSetVirtualizationMode.Unlock() + return mock.DeviceSetVirtualizationModeFunc(device, gpuVirtualizationMode) +} + +// DeviceSetVirtualizationModeCalls gets all the calls that were made to DeviceSetVirtualizationMode. +// Check the length with: +// +// len(mockedInterface.DeviceSetVirtualizationModeCalls()) +func (mock *Interface) DeviceSetVirtualizationModeCalls() []struct { + Device nvml.Device + GpuVirtualizationMode nvml.GpuVirtualizationMode +} { + var calls []struct { + Device nvml.Device + GpuVirtualizationMode nvml.GpuVirtualizationMode + } + mock.lockDeviceSetVirtualizationMode.RLock() + calls = mock.calls.DeviceSetVirtualizationMode + mock.lockDeviceSetVirtualizationMode.RUnlock() + return calls +} + +// DeviceValidateInforom calls DeviceValidateInforomFunc. +func (mock *Interface) DeviceValidateInforom(device nvml.Device) nvml.Return { + if mock.DeviceValidateInforomFunc == nil { + panic("Interface.DeviceValidateInforomFunc: method is nil but Interface.DeviceValidateInforom was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockDeviceValidateInforom.Lock() + mock.calls.DeviceValidateInforom = append(mock.calls.DeviceValidateInforom, callInfo) + mock.lockDeviceValidateInforom.Unlock() + return mock.DeviceValidateInforomFunc(device) +} + +// DeviceValidateInforomCalls gets all the calls that were made to DeviceValidateInforom. +// Check the length with: +// +// len(mockedInterface.DeviceValidateInforomCalls()) +func (mock *Interface) DeviceValidateInforomCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockDeviceValidateInforom.RLock() + calls = mock.calls.DeviceValidateInforom + mock.lockDeviceValidateInforom.RUnlock() + return calls +} + +// ErrorString calls ErrorStringFunc. +func (mock *Interface) ErrorString(returnMoqParam nvml.Return) string { + if mock.ErrorStringFunc == nil { + panic("Interface.ErrorStringFunc: method is nil but Interface.ErrorString was just called") + } + callInfo := struct { + ReturnMoqParam nvml.Return + }{ + ReturnMoqParam: returnMoqParam, + } + mock.lockErrorString.Lock() + mock.calls.ErrorString = append(mock.calls.ErrorString, callInfo) + mock.lockErrorString.Unlock() + return mock.ErrorStringFunc(returnMoqParam) +} + +// ErrorStringCalls gets all the calls that were made to ErrorString. +// Check the length with: +// +// len(mockedInterface.ErrorStringCalls()) +func (mock *Interface) ErrorStringCalls() []struct { + ReturnMoqParam nvml.Return +} { + var calls []struct { + ReturnMoqParam nvml.Return + } + mock.lockErrorString.RLock() + calls = mock.calls.ErrorString + mock.lockErrorString.RUnlock() + return calls +} + +// EventSetCreate calls EventSetCreateFunc. +func (mock *Interface) EventSetCreate() (nvml.EventSet, nvml.Return) { + if mock.EventSetCreateFunc == nil { + panic("Interface.EventSetCreateFunc: method is nil but Interface.EventSetCreate was just called") + } + callInfo := struct { + }{} + mock.lockEventSetCreate.Lock() + mock.calls.EventSetCreate = append(mock.calls.EventSetCreate, callInfo) + mock.lockEventSetCreate.Unlock() + return mock.EventSetCreateFunc() +} + +// EventSetCreateCalls gets all the calls that were made to EventSetCreate. +// Check the length with: +// +// len(mockedInterface.EventSetCreateCalls()) +func (mock *Interface) EventSetCreateCalls() []struct { +} { + var calls []struct { + } + mock.lockEventSetCreate.RLock() + calls = mock.calls.EventSetCreate + mock.lockEventSetCreate.RUnlock() + return calls +} + +// EventSetFree calls EventSetFreeFunc. +func (mock *Interface) EventSetFree(eventSet nvml.EventSet) nvml.Return { + if mock.EventSetFreeFunc == nil { + panic("Interface.EventSetFreeFunc: method is nil but Interface.EventSetFree was just called") + } + callInfo := struct { + EventSet nvml.EventSet + }{ + EventSet: eventSet, + } + mock.lockEventSetFree.Lock() + mock.calls.EventSetFree = append(mock.calls.EventSetFree, callInfo) + mock.lockEventSetFree.Unlock() + return mock.EventSetFreeFunc(eventSet) +} + +// EventSetFreeCalls gets all the calls that were made to EventSetFree. +// Check the length with: +// +// len(mockedInterface.EventSetFreeCalls()) +func (mock *Interface) EventSetFreeCalls() []struct { + EventSet nvml.EventSet +} { + var calls []struct { + EventSet nvml.EventSet + } + mock.lockEventSetFree.RLock() + calls = mock.calls.EventSetFree + mock.lockEventSetFree.RUnlock() + return calls +} + +// EventSetWait calls EventSetWaitFunc. +func (mock *Interface) EventSetWait(eventSet nvml.EventSet, v uint32) (nvml.EventData, nvml.Return) { + if mock.EventSetWaitFunc == nil { + panic("Interface.EventSetWaitFunc: method is nil but Interface.EventSetWait was just called") + } + callInfo := struct { + EventSet nvml.EventSet + V uint32 + }{ + EventSet: eventSet, + V: v, + } + mock.lockEventSetWait.Lock() + mock.calls.EventSetWait = append(mock.calls.EventSetWait, callInfo) + mock.lockEventSetWait.Unlock() + return mock.EventSetWaitFunc(eventSet, v) +} + +// EventSetWaitCalls gets all the calls that were made to EventSetWait. +// Check the length with: +// +// len(mockedInterface.EventSetWaitCalls()) +func (mock *Interface) EventSetWaitCalls() []struct { + EventSet nvml.EventSet + V uint32 +} { + var calls []struct { + EventSet nvml.EventSet + V uint32 + } + mock.lockEventSetWait.RLock() + calls = mock.calls.EventSetWait + mock.lockEventSetWait.RUnlock() + return calls +} + +// GetExcludedDeviceCount calls GetExcludedDeviceCountFunc. +func (mock *Interface) GetExcludedDeviceCount() (int, nvml.Return) { + if mock.GetExcludedDeviceCountFunc == nil { + panic("Interface.GetExcludedDeviceCountFunc: method is nil but Interface.GetExcludedDeviceCount was just called") + } + callInfo := struct { + }{} + mock.lockGetExcludedDeviceCount.Lock() + mock.calls.GetExcludedDeviceCount = append(mock.calls.GetExcludedDeviceCount, callInfo) + mock.lockGetExcludedDeviceCount.Unlock() + return mock.GetExcludedDeviceCountFunc() +} + +// GetExcludedDeviceCountCalls gets all the calls that were made to GetExcludedDeviceCount. +// Check the length with: +// +// len(mockedInterface.GetExcludedDeviceCountCalls()) +func (mock *Interface) GetExcludedDeviceCountCalls() []struct { +} { + var calls []struct { + } + mock.lockGetExcludedDeviceCount.RLock() + calls = mock.calls.GetExcludedDeviceCount + mock.lockGetExcludedDeviceCount.RUnlock() + return calls +} + +// GetExcludedDeviceInfoByIndex calls GetExcludedDeviceInfoByIndexFunc. +func (mock *Interface) GetExcludedDeviceInfoByIndex(n int) (nvml.ExcludedDeviceInfo, nvml.Return) { + if mock.GetExcludedDeviceInfoByIndexFunc == nil { + panic("Interface.GetExcludedDeviceInfoByIndexFunc: method is nil but Interface.GetExcludedDeviceInfoByIndex was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetExcludedDeviceInfoByIndex.Lock() + mock.calls.GetExcludedDeviceInfoByIndex = append(mock.calls.GetExcludedDeviceInfoByIndex, callInfo) + mock.lockGetExcludedDeviceInfoByIndex.Unlock() + return mock.GetExcludedDeviceInfoByIndexFunc(n) +} + +// GetExcludedDeviceInfoByIndexCalls gets all the calls that were made to GetExcludedDeviceInfoByIndex. +// Check the length with: +// +// len(mockedInterface.GetExcludedDeviceInfoByIndexCalls()) +func (mock *Interface) GetExcludedDeviceInfoByIndexCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetExcludedDeviceInfoByIndex.RLock() + calls = mock.calls.GetExcludedDeviceInfoByIndex + mock.lockGetExcludedDeviceInfoByIndex.RUnlock() + return calls +} + +// GetLibrary calls GetLibraryFunc. +func (mock *Interface) GetLibrary() nvml.Library { + if mock.GetLibraryFunc == nil { + panic("Interface.GetLibraryFunc: method is nil but Interface.GetLibrary was just called") + } + callInfo := struct { + }{} + mock.lockGetLibrary.Lock() + mock.calls.GetLibrary = append(mock.calls.GetLibrary, callInfo) + mock.lockGetLibrary.Unlock() + return mock.GetLibraryFunc() +} + +// GetLibraryCalls gets all the calls that were made to GetLibrary. +// Check the length with: +// +// len(mockedInterface.GetLibraryCalls()) +func (mock *Interface) GetLibraryCalls() []struct { +} { + var calls []struct { + } + mock.lockGetLibrary.RLock() + calls = mock.calls.GetLibrary + mock.lockGetLibrary.RUnlock() + return calls +} + +// GetVgpuCompatibility calls GetVgpuCompatibilityFunc. +func (mock *Interface) GetVgpuCompatibility(vgpuMetadata *nvml.VgpuMetadata, vgpuPgpuMetadata *nvml.VgpuPgpuMetadata) (nvml.VgpuPgpuCompatibility, nvml.Return) { + if mock.GetVgpuCompatibilityFunc == nil { + panic("Interface.GetVgpuCompatibilityFunc: method is nil but Interface.GetVgpuCompatibility was just called") + } + callInfo := struct { + VgpuMetadata *nvml.VgpuMetadata + VgpuPgpuMetadata *nvml.VgpuPgpuMetadata + }{ + VgpuMetadata: vgpuMetadata, + VgpuPgpuMetadata: vgpuPgpuMetadata, + } + mock.lockGetVgpuCompatibility.Lock() + mock.calls.GetVgpuCompatibility = append(mock.calls.GetVgpuCompatibility, callInfo) + mock.lockGetVgpuCompatibility.Unlock() + return mock.GetVgpuCompatibilityFunc(vgpuMetadata, vgpuPgpuMetadata) +} + +// GetVgpuCompatibilityCalls gets all the calls that were made to GetVgpuCompatibility. +// Check the length with: +// +// len(mockedInterface.GetVgpuCompatibilityCalls()) +func (mock *Interface) GetVgpuCompatibilityCalls() []struct { + VgpuMetadata *nvml.VgpuMetadata + VgpuPgpuMetadata *nvml.VgpuPgpuMetadata +} { + var calls []struct { + VgpuMetadata *nvml.VgpuMetadata + VgpuPgpuMetadata *nvml.VgpuPgpuMetadata + } + mock.lockGetVgpuCompatibility.RLock() + calls = mock.calls.GetVgpuCompatibility + mock.lockGetVgpuCompatibility.RUnlock() + return calls +} + +// GetVgpuDriverCapabilities calls GetVgpuDriverCapabilitiesFunc. +func (mock *Interface) GetVgpuDriverCapabilities(vgpuDriverCapability nvml.VgpuDriverCapability) (bool, nvml.Return) { + if mock.GetVgpuDriverCapabilitiesFunc == nil { + panic("Interface.GetVgpuDriverCapabilitiesFunc: method is nil but Interface.GetVgpuDriverCapabilities was just called") + } + callInfo := struct { + VgpuDriverCapability nvml.VgpuDriverCapability + }{ + VgpuDriverCapability: vgpuDriverCapability, + } + mock.lockGetVgpuDriverCapabilities.Lock() + mock.calls.GetVgpuDriverCapabilities = append(mock.calls.GetVgpuDriverCapabilities, callInfo) + mock.lockGetVgpuDriverCapabilities.Unlock() + return mock.GetVgpuDriverCapabilitiesFunc(vgpuDriverCapability) +} + +// GetVgpuDriverCapabilitiesCalls gets all the calls that were made to GetVgpuDriverCapabilities. +// Check the length with: +// +// len(mockedInterface.GetVgpuDriverCapabilitiesCalls()) +func (mock *Interface) GetVgpuDriverCapabilitiesCalls() []struct { + VgpuDriverCapability nvml.VgpuDriverCapability +} { + var calls []struct { + VgpuDriverCapability nvml.VgpuDriverCapability + } + mock.lockGetVgpuDriverCapabilities.RLock() + calls = mock.calls.GetVgpuDriverCapabilities + mock.lockGetVgpuDriverCapabilities.RUnlock() + return calls +} + +// GetVgpuVersion calls GetVgpuVersionFunc. +func (mock *Interface) GetVgpuVersion() (nvml.VgpuVersion, nvml.VgpuVersion, nvml.Return) { + if mock.GetVgpuVersionFunc == nil { + panic("Interface.GetVgpuVersionFunc: method is nil but Interface.GetVgpuVersion was just called") + } + callInfo := struct { + }{} + mock.lockGetVgpuVersion.Lock() + mock.calls.GetVgpuVersion = append(mock.calls.GetVgpuVersion, callInfo) + mock.lockGetVgpuVersion.Unlock() + return mock.GetVgpuVersionFunc() +} + +// GetVgpuVersionCalls gets all the calls that were made to GetVgpuVersion. +// Check the length with: +// +// len(mockedInterface.GetVgpuVersionCalls()) +func (mock *Interface) GetVgpuVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVgpuVersion.RLock() + calls = mock.calls.GetVgpuVersion + mock.lockGetVgpuVersion.RUnlock() + return calls +} + +// GpmMetricsGet calls GpmMetricsGetFunc. +func (mock *Interface) GpmMetricsGet(gpmMetricsGetType *nvml.GpmMetricsGetType) nvml.Return { + if mock.GpmMetricsGetFunc == nil { + panic("Interface.GpmMetricsGetFunc: method is nil but Interface.GpmMetricsGet was just called") + } + callInfo := struct { + GpmMetricsGetType *nvml.GpmMetricsGetType + }{ + GpmMetricsGetType: gpmMetricsGetType, + } + mock.lockGpmMetricsGet.Lock() + mock.calls.GpmMetricsGet = append(mock.calls.GpmMetricsGet, callInfo) + mock.lockGpmMetricsGet.Unlock() + return mock.GpmMetricsGetFunc(gpmMetricsGetType) +} + +// GpmMetricsGetCalls gets all the calls that were made to GpmMetricsGet. +// Check the length with: +// +// len(mockedInterface.GpmMetricsGetCalls()) +func (mock *Interface) GpmMetricsGetCalls() []struct { + GpmMetricsGetType *nvml.GpmMetricsGetType +} { + var calls []struct { + GpmMetricsGetType *nvml.GpmMetricsGetType + } + mock.lockGpmMetricsGet.RLock() + calls = mock.calls.GpmMetricsGet + mock.lockGpmMetricsGet.RUnlock() + return calls +} + +// GpmMetricsGetV calls GpmMetricsGetVFunc. +func (mock *Interface) GpmMetricsGetV(gpmMetricsGetType *nvml.GpmMetricsGetType) nvml.GpmMetricsGetVType { + if mock.GpmMetricsGetVFunc == nil { + panic("Interface.GpmMetricsGetVFunc: method is nil but Interface.GpmMetricsGetV was just called") + } + callInfo := struct { + GpmMetricsGetType *nvml.GpmMetricsGetType + }{ + GpmMetricsGetType: gpmMetricsGetType, + } + mock.lockGpmMetricsGetV.Lock() + mock.calls.GpmMetricsGetV = append(mock.calls.GpmMetricsGetV, callInfo) + mock.lockGpmMetricsGetV.Unlock() + return mock.GpmMetricsGetVFunc(gpmMetricsGetType) +} + +// GpmMetricsGetVCalls gets all the calls that were made to GpmMetricsGetV. +// Check the length with: +// +// len(mockedInterface.GpmMetricsGetVCalls()) +func (mock *Interface) GpmMetricsGetVCalls() []struct { + GpmMetricsGetType *nvml.GpmMetricsGetType +} { + var calls []struct { + GpmMetricsGetType *nvml.GpmMetricsGetType + } + mock.lockGpmMetricsGetV.RLock() + calls = mock.calls.GpmMetricsGetV + mock.lockGpmMetricsGetV.RUnlock() + return calls +} + +// GpmMigSampleGet calls GpmMigSampleGetFunc. +func (mock *Interface) GpmMigSampleGet(device nvml.Device, n int, gpmSample nvml.GpmSample) nvml.Return { + if mock.GpmMigSampleGetFunc == nil { + panic("Interface.GpmMigSampleGetFunc: method is nil but Interface.GpmMigSampleGet was just called") + } + callInfo := struct { + Device nvml.Device + N int + GpmSample nvml.GpmSample + }{ + Device: device, + N: n, + GpmSample: gpmSample, + } + mock.lockGpmMigSampleGet.Lock() + mock.calls.GpmMigSampleGet = append(mock.calls.GpmMigSampleGet, callInfo) + mock.lockGpmMigSampleGet.Unlock() + return mock.GpmMigSampleGetFunc(device, n, gpmSample) +} + +// GpmMigSampleGetCalls gets all the calls that were made to GpmMigSampleGet. +// Check the length with: +// +// len(mockedInterface.GpmMigSampleGetCalls()) +func (mock *Interface) GpmMigSampleGetCalls() []struct { + Device nvml.Device + N int + GpmSample nvml.GpmSample +} { + var calls []struct { + Device nvml.Device + N int + GpmSample nvml.GpmSample + } + mock.lockGpmMigSampleGet.RLock() + calls = mock.calls.GpmMigSampleGet + mock.lockGpmMigSampleGet.RUnlock() + return calls +} + +// GpmQueryDeviceSupport calls GpmQueryDeviceSupportFunc. +func (mock *Interface) GpmQueryDeviceSupport(device nvml.Device) (nvml.GpmSupport, nvml.Return) { + if mock.GpmQueryDeviceSupportFunc == nil { + panic("Interface.GpmQueryDeviceSupportFunc: method is nil but Interface.GpmQueryDeviceSupport was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockGpmQueryDeviceSupport.Lock() + mock.calls.GpmQueryDeviceSupport = append(mock.calls.GpmQueryDeviceSupport, callInfo) + mock.lockGpmQueryDeviceSupport.Unlock() + return mock.GpmQueryDeviceSupportFunc(device) +} + +// GpmQueryDeviceSupportCalls gets all the calls that were made to GpmQueryDeviceSupport. +// Check the length with: +// +// len(mockedInterface.GpmQueryDeviceSupportCalls()) +func (mock *Interface) GpmQueryDeviceSupportCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockGpmQueryDeviceSupport.RLock() + calls = mock.calls.GpmQueryDeviceSupport + mock.lockGpmQueryDeviceSupport.RUnlock() + return calls +} + +// GpmQueryDeviceSupportV calls GpmQueryDeviceSupportVFunc. +func (mock *Interface) GpmQueryDeviceSupportV(device nvml.Device) nvml.GpmSupportV { + if mock.GpmQueryDeviceSupportVFunc == nil { + panic("Interface.GpmQueryDeviceSupportVFunc: method is nil but Interface.GpmQueryDeviceSupportV was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockGpmQueryDeviceSupportV.Lock() + mock.calls.GpmQueryDeviceSupportV = append(mock.calls.GpmQueryDeviceSupportV, callInfo) + mock.lockGpmQueryDeviceSupportV.Unlock() + return mock.GpmQueryDeviceSupportVFunc(device) +} + +// GpmQueryDeviceSupportVCalls gets all the calls that were made to GpmQueryDeviceSupportV. +// Check the length with: +// +// len(mockedInterface.GpmQueryDeviceSupportVCalls()) +func (mock *Interface) GpmQueryDeviceSupportVCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockGpmQueryDeviceSupportV.RLock() + calls = mock.calls.GpmQueryDeviceSupportV + mock.lockGpmQueryDeviceSupportV.RUnlock() + return calls +} + +// GpmSampleAlloc calls GpmSampleAllocFunc. +func (mock *Interface) GpmSampleAlloc() (nvml.GpmSample, nvml.Return) { + if mock.GpmSampleAllocFunc == nil { + panic("Interface.GpmSampleAllocFunc: method is nil but Interface.GpmSampleAlloc was just called") + } + callInfo := struct { + }{} + mock.lockGpmSampleAlloc.Lock() + mock.calls.GpmSampleAlloc = append(mock.calls.GpmSampleAlloc, callInfo) + mock.lockGpmSampleAlloc.Unlock() + return mock.GpmSampleAllocFunc() +} + +// GpmSampleAllocCalls gets all the calls that were made to GpmSampleAlloc. +// Check the length with: +// +// len(mockedInterface.GpmSampleAllocCalls()) +func (mock *Interface) GpmSampleAllocCalls() []struct { +} { + var calls []struct { + } + mock.lockGpmSampleAlloc.RLock() + calls = mock.calls.GpmSampleAlloc + mock.lockGpmSampleAlloc.RUnlock() + return calls +} + +// GpmSampleFree calls GpmSampleFreeFunc. +func (mock *Interface) GpmSampleFree(gpmSample nvml.GpmSample) nvml.Return { + if mock.GpmSampleFreeFunc == nil { + panic("Interface.GpmSampleFreeFunc: method is nil but Interface.GpmSampleFree was just called") + } + callInfo := struct { + GpmSample nvml.GpmSample + }{ + GpmSample: gpmSample, + } + mock.lockGpmSampleFree.Lock() + mock.calls.GpmSampleFree = append(mock.calls.GpmSampleFree, callInfo) + mock.lockGpmSampleFree.Unlock() + return mock.GpmSampleFreeFunc(gpmSample) +} + +// GpmSampleFreeCalls gets all the calls that were made to GpmSampleFree. +// Check the length with: +// +// len(mockedInterface.GpmSampleFreeCalls()) +func (mock *Interface) GpmSampleFreeCalls() []struct { + GpmSample nvml.GpmSample +} { + var calls []struct { + GpmSample nvml.GpmSample + } + mock.lockGpmSampleFree.RLock() + calls = mock.calls.GpmSampleFree + mock.lockGpmSampleFree.RUnlock() + return calls +} + +// GpmSampleGet calls GpmSampleGetFunc. +func (mock *Interface) GpmSampleGet(device nvml.Device, gpmSample nvml.GpmSample) nvml.Return { + if mock.GpmSampleGetFunc == nil { + panic("Interface.GpmSampleGetFunc: method is nil but Interface.GpmSampleGet was just called") + } + callInfo := struct { + Device nvml.Device + GpmSample nvml.GpmSample + }{ + Device: device, + GpmSample: gpmSample, + } + mock.lockGpmSampleGet.Lock() + mock.calls.GpmSampleGet = append(mock.calls.GpmSampleGet, callInfo) + mock.lockGpmSampleGet.Unlock() + return mock.GpmSampleGetFunc(device, gpmSample) +} + +// GpmSampleGetCalls gets all the calls that were made to GpmSampleGet. +// Check the length with: +// +// len(mockedInterface.GpmSampleGetCalls()) +func (mock *Interface) GpmSampleGetCalls() []struct { + Device nvml.Device + GpmSample nvml.GpmSample +} { + var calls []struct { + Device nvml.Device + GpmSample nvml.GpmSample + } + mock.lockGpmSampleGet.RLock() + calls = mock.calls.GpmSampleGet + mock.lockGpmSampleGet.RUnlock() + return calls +} + +// GpuInstanceCreateComputeInstance calls GpuInstanceCreateComputeInstanceFunc. +func (mock *Interface) GpuInstanceCreateComputeInstance(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (nvml.ComputeInstance, nvml.Return) { + if mock.GpuInstanceCreateComputeInstanceFunc == nil { + panic("Interface.GpuInstanceCreateComputeInstanceFunc: method is nil but Interface.GpuInstanceCreateComputeInstance was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + }{ + GpuInstance: gpuInstance, + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + } + mock.lockGpuInstanceCreateComputeInstance.Lock() + mock.calls.GpuInstanceCreateComputeInstance = append(mock.calls.GpuInstanceCreateComputeInstance, callInfo) + mock.lockGpuInstanceCreateComputeInstance.Unlock() + return mock.GpuInstanceCreateComputeInstanceFunc(gpuInstance, computeInstanceProfileInfo) +} + +// GpuInstanceCreateComputeInstanceCalls gets all the calls that were made to GpuInstanceCreateComputeInstance. +// Check the length with: +// +// len(mockedInterface.GpuInstanceCreateComputeInstanceCalls()) +func (mock *Interface) GpuInstanceCreateComputeInstanceCalls() []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo +} { + var calls []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + mock.lockGpuInstanceCreateComputeInstance.RLock() + calls = mock.calls.GpuInstanceCreateComputeInstance + mock.lockGpuInstanceCreateComputeInstance.RUnlock() + return calls +} + +// GpuInstanceCreateComputeInstanceWithPlacement calls GpuInstanceCreateComputeInstanceWithPlacementFunc. +func (mock *Interface) GpuInstanceCreateComputeInstanceWithPlacement(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo, computeInstancePlacement *nvml.ComputeInstancePlacement) (nvml.ComputeInstance, nvml.Return) { + if mock.GpuInstanceCreateComputeInstanceWithPlacementFunc == nil { + panic("Interface.GpuInstanceCreateComputeInstanceWithPlacementFunc: method is nil but Interface.GpuInstanceCreateComputeInstanceWithPlacement was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + ComputeInstancePlacement *nvml.ComputeInstancePlacement + }{ + GpuInstance: gpuInstance, + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + ComputeInstancePlacement: computeInstancePlacement, + } + mock.lockGpuInstanceCreateComputeInstanceWithPlacement.Lock() + mock.calls.GpuInstanceCreateComputeInstanceWithPlacement = append(mock.calls.GpuInstanceCreateComputeInstanceWithPlacement, callInfo) + mock.lockGpuInstanceCreateComputeInstanceWithPlacement.Unlock() + return mock.GpuInstanceCreateComputeInstanceWithPlacementFunc(gpuInstance, computeInstanceProfileInfo, computeInstancePlacement) +} + +// GpuInstanceCreateComputeInstanceWithPlacementCalls gets all the calls that were made to GpuInstanceCreateComputeInstanceWithPlacement. +// Check the length with: +// +// len(mockedInterface.GpuInstanceCreateComputeInstanceWithPlacementCalls()) +func (mock *Interface) GpuInstanceCreateComputeInstanceWithPlacementCalls() []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + ComputeInstancePlacement *nvml.ComputeInstancePlacement +} { + var calls []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + ComputeInstancePlacement *nvml.ComputeInstancePlacement + } + mock.lockGpuInstanceCreateComputeInstanceWithPlacement.RLock() + calls = mock.calls.GpuInstanceCreateComputeInstanceWithPlacement + mock.lockGpuInstanceCreateComputeInstanceWithPlacement.RUnlock() + return calls +} + +// GpuInstanceDestroy calls GpuInstanceDestroyFunc. +func (mock *Interface) GpuInstanceDestroy(gpuInstance nvml.GpuInstance) nvml.Return { + if mock.GpuInstanceDestroyFunc == nil { + panic("Interface.GpuInstanceDestroyFunc: method is nil but Interface.GpuInstanceDestroy was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + }{ + GpuInstance: gpuInstance, + } + mock.lockGpuInstanceDestroy.Lock() + mock.calls.GpuInstanceDestroy = append(mock.calls.GpuInstanceDestroy, callInfo) + mock.lockGpuInstanceDestroy.Unlock() + return mock.GpuInstanceDestroyFunc(gpuInstance) +} + +// GpuInstanceDestroyCalls gets all the calls that were made to GpuInstanceDestroy. +// Check the length with: +// +// len(mockedInterface.GpuInstanceDestroyCalls()) +func (mock *Interface) GpuInstanceDestroyCalls() []struct { + GpuInstance nvml.GpuInstance +} { + var calls []struct { + GpuInstance nvml.GpuInstance + } + mock.lockGpuInstanceDestroy.RLock() + calls = mock.calls.GpuInstanceDestroy + mock.lockGpuInstanceDestroy.RUnlock() + return calls +} + +// GpuInstanceGetComputeInstanceById calls GpuInstanceGetComputeInstanceByIdFunc. +func (mock *Interface) GpuInstanceGetComputeInstanceById(gpuInstance nvml.GpuInstance, n int) (nvml.ComputeInstance, nvml.Return) { + if mock.GpuInstanceGetComputeInstanceByIdFunc == nil { + panic("Interface.GpuInstanceGetComputeInstanceByIdFunc: method is nil but Interface.GpuInstanceGetComputeInstanceById was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + N int + }{ + GpuInstance: gpuInstance, + N: n, + } + mock.lockGpuInstanceGetComputeInstanceById.Lock() + mock.calls.GpuInstanceGetComputeInstanceById = append(mock.calls.GpuInstanceGetComputeInstanceById, callInfo) + mock.lockGpuInstanceGetComputeInstanceById.Unlock() + return mock.GpuInstanceGetComputeInstanceByIdFunc(gpuInstance, n) +} + +// GpuInstanceGetComputeInstanceByIdCalls gets all the calls that were made to GpuInstanceGetComputeInstanceById. +// Check the length with: +// +// len(mockedInterface.GpuInstanceGetComputeInstanceByIdCalls()) +func (mock *Interface) GpuInstanceGetComputeInstanceByIdCalls() []struct { + GpuInstance nvml.GpuInstance + N int +} { + var calls []struct { + GpuInstance nvml.GpuInstance + N int + } + mock.lockGpuInstanceGetComputeInstanceById.RLock() + calls = mock.calls.GpuInstanceGetComputeInstanceById + mock.lockGpuInstanceGetComputeInstanceById.RUnlock() + return calls +} + +// GpuInstanceGetComputeInstancePossiblePlacements calls GpuInstanceGetComputeInstancePossiblePlacementsFunc. +func (mock *Interface) GpuInstanceGetComputeInstancePossiblePlacements(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstancePlacement, nvml.Return) { + if mock.GpuInstanceGetComputeInstancePossiblePlacementsFunc == nil { + panic("Interface.GpuInstanceGetComputeInstancePossiblePlacementsFunc: method is nil but Interface.GpuInstanceGetComputeInstancePossiblePlacements was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + }{ + GpuInstance: gpuInstance, + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + } + mock.lockGpuInstanceGetComputeInstancePossiblePlacements.Lock() + mock.calls.GpuInstanceGetComputeInstancePossiblePlacements = append(mock.calls.GpuInstanceGetComputeInstancePossiblePlacements, callInfo) + mock.lockGpuInstanceGetComputeInstancePossiblePlacements.Unlock() + return mock.GpuInstanceGetComputeInstancePossiblePlacementsFunc(gpuInstance, computeInstanceProfileInfo) +} + +// GpuInstanceGetComputeInstancePossiblePlacementsCalls gets all the calls that were made to GpuInstanceGetComputeInstancePossiblePlacements. +// Check the length with: +// +// len(mockedInterface.GpuInstanceGetComputeInstancePossiblePlacementsCalls()) +func (mock *Interface) GpuInstanceGetComputeInstancePossiblePlacementsCalls() []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo +} { + var calls []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + mock.lockGpuInstanceGetComputeInstancePossiblePlacements.RLock() + calls = mock.calls.GpuInstanceGetComputeInstancePossiblePlacements + mock.lockGpuInstanceGetComputeInstancePossiblePlacements.RUnlock() + return calls +} + +// GpuInstanceGetComputeInstanceProfileInfo calls GpuInstanceGetComputeInstanceProfileInfoFunc. +func (mock *Interface) GpuInstanceGetComputeInstanceProfileInfo(gpuInstance nvml.GpuInstance, n1 int, n2 int) (nvml.ComputeInstanceProfileInfo, nvml.Return) { + if mock.GpuInstanceGetComputeInstanceProfileInfoFunc == nil { + panic("Interface.GpuInstanceGetComputeInstanceProfileInfoFunc: method is nil but Interface.GpuInstanceGetComputeInstanceProfileInfo was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + N1 int + N2 int + }{ + GpuInstance: gpuInstance, + N1: n1, + N2: n2, + } + mock.lockGpuInstanceGetComputeInstanceProfileInfo.Lock() + mock.calls.GpuInstanceGetComputeInstanceProfileInfo = append(mock.calls.GpuInstanceGetComputeInstanceProfileInfo, callInfo) + mock.lockGpuInstanceGetComputeInstanceProfileInfo.Unlock() + return mock.GpuInstanceGetComputeInstanceProfileInfoFunc(gpuInstance, n1, n2) +} + +// GpuInstanceGetComputeInstanceProfileInfoCalls gets all the calls that were made to GpuInstanceGetComputeInstanceProfileInfo. +// Check the length with: +// +// len(mockedInterface.GpuInstanceGetComputeInstanceProfileInfoCalls()) +func (mock *Interface) GpuInstanceGetComputeInstanceProfileInfoCalls() []struct { + GpuInstance nvml.GpuInstance + N1 int + N2 int +} { + var calls []struct { + GpuInstance nvml.GpuInstance + N1 int + N2 int + } + mock.lockGpuInstanceGetComputeInstanceProfileInfo.RLock() + calls = mock.calls.GpuInstanceGetComputeInstanceProfileInfo + mock.lockGpuInstanceGetComputeInstanceProfileInfo.RUnlock() + return calls +} + +// GpuInstanceGetComputeInstanceProfileInfoV calls GpuInstanceGetComputeInstanceProfileInfoVFunc. +func (mock *Interface) GpuInstanceGetComputeInstanceProfileInfoV(gpuInstance nvml.GpuInstance, n1 int, n2 int) nvml.ComputeInstanceProfileInfoV { + if mock.GpuInstanceGetComputeInstanceProfileInfoVFunc == nil { + panic("Interface.GpuInstanceGetComputeInstanceProfileInfoVFunc: method is nil but Interface.GpuInstanceGetComputeInstanceProfileInfoV was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + N1 int + N2 int + }{ + GpuInstance: gpuInstance, + N1: n1, + N2: n2, + } + mock.lockGpuInstanceGetComputeInstanceProfileInfoV.Lock() + mock.calls.GpuInstanceGetComputeInstanceProfileInfoV = append(mock.calls.GpuInstanceGetComputeInstanceProfileInfoV, callInfo) + mock.lockGpuInstanceGetComputeInstanceProfileInfoV.Unlock() + return mock.GpuInstanceGetComputeInstanceProfileInfoVFunc(gpuInstance, n1, n2) +} + +// GpuInstanceGetComputeInstanceProfileInfoVCalls gets all the calls that were made to GpuInstanceGetComputeInstanceProfileInfoV. +// Check the length with: +// +// len(mockedInterface.GpuInstanceGetComputeInstanceProfileInfoVCalls()) +func (mock *Interface) GpuInstanceGetComputeInstanceProfileInfoVCalls() []struct { + GpuInstance nvml.GpuInstance + N1 int + N2 int +} { + var calls []struct { + GpuInstance nvml.GpuInstance + N1 int + N2 int + } + mock.lockGpuInstanceGetComputeInstanceProfileInfoV.RLock() + calls = mock.calls.GpuInstanceGetComputeInstanceProfileInfoV + mock.lockGpuInstanceGetComputeInstanceProfileInfoV.RUnlock() + return calls +} + +// GpuInstanceGetComputeInstanceRemainingCapacity calls GpuInstanceGetComputeInstanceRemainingCapacityFunc. +func (mock *Interface) GpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) (int, nvml.Return) { + if mock.GpuInstanceGetComputeInstanceRemainingCapacityFunc == nil { + panic("Interface.GpuInstanceGetComputeInstanceRemainingCapacityFunc: method is nil but Interface.GpuInstanceGetComputeInstanceRemainingCapacity was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + }{ + GpuInstance: gpuInstance, + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + } + mock.lockGpuInstanceGetComputeInstanceRemainingCapacity.Lock() + mock.calls.GpuInstanceGetComputeInstanceRemainingCapacity = append(mock.calls.GpuInstanceGetComputeInstanceRemainingCapacity, callInfo) + mock.lockGpuInstanceGetComputeInstanceRemainingCapacity.Unlock() + return mock.GpuInstanceGetComputeInstanceRemainingCapacityFunc(gpuInstance, computeInstanceProfileInfo) +} + +// GpuInstanceGetComputeInstanceRemainingCapacityCalls gets all the calls that were made to GpuInstanceGetComputeInstanceRemainingCapacity. +// Check the length with: +// +// len(mockedInterface.GpuInstanceGetComputeInstanceRemainingCapacityCalls()) +func (mock *Interface) GpuInstanceGetComputeInstanceRemainingCapacityCalls() []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo +} { + var calls []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + mock.lockGpuInstanceGetComputeInstanceRemainingCapacity.RLock() + calls = mock.calls.GpuInstanceGetComputeInstanceRemainingCapacity + mock.lockGpuInstanceGetComputeInstanceRemainingCapacity.RUnlock() + return calls +} + +// GpuInstanceGetComputeInstances calls GpuInstanceGetComputeInstancesFunc. +func (mock *Interface) GpuInstanceGetComputeInstances(gpuInstance nvml.GpuInstance, computeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstance, nvml.Return) { + if mock.GpuInstanceGetComputeInstancesFunc == nil { + panic("Interface.GpuInstanceGetComputeInstancesFunc: method is nil but Interface.GpuInstanceGetComputeInstances was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + }{ + GpuInstance: gpuInstance, + ComputeInstanceProfileInfo: computeInstanceProfileInfo, + } + mock.lockGpuInstanceGetComputeInstances.Lock() + mock.calls.GpuInstanceGetComputeInstances = append(mock.calls.GpuInstanceGetComputeInstances, callInfo) + mock.lockGpuInstanceGetComputeInstances.Unlock() + return mock.GpuInstanceGetComputeInstancesFunc(gpuInstance, computeInstanceProfileInfo) +} + +// GpuInstanceGetComputeInstancesCalls gets all the calls that were made to GpuInstanceGetComputeInstances. +// Check the length with: +// +// len(mockedInterface.GpuInstanceGetComputeInstancesCalls()) +func (mock *Interface) GpuInstanceGetComputeInstancesCalls() []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo +} { + var calls []struct { + GpuInstance nvml.GpuInstance + ComputeInstanceProfileInfo *nvml.ComputeInstanceProfileInfo + } + mock.lockGpuInstanceGetComputeInstances.RLock() + calls = mock.calls.GpuInstanceGetComputeInstances + mock.lockGpuInstanceGetComputeInstances.RUnlock() + return calls +} + +// GpuInstanceGetInfo calls GpuInstanceGetInfoFunc. +func (mock *Interface) GpuInstanceGetInfo(gpuInstance nvml.GpuInstance) (nvml.GpuInstanceInfo, nvml.Return) { + if mock.GpuInstanceGetInfoFunc == nil { + panic("Interface.GpuInstanceGetInfoFunc: method is nil but Interface.GpuInstanceGetInfo was just called") + } + callInfo := struct { + GpuInstance nvml.GpuInstance + }{ + GpuInstance: gpuInstance, + } + mock.lockGpuInstanceGetInfo.Lock() + mock.calls.GpuInstanceGetInfo = append(mock.calls.GpuInstanceGetInfo, callInfo) + mock.lockGpuInstanceGetInfo.Unlock() + return mock.GpuInstanceGetInfoFunc(gpuInstance) +} + +// GpuInstanceGetInfoCalls gets all the calls that were made to GpuInstanceGetInfo. +// Check the length with: +// +// len(mockedInterface.GpuInstanceGetInfoCalls()) +func (mock *Interface) GpuInstanceGetInfoCalls() []struct { + GpuInstance nvml.GpuInstance +} { + var calls []struct { + GpuInstance nvml.GpuInstance + } + mock.lockGpuInstanceGetInfo.RLock() + calls = mock.calls.GpuInstanceGetInfo + mock.lockGpuInstanceGetInfo.RUnlock() + return calls +} + +// Init calls InitFunc. +func (mock *Interface) Init() nvml.Return { + if mock.InitFunc == nil { + panic("Interface.InitFunc: method is nil but Interface.Init was just called") + } + callInfo := struct { + }{} + mock.lockInit.Lock() + mock.calls.Init = append(mock.calls.Init, callInfo) + mock.lockInit.Unlock() + return mock.InitFunc() +} + +// InitCalls gets all the calls that were made to Init. +// Check the length with: +// +// len(mockedInterface.InitCalls()) +func (mock *Interface) InitCalls() []struct { +} { + var calls []struct { + } + mock.lockInit.RLock() + calls = mock.calls.Init + mock.lockInit.RUnlock() + return calls +} + +// InitWithFlags calls InitWithFlagsFunc. +func (mock *Interface) InitWithFlags(v uint32) nvml.Return { + if mock.InitWithFlagsFunc == nil { + panic("Interface.InitWithFlagsFunc: method is nil but Interface.InitWithFlags was just called") + } + callInfo := struct { + V uint32 + }{ + V: v, + } + mock.lockInitWithFlags.Lock() + mock.calls.InitWithFlags = append(mock.calls.InitWithFlags, callInfo) + mock.lockInitWithFlags.Unlock() + return mock.InitWithFlagsFunc(v) +} + +// InitWithFlagsCalls gets all the calls that were made to InitWithFlags. +// Check the length with: +// +// len(mockedInterface.InitWithFlagsCalls()) +func (mock *Interface) InitWithFlagsCalls() []struct { + V uint32 +} { + var calls []struct { + V uint32 + } + mock.lockInitWithFlags.RLock() + calls = mock.calls.InitWithFlags + mock.lockInitWithFlags.RUnlock() + return calls +} + +// SetVgpuVersion calls SetVgpuVersionFunc. +func (mock *Interface) SetVgpuVersion(vgpuVersion *nvml.VgpuVersion) nvml.Return { + if mock.SetVgpuVersionFunc == nil { + panic("Interface.SetVgpuVersionFunc: method is nil but Interface.SetVgpuVersion was just called") + } + callInfo := struct { + VgpuVersion *nvml.VgpuVersion + }{ + VgpuVersion: vgpuVersion, + } + mock.lockSetVgpuVersion.Lock() + mock.calls.SetVgpuVersion = append(mock.calls.SetVgpuVersion, callInfo) + mock.lockSetVgpuVersion.Unlock() + return mock.SetVgpuVersionFunc(vgpuVersion) +} + +// SetVgpuVersionCalls gets all the calls that were made to SetVgpuVersion. +// Check the length with: +// +// len(mockedInterface.SetVgpuVersionCalls()) +func (mock *Interface) SetVgpuVersionCalls() []struct { + VgpuVersion *nvml.VgpuVersion +} { + var calls []struct { + VgpuVersion *nvml.VgpuVersion + } + mock.lockSetVgpuVersion.RLock() + calls = mock.calls.SetVgpuVersion + mock.lockSetVgpuVersion.RUnlock() + return calls +} + +// Shutdown calls ShutdownFunc. +func (mock *Interface) Shutdown() nvml.Return { + if mock.ShutdownFunc == nil { + panic("Interface.ShutdownFunc: method is nil but Interface.Shutdown was just called") + } + callInfo := struct { + }{} + mock.lockShutdown.Lock() + mock.calls.Shutdown = append(mock.calls.Shutdown, callInfo) + mock.lockShutdown.Unlock() + return mock.ShutdownFunc() +} + +// ShutdownCalls gets all the calls that were made to Shutdown. +// Check the length with: +// +// len(mockedInterface.ShutdownCalls()) +func (mock *Interface) ShutdownCalls() []struct { +} { + var calls []struct { + } + mock.lockShutdown.RLock() + calls = mock.calls.Shutdown + mock.lockShutdown.RUnlock() + return calls +} + +// SystemGetCudaDriverVersion calls SystemGetCudaDriverVersionFunc. +func (mock *Interface) SystemGetCudaDriverVersion() (int, nvml.Return) { + if mock.SystemGetCudaDriverVersionFunc == nil { + panic("Interface.SystemGetCudaDriverVersionFunc: method is nil but Interface.SystemGetCudaDriverVersion was just called") + } + callInfo := struct { + }{} + mock.lockSystemGetCudaDriverVersion.Lock() + mock.calls.SystemGetCudaDriverVersion = append(mock.calls.SystemGetCudaDriverVersion, callInfo) + mock.lockSystemGetCudaDriverVersion.Unlock() + return mock.SystemGetCudaDriverVersionFunc() +} + +// SystemGetCudaDriverVersionCalls gets all the calls that were made to SystemGetCudaDriverVersion. +// Check the length with: +// +// len(mockedInterface.SystemGetCudaDriverVersionCalls()) +func (mock *Interface) SystemGetCudaDriverVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockSystemGetCudaDriverVersion.RLock() + calls = mock.calls.SystemGetCudaDriverVersion + mock.lockSystemGetCudaDriverVersion.RUnlock() + return calls +} + +// SystemGetCudaDriverVersion_v2 calls SystemGetCudaDriverVersion_v2Func. +func (mock *Interface) SystemGetCudaDriverVersion_v2() (int, nvml.Return) { + if mock.SystemGetCudaDriverVersion_v2Func == nil { + panic("Interface.SystemGetCudaDriverVersion_v2Func: method is nil but Interface.SystemGetCudaDriverVersion_v2 was just called") + } + callInfo := struct { + }{} + mock.lockSystemGetCudaDriverVersion_v2.Lock() + mock.calls.SystemGetCudaDriverVersion_v2 = append(mock.calls.SystemGetCudaDriverVersion_v2, callInfo) + mock.lockSystemGetCudaDriverVersion_v2.Unlock() + return mock.SystemGetCudaDriverVersion_v2Func() +} + +// SystemGetCudaDriverVersion_v2Calls gets all the calls that were made to SystemGetCudaDriverVersion_v2. +// Check the length with: +// +// len(mockedInterface.SystemGetCudaDriverVersion_v2Calls()) +func (mock *Interface) SystemGetCudaDriverVersion_v2Calls() []struct { +} { + var calls []struct { + } + mock.lockSystemGetCudaDriverVersion_v2.RLock() + calls = mock.calls.SystemGetCudaDriverVersion_v2 + mock.lockSystemGetCudaDriverVersion_v2.RUnlock() + return calls +} + +// SystemGetDriverVersion calls SystemGetDriverVersionFunc. +func (mock *Interface) SystemGetDriverVersion() (string, nvml.Return) { + if mock.SystemGetDriverVersionFunc == nil { + panic("Interface.SystemGetDriverVersionFunc: method is nil but Interface.SystemGetDriverVersion was just called") + } + callInfo := struct { + }{} + mock.lockSystemGetDriverVersion.Lock() + mock.calls.SystemGetDriverVersion = append(mock.calls.SystemGetDriverVersion, callInfo) + mock.lockSystemGetDriverVersion.Unlock() + return mock.SystemGetDriverVersionFunc() +} + +// SystemGetDriverVersionCalls gets all the calls that were made to SystemGetDriverVersion. +// Check the length with: +// +// len(mockedInterface.SystemGetDriverVersionCalls()) +func (mock *Interface) SystemGetDriverVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockSystemGetDriverVersion.RLock() + calls = mock.calls.SystemGetDriverVersion + mock.lockSystemGetDriverVersion.RUnlock() + return calls +} + +// SystemGetHicVersion calls SystemGetHicVersionFunc. +func (mock *Interface) SystemGetHicVersion() ([]nvml.HwbcEntry, nvml.Return) { + if mock.SystemGetHicVersionFunc == nil { + panic("Interface.SystemGetHicVersionFunc: method is nil but Interface.SystemGetHicVersion was just called") + } + callInfo := struct { + }{} + mock.lockSystemGetHicVersion.Lock() + mock.calls.SystemGetHicVersion = append(mock.calls.SystemGetHicVersion, callInfo) + mock.lockSystemGetHicVersion.Unlock() + return mock.SystemGetHicVersionFunc() +} + +// SystemGetHicVersionCalls gets all the calls that were made to SystemGetHicVersion. +// Check the length with: +// +// len(mockedInterface.SystemGetHicVersionCalls()) +func (mock *Interface) SystemGetHicVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockSystemGetHicVersion.RLock() + calls = mock.calls.SystemGetHicVersion + mock.lockSystemGetHicVersion.RUnlock() + return calls +} + +// SystemGetNVMLVersion calls SystemGetNVMLVersionFunc. +func (mock *Interface) SystemGetNVMLVersion() (string, nvml.Return) { + if mock.SystemGetNVMLVersionFunc == nil { + panic("Interface.SystemGetNVMLVersionFunc: method is nil but Interface.SystemGetNVMLVersion was just called") + } + callInfo := struct { + }{} + mock.lockSystemGetNVMLVersion.Lock() + mock.calls.SystemGetNVMLVersion = append(mock.calls.SystemGetNVMLVersion, callInfo) + mock.lockSystemGetNVMLVersion.Unlock() + return mock.SystemGetNVMLVersionFunc() +} + +// SystemGetNVMLVersionCalls gets all the calls that were made to SystemGetNVMLVersion. +// Check the length with: +// +// len(mockedInterface.SystemGetNVMLVersionCalls()) +func (mock *Interface) SystemGetNVMLVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockSystemGetNVMLVersion.RLock() + calls = mock.calls.SystemGetNVMLVersion + mock.lockSystemGetNVMLVersion.RUnlock() + return calls +} + +// SystemGetProcessName calls SystemGetProcessNameFunc. +func (mock *Interface) SystemGetProcessName(n int) (string, nvml.Return) { + if mock.SystemGetProcessNameFunc == nil { + panic("Interface.SystemGetProcessNameFunc: method is nil but Interface.SystemGetProcessName was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockSystemGetProcessName.Lock() + mock.calls.SystemGetProcessName = append(mock.calls.SystemGetProcessName, callInfo) + mock.lockSystemGetProcessName.Unlock() + return mock.SystemGetProcessNameFunc(n) +} + +// SystemGetProcessNameCalls gets all the calls that were made to SystemGetProcessName. +// Check the length with: +// +// len(mockedInterface.SystemGetProcessNameCalls()) +func (mock *Interface) SystemGetProcessNameCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockSystemGetProcessName.RLock() + calls = mock.calls.SystemGetProcessName + mock.lockSystemGetProcessName.RUnlock() + return calls +} + +// SystemGetTopologyGpuSet calls SystemGetTopologyGpuSetFunc. +func (mock *Interface) SystemGetTopologyGpuSet(n int) ([]nvml.Device, nvml.Return) { + if mock.SystemGetTopologyGpuSetFunc == nil { + panic("Interface.SystemGetTopologyGpuSetFunc: method is nil but Interface.SystemGetTopologyGpuSet was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockSystemGetTopologyGpuSet.Lock() + mock.calls.SystemGetTopologyGpuSet = append(mock.calls.SystemGetTopologyGpuSet, callInfo) + mock.lockSystemGetTopologyGpuSet.Unlock() + return mock.SystemGetTopologyGpuSetFunc(n) +} + +// SystemGetTopologyGpuSetCalls gets all the calls that were made to SystemGetTopologyGpuSet. +// Check the length with: +// +// len(mockedInterface.SystemGetTopologyGpuSetCalls()) +func (mock *Interface) SystemGetTopologyGpuSetCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockSystemGetTopologyGpuSet.RLock() + calls = mock.calls.SystemGetTopologyGpuSet + mock.lockSystemGetTopologyGpuSet.RUnlock() + return calls +} + +// UnitGetCount calls UnitGetCountFunc. +func (mock *Interface) UnitGetCount() (int, nvml.Return) { + if mock.UnitGetCountFunc == nil { + panic("Interface.UnitGetCountFunc: method is nil but Interface.UnitGetCount was just called") + } + callInfo := struct { + }{} + mock.lockUnitGetCount.Lock() + mock.calls.UnitGetCount = append(mock.calls.UnitGetCount, callInfo) + mock.lockUnitGetCount.Unlock() + return mock.UnitGetCountFunc() +} + +// UnitGetCountCalls gets all the calls that were made to UnitGetCount. +// Check the length with: +// +// len(mockedInterface.UnitGetCountCalls()) +func (mock *Interface) UnitGetCountCalls() []struct { +} { + var calls []struct { + } + mock.lockUnitGetCount.RLock() + calls = mock.calls.UnitGetCount + mock.lockUnitGetCount.RUnlock() + return calls +} + +// UnitGetDevices calls UnitGetDevicesFunc. +func (mock *Interface) UnitGetDevices(unit nvml.Unit) ([]nvml.Device, nvml.Return) { + if mock.UnitGetDevicesFunc == nil { + panic("Interface.UnitGetDevicesFunc: method is nil but Interface.UnitGetDevices was just called") + } + callInfo := struct { + Unit nvml.Unit + }{ + Unit: unit, + } + mock.lockUnitGetDevices.Lock() + mock.calls.UnitGetDevices = append(mock.calls.UnitGetDevices, callInfo) + mock.lockUnitGetDevices.Unlock() + return mock.UnitGetDevicesFunc(unit) +} + +// UnitGetDevicesCalls gets all the calls that were made to UnitGetDevices. +// Check the length with: +// +// len(mockedInterface.UnitGetDevicesCalls()) +func (mock *Interface) UnitGetDevicesCalls() []struct { + Unit nvml.Unit +} { + var calls []struct { + Unit nvml.Unit + } + mock.lockUnitGetDevices.RLock() + calls = mock.calls.UnitGetDevices + mock.lockUnitGetDevices.RUnlock() + return calls +} + +// UnitGetFanSpeedInfo calls UnitGetFanSpeedInfoFunc. +func (mock *Interface) UnitGetFanSpeedInfo(unit nvml.Unit) (nvml.UnitFanSpeeds, nvml.Return) { + if mock.UnitGetFanSpeedInfoFunc == nil { + panic("Interface.UnitGetFanSpeedInfoFunc: method is nil but Interface.UnitGetFanSpeedInfo was just called") + } + callInfo := struct { + Unit nvml.Unit + }{ + Unit: unit, + } + mock.lockUnitGetFanSpeedInfo.Lock() + mock.calls.UnitGetFanSpeedInfo = append(mock.calls.UnitGetFanSpeedInfo, callInfo) + mock.lockUnitGetFanSpeedInfo.Unlock() + return mock.UnitGetFanSpeedInfoFunc(unit) +} + +// UnitGetFanSpeedInfoCalls gets all the calls that were made to UnitGetFanSpeedInfo. +// Check the length with: +// +// len(mockedInterface.UnitGetFanSpeedInfoCalls()) +func (mock *Interface) UnitGetFanSpeedInfoCalls() []struct { + Unit nvml.Unit +} { + var calls []struct { + Unit nvml.Unit + } + mock.lockUnitGetFanSpeedInfo.RLock() + calls = mock.calls.UnitGetFanSpeedInfo + mock.lockUnitGetFanSpeedInfo.RUnlock() + return calls +} + +// UnitGetHandleByIndex calls UnitGetHandleByIndexFunc. +func (mock *Interface) UnitGetHandleByIndex(n int) (nvml.Unit, nvml.Return) { + if mock.UnitGetHandleByIndexFunc == nil { + panic("Interface.UnitGetHandleByIndexFunc: method is nil but Interface.UnitGetHandleByIndex was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockUnitGetHandleByIndex.Lock() + mock.calls.UnitGetHandleByIndex = append(mock.calls.UnitGetHandleByIndex, callInfo) + mock.lockUnitGetHandleByIndex.Unlock() + return mock.UnitGetHandleByIndexFunc(n) +} + +// UnitGetHandleByIndexCalls gets all the calls that were made to UnitGetHandleByIndex. +// Check the length with: +// +// len(mockedInterface.UnitGetHandleByIndexCalls()) +func (mock *Interface) UnitGetHandleByIndexCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockUnitGetHandleByIndex.RLock() + calls = mock.calls.UnitGetHandleByIndex + mock.lockUnitGetHandleByIndex.RUnlock() + return calls +} + +// UnitGetLedState calls UnitGetLedStateFunc. +func (mock *Interface) UnitGetLedState(unit nvml.Unit) (nvml.LedState, nvml.Return) { + if mock.UnitGetLedStateFunc == nil { + panic("Interface.UnitGetLedStateFunc: method is nil but Interface.UnitGetLedState was just called") + } + callInfo := struct { + Unit nvml.Unit + }{ + Unit: unit, + } + mock.lockUnitGetLedState.Lock() + mock.calls.UnitGetLedState = append(mock.calls.UnitGetLedState, callInfo) + mock.lockUnitGetLedState.Unlock() + return mock.UnitGetLedStateFunc(unit) +} + +// UnitGetLedStateCalls gets all the calls that were made to UnitGetLedState. +// Check the length with: +// +// len(mockedInterface.UnitGetLedStateCalls()) +func (mock *Interface) UnitGetLedStateCalls() []struct { + Unit nvml.Unit +} { + var calls []struct { + Unit nvml.Unit + } + mock.lockUnitGetLedState.RLock() + calls = mock.calls.UnitGetLedState + mock.lockUnitGetLedState.RUnlock() + return calls +} + +// UnitGetPsuInfo calls UnitGetPsuInfoFunc. +func (mock *Interface) UnitGetPsuInfo(unit nvml.Unit) (nvml.PSUInfo, nvml.Return) { + if mock.UnitGetPsuInfoFunc == nil { + panic("Interface.UnitGetPsuInfoFunc: method is nil but Interface.UnitGetPsuInfo was just called") + } + callInfo := struct { + Unit nvml.Unit + }{ + Unit: unit, + } + mock.lockUnitGetPsuInfo.Lock() + mock.calls.UnitGetPsuInfo = append(mock.calls.UnitGetPsuInfo, callInfo) + mock.lockUnitGetPsuInfo.Unlock() + return mock.UnitGetPsuInfoFunc(unit) +} + +// UnitGetPsuInfoCalls gets all the calls that were made to UnitGetPsuInfo. +// Check the length with: +// +// len(mockedInterface.UnitGetPsuInfoCalls()) +func (mock *Interface) UnitGetPsuInfoCalls() []struct { + Unit nvml.Unit +} { + var calls []struct { + Unit nvml.Unit + } + mock.lockUnitGetPsuInfo.RLock() + calls = mock.calls.UnitGetPsuInfo + mock.lockUnitGetPsuInfo.RUnlock() + return calls +} + +// UnitGetTemperature calls UnitGetTemperatureFunc. +func (mock *Interface) UnitGetTemperature(unit nvml.Unit, n int) (uint32, nvml.Return) { + if mock.UnitGetTemperatureFunc == nil { + panic("Interface.UnitGetTemperatureFunc: method is nil but Interface.UnitGetTemperature was just called") + } + callInfo := struct { + Unit nvml.Unit + N int + }{ + Unit: unit, + N: n, + } + mock.lockUnitGetTemperature.Lock() + mock.calls.UnitGetTemperature = append(mock.calls.UnitGetTemperature, callInfo) + mock.lockUnitGetTemperature.Unlock() + return mock.UnitGetTemperatureFunc(unit, n) +} + +// UnitGetTemperatureCalls gets all the calls that were made to UnitGetTemperature. +// Check the length with: +// +// len(mockedInterface.UnitGetTemperatureCalls()) +func (mock *Interface) UnitGetTemperatureCalls() []struct { + Unit nvml.Unit + N int +} { + var calls []struct { + Unit nvml.Unit + N int + } + mock.lockUnitGetTemperature.RLock() + calls = mock.calls.UnitGetTemperature + mock.lockUnitGetTemperature.RUnlock() + return calls +} + +// UnitGetUnitInfo calls UnitGetUnitInfoFunc. +func (mock *Interface) UnitGetUnitInfo(unit nvml.Unit) (nvml.UnitInfo, nvml.Return) { + if mock.UnitGetUnitInfoFunc == nil { + panic("Interface.UnitGetUnitInfoFunc: method is nil but Interface.UnitGetUnitInfo was just called") + } + callInfo := struct { + Unit nvml.Unit + }{ + Unit: unit, + } + mock.lockUnitGetUnitInfo.Lock() + mock.calls.UnitGetUnitInfo = append(mock.calls.UnitGetUnitInfo, callInfo) + mock.lockUnitGetUnitInfo.Unlock() + return mock.UnitGetUnitInfoFunc(unit) +} + +// UnitGetUnitInfoCalls gets all the calls that were made to UnitGetUnitInfo. +// Check the length with: +// +// len(mockedInterface.UnitGetUnitInfoCalls()) +func (mock *Interface) UnitGetUnitInfoCalls() []struct { + Unit nvml.Unit +} { + var calls []struct { + Unit nvml.Unit + } + mock.lockUnitGetUnitInfo.RLock() + calls = mock.calls.UnitGetUnitInfo + mock.lockUnitGetUnitInfo.RUnlock() + return calls +} + +// UnitSetLedState calls UnitSetLedStateFunc. +func (mock *Interface) UnitSetLedState(unit nvml.Unit, ledColor nvml.LedColor) nvml.Return { + if mock.UnitSetLedStateFunc == nil { + panic("Interface.UnitSetLedStateFunc: method is nil but Interface.UnitSetLedState was just called") + } + callInfo := struct { + Unit nvml.Unit + LedColor nvml.LedColor + }{ + Unit: unit, + LedColor: ledColor, + } + mock.lockUnitSetLedState.Lock() + mock.calls.UnitSetLedState = append(mock.calls.UnitSetLedState, callInfo) + mock.lockUnitSetLedState.Unlock() + return mock.UnitSetLedStateFunc(unit, ledColor) +} + +// UnitSetLedStateCalls gets all the calls that were made to UnitSetLedState. +// Check the length with: +// +// len(mockedInterface.UnitSetLedStateCalls()) +func (mock *Interface) UnitSetLedStateCalls() []struct { + Unit nvml.Unit + LedColor nvml.LedColor +} { + var calls []struct { + Unit nvml.Unit + LedColor nvml.LedColor + } + mock.lockUnitSetLedState.RLock() + calls = mock.calls.UnitSetLedState + mock.lockUnitSetLedState.RUnlock() + return calls +} + +// VgpuInstanceClearAccountingPids calls VgpuInstanceClearAccountingPidsFunc. +func (mock *Interface) VgpuInstanceClearAccountingPids(vgpuInstance nvml.VgpuInstance) nvml.Return { + if mock.VgpuInstanceClearAccountingPidsFunc == nil { + panic("Interface.VgpuInstanceClearAccountingPidsFunc: method is nil but Interface.VgpuInstanceClearAccountingPids was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceClearAccountingPids.Lock() + mock.calls.VgpuInstanceClearAccountingPids = append(mock.calls.VgpuInstanceClearAccountingPids, callInfo) + mock.lockVgpuInstanceClearAccountingPids.Unlock() + return mock.VgpuInstanceClearAccountingPidsFunc(vgpuInstance) +} + +// VgpuInstanceClearAccountingPidsCalls gets all the calls that were made to VgpuInstanceClearAccountingPids. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceClearAccountingPidsCalls()) +func (mock *Interface) VgpuInstanceClearAccountingPidsCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceClearAccountingPids.RLock() + calls = mock.calls.VgpuInstanceClearAccountingPids + mock.lockVgpuInstanceClearAccountingPids.RUnlock() + return calls +} + +// VgpuInstanceGetAccountingMode calls VgpuInstanceGetAccountingModeFunc. +func (mock *Interface) VgpuInstanceGetAccountingMode(vgpuInstance nvml.VgpuInstance) (nvml.EnableState, nvml.Return) { + if mock.VgpuInstanceGetAccountingModeFunc == nil { + panic("Interface.VgpuInstanceGetAccountingModeFunc: method is nil but Interface.VgpuInstanceGetAccountingMode was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetAccountingMode.Lock() + mock.calls.VgpuInstanceGetAccountingMode = append(mock.calls.VgpuInstanceGetAccountingMode, callInfo) + mock.lockVgpuInstanceGetAccountingMode.Unlock() + return mock.VgpuInstanceGetAccountingModeFunc(vgpuInstance) +} + +// VgpuInstanceGetAccountingModeCalls gets all the calls that were made to VgpuInstanceGetAccountingMode. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetAccountingModeCalls()) +func (mock *Interface) VgpuInstanceGetAccountingModeCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetAccountingMode.RLock() + calls = mock.calls.VgpuInstanceGetAccountingMode + mock.lockVgpuInstanceGetAccountingMode.RUnlock() + return calls +} + +// VgpuInstanceGetAccountingPids calls VgpuInstanceGetAccountingPidsFunc. +func (mock *Interface) VgpuInstanceGetAccountingPids(vgpuInstance nvml.VgpuInstance) ([]int, nvml.Return) { + if mock.VgpuInstanceGetAccountingPidsFunc == nil { + panic("Interface.VgpuInstanceGetAccountingPidsFunc: method is nil but Interface.VgpuInstanceGetAccountingPids was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetAccountingPids.Lock() + mock.calls.VgpuInstanceGetAccountingPids = append(mock.calls.VgpuInstanceGetAccountingPids, callInfo) + mock.lockVgpuInstanceGetAccountingPids.Unlock() + return mock.VgpuInstanceGetAccountingPidsFunc(vgpuInstance) +} + +// VgpuInstanceGetAccountingPidsCalls gets all the calls that were made to VgpuInstanceGetAccountingPids. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetAccountingPidsCalls()) +func (mock *Interface) VgpuInstanceGetAccountingPidsCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetAccountingPids.RLock() + calls = mock.calls.VgpuInstanceGetAccountingPids + mock.lockVgpuInstanceGetAccountingPids.RUnlock() + return calls +} + +// VgpuInstanceGetAccountingStats calls VgpuInstanceGetAccountingStatsFunc. +func (mock *Interface) VgpuInstanceGetAccountingStats(vgpuInstance nvml.VgpuInstance, n int) (nvml.AccountingStats, nvml.Return) { + if mock.VgpuInstanceGetAccountingStatsFunc == nil { + panic("Interface.VgpuInstanceGetAccountingStatsFunc: method is nil but Interface.VgpuInstanceGetAccountingStats was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + N int + }{ + VgpuInstance: vgpuInstance, + N: n, + } + mock.lockVgpuInstanceGetAccountingStats.Lock() + mock.calls.VgpuInstanceGetAccountingStats = append(mock.calls.VgpuInstanceGetAccountingStats, callInfo) + mock.lockVgpuInstanceGetAccountingStats.Unlock() + return mock.VgpuInstanceGetAccountingStatsFunc(vgpuInstance, n) +} + +// VgpuInstanceGetAccountingStatsCalls gets all the calls that were made to VgpuInstanceGetAccountingStats. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetAccountingStatsCalls()) +func (mock *Interface) VgpuInstanceGetAccountingStatsCalls() []struct { + VgpuInstance nvml.VgpuInstance + N int +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + N int + } + mock.lockVgpuInstanceGetAccountingStats.RLock() + calls = mock.calls.VgpuInstanceGetAccountingStats + mock.lockVgpuInstanceGetAccountingStats.RUnlock() + return calls +} + +// VgpuInstanceGetEccMode calls VgpuInstanceGetEccModeFunc. +func (mock *Interface) VgpuInstanceGetEccMode(vgpuInstance nvml.VgpuInstance) (nvml.EnableState, nvml.Return) { + if mock.VgpuInstanceGetEccModeFunc == nil { + panic("Interface.VgpuInstanceGetEccModeFunc: method is nil but Interface.VgpuInstanceGetEccMode was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetEccMode.Lock() + mock.calls.VgpuInstanceGetEccMode = append(mock.calls.VgpuInstanceGetEccMode, callInfo) + mock.lockVgpuInstanceGetEccMode.Unlock() + return mock.VgpuInstanceGetEccModeFunc(vgpuInstance) +} + +// VgpuInstanceGetEccModeCalls gets all the calls that were made to VgpuInstanceGetEccMode. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetEccModeCalls()) +func (mock *Interface) VgpuInstanceGetEccModeCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetEccMode.RLock() + calls = mock.calls.VgpuInstanceGetEccMode + mock.lockVgpuInstanceGetEccMode.RUnlock() + return calls +} + +// VgpuInstanceGetEncoderCapacity calls VgpuInstanceGetEncoderCapacityFunc. +func (mock *Interface) VgpuInstanceGetEncoderCapacity(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) { + if mock.VgpuInstanceGetEncoderCapacityFunc == nil { + panic("Interface.VgpuInstanceGetEncoderCapacityFunc: method is nil but Interface.VgpuInstanceGetEncoderCapacity was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetEncoderCapacity.Lock() + mock.calls.VgpuInstanceGetEncoderCapacity = append(mock.calls.VgpuInstanceGetEncoderCapacity, callInfo) + mock.lockVgpuInstanceGetEncoderCapacity.Unlock() + return mock.VgpuInstanceGetEncoderCapacityFunc(vgpuInstance) +} + +// VgpuInstanceGetEncoderCapacityCalls gets all the calls that were made to VgpuInstanceGetEncoderCapacity. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetEncoderCapacityCalls()) +func (mock *Interface) VgpuInstanceGetEncoderCapacityCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetEncoderCapacity.RLock() + calls = mock.calls.VgpuInstanceGetEncoderCapacity + mock.lockVgpuInstanceGetEncoderCapacity.RUnlock() + return calls +} + +// VgpuInstanceGetEncoderSessions calls VgpuInstanceGetEncoderSessionsFunc. +func (mock *Interface) VgpuInstanceGetEncoderSessions(vgpuInstance nvml.VgpuInstance) (int, nvml.EncoderSessionInfo, nvml.Return) { + if mock.VgpuInstanceGetEncoderSessionsFunc == nil { + panic("Interface.VgpuInstanceGetEncoderSessionsFunc: method is nil but Interface.VgpuInstanceGetEncoderSessions was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetEncoderSessions.Lock() + mock.calls.VgpuInstanceGetEncoderSessions = append(mock.calls.VgpuInstanceGetEncoderSessions, callInfo) + mock.lockVgpuInstanceGetEncoderSessions.Unlock() + return mock.VgpuInstanceGetEncoderSessionsFunc(vgpuInstance) +} + +// VgpuInstanceGetEncoderSessionsCalls gets all the calls that were made to VgpuInstanceGetEncoderSessions. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetEncoderSessionsCalls()) +func (mock *Interface) VgpuInstanceGetEncoderSessionsCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetEncoderSessions.RLock() + calls = mock.calls.VgpuInstanceGetEncoderSessions + mock.lockVgpuInstanceGetEncoderSessions.RUnlock() + return calls +} + +// VgpuInstanceGetEncoderStats calls VgpuInstanceGetEncoderStatsFunc. +func (mock *Interface) VgpuInstanceGetEncoderStats(vgpuInstance nvml.VgpuInstance) (int, uint32, uint32, nvml.Return) { + if mock.VgpuInstanceGetEncoderStatsFunc == nil { + panic("Interface.VgpuInstanceGetEncoderStatsFunc: method is nil but Interface.VgpuInstanceGetEncoderStats was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetEncoderStats.Lock() + mock.calls.VgpuInstanceGetEncoderStats = append(mock.calls.VgpuInstanceGetEncoderStats, callInfo) + mock.lockVgpuInstanceGetEncoderStats.Unlock() + return mock.VgpuInstanceGetEncoderStatsFunc(vgpuInstance) +} + +// VgpuInstanceGetEncoderStatsCalls gets all the calls that were made to VgpuInstanceGetEncoderStats. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetEncoderStatsCalls()) +func (mock *Interface) VgpuInstanceGetEncoderStatsCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetEncoderStats.RLock() + calls = mock.calls.VgpuInstanceGetEncoderStats + mock.lockVgpuInstanceGetEncoderStats.RUnlock() + return calls +} + +// VgpuInstanceGetFBCSessions calls VgpuInstanceGetFBCSessionsFunc. +func (mock *Interface) VgpuInstanceGetFBCSessions(vgpuInstance nvml.VgpuInstance) (int, nvml.FBCSessionInfo, nvml.Return) { + if mock.VgpuInstanceGetFBCSessionsFunc == nil { + panic("Interface.VgpuInstanceGetFBCSessionsFunc: method is nil but Interface.VgpuInstanceGetFBCSessions was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetFBCSessions.Lock() + mock.calls.VgpuInstanceGetFBCSessions = append(mock.calls.VgpuInstanceGetFBCSessions, callInfo) + mock.lockVgpuInstanceGetFBCSessions.Unlock() + return mock.VgpuInstanceGetFBCSessionsFunc(vgpuInstance) +} + +// VgpuInstanceGetFBCSessionsCalls gets all the calls that were made to VgpuInstanceGetFBCSessions. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetFBCSessionsCalls()) +func (mock *Interface) VgpuInstanceGetFBCSessionsCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetFBCSessions.RLock() + calls = mock.calls.VgpuInstanceGetFBCSessions + mock.lockVgpuInstanceGetFBCSessions.RUnlock() + return calls +} + +// VgpuInstanceGetFBCStats calls VgpuInstanceGetFBCStatsFunc. +func (mock *Interface) VgpuInstanceGetFBCStats(vgpuInstance nvml.VgpuInstance) (nvml.FBCStats, nvml.Return) { + if mock.VgpuInstanceGetFBCStatsFunc == nil { + panic("Interface.VgpuInstanceGetFBCStatsFunc: method is nil but Interface.VgpuInstanceGetFBCStats was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetFBCStats.Lock() + mock.calls.VgpuInstanceGetFBCStats = append(mock.calls.VgpuInstanceGetFBCStats, callInfo) + mock.lockVgpuInstanceGetFBCStats.Unlock() + return mock.VgpuInstanceGetFBCStatsFunc(vgpuInstance) +} + +// VgpuInstanceGetFBCStatsCalls gets all the calls that were made to VgpuInstanceGetFBCStats. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetFBCStatsCalls()) +func (mock *Interface) VgpuInstanceGetFBCStatsCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetFBCStats.RLock() + calls = mock.calls.VgpuInstanceGetFBCStats + mock.lockVgpuInstanceGetFBCStats.RUnlock() + return calls +} + +// VgpuInstanceGetFbUsage calls VgpuInstanceGetFbUsageFunc. +func (mock *Interface) VgpuInstanceGetFbUsage(vgpuInstance nvml.VgpuInstance) (uint64, nvml.Return) { + if mock.VgpuInstanceGetFbUsageFunc == nil { + panic("Interface.VgpuInstanceGetFbUsageFunc: method is nil but Interface.VgpuInstanceGetFbUsage was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetFbUsage.Lock() + mock.calls.VgpuInstanceGetFbUsage = append(mock.calls.VgpuInstanceGetFbUsage, callInfo) + mock.lockVgpuInstanceGetFbUsage.Unlock() + return mock.VgpuInstanceGetFbUsageFunc(vgpuInstance) +} + +// VgpuInstanceGetFbUsageCalls gets all the calls that were made to VgpuInstanceGetFbUsage. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetFbUsageCalls()) +func (mock *Interface) VgpuInstanceGetFbUsageCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetFbUsage.RLock() + calls = mock.calls.VgpuInstanceGetFbUsage + mock.lockVgpuInstanceGetFbUsage.RUnlock() + return calls +} + +// VgpuInstanceGetFrameRateLimit calls VgpuInstanceGetFrameRateLimitFunc. +func (mock *Interface) VgpuInstanceGetFrameRateLimit(vgpuInstance nvml.VgpuInstance) (uint32, nvml.Return) { + if mock.VgpuInstanceGetFrameRateLimitFunc == nil { + panic("Interface.VgpuInstanceGetFrameRateLimitFunc: method is nil but Interface.VgpuInstanceGetFrameRateLimit was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetFrameRateLimit.Lock() + mock.calls.VgpuInstanceGetFrameRateLimit = append(mock.calls.VgpuInstanceGetFrameRateLimit, callInfo) + mock.lockVgpuInstanceGetFrameRateLimit.Unlock() + return mock.VgpuInstanceGetFrameRateLimitFunc(vgpuInstance) +} + +// VgpuInstanceGetFrameRateLimitCalls gets all the calls that were made to VgpuInstanceGetFrameRateLimit. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetFrameRateLimitCalls()) +func (mock *Interface) VgpuInstanceGetFrameRateLimitCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetFrameRateLimit.RLock() + calls = mock.calls.VgpuInstanceGetFrameRateLimit + mock.lockVgpuInstanceGetFrameRateLimit.RUnlock() + return calls +} + +// VgpuInstanceGetGpuInstanceId calls VgpuInstanceGetGpuInstanceIdFunc. +func (mock *Interface) VgpuInstanceGetGpuInstanceId(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) { + if mock.VgpuInstanceGetGpuInstanceIdFunc == nil { + panic("Interface.VgpuInstanceGetGpuInstanceIdFunc: method is nil but Interface.VgpuInstanceGetGpuInstanceId was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetGpuInstanceId.Lock() + mock.calls.VgpuInstanceGetGpuInstanceId = append(mock.calls.VgpuInstanceGetGpuInstanceId, callInfo) + mock.lockVgpuInstanceGetGpuInstanceId.Unlock() + return mock.VgpuInstanceGetGpuInstanceIdFunc(vgpuInstance) +} + +// VgpuInstanceGetGpuInstanceIdCalls gets all the calls that were made to VgpuInstanceGetGpuInstanceId. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetGpuInstanceIdCalls()) +func (mock *Interface) VgpuInstanceGetGpuInstanceIdCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetGpuInstanceId.RLock() + calls = mock.calls.VgpuInstanceGetGpuInstanceId + mock.lockVgpuInstanceGetGpuInstanceId.RUnlock() + return calls +} + +// VgpuInstanceGetGpuPciId calls VgpuInstanceGetGpuPciIdFunc. +func (mock *Interface) VgpuInstanceGetGpuPciId(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) { + if mock.VgpuInstanceGetGpuPciIdFunc == nil { + panic("Interface.VgpuInstanceGetGpuPciIdFunc: method is nil but Interface.VgpuInstanceGetGpuPciId was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetGpuPciId.Lock() + mock.calls.VgpuInstanceGetGpuPciId = append(mock.calls.VgpuInstanceGetGpuPciId, callInfo) + mock.lockVgpuInstanceGetGpuPciId.Unlock() + return mock.VgpuInstanceGetGpuPciIdFunc(vgpuInstance) +} + +// VgpuInstanceGetGpuPciIdCalls gets all the calls that were made to VgpuInstanceGetGpuPciId. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetGpuPciIdCalls()) +func (mock *Interface) VgpuInstanceGetGpuPciIdCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetGpuPciId.RLock() + calls = mock.calls.VgpuInstanceGetGpuPciId + mock.lockVgpuInstanceGetGpuPciId.RUnlock() + return calls +} + +// VgpuInstanceGetLicenseInfo calls VgpuInstanceGetLicenseInfoFunc. +func (mock *Interface) VgpuInstanceGetLicenseInfo(vgpuInstance nvml.VgpuInstance) (nvml.VgpuLicenseInfo, nvml.Return) { + if mock.VgpuInstanceGetLicenseInfoFunc == nil { + panic("Interface.VgpuInstanceGetLicenseInfoFunc: method is nil but Interface.VgpuInstanceGetLicenseInfo was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetLicenseInfo.Lock() + mock.calls.VgpuInstanceGetLicenseInfo = append(mock.calls.VgpuInstanceGetLicenseInfo, callInfo) + mock.lockVgpuInstanceGetLicenseInfo.Unlock() + return mock.VgpuInstanceGetLicenseInfoFunc(vgpuInstance) +} + +// VgpuInstanceGetLicenseInfoCalls gets all the calls that were made to VgpuInstanceGetLicenseInfo. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetLicenseInfoCalls()) +func (mock *Interface) VgpuInstanceGetLicenseInfoCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetLicenseInfo.RLock() + calls = mock.calls.VgpuInstanceGetLicenseInfo + mock.lockVgpuInstanceGetLicenseInfo.RUnlock() + return calls +} + +// VgpuInstanceGetLicenseStatus calls VgpuInstanceGetLicenseStatusFunc. +func (mock *Interface) VgpuInstanceGetLicenseStatus(vgpuInstance nvml.VgpuInstance) (int, nvml.Return) { + if mock.VgpuInstanceGetLicenseStatusFunc == nil { + panic("Interface.VgpuInstanceGetLicenseStatusFunc: method is nil but Interface.VgpuInstanceGetLicenseStatus was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetLicenseStatus.Lock() + mock.calls.VgpuInstanceGetLicenseStatus = append(mock.calls.VgpuInstanceGetLicenseStatus, callInfo) + mock.lockVgpuInstanceGetLicenseStatus.Unlock() + return mock.VgpuInstanceGetLicenseStatusFunc(vgpuInstance) +} + +// VgpuInstanceGetLicenseStatusCalls gets all the calls that were made to VgpuInstanceGetLicenseStatus. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetLicenseStatusCalls()) +func (mock *Interface) VgpuInstanceGetLicenseStatusCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetLicenseStatus.RLock() + calls = mock.calls.VgpuInstanceGetLicenseStatus + mock.lockVgpuInstanceGetLicenseStatus.RUnlock() + return calls +} + +// VgpuInstanceGetMdevUUID calls VgpuInstanceGetMdevUUIDFunc. +func (mock *Interface) VgpuInstanceGetMdevUUID(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) { + if mock.VgpuInstanceGetMdevUUIDFunc == nil { + panic("Interface.VgpuInstanceGetMdevUUIDFunc: method is nil but Interface.VgpuInstanceGetMdevUUID was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetMdevUUID.Lock() + mock.calls.VgpuInstanceGetMdevUUID = append(mock.calls.VgpuInstanceGetMdevUUID, callInfo) + mock.lockVgpuInstanceGetMdevUUID.Unlock() + return mock.VgpuInstanceGetMdevUUIDFunc(vgpuInstance) +} + +// VgpuInstanceGetMdevUUIDCalls gets all the calls that were made to VgpuInstanceGetMdevUUID. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetMdevUUIDCalls()) +func (mock *Interface) VgpuInstanceGetMdevUUIDCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetMdevUUID.RLock() + calls = mock.calls.VgpuInstanceGetMdevUUID + mock.lockVgpuInstanceGetMdevUUID.RUnlock() + return calls +} + +// VgpuInstanceGetMetadata calls VgpuInstanceGetMetadataFunc. +func (mock *Interface) VgpuInstanceGetMetadata(vgpuInstance nvml.VgpuInstance) (nvml.VgpuMetadata, nvml.Return) { + if mock.VgpuInstanceGetMetadataFunc == nil { + panic("Interface.VgpuInstanceGetMetadataFunc: method is nil but Interface.VgpuInstanceGetMetadata was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetMetadata.Lock() + mock.calls.VgpuInstanceGetMetadata = append(mock.calls.VgpuInstanceGetMetadata, callInfo) + mock.lockVgpuInstanceGetMetadata.Unlock() + return mock.VgpuInstanceGetMetadataFunc(vgpuInstance) +} + +// VgpuInstanceGetMetadataCalls gets all the calls that were made to VgpuInstanceGetMetadata. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetMetadataCalls()) +func (mock *Interface) VgpuInstanceGetMetadataCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetMetadata.RLock() + calls = mock.calls.VgpuInstanceGetMetadata + mock.lockVgpuInstanceGetMetadata.RUnlock() + return calls +} + +// VgpuInstanceGetType calls VgpuInstanceGetTypeFunc. +func (mock *Interface) VgpuInstanceGetType(vgpuInstance nvml.VgpuInstance) (nvml.VgpuTypeId, nvml.Return) { + if mock.VgpuInstanceGetTypeFunc == nil { + panic("Interface.VgpuInstanceGetTypeFunc: method is nil but Interface.VgpuInstanceGetType was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetType.Lock() + mock.calls.VgpuInstanceGetType = append(mock.calls.VgpuInstanceGetType, callInfo) + mock.lockVgpuInstanceGetType.Unlock() + return mock.VgpuInstanceGetTypeFunc(vgpuInstance) +} + +// VgpuInstanceGetTypeCalls gets all the calls that were made to VgpuInstanceGetType. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetTypeCalls()) +func (mock *Interface) VgpuInstanceGetTypeCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetType.RLock() + calls = mock.calls.VgpuInstanceGetType + mock.lockVgpuInstanceGetType.RUnlock() + return calls +} + +// VgpuInstanceGetUUID calls VgpuInstanceGetUUIDFunc. +func (mock *Interface) VgpuInstanceGetUUID(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) { + if mock.VgpuInstanceGetUUIDFunc == nil { + panic("Interface.VgpuInstanceGetUUIDFunc: method is nil but Interface.VgpuInstanceGetUUID was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetUUID.Lock() + mock.calls.VgpuInstanceGetUUID = append(mock.calls.VgpuInstanceGetUUID, callInfo) + mock.lockVgpuInstanceGetUUID.Unlock() + return mock.VgpuInstanceGetUUIDFunc(vgpuInstance) +} + +// VgpuInstanceGetUUIDCalls gets all the calls that were made to VgpuInstanceGetUUID. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetUUIDCalls()) +func (mock *Interface) VgpuInstanceGetUUIDCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetUUID.RLock() + calls = mock.calls.VgpuInstanceGetUUID + mock.lockVgpuInstanceGetUUID.RUnlock() + return calls +} + +// VgpuInstanceGetVmDriverVersion calls VgpuInstanceGetVmDriverVersionFunc. +func (mock *Interface) VgpuInstanceGetVmDriverVersion(vgpuInstance nvml.VgpuInstance) (string, nvml.Return) { + if mock.VgpuInstanceGetVmDriverVersionFunc == nil { + panic("Interface.VgpuInstanceGetVmDriverVersionFunc: method is nil but Interface.VgpuInstanceGetVmDriverVersion was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetVmDriverVersion.Lock() + mock.calls.VgpuInstanceGetVmDriverVersion = append(mock.calls.VgpuInstanceGetVmDriverVersion, callInfo) + mock.lockVgpuInstanceGetVmDriverVersion.Unlock() + return mock.VgpuInstanceGetVmDriverVersionFunc(vgpuInstance) +} + +// VgpuInstanceGetVmDriverVersionCalls gets all the calls that were made to VgpuInstanceGetVmDriverVersion. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetVmDriverVersionCalls()) +func (mock *Interface) VgpuInstanceGetVmDriverVersionCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetVmDriverVersion.RLock() + calls = mock.calls.VgpuInstanceGetVmDriverVersion + mock.lockVgpuInstanceGetVmDriverVersion.RUnlock() + return calls +} + +// VgpuInstanceGetVmID calls VgpuInstanceGetVmIDFunc. +func (mock *Interface) VgpuInstanceGetVmID(vgpuInstance nvml.VgpuInstance) (string, nvml.VgpuVmIdType, nvml.Return) { + if mock.VgpuInstanceGetVmIDFunc == nil { + panic("Interface.VgpuInstanceGetVmIDFunc: method is nil but Interface.VgpuInstanceGetVmID was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + }{ + VgpuInstance: vgpuInstance, + } + mock.lockVgpuInstanceGetVmID.Lock() + mock.calls.VgpuInstanceGetVmID = append(mock.calls.VgpuInstanceGetVmID, callInfo) + mock.lockVgpuInstanceGetVmID.Unlock() + return mock.VgpuInstanceGetVmIDFunc(vgpuInstance) +} + +// VgpuInstanceGetVmIDCalls gets all the calls that were made to VgpuInstanceGetVmID. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceGetVmIDCalls()) +func (mock *Interface) VgpuInstanceGetVmIDCalls() []struct { + VgpuInstance nvml.VgpuInstance +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + } + mock.lockVgpuInstanceGetVmID.RLock() + calls = mock.calls.VgpuInstanceGetVmID + mock.lockVgpuInstanceGetVmID.RUnlock() + return calls +} + +// VgpuInstanceSetEncoderCapacity calls VgpuInstanceSetEncoderCapacityFunc. +func (mock *Interface) VgpuInstanceSetEncoderCapacity(vgpuInstance nvml.VgpuInstance, n int) nvml.Return { + if mock.VgpuInstanceSetEncoderCapacityFunc == nil { + panic("Interface.VgpuInstanceSetEncoderCapacityFunc: method is nil but Interface.VgpuInstanceSetEncoderCapacity was just called") + } + callInfo := struct { + VgpuInstance nvml.VgpuInstance + N int + }{ + VgpuInstance: vgpuInstance, + N: n, + } + mock.lockVgpuInstanceSetEncoderCapacity.Lock() + mock.calls.VgpuInstanceSetEncoderCapacity = append(mock.calls.VgpuInstanceSetEncoderCapacity, callInfo) + mock.lockVgpuInstanceSetEncoderCapacity.Unlock() + return mock.VgpuInstanceSetEncoderCapacityFunc(vgpuInstance, n) +} + +// VgpuInstanceSetEncoderCapacityCalls gets all the calls that were made to VgpuInstanceSetEncoderCapacity. +// Check the length with: +// +// len(mockedInterface.VgpuInstanceSetEncoderCapacityCalls()) +func (mock *Interface) VgpuInstanceSetEncoderCapacityCalls() []struct { + VgpuInstance nvml.VgpuInstance + N int +} { + var calls []struct { + VgpuInstance nvml.VgpuInstance + N int + } + mock.lockVgpuInstanceSetEncoderCapacity.RLock() + calls = mock.calls.VgpuInstanceSetEncoderCapacity + mock.lockVgpuInstanceSetEncoderCapacity.RUnlock() + return calls +} + +// VgpuTypeGetCapabilities calls VgpuTypeGetCapabilitiesFunc. +func (mock *Interface) VgpuTypeGetCapabilities(vgpuTypeId nvml.VgpuTypeId, vgpuCapability nvml.VgpuCapability) (bool, nvml.Return) { + if mock.VgpuTypeGetCapabilitiesFunc == nil { + panic("Interface.VgpuTypeGetCapabilitiesFunc: method is nil but Interface.VgpuTypeGetCapabilities was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + VgpuCapability nvml.VgpuCapability + }{ + VgpuTypeId: vgpuTypeId, + VgpuCapability: vgpuCapability, + } + mock.lockVgpuTypeGetCapabilities.Lock() + mock.calls.VgpuTypeGetCapabilities = append(mock.calls.VgpuTypeGetCapabilities, callInfo) + mock.lockVgpuTypeGetCapabilities.Unlock() + return mock.VgpuTypeGetCapabilitiesFunc(vgpuTypeId, vgpuCapability) +} + +// VgpuTypeGetCapabilitiesCalls gets all the calls that were made to VgpuTypeGetCapabilities. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetCapabilitiesCalls()) +func (mock *Interface) VgpuTypeGetCapabilitiesCalls() []struct { + VgpuTypeId nvml.VgpuTypeId + VgpuCapability nvml.VgpuCapability +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + VgpuCapability nvml.VgpuCapability + } + mock.lockVgpuTypeGetCapabilities.RLock() + calls = mock.calls.VgpuTypeGetCapabilities + mock.lockVgpuTypeGetCapabilities.RUnlock() + return calls +} + +// VgpuTypeGetClass calls VgpuTypeGetClassFunc. +func (mock *Interface) VgpuTypeGetClass(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) { + if mock.VgpuTypeGetClassFunc == nil { + panic("Interface.VgpuTypeGetClassFunc: method is nil but Interface.VgpuTypeGetClass was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetClass.Lock() + mock.calls.VgpuTypeGetClass = append(mock.calls.VgpuTypeGetClass, callInfo) + mock.lockVgpuTypeGetClass.Unlock() + return mock.VgpuTypeGetClassFunc(vgpuTypeId) +} + +// VgpuTypeGetClassCalls gets all the calls that were made to VgpuTypeGetClass. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetClassCalls()) +func (mock *Interface) VgpuTypeGetClassCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetClass.RLock() + calls = mock.calls.VgpuTypeGetClass + mock.lockVgpuTypeGetClass.RUnlock() + return calls +} + +// VgpuTypeGetDeviceID calls VgpuTypeGetDeviceIDFunc. +func (mock *Interface) VgpuTypeGetDeviceID(vgpuTypeId nvml.VgpuTypeId) (uint64, uint64, nvml.Return) { + if mock.VgpuTypeGetDeviceIDFunc == nil { + panic("Interface.VgpuTypeGetDeviceIDFunc: method is nil but Interface.VgpuTypeGetDeviceID was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetDeviceID.Lock() + mock.calls.VgpuTypeGetDeviceID = append(mock.calls.VgpuTypeGetDeviceID, callInfo) + mock.lockVgpuTypeGetDeviceID.Unlock() + return mock.VgpuTypeGetDeviceIDFunc(vgpuTypeId) +} + +// VgpuTypeGetDeviceIDCalls gets all the calls that were made to VgpuTypeGetDeviceID. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetDeviceIDCalls()) +func (mock *Interface) VgpuTypeGetDeviceIDCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetDeviceID.RLock() + calls = mock.calls.VgpuTypeGetDeviceID + mock.lockVgpuTypeGetDeviceID.RUnlock() + return calls +} + +// VgpuTypeGetFrameRateLimit calls VgpuTypeGetFrameRateLimitFunc. +func (mock *Interface) VgpuTypeGetFrameRateLimit(vgpuTypeId nvml.VgpuTypeId) (uint32, nvml.Return) { + if mock.VgpuTypeGetFrameRateLimitFunc == nil { + panic("Interface.VgpuTypeGetFrameRateLimitFunc: method is nil but Interface.VgpuTypeGetFrameRateLimit was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetFrameRateLimit.Lock() + mock.calls.VgpuTypeGetFrameRateLimit = append(mock.calls.VgpuTypeGetFrameRateLimit, callInfo) + mock.lockVgpuTypeGetFrameRateLimit.Unlock() + return mock.VgpuTypeGetFrameRateLimitFunc(vgpuTypeId) +} + +// VgpuTypeGetFrameRateLimitCalls gets all the calls that were made to VgpuTypeGetFrameRateLimit. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetFrameRateLimitCalls()) +func (mock *Interface) VgpuTypeGetFrameRateLimitCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetFrameRateLimit.RLock() + calls = mock.calls.VgpuTypeGetFrameRateLimit + mock.lockVgpuTypeGetFrameRateLimit.RUnlock() + return calls +} + +// VgpuTypeGetFramebufferSize calls VgpuTypeGetFramebufferSizeFunc. +func (mock *Interface) VgpuTypeGetFramebufferSize(vgpuTypeId nvml.VgpuTypeId) (uint64, nvml.Return) { + if mock.VgpuTypeGetFramebufferSizeFunc == nil { + panic("Interface.VgpuTypeGetFramebufferSizeFunc: method is nil but Interface.VgpuTypeGetFramebufferSize was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetFramebufferSize.Lock() + mock.calls.VgpuTypeGetFramebufferSize = append(mock.calls.VgpuTypeGetFramebufferSize, callInfo) + mock.lockVgpuTypeGetFramebufferSize.Unlock() + return mock.VgpuTypeGetFramebufferSizeFunc(vgpuTypeId) +} + +// VgpuTypeGetFramebufferSizeCalls gets all the calls that were made to VgpuTypeGetFramebufferSize. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetFramebufferSizeCalls()) +func (mock *Interface) VgpuTypeGetFramebufferSizeCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetFramebufferSize.RLock() + calls = mock.calls.VgpuTypeGetFramebufferSize + mock.lockVgpuTypeGetFramebufferSize.RUnlock() + return calls +} + +// VgpuTypeGetGpuInstanceProfileId calls VgpuTypeGetGpuInstanceProfileIdFunc. +func (mock *Interface) VgpuTypeGetGpuInstanceProfileId(vgpuTypeId nvml.VgpuTypeId) (uint32, nvml.Return) { + if mock.VgpuTypeGetGpuInstanceProfileIdFunc == nil { + panic("Interface.VgpuTypeGetGpuInstanceProfileIdFunc: method is nil but Interface.VgpuTypeGetGpuInstanceProfileId was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetGpuInstanceProfileId.Lock() + mock.calls.VgpuTypeGetGpuInstanceProfileId = append(mock.calls.VgpuTypeGetGpuInstanceProfileId, callInfo) + mock.lockVgpuTypeGetGpuInstanceProfileId.Unlock() + return mock.VgpuTypeGetGpuInstanceProfileIdFunc(vgpuTypeId) +} + +// VgpuTypeGetGpuInstanceProfileIdCalls gets all the calls that were made to VgpuTypeGetGpuInstanceProfileId. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetGpuInstanceProfileIdCalls()) +func (mock *Interface) VgpuTypeGetGpuInstanceProfileIdCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetGpuInstanceProfileId.RLock() + calls = mock.calls.VgpuTypeGetGpuInstanceProfileId + mock.lockVgpuTypeGetGpuInstanceProfileId.RUnlock() + return calls +} + +// VgpuTypeGetLicense calls VgpuTypeGetLicenseFunc. +func (mock *Interface) VgpuTypeGetLicense(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) { + if mock.VgpuTypeGetLicenseFunc == nil { + panic("Interface.VgpuTypeGetLicenseFunc: method is nil but Interface.VgpuTypeGetLicense was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetLicense.Lock() + mock.calls.VgpuTypeGetLicense = append(mock.calls.VgpuTypeGetLicense, callInfo) + mock.lockVgpuTypeGetLicense.Unlock() + return mock.VgpuTypeGetLicenseFunc(vgpuTypeId) +} + +// VgpuTypeGetLicenseCalls gets all the calls that were made to VgpuTypeGetLicense. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetLicenseCalls()) +func (mock *Interface) VgpuTypeGetLicenseCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetLicense.RLock() + calls = mock.calls.VgpuTypeGetLicense + mock.lockVgpuTypeGetLicense.RUnlock() + return calls +} + +// VgpuTypeGetMaxInstances calls VgpuTypeGetMaxInstancesFunc. +func (mock *Interface) VgpuTypeGetMaxInstances(device nvml.Device, vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) { + if mock.VgpuTypeGetMaxInstancesFunc == nil { + panic("Interface.VgpuTypeGetMaxInstancesFunc: method is nil but Interface.VgpuTypeGetMaxInstances was just called") + } + callInfo := struct { + Device nvml.Device + VgpuTypeId nvml.VgpuTypeId + }{ + Device: device, + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetMaxInstances.Lock() + mock.calls.VgpuTypeGetMaxInstances = append(mock.calls.VgpuTypeGetMaxInstances, callInfo) + mock.lockVgpuTypeGetMaxInstances.Unlock() + return mock.VgpuTypeGetMaxInstancesFunc(device, vgpuTypeId) +} + +// VgpuTypeGetMaxInstancesCalls gets all the calls that were made to VgpuTypeGetMaxInstances. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetMaxInstancesCalls()) +func (mock *Interface) VgpuTypeGetMaxInstancesCalls() []struct { + Device nvml.Device + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + Device nvml.Device + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetMaxInstances.RLock() + calls = mock.calls.VgpuTypeGetMaxInstances + mock.lockVgpuTypeGetMaxInstances.RUnlock() + return calls +} + +// VgpuTypeGetMaxInstancesPerVm calls VgpuTypeGetMaxInstancesPerVmFunc. +func (mock *Interface) VgpuTypeGetMaxInstancesPerVm(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) { + if mock.VgpuTypeGetMaxInstancesPerVmFunc == nil { + panic("Interface.VgpuTypeGetMaxInstancesPerVmFunc: method is nil but Interface.VgpuTypeGetMaxInstancesPerVm was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetMaxInstancesPerVm.Lock() + mock.calls.VgpuTypeGetMaxInstancesPerVm = append(mock.calls.VgpuTypeGetMaxInstancesPerVm, callInfo) + mock.lockVgpuTypeGetMaxInstancesPerVm.Unlock() + return mock.VgpuTypeGetMaxInstancesPerVmFunc(vgpuTypeId) +} + +// VgpuTypeGetMaxInstancesPerVmCalls gets all the calls that were made to VgpuTypeGetMaxInstancesPerVm. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetMaxInstancesPerVmCalls()) +func (mock *Interface) VgpuTypeGetMaxInstancesPerVmCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetMaxInstancesPerVm.RLock() + calls = mock.calls.VgpuTypeGetMaxInstancesPerVm + mock.lockVgpuTypeGetMaxInstancesPerVm.RUnlock() + return calls +} + +// VgpuTypeGetName calls VgpuTypeGetNameFunc. +func (mock *Interface) VgpuTypeGetName(vgpuTypeId nvml.VgpuTypeId) (string, nvml.Return) { + if mock.VgpuTypeGetNameFunc == nil { + panic("Interface.VgpuTypeGetNameFunc: method is nil but Interface.VgpuTypeGetName was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetName.Lock() + mock.calls.VgpuTypeGetName = append(mock.calls.VgpuTypeGetName, callInfo) + mock.lockVgpuTypeGetName.Unlock() + return mock.VgpuTypeGetNameFunc(vgpuTypeId) +} + +// VgpuTypeGetNameCalls gets all the calls that were made to VgpuTypeGetName. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetNameCalls()) +func (mock *Interface) VgpuTypeGetNameCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetName.RLock() + calls = mock.calls.VgpuTypeGetName + mock.lockVgpuTypeGetName.RUnlock() + return calls +} + +// VgpuTypeGetNumDisplayHeads calls VgpuTypeGetNumDisplayHeadsFunc. +func (mock *Interface) VgpuTypeGetNumDisplayHeads(vgpuTypeId nvml.VgpuTypeId) (int, nvml.Return) { + if mock.VgpuTypeGetNumDisplayHeadsFunc == nil { + panic("Interface.VgpuTypeGetNumDisplayHeadsFunc: method is nil but Interface.VgpuTypeGetNumDisplayHeads was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + }{ + VgpuTypeId: vgpuTypeId, + } + mock.lockVgpuTypeGetNumDisplayHeads.Lock() + mock.calls.VgpuTypeGetNumDisplayHeads = append(mock.calls.VgpuTypeGetNumDisplayHeads, callInfo) + mock.lockVgpuTypeGetNumDisplayHeads.Unlock() + return mock.VgpuTypeGetNumDisplayHeadsFunc(vgpuTypeId) +} + +// VgpuTypeGetNumDisplayHeadsCalls gets all the calls that were made to VgpuTypeGetNumDisplayHeads. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetNumDisplayHeadsCalls()) +func (mock *Interface) VgpuTypeGetNumDisplayHeadsCalls() []struct { + VgpuTypeId nvml.VgpuTypeId +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + } + mock.lockVgpuTypeGetNumDisplayHeads.RLock() + calls = mock.calls.VgpuTypeGetNumDisplayHeads + mock.lockVgpuTypeGetNumDisplayHeads.RUnlock() + return calls +} + +// VgpuTypeGetResolution calls VgpuTypeGetResolutionFunc. +func (mock *Interface) VgpuTypeGetResolution(vgpuTypeId nvml.VgpuTypeId, n int) (uint32, uint32, nvml.Return) { + if mock.VgpuTypeGetResolutionFunc == nil { + panic("Interface.VgpuTypeGetResolutionFunc: method is nil but Interface.VgpuTypeGetResolution was just called") + } + callInfo := struct { + VgpuTypeId nvml.VgpuTypeId + N int + }{ + VgpuTypeId: vgpuTypeId, + N: n, + } + mock.lockVgpuTypeGetResolution.Lock() + mock.calls.VgpuTypeGetResolution = append(mock.calls.VgpuTypeGetResolution, callInfo) + mock.lockVgpuTypeGetResolution.Unlock() + return mock.VgpuTypeGetResolutionFunc(vgpuTypeId, n) +} + +// VgpuTypeGetResolutionCalls gets all the calls that were made to VgpuTypeGetResolution. +// Check the length with: +// +// len(mockedInterface.VgpuTypeGetResolutionCalls()) +func (mock *Interface) VgpuTypeGetResolutionCalls() []struct { + VgpuTypeId nvml.VgpuTypeId + N int +} { + var calls []struct { + VgpuTypeId nvml.VgpuTypeId + N int + } + mock.lockVgpuTypeGetResolution.RLock() + calls = mock.calls.VgpuTypeGetResolution + mock.lockVgpuTypeGetResolution.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/unit.go b/pkg/nvml/mock/unit.go new file mode 100644 index 0000000..64af542 --- /dev/null +++ b/pkg/nvml/mock/unit.go @@ -0,0 +1,304 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that Unit does implement nvml.Unit. +// If this is not the case, regenerate this file with moq. +var _ nvml.Unit = &Unit{} + +// Unit is a mock implementation of nvml.Unit. +// +// func TestSomethingThatUsesUnit(t *testing.T) { +// +// // make and configure a mocked nvml.Unit +// mockedUnit := &Unit{ +// GetDevicesFunc: func() ([]nvml.Device, nvml.Return) { +// panic("mock out the GetDevices method") +// }, +// GetFanSpeedInfoFunc: func() (nvml.UnitFanSpeeds, nvml.Return) { +// panic("mock out the GetFanSpeedInfo method") +// }, +// GetLedStateFunc: func() (nvml.LedState, nvml.Return) { +// panic("mock out the GetLedState method") +// }, +// GetPsuInfoFunc: func() (nvml.PSUInfo, nvml.Return) { +// panic("mock out the GetPsuInfo method") +// }, +// GetTemperatureFunc: func(n int) (uint32, nvml.Return) { +// panic("mock out the GetTemperature method") +// }, +// GetUnitInfoFunc: func() (nvml.UnitInfo, nvml.Return) { +// panic("mock out the GetUnitInfo method") +// }, +// SetLedStateFunc: func(ledColor nvml.LedColor) nvml.Return { +// panic("mock out the SetLedState method") +// }, +// } +// +// // use mockedUnit in code that requires nvml.Unit +// // and then make assertions. +// +// } +type Unit struct { + // GetDevicesFunc mocks the GetDevices method. + GetDevicesFunc func() ([]nvml.Device, nvml.Return) + + // GetFanSpeedInfoFunc mocks the GetFanSpeedInfo method. + GetFanSpeedInfoFunc func() (nvml.UnitFanSpeeds, nvml.Return) + + // GetLedStateFunc mocks the GetLedState method. + GetLedStateFunc func() (nvml.LedState, nvml.Return) + + // GetPsuInfoFunc mocks the GetPsuInfo method. + GetPsuInfoFunc func() (nvml.PSUInfo, nvml.Return) + + // GetTemperatureFunc mocks the GetTemperature method. + GetTemperatureFunc func(n int) (uint32, nvml.Return) + + // GetUnitInfoFunc mocks the GetUnitInfo method. + GetUnitInfoFunc func() (nvml.UnitInfo, nvml.Return) + + // SetLedStateFunc mocks the SetLedState method. + SetLedStateFunc func(ledColor nvml.LedColor) nvml.Return + + // calls tracks calls to the methods. + calls struct { + // GetDevices holds details about calls to the GetDevices method. + GetDevices []struct { + } + // GetFanSpeedInfo holds details about calls to the GetFanSpeedInfo method. + GetFanSpeedInfo []struct { + } + // GetLedState holds details about calls to the GetLedState method. + GetLedState []struct { + } + // GetPsuInfo holds details about calls to the GetPsuInfo method. + GetPsuInfo []struct { + } + // GetTemperature holds details about calls to the GetTemperature method. + GetTemperature []struct { + // N is the n argument value. + N int + } + // GetUnitInfo holds details about calls to the GetUnitInfo method. + GetUnitInfo []struct { + } + // SetLedState holds details about calls to the SetLedState method. + SetLedState []struct { + // LedColor is the ledColor argument value. + LedColor nvml.LedColor + } + } + lockGetDevices sync.RWMutex + lockGetFanSpeedInfo sync.RWMutex + lockGetLedState sync.RWMutex + lockGetPsuInfo sync.RWMutex + lockGetTemperature sync.RWMutex + lockGetUnitInfo sync.RWMutex + lockSetLedState sync.RWMutex +} + +// GetDevices calls GetDevicesFunc. +func (mock *Unit) GetDevices() ([]nvml.Device, nvml.Return) { + if mock.GetDevicesFunc == nil { + panic("Unit.GetDevicesFunc: method is nil but Unit.GetDevices was just called") + } + callInfo := struct { + }{} + mock.lockGetDevices.Lock() + mock.calls.GetDevices = append(mock.calls.GetDevices, callInfo) + mock.lockGetDevices.Unlock() + return mock.GetDevicesFunc() +} + +// GetDevicesCalls gets all the calls that were made to GetDevices. +// Check the length with: +// +// len(mockedUnit.GetDevicesCalls()) +func (mock *Unit) GetDevicesCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDevices.RLock() + calls = mock.calls.GetDevices + mock.lockGetDevices.RUnlock() + return calls +} + +// GetFanSpeedInfo calls GetFanSpeedInfoFunc. +func (mock *Unit) GetFanSpeedInfo() (nvml.UnitFanSpeeds, nvml.Return) { + if mock.GetFanSpeedInfoFunc == nil { + panic("Unit.GetFanSpeedInfoFunc: method is nil but Unit.GetFanSpeedInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetFanSpeedInfo.Lock() + mock.calls.GetFanSpeedInfo = append(mock.calls.GetFanSpeedInfo, callInfo) + mock.lockGetFanSpeedInfo.Unlock() + return mock.GetFanSpeedInfoFunc() +} + +// GetFanSpeedInfoCalls gets all the calls that were made to GetFanSpeedInfo. +// Check the length with: +// +// len(mockedUnit.GetFanSpeedInfoCalls()) +func (mock *Unit) GetFanSpeedInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFanSpeedInfo.RLock() + calls = mock.calls.GetFanSpeedInfo + mock.lockGetFanSpeedInfo.RUnlock() + return calls +} + +// GetLedState calls GetLedStateFunc. +func (mock *Unit) GetLedState() (nvml.LedState, nvml.Return) { + if mock.GetLedStateFunc == nil { + panic("Unit.GetLedStateFunc: method is nil but Unit.GetLedState was just called") + } + callInfo := struct { + }{} + mock.lockGetLedState.Lock() + mock.calls.GetLedState = append(mock.calls.GetLedState, callInfo) + mock.lockGetLedState.Unlock() + return mock.GetLedStateFunc() +} + +// GetLedStateCalls gets all the calls that were made to GetLedState. +// Check the length with: +// +// len(mockedUnit.GetLedStateCalls()) +func (mock *Unit) GetLedStateCalls() []struct { +} { + var calls []struct { + } + mock.lockGetLedState.RLock() + calls = mock.calls.GetLedState + mock.lockGetLedState.RUnlock() + return calls +} + +// GetPsuInfo calls GetPsuInfoFunc. +func (mock *Unit) GetPsuInfo() (nvml.PSUInfo, nvml.Return) { + if mock.GetPsuInfoFunc == nil { + panic("Unit.GetPsuInfoFunc: method is nil but Unit.GetPsuInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetPsuInfo.Lock() + mock.calls.GetPsuInfo = append(mock.calls.GetPsuInfo, callInfo) + mock.lockGetPsuInfo.Unlock() + return mock.GetPsuInfoFunc() +} + +// GetPsuInfoCalls gets all the calls that were made to GetPsuInfo. +// Check the length with: +// +// len(mockedUnit.GetPsuInfoCalls()) +func (mock *Unit) GetPsuInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetPsuInfo.RLock() + calls = mock.calls.GetPsuInfo + mock.lockGetPsuInfo.RUnlock() + return calls +} + +// GetTemperature calls GetTemperatureFunc. +func (mock *Unit) GetTemperature(n int) (uint32, nvml.Return) { + if mock.GetTemperatureFunc == nil { + panic("Unit.GetTemperatureFunc: method is nil but Unit.GetTemperature was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetTemperature.Lock() + mock.calls.GetTemperature = append(mock.calls.GetTemperature, callInfo) + mock.lockGetTemperature.Unlock() + return mock.GetTemperatureFunc(n) +} + +// GetTemperatureCalls gets all the calls that were made to GetTemperature. +// Check the length with: +// +// len(mockedUnit.GetTemperatureCalls()) +func (mock *Unit) GetTemperatureCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetTemperature.RLock() + calls = mock.calls.GetTemperature + mock.lockGetTemperature.RUnlock() + return calls +} + +// GetUnitInfo calls GetUnitInfoFunc. +func (mock *Unit) GetUnitInfo() (nvml.UnitInfo, nvml.Return) { + if mock.GetUnitInfoFunc == nil { + panic("Unit.GetUnitInfoFunc: method is nil but Unit.GetUnitInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetUnitInfo.Lock() + mock.calls.GetUnitInfo = append(mock.calls.GetUnitInfo, callInfo) + mock.lockGetUnitInfo.Unlock() + return mock.GetUnitInfoFunc() +} + +// GetUnitInfoCalls gets all the calls that were made to GetUnitInfo. +// Check the length with: +// +// len(mockedUnit.GetUnitInfoCalls()) +func (mock *Unit) GetUnitInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetUnitInfo.RLock() + calls = mock.calls.GetUnitInfo + mock.lockGetUnitInfo.RUnlock() + return calls +} + +// SetLedState calls SetLedStateFunc. +func (mock *Unit) SetLedState(ledColor nvml.LedColor) nvml.Return { + if mock.SetLedStateFunc == nil { + panic("Unit.SetLedStateFunc: method is nil but Unit.SetLedState was just called") + } + callInfo := struct { + LedColor nvml.LedColor + }{ + LedColor: ledColor, + } + mock.lockSetLedState.Lock() + mock.calls.SetLedState = append(mock.calls.SetLedState, callInfo) + mock.lockSetLedState.Unlock() + return mock.SetLedStateFunc(ledColor) +} + +// SetLedStateCalls gets all the calls that were made to SetLedState. +// Check the length with: +// +// len(mockedUnit.SetLedStateCalls()) +func (mock *Unit) SetLedStateCalls() []struct { + LedColor nvml.LedColor +} { + var calls []struct { + LedColor nvml.LedColor + } + mock.lockSetLedState.RLock() + calls = mock.calls.SetLedState + mock.lockSetLedState.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/vgpuinstance.go b/pkg/nvml/mock/vgpuinstance.go new file mode 100644 index 0000000..e0af013 --- /dev/null +++ b/pkg/nvml/mock/vgpuinstance.go @@ -0,0 +1,896 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that VgpuInstance does implement nvml.VgpuInstance. +// If this is not the case, regenerate this file with moq. +var _ nvml.VgpuInstance = &VgpuInstance{} + +// VgpuInstance is a mock implementation of nvml.VgpuInstance. +// +// func TestSomethingThatUsesVgpuInstance(t *testing.T) { +// +// // make and configure a mocked nvml.VgpuInstance +// mockedVgpuInstance := &VgpuInstance{ +// ClearAccountingPidsFunc: func() nvml.Return { +// panic("mock out the ClearAccountingPids method") +// }, +// GetAccountingModeFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetAccountingMode method") +// }, +// GetAccountingPidsFunc: func() ([]int, nvml.Return) { +// panic("mock out the GetAccountingPids method") +// }, +// GetAccountingStatsFunc: func(n int) (nvml.AccountingStats, nvml.Return) { +// panic("mock out the GetAccountingStats method") +// }, +// GetEccModeFunc: func() (nvml.EnableState, nvml.Return) { +// panic("mock out the GetEccMode method") +// }, +// GetEncoderCapacityFunc: func() (int, nvml.Return) { +// panic("mock out the GetEncoderCapacity method") +// }, +// GetEncoderSessionsFunc: func() (int, nvml.EncoderSessionInfo, nvml.Return) { +// panic("mock out the GetEncoderSessions method") +// }, +// GetEncoderStatsFunc: func() (int, uint32, uint32, nvml.Return) { +// panic("mock out the GetEncoderStats method") +// }, +// GetFBCSessionsFunc: func() (int, nvml.FBCSessionInfo, nvml.Return) { +// panic("mock out the GetFBCSessions method") +// }, +// GetFBCStatsFunc: func() (nvml.FBCStats, nvml.Return) { +// panic("mock out the GetFBCStats method") +// }, +// GetFbUsageFunc: func() (uint64, nvml.Return) { +// panic("mock out the GetFbUsage method") +// }, +// GetFrameRateLimitFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetFrameRateLimit method") +// }, +// GetGpuInstanceIdFunc: func() (int, nvml.Return) { +// panic("mock out the GetGpuInstanceId method") +// }, +// GetGpuPciIdFunc: func() (string, nvml.Return) { +// panic("mock out the GetGpuPciId method") +// }, +// GetLicenseInfoFunc: func() (nvml.VgpuLicenseInfo, nvml.Return) { +// panic("mock out the GetLicenseInfo method") +// }, +// GetLicenseStatusFunc: func() (int, nvml.Return) { +// panic("mock out the GetLicenseStatus method") +// }, +// GetMdevUUIDFunc: func() (string, nvml.Return) { +// panic("mock out the GetMdevUUID method") +// }, +// GetMetadataFunc: func() (nvml.VgpuMetadata, nvml.Return) { +// panic("mock out the GetMetadata method") +// }, +// GetTypeFunc: func() (nvml.VgpuTypeId, nvml.Return) { +// panic("mock out the GetType method") +// }, +// GetUUIDFunc: func() (string, nvml.Return) { +// panic("mock out the GetUUID method") +// }, +// GetVmDriverVersionFunc: func() (string, nvml.Return) { +// panic("mock out the GetVmDriverVersion method") +// }, +// GetVmIDFunc: func() (string, nvml.VgpuVmIdType, nvml.Return) { +// panic("mock out the GetVmID method") +// }, +// SetEncoderCapacityFunc: func(n int) nvml.Return { +// panic("mock out the SetEncoderCapacity method") +// }, +// } +// +// // use mockedVgpuInstance in code that requires nvml.VgpuInstance +// // and then make assertions. +// +// } +type VgpuInstance struct { + // ClearAccountingPidsFunc mocks the ClearAccountingPids method. + ClearAccountingPidsFunc func() nvml.Return + + // GetAccountingModeFunc mocks the GetAccountingMode method. + GetAccountingModeFunc func() (nvml.EnableState, nvml.Return) + + // GetAccountingPidsFunc mocks the GetAccountingPids method. + GetAccountingPidsFunc func() ([]int, nvml.Return) + + // GetAccountingStatsFunc mocks the GetAccountingStats method. + GetAccountingStatsFunc func(n int) (nvml.AccountingStats, nvml.Return) + + // GetEccModeFunc mocks the GetEccMode method. + GetEccModeFunc func() (nvml.EnableState, nvml.Return) + + // GetEncoderCapacityFunc mocks the GetEncoderCapacity method. + GetEncoderCapacityFunc func() (int, nvml.Return) + + // GetEncoderSessionsFunc mocks the GetEncoderSessions method. + GetEncoderSessionsFunc func() (int, nvml.EncoderSessionInfo, nvml.Return) + + // GetEncoderStatsFunc mocks the GetEncoderStats method. + GetEncoderStatsFunc func() (int, uint32, uint32, nvml.Return) + + // GetFBCSessionsFunc mocks the GetFBCSessions method. + GetFBCSessionsFunc func() (int, nvml.FBCSessionInfo, nvml.Return) + + // GetFBCStatsFunc mocks the GetFBCStats method. + GetFBCStatsFunc func() (nvml.FBCStats, nvml.Return) + + // GetFbUsageFunc mocks the GetFbUsage method. + GetFbUsageFunc func() (uint64, nvml.Return) + + // GetFrameRateLimitFunc mocks the GetFrameRateLimit method. + GetFrameRateLimitFunc func() (uint32, nvml.Return) + + // GetGpuInstanceIdFunc mocks the GetGpuInstanceId method. + GetGpuInstanceIdFunc func() (int, nvml.Return) + + // GetGpuPciIdFunc mocks the GetGpuPciId method. + GetGpuPciIdFunc func() (string, nvml.Return) + + // GetLicenseInfoFunc mocks the GetLicenseInfo method. + GetLicenseInfoFunc func() (nvml.VgpuLicenseInfo, nvml.Return) + + // GetLicenseStatusFunc mocks the GetLicenseStatus method. + GetLicenseStatusFunc func() (int, nvml.Return) + + // GetMdevUUIDFunc mocks the GetMdevUUID method. + GetMdevUUIDFunc func() (string, nvml.Return) + + // GetMetadataFunc mocks the GetMetadata method. + GetMetadataFunc func() (nvml.VgpuMetadata, nvml.Return) + + // GetTypeFunc mocks the GetType method. + GetTypeFunc func() (nvml.VgpuTypeId, nvml.Return) + + // GetUUIDFunc mocks the GetUUID method. + GetUUIDFunc func() (string, nvml.Return) + + // GetVmDriverVersionFunc mocks the GetVmDriverVersion method. + GetVmDriverVersionFunc func() (string, nvml.Return) + + // GetVmIDFunc mocks the GetVmID method. + GetVmIDFunc func() (string, nvml.VgpuVmIdType, nvml.Return) + + // SetEncoderCapacityFunc mocks the SetEncoderCapacity method. + SetEncoderCapacityFunc func(n int) nvml.Return + + // calls tracks calls to the methods. + calls struct { + // ClearAccountingPids holds details about calls to the ClearAccountingPids method. + ClearAccountingPids []struct { + } + // GetAccountingMode holds details about calls to the GetAccountingMode method. + GetAccountingMode []struct { + } + // GetAccountingPids holds details about calls to the GetAccountingPids method. + GetAccountingPids []struct { + } + // GetAccountingStats holds details about calls to the GetAccountingStats method. + GetAccountingStats []struct { + // N is the n argument value. + N int + } + // GetEccMode holds details about calls to the GetEccMode method. + GetEccMode []struct { + } + // GetEncoderCapacity holds details about calls to the GetEncoderCapacity method. + GetEncoderCapacity []struct { + } + // GetEncoderSessions holds details about calls to the GetEncoderSessions method. + GetEncoderSessions []struct { + } + // GetEncoderStats holds details about calls to the GetEncoderStats method. + GetEncoderStats []struct { + } + // GetFBCSessions holds details about calls to the GetFBCSessions method. + GetFBCSessions []struct { + } + // GetFBCStats holds details about calls to the GetFBCStats method. + GetFBCStats []struct { + } + // GetFbUsage holds details about calls to the GetFbUsage method. + GetFbUsage []struct { + } + // GetFrameRateLimit holds details about calls to the GetFrameRateLimit method. + GetFrameRateLimit []struct { + } + // GetGpuInstanceId holds details about calls to the GetGpuInstanceId method. + GetGpuInstanceId []struct { + } + // GetGpuPciId holds details about calls to the GetGpuPciId method. + GetGpuPciId []struct { + } + // GetLicenseInfo holds details about calls to the GetLicenseInfo method. + GetLicenseInfo []struct { + } + // GetLicenseStatus holds details about calls to the GetLicenseStatus method. + GetLicenseStatus []struct { + } + // GetMdevUUID holds details about calls to the GetMdevUUID method. + GetMdevUUID []struct { + } + // GetMetadata holds details about calls to the GetMetadata method. + GetMetadata []struct { + } + // GetType holds details about calls to the GetType method. + GetType []struct { + } + // GetUUID holds details about calls to the GetUUID method. + GetUUID []struct { + } + // GetVmDriverVersion holds details about calls to the GetVmDriverVersion method. + GetVmDriverVersion []struct { + } + // GetVmID holds details about calls to the GetVmID method. + GetVmID []struct { + } + // SetEncoderCapacity holds details about calls to the SetEncoderCapacity method. + SetEncoderCapacity []struct { + // N is the n argument value. + N int + } + } + lockClearAccountingPids sync.RWMutex + lockGetAccountingMode sync.RWMutex + lockGetAccountingPids sync.RWMutex + lockGetAccountingStats sync.RWMutex + lockGetEccMode sync.RWMutex + lockGetEncoderCapacity sync.RWMutex + lockGetEncoderSessions sync.RWMutex + lockGetEncoderStats sync.RWMutex + lockGetFBCSessions sync.RWMutex + lockGetFBCStats sync.RWMutex + lockGetFbUsage sync.RWMutex + lockGetFrameRateLimit sync.RWMutex + lockGetGpuInstanceId sync.RWMutex + lockGetGpuPciId sync.RWMutex + lockGetLicenseInfo sync.RWMutex + lockGetLicenseStatus sync.RWMutex + lockGetMdevUUID sync.RWMutex + lockGetMetadata sync.RWMutex + lockGetType sync.RWMutex + lockGetUUID sync.RWMutex + lockGetVmDriverVersion sync.RWMutex + lockGetVmID sync.RWMutex + lockSetEncoderCapacity sync.RWMutex +} + +// ClearAccountingPids calls ClearAccountingPidsFunc. +func (mock *VgpuInstance) ClearAccountingPids() nvml.Return { + if mock.ClearAccountingPidsFunc == nil { + panic("VgpuInstance.ClearAccountingPidsFunc: method is nil but VgpuInstance.ClearAccountingPids was just called") + } + callInfo := struct { + }{} + mock.lockClearAccountingPids.Lock() + mock.calls.ClearAccountingPids = append(mock.calls.ClearAccountingPids, callInfo) + mock.lockClearAccountingPids.Unlock() + return mock.ClearAccountingPidsFunc() +} + +// ClearAccountingPidsCalls gets all the calls that were made to ClearAccountingPids. +// Check the length with: +// +// len(mockedVgpuInstance.ClearAccountingPidsCalls()) +func (mock *VgpuInstance) ClearAccountingPidsCalls() []struct { +} { + var calls []struct { + } + mock.lockClearAccountingPids.RLock() + calls = mock.calls.ClearAccountingPids + mock.lockClearAccountingPids.RUnlock() + return calls +} + +// GetAccountingMode calls GetAccountingModeFunc. +func (mock *VgpuInstance) GetAccountingMode() (nvml.EnableState, nvml.Return) { + if mock.GetAccountingModeFunc == nil { + panic("VgpuInstance.GetAccountingModeFunc: method is nil but VgpuInstance.GetAccountingMode was just called") + } + callInfo := struct { + }{} + mock.lockGetAccountingMode.Lock() + mock.calls.GetAccountingMode = append(mock.calls.GetAccountingMode, callInfo) + mock.lockGetAccountingMode.Unlock() + return mock.GetAccountingModeFunc() +} + +// GetAccountingModeCalls gets all the calls that were made to GetAccountingMode. +// Check the length with: +// +// len(mockedVgpuInstance.GetAccountingModeCalls()) +func (mock *VgpuInstance) GetAccountingModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetAccountingMode.RLock() + calls = mock.calls.GetAccountingMode + mock.lockGetAccountingMode.RUnlock() + return calls +} + +// GetAccountingPids calls GetAccountingPidsFunc. +func (mock *VgpuInstance) GetAccountingPids() ([]int, nvml.Return) { + if mock.GetAccountingPidsFunc == nil { + panic("VgpuInstance.GetAccountingPidsFunc: method is nil but VgpuInstance.GetAccountingPids was just called") + } + callInfo := struct { + }{} + mock.lockGetAccountingPids.Lock() + mock.calls.GetAccountingPids = append(mock.calls.GetAccountingPids, callInfo) + mock.lockGetAccountingPids.Unlock() + return mock.GetAccountingPidsFunc() +} + +// GetAccountingPidsCalls gets all the calls that were made to GetAccountingPids. +// Check the length with: +// +// len(mockedVgpuInstance.GetAccountingPidsCalls()) +func (mock *VgpuInstance) GetAccountingPidsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetAccountingPids.RLock() + calls = mock.calls.GetAccountingPids + mock.lockGetAccountingPids.RUnlock() + return calls +} + +// GetAccountingStats calls GetAccountingStatsFunc. +func (mock *VgpuInstance) GetAccountingStats(n int) (nvml.AccountingStats, nvml.Return) { + if mock.GetAccountingStatsFunc == nil { + panic("VgpuInstance.GetAccountingStatsFunc: method is nil but VgpuInstance.GetAccountingStats was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetAccountingStats.Lock() + mock.calls.GetAccountingStats = append(mock.calls.GetAccountingStats, callInfo) + mock.lockGetAccountingStats.Unlock() + return mock.GetAccountingStatsFunc(n) +} + +// GetAccountingStatsCalls gets all the calls that were made to GetAccountingStats. +// Check the length with: +// +// len(mockedVgpuInstance.GetAccountingStatsCalls()) +func (mock *VgpuInstance) GetAccountingStatsCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetAccountingStats.RLock() + calls = mock.calls.GetAccountingStats + mock.lockGetAccountingStats.RUnlock() + return calls +} + +// GetEccMode calls GetEccModeFunc. +func (mock *VgpuInstance) GetEccMode() (nvml.EnableState, nvml.Return) { + if mock.GetEccModeFunc == nil { + panic("VgpuInstance.GetEccModeFunc: method is nil but VgpuInstance.GetEccMode was just called") + } + callInfo := struct { + }{} + mock.lockGetEccMode.Lock() + mock.calls.GetEccMode = append(mock.calls.GetEccMode, callInfo) + mock.lockGetEccMode.Unlock() + return mock.GetEccModeFunc() +} + +// GetEccModeCalls gets all the calls that were made to GetEccMode. +// Check the length with: +// +// len(mockedVgpuInstance.GetEccModeCalls()) +func (mock *VgpuInstance) GetEccModeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEccMode.RLock() + calls = mock.calls.GetEccMode + mock.lockGetEccMode.RUnlock() + return calls +} + +// GetEncoderCapacity calls GetEncoderCapacityFunc. +func (mock *VgpuInstance) GetEncoderCapacity() (int, nvml.Return) { + if mock.GetEncoderCapacityFunc == nil { + panic("VgpuInstance.GetEncoderCapacityFunc: method is nil but VgpuInstance.GetEncoderCapacity was just called") + } + callInfo := struct { + }{} + mock.lockGetEncoderCapacity.Lock() + mock.calls.GetEncoderCapacity = append(mock.calls.GetEncoderCapacity, callInfo) + mock.lockGetEncoderCapacity.Unlock() + return mock.GetEncoderCapacityFunc() +} + +// GetEncoderCapacityCalls gets all the calls that were made to GetEncoderCapacity. +// Check the length with: +// +// len(mockedVgpuInstance.GetEncoderCapacityCalls()) +func (mock *VgpuInstance) GetEncoderCapacityCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEncoderCapacity.RLock() + calls = mock.calls.GetEncoderCapacity + mock.lockGetEncoderCapacity.RUnlock() + return calls +} + +// GetEncoderSessions calls GetEncoderSessionsFunc. +func (mock *VgpuInstance) GetEncoderSessions() (int, nvml.EncoderSessionInfo, nvml.Return) { + if mock.GetEncoderSessionsFunc == nil { + panic("VgpuInstance.GetEncoderSessionsFunc: method is nil but VgpuInstance.GetEncoderSessions was just called") + } + callInfo := struct { + }{} + mock.lockGetEncoderSessions.Lock() + mock.calls.GetEncoderSessions = append(mock.calls.GetEncoderSessions, callInfo) + mock.lockGetEncoderSessions.Unlock() + return mock.GetEncoderSessionsFunc() +} + +// GetEncoderSessionsCalls gets all the calls that were made to GetEncoderSessions. +// Check the length with: +// +// len(mockedVgpuInstance.GetEncoderSessionsCalls()) +func (mock *VgpuInstance) GetEncoderSessionsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEncoderSessions.RLock() + calls = mock.calls.GetEncoderSessions + mock.lockGetEncoderSessions.RUnlock() + return calls +} + +// GetEncoderStats calls GetEncoderStatsFunc. +func (mock *VgpuInstance) GetEncoderStats() (int, uint32, uint32, nvml.Return) { + if mock.GetEncoderStatsFunc == nil { + panic("VgpuInstance.GetEncoderStatsFunc: method is nil but VgpuInstance.GetEncoderStats was just called") + } + callInfo := struct { + }{} + mock.lockGetEncoderStats.Lock() + mock.calls.GetEncoderStats = append(mock.calls.GetEncoderStats, callInfo) + mock.lockGetEncoderStats.Unlock() + return mock.GetEncoderStatsFunc() +} + +// GetEncoderStatsCalls gets all the calls that were made to GetEncoderStats. +// Check the length with: +// +// len(mockedVgpuInstance.GetEncoderStatsCalls()) +func (mock *VgpuInstance) GetEncoderStatsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetEncoderStats.RLock() + calls = mock.calls.GetEncoderStats + mock.lockGetEncoderStats.RUnlock() + return calls +} + +// GetFBCSessions calls GetFBCSessionsFunc. +func (mock *VgpuInstance) GetFBCSessions() (int, nvml.FBCSessionInfo, nvml.Return) { + if mock.GetFBCSessionsFunc == nil { + panic("VgpuInstance.GetFBCSessionsFunc: method is nil but VgpuInstance.GetFBCSessions was just called") + } + callInfo := struct { + }{} + mock.lockGetFBCSessions.Lock() + mock.calls.GetFBCSessions = append(mock.calls.GetFBCSessions, callInfo) + mock.lockGetFBCSessions.Unlock() + return mock.GetFBCSessionsFunc() +} + +// GetFBCSessionsCalls gets all the calls that were made to GetFBCSessions. +// Check the length with: +// +// len(mockedVgpuInstance.GetFBCSessionsCalls()) +func (mock *VgpuInstance) GetFBCSessionsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFBCSessions.RLock() + calls = mock.calls.GetFBCSessions + mock.lockGetFBCSessions.RUnlock() + return calls +} + +// GetFBCStats calls GetFBCStatsFunc. +func (mock *VgpuInstance) GetFBCStats() (nvml.FBCStats, nvml.Return) { + if mock.GetFBCStatsFunc == nil { + panic("VgpuInstance.GetFBCStatsFunc: method is nil but VgpuInstance.GetFBCStats was just called") + } + callInfo := struct { + }{} + mock.lockGetFBCStats.Lock() + mock.calls.GetFBCStats = append(mock.calls.GetFBCStats, callInfo) + mock.lockGetFBCStats.Unlock() + return mock.GetFBCStatsFunc() +} + +// GetFBCStatsCalls gets all the calls that were made to GetFBCStats. +// Check the length with: +// +// len(mockedVgpuInstance.GetFBCStatsCalls()) +func (mock *VgpuInstance) GetFBCStatsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFBCStats.RLock() + calls = mock.calls.GetFBCStats + mock.lockGetFBCStats.RUnlock() + return calls +} + +// GetFbUsage calls GetFbUsageFunc. +func (mock *VgpuInstance) GetFbUsage() (uint64, nvml.Return) { + if mock.GetFbUsageFunc == nil { + panic("VgpuInstance.GetFbUsageFunc: method is nil but VgpuInstance.GetFbUsage was just called") + } + callInfo := struct { + }{} + mock.lockGetFbUsage.Lock() + mock.calls.GetFbUsage = append(mock.calls.GetFbUsage, callInfo) + mock.lockGetFbUsage.Unlock() + return mock.GetFbUsageFunc() +} + +// GetFbUsageCalls gets all the calls that were made to GetFbUsage. +// Check the length with: +// +// len(mockedVgpuInstance.GetFbUsageCalls()) +func (mock *VgpuInstance) GetFbUsageCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFbUsage.RLock() + calls = mock.calls.GetFbUsage + mock.lockGetFbUsage.RUnlock() + return calls +} + +// GetFrameRateLimit calls GetFrameRateLimitFunc. +func (mock *VgpuInstance) GetFrameRateLimit() (uint32, nvml.Return) { + if mock.GetFrameRateLimitFunc == nil { + panic("VgpuInstance.GetFrameRateLimitFunc: method is nil but VgpuInstance.GetFrameRateLimit was just called") + } + callInfo := struct { + }{} + mock.lockGetFrameRateLimit.Lock() + mock.calls.GetFrameRateLimit = append(mock.calls.GetFrameRateLimit, callInfo) + mock.lockGetFrameRateLimit.Unlock() + return mock.GetFrameRateLimitFunc() +} + +// GetFrameRateLimitCalls gets all the calls that were made to GetFrameRateLimit. +// Check the length with: +// +// len(mockedVgpuInstance.GetFrameRateLimitCalls()) +func (mock *VgpuInstance) GetFrameRateLimitCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFrameRateLimit.RLock() + calls = mock.calls.GetFrameRateLimit + mock.lockGetFrameRateLimit.RUnlock() + return calls +} + +// GetGpuInstanceId calls GetGpuInstanceIdFunc. +func (mock *VgpuInstance) GetGpuInstanceId() (int, nvml.Return) { + if mock.GetGpuInstanceIdFunc == nil { + panic("VgpuInstance.GetGpuInstanceIdFunc: method is nil but VgpuInstance.GetGpuInstanceId was just called") + } + callInfo := struct { + }{} + mock.lockGetGpuInstanceId.Lock() + mock.calls.GetGpuInstanceId = append(mock.calls.GetGpuInstanceId, callInfo) + mock.lockGetGpuInstanceId.Unlock() + return mock.GetGpuInstanceIdFunc() +} + +// GetGpuInstanceIdCalls gets all the calls that were made to GetGpuInstanceId. +// Check the length with: +// +// len(mockedVgpuInstance.GetGpuInstanceIdCalls()) +func (mock *VgpuInstance) GetGpuInstanceIdCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpuInstanceId.RLock() + calls = mock.calls.GetGpuInstanceId + mock.lockGetGpuInstanceId.RUnlock() + return calls +} + +// GetGpuPciId calls GetGpuPciIdFunc. +func (mock *VgpuInstance) GetGpuPciId() (string, nvml.Return) { + if mock.GetGpuPciIdFunc == nil { + panic("VgpuInstance.GetGpuPciIdFunc: method is nil but VgpuInstance.GetGpuPciId was just called") + } + callInfo := struct { + }{} + mock.lockGetGpuPciId.Lock() + mock.calls.GetGpuPciId = append(mock.calls.GetGpuPciId, callInfo) + mock.lockGetGpuPciId.Unlock() + return mock.GetGpuPciIdFunc() +} + +// GetGpuPciIdCalls gets all the calls that were made to GetGpuPciId. +// Check the length with: +// +// len(mockedVgpuInstance.GetGpuPciIdCalls()) +func (mock *VgpuInstance) GetGpuPciIdCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpuPciId.RLock() + calls = mock.calls.GetGpuPciId + mock.lockGetGpuPciId.RUnlock() + return calls +} + +// GetLicenseInfo calls GetLicenseInfoFunc. +func (mock *VgpuInstance) GetLicenseInfo() (nvml.VgpuLicenseInfo, nvml.Return) { + if mock.GetLicenseInfoFunc == nil { + panic("VgpuInstance.GetLicenseInfoFunc: method is nil but VgpuInstance.GetLicenseInfo was just called") + } + callInfo := struct { + }{} + mock.lockGetLicenseInfo.Lock() + mock.calls.GetLicenseInfo = append(mock.calls.GetLicenseInfo, callInfo) + mock.lockGetLicenseInfo.Unlock() + return mock.GetLicenseInfoFunc() +} + +// GetLicenseInfoCalls gets all the calls that were made to GetLicenseInfo. +// Check the length with: +// +// len(mockedVgpuInstance.GetLicenseInfoCalls()) +func (mock *VgpuInstance) GetLicenseInfoCalls() []struct { +} { + var calls []struct { + } + mock.lockGetLicenseInfo.RLock() + calls = mock.calls.GetLicenseInfo + mock.lockGetLicenseInfo.RUnlock() + return calls +} + +// GetLicenseStatus calls GetLicenseStatusFunc. +func (mock *VgpuInstance) GetLicenseStatus() (int, nvml.Return) { + if mock.GetLicenseStatusFunc == nil { + panic("VgpuInstance.GetLicenseStatusFunc: method is nil but VgpuInstance.GetLicenseStatus was just called") + } + callInfo := struct { + }{} + mock.lockGetLicenseStatus.Lock() + mock.calls.GetLicenseStatus = append(mock.calls.GetLicenseStatus, callInfo) + mock.lockGetLicenseStatus.Unlock() + return mock.GetLicenseStatusFunc() +} + +// GetLicenseStatusCalls gets all the calls that were made to GetLicenseStatus. +// Check the length with: +// +// len(mockedVgpuInstance.GetLicenseStatusCalls()) +func (mock *VgpuInstance) GetLicenseStatusCalls() []struct { +} { + var calls []struct { + } + mock.lockGetLicenseStatus.RLock() + calls = mock.calls.GetLicenseStatus + mock.lockGetLicenseStatus.RUnlock() + return calls +} + +// GetMdevUUID calls GetMdevUUIDFunc. +func (mock *VgpuInstance) GetMdevUUID() (string, nvml.Return) { + if mock.GetMdevUUIDFunc == nil { + panic("VgpuInstance.GetMdevUUIDFunc: method is nil but VgpuInstance.GetMdevUUID was just called") + } + callInfo := struct { + }{} + mock.lockGetMdevUUID.Lock() + mock.calls.GetMdevUUID = append(mock.calls.GetMdevUUID, callInfo) + mock.lockGetMdevUUID.Unlock() + return mock.GetMdevUUIDFunc() +} + +// GetMdevUUIDCalls gets all the calls that were made to GetMdevUUID. +// Check the length with: +// +// len(mockedVgpuInstance.GetMdevUUIDCalls()) +func (mock *VgpuInstance) GetMdevUUIDCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMdevUUID.RLock() + calls = mock.calls.GetMdevUUID + mock.lockGetMdevUUID.RUnlock() + return calls +} + +// GetMetadata calls GetMetadataFunc. +func (mock *VgpuInstance) GetMetadata() (nvml.VgpuMetadata, nvml.Return) { + if mock.GetMetadataFunc == nil { + panic("VgpuInstance.GetMetadataFunc: method is nil but VgpuInstance.GetMetadata was just called") + } + callInfo := struct { + }{} + mock.lockGetMetadata.Lock() + mock.calls.GetMetadata = append(mock.calls.GetMetadata, callInfo) + mock.lockGetMetadata.Unlock() + return mock.GetMetadataFunc() +} + +// GetMetadataCalls gets all the calls that were made to GetMetadata. +// Check the length with: +// +// len(mockedVgpuInstance.GetMetadataCalls()) +func (mock *VgpuInstance) GetMetadataCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMetadata.RLock() + calls = mock.calls.GetMetadata + mock.lockGetMetadata.RUnlock() + return calls +} + +// GetType calls GetTypeFunc. +func (mock *VgpuInstance) GetType() (nvml.VgpuTypeId, nvml.Return) { + if mock.GetTypeFunc == nil { + panic("VgpuInstance.GetTypeFunc: method is nil but VgpuInstance.GetType was just called") + } + callInfo := struct { + }{} + mock.lockGetType.Lock() + mock.calls.GetType = append(mock.calls.GetType, callInfo) + mock.lockGetType.Unlock() + return mock.GetTypeFunc() +} + +// GetTypeCalls gets all the calls that were made to GetType. +// Check the length with: +// +// len(mockedVgpuInstance.GetTypeCalls()) +func (mock *VgpuInstance) GetTypeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetType.RLock() + calls = mock.calls.GetType + mock.lockGetType.RUnlock() + return calls +} + +// GetUUID calls GetUUIDFunc. +func (mock *VgpuInstance) GetUUID() (string, nvml.Return) { + if mock.GetUUIDFunc == nil { + panic("VgpuInstance.GetUUIDFunc: method is nil but VgpuInstance.GetUUID was just called") + } + callInfo := struct { + }{} + mock.lockGetUUID.Lock() + mock.calls.GetUUID = append(mock.calls.GetUUID, callInfo) + mock.lockGetUUID.Unlock() + return mock.GetUUIDFunc() +} + +// GetUUIDCalls gets all the calls that were made to GetUUID. +// Check the length with: +// +// len(mockedVgpuInstance.GetUUIDCalls()) +func (mock *VgpuInstance) GetUUIDCalls() []struct { +} { + var calls []struct { + } + mock.lockGetUUID.RLock() + calls = mock.calls.GetUUID + mock.lockGetUUID.RUnlock() + return calls +} + +// GetVmDriverVersion calls GetVmDriverVersionFunc. +func (mock *VgpuInstance) GetVmDriverVersion() (string, nvml.Return) { + if mock.GetVmDriverVersionFunc == nil { + panic("VgpuInstance.GetVmDriverVersionFunc: method is nil but VgpuInstance.GetVmDriverVersion was just called") + } + callInfo := struct { + }{} + mock.lockGetVmDriverVersion.Lock() + mock.calls.GetVmDriverVersion = append(mock.calls.GetVmDriverVersion, callInfo) + mock.lockGetVmDriverVersion.Unlock() + return mock.GetVmDriverVersionFunc() +} + +// GetVmDriverVersionCalls gets all the calls that were made to GetVmDriverVersion. +// Check the length with: +// +// len(mockedVgpuInstance.GetVmDriverVersionCalls()) +func (mock *VgpuInstance) GetVmDriverVersionCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVmDriverVersion.RLock() + calls = mock.calls.GetVmDriverVersion + mock.lockGetVmDriverVersion.RUnlock() + return calls +} + +// GetVmID calls GetVmIDFunc. +func (mock *VgpuInstance) GetVmID() (string, nvml.VgpuVmIdType, nvml.Return) { + if mock.GetVmIDFunc == nil { + panic("VgpuInstance.GetVmIDFunc: method is nil but VgpuInstance.GetVmID was just called") + } + callInfo := struct { + }{} + mock.lockGetVmID.Lock() + mock.calls.GetVmID = append(mock.calls.GetVmID, callInfo) + mock.lockGetVmID.Unlock() + return mock.GetVmIDFunc() +} + +// GetVmIDCalls gets all the calls that were made to GetVmID. +// Check the length with: +// +// len(mockedVgpuInstance.GetVmIDCalls()) +func (mock *VgpuInstance) GetVmIDCalls() []struct { +} { + var calls []struct { + } + mock.lockGetVmID.RLock() + calls = mock.calls.GetVmID + mock.lockGetVmID.RUnlock() + return calls +} + +// SetEncoderCapacity calls SetEncoderCapacityFunc. +func (mock *VgpuInstance) SetEncoderCapacity(n int) nvml.Return { + if mock.SetEncoderCapacityFunc == nil { + panic("VgpuInstance.SetEncoderCapacityFunc: method is nil but VgpuInstance.SetEncoderCapacity was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockSetEncoderCapacity.Lock() + mock.calls.SetEncoderCapacity = append(mock.calls.SetEncoderCapacity, callInfo) + mock.lockSetEncoderCapacity.Unlock() + return mock.SetEncoderCapacityFunc(n) +} + +// SetEncoderCapacityCalls gets all the calls that were made to SetEncoderCapacity. +// Check the length with: +// +// len(mockedVgpuInstance.SetEncoderCapacityCalls()) +func (mock *VgpuInstance) SetEncoderCapacityCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockSetEncoderCapacity.RLock() + calls = mock.calls.SetEncoderCapacity + mock.lockSetEncoderCapacity.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/vgputypeid.go b/pkg/nvml/mock/vgputypeid.go new file mode 100644 index 0000000..c838c3b --- /dev/null +++ b/pkg/nvml/mock/vgputypeid.go @@ -0,0 +1,496 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that VgpuTypeId does implement nvml.VgpuTypeId. +// If this is not the case, regenerate this file with moq. +var _ nvml.VgpuTypeId = &VgpuTypeId{} + +// VgpuTypeId is a mock implementation of nvml.VgpuTypeId. +// +// func TestSomethingThatUsesVgpuTypeId(t *testing.T) { +// +// // make and configure a mocked nvml.VgpuTypeId +// mockedVgpuTypeId := &VgpuTypeId{ +// GetCapabilitiesFunc: func(vgpuCapability nvml.VgpuCapability) (bool, nvml.Return) { +// panic("mock out the GetCapabilities method") +// }, +// GetClassFunc: func() (string, nvml.Return) { +// panic("mock out the GetClass method") +// }, +// GetDeviceIDFunc: func() (uint64, uint64, nvml.Return) { +// panic("mock out the GetDeviceID method") +// }, +// GetFrameRateLimitFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetFrameRateLimit method") +// }, +// GetFramebufferSizeFunc: func() (uint64, nvml.Return) { +// panic("mock out the GetFramebufferSize method") +// }, +// GetGpuInstanceProfileIdFunc: func() (uint32, nvml.Return) { +// panic("mock out the GetGpuInstanceProfileId method") +// }, +// GetLicenseFunc: func() (string, nvml.Return) { +// panic("mock out the GetLicense method") +// }, +// GetMaxInstancesFunc: func(device nvml.Device) (int, nvml.Return) { +// panic("mock out the GetMaxInstances method") +// }, +// GetMaxInstancesPerVmFunc: func() (int, nvml.Return) { +// panic("mock out the GetMaxInstancesPerVm method") +// }, +// GetNameFunc: func() (string, nvml.Return) { +// panic("mock out the GetName method") +// }, +// GetNumDisplayHeadsFunc: func() (int, nvml.Return) { +// panic("mock out the GetNumDisplayHeads method") +// }, +// GetResolutionFunc: func(n int) (uint32, uint32, nvml.Return) { +// panic("mock out the GetResolution method") +// }, +// } +// +// // use mockedVgpuTypeId in code that requires nvml.VgpuTypeId +// // and then make assertions. +// +// } +type VgpuTypeId struct { + // GetCapabilitiesFunc mocks the GetCapabilities method. + GetCapabilitiesFunc func(vgpuCapability nvml.VgpuCapability) (bool, nvml.Return) + + // GetClassFunc mocks the GetClass method. + GetClassFunc func() (string, nvml.Return) + + // GetDeviceIDFunc mocks the GetDeviceID method. + GetDeviceIDFunc func() (uint64, uint64, nvml.Return) + + // GetFrameRateLimitFunc mocks the GetFrameRateLimit method. + GetFrameRateLimitFunc func() (uint32, nvml.Return) + + // GetFramebufferSizeFunc mocks the GetFramebufferSize method. + GetFramebufferSizeFunc func() (uint64, nvml.Return) + + // GetGpuInstanceProfileIdFunc mocks the GetGpuInstanceProfileId method. + GetGpuInstanceProfileIdFunc func() (uint32, nvml.Return) + + // GetLicenseFunc mocks the GetLicense method. + GetLicenseFunc func() (string, nvml.Return) + + // GetMaxInstancesFunc mocks the GetMaxInstances method. + GetMaxInstancesFunc func(device nvml.Device) (int, nvml.Return) + + // GetMaxInstancesPerVmFunc mocks the GetMaxInstancesPerVm method. + GetMaxInstancesPerVmFunc func() (int, nvml.Return) + + // GetNameFunc mocks the GetName method. + GetNameFunc func() (string, nvml.Return) + + // GetNumDisplayHeadsFunc mocks the GetNumDisplayHeads method. + GetNumDisplayHeadsFunc func() (int, nvml.Return) + + // GetResolutionFunc mocks the GetResolution method. + GetResolutionFunc func(n int) (uint32, uint32, nvml.Return) + + // calls tracks calls to the methods. + calls struct { + // GetCapabilities holds details about calls to the GetCapabilities method. + GetCapabilities []struct { + // VgpuCapability is the vgpuCapability argument value. + VgpuCapability nvml.VgpuCapability + } + // GetClass holds details about calls to the GetClass method. + GetClass []struct { + } + // GetDeviceID holds details about calls to the GetDeviceID method. + GetDeviceID []struct { + } + // GetFrameRateLimit holds details about calls to the GetFrameRateLimit method. + GetFrameRateLimit []struct { + } + // GetFramebufferSize holds details about calls to the GetFramebufferSize method. + GetFramebufferSize []struct { + } + // GetGpuInstanceProfileId holds details about calls to the GetGpuInstanceProfileId method. + GetGpuInstanceProfileId []struct { + } + // GetLicense holds details about calls to the GetLicense method. + GetLicense []struct { + } + // GetMaxInstances holds details about calls to the GetMaxInstances method. + GetMaxInstances []struct { + // Device is the device argument value. + Device nvml.Device + } + // GetMaxInstancesPerVm holds details about calls to the GetMaxInstancesPerVm method. + GetMaxInstancesPerVm []struct { + } + // GetName holds details about calls to the GetName method. + GetName []struct { + } + // GetNumDisplayHeads holds details about calls to the GetNumDisplayHeads method. + GetNumDisplayHeads []struct { + } + // GetResolution holds details about calls to the GetResolution method. + GetResolution []struct { + // N is the n argument value. + N int + } + } + lockGetCapabilities sync.RWMutex + lockGetClass sync.RWMutex + lockGetDeviceID sync.RWMutex + lockGetFrameRateLimit sync.RWMutex + lockGetFramebufferSize sync.RWMutex + lockGetGpuInstanceProfileId sync.RWMutex + lockGetLicense sync.RWMutex + lockGetMaxInstances sync.RWMutex + lockGetMaxInstancesPerVm sync.RWMutex + lockGetName sync.RWMutex + lockGetNumDisplayHeads sync.RWMutex + lockGetResolution sync.RWMutex +} + +// GetCapabilities calls GetCapabilitiesFunc. +func (mock *VgpuTypeId) GetCapabilities(vgpuCapability nvml.VgpuCapability) (bool, nvml.Return) { + if mock.GetCapabilitiesFunc == nil { + panic("VgpuTypeId.GetCapabilitiesFunc: method is nil but VgpuTypeId.GetCapabilities was just called") + } + callInfo := struct { + VgpuCapability nvml.VgpuCapability + }{ + VgpuCapability: vgpuCapability, + } + mock.lockGetCapabilities.Lock() + mock.calls.GetCapabilities = append(mock.calls.GetCapabilities, callInfo) + mock.lockGetCapabilities.Unlock() + return mock.GetCapabilitiesFunc(vgpuCapability) +} + +// GetCapabilitiesCalls gets all the calls that were made to GetCapabilities. +// Check the length with: +// +// len(mockedVgpuTypeId.GetCapabilitiesCalls()) +func (mock *VgpuTypeId) GetCapabilitiesCalls() []struct { + VgpuCapability nvml.VgpuCapability +} { + var calls []struct { + VgpuCapability nvml.VgpuCapability + } + mock.lockGetCapabilities.RLock() + calls = mock.calls.GetCapabilities + mock.lockGetCapabilities.RUnlock() + return calls +} + +// GetClass calls GetClassFunc. +func (mock *VgpuTypeId) GetClass() (string, nvml.Return) { + if mock.GetClassFunc == nil { + panic("VgpuTypeId.GetClassFunc: method is nil but VgpuTypeId.GetClass was just called") + } + callInfo := struct { + }{} + mock.lockGetClass.Lock() + mock.calls.GetClass = append(mock.calls.GetClass, callInfo) + mock.lockGetClass.Unlock() + return mock.GetClassFunc() +} + +// GetClassCalls gets all the calls that were made to GetClass. +// Check the length with: +// +// len(mockedVgpuTypeId.GetClassCalls()) +func (mock *VgpuTypeId) GetClassCalls() []struct { +} { + var calls []struct { + } + mock.lockGetClass.RLock() + calls = mock.calls.GetClass + mock.lockGetClass.RUnlock() + return calls +} + +// GetDeviceID calls GetDeviceIDFunc. +func (mock *VgpuTypeId) GetDeviceID() (uint64, uint64, nvml.Return) { + if mock.GetDeviceIDFunc == nil { + panic("VgpuTypeId.GetDeviceIDFunc: method is nil but VgpuTypeId.GetDeviceID was just called") + } + callInfo := struct { + }{} + mock.lockGetDeviceID.Lock() + mock.calls.GetDeviceID = append(mock.calls.GetDeviceID, callInfo) + mock.lockGetDeviceID.Unlock() + return mock.GetDeviceIDFunc() +} + +// GetDeviceIDCalls gets all the calls that were made to GetDeviceID. +// Check the length with: +// +// len(mockedVgpuTypeId.GetDeviceIDCalls()) +func (mock *VgpuTypeId) GetDeviceIDCalls() []struct { +} { + var calls []struct { + } + mock.lockGetDeviceID.RLock() + calls = mock.calls.GetDeviceID + mock.lockGetDeviceID.RUnlock() + return calls +} + +// GetFrameRateLimit calls GetFrameRateLimitFunc. +func (mock *VgpuTypeId) GetFrameRateLimit() (uint32, nvml.Return) { + if mock.GetFrameRateLimitFunc == nil { + panic("VgpuTypeId.GetFrameRateLimitFunc: method is nil but VgpuTypeId.GetFrameRateLimit was just called") + } + callInfo := struct { + }{} + mock.lockGetFrameRateLimit.Lock() + mock.calls.GetFrameRateLimit = append(mock.calls.GetFrameRateLimit, callInfo) + mock.lockGetFrameRateLimit.Unlock() + return mock.GetFrameRateLimitFunc() +} + +// GetFrameRateLimitCalls gets all the calls that were made to GetFrameRateLimit. +// Check the length with: +// +// len(mockedVgpuTypeId.GetFrameRateLimitCalls()) +func (mock *VgpuTypeId) GetFrameRateLimitCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFrameRateLimit.RLock() + calls = mock.calls.GetFrameRateLimit + mock.lockGetFrameRateLimit.RUnlock() + return calls +} + +// GetFramebufferSize calls GetFramebufferSizeFunc. +func (mock *VgpuTypeId) GetFramebufferSize() (uint64, nvml.Return) { + if mock.GetFramebufferSizeFunc == nil { + panic("VgpuTypeId.GetFramebufferSizeFunc: method is nil but VgpuTypeId.GetFramebufferSize was just called") + } + callInfo := struct { + }{} + mock.lockGetFramebufferSize.Lock() + mock.calls.GetFramebufferSize = append(mock.calls.GetFramebufferSize, callInfo) + mock.lockGetFramebufferSize.Unlock() + return mock.GetFramebufferSizeFunc() +} + +// GetFramebufferSizeCalls gets all the calls that were made to GetFramebufferSize. +// Check the length with: +// +// len(mockedVgpuTypeId.GetFramebufferSizeCalls()) +func (mock *VgpuTypeId) GetFramebufferSizeCalls() []struct { +} { + var calls []struct { + } + mock.lockGetFramebufferSize.RLock() + calls = mock.calls.GetFramebufferSize + mock.lockGetFramebufferSize.RUnlock() + return calls +} + +// GetGpuInstanceProfileId calls GetGpuInstanceProfileIdFunc. +func (mock *VgpuTypeId) GetGpuInstanceProfileId() (uint32, nvml.Return) { + if mock.GetGpuInstanceProfileIdFunc == nil { + panic("VgpuTypeId.GetGpuInstanceProfileIdFunc: method is nil but VgpuTypeId.GetGpuInstanceProfileId was just called") + } + callInfo := struct { + }{} + mock.lockGetGpuInstanceProfileId.Lock() + mock.calls.GetGpuInstanceProfileId = append(mock.calls.GetGpuInstanceProfileId, callInfo) + mock.lockGetGpuInstanceProfileId.Unlock() + return mock.GetGpuInstanceProfileIdFunc() +} + +// GetGpuInstanceProfileIdCalls gets all the calls that were made to GetGpuInstanceProfileId. +// Check the length with: +// +// len(mockedVgpuTypeId.GetGpuInstanceProfileIdCalls()) +func (mock *VgpuTypeId) GetGpuInstanceProfileIdCalls() []struct { +} { + var calls []struct { + } + mock.lockGetGpuInstanceProfileId.RLock() + calls = mock.calls.GetGpuInstanceProfileId + mock.lockGetGpuInstanceProfileId.RUnlock() + return calls +} + +// GetLicense calls GetLicenseFunc. +func (mock *VgpuTypeId) GetLicense() (string, nvml.Return) { + if mock.GetLicenseFunc == nil { + panic("VgpuTypeId.GetLicenseFunc: method is nil but VgpuTypeId.GetLicense was just called") + } + callInfo := struct { + }{} + mock.lockGetLicense.Lock() + mock.calls.GetLicense = append(mock.calls.GetLicense, callInfo) + mock.lockGetLicense.Unlock() + return mock.GetLicenseFunc() +} + +// GetLicenseCalls gets all the calls that were made to GetLicense. +// Check the length with: +// +// len(mockedVgpuTypeId.GetLicenseCalls()) +func (mock *VgpuTypeId) GetLicenseCalls() []struct { +} { + var calls []struct { + } + mock.lockGetLicense.RLock() + calls = mock.calls.GetLicense + mock.lockGetLicense.RUnlock() + return calls +} + +// GetMaxInstances calls GetMaxInstancesFunc. +func (mock *VgpuTypeId) GetMaxInstances(device nvml.Device) (int, nvml.Return) { + if mock.GetMaxInstancesFunc == nil { + panic("VgpuTypeId.GetMaxInstancesFunc: method is nil but VgpuTypeId.GetMaxInstances was just called") + } + callInfo := struct { + Device nvml.Device + }{ + Device: device, + } + mock.lockGetMaxInstances.Lock() + mock.calls.GetMaxInstances = append(mock.calls.GetMaxInstances, callInfo) + mock.lockGetMaxInstances.Unlock() + return mock.GetMaxInstancesFunc(device) +} + +// GetMaxInstancesCalls gets all the calls that were made to GetMaxInstances. +// Check the length with: +// +// len(mockedVgpuTypeId.GetMaxInstancesCalls()) +func (mock *VgpuTypeId) GetMaxInstancesCalls() []struct { + Device nvml.Device +} { + var calls []struct { + Device nvml.Device + } + mock.lockGetMaxInstances.RLock() + calls = mock.calls.GetMaxInstances + mock.lockGetMaxInstances.RUnlock() + return calls +} + +// GetMaxInstancesPerVm calls GetMaxInstancesPerVmFunc. +func (mock *VgpuTypeId) GetMaxInstancesPerVm() (int, nvml.Return) { + if mock.GetMaxInstancesPerVmFunc == nil { + panic("VgpuTypeId.GetMaxInstancesPerVmFunc: method is nil but VgpuTypeId.GetMaxInstancesPerVm was just called") + } + callInfo := struct { + }{} + mock.lockGetMaxInstancesPerVm.Lock() + mock.calls.GetMaxInstancesPerVm = append(mock.calls.GetMaxInstancesPerVm, callInfo) + mock.lockGetMaxInstancesPerVm.Unlock() + return mock.GetMaxInstancesPerVmFunc() +} + +// GetMaxInstancesPerVmCalls gets all the calls that were made to GetMaxInstancesPerVm. +// Check the length with: +// +// len(mockedVgpuTypeId.GetMaxInstancesPerVmCalls()) +func (mock *VgpuTypeId) GetMaxInstancesPerVmCalls() []struct { +} { + var calls []struct { + } + mock.lockGetMaxInstancesPerVm.RLock() + calls = mock.calls.GetMaxInstancesPerVm + mock.lockGetMaxInstancesPerVm.RUnlock() + return calls +} + +// GetName calls GetNameFunc. +func (mock *VgpuTypeId) GetName() (string, nvml.Return) { + if mock.GetNameFunc == nil { + panic("VgpuTypeId.GetNameFunc: method is nil but VgpuTypeId.GetName was just called") + } + callInfo := struct { + }{} + mock.lockGetName.Lock() + mock.calls.GetName = append(mock.calls.GetName, callInfo) + mock.lockGetName.Unlock() + return mock.GetNameFunc() +} + +// GetNameCalls gets all the calls that were made to GetName. +// Check the length with: +// +// len(mockedVgpuTypeId.GetNameCalls()) +func (mock *VgpuTypeId) GetNameCalls() []struct { +} { + var calls []struct { + } + mock.lockGetName.RLock() + calls = mock.calls.GetName + mock.lockGetName.RUnlock() + return calls +} + +// GetNumDisplayHeads calls GetNumDisplayHeadsFunc. +func (mock *VgpuTypeId) GetNumDisplayHeads() (int, nvml.Return) { + if mock.GetNumDisplayHeadsFunc == nil { + panic("VgpuTypeId.GetNumDisplayHeadsFunc: method is nil but VgpuTypeId.GetNumDisplayHeads was just called") + } + callInfo := struct { + }{} + mock.lockGetNumDisplayHeads.Lock() + mock.calls.GetNumDisplayHeads = append(mock.calls.GetNumDisplayHeads, callInfo) + mock.lockGetNumDisplayHeads.Unlock() + return mock.GetNumDisplayHeadsFunc() +} + +// GetNumDisplayHeadsCalls gets all the calls that were made to GetNumDisplayHeads. +// Check the length with: +// +// len(mockedVgpuTypeId.GetNumDisplayHeadsCalls()) +func (mock *VgpuTypeId) GetNumDisplayHeadsCalls() []struct { +} { + var calls []struct { + } + mock.lockGetNumDisplayHeads.RLock() + calls = mock.calls.GetNumDisplayHeads + mock.lockGetNumDisplayHeads.RUnlock() + return calls +} + +// GetResolution calls GetResolutionFunc. +func (mock *VgpuTypeId) GetResolution(n int) (uint32, uint32, nvml.Return) { + if mock.GetResolutionFunc == nil { + panic("VgpuTypeId.GetResolutionFunc: method is nil but VgpuTypeId.GetResolution was just called") + } + callInfo := struct { + N int + }{ + N: n, + } + mock.lockGetResolution.Lock() + mock.calls.GetResolution = append(mock.calls.GetResolution, callInfo) + mock.lockGetResolution.Unlock() + return mock.GetResolutionFunc(n) +} + +// GetResolutionCalls gets all the calls that were made to GetResolution. +// Check the length with: +// +// len(mockedVgpuTypeId.GetResolutionCalls()) +func (mock *VgpuTypeId) GetResolutionCalls() []struct { + N int +} { + var calls []struct { + N int + } + mock.lockGetResolution.RLock() + calls = mock.calls.GetResolution + mock.lockGetResolution.RUnlock() + return calls +} diff --git a/pkg/nvml/zz_generated.api.go b/pkg/nvml/zz_generated.api.go index 1758ead..76bf64b 100644 --- a/pkg/nvml/zz_generated.api.go +++ b/pkg/nvml/zz_generated.api.go @@ -314,6 +314,8 @@ var ( ) // 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) @@ -609,6 +611,8 @@ type Interface interface { } // 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 @@ -814,6 +818,8 @@ type Device interface { } // 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) @@ -828,18 +834,24 @@ type GpuInstance interface { } // 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 @@ -847,6 +859,8 @@ type GpmSample interface { } // 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) @@ -858,6 +872,8 @@ type Unit interface { } // 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) @@ -885,6 +901,8 @@ type VgpuInstance interface { } // 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) From d72aa68f8ac0353eec7276e48766597666f81db8 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Fri, 12 Apr 2024 10:05:24 +0000 Subject: [PATCH 20/21] Add a mock DGXA100 server that implements parts of the NVML interface This code was pulled over (mostly) directly from 'mig-parted' Signed-off-by: Kevin Klues --- go.mod | 5 +- go.sum | 2 + pkg/nvml/mock/dgxa100/dgxa100.go | 565 +++++++++++++++++++++++++++++++ 3 files changed, 571 insertions(+), 1 deletion(-) create mode 100644 pkg/nvml/mock/dgxa100/dgxa100.go diff --git a/go.mod b/go.mod index 80fb5c4..9599f5f 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,10 @@ module github.com/NVIDIA/go-nvml go 1.20 -require github.com/stretchr/testify v1.9.0 +require ( + github.com/google/uuid v1.6.0 + github.com/stretchr/testify v1.9.0 +) require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index 60ce688..5697539 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= diff --git a/pkg/nvml/mock/dgxa100/dgxa100.go b/pkg/nvml/mock/dgxa100/dgxa100.go new file mode 100644 index 0000000..0188a03 --- /dev/null +++ b/pkg/nvml/mock/dgxa100/dgxa100.go @@ -0,0 +1,565 @@ +/* + * Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + * + * 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. + */ + +package dgxa100 + +import ( + "fmt" + + "github.com/NVIDIA/go-nvml/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml/mock" + "github.com/google/uuid" +) + +type Server struct { + mock.Interface + Devices [8]nvml.Device +} +type Device struct { + mock.Device + UUID string + PciBusID string + Index int + MigMode int + GpuInstances map[*GpuInstance]struct{} + GpuInstanceCounter uint32 + MemoryInfo nvml.Memory +} +type GpuInstance struct { + mock.GpuInstance + Info nvml.GpuInstanceInfo + ComputeInstances map[*ComputeInstance]struct{} + ComputeInstanceCounter uint32 +} +type ComputeInstance struct { + mock.ComputeInstance + Info nvml.ComputeInstanceInfo +} + +var _ nvml.Interface = (*Server)(nil) +var _ nvml.Device = (*Device)(nil) +var _ nvml.GpuInstance = (*GpuInstance)(nil) +var _ nvml.ComputeInstance = (*ComputeInstance)(nil) + +var MIGProfiles = struct { + GpuInstanceProfiles map[int]nvml.GpuInstanceProfileInfo + ComputeInstanceProfiles map[int]map[int]nvml.ComputeInstanceProfileInfo +}{ + GpuInstanceProfiles: map[int]nvml.GpuInstanceProfileInfo{ + nvml.GPU_INSTANCE_PROFILE_1_SLICE: { + Id: nvml.GPU_INSTANCE_PROFILE_1_SLICE, + IsP2pSupported: 0, + SliceCount: 1, + InstanceCount: 7, + MultiprocessorCount: 1, + CopyEngineCount: 1, + DecoderCount: 0, + EncoderCount: 0, + JpegCount: 0, + OfaCount: 0, + MemorySizeMB: 5120, + }, + nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1: { + Id: nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1, + IsP2pSupported: 0, + SliceCount: 1, + InstanceCount: 1, + MultiprocessorCount: 1, + CopyEngineCount: 1, + DecoderCount: 1, + EncoderCount: 1, + JpegCount: 1, + OfaCount: 1, + MemorySizeMB: 5120, + }, + nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2: { + Id: nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2, + IsP2pSupported: 0, + SliceCount: 1, + InstanceCount: 4, + MultiprocessorCount: 1, + CopyEngineCount: 1, + DecoderCount: 0, + EncoderCount: 0, + JpegCount: 0, + OfaCount: 0, + MemorySizeMB: 10240, + }, + nvml.GPU_INSTANCE_PROFILE_2_SLICE: { + Id: nvml.GPU_INSTANCE_PROFILE_2_SLICE, + IsP2pSupported: 0, + SliceCount: 2, + InstanceCount: 3, + MultiprocessorCount: 2, + CopyEngineCount: 2, + DecoderCount: 1, + EncoderCount: 1, + JpegCount: 0, + OfaCount: 0, + MemorySizeMB: 10240, + }, + nvml.GPU_INSTANCE_PROFILE_3_SLICE: { + Id: nvml.GPU_INSTANCE_PROFILE_3_SLICE, + IsP2pSupported: 0, + SliceCount: 3, + InstanceCount: 2, + MultiprocessorCount: 3, + CopyEngineCount: 4, + DecoderCount: 2, + EncoderCount: 2, + JpegCount: 0, + OfaCount: 0, + MemorySizeMB: 20480, + }, + nvml.GPU_INSTANCE_PROFILE_4_SLICE: { + Id: nvml.GPU_INSTANCE_PROFILE_4_SLICE, + IsP2pSupported: 0, + SliceCount: 4, + InstanceCount: 1, + MultiprocessorCount: 4, + CopyEngineCount: 4, + DecoderCount: 2, + EncoderCount: 2, + JpegCount: 0, + OfaCount: 0, + MemorySizeMB: 20480, + }, + nvml.GPU_INSTANCE_PROFILE_7_SLICE: { + Id: nvml.GPU_INSTANCE_PROFILE_7_SLICE, + IsP2pSupported: 0, + SliceCount: 7, + InstanceCount: 1, + MultiprocessorCount: 7, + CopyEngineCount: 8, + DecoderCount: 5, + EncoderCount: 5, + JpegCount: 1, + OfaCount: 1, + MemorySizeMB: 40960, + }, + }, + ComputeInstanceProfiles: map[int]map[int]nvml.ComputeInstanceProfileInfo{ + nvml.GPU_INSTANCE_PROFILE_1_SLICE: { + nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE, + SliceCount: 1, + InstanceCount: 1, + MultiprocessorCount: 1, + SharedCopyEngineCount: 1, + SharedDecoderCount: 0, + SharedEncoderCount: 0, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + }, + nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1: { + nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE, + SliceCount: 1, + InstanceCount: 1, + MultiprocessorCount: 1, + SharedCopyEngineCount: 1, + SharedDecoderCount: 1, + SharedEncoderCount: 1, + SharedJpegCount: 1, + SharedOfaCount: 1, + }, + }, + nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2: { + nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE, + SliceCount: 1, + InstanceCount: 1, + MultiprocessorCount: 1, + SharedCopyEngineCount: 1, + SharedDecoderCount: 0, + SharedEncoderCount: 0, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + }, + nvml.GPU_INSTANCE_PROFILE_2_SLICE: { + nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE, + SliceCount: 1, + InstanceCount: 2, + MultiprocessorCount: 1, + SharedCopyEngineCount: 2, + SharedDecoderCount: 1, + SharedEncoderCount: 1, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE, + SliceCount: 2, + InstanceCount: 1, + MultiprocessorCount: 2, + SharedCopyEngineCount: 2, + SharedDecoderCount: 1, + SharedEncoderCount: 1, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + }, + nvml.GPU_INSTANCE_PROFILE_3_SLICE: { + nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE, + SliceCount: 1, + InstanceCount: 3, + MultiprocessorCount: 1, + SharedCopyEngineCount: 4, + SharedDecoderCount: 2, + SharedEncoderCount: 1, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE, + SliceCount: 2, + InstanceCount: 1, + MultiprocessorCount: 2, + SharedCopyEngineCount: 4, + SharedDecoderCount: 2, + SharedEncoderCount: 2, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE, + SliceCount: 3, + InstanceCount: 1, + MultiprocessorCount: 3, + SharedCopyEngineCount: 4, + SharedDecoderCount: 2, + SharedEncoderCount: 0, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + }, + nvml.GPU_INSTANCE_PROFILE_4_SLICE: { + nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE, + SliceCount: 1, + InstanceCount: 4, + MultiprocessorCount: 1, + SharedCopyEngineCount: 4, + SharedDecoderCount: 2, + SharedEncoderCount: 2, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE, + SliceCount: 2, + InstanceCount: 2, + MultiprocessorCount: 2, + SharedCopyEngineCount: 4, + SharedDecoderCount: 2, + SharedEncoderCount: 2, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE, + SliceCount: 4, + InstanceCount: 1, + MultiprocessorCount: 4, + SharedCopyEngineCount: 4, + SharedDecoderCount: 2, + SharedEncoderCount: 2, + SharedJpegCount: 0, + SharedOfaCount: 0, + }, + }, + nvml.GPU_INSTANCE_PROFILE_7_SLICE: { + nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE, + SliceCount: 1, + InstanceCount: 7, + MultiprocessorCount: 1, + SharedCopyEngineCount: 8, + SharedDecoderCount: 5, + SharedEncoderCount: 5, + SharedJpegCount: 1, + SharedOfaCount: 1, + }, + nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE, + SliceCount: 2, + InstanceCount: 3, + MultiprocessorCount: 2, + SharedCopyEngineCount: 8, + SharedDecoderCount: 5, + SharedEncoderCount: 5, + SharedJpegCount: 1, + SharedOfaCount: 1, + }, + nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE, + SliceCount: 3, + InstanceCount: 2, + MultiprocessorCount: 3, + SharedCopyEngineCount: 8, + SharedDecoderCount: 5, + SharedEncoderCount: 5, + SharedJpegCount: 1, + SharedOfaCount: 1, + }, + nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE, + SliceCount: 4, + InstanceCount: 1, + MultiprocessorCount: 4, + SharedCopyEngineCount: 8, + SharedDecoderCount: 5, + SharedEncoderCount: 5, + SharedJpegCount: 1, + SharedOfaCount: 1, + }, + nvml.COMPUTE_INSTANCE_PROFILE_7_SLICE: { + Id: nvml.COMPUTE_INSTANCE_PROFILE_7_SLICE, + SliceCount: 7, + InstanceCount: 1, + MultiprocessorCount: 7, + SharedCopyEngineCount: 8, + SharedDecoderCount: 5, + SharedEncoderCount: 5, + SharedJpegCount: 1, + SharedOfaCount: 1, + }, + }, + }, +} + +func New() nvml.Interface { + return &Server{ + Devices: [8]nvml.Device{ + NewDevice(0), + NewDevice(1), + NewDevice(2), + NewDevice(3), + NewDevice(4), + NewDevice(5), + NewDevice(6), + NewDevice(7), + }, + } +} + +func NewDevice(index int) nvml.Device { + return &Device{ + UUID: "GPU-" + uuid.New().String(), + PciBusID: fmt.Sprintf("0000:%02x:00.0", index), + Index: index, + GpuInstances: make(map[*GpuInstance]struct{}), + GpuInstanceCounter: 0, + MemoryInfo: nvml.Memory{42949672960, 0, 0}, + } +} + +func NewGpuInstance(info nvml.GpuInstanceInfo) nvml.GpuInstance { + return &GpuInstance{ + Info: info, + ComputeInstances: make(map[*ComputeInstance]struct{}), + ComputeInstanceCounter: 0, + } +} + +func NewComputeInstance(info nvml.ComputeInstanceInfo) nvml.ComputeInstance { + return &ComputeInstance{ + Info: info, + } +} + +func (n *Server) Init() nvml.Return { + return nvml.SUCCESS +} + +func (n *Server) Shutdown() nvml.Return { + return nvml.SUCCESS +} + +func (n *Server) SystemGetNVMLVersion() (string, nvml.Return) { + return "11.450.51", nvml.SUCCESS +} + +func (n *Server) DeviceGetCount() (int, nvml.Return) { + return len(n.Devices), nvml.SUCCESS +} + +func (n *Server) DeviceGetHandleByIndex(index int) (nvml.Device, nvml.Return) { + if index < 0 || index >= len(n.Devices) { + return nil, nvml.ERROR_INVALID_ARGUMENT + } + return n.Devices[index], nvml.SUCCESS +} + +func (n *Server) DeviceGetHandleByUUID(uuid string) (nvml.Device, nvml.Return) { + for _, d := range n.Devices { + if uuid == d.(*Device).UUID { + return d, nvml.SUCCESS + } + } + return nil, nvml.ERROR_INVALID_ARGUMENT +} + +func (n *Server) DeviceGetHandleByPciBusId(busID string) (nvml.Device, nvml.Return) { + for _, d := range n.Devices { + if busID == d.(*Device).PciBusID { + return d, nvml.SUCCESS + } + } + return nil, nvml.ERROR_INVALID_ARGUMENT +} + +func (d *Device) GetIndex() (int, nvml.Return) { + return d.Index, nvml.SUCCESS +} + +func (d *Device) GetUUID() (string, nvml.Return) { + return d.UUID, nvml.SUCCESS +} + +func (d *Device) GetMemoryInfo() (nvml.Memory, nvml.Return) { + return d.MemoryInfo, nvml.SUCCESS +} + +func (d *Device) GetPciInfo() (nvml.PciInfo, nvml.Return) { + p := nvml.PciInfo{ + PciDeviceId: 0x20B010DE, + } + return p, nvml.SUCCESS +} + +func (d *Device) SetMigMode(mode int) (nvml.Return, nvml.Return) { + d.MigMode = mode + return nvml.SUCCESS, nvml.SUCCESS +} + +func (d *Device) GetMigMode() (int, int, nvml.Return) { + return d.MigMode, d.MigMode, nvml.SUCCESS +} + +func (d *Device) GetGpuInstanceProfileInfo(giProfileId int) (nvml.GpuInstanceProfileInfo, nvml.Return) { + if giProfileId < 0 || giProfileId >= nvml.GPU_INSTANCE_PROFILE_COUNT { + return nvml.GpuInstanceProfileInfo{}, nvml.ERROR_INVALID_ARGUMENT + } + + if _, exists := MIGProfiles.GpuInstanceProfiles[giProfileId]; !exists { + return nvml.GpuInstanceProfileInfo{}, nvml.ERROR_NOT_SUPPORTED + } + + return MIGProfiles.GpuInstanceProfiles[giProfileId], nvml.SUCCESS +} + +func (d *Device) CreateGpuInstance(info *nvml.GpuInstanceProfileInfo) (nvml.GpuInstance, nvml.Return) { + giInfo := nvml.GpuInstanceInfo{ + Device: d, + Id: d.GpuInstanceCounter, + ProfileId: info.Id, + } + d.GpuInstanceCounter++ + gi := NewGpuInstance(giInfo) + d.GpuInstances[gi.(*GpuInstance)] = struct{}{} + return gi, nvml.SUCCESS +} + +func (d *Device) CreateGpuInstanceWithPlacement(info *nvml.GpuInstanceProfileInfo, placement *nvml.GpuInstancePlacement) (nvml.GpuInstance, nvml.Return) { + giInfo := nvml.GpuInstanceInfo{ + Device: d, + Id: d.GpuInstanceCounter, + ProfileId: info.Id, + Placement: *placement, + } + d.GpuInstanceCounter++ + gi := NewGpuInstance(giInfo) + d.GpuInstances[gi.(*GpuInstance)] = struct{}{} + return gi, nvml.SUCCESS +} + +func (d *Device) GetGpuInstances(info *nvml.GpuInstanceProfileInfo) ([]nvml.GpuInstance, nvml.Return) { + var gis []nvml.GpuInstance + for gi := range d.GpuInstances { + if gi.Info.ProfileId == info.Id { + gis = append(gis, gi) + } + } + return gis, nvml.SUCCESS +} + +func (gi *GpuInstance) GetInfo() (nvml.GpuInstanceInfo, nvml.Return) { + return gi.Info, nvml.SUCCESS +} + +func (gi *GpuInstance) GetComputeInstanceProfileInfo(ciProfileId int, ciEngProfileId int) (nvml.ComputeInstanceProfileInfo, nvml.Return) { + if ciProfileId < 0 || ciProfileId >= nvml.COMPUTE_INSTANCE_PROFILE_COUNT { + return nvml.ComputeInstanceProfileInfo{}, nvml.ERROR_INVALID_ARGUMENT + } + + if ciEngProfileId != nvml.COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED { + return nvml.ComputeInstanceProfileInfo{}, nvml.ERROR_NOT_SUPPORTED + } + + giProfileId := int(gi.Info.ProfileId) + + if _, exists := MIGProfiles.ComputeInstanceProfiles[giProfileId]; !exists { + return nvml.ComputeInstanceProfileInfo{}, nvml.ERROR_NOT_SUPPORTED + } + + if _, exists := MIGProfiles.ComputeInstanceProfiles[giProfileId][ciProfileId]; !exists { + return nvml.ComputeInstanceProfileInfo{}, nvml.ERROR_NOT_SUPPORTED + } + + return MIGProfiles.ComputeInstanceProfiles[giProfileId][ciProfileId], nvml.SUCCESS +} + +func (gi *GpuInstance) CreateComputeInstance(info *nvml.ComputeInstanceProfileInfo) (nvml.ComputeInstance, nvml.Return) { + ciInfo := nvml.ComputeInstanceInfo{ + Device: gi.Info.Device, + GpuInstance: gi, + Id: gi.ComputeInstanceCounter, + ProfileId: info.Id, + } + gi.ComputeInstanceCounter++ + ci := NewComputeInstance(ciInfo) + gi.ComputeInstances[ci.(*ComputeInstance)] = struct{}{} + return ci, nvml.SUCCESS +} + +func (gi *GpuInstance) GetComputeInstances(info *nvml.ComputeInstanceProfileInfo) ([]nvml.ComputeInstance, nvml.Return) { + var cis []nvml.ComputeInstance + for ci := range gi.ComputeInstances { + if ci.Info.ProfileId == info.Id { + cis = append(cis, ci) + } + } + return cis, nvml.SUCCESS +} + +func (gi *GpuInstance) Destroy() nvml.Return { + delete(gi.Info.Device.(*Device).GpuInstances, gi) + return nvml.SUCCESS +} + +func (ci *ComputeInstance) GetInfo() (nvml.ComputeInstanceInfo, nvml.Return) { + return ci.Info, nvml.SUCCESS +} + +func (ci *ComputeInstance) Destroy() nvml.Return { + delete(ci.Info.GpuInstance.(*GpuInstance).ComputeInstances, ci) + return nvml.SUCCESS +} From 1fa43fd56038ecaaf6b173885e19a01eca639d58 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Fri, 12 Apr 2024 17:40:54 +0000 Subject: [PATCH 21/21] Replace Library interface with Extensions interface The methods in this interface represent extensions to the core NVML API that are only accessible through calling GetExtensions() against the Interface in use (or at the package level for the default interface). Signed-off-by: Kevin Klues --- gen/nvml/generateapi.go | 2 +- pkg/nvml/api.go | 16 +++++-- pkg/nvml/lib.go | 50 ++++++++++---------- pkg/nvml/lib_test.go | 2 +- pkg/nvml/mock/extendedinterface.go | 75 ++++++++++++++++++++++++++++++ pkg/nvml/mock/interface.go | 74 ++++++++++++++--------------- pkg/nvml/zz_generated.api.go | 4 +- 7 files changed, 152 insertions(+), 71 deletions(-) create mode 100644 pkg/nvml/mock/extendedinterface.go diff --git a/gen/nvml/generateapi.go b/gen/nvml/generateapi.go index c99fd78..5ec4a07 100644 --- a/gen/nvml/generateapi.go +++ b/gen/nvml/generateapi.go @@ -43,7 +43,7 @@ var GeneratableInterfaces = []GeneratableInterfacePoperties{ { Type: "library", Interface: "Interface", - Exclude: []string{"Lookup"}, + Exclude: []string{"LookupSymbol"}, PackageMethodsAliasedFrom: "libnvml", }, { diff --git a/pkg/nvml/api.go b/pkg/nvml/api.go index 9ede936..fdf27bd 100644 --- a/pkg/nvml/api.go +++ b/pkg/nvml/api.go @@ -16,6 +16,17 @@ package nvml +// 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 +} + // libraryOptions hold the paramaters than can be set by a LibraryOption type libraryOptions struct { path string @@ -25,11 +36,6 @@ type libraryOptions struct { // LibraryOption represents a functional option to configure the underlying NVML library type LibraryOption func(*libraryOptions) -// Library defines a set of functions defined on the underlying dynamic library. -type Library interface { - Lookup(string) 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) { diff --git a/pkg/nvml/lib.go b/pkg/nvml/lib.go index ed4f469..4d26531 100644 --- a/pkg/nvml/lib.go +++ b/pkg/nvml/lib.go @@ -85,13 +85,13 @@ func (l *library) init(opts ...LibraryOption) { l.dl = dl.New(o.path, o.flags) } -func (l *library) GetLibrary() Library { +func (l *library) Extensions() ExtendedInterface { return l } -// Lookup checks whether the specified library symbol exists in the library. +// 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 { +func (l *library) LookupSymbol(name string) error { if l == nil || l.refcount == 0 { return fmt.Errorf("error looking up %s: %w", name, errLibraryNotLoaded) } @@ -198,93 +198,93 @@ 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 } - err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetComputeRunningProcesses_v3") if err == nil { deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3 } - err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v2") + err = l.LookupSymbol("nvmlDeviceGetGraphicsRunningProcesses_v2") if err == nil { deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2 } - err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetGraphicsRunningProcesses_v3") if err == nil { deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3 } - err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v2") + err = l.LookupSymbol("nvmlDeviceGetMPSComputeRunningProcesses_v2") if err == nil { deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2 } - err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetMPSComputeRunningProcesses_v3") if err == nil { 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 } diff --git a/pkg/nvml/lib_test.go b/pkg/nvml/lib_test.go index 460ed1d..5e233e8 100644 --- a/pkg/nvml/lib_test.go +++ b/pkg/nvml/lib_test.go @@ -125,7 +125,7 @@ func TestLookupFromDefault(t *testing.T) { if !tc.skipLoadLibrary { require.ErrorIs(t, l.load(), tc.expectedLoadError) } - require.ErrorIs(t, l.Lookup("symbol"), tc.expectedLookupErrror) + require.ErrorIs(t, l.LookupSymbol("symbol"), tc.expectedLookupErrror) require.ErrorIs(t, l.close(), tc.expectedCloseError) if tc.expectedCloseError == nil { require.Equal(t, 0, int(l.refcount)) diff --git a/pkg/nvml/mock/extendedinterface.go b/pkg/nvml/mock/extendedinterface.go new file mode 100644 index 0000000..71634bf --- /dev/null +++ b/pkg/nvml/mock/extendedinterface.go @@ -0,0 +1,75 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package mock + +import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" + "sync" +) + +// Ensure, that ExtendedInterface does implement nvml.ExtendedInterface. +// If this is not the case, regenerate this file with moq. +var _ nvml.ExtendedInterface = &ExtendedInterface{} + +// ExtendedInterface is a mock implementation of nvml.ExtendedInterface. +// +// func TestSomethingThatUsesExtendedInterface(t *testing.T) { +// +// // make and configure a mocked nvml.ExtendedInterface +// mockedExtendedInterface := &ExtendedInterface{ +// LookupSymbolFunc: func(s string) error { +// panic("mock out the LookupSymbol method") +// }, +// } +// +// // use mockedExtendedInterface in code that requires nvml.ExtendedInterface +// // and then make assertions. +// +// } +type ExtendedInterface struct { + // LookupSymbolFunc mocks the LookupSymbol method. + LookupSymbolFunc func(s string) error + + // calls tracks calls to the methods. + calls struct { + // LookupSymbol holds details about calls to the LookupSymbol method. + LookupSymbol []struct { + // S is the s argument value. + S string + } + } + lockLookupSymbol sync.RWMutex +} + +// LookupSymbol calls LookupSymbolFunc. +func (mock *ExtendedInterface) LookupSymbol(s string) error { + if mock.LookupSymbolFunc == nil { + panic("ExtendedInterface.LookupSymbolFunc: method is nil but ExtendedInterface.LookupSymbol was just called") + } + callInfo := struct { + S string + }{ + S: s, + } + mock.lockLookupSymbol.Lock() + mock.calls.LookupSymbol = append(mock.calls.LookupSymbol, callInfo) + mock.lockLookupSymbol.Unlock() + return mock.LookupSymbolFunc(s) +} + +// LookupSymbolCalls gets all the calls that were made to LookupSymbol. +// Check the length with: +// +// len(mockedExtendedInterface.LookupSymbolCalls()) +func (mock *ExtendedInterface) LookupSymbolCalls() []struct { + S string +} { + var calls []struct { + S string + } + mock.lockLookupSymbol.RLock() + calls = mock.calls.LookupSymbol + mock.lockLookupSymbol.RUnlock() + return calls +} diff --git a/pkg/nvml/mock/interface.go b/pkg/nvml/mock/interface.go index 6e2f3d5..96739dd 100644 --- a/pkg/nvml/mock/interface.go +++ b/pkg/nvml/mock/interface.go @@ -654,15 +654,15 @@ var _ nvml.Interface = &Interface{} // EventSetWaitFunc: func(eventSet nvml.EventSet, v uint32) (nvml.EventData, nvml.Return) { // panic("mock out the EventSetWait method") // }, +// ExtensionsFunc: func() nvml.ExtendedInterface { +// panic("mock out the Extensions method") +// }, // GetExcludedDeviceCountFunc: func() (int, nvml.Return) { // panic("mock out the GetExcludedDeviceCount method") // }, // GetExcludedDeviceInfoByIndexFunc: func(n int) (nvml.ExcludedDeviceInfo, nvml.Return) { // panic("mock out the GetExcludedDeviceInfoByIndex method") // }, -// GetLibraryFunc: func() nvml.Library { -// panic("mock out the GetLibrary method") -// }, // GetVgpuCompatibilityFunc: func(vgpuMetadata *nvml.VgpuMetadata, vgpuPgpuMetadata *nvml.VgpuPgpuMetadata) (nvml.VgpuPgpuCompatibility, nvml.Return) { // panic("mock out the GetVgpuCompatibility method") // }, @@ -1534,15 +1534,15 @@ type Interface struct { // EventSetWaitFunc mocks the EventSetWait method. EventSetWaitFunc func(eventSet nvml.EventSet, v uint32) (nvml.EventData, nvml.Return) + // ExtensionsFunc mocks the Extensions method. + ExtensionsFunc func() nvml.ExtendedInterface + // GetExcludedDeviceCountFunc mocks the GetExcludedDeviceCount method. GetExcludedDeviceCountFunc func() (int, nvml.Return) // GetExcludedDeviceInfoByIndexFunc mocks the GetExcludedDeviceInfoByIndex method. GetExcludedDeviceInfoByIndexFunc func(n int) (nvml.ExcludedDeviceInfo, nvml.Return) - // GetLibraryFunc mocks the GetLibrary method. - GetLibraryFunc func() nvml.Library - // GetVgpuCompatibilityFunc mocks the GetVgpuCompatibility method. GetVgpuCompatibilityFunc func(vgpuMetadata *nvml.VgpuMetadata, vgpuPgpuMetadata *nvml.VgpuPgpuMetadata) (nvml.VgpuPgpuCompatibility, nvml.Return) @@ -3069,6 +3069,9 @@ type Interface struct { // V is the v argument value. V uint32 } + // Extensions holds details about calls to the Extensions method. + Extensions []struct { + } // GetExcludedDeviceCount holds details about calls to the GetExcludedDeviceCount method. GetExcludedDeviceCount []struct { } @@ -3077,9 +3080,6 @@ type Interface struct { // N is the n argument value. N int } - // GetLibrary holds details about calls to the GetLibrary method. - GetLibrary []struct { - } // GetVgpuCompatibility holds details about calls to the GetVgpuCompatibility method. GetVgpuCompatibility []struct { // VgpuMetadata is the vgpuMetadata argument value. @@ -3697,9 +3697,9 @@ type Interface struct { lockEventSetCreate sync.RWMutex lockEventSetFree sync.RWMutex lockEventSetWait sync.RWMutex + lockExtensions sync.RWMutex lockGetExcludedDeviceCount sync.RWMutex lockGetExcludedDeviceInfoByIndex sync.RWMutex - lockGetLibrary sync.RWMutex lockGetVgpuCompatibility sync.RWMutex lockGetVgpuDriverCapabilities sync.RWMutex lockGetVgpuVersion sync.RWMutex @@ -11031,6 +11031,33 @@ func (mock *Interface) EventSetWaitCalls() []struct { return calls } +// Extensions calls ExtensionsFunc. +func (mock *Interface) Extensions() nvml.ExtendedInterface { + if mock.ExtensionsFunc == nil { + panic("Interface.ExtensionsFunc: method is nil but Interface.Extensions was just called") + } + callInfo := struct { + }{} + mock.lockExtensions.Lock() + mock.calls.Extensions = append(mock.calls.Extensions, callInfo) + mock.lockExtensions.Unlock() + return mock.ExtensionsFunc() +} + +// ExtensionsCalls gets all the calls that were made to Extensions. +// Check the length with: +// +// len(mockedInterface.ExtensionsCalls()) +func (mock *Interface) ExtensionsCalls() []struct { +} { + var calls []struct { + } + mock.lockExtensions.RLock() + calls = mock.calls.Extensions + mock.lockExtensions.RUnlock() + return calls +} + // GetExcludedDeviceCount calls GetExcludedDeviceCountFunc. func (mock *Interface) GetExcludedDeviceCount() (int, nvml.Return) { if mock.GetExcludedDeviceCountFunc == nil { @@ -11090,33 +11117,6 @@ func (mock *Interface) GetExcludedDeviceInfoByIndexCalls() []struct { return calls } -// GetLibrary calls GetLibraryFunc. -func (mock *Interface) GetLibrary() nvml.Library { - if mock.GetLibraryFunc == nil { - panic("Interface.GetLibraryFunc: method is nil but Interface.GetLibrary was just called") - } - callInfo := struct { - }{} - mock.lockGetLibrary.Lock() - mock.calls.GetLibrary = append(mock.calls.GetLibrary, callInfo) - mock.lockGetLibrary.Unlock() - return mock.GetLibraryFunc() -} - -// GetLibraryCalls gets all the calls that were made to GetLibrary. -// Check the length with: -// -// len(mockedInterface.GetLibraryCalls()) -func (mock *Interface) GetLibraryCalls() []struct { -} { - var calls []struct { - } - mock.lockGetLibrary.RLock() - calls = mock.calls.GetLibrary - mock.lockGetLibrary.RUnlock() - return calls -} - // GetVgpuCompatibility calls GetVgpuCompatibilityFunc. func (mock *Interface) GetVgpuCompatibility(vgpuMetadata *nvml.VgpuMetadata, vgpuPgpuMetadata *nvml.VgpuPgpuMetadata) (nvml.VgpuPgpuCompatibility, nvml.Return) { if mock.GetVgpuCompatibilityFunc == nil { diff --git a/pkg/nvml/zz_generated.api.go b/pkg/nvml/zz_generated.api.go index 76bf64b..9997a27 100644 --- a/pkg/nvml/zz_generated.api.go +++ b/pkg/nvml/zz_generated.api.go @@ -232,9 +232,9 @@ var ( EventSetCreate = libnvml.EventSetCreate EventSetFree = libnvml.EventSetFree EventSetWait = libnvml.EventSetWait + Extensions = libnvml.Extensions GetExcludedDeviceCount = libnvml.GetExcludedDeviceCount GetExcludedDeviceInfoByIndex = libnvml.GetExcludedDeviceInfoByIndex - GetLibrary = libnvml.GetLibrary GetVgpuCompatibility = libnvml.GetVgpuCompatibility GetVgpuDriverCapabilities = libnvml.GetVgpuDriverCapabilities GetVgpuVersion = libnvml.GetVgpuVersion @@ -529,9 +529,9 @@ type Interface interface { EventSetCreate() (EventSet, Return) EventSetFree(EventSet) Return EventSetWait(EventSet, uint32) (EventData, Return) + Extensions() ExtendedInterface GetExcludedDeviceCount() (int, Return) GetExcludedDeviceInfoByIndex(int) (ExcludedDeviceInfo, Return) - GetLibrary() Library GetVgpuCompatibility(*VgpuMetadata, *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) GetVgpuDriverCapabilities(VgpuDriverCapability) (bool, Return) GetVgpuVersion() (VgpuVersion, VgpuVersion, Return)