From 8d39bd7115511197aaf9e36b57a48656ca6999ef Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Fri, 12 Apr 2024 21:28:32 +0000 Subject: [PATCH] Update to incorporate go-nvml updates to expose interface types Signed-off-by: Kevin Klues --- cmd/nvidia-mig-parted/apply/apply.go | 2 +- cmd/nvidia-mig-parted/assert/assert.go | 2 +- .../checkpoint/checkpoint.go | 2 +- cmd/nvidia-mig-parted/export/export.go | 2 +- cmd/nvidia-mig-parted/util/device.go | 6 +- cmd/nvidia-mig-parted/util/nvml.go | 12 +- go.mod | 10 +- go.sum | 15 +- internal/nvlib/mig/mig.go | 22 +- internal/nvlib/nvlib.go | 2 +- internal/nvml/consts.go | 85 - internal/nvml/mock.go | 559 - internal/nvml/nvml.go | 174 - internal/nvml/return.go | 110 - internal/nvml/types.go | 79 - pkg/mig/config/config.go | 32 +- pkg/mig/config/config_test.go | 19 +- pkg/mig/mode/nvml.go | 30 +- pkg/mig/mode/nvml_test.go | 26 +- pkg/mig/state/state.go | 34 +- pkg/mig/state/state_test.go | 7 +- pkg/types/mig_state.go | 2 +- pkg/types/nvdev.go | 7 +- .../NVIDIA/go-nvlib/pkg/nvlib/device/api.go | 14 +- .../go-nvlib/pkg/nvlib/device/device.go | 46 +- .../go-nvlib/pkg/nvlib/device/identifier.go | 12 +- .../go-nvlib/pkg/nvlib/device/mig_device.go | 10 +- .../go-nvlib/pkg/nvlib/device/mig_profile.go | 26 +- .../github.com/NVIDIA/go-nvlib/pkg/nvml/ci.go | 44 - .../NVIDIA/go-nvlib/pkg/nvml/consts.go | 163 - .../NVIDIA/go-nvlib/pkg/nvml/device.go | 215 - .../NVIDIA/go-nvlib/pkg/nvml/device_mock.go | 1237 -- .../NVIDIA/go-nvlib/pkg/nvml/event_set.go | 39 - .../github.com/NVIDIA/go-nvlib/pkg/nvml/gi.go | 71 - .../NVIDIA/go-nvlib/pkg/nvml/gi_mock.go | 286 - .../NVIDIA/go-nvlib/pkg/nvml/nvml.go | 127 - .../NVIDIA/go-nvlib/pkg/nvml/nvml_mock.go | 428 - .../NVIDIA/go-nvlib/pkg/nvml/options.go | 32 - .../NVIDIA/go-nvlib/pkg/nvml/return.go | 93 - .../NVIDIA/go-nvlib/pkg/nvml/types.go | 162 - .../NVIDIA/go-nvlib/pkg/nvpci/bytes/bytes.go | 14 +- .../NVIDIA/go-nvlib/pkg/nvpci/config.go | 20 +- .../NVIDIA/go-nvlib/pkg/nvpci/mlxpci.go | 18 +- .../NVIDIA/go-nvlib/pkg/nvpci/mmio/mmio.go | 6 +- .../NVIDIA/go-nvlib/pkg/nvpci/mmio/mock.go | 9 +- .../NVIDIA/go-nvlib/pkg/nvpci/mock.go | 8 +- .../NVIDIA/go-nvlib/pkg/nvpci/nvpci.go | 56 +- .../NVIDIA/go-nvlib/pkg/nvpci/resources.go | 10 +- .../NVIDIA/go-nvlib/pkg/pciids/pciids.go | 76 +- .../github.com/NVIDIA/go-nvml/pkg/nvml/api.go | 45 +- .../{cgo_helpers.go => cgo_helpers_static.go} | 11 + .../nvml/{const_gen.go => const_static.go} | 0 .../NVIDIA/go-nvml/pkg/nvml/device.go | 2833 ++-- .../NVIDIA/go-nvml/pkg/nvml/event_set.go | 55 +- .../github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go | 126 +- .../NVIDIA/go-nvml/pkg/nvml/init.go | 10 +- .../github.com/NVIDIA/go-nvml/pkg/nvml/lib.go | 166 +- .../pkg/nvml/mock/computeinstance.go} | 37 +- .../NVIDIA/go-nvml/pkg/nvml/mock/device.go | 8283 ++++++++++ .../go-nvml/pkg/nvml/mock/dgxa100/dgxa100.go | 565 + .../NVIDIA/go-nvml/pkg/nvml/mock/eventset.go | 112 + .../pkg/nvml/mock/extendedinterface.go | 75 + .../NVIDIA/go-nvml/pkg/nvml/mock/gpmsample.go | 162 + .../go-nvml/pkg/nvml/mock/gpuinstance.go | 475 + .../NVIDIA/go-nvml/pkg/nvml/mock/interface.go | 13588 ++++++++++++++++ .../NVIDIA/go-nvml/pkg/nvml/mock/unit.go | 304 + .../go-nvml/pkg/nvml/mock/vgpuinstance.go | 896 + .../go-nvml/pkg/nvml/mock/vgputypeid.go | 496 + .../NVIDIA/go-nvml/pkg/nvml/nvml.go | 1688 +- .../NVIDIA/go-nvml/pkg/nvml/return.go | 24 +- .../NVIDIA/go-nvml/pkg/nvml/system.go | 42 +- .../NVIDIA/go-nvml/pkg/nvml/types_gen.go | 36 +- .../NVIDIA/go-nvml/pkg/nvml/unit.go | 98 +- .../NVIDIA/go-nvml/pkg/nvml/vgpu.go | 488 +- .../go-nvml/pkg/nvml/zz_generated.api.go | 919 ++ vendor/modules.txt | 8 +- 76 files changed, 29089 insertions(+), 6914 deletions(-) delete mode 100644 internal/nvml/consts.go delete mode 100644 internal/nvml/mock.go delete mode 100644 internal/nvml/nvml.go delete mode 100644 internal/nvml/return.go delete mode 100644 internal/nvml/types.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/ci.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/consts.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/device.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/device_mock.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/event_set.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/gi.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/gi_mock.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/nvml.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/nvml_mock.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/options.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/return.go delete mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/types.go rename vendor/github.com/NVIDIA/go-nvml/pkg/nvml/{cgo_helpers.go => cgo_helpers_static.go} (89%) rename vendor/github.com/NVIDIA/go-nvml/pkg/nvml/{const_gen.go => const_static.go} (100%) rename vendor/github.com/NVIDIA/{go-nvlib/pkg/nvml/ci_mock.go => go-nvml/pkg/nvml/mock/computeinstance.go} (61%) create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/device.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100/dgxa100.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/eventset.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/extendedinterface.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/gpmsample.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/gpuinstance.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/interface.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/unit.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/vgpuinstance.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/vgputypeid.go create mode 100644 vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go diff --git a/cmd/nvidia-mig-parted/apply/apply.go b/cmd/nvidia-mig-parted/apply/apply.go index b0558d97..5a8517c5 100644 --- a/cmd/nvidia-mig-parted/apply/apply.go +++ b/cmd/nvidia-mig-parted/apply/apply.go @@ -26,7 +26,7 @@ import ( hooks "github.com/NVIDIA/mig-parted/api/hooks/v1" "github.com/NVIDIA/mig-parted/cmd/nvidia-mig-parted/assert" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" "sigs.k8s.io/yaml" ) diff --git a/cmd/nvidia-mig-parted/assert/assert.go b/cmd/nvidia-mig-parted/assert/assert.go index d480fdf9..7695a401 100644 --- a/cmd/nvidia-mig-parted/assert/assert.go +++ b/cmd/nvidia-mig-parted/assert/assert.go @@ -27,7 +27,7 @@ import ( v1 "github.com/NVIDIA/mig-parted/api/spec/v1" "github.com/NVIDIA/mig-parted/cmd/nvidia-mig-parted/util" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" "github.com/NVIDIA/mig-parted/pkg/types" "sigs.k8s.io/yaml" diff --git a/cmd/nvidia-mig-parted/checkpoint/checkpoint.go b/cmd/nvidia-mig-parted/checkpoint/checkpoint.go index ab5529c3..9686bced 100644 --- a/cmd/nvidia-mig-parted/checkpoint/checkpoint.go +++ b/cmd/nvidia-mig-parted/checkpoint/checkpoint.go @@ -27,7 +27,7 @@ import ( checkpoint "github.com/NVIDIA/mig-parted/api/checkpoint/v1" "github.com/NVIDIA/mig-parted/cmd/nvidia-mig-parted/util" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" "github.com/NVIDIA/mig-parted/pkg/mig/state" ) diff --git a/cmd/nvidia-mig-parted/export/export.go b/cmd/nvidia-mig-parted/export/export.go index eb033a6d..bf3b0920 100644 --- a/cmd/nvidia-mig-parted/export/export.go +++ b/cmd/nvidia-mig-parted/export/export.go @@ -26,7 +26,7 @@ import ( cli "github.com/urfave/cli/v2" v1 "github.com/NVIDIA/mig-parted/api/spec/v1" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" yaml "gopkg.in/yaml.v2" ) diff --git a/cmd/nvidia-mig-parted/util/device.go b/cmd/nvidia-mig-parted/util/device.go index 0e5eb3d8..71390731 100644 --- a/cmd/nvidia-mig-parted/util/device.go +++ b/cmd/nvidia-mig-parted/util/device.go @@ -21,7 +21,7 @@ import ( "os/exec" "strings" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" "github.com/NVIDIA/mig-parted/pkg/types" "github.com/NVIDIA/go-nvlib/pkg/nvpci" @@ -87,7 +87,7 @@ func nvmlGetGPUDeviceIDs() ([]types.DeviceID, error) { var ids []types.DeviceID err = pciVisitGPUs(func(gpu *nvpci.NvidiaPCIDevice) error { _, ret := nvmlLib.DeviceGetHandleByPciBusId(gpu.Address) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil } @@ -126,7 +126,7 @@ func nvmlGetGPUPciBusIds() ([]string, error) { } _, ret := nvmlLib.DeviceGetHandleByPciBusId(gpu.Address) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil } diff --git a/cmd/nvidia-mig-parted/util/nvml.go b/cmd/nvidia-mig-parted/util/nvml.go index c0e69f47..cd0e5aab 100644 --- a/cmd/nvidia-mig-parted/util/nvml.go +++ b/cmd/nvidia-mig-parted/util/nvml.go @@ -24,7 +24,7 @@ import ( log "github.com/sirupsen/logrus" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) const ( @@ -49,18 +49,18 @@ func IsNVMLVersionSupported() (bool, error) { nvmlLib := nvml.New() ret := nvmlLib.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return false, fmt.Errorf("error initializing NVML: %v", ret) } defer func() { ret := nvmlLib.Shutdown() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { log.Warnf("error shutting down NVML: %v", ret) } }() sversion, ret := nvmlLib.SystemGetNVMLVersion() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return false, fmt.Errorf("error getting getting version: %v", ret) } @@ -86,7 +86,7 @@ func NvmlInit(nvmlLib nvml.Interface) error { nvmlLib = nvml.New() } ret := nvmlLib.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return ret } return nil @@ -97,7 +97,7 @@ func TryNvmlShutdown(nvmlLib nvml.Interface) { nvmlLib = nvml.New() } ret := nvmlLib.Shutdown() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { log.Warnf("error shutting down NVML: %v", ret) } } diff --git a/go.mod b/go.mod index a8597ef2..fd15e9ba 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,14 @@ module github.com/NVIDIA/mig-parted -go 1.20 +go 1.21 + +toolchain go1.22.1 + +replace github.com/NVIDIA/go-nvlib => github.com/klueska/go-nvlib v0.0.0-20240412211930-153699bb9310 require ( github.com/NVIDIA/go-nvlib v0.2.0 - github.com/NVIDIA/go-nvml v0.12.0-3 - github.com/google/uuid v1.6.0 + github.com/NVIDIA/go-nvml v0.12.0-4 github.com/sirupsen/logrus v1.7.0 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.27.1 @@ -29,6 +32,7 @@ require ( github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect diff --git a/go.sum b/go.sum index 46aa4922..7f791763 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ -github.com/NVIDIA/go-nvlib v0.2.0 h1:roq+SDstbP1fcy2XVH7wB2Gz2/Ud7Q+NGQYOcVITVrA= -github.com/NVIDIA/go-nvlib v0.2.0/go.mod h1:kFuLNTyD1tF6FbRFlk+/EdUW5BrkE+v1Y3A3/9zKSjA= -github.com/NVIDIA/go-nvml v0.12.0-3 h1:QwfjYxEqIQVRhl8327g2Y3ZvKResPydpGSKtCIIK9jE= -github.com/NVIDIA/go-nvml v0.12.0-3/go.mod h1:SOufGc5Wql+cxrIZ8RyJwVKDYxfbs4WPkHXqadcbfvA= +github.com/NVIDIA/go-nvml v0.12.0-4 h1:BvPjnjJr6qje0zov57Md7TwEA8i/12kZeUQIpyWzTEE= +github.com/NVIDIA/go-nvml v0.12.0-4/go.mod h1:8Llmj+1Rr+9VGGwZuRer5N/aCjxGuR5nPb/9ebBiIEQ= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -19,6 +17,7 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -33,6 +32,7 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 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/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= @@ -43,8 +43,11 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klueska/go-nvlib v0.0.0-20240412211930-153699bb9310 h1:wQJmRXCO75TlHrcPkKZXPrD1wyjBYneTTiH8qXE5KsI= +github.com/klueska/go-nvlib v0.0.0-20240412211930-153699bb9310/go.mod h1:NasUuId9hYFvwzuOHCu9F2X6oTU2tG0JHTfbJYuDAbA= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -59,10 +62,13 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= 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/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= @@ -122,6 +128,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/nvlib/mig/mig.go b/internal/nvlib/mig/mig.go index 658f981d..96382cb5 100644 --- a/internal/nvlib/mig/mig.go +++ b/internal/nvlib/mig/mig.go @@ -19,7 +19,7 @@ package mig import ( "fmt" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) type Interface struct { @@ -52,10 +52,10 @@ func (i Interface) GpuInstance(gi nvml.GpuInstance) GpuInstance { func (device Device) AssertMigEnabled() error { mode, _, ret := device.GetMigMode() - if ret.Value() == nvml.ERROR_NOT_SUPPORTED { + if ret == nvml.ERROR_NOT_SUPPORTED { return fmt.Errorf("MIG not supported") } - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting MIG mode: %v", ret) } if mode != nvml.DEVICE_MIG_ENABLE { @@ -67,18 +67,18 @@ func (device Device) AssertMigEnabled() error { func (device Device) WalkGpuInstances(f func(nvml.GpuInstance, int, nvml.GpuInstanceProfileInfo) error) error { for i := 0; i < nvml.GPU_INSTANCE_PROFILE_COUNT; i++ { giProfileInfo, ret := device.GetGpuInstanceProfileInfo(i) - if ret.Value() == nvml.ERROR_NOT_SUPPORTED { + if ret == nvml.ERROR_NOT_SUPPORTED { continue } - if ret.Value() == nvml.ERROR_INVALID_ARGUMENT { + if ret == nvml.ERROR_INVALID_ARGUMENT { continue } - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting GPU instance profile info for '%v': %v", i, ret) } gis, ret := device.GetGpuInstances(&giProfileInfo) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting GPU instances for profile '%v': %v", i, ret) } @@ -96,18 +96,18 @@ func (gi GpuInstance) WalkComputeInstances(f func(ci nvml.ComputeInstance, ciPro for j := 0; j < nvml.COMPUTE_INSTANCE_PROFILE_COUNT; j++ { for k := 0; k < nvml.COMPUTE_INSTANCE_ENGINE_PROFILE_COUNT; k++ { ciProfileInfo, ret := gi.GetComputeInstanceProfileInfo(j, k) - if ret.Value() == nvml.ERROR_NOT_SUPPORTED { + if ret == nvml.ERROR_NOT_SUPPORTED { continue } - if ret.Value() == nvml.ERROR_INVALID_ARGUMENT { + if ret == nvml.ERROR_INVALID_ARGUMENT { continue } - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting Compute instance profile info for '(%v, %v)': %v", j, k, ret) } cis, ret := gi.GetComputeInstances(&ciProfileInfo) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting Compute instances for profile '(%v, %v)': %v", j, k, ret) } diff --git a/internal/nvlib/nvlib.go b/internal/nvlib/nvlib.go index b0b1e05a..eee0b8e7 100644 --- a/internal/nvlib/nvlib.go +++ b/internal/nvlib/nvlib.go @@ -18,7 +18,7 @@ package nvlib import ( "github.com/NVIDIA/mig-parted/internal/nvlib/mig" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) type Interface struct { diff --git a/internal/nvml/consts.go b/internal/nvml/consts.go deleted file mode 100644 index 83388afc..00000000 --- a/internal/nvml/consts.go +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2021, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -const ( - SUCCESS = nvml.SUCCESS - ERROR_UNINITIALIZED = nvml.ERROR_UNINITIALIZED - ERROR_INVALID_ARGUMENT = nvml.ERROR_INVALID_ARGUMENT - ERROR_NOT_SUPPORTED = nvml.ERROR_NOT_SUPPORTED - ERROR_NO_PERMISSION = nvml.ERROR_NO_PERMISSION - ERROR_ALREADY_INITIALIZED = nvml.ERROR_ALREADY_INITIALIZED - ERROR_NOT_FOUND = nvml.ERROR_NOT_FOUND - ERROR_INSUFFICIENT_SIZE = nvml.ERROR_INSUFFICIENT_SIZE - ERROR_INSUFFICIENT_POWER = nvml.ERROR_INSUFFICIENT_POWER - ERROR_DRIVER_NOT_LOADED = nvml.ERROR_DRIVER_NOT_LOADED - ERROR_TIMEOUT = nvml.ERROR_TIMEOUT - ERROR_IRQ_ISSUE = nvml.ERROR_IRQ_ISSUE - ERROR_LIBRARY_NOT_FOUND = nvml.ERROR_LIBRARY_NOT_FOUND - ERROR_FUNCTION_NOT_FOUND = nvml.ERROR_FUNCTION_NOT_FOUND - ERROR_CORRUPTED_INFOROM = nvml.ERROR_CORRUPTED_INFOROM - ERROR_GPU_IS_LOST = nvml.ERROR_GPU_IS_LOST - ERROR_RESET_REQUIRED = nvml.ERROR_RESET_REQUIRED - ERROR_OPERATING_SYSTEM = nvml.ERROR_OPERATING_SYSTEM - ERROR_LIB_RM_VERSION_MISMATCH = nvml.ERROR_LIB_RM_VERSION_MISMATCH - ERROR_IN_USE = nvml.ERROR_IN_USE - ERROR_MEMORY = nvml.ERROR_MEMORY - ERROR_NO_DATA = nvml.ERROR_NO_DATA - ERROR_VGPU_ECC_NOT_SUPPORTED = nvml.ERROR_VGPU_ECC_NOT_SUPPORTED - ERROR_INSUFFICIENT_RESOURCES = nvml.ERROR_INSUFFICIENT_RESOURCES - ERROR_UNKNOWN = nvml.ERROR_UNKNOWN -) - -const ( - DEVICE_MIG_ENABLE = nvml.DEVICE_MIG_ENABLE - DEVICE_MIG_DISABLE = nvml.DEVICE_MIG_DISABLE -) - -const ( - GPU_INSTANCE_PROFILE_1_SLICE = nvml.GPU_INSTANCE_PROFILE_1_SLICE - GPU_INSTANCE_PROFILE_2_SLICE = nvml.GPU_INSTANCE_PROFILE_2_SLICE - GPU_INSTANCE_PROFILE_3_SLICE = nvml.GPU_INSTANCE_PROFILE_3_SLICE - GPU_INSTANCE_PROFILE_4_SLICE = nvml.GPU_INSTANCE_PROFILE_4_SLICE - GPU_INSTANCE_PROFILE_6_SLICE = nvml.GPU_INSTANCE_PROFILE_6_SLICE - GPU_INSTANCE_PROFILE_7_SLICE = nvml.GPU_INSTANCE_PROFILE_7_SLICE - GPU_INSTANCE_PROFILE_8_SLICE = nvml.GPU_INSTANCE_PROFILE_8_SLICE - GPU_INSTANCE_PROFILE_1_SLICE_REV1 = nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1 - GPU_INSTANCE_PROFILE_1_SLICE_REV2 = nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2 - GPU_INSTANCE_PROFILE_2_SLICE_REV1 = nvml.GPU_INSTANCE_PROFILE_2_SLICE_REV1 - GPU_INSTANCE_PROFILE_COUNT = nvml.GPU_INSTANCE_PROFILE_COUNT -) - -const ( - COMPUTE_INSTANCE_PROFILE_1_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE - COMPUTE_INSTANCE_PROFILE_2_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE - COMPUTE_INSTANCE_PROFILE_3_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE - COMPUTE_INSTANCE_PROFILE_4_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE - COMPUTE_INSTANCE_PROFILE_6_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_6_SLICE - COMPUTE_INSTANCE_PROFILE_7_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_7_SLICE - COMPUTE_INSTANCE_PROFILE_8_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_8_SLICE - COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1 = nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1 - COMPUTE_INSTANCE_PROFILE_COUNT = nvml.COMPUTE_INSTANCE_PROFILE_COUNT -) - -const ( - COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED = nvml.COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED - COMPUTE_INSTANCE_ENGINE_PROFILE_COUNT = nvml.COMPUTE_INSTANCE_ENGINE_PROFILE_COUNT -) diff --git a/internal/nvml/mock.go b/internal/nvml/mock.go deleted file mode 100644 index 82d952cd..00000000 --- a/internal/nvml/mock.go +++ /dev/null @@ -1,559 +0,0 @@ -/* - * Copyright (c) 2021, 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 nvml - -import ( - "fmt" - - "github.com/google/uuid" -) - -type MockLunaServer struct { - Devices [8]Device -} -type MockA100Device struct { - UUID string - PciBusID string - Index int - MigMode int - GpuInstances map[*MockA100GpuInstance]struct{} - GpuInstanceCounter uint32 - MemoryInfo Memory -} -type MockA100GpuInstance struct { - Info GpuInstanceInfo - ComputeInstances map[*MockA100ComputeInstance]struct{} - ComputeInstanceCounter uint32 -} -type MockA100ComputeInstance struct { - Info ComputeInstanceInfo -} - -var _ Interface = (*MockLunaServer)(nil) -var _ Device = (*MockA100Device)(nil) -var _ GpuInstance = (*MockA100GpuInstance)(nil) -var _ ComputeInstance = (*MockA100ComputeInstance)(nil) - -var MockA100MIGProfiles = struct { - GpuInstanceProfiles map[int]GpuInstanceProfileInfo - ComputeInstanceProfiles map[int]map[int]ComputeInstanceProfileInfo -}{ - GpuInstanceProfiles: map[int]GpuInstanceProfileInfo{ - GPU_INSTANCE_PROFILE_1_SLICE: { - Id: 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, - }, - GPU_INSTANCE_PROFILE_1_SLICE_REV1: { - Id: 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, - }, - GPU_INSTANCE_PROFILE_1_SLICE_REV2: { - Id: 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, - }, - GPU_INSTANCE_PROFILE_2_SLICE: { - Id: 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, - }, - GPU_INSTANCE_PROFILE_3_SLICE: { - Id: 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, - }, - GPU_INSTANCE_PROFILE_4_SLICE: { - Id: 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, - }, - GPU_INSTANCE_PROFILE_7_SLICE: { - Id: 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]ComputeInstanceProfileInfo{ - GPU_INSTANCE_PROFILE_1_SLICE: { - COMPUTE_INSTANCE_PROFILE_1_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_1_SLICE, - SliceCount: 1, - InstanceCount: 1, - MultiprocessorCount: 1, - SharedCopyEngineCount: 1, - SharedDecoderCount: 0, - SharedEncoderCount: 0, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - }, - GPU_INSTANCE_PROFILE_1_SLICE_REV1: { - COMPUTE_INSTANCE_PROFILE_1_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_1_SLICE, - SliceCount: 1, - InstanceCount: 1, - MultiprocessorCount: 1, - SharedCopyEngineCount: 1, - SharedDecoderCount: 1, - SharedEncoderCount: 1, - SharedJpegCount: 1, - SharedOfaCount: 1, - }, - }, - GPU_INSTANCE_PROFILE_1_SLICE_REV2: { - COMPUTE_INSTANCE_PROFILE_1_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_1_SLICE, - SliceCount: 1, - InstanceCount: 1, - MultiprocessorCount: 1, - SharedCopyEngineCount: 1, - SharedDecoderCount: 0, - SharedEncoderCount: 0, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - }, - GPU_INSTANCE_PROFILE_2_SLICE: { - COMPUTE_INSTANCE_PROFILE_1_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_1_SLICE, - SliceCount: 1, - InstanceCount: 2, - MultiprocessorCount: 1, - SharedCopyEngineCount: 2, - SharedDecoderCount: 1, - SharedEncoderCount: 1, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - COMPUTE_INSTANCE_PROFILE_2_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_2_SLICE, - SliceCount: 2, - InstanceCount: 1, - MultiprocessorCount: 2, - SharedCopyEngineCount: 2, - SharedDecoderCount: 1, - SharedEncoderCount: 1, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - }, - GPU_INSTANCE_PROFILE_3_SLICE: { - COMPUTE_INSTANCE_PROFILE_1_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_1_SLICE, - SliceCount: 1, - InstanceCount: 3, - MultiprocessorCount: 1, - SharedCopyEngineCount: 4, - SharedDecoderCount: 2, - SharedEncoderCount: 1, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - COMPUTE_INSTANCE_PROFILE_2_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_2_SLICE, - SliceCount: 2, - InstanceCount: 1, - MultiprocessorCount: 2, - SharedCopyEngineCount: 4, - SharedDecoderCount: 2, - SharedEncoderCount: 2, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - COMPUTE_INSTANCE_PROFILE_3_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_3_SLICE, - SliceCount: 3, - InstanceCount: 1, - MultiprocessorCount: 3, - SharedCopyEngineCount: 4, - SharedDecoderCount: 2, - SharedEncoderCount: 0, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - }, - GPU_INSTANCE_PROFILE_4_SLICE: { - COMPUTE_INSTANCE_PROFILE_1_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_1_SLICE, - SliceCount: 1, - InstanceCount: 4, - MultiprocessorCount: 1, - SharedCopyEngineCount: 4, - SharedDecoderCount: 2, - SharedEncoderCount: 2, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - COMPUTE_INSTANCE_PROFILE_2_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_2_SLICE, - SliceCount: 2, - InstanceCount: 2, - MultiprocessorCount: 2, - SharedCopyEngineCount: 4, - SharedDecoderCount: 2, - SharedEncoderCount: 2, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - COMPUTE_INSTANCE_PROFILE_4_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_4_SLICE, - SliceCount: 4, - InstanceCount: 1, - MultiprocessorCount: 4, - SharedCopyEngineCount: 4, - SharedDecoderCount: 2, - SharedEncoderCount: 2, - SharedJpegCount: 0, - SharedOfaCount: 0, - }, - }, - GPU_INSTANCE_PROFILE_7_SLICE: { - COMPUTE_INSTANCE_PROFILE_1_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_1_SLICE, - SliceCount: 1, - InstanceCount: 7, - MultiprocessorCount: 1, - SharedCopyEngineCount: 8, - SharedDecoderCount: 5, - SharedEncoderCount: 5, - SharedJpegCount: 1, - SharedOfaCount: 1, - }, - COMPUTE_INSTANCE_PROFILE_2_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_2_SLICE, - SliceCount: 2, - InstanceCount: 3, - MultiprocessorCount: 2, - SharedCopyEngineCount: 8, - SharedDecoderCount: 5, - SharedEncoderCount: 5, - SharedJpegCount: 1, - SharedOfaCount: 1, - }, - COMPUTE_INSTANCE_PROFILE_3_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_3_SLICE, - SliceCount: 3, - InstanceCount: 2, - MultiprocessorCount: 3, - SharedCopyEngineCount: 8, - SharedDecoderCount: 5, - SharedEncoderCount: 5, - SharedJpegCount: 1, - SharedOfaCount: 1, - }, - COMPUTE_INSTANCE_PROFILE_4_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_4_SLICE, - SliceCount: 4, - InstanceCount: 1, - MultiprocessorCount: 4, - SharedCopyEngineCount: 8, - SharedDecoderCount: 5, - SharedEncoderCount: 5, - SharedJpegCount: 1, - SharedOfaCount: 1, - }, - COMPUTE_INSTANCE_PROFILE_7_SLICE: { - Id: COMPUTE_INSTANCE_PROFILE_7_SLICE, - SliceCount: 7, - InstanceCount: 1, - MultiprocessorCount: 7, - SharedCopyEngineCount: 8, - SharedDecoderCount: 5, - SharedEncoderCount: 5, - SharedJpegCount: 1, - SharedOfaCount: 1, - }, - }, - }, -} - -func NewMockNVMLOnLunaServer() Interface { - return &MockLunaServer{ - Devices: [8]Device{ - NewMockA100Device(0), - NewMockA100Device(1), - NewMockA100Device(2), - NewMockA100Device(3), - NewMockA100Device(4), - NewMockA100Device(5), - NewMockA100Device(6), - NewMockA100Device(7), - }, - } -} - -func NewMockA100Device(index int) Device { - return &MockA100Device{ - UUID: "GPU-" + uuid.New().String(), - PciBusID: fmt.Sprintf("0000:%02x:00.0", index), - Index: index, - GpuInstances: make(map[*MockA100GpuInstance]struct{}), - GpuInstanceCounter: 0, - MemoryInfo: Memory{42949672960, 0, 0}, - } -} - -func NewMockA100GpuInstance(info GpuInstanceInfo) GpuInstance { - return &MockA100GpuInstance{ - Info: info, - ComputeInstances: make(map[*MockA100ComputeInstance]struct{}), - ComputeInstanceCounter: 0, - } -} - -func NewMockA100ComputeInstance(info ComputeInstanceInfo) ComputeInstance { - return &MockA100ComputeInstance{ - Info: info, - } -} - -func (n *MockLunaServer) Init() Return { - return MockReturn(SUCCESS) -} - -func (n *MockLunaServer) Shutdown() Return { - return MockReturn(SUCCESS) -} - -func (n *MockLunaServer) SystemGetNVMLVersion() (string, Return) { - return "11.450.51", nvmlReturn(SUCCESS) -} - -func (n *MockLunaServer) DeviceGetCount() (int, Return) { - return len(n.Devices), MockReturn(SUCCESS) -} - -func (n *MockLunaServer) DeviceGetHandleByIndex(index int) (Device, Return) { - if index < 0 || index >= len(n.Devices) { - return nil, MockReturn(ERROR_INVALID_ARGUMENT) - } - return n.Devices[index], MockReturn(SUCCESS) -} - -func (n *MockLunaServer) DeviceGetHandleByUUID(uuid string) (Device, Return) { - for _, d := range n.Devices { - if uuid == d.(*MockA100Device).UUID { - return d, MockReturn(SUCCESS) - } - } - return nil, MockReturn(ERROR_INVALID_ARGUMENT) -} - -func (n *MockLunaServer) DeviceGetHandleByPciBusId(busID string) (Device, Return) { - for _, d := range n.Devices { - if busID == d.(*MockA100Device).PciBusID { - return d, MockReturn(SUCCESS) - } - } - return nil, MockReturn(ERROR_INVALID_ARGUMENT) -} - -func (d *MockA100Device) GetIndex() (int, Return) { - return d.Index, MockReturn(SUCCESS) -} - -func (d *MockA100Device) GetUUID() (string, Return) { - return d.UUID, MockReturn(SUCCESS) -} - -func (d *MockA100Device) GetMemoryInfo() (Memory, Return) { - return d.MemoryInfo, MockReturn(SUCCESS) -} - -func (d *MockA100Device) GetPciInfo() (PciInfo, Return) { - p := PciInfo{ - PciDeviceId: 0x20B010DE, - } - return p, MockReturn(SUCCESS) -} - -func (d *MockA100Device) SetMigMode(mode int) (Return, Return) { - d.MigMode = mode - return MockReturn(SUCCESS), MockReturn(SUCCESS) -} - -func (d *MockA100Device) GetMigMode() (int, int, Return) { - return d.MigMode, d.MigMode, MockReturn(SUCCESS) -} - -func (d *MockA100Device) GetGpuInstanceProfileInfo(giProfileId int) (GpuInstanceProfileInfo, Return) { - if giProfileId < 0 || giProfileId >= GPU_INSTANCE_PROFILE_COUNT { - return GpuInstanceProfileInfo{}, MockReturn(ERROR_INVALID_ARGUMENT) - } - - if _, exists := MockA100MIGProfiles.GpuInstanceProfiles[giProfileId]; !exists { - return GpuInstanceProfileInfo{}, MockReturn(ERROR_NOT_SUPPORTED) - } - - return MockA100MIGProfiles.GpuInstanceProfiles[giProfileId], MockReturn(SUCCESS) -} - -func (d *MockA100Device) CreateGpuInstance(info *GpuInstanceProfileInfo) (GpuInstance, Return) { - giInfo := GpuInstanceInfo{ - Device: d, - Id: d.GpuInstanceCounter, - ProfileId: info.Id, - } - d.GpuInstanceCounter++ - gi := NewMockA100GpuInstance(giInfo) - d.GpuInstances[gi.(*MockA100GpuInstance)] = struct{}{} - return gi, MockReturn(SUCCESS) -} - -func (d *MockA100Device) CreateGpuInstanceWithPlacement(info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) { - giInfo := GpuInstanceInfo{ - Device: d, - Id: d.GpuInstanceCounter, - ProfileId: info.Id, - Placement: *placement, - } - d.GpuInstanceCounter++ - gi := NewMockA100GpuInstance(giInfo) - d.GpuInstances[gi.(*MockA100GpuInstance)] = struct{}{} - return gi, MockReturn(SUCCESS) -} - -func (d *MockA100Device) GetGpuInstances(info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - var gis []GpuInstance - for gi := range d.GpuInstances { - if gi.Info.ProfileId == info.Id { - gis = append(gis, gi) - } - } - return gis, MockReturn(SUCCESS) -} - -func (gi *MockA100GpuInstance) GetInfo() (GpuInstanceInfo, Return) { - return gi.Info, MockReturn(SUCCESS) -} - -func (gi *MockA100GpuInstance) GetComputeInstanceProfileInfo(ciProfileId int, ciEngProfileId int) (ComputeInstanceProfileInfo, Return) { - if ciProfileId < 0 || ciProfileId >= COMPUTE_INSTANCE_PROFILE_COUNT { - return ComputeInstanceProfileInfo{}, MockReturn(ERROR_INVALID_ARGUMENT) - } - - if ciEngProfileId != COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED { - return ComputeInstanceProfileInfo{}, MockReturn(ERROR_NOT_SUPPORTED) - } - - giProfileId := int(gi.Info.ProfileId) - - if _, exists := MockA100MIGProfiles.ComputeInstanceProfiles[giProfileId]; !exists { - return ComputeInstanceProfileInfo{}, MockReturn(ERROR_NOT_SUPPORTED) - } - - if _, exists := MockA100MIGProfiles.ComputeInstanceProfiles[giProfileId][ciProfileId]; !exists { - return ComputeInstanceProfileInfo{}, MockReturn(ERROR_NOT_SUPPORTED) - } - - return MockA100MIGProfiles.ComputeInstanceProfiles[giProfileId][ciProfileId], MockReturn(SUCCESS) -} - -func (gi *MockA100GpuInstance) CreateComputeInstance(info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - ciInfo := ComputeInstanceInfo{ - Device: gi.Info.Device, - GpuInstance: gi, - Id: gi.ComputeInstanceCounter, - ProfileId: info.Id, - } - gi.ComputeInstanceCounter++ - ci := NewMockA100ComputeInstance(ciInfo) - gi.ComputeInstances[ci.(*MockA100ComputeInstance)] = struct{}{} - return ci, MockReturn(SUCCESS) -} - -func (gi *MockA100GpuInstance) GetComputeInstances(info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - var cis []ComputeInstance - for ci := range gi.ComputeInstances { - if ci.Info.ProfileId == info.Id { - cis = append(cis, ci) - } - } - return cis, MockReturn(SUCCESS) -} - -func (gi *MockA100GpuInstance) Destroy() Return { - delete(gi.Info.Device.(*MockA100Device).GpuInstances, gi) - return MockReturn(SUCCESS) -} - -func (ci *MockA100ComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { - return ci.Info, MockReturn(SUCCESS) -} - -func (ci *MockA100ComputeInstance) Destroy() Return { - delete(ci.Info.GpuInstance.(*MockA100GpuInstance).ComputeInstances, ci) - return MockReturn(SUCCESS) -} diff --git a/internal/nvml/nvml.go b/internal/nvml/nvml.go deleted file mode 100644 index 5ed788e6..00000000 --- a/internal/nvml/nvml.go +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2021, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -type nvmlLib struct{} -type nvmlDevice nvml.Device -type nvmlGpuInstance nvml.GpuInstance -type nvmlComputeInstance nvml.ComputeInstance - -var _ Interface = (*nvmlLib)(nil) -var _ Device = (*nvmlDevice)(nil) -var _ GpuInstance = (*nvmlGpuInstance)(nil) -var _ ComputeInstance = (*nvmlComputeInstance)(nil) - -func New() Interface { - return &nvmlLib{} -} - -func (n *nvmlLib) Init() Return { - return nvmlReturn(nvml.Init()) -} - -func (n *nvmlLib) Shutdown() Return { - return nvmlReturn(nvml.Shutdown()) -} - -func (n *nvmlLib) SystemGetNVMLVersion() (string, Return) { - s, r := nvml.SystemGetNVMLVersion() - return s, nvmlReturn(r) -} - -func (n *nvmlLib) DeviceGetCount() (int, Return) { - c, r := nvml.DeviceGetCount() - return c, nvmlReturn(r) -} - -func (n *nvmlLib) DeviceGetHandleByIndex(index int) (Device, Return) { - d, r := nvml.DeviceGetHandleByIndex(index) - return nvmlDevice(d), nvmlReturn(r) -} - -func (n *nvmlLib) DeviceGetHandleByUUID(uuid string) (Device, Return) { - d, r := nvml.DeviceGetHandleByUUID(uuid) - return nvmlDevice(d), nvmlReturn(r) -} - -func (n *nvmlLib) DeviceGetHandleByPciBusId(busID string) (Device, Return) { - d, r := nvml.DeviceGetHandleByPciBusId(busID) - return nvmlDevice(d), nvmlReturn(r) -} - -func (d nvmlDevice) GetIndex() (int, Return) { - i, r := nvml.Device(d).GetIndex() - return i, nvmlReturn(r) -} - -func (d nvmlDevice) GetUUID() (string, Return) { - u, r := nvml.Device(d).GetUUID() - return u, nvmlReturn(r) -} - -func (d nvmlDevice) GetMemoryInfo() (Memory, Return) { - m, r := nvml.Device(d).GetMemoryInfo() - return Memory(m), nvmlReturn(r) -} - -func (d nvmlDevice) GetPciInfo() (PciInfo, Return) { - p, r := nvml.Device(d).GetPciInfo() - return PciInfo(p), nvmlReturn(r) -} - -func (d nvmlDevice) SetMigMode(mode int) (Return, Return) { - r1, r2 := nvml.Device(d).SetMigMode(mode) - return nvmlReturn(r1), nvmlReturn(r2) -} - -func (d nvmlDevice) GetMigMode() (int, int, Return) { - s1, s2, r := nvml.Device(d).GetMigMode() - return s1, s2, nvmlReturn(r) -} - -func (d nvmlDevice) GetGpuInstanceProfileInfo(profile int) (GpuInstanceProfileInfo, Return) { - p, r := nvml.Device(d).GetGpuInstanceProfileInfo(profile) - return GpuInstanceProfileInfo(p), nvmlReturn(r) -} - -func (d nvmlDevice) CreateGpuInstance(info *GpuInstanceProfileInfo) (GpuInstance, Return) { - gi, r := nvml.Device(d).CreateGpuInstance((*nvml.GpuInstanceProfileInfo)(info)) - return nvmlGpuInstance(gi), nvmlReturn(r) -} - -func (d nvmlDevice) CreateGpuInstanceWithPlacement(info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) { - gi, r := nvml.Device(d).CreateGpuInstanceWithPlacement((*nvml.GpuInstanceProfileInfo)(info), (*nvml.GpuInstancePlacement)(placement)) - return nvmlGpuInstance(gi), nvmlReturn(r) -} - -func (d nvmlDevice) GetGpuInstances(info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - nvmlGis, r := nvml.Device(d).GetGpuInstances((*nvml.GpuInstanceProfileInfo)(info)) - var gis []GpuInstance - for _, gi := range nvmlGis { - gis = append(gis, nvmlGpuInstance(gi)) - } - return gis, nvmlReturn(r) -} - -func (gi nvmlGpuInstance) GetInfo() (GpuInstanceInfo, Return) { - i, r := nvml.GpuInstance(gi).GetInfo() - info := GpuInstanceInfo{ - Device: nvmlDevice(i.Device), - Id: i.Id, - ProfileId: i.ProfileId, - Placement: GpuInstancePlacement(i.Placement), - } - return info, nvmlReturn(r) -} - -func (gi nvmlGpuInstance) GetComputeInstanceProfileInfo(profile int, engProfile int) (ComputeInstanceProfileInfo, Return) { - p, r := nvml.GpuInstance(gi).GetComputeInstanceProfileInfo(profile, engProfile) - return ComputeInstanceProfileInfo(p), nvmlReturn(r) -} - -func (gi nvmlGpuInstance) CreateComputeInstance(info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - ci, r := nvml.GpuInstance(gi).CreateComputeInstance((*nvml.ComputeInstanceProfileInfo)(info)) - return nvmlComputeInstance(ci), nvmlReturn(r) -} - -func (gi nvmlGpuInstance) GetComputeInstances(info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - nvmlCis, r := nvml.GpuInstance(gi).GetComputeInstances((*nvml.ComputeInstanceProfileInfo)(info)) - var cis []ComputeInstance - for _, ci := range nvmlCis { - cis = append(cis, nvmlComputeInstance(ci)) - } - return cis, nvmlReturn(r) -} - -func (gi nvmlGpuInstance) Destroy() Return { - r := nvml.GpuInstance(gi).Destroy() - return nvmlReturn(r) -} - -func (ci nvmlComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { - i, r := nvml.ComputeInstance(ci).GetInfo() - info := ComputeInstanceInfo{ - Device: nvmlDevice(i.Device), - GpuInstance: nvmlGpuInstance(i.GpuInstance), - Id: i.Id, - ProfileId: i.ProfileId, - Placement: ComputeInstancePlacement(i.Placement), - } - return info, nvmlReturn(r) -} - -func (ci nvmlComputeInstance) Destroy() Return { - r := nvml.ComputeInstance(ci).Destroy() - return nvmlReturn(r) -} diff --git a/internal/nvml/return.go b/internal/nvml/return.go deleted file mode 100644 index ca3c5d75..00000000 --- a/internal/nvml/return.go +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2021, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -type Return interface { - Value() nvml.Return - String() string - Error() string -} - -type nvmlReturn nvml.Return -type MockReturn nvml.Return - -var _ Return = (*nvmlReturn)(nil) -var _ Return = (*MockReturn)(nil) - -func (r nvmlReturn) Value() nvml.Return { - return nvml.Return(r) -} - -func (r nvmlReturn) String() string { - return r.Error() -} - -func (r nvmlReturn) Error() string { - return nvml.ErrorString(nvml.Return(r)) -} - -func (r MockReturn) Value() nvml.Return { - return nvml.Return(r) -} - -func (r MockReturn) String() string { - return r.Error() -} - -func (r MockReturn) Error() string { - switch nvml.Return(r) { - case SUCCESS: - return "SUCCESS" - case ERROR_UNINITIALIZED: - return "ERROR_UNINITIALIZED" - case ERROR_INVALID_ARGUMENT: - return "ERROR_INVALID_ARGUMENT" - case ERROR_NOT_SUPPORTED: - return "ERROR_NOT_SUPPORTED" - case ERROR_NO_PERMISSION: - return "ERROR_NO_PERMISSION" - case ERROR_ALREADY_INITIALIZED: - return "ERROR_ALREADY_INITIALIZED" - case ERROR_NOT_FOUND: - return "ERROR_NOT_FOUND" - case ERROR_INSUFFICIENT_SIZE: - return "ERROR_INSUFFICIENT_SIZE" - case ERROR_INSUFFICIENT_POWER: - return "ERROR_INSUFFICIENT_POWER" - case ERROR_DRIVER_NOT_LOADED: - return "ERROR_DRIVER_NOT_LOADED" - case ERROR_TIMEOUT: - return "ERROR_TIMEOUT" - case ERROR_IRQ_ISSUE: - return "ERROR_IRQ_ISSUE" - case ERROR_LIBRARY_NOT_FOUND: - return "ERROR_LIBRARY_NOT_FOUND" - case ERROR_FUNCTION_NOT_FOUND: - return "ERROR_FUNCTION_NOT_FOUND" - case ERROR_CORRUPTED_INFOROM: - return "ERROR_CORRUPTED_INFOROM" - case ERROR_GPU_IS_LOST: - return "ERROR_GPU_IS_LOST" - case ERROR_RESET_REQUIRED: - return "ERROR_RESET_REQUIRED" - case ERROR_OPERATING_SYSTEM: - return "ERROR_OPERATING_SYSTEM" - case ERROR_LIB_RM_VERSION_MISMATCH: - return "ERROR_LIB_RM_VERSION_MISMATCH" - case ERROR_IN_USE: - return "ERROR_IN_USE" - case ERROR_MEMORY: - return "ERROR_MEMORY" - case ERROR_NO_DATA: - return "ERROR_NO_DATA" - case ERROR_VGPU_ECC_NOT_SUPPORTED: - return "ERROR_VGPU_ECC_NOT_SUPPORTED" - case ERROR_INSUFFICIENT_RESOURCES: - return "ERROR_INSUFFICIENT_RESOURCES" - case ERROR_UNKNOWN: - return "ERROR_UNKNOWN" - default: - return "Unknown return value" - } -} diff --git a/internal/nvml/types.go b/internal/nvml/types.go deleted file mode 100644 index 7ae91b1f..00000000 --- a/internal/nvml/types.go +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2021, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -type Interface interface { - Init() Return - Shutdown() Return - SystemGetNVMLVersion() (string, Return) - DeviceGetCount() (int, Return) - DeviceGetHandleByIndex(Index int) (Device, Return) - DeviceGetHandleByUUID(UUID string) (Device, Return) - DeviceGetHandleByPciBusId(busID string) (Device, Return) -} - -type Device interface { - GetIndex() (int, Return) - GetUUID() (string, Return) - GetMemoryInfo() (Memory, Return) - GetPciInfo() (PciInfo, Return) - SetMigMode(Mode int) (Return, Return) - GetMigMode() (int, int, Return) - GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) - CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) - CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) - GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) -} - -type GpuInstance interface { - GetInfo() (GpuInstanceInfo, Return) - GetComputeInstanceProfileInfo(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) - CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) - GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) - Destroy() Return -} - -type ComputeInstance interface { - GetInfo() (ComputeInstanceInfo, Return) - Destroy() Return -} - -type GpuInstanceInfo struct { - Device Device - Id uint32 - ProfileId uint32 - Placement GpuInstancePlacement -} - -type ComputeInstanceInfo struct { - Device Device - GpuInstance GpuInstance - Id uint32 - ProfileId uint32 - Placement ComputeInstancePlacement -} - -type Memory nvml.Memory -type PciInfo nvml.PciInfo -type GpuInstanceProfileInfo nvml.GpuInstanceProfileInfo -type GpuInstancePlacement nvml.GpuInstancePlacement -type ComputeInstanceProfileInfo nvml.ComputeInstanceProfileInfo -type ComputeInstancePlacement nvml.ComputeInstancePlacement diff --git a/pkg/mig/config/config.go b/pkg/mig/config/config.go index 278621b2..17427921 100644 --- a/pkg/mig/config/config.go +++ b/pkg/mig/config/config.go @@ -23,7 +23,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/NVIDIA/mig-parted/internal/nvlib" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" "github.com/NVIDIA/mig-parted/pkg/types" ) @@ -42,7 +42,7 @@ var _ Manager = (*nvmlMigConfigManager)(nil) func tryNvmlShutdown(nvmlLib nvml.Interface) { ret := nvmlLib.Shutdown() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { log.Warnf("Error shutting down NVML: %v", ret) } } @@ -57,18 +57,18 @@ func NewMockNvmlMigConfigManager(nvml nvml.Interface) Manager { func (m *nvmlMigConfigManager) GetMigConfig(gpu int) (types.MigConfig, error) { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil, fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) device, ret := m.nvml.DeviceGetHandleByIndex(gpu) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil, fmt.Errorf("error getting device handle: %v", ret) } deviceMemory, ret := device.GetMemoryInfo() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil, fmt.Errorf("error getting device memory: %v", ret) } @@ -101,18 +101,18 @@ func (m *nvmlMigConfigManager) GetMigConfig(gpu int) (types.MigConfig, error) { func (m *nvmlMigConfigManager) SetMigConfig(gpu int, config types.MigConfig) error { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) device, ret := m.nvml.DeviceGetHandleByIndex(gpu) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting device handle: %v", ret) } deviceMemory, ret := device.GetMemoryInfo() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting device memory: %v", ret) } @@ -150,7 +150,7 @@ func (m *nvmlMigConfigManager) SetMigConfig(gpu int, config types.MigConfig) err var gi nvml.GpuInstance = nil for _, mp := range mps { giProfileInfo, ret := device.GetGpuInstanceProfileInfo(mp.GIProfileID) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting GPU instance profile info for '%v': %v", mp, ret) } reuseGI := (gi != nil) && (lastGIProfileID == mp.GIProfileID) @@ -159,13 +159,13 @@ func (m *nvmlMigConfigManager) SetMigConfig(gpu int, config types.MigConfig) err for { if !reuseGI { gi, ret = device.CreateGpuInstance(&giProfileInfo) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error creating GPU instance for '%v': %v", mp, ret) } } ciProfileInfo, ret := gi.GetComputeInstanceProfileInfo(mp.CIProfileID, mp.CIEngProfileID) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { if reuseGI { reuseGI = false continue @@ -174,7 +174,7 @@ func (m *nvmlMigConfigManager) SetMigConfig(gpu int, config types.MigConfig) err } _, ret = gi.CreateComputeInstance(&ciProfileInfo) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { if reuseGI { reuseGI = false continue @@ -213,13 +213,13 @@ func (m *nvmlMigConfigManager) SetMigConfig(gpu int, config types.MigConfig) err func (m *nvmlMigConfigManager) ClearMigConfig(gpu int) error { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) device, ret := m.nvml.DeviceGetHandleByIndex(gpu) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting device handle: %v", ret) } @@ -231,7 +231,7 @@ func (m *nvmlMigConfigManager) ClearMigConfig(gpu int) error { err = m.nvlib.Mig.Device(device).WalkGpuInstances(func(gi nvml.GpuInstance, giProfileID int, giProfileInfo nvml.GpuInstanceProfileInfo) error { err := m.nvlib.Mig.GpuInstance(gi).WalkComputeInstances(func(ci nvml.ComputeInstance, ciProfileID int, ciEngProfileID int, ciProfileInfo nvml.ComputeInstanceProfileInfo) error { ret := ci.Destroy() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error destroying Compute instance for profile '(%v, %v)': %v", ciProfileID, ciEngProfileID, ret) } return nil @@ -241,7 +241,7 @@ func (m *nvmlMigConfigManager) ClearMigConfig(gpu int) error { } ret := gi.Destroy() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error destroying GPU instance for profile '%v': %v", giProfileID, ret) } return nil diff --git a/pkg/mig/config/config_test.go b/pkg/mig/config/config_test.go index 27ceb047..0f23a38b 100644 --- a/pkg/mig/config/config_test.go +++ b/pkg/mig/config/config_test.go @@ -24,30 +24,31 @@ import ( "github.com/stretchr/testify/require" "github.com/NVIDIA/mig-parted/internal/nvlib" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100" "github.com/NVIDIA/mig-parted/pkg/types" ) func NewMockLunaServerMigConfigManager() Manager { - nvml := nvml.NewMockNVMLOnLunaServer() + nvml := dgxa100.New() nvlib := nvlib.NewMock(nvml) return &nvmlMigConfigManager{nvml, nvlib} } func EnableMigMode(manager Manager, gpu int) (nvml.Return, nvml.Return) { m := manager.(*nvmlMigConfigManager) - n := m.nvml.(*nvml.MockLunaServer) + n := m.nvml.(*dgxa100.Server) r1, r2 := n.Devices[gpu].SetMigMode(nvml.DEVICE_MIG_ENABLE) return r1, r2 } func TestGetSetMigConfig(t *testing.T) { - nvmlLib := nvml.NewMockNVMLOnLunaServer() + nvmlLib := dgxa100.New() manager := NewMockLunaServerMigConfigManager() numGPUs, ret := nvmlLib.DeviceGetCount() require.NotNil(t, ret, "Unexpected nil return from DeviceGetCount") - require.Equal(t, ret.Value(), nvml.SUCCESS, "Unexpected return value from DeviceGetCount") + require.Equal(t, ret, nvml.SUCCESS, "Unexpected return value from DeviceGetCount") mcg := NewA100_SXM4_40GB_MigConfigGroup() @@ -71,8 +72,8 @@ func TestGetSetMigConfig(t *testing.T) { t.Run(tc.description, func(t *testing.T) { for i := 0; i < numGPUs; i++ { r1, r2 := EnableMigMode(manager, i) - require.Equal(t, nvml.SUCCESS, r1.Value()) - require.Equal(t, nvml.SUCCESS, r2.Value()) + require.Equal(t, nvml.SUCCESS, r1) + require.Equal(t, nvml.SUCCESS, r2) err := manager.SetMigConfig(i, tc.config) require.Nil(t, err, "Unexpected failure from SetMigConfig") @@ -109,8 +110,8 @@ func TestClearMigConfig(t *testing.T) { manager := NewMockLunaServerMigConfigManager() r1, r2 := EnableMigMode(manager, 0) - require.Equal(t, nvml.SUCCESS, r1.Value()) - require.Equal(t, nvml.SUCCESS, r2.Value()) + require.Equal(t, nvml.SUCCESS, r1) + require.Equal(t, nvml.SUCCESS, r2) err := manager.SetMigConfig(0, tc.config) require.Nil(t, err, "Unexpected failure from SetMigConfig") diff --git a/pkg/mig/mode/nvml.go b/pkg/mig/mode/nvml.go index 68d64b77..d79d3355 100644 --- a/pkg/mig/mode/nvml.go +++ b/pkg/mig/mode/nvml.go @@ -21,7 +21,7 @@ import ( log "github.com/sirupsen/logrus" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) type nvmlMigModeManager struct { @@ -32,7 +32,7 @@ var _ Manager = (*nvmlMigModeManager)(nil) func tryNvmlShutdown(nvmlLib nvml.Interface) { ret := nvmlLib.Shutdown() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { log.Warnf("error shutting down NVML: %v", ret) } } @@ -47,21 +47,21 @@ func NewMockNvmlMigModeManager(nvml nvml.Interface) Manager { func (m *nvmlMigModeManager) IsMigCapable(gpu int) (bool, error) { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return false, fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) device, ret := m.nvml.DeviceGetHandleByIndex(gpu) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return false, fmt.Errorf("error getting device handle: %v", ret) } _, _, ret = device.GetMigMode() - if ret.Value() == nvml.ERROR_NOT_SUPPORTED { + if ret == nvml.ERROR_NOT_SUPPORTED { return false, nil } - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return false, fmt.Errorf("error getting Mig mode: %v", ret) } @@ -70,18 +70,18 @@ func (m *nvmlMigModeManager) IsMigCapable(gpu int) (bool, error) { func (m *nvmlMigModeManager) GetMigMode(gpu int) (MigMode, error) { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return -1, fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) device, ret := m.nvml.DeviceGetHandleByIndex(gpu) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return -1, fmt.Errorf("error getting device handle: %v", ret) } current, _, ret := device.GetMigMode() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return -1, fmt.Errorf("error getting Mig mode settings: %v", ret) } @@ -97,13 +97,13 @@ func (m *nvmlMigModeManager) GetMigMode(gpu int) (MigMode, error) { func (m *nvmlMigModeManager) SetMigMode(gpu int, mode MigMode) error { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) device, ret := m.nvml.DeviceGetHandleByIndex(gpu) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting device handle: %v", ret) } @@ -115,7 +115,7 @@ func (m *nvmlMigModeManager) SetMigMode(gpu int, mode MigMode) error { default: return fmt.Errorf("unknown Mig mode selected: %v", mode) } - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error setting Mig mode: %v", ret) } @@ -124,18 +124,18 @@ func (m *nvmlMigModeManager) SetMigMode(gpu int, mode MigMode) error { func (m *nvmlMigModeManager) IsMigModeChangePending(gpu int) (bool, error) { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return false, fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) device, ret := m.nvml.DeviceGetHandleByIndex(gpu) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return false, fmt.Errorf("error getting device handle: %v", ret) } current, pending, ret := device.GetMigMode() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return false, fmt.Errorf("error getting Mig mode settings: %v", ret) } diff --git a/pkg/mig/mode/nvml_test.go b/pkg/mig/mode/nvml_test.go index 38e815d2..1931ce84 100644 --- a/pkg/mig/mode/nvml_test.go +++ b/pkg/mig/mode/nvml_test.go @@ -22,11 +22,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100" ) type Return = nvml.Return -type MockReturn = nvml.MockReturn type mockNvmlA100Device struct { nvml.Device @@ -37,10 +37,10 @@ type mockNvmlA100Device struct { } func NewMockNvmlLunaServer() *nvmlMigModeManager { - mls := &nvml.MockLunaServer{} + mls := &dgxa100.Server{} for i := 0; i < 8; i++ { mls.Devices[i] = &mockNvmlA100Device{ - Device: nvml.NewMockA100Device(i), + Device: dgxa100.NewDevice(i), migCapable: true, driverBusy: false, currentMigMode: nvml.DEVICE_MIG_DISABLE, @@ -52,22 +52,22 @@ func NewMockNvmlLunaServer() *nvmlMigModeManager { func (d *mockNvmlA100Device) SetMigMode(mode int) (Return, Return) { if !d.migCapable { - return MockReturn(nvml.ERROR_NOT_SUPPORTED), MockReturn(nvml.ERROR_NOT_SUPPORTED) + return nvml.ERROR_NOT_SUPPORTED, nvml.ERROR_NOT_SUPPORTED } d.pendingMigMode = mode if !d.driverBusy { d.currentMigMode = mode - return MockReturn(nvml.ERROR_IN_USE), MockReturn(nvml.SUCCESS) + return nvml.ERROR_IN_USE, nvml.SUCCESS } - return MockReturn(nvml.SUCCESS), MockReturn(nvml.SUCCESS) + return nvml.SUCCESS, nvml.SUCCESS } func (d *mockNvmlA100Device) GetMigMode() (int, int, Return) { if !d.migCapable { - return -1, -1, MockReturn(nvml.ERROR_NOT_SUPPORTED) + return -1, -1, nvml.ERROR_NOT_SUPPORTED } - return d.currentMigMode, d.pendingMigMode, MockReturn(nvml.SUCCESS) + return d.currentMigMode, d.pendingMigMode, nvml.SUCCESS } func TestNvmlIsMigCapable(t *testing.T) { @@ -75,7 +75,7 @@ func TestNvmlIsMigCapable(t *testing.T) { numGPUs, ret := manager.nvml.DeviceGetCount() require.NotNil(t, ret, "Unexpected nil return from DeviceGetCount") - require.Equal(t, ret.Value(), nvml.SUCCESS, "Unexpected return value from DeviceGetCount") + require.Equal(t, ret, nvml.SUCCESS, "Unexpected return value from DeviceGetCount") for i := 0; i < numGPUs; i++ { t.Run(fmt.Sprintf("GPU %v", i), func(t *testing.T) { @@ -83,7 +83,7 @@ func TestNvmlIsMigCapable(t *testing.T) { require.Nil(t, err, "Unexpected failure from IsMigCapable") require.True(t, capable) - server := manager.nvml.(*nvml.MockLunaServer) + server := manager.nvml.(*dgxa100.Server) device := server.Devices[i].(*mockNvmlA100Device) device.migCapable = false @@ -99,7 +99,7 @@ func TestNvmlEnableDisableMig(t *testing.T) { numGPUs, ret := manager.nvml.DeviceGetCount() require.NotNil(t, ret, "Unexpected nil return from DeviceGetCount") - require.Equal(t, ret.Value(), nvml.SUCCESS, "Unexpected return value from DeviceGetCount") + require.Equal(t, ret, nvml.SUCCESS, "Unexpected return value from DeviceGetCount") for i := 0; i < numGPUs; i++ { t.Run(fmt.Sprintf("GPU %v", i), func(t *testing.T) { @@ -117,7 +117,7 @@ func TestNvmlEnableDisableMig(t *testing.T) { require.Nil(t, err, "Unexpected failure from GetMigMode") require.Equal(t, Disabled, mode) - server := manager.nvml.(*nvml.MockLunaServer) + server := manager.nvml.(*dgxa100.Server) device := server.Devices[i].(*mockNvmlA100Device) device.driverBusy = true diff --git a/pkg/mig/state/state.go b/pkg/mig/state/state.go index b485be3c..664893dd 100644 --- a/pkg/mig/state/state.go +++ b/pkg/mig/state/state.go @@ -22,7 +22,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/NVIDIA/mig-parted/internal/nvlib" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" "github.com/NVIDIA/mig-parted/pkg/mig/config" "github.com/NVIDIA/mig-parted/pkg/mig/mode" "github.com/NVIDIA/mig-parted/pkg/types" @@ -46,7 +46,7 @@ var _ Manager = (*migStateManager)(nil) func tryNvmlShutdown(nvmlLib nvml.Interface) { ret := nvmlLib.Shutdown() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { log.Warnf("Error shutting down NVML: %v", ret) } } @@ -74,13 +74,13 @@ func NewMockMigStateManager(nvml nvml.Interface) Manager { // Fetch collects the full MIG state of all GPUs on a node and returns it in a 'MigState' struct. func (m *migStateManager) Fetch() (*types.MigState, error) { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil, fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) numGPUs, ret := m.nvml.DeviceGetCount() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil, fmt.Errorf("error getting device count: %v", ret) } @@ -96,12 +96,12 @@ func (m *migStateManager) Fetch() (*types.MigState, error) { } device, ret := m.nvml.DeviceGetHandleByIndex(gpu) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil, fmt.Errorf("error getting device handle: %v", ret) } uuid, ret := device.GetUUID() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return nil, fmt.Errorf("error getting device uuid: %v", ret) } @@ -121,7 +121,7 @@ func (m *migStateManager) Fetch() (*types.MigState, error) { err = m.nvlib.Mig.Device(device).WalkGpuInstances(func(gi nvml.GpuInstance, giProfileID int, giProfileInfo nvml.GpuInstanceProfileInfo) error { giInfo, ret := gi.GetInfo() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting GPU instance info for '%v': %v", giProfileID, ret) } @@ -157,19 +157,19 @@ func (m *migStateManager) Fetch() (*types.MigState, error) { // RestoreMode restores just the MIG mode state of all GPUs represented in the provided 'MigState'. func (m *migStateManager) RestoreMode(state *types.MigState) error { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) for _, deviceState := range state.Devices { device, ret := m.nvml.DeviceGetHandleByUUID(deviceState.UUID) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting device handle: %v", ret) } index, ret := device.GetIndex() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting device index: %v", ret) } @@ -185,7 +185,7 @@ func (m *migStateManager) RestoreMode(state *types.MigState) error { // RestoreMode restores the full MIG configuration of all GPUs represented in the provided 'MigState'. func (m *migStateManager) RestoreConfig(state *types.MigState) error { ret := m.nvml.Init() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error initializing NVML: %v", ret) } defer tryNvmlShutdown(m.nvml) @@ -196,12 +196,12 @@ func (m *migStateManager) RestoreConfig(state *types.MigState) error { } device, ret := m.nvml.DeviceGetHandleByUUID(deviceState.UUID) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting device handle: %v", ret) } index, ret := device.GetIndex() - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting device index: %v", ret) } @@ -212,24 +212,24 @@ func (m *migStateManager) RestoreConfig(state *types.MigState) error { for _, giState := range deviceState.GpuInstances { giProfileInfo, ret := device.GetGpuInstanceProfileInfo(giState.ProfileID) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting GPU instance profile info for '%v': %v", giState.ProfileID, ret) } placement := giState.Placement gi, ret := device.CreateGpuInstanceWithPlacement(&giProfileInfo, &placement) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error creating GPU instance for '%v': %v", giState.ProfileID, ret) } for _, ciState := range giState.ComputeInstances { ciProfileInfo, ret := gi.GetComputeInstanceProfileInfo(ciState.ProfileID, ciState.EngProfileID) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error getting Compute instance profile info for '(%v, %v)': %v", ciState.ProfileID, ciState.EngProfileID, ret) } _, ret = gi.CreateComputeInstance(&ciProfileInfo) - if ret.Value() != nvml.SUCCESS { + if ret != nvml.SUCCESS { return fmt.Errorf("error creating Compute instance for '(%v, %v)': %v", ciState.ProfileID, ciState.EngProfileID, ret) } } diff --git a/pkg/mig/state/state_test.go b/pkg/mig/state/state_test.go index 6ff75642..2d5429aa 100644 --- a/pkg/mig/state/state_test.go +++ b/pkg/mig/state/state_test.go @@ -22,14 +22,15 @@ import ( "github.com/stretchr/testify/require" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100" "github.com/NVIDIA/mig-parted/pkg/mig/config" "github.com/NVIDIA/mig-parted/pkg/mig/mode" "github.com/NVIDIA/mig-parted/pkg/types" ) func newMockMigStateManagerOnLunaServer() *migStateManager { - nvml := nvml.NewMockNVMLOnLunaServer() + nvml := dgxa100.New() return NewMockMigStateManager(nvml).(*migStateManager) } @@ -38,7 +39,7 @@ func TestFetchRestore(t *testing.T) { numGPUs, ret := manager.nvml.DeviceGetCount() require.NotNil(t, ret, "Unexpected nil return from DeviceGetCount") - require.Equal(t, ret.Value(), nvml.SUCCESS, "Unexpected return value from DeviceGetCount") + require.Equal(t, ret, nvml.SUCCESS, "Unexpected return value from DeviceGetCount") mcg := config.NewA100_SXM4_40GB_MigConfigGroup() diff --git a/pkg/types/mig_state.go b/pkg/types/mig_state.go index 00300ec2..dcc5bb56 100644 --- a/pkg/types/mig_state.go +++ b/pkg/types/mig_state.go @@ -18,7 +18,7 @@ package types import ( "github.com/NVIDIA/mig-parted/internal/nvlib/mig" - "github.com/NVIDIA/mig-parted/internal/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) // MigState stores the MIG state for a set of GPUs. diff --git a/pkg/types/nvdev.go b/pkg/types/nvdev.go index e17e3e70..1506aaae 100644 --- a/pkg/types/nvdev.go +++ b/pkg/types/nvdev.go @@ -22,7 +22,8 @@ import ( log "github.com/sirupsen/logrus" nvdev "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" - "github.com/NVIDIA/go-nvlib/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml/mock" ) var nvmllib nvml.Interface @@ -85,7 +86,7 @@ func nvdevParseMigProfile(profile string) (nvdev.MigProfile, error) { } func SetMockNVdevlib() { - mockDevice := &nvml.DeviceMock{ + mockDevice := &mock.Device{ GetNameFunc: func() (string, nvml.Return) { return "MockDevice", nvml.SUCCESS }, @@ -125,7 +126,7 @@ func SetMockNVdevlib() { }, } - nvmllib = &nvml.InterfaceMock{ + nvmllib = &mock.Interface{ InitFunc: func() nvml.Return { return nvml.SUCCESS }, diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/api.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/api.go index 57db8598..11aa139d 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/api.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/api.go @@ -17,10 +17,10 @@ package device import ( - "github.com/NVIDIA/go-nvlib/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) -// Interface provides the API to the 'device' package +// Interface provides the API to the 'device' package. type Interface interface { AssertValidMigProfileFormat(profile string) error GetDevices() ([]Device, error) @@ -46,7 +46,7 @@ type devicelib struct { var _ Interface = &devicelib{} -// New creates a new instance of the 'device' interface +// New creates a new instance of the 'device' interface. func New(opts ...Option) Interface { d := &devicelib{} for _, opt := range opts { @@ -68,21 +68,21 @@ func New(opts ...Option) Interface { return d } -// WithNvml provides an Option to set the NVML library used by the 'device' interface +// WithNvml provides an Option to set the NVML library used by the 'device' interface. func WithNvml(nvml nvml.Interface) Option { return func(d *devicelib) { d.nvml = nvml } } -// WithVerifySymbols provides an option to toggle whether to verify select symbols exist in dynamic libraries before calling them +// WithVerifySymbols provides an option to toggle whether to verify select symbols exist in dynamic libraries before calling them. func WithVerifySymbols(verify bool) Option { return func(d *devicelib) { d.verifySymbols = &verify } } -// WithSkippedDevices provides an Option to set devices to be skipped by model name +// WithSkippedDevices provides an Option to set devices to be skipped by model name. func WithSkippedDevices(names ...string) Option { return func(d *devicelib) { if d.skippedDevices == nil { @@ -94,5 +94,5 @@ func WithSkippedDevices(names ...string) Option { } } -// Option defines a function for passing options to the New() call +// Option defines a function for passing options to the New() call. type Option func(*devicelib) diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/device.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/device.go index 49734e80..10514591 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/device.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/device.go @@ -19,10 +19,10 @@ package device import ( "fmt" - "github.com/NVIDIA/go-nvlib/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) -// Device defines the set of extended functions associated with a device.Device +// Device defines the set of extended functions associated with a device.Device. type Device interface { nvml.Device GetArchitectureAsString() (string, error) @@ -44,12 +44,12 @@ type device struct { var _ Device = &device{} -// NewDevice builds a new Device from an nvml.Device +// NewDevice builds a new Device from an nvml.Device. func (d *devicelib) NewDevice(dev nvml.Device) (Device, error) { return d.newDevice(dev) } -// NewDeviceByUUID builds a new Device from a UUID +// NewDeviceByUUID builds a new Device from a UUID. func (d *devicelib) NewDeviceByUUID(uuid string) (Device, error) { dev, ret := d.nvml.DeviceGetHandleByUUID(uuid) if ret != nvml.SUCCESS { @@ -58,12 +58,12 @@ func (d *devicelib) NewDeviceByUUID(uuid string) (Device, error) { return d.newDevice(dev) } -// newDevice creates a device from an nvml.Device +// newDevice creates a device from an nvml.Device. func (d *devicelib) newDevice(dev nvml.Device) (*device, error) { return &device{dev, d, nil}, nil } -// GetArchitectureAsString returns the Device architecture as a string +// GetArchitectureAsString returns the Device architecture as a string. func (d *device) GetArchitectureAsString() (string, error) { arch, ret := d.GetArchitecture() if ret != nvml.SUCCESS { @@ -92,7 +92,7 @@ func (d *device) GetArchitectureAsString() (string, error) { return "", fmt.Errorf("error interpreting device architecture as string: %v", arch) } -// GetBrandAsString returns the Device architecture as a string +// GetBrandAsString returns the Device architecture as a string. func (d *device) GetBrandAsString() (string, error) { brand, ret := d.GetBrand() if ret != nvml.SUCCESS { @@ -140,7 +140,7 @@ func (d *device) GetBrandAsString() (string, error) { return "", fmt.Errorf("error interpreting device brand as string: %v", brand) } -// GetCudaComputeCapabilityAsString returns the Device's CUDA compute capability as a version string +// GetCudaComputeCapabilityAsString returns the Device's CUDA compute capability as a version string. func (d *device) GetCudaComputeCapabilityAsString() (string, error) { major, minor, ret := d.GetCudaComputeCapability() if ret != nvml.SUCCESS { @@ -149,7 +149,7 @@ func (d *device) GetCudaComputeCapabilityAsString() (string, error) { return fmt.Sprintf("%d.%d", major, minor), nil } -// IsMigCapable checks if a device is capable of having MIG paprtitions created on it +// IsMigCapable checks if a device is capable of having MIG paprtitions created on it. func (d *device) IsMigCapable() (bool, error) { if !d.lib.hasSymbol("nvmlDeviceGetMigMode") { return false, nil @@ -166,7 +166,7 @@ func (d *device) IsMigCapable() (bool, error) { return true, nil } -// IsMigEnabled checks if a device has MIG mode currently enabled on it +// IsMigEnabled checks if a device has MIG mode currently enabled on it. func (d *device) IsMigEnabled() (bool, error) { if !d.lib.hasSymbol("nvmlDeviceGetMigMode") { return false, nil @@ -183,7 +183,7 @@ func (d *device) IsMigEnabled() (bool, error) { return (mode == nvml.DEVICE_MIG_ENABLE), nil } -// VisitMigDevices walks a top-level device and invokes a callback function for each MIG device configured on it +// VisitMigDevices walks a top-level device and invokes a callback function for each MIG device configured on it. func (d *device) VisitMigDevices(visit func(int, MigDevice) error) error { capable, err := d.IsMigCapable() if err != nil { @@ -221,7 +221,7 @@ func (d *device) VisitMigDevices(visit func(int, MigDevice) error) error { return nil } -// VisitMigProfiles walks a top-level device and invokes a callback function for each unique MIG Profile that can be configured on it +// VisitMigProfiles walks a top-level device and invokes a callback function for each unique MIG Profile that can be configured on it. func (d *device) VisitMigProfiles(visit func(MigProfile) error) error { capable, err := d.IsMigCapable() if err != nil { @@ -283,7 +283,7 @@ func (d *device) VisitMigProfiles(visit func(MigProfile) error) error { return nil } -// GetMigDevices gets the set of MIG devices associated with a top-level device +// GetMigDevices gets the set of MIG devices associated with a top-level device. func (d *device) GetMigDevices() ([]MigDevice, error) { var migs []MigDevice err := d.VisitMigDevices(func(j int, m MigDevice) error { @@ -296,7 +296,7 @@ func (d *device) GetMigDevices() ([]MigDevice, error) { return migs, nil } -// GetMigProfiles gets the set of unique MIG profiles associated with a top-level device +// GetMigProfiles gets the set of unique MIG profiles associated with a top-level device. func (d *device) GetMigProfiles() ([]MigProfile, error) { // Return the cached list if available if d.migProfiles != nil { @@ -313,7 +313,7 @@ func (d *device) GetMigProfiles() ([]MigProfile, error) { return nil, err } - // And cache it before returning + // And cache it before returning. d.migProfiles = profiles return profiles, nil } @@ -332,7 +332,7 @@ func (d *device) isSkipped() (bool, error) { return false, nil } -// VisitDevices visits each top-level device and invokes a callback function for it +// VisitDevices visits each top-level device and invokes a callback function for it. func (d *devicelib) VisitDevices(visit func(int, Device) error) error { count, ret := d.nvml.DeviceGetCount() if ret != nvml.SUCCESS { @@ -365,7 +365,7 @@ func (d *devicelib) VisitDevices(visit func(int, Device) error) error { return nil } -// VisitMigDevices walks a top-level device and invokes a callback function for each MIG device configured on it +// VisitMigDevices walks a top-level device and invokes a callback function for each MIG device configured on it. func (d *devicelib) VisitMigDevices(visit func(int, Device, int, MigDevice) error) error { err := d.VisitDevices(func(i int, dev Device) error { err := dev.VisitMigDevices(func(j int, mig MigDevice) error { @@ -386,7 +386,7 @@ func (d *devicelib) VisitMigDevices(visit func(int, Device, int, MigDevice) erro return nil } -// VisitMigProfiles walks a top-level device and invokes a callback function for each unique MIG profile found on them +// VisitMigProfiles walks a top-level device and invokes a callback function for each unique MIG profile found on them. func (d *devicelib) VisitMigProfiles(visit func(MigProfile) error) error { visited := make(map[string]bool) err := d.VisitDevices(func(i int, dev Device) error { @@ -414,7 +414,7 @@ func (d *devicelib) VisitMigProfiles(visit func(MigProfile) error) error { return nil } -// GetDevices gets the set of all top-level devices +// GetDevices gets the set of all top-level devices. func (d *devicelib) GetDevices() ([]Device, error) { var devs []Device err := d.VisitDevices(func(i int, dev Device) error { @@ -427,7 +427,7 @@ func (d *devicelib) GetDevices() ([]Device, error) { return devs, nil } -// GetMigDevices gets the set of MIG devices across all top-level devices +// GetMigDevices gets the set of MIG devices across all top-level devices. func (d *devicelib) GetMigDevices() ([]MigDevice, error) { var migs []MigDevice err := d.VisitMigDevices(func(i int, dev Device, j int, m MigDevice) error { @@ -440,7 +440,7 @@ func (d *devicelib) GetMigDevices() ([]MigDevice, error) { return migs, nil } -// GetMigProfiles gets the set of unique MIG profiles across all top-level devices +// GetMigProfiles gets the set of unique MIG profiles across all top-level devices. func (d *devicelib) GetMigProfiles() ([]MigProfile, error) { // Return the cached list if available if d.migProfiles != nil { @@ -457,7 +457,7 @@ func (d *devicelib) GetMigProfiles() ([]MigProfile, error) { return nil, err } - // And cache it before returning + // And cache it before returning. d.migProfiles = profiles return profiles, nil } @@ -469,5 +469,5 @@ func (d *devicelib) hasSymbol(symbol string) bool { return true } - return d.nvml.Lookup(symbol) == nil + return d.nvml.Extensions().LookupSymbol(symbol) == nil } diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/identifier.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/identifier.go index 689de6d4..114e9cd5 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/identifier.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/identifier.go @@ -27,7 +27,7 @@ import ( // This includes a device index or UUID. type Identifier string -// IsGpuIndex checks if an identifier is a full GPU index +// IsGpuIndex checks if an identifier is a full GPU index. func (i Identifier) IsGpuIndex() bool { if _, err := strconv.ParseUint(string(i), 10, 0); err != nil { return false @@ -35,7 +35,7 @@ func (i Identifier) IsGpuIndex() bool { return true } -// IsMigIndex checks if an identifier is a MIG index +// IsMigIndex checks if an identifier is a MIG index. func (i Identifier) IsMigIndex() bool { split := strings.Split(string(i), ":") if len(split) != 2 { @@ -49,13 +49,13 @@ func (i Identifier) IsMigIndex() bool { return true } -// IsUUID checks if an identifier is a UUID +// IsUUID checks if an identifier is a UUID. func (i Identifier) IsUUID() bool { return i.IsGpuUUID() || i.IsMigUUID() } -// IsGpuUUID checks if an identifier is a GPU UUID -// A GPU UUID must be of the form GPU-b1028956-cfa2-0990-bf4a-5da9abb51763 +// IsGpuUUID checks if an identifier is a GPU UUID. +// A GPU UUID must be of the form GPU-b1028956-cfa2-0990-bf4a-5da9abb51763. func (i Identifier) IsGpuUUID() bool { if !strings.HasPrefix(string(i), "GPU-") { return false @@ -64,7 +64,7 @@ func (i Identifier) IsGpuUUID() bool { return err == nil } -// IsMigUUID checks if an identifier is a MIG UUID +// IsMigUUID checks if an identifier is a MIG UUID. // A MIG UUID can be of one of two forms: // - MIG-b1028956-cfa2-0990-bf4a-5da9abb51763 // - MIG-GPU-b1028956-cfa2-0990-bf4a-5da9abb51763/3/0 diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/mig_device.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/mig_device.go index bbe3bb6e..b02d4176 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/mig_device.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/mig_device.go @@ -19,10 +19,10 @@ package device import ( "fmt" - "github.com/NVIDIA/go-nvlib/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) -// MigDevice defines the set of extended functions associated with a MIG device +// MigDevice defines the set of extended functions associated with a MIG device. type MigDevice interface { nvml.Device GetProfile() (MigProfile, error) @@ -36,7 +36,7 @@ type migdevice struct { var _ MigDevice = &migdevice{} -// NewMigDevice builds a new MigDevice from an nvml.Device +// NewMigDevice builds a new MigDevice from an nvml.Device. func (d *devicelib) NewMigDevice(handle nvml.Device) (MigDevice, error) { isMig, ret := handle.IsMigDeviceHandle() if ret != nvml.SUCCESS { @@ -48,7 +48,7 @@ func (d *devicelib) NewMigDevice(handle nvml.Device) (MigDevice, error) { return &migdevice{handle, d, nil}, nil } -// NewMigDeviceByUUID builds a new MigDevice from a UUID +// NewMigDeviceByUUID builds a new MigDevice from a UUID. func (d *devicelib) NewMigDeviceByUUID(uuid string) (MigDevice, error) { dev, ret := d.nvml.DeviceGetHandleByUUID(uuid) if ret != nvml.SUCCESS { @@ -57,7 +57,7 @@ func (d *devicelib) NewMigDeviceByUUID(uuid string) (MigDevice, error) { return d.NewMigDevice(dev) } -// GetProfile returns the MIG profile associated with a MIG device +// GetProfile returns the MIG profile associated with a MIG device. func (m *migdevice) GetProfile() (MigProfile, error) { if m.profile != nil { return m.profile, nil diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/mig_profile.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/mig_profile.go index 6f27af61..c1f0190f 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/mig_profile.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/mig_profile.go @@ -23,7 +23,7 @@ import ( "strconv" "strings" - "github.com/NVIDIA/go-nvlib/pkg/nvml" + "github.com/NVIDIA/go-nvml/pkg/nvml" ) const ( @@ -40,7 +40,7 @@ type MigProfile interface { Matches(profile string) bool } -// MigProfileInfo holds all info associated with a specific MIG profile +// MigProfileInfo holds all info associated with a specific MIG profile. type MigProfileInfo struct { C int G int @@ -119,13 +119,13 @@ func (d *devicelib) NewMigProfile(giProfileID, ciProfileID, ciEngProfileID int, return p, nil } -// AssertValidMigProfileFormat checks if the string is in the proper format to represent a MIG profile +// AssertValidMigProfileFormat checks if the string is in the proper format to represent a MIG profile. func (d *devicelib) AssertValidMigProfileFormat(profile string) error { _, _, _, _, err := parseMigProfile(profile) return err } -// ParseMigProfile converts a string representation of a MigProfile into an object +// ParseMigProfile converts a string representation of a MigProfile into an object. func (d *devicelib) ParseMigProfile(profile string) (MigProfile, error) { profiles, err := d.GetMigProfiles() if err != nil { @@ -141,7 +141,7 @@ func (d *devicelib) ParseMigProfile(profile string) (MigProfile, error) { return nil, fmt.Errorf("unable to parse profile string into a valid profile") } -// String returns the string representation of a Profile +// String returns the string representation of a Profile. func (p MigProfileInfo) String() string { var suffix string if len(p.Attributes) > 0 { @@ -153,12 +153,12 @@ func (p MigProfileInfo) String() string { return fmt.Sprintf("%dc.%dg.%dgb%s", p.C, p.G, p.GB, suffix) } -// GetInfo returns detailed info about a Profile +// GetInfo returns detailed info about a Profile. func (p MigProfileInfo) GetInfo() MigProfileInfo { return p } -// Equals checks if two Profiles are identical or not +// Equals checks if two Profiles are identical or not. func (p MigProfileInfo) Equals(other MigProfile) bool { o := other.GetInfo() if p.C != o.C { @@ -182,7 +182,7 @@ func (p MigProfileInfo) Equals(other MigProfile) bool { return true } -// Matches checks if a MigProfile matches the string passed in +// Matches checks if a MigProfile matches the string passed in. func (p MigProfileInfo) Matches(profile string) bool { c, g, gb, attrs, err := parseMigProfile(profile) if err != nil { @@ -211,26 +211,26 @@ func (p MigProfileInfo) Matches(profile string) bool { } func parseMigProfile(profile string) (int, int, int, []string, error) { - // If we are handed the empty string, we cannot parse it + // If we are handed the empty string, we cannot parse it. if profile == "" { return -1, -1, -1, nil, fmt.Errorf("profile is the empty string") } - // Split by + to separate out attributes + // Split by + to separate out attributes. split := strings.SplitN(profile, "+", 2) - // Check to make sure the c, g, and gb values match + // Check to make sure the c, g, and gb values match. c, g, gb, err := parseMigProfileFields(split[0]) if err != nil { return -1, -1, -1, nil, fmt.Errorf("cannot parse fields of '%v': %v", profile, err) } - // If we have no attributes we are done + // If we have no attributes we are done. if len(split) == 1 { return c, g, gb, nil, nil } - // Make sure we have the same set of attributes + // Make sure we have the same set of attributes. attrs, err := parseMigProfileAttributes(split[1]) if err != nil { return -1, -1, -1, nil, fmt.Errorf("cannot parse attributes of '%v': %v", profile, err) diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/ci.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/ci.go deleted file mode 100644 index 6a9d798b..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/ci.go +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -type nvmlComputeInstance nvml.ComputeInstance - -var _ ComputeInstance = (*nvmlComputeInstance)(nil) - -// GetInfo() returns info about a Compute Instance -func (ci nvmlComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { - i, r := nvml.ComputeInstance(ci).GetInfo() - info := ComputeInstanceInfo{ - Device: nvmlDevice(i.Device), - GpuInstance: nvmlGpuInstance(i.GpuInstance), - Id: i.Id, - ProfileId: i.ProfileId, - Placement: ComputeInstancePlacement(i.Placement), - } - return info, Return(r) -} - -// Destroy() destroys a Compute Instance -func (ci nvmlComputeInstance) Destroy() Return { - r := nvml.ComputeInstance(ci).Destroy() - return Return(r) -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/consts.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/consts.go deleted file mode 100644 index cba00b98..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/consts.go +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2022, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -// General untyped constants -const ( - NVLINK_MAX_LINKS = nvml.NVLINK_MAX_LINKS -) - -// Return constants -const ( - SUCCESS = Return(nvml.SUCCESS) - ERROR_UNINITIALIZED = Return(nvml.ERROR_UNINITIALIZED) - ERROR_INVALID_ARGUMENT = Return(nvml.ERROR_INVALID_ARGUMENT) - ERROR_NOT_SUPPORTED = Return(nvml.ERROR_NOT_SUPPORTED) - ERROR_NO_PERMISSION = Return(nvml.ERROR_NO_PERMISSION) - ERROR_ALREADY_INITIALIZED = Return(nvml.ERROR_ALREADY_INITIALIZED) - ERROR_NOT_FOUND = Return(nvml.ERROR_NOT_FOUND) - ERROR_INSUFFICIENT_SIZE = Return(nvml.ERROR_INSUFFICIENT_SIZE) - ERROR_INSUFFICIENT_POWER = Return(nvml.ERROR_INSUFFICIENT_POWER) - ERROR_DRIVER_NOT_LOADED = Return(nvml.ERROR_DRIVER_NOT_LOADED) - ERROR_TIMEOUT = Return(nvml.ERROR_TIMEOUT) - ERROR_IRQ_ISSUE = Return(nvml.ERROR_IRQ_ISSUE) - ERROR_LIBRARY_NOT_FOUND = Return(nvml.ERROR_LIBRARY_NOT_FOUND) - ERROR_FUNCTION_NOT_FOUND = Return(nvml.ERROR_FUNCTION_NOT_FOUND) - ERROR_CORRUPTED_INFOROM = Return(nvml.ERROR_CORRUPTED_INFOROM) - ERROR_GPU_IS_LOST = Return(nvml.ERROR_GPU_IS_LOST) - ERROR_RESET_REQUIRED = Return(nvml.ERROR_RESET_REQUIRED) - ERROR_OPERATING_SYSTEM = Return(nvml.ERROR_OPERATING_SYSTEM) - ERROR_LIB_RM_VERSION_MISMATCH = Return(nvml.ERROR_LIB_RM_VERSION_MISMATCH) - ERROR_IN_USE = Return(nvml.ERROR_IN_USE) - ERROR_MEMORY = Return(nvml.ERROR_MEMORY) - ERROR_NO_DATA = Return(nvml.ERROR_NO_DATA) - ERROR_VGPU_ECC_NOT_SUPPORTED = Return(nvml.ERROR_VGPU_ECC_NOT_SUPPORTED) - ERROR_INSUFFICIENT_RESOURCES = Return(nvml.ERROR_INSUFFICIENT_RESOURCES) - ERROR_UNKNOWN = Return(nvml.ERROR_UNKNOWN) -) - -// Device architecture constants -const ( - DEVICE_ARCH_KEPLER = nvml.DEVICE_ARCH_KEPLER - DEVICE_ARCH_MAXWELL = nvml.DEVICE_ARCH_MAXWELL - DEVICE_ARCH_PASCAL = nvml.DEVICE_ARCH_PASCAL - DEVICE_ARCH_VOLTA = nvml.DEVICE_ARCH_VOLTA - DEVICE_ARCH_TURING = nvml.DEVICE_ARCH_TURING - DEVICE_ARCH_AMPERE = nvml.DEVICE_ARCH_AMPERE - DEVICE_ARCH_ADA = nvml.DEVICE_ARCH_ADA - DEVICE_ARCH_HOPPER = nvml.DEVICE_ARCH_HOPPER - DEVICE_ARCH_UNKNOWN = nvml.DEVICE_ARCH_UNKNOWN -) - -// Device brand constants -const ( - BRAND_UNKNOWN = BrandType(nvml.BRAND_UNKNOWN) - BRAND_QUADRO = BrandType(nvml.BRAND_QUADRO) - BRAND_TESLA = BrandType(nvml.BRAND_TESLA) - BRAND_NVS = BrandType(nvml.BRAND_NVS) - BRAND_GRID = BrandType(nvml.BRAND_GRID) - BRAND_GEFORCE = BrandType(nvml.BRAND_GEFORCE) - BRAND_TITAN = BrandType(nvml.BRAND_TITAN) - BRAND_NVIDIA_VAPPS = BrandType(nvml.BRAND_NVIDIA_VAPPS) - BRAND_NVIDIA_VPC = BrandType(nvml.BRAND_NVIDIA_VPC) - BRAND_NVIDIA_VCS = BrandType(nvml.BRAND_NVIDIA_VCS) - BRAND_NVIDIA_VWS = BrandType(nvml.BRAND_NVIDIA_VWS) - BRAND_NVIDIA_CLOUD_GAMING = BrandType(nvml.BRAND_NVIDIA_CLOUD_GAMING) - BRAND_NVIDIA_VGAMING = BrandType(nvml.BRAND_NVIDIA_VGAMING) - BRAND_QUADRO_RTX = BrandType(nvml.BRAND_QUADRO_RTX) - BRAND_NVIDIA_RTX = BrandType(nvml.BRAND_NVIDIA_RTX) - BRAND_NVIDIA = BrandType(nvml.BRAND_NVIDIA) - BRAND_GEFORCE_RTX = BrandType(nvml.BRAND_GEFORCE_RTX) - BRAND_TITAN_RTX = BrandType(nvml.BRAND_TITAN_RTX) - BRAND_COUNT = BrandType(nvml.BRAND_COUNT) -) - -// MIG Mode constants -const ( - DEVICE_MIG_ENABLE = nvml.DEVICE_MIG_ENABLE - DEVICE_MIG_DISABLE = nvml.DEVICE_MIG_DISABLE -) - -// GPU Instance Profiles -const ( - GPU_INSTANCE_PROFILE_1_SLICE = nvml.GPU_INSTANCE_PROFILE_1_SLICE - GPU_INSTANCE_PROFILE_2_SLICE = nvml.GPU_INSTANCE_PROFILE_2_SLICE - GPU_INSTANCE_PROFILE_3_SLICE = nvml.GPU_INSTANCE_PROFILE_3_SLICE - GPU_INSTANCE_PROFILE_4_SLICE = nvml.GPU_INSTANCE_PROFILE_4_SLICE - GPU_INSTANCE_PROFILE_6_SLICE = nvml.GPU_INSTANCE_PROFILE_6_SLICE - GPU_INSTANCE_PROFILE_7_SLICE = nvml.GPU_INSTANCE_PROFILE_7_SLICE - GPU_INSTANCE_PROFILE_8_SLICE = nvml.GPU_INSTANCE_PROFILE_8_SLICE - GPU_INSTANCE_PROFILE_1_SLICE_REV1 = nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1 - GPU_INSTANCE_PROFILE_1_SLICE_REV2 = nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2 - GPU_INSTANCE_PROFILE_2_SLICE_REV1 = nvml.GPU_INSTANCE_PROFILE_2_SLICE_REV1 - GPU_INSTANCE_PROFILE_COUNT = nvml.GPU_INSTANCE_PROFILE_COUNT -) - -// Compute Instance Profiles -const ( - COMPUTE_INSTANCE_PROFILE_1_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE - COMPUTE_INSTANCE_PROFILE_2_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE - COMPUTE_INSTANCE_PROFILE_3_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE - COMPUTE_INSTANCE_PROFILE_4_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE - COMPUTE_INSTANCE_PROFILE_6_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_6_SLICE - COMPUTE_INSTANCE_PROFILE_7_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_7_SLICE - COMPUTE_INSTANCE_PROFILE_8_SLICE = nvml.COMPUTE_INSTANCE_PROFILE_8_SLICE - COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1 = nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1 - COMPUTE_INSTANCE_PROFILE_COUNT = nvml.COMPUTE_INSTANCE_PROFILE_COUNT -) - -// Compute Instance Engine Profiles -const ( - COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED = nvml.COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED - COMPUTE_INSTANCE_ENGINE_PROFILE_COUNT = nvml.COMPUTE_INSTANCE_ENGINE_PROFILE_COUNT -) - -// Event Types -const ( - EventTypeXidCriticalError = nvml.EventTypeXidCriticalError - EventTypeSingleBitEccError = nvml.EventTypeSingleBitEccError - EventTypeDoubleBitEccError = nvml.EventTypeDoubleBitEccError -) - -// GPU Topology enumeration -const ( - TOPOLOGY_INTERNAL = GpuTopologyLevel(nvml.TOPOLOGY_INTERNAL) - TOPOLOGY_SINGLE = GpuTopologyLevel(nvml.TOPOLOGY_SINGLE) - TOPOLOGY_MULTIPLE = GpuTopologyLevel(nvml.TOPOLOGY_MULTIPLE) - TOPOLOGY_HOSTBRIDGE = GpuTopologyLevel(nvml.TOPOLOGY_HOSTBRIDGE) - TOPOLOGY_NODE = GpuTopologyLevel(nvml.TOPOLOGY_NODE) - TOPOLOGY_SYSTEM = GpuTopologyLevel(nvml.TOPOLOGY_SYSTEM) -) - -// Generic enable/disable constants -const ( - FEATURE_DISABLED = EnableState(nvml.FEATURE_DISABLED) - FEATURE_ENABLED = EnableState(nvml.FEATURE_ENABLED) -) - -// Compute mode constants -const ( - COMPUTEMODE_DEFAULT = ComputeMode(nvml.COMPUTEMODE_DEFAULT) - COMPUTEMODE_EXCLUSIVE_THREAD = ComputeMode(nvml.COMPUTEMODE_EXCLUSIVE_THREAD) - COMPUTEMODE_PROHIBITED = ComputeMode(nvml.COMPUTEMODE_PROHIBITED) - COMPUTEMODE_EXCLUSIVE_PROCESS = ComputeMode(nvml.COMPUTEMODE_EXCLUSIVE_PROCESS) - COMPUTEMODE_COUNT = ComputeMode(nvml.COMPUTEMODE_COUNT) -) diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/device.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/device.go deleted file mode 100644 index 777a9daa..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/device.go +++ /dev/null @@ -1,215 +0,0 @@ -/** -# Copyright (c) 2022, 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 nvml - -import "github.com/NVIDIA/go-nvml/pkg/nvml" - -type nvmlDevice nvml.Device - -var _ Device = (*nvmlDevice)(nil) - -// nvmlDeviceHandle returns a pointer to the underlying device. -func (d nvmlDevice) nvmlDeviceHandle() *nvml.Device { - return (*nvml.Device)(&d) -} - -// GetIndex returns the index of a Device -func (d nvmlDevice) GetIndex() (int, Return) { - i, r := nvml.Device(d).GetIndex() - return i, Return(r) -} - -// GetPciInfo returns the PCI info of a Device -func (d nvmlDevice) GetPciInfo() (PciInfo, Return) { - p, r := nvml.Device(d).GetPciInfo() - return PciInfo(p), Return(r) -} - -// GetMemoryInfo returns the memory info of a Device -func (d nvmlDevice) GetMemoryInfo() (Memory, Return) { - p, r := nvml.Device(d).GetMemoryInfo() - return Memory(p), Return(r) -} - -// GetUUID returns the UUID of a Device -func (d nvmlDevice) GetUUID() (string, Return) { - u, r := nvml.Device(d).GetUUID() - return u, Return(r) -} - -// GetMinorNumber returns the minor number of a Device -func (d nvmlDevice) GetMinorNumber() (int, Return) { - m, r := nvml.Device(d).GetMinorNumber() - return m, Return(r) -} - -// IsMigDeviceHandle returns whether a Device is a MIG device or not -func (d nvmlDevice) IsMigDeviceHandle() (bool, Return) { - b, r := nvml.Device(d).IsMigDeviceHandle() - return b, Return(r) -} - -// GetDeviceHandleFromMigDeviceHandle returns the parent Device of a MIG device -func (d nvmlDevice) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { - p, r := nvml.Device(d).GetDeviceHandleFromMigDeviceHandle() - return nvmlDevice(p), Return(r) -} - -// SetMigMode sets the MIG mode of a Device -func (d nvmlDevice) SetMigMode(mode int) (Return, Return) { - r1, r2 := nvml.Device(d).SetMigMode(mode) - return Return(r1), Return(r2) -} - -// GetMigMode returns the MIG mode of a Device -func (d nvmlDevice) GetMigMode() (int, int, Return) { - s1, s2, r := nvml.Device(d).GetMigMode() - return s1, s2, Return(r) -} - -// GetGpuInstanceById returns the GPU Instance associated with a particular ID -func (d nvmlDevice) GetGpuInstanceById(id int) (GpuInstance, Return) { - gi, r := nvml.Device(d).GetGpuInstanceById(id) - return nvmlGpuInstance(gi), Return(r) -} - -// GetGpuInstanceProfileInfo returns the profile info of a GPU Instance -func (d nvmlDevice) GetGpuInstanceProfileInfo(profile int) (GpuInstanceProfileInfo, Return) { - p, r := nvml.Device(d).GetGpuInstanceProfileInfo(profile) - return GpuInstanceProfileInfo(p), Return(r) -} - -// GetGpuInstancePossiblePlacements returns the possible placements of a GPU Instance -func (d nvmlDevice) GetGpuInstancePossiblePlacements(info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { - nvmlPlacements, r := nvml.Device(d).GetGpuInstancePossiblePlacements((*nvml.GpuInstanceProfileInfo)(info)) - var placements []GpuInstancePlacement - for _, p := range nvmlPlacements { - placements = append(placements, GpuInstancePlacement(p)) - } - return placements, Return(r) -} - -// GetGpuInstances returns the set of GPU Instances associated with a Device -func (d nvmlDevice) GetGpuInstances(info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - nvmlGis, r := nvml.Device(d).GetGpuInstances((*nvml.GpuInstanceProfileInfo)(info)) - var gis []GpuInstance - for _, gi := range nvmlGis { - gis = append(gis, nvmlGpuInstance(gi)) - } - return gis, Return(r) -} - -// CreateGpuInstanceWithPlacement creates a GPU Instance with a specific placement -func (d nvmlDevice) CreateGpuInstanceWithPlacement(info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) { - gi, r := nvml.Device(d).CreateGpuInstanceWithPlacement((*nvml.GpuInstanceProfileInfo)(info), (*nvml.GpuInstancePlacement)(placement)) - return nvmlGpuInstance(gi), Return(r) -} - -// GetMaxMigDeviceCount returns the maximum number of MIG devices that can be created on a Device -func (d nvmlDevice) GetMaxMigDeviceCount() (int, Return) { - m, r := nvml.Device(d).GetMaxMigDeviceCount() - return m, Return(r) -} - -// GetMigDeviceHandleByIndex returns the handle to a MIG device given its index -func (d nvmlDevice) GetMigDeviceHandleByIndex(Index int) (Device, Return) { - h, r := nvml.Device(d).GetMigDeviceHandleByIndex(Index) - return nvmlDevice(h), Return(r) -} - -// GetGpuInstanceId returns the GPU Instance ID of a MIG device -func (d nvmlDevice) GetGpuInstanceId() (int, Return) { - gi, r := nvml.Device(d).GetGpuInstanceId() - return gi, Return(r) -} - -// GetComputeInstanceId returns the Compute Instance ID of a MIG device -func (d nvmlDevice) GetComputeInstanceId() (int, Return) { - ci, r := nvml.Device(d).GetComputeInstanceId() - return ci, Return(r) -} - -// GetCudaComputeCapability returns the compute capability major and minor versions for a device -func (d nvmlDevice) GetCudaComputeCapability() (int, int, Return) { - major, minor, r := nvml.Device(d).GetCudaComputeCapability() - return major, minor, Return(r) -} - -// GetAttributes returns the device attributes for a MIG device -func (d nvmlDevice) GetAttributes() (DeviceAttributes, Return) { - a, r := nvml.Device(d).GetAttributes() - return DeviceAttributes(a), Return(r) -} - -// GetName returns the product name of a Device -func (d nvmlDevice) GetName() (string, Return) { - n, r := nvml.Device(d).GetName() - return n, Return(r) -} - -// GetBrand returns the brand of a Device -func (d nvmlDevice) GetBrand() (BrandType, Return) { - b, r := nvml.Device(d).GetBrand() - return BrandType(b), Return(r) -} - -// GetArchitecture returns the architecture of a Device -func (d nvmlDevice) GetArchitecture() (DeviceArchitecture, Return) { - a, r := nvml.Device(d).GetArchitecture() - return DeviceArchitecture(a), Return(r) -} - -// RegisterEvents registers the specified event set and type with the device -func (d nvmlDevice) RegisterEvents(EventTypes uint64, Set EventSet) Return { - return Return(nvml.Device(d).RegisterEvents(EventTypes, nvml.EventSet(Set))) -} - -// GetSupportedEventTypes returns the events supported by the device -func (d nvmlDevice) GetSupportedEventTypes() (uint64, Return) { - e, r := nvml.Device(d).GetSupportedEventTypes() - return e, Return(r) -} - -// GetTopologyCommonAncestor retrieves the common ancestor for two devices. -func (d nvmlDevice) GetTopologyCommonAncestor(o Device) (GpuTopologyLevel, Return) { - other := o.nvmlDeviceHandle() - if other == nil { - return 0, ERROR_INVALID_ARGUMENT - } - - l, r := nvml.Device(d).GetTopologyCommonAncestor(*other) - return GpuTopologyLevel(l), Return(r) -} - -// GetNvLinkState retrieves the state of the device's NvLink for the link specified. -func (d nvmlDevice) GetNvLinkState(link int) (EnableState, Return) { - s, r := nvml.Device(d).GetNvLinkState(link) - return EnableState(s), Return(r) -} - -// GetNvLinkRemotePciInfo retrieves the PCI information for the remote node on a NvLink link. -// Note: pciSubSystemId is not filled in this function and is indeterminate. -func (d nvmlDevice) GetNvLinkRemotePciInfo(link int) (PciInfo, Return) { - p, r := nvml.Device(d).GetNvLinkRemotePciInfo(link) - return PciInfo(p), Return(r) -} - -// SetComputeMode sets the compute mode for the device. -func (d nvmlDevice) SetComputeMode(mode ComputeMode) Return { - r := nvml.Device(d).SetComputeMode(nvml.ComputeMode(mode)) - return Return(r) -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/device_mock.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/device_mock.go deleted file mode 100644 index 84f14722..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/device_mock.go +++ /dev/null @@ -1,1237 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" - "sync" -) - -// Ensure, that DeviceMock does implement Device. -// If this is not the case, regenerate this file with moq. -var _ Device = &DeviceMock{} - -// DeviceMock is a mock implementation of Device. -// -// func TestSomethingThatUsesDevice(t *testing.T) { -// -// // make and configure a mocked Device -// mockedDevice := &DeviceMock{ -// CreateGpuInstanceWithPlacementFunc: func(gpuInstanceProfileInfo *GpuInstanceProfileInfo, gpuInstancePlacement *GpuInstancePlacement) (GpuInstance, Return) { -// panic("mock out the CreateGpuInstanceWithPlacement method") -// }, -// GetArchitectureFunc: func() (DeviceArchitecture, Return) { -// panic("mock out the GetArchitecture method") -// }, -// GetAttributesFunc: func() (DeviceAttributes, Return) { -// panic("mock out the GetAttributes method") -// }, -// GetBrandFunc: func() (BrandType, Return) { -// panic("mock out the GetBrand method") -// }, -// GetComputeInstanceIdFunc: func() (int, Return) { -// panic("mock out the GetComputeInstanceId method") -// }, -// GetCudaComputeCapabilityFunc: func() (int, int, Return) { -// panic("mock out the GetCudaComputeCapability method") -// }, -// GetDeviceHandleFromMigDeviceHandleFunc: func() (Device, Return) { -// panic("mock out the GetDeviceHandleFromMigDeviceHandle method") -// }, -// GetGpuInstanceByIdFunc: func(ID int) (GpuInstance, Return) { -// panic("mock out the GetGpuInstanceById method") -// }, -// GetGpuInstanceIdFunc: func() (int, Return) { -// panic("mock out the GetGpuInstanceId method") -// }, -// GetGpuInstancePossiblePlacementsFunc: func(gpuInstanceProfileInfo *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { -// panic("mock out the GetGpuInstancePossiblePlacements method") -// }, -// GetGpuInstanceProfileInfoFunc: func(Profile int) (GpuInstanceProfileInfo, Return) { -// panic("mock out the GetGpuInstanceProfileInfo method") -// }, -// GetGpuInstancesFunc: func(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { -// panic("mock out the GetGpuInstances method") -// }, -// GetIndexFunc: func() (int, Return) { -// panic("mock out the GetIndex method") -// }, -// GetMaxMigDeviceCountFunc: func() (int, Return) { -// panic("mock out the GetMaxMigDeviceCount method") -// }, -// GetMemoryInfoFunc: func() (Memory, Return) { -// panic("mock out the GetMemoryInfo method") -// }, -// GetMigDeviceHandleByIndexFunc: func(Index int) (Device, Return) { -// panic("mock out the GetMigDeviceHandleByIndex method") -// }, -// GetMigModeFunc: func() (int, int, Return) { -// panic("mock out the GetMigMode method") -// }, -// GetMinorNumberFunc: func() (int, Return) { -// panic("mock out the GetMinorNumber method") -// }, -// GetNameFunc: func() (string, Return) { -// panic("mock out the GetName method") -// }, -// GetNvLinkRemotePciInfoFunc: func(n int) (PciInfo, Return) { -// panic("mock out the GetNvLinkRemotePciInfo method") -// }, -// GetNvLinkStateFunc: func(n int) (EnableState, Return) { -// panic("mock out the GetNvLinkState method") -// }, -// GetPciInfoFunc: func() (PciInfo, Return) { -// panic("mock out the GetPciInfo method") -// }, -// GetSupportedEventTypesFunc: func() (uint64, Return) { -// panic("mock out the GetSupportedEventTypes method") -// }, -// GetTopologyCommonAncestorFunc: func(device Device) (GpuTopologyLevel, Return) { -// panic("mock out the GetTopologyCommonAncestor method") -// }, -// GetUUIDFunc: func() (string, Return) { -// panic("mock out the GetUUID method") -// }, -// IsMigDeviceHandleFunc: func() (bool, Return) { -// panic("mock out the IsMigDeviceHandle method") -// }, -// RegisterEventsFunc: func(v uint64, eventSet EventSet) Return { -// panic("mock out the RegisterEvents method") -// }, -// SetComputeModeFunc: func(computeMode ComputeMode) Return { -// panic("mock out the SetComputeMode method") -// }, -// SetMigModeFunc: func(Mode int) (Return, Return) { -// panic("mock out the SetMigMode method") -// }, -// nvmlDeviceHandleFunc: func() *nvml.Device { -// panic("mock out the nvmlDeviceHandle method") -// }, -// } -// -// // use mockedDevice in code that requires Device -// // and then make assertions. -// -// } -type DeviceMock struct { - // CreateGpuInstanceWithPlacementFunc mocks the CreateGpuInstanceWithPlacement method. - CreateGpuInstanceWithPlacementFunc func(gpuInstanceProfileInfo *GpuInstanceProfileInfo, gpuInstancePlacement *GpuInstancePlacement) (GpuInstance, Return) - - // GetArchitectureFunc mocks the GetArchitecture method. - GetArchitectureFunc func() (DeviceArchitecture, Return) - - // GetAttributesFunc mocks the GetAttributes method. - GetAttributesFunc func() (DeviceAttributes, Return) - - // GetBrandFunc mocks the GetBrand method. - GetBrandFunc func() (BrandType, Return) - - // GetComputeInstanceIdFunc mocks the GetComputeInstanceId method. - GetComputeInstanceIdFunc func() (int, Return) - - // GetCudaComputeCapabilityFunc mocks the GetCudaComputeCapability method. - GetCudaComputeCapabilityFunc func() (int, int, Return) - - // GetDeviceHandleFromMigDeviceHandleFunc mocks the GetDeviceHandleFromMigDeviceHandle method. - GetDeviceHandleFromMigDeviceHandleFunc func() (Device, Return) - - // GetGpuInstanceByIdFunc mocks the GetGpuInstanceById method. - GetGpuInstanceByIdFunc func(ID int) (GpuInstance, Return) - - // GetGpuInstanceIdFunc mocks the GetGpuInstanceId method. - GetGpuInstanceIdFunc func() (int, Return) - - // GetGpuInstancePossiblePlacementsFunc mocks the GetGpuInstancePossiblePlacements method. - GetGpuInstancePossiblePlacementsFunc func(gpuInstanceProfileInfo *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) - - // GetGpuInstanceProfileInfoFunc mocks the GetGpuInstanceProfileInfo method. - GetGpuInstanceProfileInfoFunc func(Profile int) (GpuInstanceProfileInfo, Return) - - // GetGpuInstancesFunc mocks the GetGpuInstances method. - GetGpuInstancesFunc func(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) - - // GetIndexFunc mocks the GetIndex method. - GetIndexFunc func() (int, Return) - - // GetMaxMigDeviceCountFunc mocks the GetMaxMigDeviceCount method. - GetMaxMigDeviceCountFunc func() (int, Return) - - // GetMemoryInfoFunc mocks the GetMemoryInfo method. - GetMemoryInfoFunc func() (Memory, Return) - - // GetMigDeviceHandleByIndexFunc mocks the GetMigDeviceHandleByIndex method. - GetMigDeviceHandleByIndexFunc func(Index int) (Device, Return) - - // GetMigModeFunc mocks the GetMigMode method. - GetMigModeFunc func() (int, int, Return) - - // GetMinorNumberFunc mocks the GetMinorNumber method. - GetMinorNumberFunc func() (int, Return) - - // GetNameFunc mocks the GetName method. - GetNameFunc func() (string, Return) - - // GetNvLinkRemotePciInfoFunc mocks the GetNvLinkRemotePciInfo method. - GetNvLinkRemotePciInfoFunc func(n int) (PciInfo, Return) - - // GetNvLinkStateFunc mocks the GetNvLinkState method. - GetNvLinkStateFunc func(n int) (EnableState, Return) - - // GetPciInfoFunc mocks the GetPciInfo method. - GetPciInfoFunc func() (PciInfo, Return) - - // GetSupportedEventTypesFunc mocks the GetSupportedEventTypes method. - GetSupportedEventTypesFunc func() (uint64, Return) - - // GetTopologyCommonAncestorFunc mocks the GetTopologyCommonAncestor method. - GetTopologyCommonAncestorFunc func(device Device) (GpuTopologyLevel, Return) - - // GetUUIDFunc mocks the GetUUID method. - GetUUIDFunc func() (string, Return) - - // IsMigDeviceHandleFunc mocks the IsMigDeviceHandle method. - IsMigDeviceHandleFunc func() (bool, Return) - - // RegisterEventsFunc mocks the RegisterEvents method. - RegisterEventsFunc func(v uint64, eventSet EventSet) Return - - // SetComputeModeFunc mocks the SetComputeMode method. - SetComputeModeFunc func(computeMode ComputeMode) Return - - // SetMigModeFunc mocks the SetMigMode method. - SetMigModeFunc func(Mode int) (Return, Return) - - // nvmlDeviceHandleFunc mocks the nvmlDeviceHandle method. - nvmlDeviceHandleFunc func() *nvml.Device - - // calls tracks calls to the methods. - calls struct { - // CreateGpuInstanceWithPlacement holds details about calls to the CreateGpuInstanceWithPlacement method. - CreateGpuInstanceWithPlacement []struct { - // GpuInstanceProfileInfo is the gpuInstanceProfileInfo argument value. - GpuInstanceProfileInfo *GpuInstanceProfileInfo - // GpuInstancePlacement is the gpuInstancePlacement argument value. - GpuInstancePlacement *GpuInstancePlacement - } - // GetArchitecture holds details about calls to the GetArchitecture method. - GetArchitecture []struct { - } - // GetAttributes holds details about calls to the GetAttributes method. - GetAttributes []struct { - } - // GetBrand holds details about calls to the GetBrand method. - GetBrand []struct { - } - // GetComputeInstanceId holds details about calls to the GetComputeInstanceId method. - GetComputeInstanceId []struct { - } - // GetCudaComputeCapability holds details about calls to the GetCudaComputeCapability method. - GetCudaComputeCapability []struct { - } - // GetDeviceHandleFromMigDeviceHandle holds details about calls to the GetDeviceHandleFromMigDeviceHandle method. - GetDeviceHandleFromMigDeviceHandle []struct { - } - // GetGpuInstanceById holds details about calls to the GetGpuInstanceById method. - GetGpuInstanceById []struct { - // ID is the ID argument value. - ID 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 *GpuInstanceProfileInfo - } - // GetGpuInstanceProfileInfo holds details about calls to the GetGpuInstanceProfileInfo method. - GetGpuInstanceProfileInfo []struct { - // Profile is the Profile argument value. - Profile int - } - // GetGpuInstances holds details about calls to the GetGpuInstances method. - GetGpuInstances []struct { - // Info is the Info argument value. - Info *GpuInstanceProfileInfo - } - // GetIndex holds details about calls to the GetIndex method. - GetIndex []struct { - } - // GetMaxMigDeviceCount holds details about calls to the GetMaxMigDeviceCount method. - GetMaxMigDeviceCount []struct { - } - // GetMemoryInfo holds details about calls to the GetMemoryInfo method. - GetMemoryInfo []struct { - } - // GetMigDeviceHandleByIndex holds details about calls to the GetMigDeviceHandleByIndex method. - GetMigDeviceHandleByIndex []struct { - // Index is the Index argument value. - Index int - } - // GetMigMode holds details about calls to the GetMigMode method. - GetMigMode []struct { - } - // GetMinorNumber holds details about calls to the GetMinorNumber method. - GetMinorNumber []struct { - } - // GetName holds details about calls to the GetName method. - GetName []struct { - } - // 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 - } - // GetPciInfo holds details about calls to the GetPciInfo method. - GetPciInfo []struct { - } - // GetSupportedEventTypes holds details about calls to the GetSupportedEventTypes method. - GetSupportedEventTypes []struct { - } - // GetTopologyCommonAncestor holds details about calls to the GetTopologyCommonAncestor method. - GetTopologyCommonAncestor []struct { - // Device is the device argument value. - Device Device - } - // GetUUID holds details about calls to the GetUUID method. - GetUUID []struct { - } - // IsMigDeviceHandle holds details about calls to the IsMigDeviceHandle method. - IsMigDeviceHandle []struct { - } - // 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 EventSet - } - // SetComputeMode holds details about calls to the SetComputeMode method. - SetComputeMode []struct { - // ComputeMode is the computeMode argument value. - ComputeMode ComputeMode - } - // SetMigMode holds details about calls to the SetMigMode method. - SetMigMode []struct { - // Mode is the Mode argument value. - Mode int - } - // nvmlDeviceHandle holds details about calls to the nvmlDeviceHandle method. - nvmlDeviceHandle []struct { - } - } - lockCreateGpuInstanceWithPlacement sync.RWMutex - lockGetArchitecture sync.RWMutex - lockGetAttributes sync.RWMutex - lockGetBrand sync.RWMutex - lockGetComputeInstanceId sync.RWMutex - lockGetCudaComputeCapability sync.RWMutex - lockGetDeviceHandleFromMigDeviceHandle sync.RWMutex - lockGetGpuInstanceById sync.RWMutex - lockGetGpuInstanceId sync.RWMutex - lockGetGpuInstancePossiblePlacements sync.RWMutex - lockGetGpuInstanceProfileInfo sync.RWMutex - lockGetGpuInstances sync.RWMutex - lockGetIndex sync.RWMutex - lockGetMaxMigDeviceCount sync.RWMutex - lockGetMemoryInfo sync.RWMutex - lockGetMigDeviceHandleByIndex sync.RWMutex - lockGetMigMode sync.RWMutex - lockGetMinorNumber sync.RWMutex - lockGetName sync.RWMutex - lockGetNvLinkRemotePciInfo sync.RWMutex - lockGetNvLinkState sync.RWMutex - lockGetPciInfo sync.RWMutex - lockGetSupportedEventTypes sync.RWMutex - lockGetTopologyCommonAncestor sync.RWMutex - lockGetUUID sync.RWMutex - lockIsMigDeviceHandle sync.RWMutex - lockRegisterEvents sync.RWMutex - lockSetComputeMode sync.RWMutex - lockSetMigMode sync.RWMutex - locknvmlDeviceHandle sync.RWMutex -} - -// CreateGpuInstanceWithPlacement calls CreateGpuInstanceWithPlacementFunc. -func (mock *DeviceMock) CreateGpuInstanceWithPlacement(gpuInstanceProfileInfo *GpuInstanceProfileInfo, gpuInstancePlacement *GpuInstancePlacement) (GpuInstance, Return) { - if mock.CreateGpuInstanceWithPlacementFunc == nil { - panic("DeviceMock.CreateGpuInstanceWithPlacementFunc: method is nil but Device.CreateGpuInstanceWithPlacement was just called") - } - callInfo := struct { - GpuInstanceProfileInfo *GpuInstanceProfileInfo - GpuInstancePlacement *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 *DeviceMock) CreateGpuInstanceWithPlacementCalls() []struct { - GpuInstanceProfileInfo *GpuInstanceProfileInfo - GpuInstancePlacement *GpuInstancePlacement -} { - var calls []struct { - GpuInstanceProfileInfo *GpuInstanceProfileInfo - GpuInstancePlacement *GpuInstancePlacement - } - mock.lockCreateGpuInstanceWithPlacement.RLock() - calls = mock.calls.CreateGpuInstanceWithPlacement - mock.lockCreateGpuInstanceWithPlacement.RUnlock() - return calls -} - -// GetArchitecture calls GetArchitectureFunc. -func (mock *DeviceMock) GetArchitecture() (DeviceArchitecture, Return) { - if mock.GetArchitectureFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetArchitectureCalls() []struct { -} { - var calls []struct { - } - mock.lockGetArchitecture.RLock() - calls = mock.calls.GetArchitecture - mock.lockGetArchitecture.RUnlock() - return calls -} - -// GetAttributes calls GetAttributesFunc. -func (mock *DeviceMock) GetAttributes() (DeviceAttributes, Return) { - if mock.GetAttributesFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetAttributesCalls() []struct { -} { - var calls []struct { - } - mock.lockGetAttributes.RLock() - calls = mock.calls.GetAttributes - mock.lockGetAttributes.RUnlock() - return calls -} - -// GetBrand calls GetBrandFunc. -func (mock *DeviceMock) GetBrand() (BrandType, Return) { - if mock.GetBrandFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetBrandCalls() []struct { -} { - var calls []struct { - } - mock.lockGetBrand.RLock() - calls = mock.calls.GetBrand - mock.lockGetBrand.RUnlock() - return calls -} - -// GetComputeInstanceId calls GetComputeInstanceIdFunc. -func (mock *DeviceMock) GetComputeInstanceId() (int, Return) { - if mock.GetComputeInstanceIdFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetComputeInstanceIdCalls() []struct { -} { - var calls []struct { - } - mock.lockGetComputeInstanceId.RLock() - calls = mock.calls.GetComputeInstanceId - mock.lockGetComputeInstanceId.RUnlock() - return calls -} - -// GetCudaComputeCapability calls GetCudaComputeCapabilityFunc. -func (mock *DeviceMock) GetCudaComputeCapability() (int, int, Return) { - if mock.GetCudaComputeCapabilityFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetCudaComputeCapabilityCalls() []struct { -} { - var calls []struct { - } - mock.lockGetCudaComputeCapability.RLock() - calls = mock.calls.GetCudaComputeCapability - mock.lockGetCudaComputeCapability.RUnlock() - return calls -} - -// GetDeviceHandleFromMigDeviceHandle calls GetDeviceHandleFromMigDeviceHandleFunc. -func (mock *DeviceMock) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { - if mock.GetDeviceHandleFromMigDeviceHandleFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetDeviceHandleFromMigDeviceHandleCalls() []struct { -} { - var calls []struct { - } - mock.lockGetDeviceHandleFromMigDeviceHandle.RLock() - calls = mock.calls.GetDeviceHandleFromMigDeviceHandle - mock.lockGetDeviceHandleFromMigDeviceHandle.RUnlock() - return calls -} - -// GetGpuInstanceById calls GetGpuInstanceByIdFunc. -func (mock *DeviceMock) GetGpuInstanceById(ID int) (GpuInstance, Return) { - if mock.GetGpuInstanceByIdFunc == nil { - panic("DeviceMock.GetGpuInstanceByIdFunc: method is nil but Device.GetGpuInstanceById was just called") - } - callInfo := struct { - ID int - }{ - ID: ID, - } - mock.lockGetGpuInstanceById.Lock() - mock.calls.GetGpuInstanceById = append(mock.calls.GetGpuInstanceById, callInfo) - mock.lockGetGpuInstanceById.Unlock() - return mock.GetGpuInstanceByIdFunc(ID) -} - -// GetGpuInstanceByIdCalls gets all the calls that were made to GetGpuInstanceById. -// Check the length with: -// -// len(mockedDevice.GetGpuInstanceByIdCalls()) -func (mock *DeviceMock) GetGpuInstanceByIdCalls() []struct { - ID int -} { - var calls []struct { - ID int - } - mock.lockGetGpuInstanceById.RLock() - calls = mock.calls.GetGpuInstanceById - mock.lockGetGpuInstanceById.RUnlock() - return calls -} - -// GetGpuInstanceId calls GetGpuInstanceIdFunc. -func (mock *DeviceMock) GetGpuInstanceId() (int, Return) { - if mock.GetGpuInstanceIdFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetGpuInstanceIdCalls() []struct { -} { - var calls []struct { - } - mock.lockGetGpuInstanceId.RLock() - calls = mock.calls.GetGpuInstanceId - mock.lockGetGpuInstanceId.RUnlock() - return calls -} - -// GetGpuInstancePossiblePlacements calls GetGpuInstancePossiblePlacementsFunc. -func (mock *DeviceMock) GetGpuInstancePossiblePlacements(gpuInstanceProfileInfo *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { - if mock.GetGpuInstancePossiblePlacementsFunc == nil { - panic("DeviceMock.GetGpuInstancePossiblePlacementsFunc: method is nil but Device.GetGpuInstancePossiblePlacements was just called") - } - callInfo := struct { - GpuInstanceProfileInfo *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 *DeviceMock) GetGpuInstancePossiblePlacementsCalls() []struct { - GpuInstanceProfileInfo *GpuInstanceProfileInfo -} { - var calls []struct { - GpuInstanceProfileInfo *GpuInstanceProfileInfo - } - mock.lockGetGpuInstancePossiblePlacements.RLock() - calls = mock.calls.GetGpuInstancePossiblePlacements - mock.lockGetGpuInstancePossiblePlacements.RUnlock() - return calls -} - -// GetGpuInstanceProfileInfo calls GetGpuInstanceProfileInfoFunc. -func (mock *DeviceMock) GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) { - if mock.GetGpuInstanceProfileInfoFunc == nil { - panic("DeviceMock.GetGpuInstanceProfileInfoFunc: method is nil but Device.GetGpuInstanceProfileInfo was just called") - } - callInfo := struct { - Profile int - }{ - Profile: Profile, - } - mock.lockGetGpuInstanceProfileInfo.Lock() - mock.calls.GetGpuInstanceProfileInfo = append(mock.calls.GetGpuInstanceProfileInfo, callInfo) - mock.lockGetGpuInstanceProfileInfo.Unlock() - return mock.GetGpuInstanceProfileInfoFunc(Profile) -} - -// GetGpuInstanceProfileInfoCalls gets all the calls that were made to GetGpuInstanceProfileInfo. -// Check the length with: -// -// len(mockedDevice.GetGpuInstanceProfileInfoCalls()) -func (mock *DeviceMock) GetGpuInstanceProfileInfoCalls() []struct { - Profile int -} { - var calls []struct { - Profile int - } - mock.lockGetGpuInstanceProfileInfo.RLock() - calls = mock.calls.GetGpuInstanceProfileInfo - mock.lockGetGpuInstanceProfileInfo.RUnlock() - return calls -} - -// GetGpuInstances calls GetGpuInstancesFunc. -func (mock *DeviceMock) GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - if mock.GetGpuInstancesFunc == nil { - panic("DeviceMock.GetGpuInstancesFunc: method is nil but Device.GetGpuInstances was just called") - } - callInfo := struct { - Info *GpuInstanceProfileInfo - }{ - Info: Info, - } - mock.lockGetGpuInstances.Lock() - mock.calls.GetGpuInstances = append(mock.calls.GetGpuInstances, callInfo) - mock.lockGetGpuInstances.Unlock() - return mock.GetGpuInstancesFunc(Info) -} - -// GetGpuInstancesCalls gets all the calls that were made to GetGpuInstances. -// Check the length with: -// -// len(mockedDevice.GetGpuInstancesCalls()) -func (mock *DeviceMock) GetGpuInstancesCalls() []struct { - Info *GpuInstanceProfileInfo -} { - var calls []struct { - Info *GpuInstanceProfileInfo - } - mock.lockGetGpuInstances.RLock() - calls = mock.calls.GetGpuInstances - mock.lockGetGpuInstances.RUnlock() - return calls -} - -// GetIndex calls GetIndexFunc. -func (mock *DeviceMock) GetIndex() (int, Return) { - if mock.GetIndexFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetIndexCalls() []struct { -} { - var calls []struct { - } - mock.lockGetIndex.RLock() - calls = mock.calls.GetIndex - mock.lockGetIndex.RUnlock() - return calls -} - -// GetMaxMigDeviceCount calls GetMaxMigDeviceCountFunc. -func (mock *DeviceMock) GetMaxMigDeviceCount() (int, Return) { - if mock.GetMaxMigDeviceCountFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetMaxMigDeviceCountCalls() []struct { -} { - var calls []struct { - } - mock.lockGetMaxMigDeviceCount.RLock() - calls = mock.calls.GetMaxMigDeviceCount - mock.lockGetMaxMigDeviceCount.RUnlock() - return calls -} - -// GetMemoryInfo calls GetMemoryInfoFunc. -func (mock *DeviceMock) GetMemoryInfo() (Memory, Return) { - if mock.GetMemoryInfoFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetMemoryInfoCalls() []struct { -} { - var calls []struct { - } - mock.lockGetMemoryInfo.RLock() - calls = mock.calls.GetMemoryInfo - mock.lockGetMemoryInfo.RUnlock() - return calls -} - -// GetMigDeviceHandleByIndex calls GetMigDeviceHandleByIndexFunc. -func (mock *DeviceMock) GetMigDeviceHandleByIndex(Index int) (Device, Return) { - if mock.GetMigDeviceHandleByIndexFunc == nil { - panic("DeviceMock.GetMigDeviceHandleByIndexFunc: method is nil but Device.GetMigDeviceHandleByIndex was just called") - } - callInfo := struct { - Index int - }{ - Index: Index, - } - mock.lockGetMigDeviceHandleByIndex.Lock() - mock.calls.GetMigDeviceHandleByIndex = append(mock.calls.GetMigDeviceHandleByIndex, callInfo) - mock.lockGetMigDeviceHandleByIndex.Unlock() - return mock.GetMigDeviceHandleByIndexFunc(Index) -} - -// GetMigDeviceHandleByIndexCalls gets all the calls that were made to GetMigDeviceHandleByIndex. -// Check the length with: -// -// len(mockedDevice.GetMigDeviceHandleByIndexCalls()) -func (mock *DeviceMock) GetMigDeviceHandleByIndexCalls() []struct { - Index int -} { - var calls []struct { - Index int - } - mock.lockGetMigDeviceHandleByIndex.RLock() - calls = mock.calls.GetMigDeviceHandleByIndex - mock.lockGetMigDeviceHandleByIndex.RUnlock() - return calls -} - -// GetMigMode calls GetMigModeFunc. -func (mock *DeviceMock) GetMigMode() (int, int, Return) { - if mock.GetMigModeFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetMigModeCalls() []struct { -} { - var calls []struct { - } - mock.lockGetMigMode.RLock() - calls = mock.calls.GetMigMode - mock.lockGetMigMode.RUnlock() - return calls -} - -// GetMinorNumber calls GetMinorNumberFunc. -func (mock *DeviceMock) GetMinorNumber() (int, Return) { - if mock.GetMinorNumberFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetMinorNumberCalls() []struct { -} { - var calls []struct { - } - mock.lockGetMinorNumber.RLock() - calls = mock.calls.GetMinorNumber - mock.lockGetMinorNumber.RUnlock() - return calls -} - -// GetName calls GetNameFunc. -func (mock *DeviceMock) GetName() (string, Return) { - if mock.GetNameFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetNameCalls() []struct { -} { - var calls []struct { - } - mock.lockGetName.RLock() - calls = mock.calls.GetName - mock.lockGetName.RUnlock() - return calls -} - -// GetNvLinkRemotePciInfo calls GetNvLinkRemotePciInfoFunc. -func (mock *DeviceMock) GetNvLinkRemotePciInfo(n int) (PciInfo, Return) { - if mock.GetNvLinkRemotePciInfoFunc == nil { - panic("DeviceMock.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 *DeviceMock) 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 *DeviceMock) GetNvLinkState(n int) (EnableState, Return) { - if mock.GetNvLinkStateFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetNvLinkStateCalls() []struct { - N int -} { - var calls []struct { - N int - } - mock.lockGetNvLinkState.RLock() - calls = mock.calls.GetNvLinkState - mock.lockGetNvLinkState.RUnlock() - return calls -} - -// GetPciInfo calls GetPciInfoFunc. -func (mock *DeviceMock) GetPciInfo() (PciInfo, Return) { - if mock.GetPciInfoFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetPciInfoCalls() []struct { -} { - var calls []struct { - } - mock.lockGetPciInfo.RLock() - calls = mock.calls.GetPciInfo - mock.lockGetPciInfo.RUnlock() - return calls -} - -// GetSupportedEventTypes calls GetSupportedEventTypesFunc. -func (mock *DeviceMock) GetSupportedEventTypes() (uint64, Return) { - if mock.GetSupportedEventTypesFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetSupportedEventTypesCalls() []struct { -} { - var calls []struct { - } - mock.lockGetSupportedEventTypes.RLock() - calls = mock.calls.GetSupportedEventTypes - mock.lockGetSupportedEventTypes.RUnlock() - return calls -} - -// GetTopologyCommonAncestor calls GetTopologyCommonAncestorFunc. -func (mock *DeviceMock) GetTopologyCommonAncestor(device Device) (GpuTopologyLevel, Return) { - if mock.GetTopologyCommonAncestorFunc == nil { - panic("DeviceMock.GetTopologyCommonAncestorFunc: method is nil but Device.GetTopologyCommonAncestor was just called") - } - callInfo := struct { - Device 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 *DeviceMock) GetTopologyCommonAncestorCalls() []struct { - Device Device -} { - var calls []struct { - Device Device - } - mock.lockGetTopologyCommonAncestor.RLock() - calls = mock.calls.GetTopologyCommonAncestor - mock.lockGetTopologyCommonAncestor.RUnlock() - return calls -} - -// GetUUID calls GetUUIDFunc. -func (mock *DeviceMock) GetUUID() (string, Return) { - if mock.GetUUIDFunc == nil { - panic("DeviceMock.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 *DeviceMock) GetUUIDCalls() []struct { -} { - var calls []struct { - } - mock.lockGetUUID.RLock() - calls = mock.calls.GetUUID - mock.lockGetUUID.RUnlock() - return calls -} - -// IsMigDeviceHandle calls IsMigDeviceHandleFunc. -func (mock *DeviceMock) IsMigDeviceHandle() (bool, Return) { - if mock.IsMigDeviceHandleFunc == nil { - panic("DeviceMock.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 *DeviceMock) IsMigDeviceHandleCalls() []struct { -} { - var calls []struct { - } - mock.lockIsMigDeviceHandle.RLock() - calls = mock.calls.IsMigDeviceHandle - mock.lockIsMigDeviceHandle.RUnlock() - return calls -} - -// RegisterEvents calls RegisterEventsFunc. -func (mock *DeviceMock) RegisterEvents(v uint64, eventSet EventSet) Return { - if mock.RegisterEventsFunc == nil { - panic("DeviceMock.RegisterEventsFunc: method is nil but Device.RegisterEvents was just called") - } - callInfo := struct { - V uint64 - EventSet 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 *DeviceMock) RegisterEventsCalls() []struct { - V uint64 - EventSet EventSet -} { - var calls []struct { - V uint64 - EventSet EventSet - } - mock.lockRegisterEvents.RLock() - calls = mock.calls.RegisterEvents - mock.lockRegisterEvents.RUnlock() - return calls -} - -// SetComputeMode calls SetComputeModeFunc. -func (mock *DeviceMock) SetComputeMode(computeMode ComputeMode) Return { - if mock.SetComputeModeFunc == nil { - panic("DeviceMock.SetComputeModeFunc: method is nil but Device.SetComputeMode was just called") - } - callInfo := struct { - ComputeMode 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 *DeviceMock) SetComputeModeCalls() []struct { - ComputeMode ComputeMode -} { - var calls []struct { - ComputeMode ComputeMode - } - mock.lockSetComputeMode.RLock() - calls = mock.calls.SetComputeMode - mock.lockSetComputeMode.RUnlock() - return calls -} - -// SetMigMode calls SetMigModeFunc. -func (mock *DeviceMock) SetMigMode(Mode int) (Return, Return) { - if mock.SetMigModeFunc == nil { - panic("DeviceMock.SetMigModeFunc: method is nil but Device.SetMigMode was just called") - } - callInfo := struct { - Mode int - }{ - Mode: Mode, - } - mock.lockSetMigMode.Lock() - mock.calls.SetMigMode = append(mock.calls.SetMigMode, callInfo) - mock.lockSetMigMode.Unlock() - return mock.SetMigModeFunc(Mode) -} - -// SetMigModeCalls gets all the calls that were made to SetMigMode. -// Check the length with: -// -// len(mockedDevice.SetMigModeCalls()) -func (mock *DeviceMock) SetMigModeCalls() []struct { - Mode int -} { - var calls []struct { - Mode int - } - mock.lockSetMigMode.RLock() - calls = mock.calls.SetMigMode - mock.lockSetMigMode.RUnlock() - return calls -} - -// nvmlDeviceHandle calls nvmlDeviceHandleFunc. -func (mock *DeviceMock) nvmlDeviceHandle() *nvml.Device { - if mock.nvmlDeviceHandleFunc == nil { - panic("DeviceMock.nvmlDeviceHandleFunc: method is nil but Device.nvmlDeviceHandle was just called") - } - callInfo := struct { - }{} - mock.locknvmlDeviceHandle.Lock() - mock.calls.nvmlDeviceHandle = append(mock.calls.nvmlDeviceHandle, callInfo) - mock.locknvmlDeviceHandle.Unlock() - return mock.nvmlDeviceHandleFunc() -} - -// nvmlDeviceHandleCalls gets all the calls that were made to nvmlDeviceHandle. -// Check the length with: -// -// len(mockedDevice.nvmlDeviceHandleCalls()) -func (mock *DeviceMock) nvmlDeviceHandleCalls() []struct { -} { - var calls []struct { - } - mock.locknvmlDeviceHandle.RLock() - calls = mock.calls.nvmlDeviceHandle - mock.locknvmlDeviceHandle.RUnlock() - return calls -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/event_set.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/event_set.go deleted file mode 100644 index 2e0b9e2c..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/event_set.go +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2022, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -// Wait watches for an event with the specified timeout -func (e EventSet) Wait(Timeoutms uint32) (EventData, Return) { - d, r := nvml.EventSet(e).Wait(Timeoutms) - eventData := EventData{ - Device: nvmlDevice(d.Device), - EventType: d.EventType, - EventData: d.EventData, - GpuInstanceId: d.GpuInstanceId, - ComputeInstanceId: d.ComputeInstanceId, - } - return eventData, Return(r) -} - -// Free deletes the event set -func (e EventSet) Free() Return { - return Return(nvml.EventSet(e).Free()) -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/gi.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/gi.go deleted file mode 100644 index bc4d3734..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/gi.go +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2022, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -type nvmlGpuInstance nvml.GpuInstance - -var _ GpuInstance = (*nvmlGpuInstance)(nil) - -// GetInfo returns info about a GPU Intsance -func (gi nvmlGpuInstance) GetInfo() (GpuInstanceInfo, Return) { - i, r := nvml.GpuInstance(gi).GetInfo() - info := GpuInstanceInfo{ - Device: nvmlDevice(i.Device), - Id: i.Id, - ProfileId: i.ProfileId, - Placement: GpuInstancePlacement(i.Placement), - } - return info, Return(r) -} - -// GetComputeInstanceById returns the Compute Instance associated with a particular ID. -func (gi nvmlGpuInstance) GetComputeInstanceById(id int) (ComputeInstance, Return) { - ci, r := nvml.GpuInstance(gi).GetComputeInstanceById(id) - return nvmlComputeInstance(ci), Return(r) -} - -// GetComputeInstanceProfileInfo returns info about a given Compute Instance profile -func (gi nvmlGpuInstance) GetComputeInstanceProfileInfo(profile int, engProfile int) (ComputeInstanceProfileInfo, Return) { - p, r := nvml.GpuInstance(gi).GetComputeInstanceProfileInfo(profile, engProfile) - return ComputeInstanceProfileInfo(p), Return(r) -} - -// CreateComputeInstance creates a Compute Instance within the GPU Instance -func (gi nvmlGpuInstance) CreateComputeInstance(info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - ci, r := nvml.GpuInstance(gi).CreateComputeInstance((*nvml.ComputeInstanceProfileInfo)(info)) - return nvmlComputeInstance(ci), Return(r) -} - -// GetComputeInstances returns the set of Compute Instances associated with a GPU Instance -func (gi nvmlGpuInstance) GetComputeInstances(info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - nvmlCis, r := nvml.GpuInstance(gi).GetComputeInstances((*nvml.ComputeInstanceProfileInfo)(info)) - var cis []ComputeInstance - for _, ci := range nvmlCis { - cis = append(cis, nvmlComputeInstance(ci)) - } - return cis, Return(r) -} - -// Destroy destroys a GPU Instance -func (gi nvmlGpuInstance) Destroy() Return { - r := nvml.GpuInstance(gi).Destroy() - return Return(r) -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/gi_mock.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/gi_mock.go deleted file mode 100644 index ac26cb2c..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/gi_mock.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package nvml - -import ( - "sync" -) - -// Ensure, that GpuInstanceMock does implement GpuInstance. -// If this is not the case, regenerate this file with moq. -var _ GpuInstance = &GpuInstanceMock{} - -// GpuInstanceMock is a mock implementation of GpuInstance. -// -// func TestSomethingThatUsesGpuInstance(t *testing.T) { -// -// // make and configure a mocked GpuInstance -// mockedGpuInstance := &GpuInstanceMock{ -// CreateComputeInstanceFunc: func(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { -// panic("mock out the CreateComputeInstance method") -// }, -// DestroyFunc: func() Return { -// panic("mock out the Destroy method") -// }, -// GetComputeInstanceByIdFunc: func(ID int) (ComputeInstance, Return) { -// panic("mock out the GetComputeInstanceById method") -// }, -// GetComputeInstanceProfileInfoFunc: func(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { -// panic("mock out the GetComputeInstanceProfileInfo method") -// }, -// GetComputeInstancesFunc: func(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { -// panic("mock out the GetComputeInstances method") -// }, -// GetInfoFunc: func() (GpuInstanceInfo, Return) { -// panic("mock out the GetInfo method") -// }, -// } -// -// // use mockedGpuInstance in code that requires GpuInstance -// // and then make assertions. -// -// } -type GpuInstanceMock struct { - // CreateComputeInstanceFunc mocks the CreateComputeInstance method. - CreateComputeInstanceFunc func(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) - - // DestroyFunc mocks the Destroy method. - DestroyFunc func() Return - - // GetComputeInstanceByIdFunc mocks the GetComputeInstanceById method. - GetComputeInstanceByIdFunc func(ID int) (ComputeInstance, Return) - - // GetComputeInstanceProfileInfoFunc mocks the GetComputeInstanceProfileInfo method. - GetComputeInstanceProfileInfoFunc func(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) - - // GetComputeInstancesFunc mocks the GetComputeInstances method. - GetComputeInstancesFunc func(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) - - // GetInfoFunc mocks the GetInfo method. - GetInfoFunc func() (GpuInstanceInfo, Return) - - // calls tracks calls to the methods. - calls struct { - // CreateComputeInstance holds details about calls to the CreateComputeInstance method. - CreateComputeInstance []struct { - // Info is the Info argument value. - Info *ComputeInstanceProfileInfo - } - // Destroy holds details about calls to the Destroy method. - Destroy []struct { - } - // GetComputeInstanceById holds details about calls to the GetComputeInstanceById method. - GetComputeInstanceById []struct { - // ID is the ID argument value. - ID int - } - // GetComputeInstanceProfileInfo holds details about calls to the GetComputeInstanceProfileInfo method. - GetComputeInstanceProfileInfo []struct { - // Profile is the Profile argument value. - Profile int - // EngProfile is the EngProfile argument value. - EngProfile int - } - // GetComputeInstances holds details about calls to the GetComputeInstances method. - GetComputeInstances []struct { - // Info is the Info argument value. - Info *ComputeInstanceProfileInfo - } - // GetInfo holds details about calls to the GetInfo method. - GetInfo []struct { - } - } - lockCreateComputeInstance sync.RWMutex - lockDestroy sync.RWMutex - lockGetComputeInstanceById sync.RWMutex - lockGetComputeInstanceProfileInfo sync.RWMutex - lockGetComputeInstances sync.RWMutex - lockGetInfo sync.RWMutex -} - -// CreateComputeInstance calls CreateComputeInstanceFunc. -func (mock *GpuInstanceMock) CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - if mock.CreateComputeInstanceFunc == nil { - panic("GpuInstanceMock.CreateComputeInstanceFunc: method is nil but GpuInstance.CreateComputeInstance was just called") - } - callInfo := struct { - Info *ComputeInstanceProfileInfo - }{ - Info: Info, - } - mock.lockCreateComputeInstance.Lock() - mock.calls.CreateComputeInstance = append(mock.calls.CreateComputeInstance, callInfo) - mock.lockCreateComputeInstance.Unlock() - return mock.CreateComputeInstanceFunc(Info) -} - -// CreateComputeInstanceCalls gets all the calls that were made to CreateComputeInstance. -// Check the length with: -// -// len(mockedGpuInstance.CreateComputeInstanceCalls()) -func (mock *GpuInstanceMock) CreateComputeInstanceCalls() []struct { - Info *ComputeInstanceProfileInfo -} { - var calls []struct { - Info *ComputeInstanceProfileInfo - } - mock.lockCreateComputeInstance.RLock() - calls = mock.calls.CreateComputeInstance - mock.lockCreateComputeInstance.RUnlock() - return calls -} - -// Destroy calls DestroyFunc. -func (mock *GpuInstanceMock) Destroy() Return { - if mock.DestroyFunc == nil { - panic("GpuInstanceMock.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 *GpuInstanceMock) DestroyCalls() []struct { -} { - var calls []struct { - } - mock.lockDestroy.RLock() - calls = mock.calls.Destroy - mock.lockDestroy.RUnlock() - return calls -} - -// GetComputeInstanceById calls GetComputeInstanceByIdFunc. -func (mock *GpuInstanceMock) GetComputeInstanceById(ID int) (ComputeInstance, Return) { - if mock.GetComputeInstanceByIdFunc == nil { - panic("GpuInstanceMock.GetComputeInstanceByIdFunc: method is nil but GpuInstance.GetComputeInstanceById was just called") - } - callInfo := struct { - ID int - }{ - ID: ID, - } - mock.lockGetComputeInstanceById.Lock() - mock.calls.GetComputeInstanceById = append(mock.calls.GetComputeInstanceById, callInfo) - mock.lockGetComputeInstanceById.Unlock() - return mock.GetComputeInstanceByIdFunc(ID) -} - -// GetComputeInstanceByIdCalls gets all the calls that were made to GetComputeInstanceById. -// Check the length with: -// -// len(mockedGpuInstance.GetComputeInstanceByIdCalls()) -func (mock *GpuInstanceMock) GetComputeInstanceByIdCalls() []struct { - ID int -} { - var calls []struct { - ID int - } - mock.lockGetComputeInstanceById.RLock() - calls = mock.calls.GetComputeInstanceById - mock.lockGetComputeInstanceById.RUnlock() - return calls -} - -// GetComputeInstanceProfileInfo calls GetComputeInstanceProfileInfoFunc. -func (mock *GpuInstanceMock) GetComputeInstanceProfileInfo(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { - if mock.GetComputeInstanceProfileInfoFunc == nil { - panic("GpuInstanceMock.GetComputeInstanceProfileInfoFunc: method is nil but GpuInstance.GetComputeInstanceProfileInfo was just called") - } - callInfo := struct { - Profile int - EngProfile int - }{ - Profile: Profile, - EngProfile: EngProfile, - } - mock.lockGetComputeInstanceProfileInfo.Lock() - mock.calls.GetComputeInstanceProfileInfo = append(mock.calls.GetComputeInstanceProfileInfo, callInfo) - mock.lockGetComputeInstanceProfileInfo.Unlock() - return mock.GetComputeInstanceProfileInfoFunc(Profile, EngProfile) -} - -// GetComputeInstanceProfileInfoCalls gets all the calls that were made to GetComputeInstanceProfileInfo. -// Check the length with: -// -// len(mockedGpuInstance.GetComputeInstanceProfileInfoCalls()) -func (mock *GpuInstanceMock) GetComputeInstanceProfileInfoCalls() []struct { - Profile int - EngProfile int -} { - var calls []struct { - Profile int - EngProfile int - } - mock.lockGetComputeInstanceProfileInfo.RLock() - calls = mock.calls.GetComputeInstanceProfileInfo - mock.lockGetComputeInstanceProfileInfo.RUnlock() - return calls -} - -// GetComputeInstances calls GetComputeInstancesFunc. -func (mock *GpuInstanceMock) GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - if mock.GetComputeInstancesFunc == nil { - panic("GpuInstanceMock.GetComputeInstancesFunc: method is nil but GpuInstance.GetComputeInstances was just called") - } - callInfo := struct { - Info *ComputeInstanceProfileInfo - }{ - Info: Info, - } - mock.lockGetComputeInstances.Lock() - mock.calls.GetComputeInstances = append(mock.calls.GetComputeInstances, callInfo) - mock.lockGetComputeInstances.Unlock() - return mock.GetComputeInstancesFunc(Info) -} - -// GetComputeInstancesCalls gets all the calls that were made to GetComputeInstances. -// Check the length with: -// -// len(mockedGpuInstance.GetComputeInstancesCalls()) -func (mock *GpuInstanceMock) GetComputeInstancesCalls() []struct { - Info *ComputeInstanceProfileInfo -} { - var calls []struct { - Info *ComputeInstanceProfileInfo - } - mock.lockGetComputeInstances.RLock() - calls = mock.calls.GetComputeInstances - mock.lockGetComputeInstances.RUnlock() - return calls -} - -// GetInfo calls GetInfoFunc. -func (mock *GpuInstanceMock) GetInfo() (GpuInstanceInfo, Return) { - if mock.GetInfoFunc == nil { - panic("GpuInstanceMock.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 *GpuInstanceMock) GetInfoCalls() []struct { -} { - var calls []struct { - } - mock.lockGetInfo.RLock() - calls = mock.calls.GetInfo - mock.lockGetInfo.RUnlock() - return calls -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/nvml.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/nvml.go deleted file mode 100644 index fdd28de3..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/nvml.go +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2022, 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 nvml - -import ( - "sync" - - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -type nvmlLib struct { - sync.Mutex - refcount int -} - -var _ Interface = (*nvmlLib)(nil) - -// New creates a new instance of the NVML Interface -func New(opts ...Option) Interface { - o := &options{} - for _, opt := range opts { - opt(o) - } - - var nvmlOptions []nvml.LibraryOption - if o.libraryPath != "" { - nvmlOptions = append(nvmlOptions, nvml.WithLibraryPath(o.libraryPath)) - } - nvml.SetLibraryOptions(nvmlOptions...) - - return &nvmlLib{} -} - -// Lookup checks whether the specified symbol exists in the configured NVML library. -func (n *nvmlLib) Lookup(name string) error { - // TODO: For now we rely on the default NVML library and perform the lookups against this. - return nvml.GetLibrary().Lookup(name) -} - -// Init initializes an NVML Interface -func (n *nvmlLib) Init() Return { - ret := nvml.Init() - if ret != nvml.SUCCESS { - return Return(ret) - } - - n.Lock() - defer n.Unlock() - if n.refcount == 0 { - errorStringFunc = nvml.ErrorString - } - n.refcount++ - - return SUCCESS -} - -// Shutdown shuts down an NVML Interface -func (n *nvmlLib) Shutdown() Return { - ret := nvml.Shutdown() - if ret != nvml.SUCCESS { - return Return(ret) - } - - n.Lock() - defer n.Unlock() - n.refcount-- - if n.refcount == 0 { - errorStringFunc = defaultErrorStringFunc - } - - return SUCCESS -} - -// DeviceGetCount returns the total number of GPU Devices -func (n *nvmlLib) DeviceGetCount() (int, Return) { - c, r := nvml.DeviceGetCount() - return c, Return(r) -} - -// DeviceGetHandleByIndex returns a Device handle given its index -func (n *nvmlLib) DeviceGetHandleByIndex(index int) (Device, Return) { - d, r := nvml.DeviceGetHandleByIndex(index) - return nvmlDevice(d), Return(r) -} - -// DeviceGetHandleByUUID returns a Device handle given its UUID -func (n *nvmlLib) DeviceGetHandleByUUID(uuid string) (Device, Return) { - d, r := nvml.DeviceGetHandleByUUID(uuid) - return nvmlDevice(d), Return(r) -} - -// SystemGetDriverVersion returns the version of the installed NVIDIA driver -func (n *nvmlLib) SystemGetDriverVersion() (string, Return) { - v, r := nvml.SystemGetDriverVersion() - return v, Return(r) -} - -// SystemGetCudaDriverVersion returns the version of CUDA associated with the NVIDIA driver -func (n *nvmlLib) SystemGetCudaDriverVersion() (int, Return) { - v, r := nvml.SystemGetCudaDriverVersion() - return v, Return(r) -} - -// ErrorString returns the error string associated with a given return value -func (n *nvmlLib) ErrorString(ret Return) string { - return nvml.ErrorString(nvml.Return(ret)) -} - -// EventSetCreate creates an event set -func (n *nvmlLib) EventSetCreate() (EventSet, Return) { - e, r := nvml.EventSetCreate() - return EventSet(e), Return(r) -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/nvml_mock.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/nvml_mock.go deleted file mode 100644 index 00957f81..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/nvml_mock.go +++ /dev/null @@ -1,428 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package nvml - -import ( - "sync" -) - -// Ensure, that InterfaceMock does implement Interface. -// If this is not the case, regenerate this file with moq. -var _ Interface = &InterfaceMock{} - -// InterfaceMock is a mock implementation of Interface. -// -// func TestSomethingThatUsesInterface(t *testing.T) { -// -// // make and configure a mocked Interface -// mockedInterface := &InterfaceMock{ -// DeviceGetCountFunc: func() (int, Return) { -// panic("mock out the DeviceGetCount method") -// }, -// DeviceGetHandleByIndexFunc: func(Index int) (Device, Return) { -// panic("mock out the DeviceGetHandleByIndex method") -// }, -// DeviceGetHandleByUUIDFunc: func(UUID string) (Device, Return) { -// panic("mock out the DeviceGetHandleByUUID method") -// }, -// ErrorStringFunc: func(r Return) string { -// panic("mock out the ErrorString method") -// }, -// EventSetCreateFunc: func() (EventSet, Return) { -// panic("mock out the EventSetCreate method") -// }, -// InitFunc: func() Return { -// panic("mock out the Init method") -// }, -// LookupFunc: func(s string) error { -// panic("mock out the Lookup method") -// }, -// ShutdownFunc: func() Return { -// panic("mock out the Shutdown method") -// }, -// SystemGetCudaDriverVersionFunc: func() (int, Return) { -// panic("mock out the SystemGetCudaDriverVersion method") -// }, -// SystemGetDriverVersionFunc: func() (string, Return) { -// panic("mock out the SystemGetDriverVersion method") -// }, -// } -// -// // use mockedInterface in code that requires Interface -// // and then make assertions. -// -// } -type InterfaceMock struct { - // DeviceGetCountFunc mocks the DeviceGetCount method. - DeviceGetCountFunc func() (int, Return) - - // DeviceGetHandleByIndexFunc mocks the DeviceGetHandleByIndex method. - DeviceGetHandleByIndexFunc func(Index int) (Device, Return) - - // DeviceGetHandleByUUIDFunc mocks the DeviceGetHandleByUUID method. - DeviceGetHandleByUUIDFunc func(UUID string) (Device, Return) - - // ErrorStringFunc mocks the ErrorString method. - ErrorStringFunc func(r Return) string - - // EventSetCreateFunc mocks the EventSetCreate method. - EventSetCreateFunc func() (EventSet, Return) - - // InitFunc mocks the Init method. - InitFunc func() Return - - // LookupFunc mocks the Lookup method. - LookupFunc func(s string) error - - // ShutdownFunc mocks the Shutdown method. - ShutdownFunc func() Return - - // SystemGetCudaDriverVersionFunc mocks the SystemGetCudaDriverVersion method. - SystemGetCudaDriverVersionFunc func() (int, Return) - - // SystemGetDriverVersionFunc mocks the SystemGetDriverVersion method. - SystemGetDriverVersionFunc func() (string, Return) - - // calls tracks calls to the methods. - calls struct { - // DeviceGetCount holds details about calls to the DeviceGetCount method. - DeviceGetCount []struct { - } - // DeviceGetHandleByIndex holds details about calls to the DeviceGetHandleByIndex method. - DeviceGetHandleByIndex []struct { - // Index is the Index argument value. - Index int - } - // DeviceGetHandleByUUID holds details about calls to the DeviceGetHandleByUUID method. - DeviceGetHandleByUUID []struct { - // UUID is the UUID argument value. - UUID string - } - // ErrorString holds details about calls to the ErrorString method. - ErrorString []struct { - // R is the r argument value. - R Return - } - // EventSetCreate holds details about calls to the EventSetCreate method. - EventSetCreate []struct { - } - // Init holds details about calls to the Init method. - Init []struct { - } - // Lookup holds details about calls to the Lookup method. - Lookup []struct { - // S is the s argument value. - S string - } - // Shutdown holds details about calls to the Shutdown method. - Shutdown []struct { - } - // SystemGetCudaDriverVersion holds details about calls to the SystemGetCudaDriverVersion method. - SystemGetCudaDriverVersion []struct { - } - // SystemGetDriverVersion holds details about calls to the SystemGetDriverVersion method. - SystemGetDriverVersion []struct { - } - } - lockDeviceGetCount sync.RWMutex - lockDeviceGetHandleByIndex sync.RWMutex - lockDeviceGetHandleByUUID sync.RWMutex - lockErrorString sync.RWMutex - lockEventSetCreate sync.RWMutex - lockInit sync.RWMutex - lockLookup sync.RWMutex - lockShutdown sync.RWMutex - lockSystemGetCudaDriverVersion sync.RWMutex - lockSystemGetDriverVersion sync.RWMutex -} - -// DeviceGetCount calls DeviceGetCountFunc. -func (mock *InterfaceMock) DeviceGetCount() (int, Return) { - if mock.DeviceGetCountFunc == nil { - panic("InterfaceMock.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 *InterfaceMock) DeviceGetCountCalls() []struct { -} { - var calls []struct { - } - mock.lockDeviceGetCount.RLock() - calls = mock.calls.DeviceGetCount - mock.lockDeviceGetCount.RUnlock() - return calls -} - -// DeviceGetHandleByIndex calls DeviceGetHandleByIndexFunc. -func (mock *InterfaceMock) DeviceGetHandleByIndex(Index int) (Device, Return) { - if mock.DeviceGetHandleByIndexFunc == nil { - panic("InterfaceMock.DeviceGetHandleByIndexFunc: method is nil but Interface.DeviceGetHandleByIndex was just called") - } - callInfo := struct { - Index int - }{ - Index: Index, - } - mock.lockDeviceGetHandleByIndex.Lock() - mock.calls.DeviceGetHandleByIndex = append(mock.calls.DeviceGetHandleByIndex, callInfo) - mock.lockDeviceGetHandleByIndex.Unlock() - return mock.DeviceGetHandleByIndexFunc(Index) -} - -// DeviceGetHandleByIndexCalls gets all the calls that were made to DeviceGetHandleByIndex. -// Check the length with: -// -// len(mockedInterface.DeviceGetHandleByIndexCalls()) -func (mock *InterfaceMock) DeviceGetHandleByIndexCalls() []struct { - Index int -} { - var calls []struct { - Index int - } - mock.lockDeviceGetHandleByIndex.RLock() - calls = mock.calls.DeviceGetHandleByIndex - mock.lockDeviceGetHandleByIndex.RUnlock() - return calls -} - -// DeviceGetHandleByUUID calls DeviceGetHandleByUUIDFunc. -func (mock *InterfaceMock) DeviceGetHandleByUUID(UUID string) (Device, Return) { - if mock.DeviceGetHandleByUUIDFunc == nil { - panic("InterfaceMock.DeviceGetHandleByUUIDFunc: method is nil but Interface.DeviceGetHandleByUUID was just called") - } - callInfo := struct { - UUID string - }{ - UUID: UUID, - } - mock.lockDeviceGetHandleByUUID.Lock() - mock.calls.DeviceGetHandleByUUID = append(mock.calls.DeviceGetHandleByUUID, callInfo) - mock.lockDeviceGetHandleByUUID.Unlock() - return mock.DeviceGetHandleByUUIDFunc(UUID) -} - -// DeviceGetHandleByUUIDCalls gets all the calls that were made to DeviceGetHandleByUUID. -// Check the length with: -// -// len(mockedInterface.DeviceGetHandleByUUIDCalls()) -func (mock *InterfaceMock) DeviceGetHandleByUUIDCalls() []struct { - UUID string -} { - var calls []struct { - UUID string - } - mock.lockDeviceGetHandleByUUID.RLock() - calls = mock.calls.DeviceGetHandleByUUID - mock.lockDeviceGetHandleByUUID.RUnlock() - return calls -} - -// ErrorString calls ErrorStringFunc. -func (mock *InterfaceMock) ErrorString(r Return) string { - if mock.ErrorStringFunc == nil { - panic("InterfaceMock.ErrorStringFunc: method is nil but Interface.ErrorString was just called") - } - callInfo := struct { - R Return - }{ - R: r, - } - mock.lockErrorString.Lock() - mock.calls.ErrorString = append(mock.calls.ErrorString, callInfo) - mock.lockErrorString.Unlock() - return mock.ErrorStringFunc(r) -} - -// ErrorStringCalls gets all the calls that were made to ErrorString. -// Check the length with: -// -// len(mockedInterface.ErrorStringCalls()) -func (mock *InterfaceMock) ErrorStringCalls() []struct { - R Return -} { - var calls []struct { - R Return - } - mock.lockErrorString.RLock() - calls = mock.calls.ErrorString - mock.lockErrorString.RUnlock() - return calls -} - -// EventSetCreate calls EventSetCreateFunc. -func (mock *InterfaceMock) EventSetCreate() (EventSet, Return) { - if mock.EventSetCreateFunc == nil { - panic("InterfaceMock.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 *InterfaceMock) EventSetCreateCalls() []struct { -} { - var calls []struct { - } - mock.lockEventSetCreate.RLock() - calls = mock.calls.EventSetCreate - mock.lockEventSetCreate.RUnlock() - return calls -} - -// Init calls InitFunc. -func (mock *InterfaceMock) Init() Return { - if mock.InitFunc == nil { - panic("InterfaceMock.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 *InterfaceMock) InitCalls() []struct { -} { - var calls []struct { - } - mock.lockInit.RLock() - calls = mock.calls.Init - mock.lockInit.RUnlock() - return calls -} - -// Lookup calls LookupFunc. -func (mock *InterfaceMock) Lookup(s string) error { - if mock.LookupFunc == nil { - panic("InterfaceMock.LookupFunc: method is nil but Interface.Lookup was just called") - } - callInfo := struct { - S string - }{ - S: s, - } - mock.lockLookup.Lock() - mock.calls.Lookup = append(mock.calls.Lookup, callInfo) - mock.lockLookup.Unlock() - return mock.LookupFunc(s) -} - -// LookupCalls gets all the calls that were made to Lookup. -// Check the length with: -// -// len(mockedInterface.LookupCalls()) -func (mock *InterfaceMock) LookupCalls() []struct { - S string -} { - var calls []struct { - S string - } - mock.lockLookup.RLock() - calls = mock.calls.Lookup - mock.lockLookup.RUnlock() - return calls -} - -// Shutdown calls ShutdownFunc. -func (mock *InterfaceMock) Shutdown() Return { - if mock.ShutdownFunc == nil { - panic("InterfaceMock.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 *InterfaceMock) ShutdownCalls() []struct { -} { - var calls []struct { - } - mock.lockShutdown.RLock() - calls = mock.calls.Shutdown - mock.lockShutdown.RUnlock() - return calls -} - -// SystemGetCudaDriverVersion calls SystemGetCudaDriverVersionFunc. -func (mock *InterfaceMock) SystemGetCudaDriverVersion() (int, Return) { - if mock.SystemGetCudaDriverVersionFunc == nil { - panic("InterfaceMock.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 *InterfaceMock) SystemGetCudaDriverVersionCalls() []struct { -} { - var calls []struct { - } - mock.lockSystemGetCudaDriverVersion.RLock() - calls = mock.calls.SystemGetCudaDriverVersion - mock.lockSystemGetCudaDriverVersion.RUnlock() - return calls -} - -// SystemGetDriverVersion calls SystemGetDriverVersionFunc. -func (mock *InterfaceMock) SystemGetDriverVersion() (string, Return) { - if mock.SystemGetDriverVersionFunc == nil { - panic("InterfaceMock.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 *InterfaceMock) SystemGetDriverVersionCalls() []struct { -} { - var calls []struct { - } - mock.lockSystemGetDriverVersion.RLock() - calls = mock.calls.SystemGetDriverVersion - mock.lockSystemGetDriverVersion.RUnlock() - return calls -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/options.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/options.go deleted file mode 100644 index d34bb237..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/options.go +++ /dev/null @@ -1,32 +0,0 @@ -/** -# Copyright 2023 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 nvml - -// options represents the options that could be passed to the nvml contructor. -type options struct { - libraryPath string -} - -// Option represents a functional option to control behaviour. -type Option func(*options) - -// WithLibraryPath sets the NVML library name to use. -func WithLibraryPath(libraryPath string) Option { - return func(o *options) { - o.libraryPath = libraryPath - } -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/return.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/return.go deleted file mode 100644 index 64cc1e19..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/return.go +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2022, 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 nvml - -import ( - "fmt" - - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -// String returns the string representation of a Return -func (r Return) String() string { - return errorStringFunc(nvml.Return(r)) -} - -// Error returns the string representation of a Return -func (r Return) Error() string { - return errorStringFunc(nvml.Return(r)) -} - -// Assigned to nvml.ErrorString if the system nvml library is in use -var errorStringFunc = defaultErrorStringFunc - -var defaultErrorStringFunc = func(r nvml.Return) string { - switch Return(r) { - case SUCCESS: - return "SUCCESS" - case ERROR_UNINITIALIZED: - return "ERROR_UNINITIALIZED" - case ERROR_INVALID_ARGUMENT: - return "ERROR_INVALID_ARGUMENT" - case ERROR_NOT_SUPPORTED: - return "ERROR_NOT_SUPPORTED" - case ERROR_NO_PERMISSION: - return "ERROR_NO_PERMISSION" - case ERROR_ALREADY_INITIALIZED: - return "ERROR_ALREADY_INITIALIZED" - case ERROR_NOT_FOUND: - return "ERROR_NOT_FOUND" - case ERROR_INSUFFICIENT_SIZE: - return "ERROR_INSUFFICIENT_SIZE" - case ERROR_INSUFFICIENT_POWER: - return "ERROR_INSUFFICIENT_POWER" - case ERROR_DRIVER_NOT_LOADED: - return "ERROR_DRIVER_NOT_LOADED" - case ERROR_TIMEOUT: - return "ERROR_TIMEOUT" - case ERROR_IRQ_ISSUE: - return "ERROR_IRQ_ISSUE" - case ERROR_LIBRARY_NOT_FOUND: - return "ERROR_LIBRARY_NOT_FOUND" - case ERROR_FUNCTION_NOT_FOUND: - return "ERROR_FUNCTION_NOT_FOUND" - case ERROR_CORRUPTED_INFOROM: - return "ERROR_CORRUPTED_INFOROM" - case ERROR_GPU_IS_LOST: - return "ERROR_GPU_IS_LOST" - case ERROR_RESET_REQUIRED: - return "ERROR_RESET_REQUIRED" - case ERROR_OPERATING_SYSTEM: - return "ERROR_OPERATING_SYSTEM" - case ERROR_LIB_RM_VERSION_MISMATCH: - return "ERROR_LIB_RM_VERSION_MISMATCH" - case ERROR_IN_USE: - return "ERROR_IN_USE" - case ERROR_MEMORY: - return "ERROR_MEMORY" - case ERROR_NO_DATA: - return "ERROR_NO_DATA" - case ERROR_VGPU_ECC_NOT_SUPPORTED: - return "ERROR_VGPU_ECC_NOT_SUPPORTED" - case ERROR_INSUFFICIENT_RESOURCES: - return "ERROR_INSUFFICIENT_RESOURCES" - case ERROR_UNKNOWN: - return "ERROR_UNKNOWN" - default: - return fmt.Sprintf("Unknown return value: %d", r) - } -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/types.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/types.go deleted file mode 100644 index d5150972..00000000 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/types.go +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2022, 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 nvml - -import ( - "github.com/NVIDIA/go-nvml/pkg/nvml" -) - -// Interface defines the functions implemented by an NVML library -// -//go:generate moq -out nvml_mock.go . Interface -type Interface interface { - DeviceGetCount() (int, Return) - DeviceGetHandleByIndex(Index int) (Device, Return) - DeviceGetHandleByUUID(UUID string) (Device, Return) - ErrorString(r Return) string - EventSetCreate() (EventSet, Return) - Init() Return - Lookup(string) error - Shutdown() Return - SystemGetCudaDriverVersion() (int, Return) - SystemGetDriverVersion() (string, Return) -} - -// Device defines the functions implemented by an NVML device -// -//go:generate moq -out device_mock.go . Device -type Device interface { - CreateGpuInstanceWithPlacement(*GpuInstanceProfileInfo, *GpuInstancePlacement) (GpuInstance, Return) - GetArchitecture() (DeviceArchitecture, Return) - GetAttributes() (DeviceAttributes, Return) - GetBrand() (BrandType, Return) - GetComputeInstanceId() (int, Return) - GetCudaComputeCapability() (int, int, Return) - GetDeviceHandleFromMigDeviceHandle() (Device, Return) - GetGpuInstanceById(ID int) (GpuInstance, Return) - GetGpuInstanceId() (int, Return) - GetGpuInstancePossiblePlacements(*GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) - GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) - GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) - GetIndex() (int, Return) - GetMaxMigDeviceCount() (int, Return) - GetMemoryInfo() (Memory, Return) - GetMigDeviceHandleByIndex(Index int) (Device, Return) - GetMigMode() (int, int, Return) - GetMinorNumber() (int, Return) - GetName() (string, Return) - GetNvLinkRemotePciInfo(int) (PciInfo, Return) - GetNvLinkState(int) (EnableState, Return) - GetPciInfo() (PciInfo, Return) - GetSupportedEventTypes() (uint64, Return) - GetTopologyCommonAncestor(Device) (GpuTopologyLevel, Return) - GetUUID() (string, Return) - IsMigDeviceHandle() (bool, Return) - RegisterEvents(uint64, EventSet) Return - SetComputeMode(ComputeMode) Return - SetMigMode(Mode int) (Return, Return) - // nvmlDeviceHandle returns a pointer to the underlying NVML device. - nvmlDeviceHandle() *nvml.Device -} - -// GpuInstance defines the functions implemented by a GpuInstance -// -//go:generate moq -out gi_mock.go . GpuInstance -type GpuInstance interface { - CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) - Destroy() Return - GetComputeInstanceById(ID int) (ComputeInstance, Return) - GetComputeInstanceProfileInfo(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) - GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) - GetInfo() (GpuInstanceInfo, Return) -} - -// ComputeInstance defines the functions implemented by a ComputeInstance -// -//go:generate moq -out ci_mock.go . ComputeInstance -type ComputeInstance interface { - Destroy() Return - GetInfo() (ComputeInstanceInfo, Return) -} - -// GpuInstanceInfo holds info about a GPU Instance -type GpuInstanceInfo struct { - Device Device - Id uint32 - ProfileId uint32 - Placement GpuInstancePlacement -} - -// ComputeInstanceInfo holds info about a Compute Instance -type ComputeInstanceInfo struct { - Device Device - GpuInstance GpuInstance - Id uint32 - ProfileId uint32 - Placement ComputeInstancePlacement -} - -// EventData defines NVML event Data -type EventData struct { - Device Device - EventType uint64 - EventData uint64 - GpuInstanceId uint32 - ComputeInstanceId uint32 -} - -// EventSet defines NVML event Data -type EventSet nvml.EventSet - -// Return defines an NVML return type -type Return nvml.Return - -// Memory holds info about GPU device memory -type Memory nvml.Memory - -// PciInfo holds info about the PCI connections of a GPU dvice -type PciInfo nvml.PciInfo - -// GpuInstanceProfileInfo holds info about a GPU Instance Profile -type GpuInstanceProfileInfo nvml.GpuInstanceProfileInfo - -// GpuInstancePlacement holds placement info about a GPU Instance -type GpuInstancePlacement nvml.GpuInstancePlacement - -// ComputeInstanceProfileInfo holds info about a Compute Instance Profile -type ComputeInstanceProfileInfo nvml.ComputeInstanceProfileInfo - -// ComputeInstancePlacement holds placement info about a Compute Instance -type ComputeInstancePlacement nvml.ComputeInstancePlacement - -// DeviceAttributes stores information about MIG devices -type DeviceAttributes nvml.DeviceAttributes - -// DeviceArchitecture represents the hardware architecture of a GPU device -type DeviceArchitecture nvml.DeviceArchitecture - -// BrandType represents the brand of a GPU device -type BrandType nvml.BrandType - -// GpuTopologyLevel represents level relationships within a system between two GPUs -type GpuTopologyLevel nvml.GpuTopologyLevel - -// EnableState represents a generic enable/disable enum -type EnableState nvml.EnableState - -// ComputeMode represents the compute mode for a device -type ComputeMode nvml.ComputeMode diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes/bytes.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes/bytes.go index 7788a1fb..04fb4aa9 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes/bytes.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes/bytes.go @@ -21,12 +21,12 @@ import ( "unsafe" ) -// Raw returns just the bytes without any assumptions about layout +// Raw returns just the bytes without any assumptions about layout. type Raw interface { Raw() *[]byte } -// Reader used to read various data sizes in the byte array +// Reader used to read various data sizes in the byte array. type Reader interface { Read8(pos int) uint8 Read16(pos int) uint16 @@ -35,7 +35,7 @@ type Reader interface { Len() int } -// Writer used to write various sizes of data in the byte array +// Writer used to write various sizes of data in the byte array. type Writer interface { Write8(pos int, value uint8) Write16(pos int, value uint16) @@ -44,7 +44,7 @@ type Writer interface { Len() int } -// Bytes object for manipulating arbitrary byte arrays +// Bytes object for manipulating arbitrary byte arrays. type Bytes interface { Raw Reader @@ -70,12 +70,12 @@ func init() { } } -// New raw bytearray +// New raw bytearray. func New(data *[]byte) Bytes { return (*native)(data) } -// NewLittleEndian little endian ordering of bytes +// NewLittleEndian little endian ordering of bytes. func NewLittleEndian(data *[]byte) Bytes { if nativeByteOrder == binary.LittleEndian { return (*native)(data) @@ -84,7 +84,7 @@ func NewLittleEndian(data *[]byte) Bytes { return (*swapbo)(data) } -// NewBigEndian big endian ordering of bytes +// NewBigEndian big endian ordering of bytes. func NewBigEndian(data *[]byte) Bytes { if nativeByteOrder == binary.BigEndian { return (*native)(data) diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/config.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/config.go index e25e72f6..397c8650 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/config.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/config.go @@ -24,24 +24,24 @@ import ( ) const ( - // PCICfgSpaceStandardSize represents the size in bytes of the standard config space + // PCICfgSpaceStandardSize represents the size in bytes of the standard config space. PCICfgSpaceStandardSize = 256 - // PCICfgSpaceExtendedSize represents the size in bytes of the extended config space + // PCICfgSpaceExtendedSize represents the size in bytes of the extended config space. PCICfgSpaceExtendedSize = 4096 - // PCICapabilityListPointer represents offset for the capability list pointer + // PCICapabilityListPointer represents offset for the capability list pointer. PCICapabilityListPointer = 0x34 - // PCIStatusCapabilityList represents the status register bit which indicates capability list support + // PCIStatusCapabilityList represents the status register bit which indicates capability list support. PCIStatusCapabilityList = 0x10 - // PCIStatusBytePosition represents the position of the status register + // PCIStatusBytePosition represents the position of the status register. PCIStatusBytePosition = 0x06 ) -// ConfigSpace PCI configuration space (standard extended) file path +// ConfigSpace PCI configuration space (standard extended) file path. type ConfigSpace struct { Path string } -// ConfigSpaceIO Interface for reading and writing raw and preconfigured values +// ConfigSpaceIO Interface for reading and writing raw and preconfigured values. type ConfigSpaceIO interface { bytes.Bytes GetVendorID() uint16 @@ -53,18 +53,18 @@ type configSpaceIO struct { bytes.Bytes } -// PCIStandardCapability standard PCI config space +// PCIStandardCapability standard PCI config space. type PCIStandardCapability struct { bytes.Bytes } -// PCIExtendedCapability extended PCI config space +// PCIExtendedCapability extended PCI config space. type PCIExtendedCapability struct { bytes.Bytes Version uint8 } -// PCICapabilities combines the standard and extended config space +// PCICapabilities combines the standard and extended config space. type PCICapabilities struct { Standard map[uint8]*PCIStandardCapability Extended map[uint16]*PCIExtendedCapability diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mlxpci.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mlxpci.go index 62937d7f..ddf7d19f 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mlxpci.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mlxpci.go @@ -22,15 +22,15 @@ import ( ) const ( - // PCIMellanoxVendorID represents PCI vendor id for Mellanox + // PCIMellanoxVendorID represents PCI vendor id for Mellanox. PCIMellanoxVendorID uint16 = 0x15b3 - // PCINetworkControllerClass represents the PCI class for network controllers + // PCINetworkControllerClass represents the PCI class for network controllers. PCINetworkControllerClass uint32 = 0x020000 - // PCIBridgeClass represents the PCI class for network controllers + // PCIBridgeClass represents the PCI class for network controllers. PCIBridgeClass uint32 = 0x060400 ) -// GetNetworkControllers returns all Mellanox Network Controller PCI devices on the system +// GetNetworkControllers returns all Mellanox Network Controller PCI devices on the system. func (p *nvpci) GetNetworkControllers() ([]*NvidiaPCIDevice, error) { devices, err := p.GetAllDevices() if err != nil { @@ -47,7 +47,7 @@ func (p *nvpci) GetNetworkControllers() ([]*NvidiaPCIDevice, error) { return filtered, nil } -// GetPciBridges retrieves all Mellanox PCI(e) Bridges +// GetPciBridges retrieves all Mellanox PCI(e) Bridges. func (p *nvpci) GetPciBridges() ([]*NvidiaPCIDevice, error) { devices, err := p.GetAllDevices() if err != nil { @@ -64,17 +64,17 @@ func (p *nvpci) GetPciBridges() ([]*NvidiaPCIDevice, error) { return filtered, nil } -// IsNetworkController if class == 0x300 +// IsNetworkController if class == 0x300. func (d *NvidiaPCIDevice) IsNetworkController() bool { return d.Class == PCINetworkControllerClass } -// IsPciBridge if class == 0x0604 +// IsPciBridge if class == 0x0604. func (d *NvidiaPCIDevice) IsPciBridge() bool { return d.Class == PCIBridgeClass } -// IsDPU returns if a device is a DPU +// IsDPU returns if a device is a DPU. func (d *NvidiaPCIDevice) IsDPU() bool { if !strings.Contains(d.DeviceName, "BlueField") { return false @@ -87,7 +87,7 @@ func (d *NvidiaPCIDevice) IsDPU() bool { return false } -// GetDPUs returns all Mellanox DPU devices on the system +// GetDPUs returns all Mellanox DPU devices on the system. func (p *nvpci) GetDPUs() ([]*NvidiaPCIDevice, error) { devices, err := p.GetNetworkControllers() if err != nil { diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio/mmio.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio/mmio.go index 1535fa04..88dd7ddf 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio/mmio.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio/mmio.go @@ -25,7 +25,7 @@ import ( "github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes" ) -// Mmio memory map a region +// Mmio memory map a region. type Mmio interface { bytes.Raw bytes.Reader @@ -84,12 +84,12 @@ func open(path string, offset int, size int, flags int) (Mmio, error) { return &mmio{bytes.New(&mmap)}, nil } -// OpenRO open region readonly +// OpenRO open region readonly. func OpenRO(path string, offset int, size int) (Mmio, error) { return open(path, offset, size, os.O_RDONLY) } -// OpenRW open region read write +// OpenRW open region read write. func OpenRW(path string, offset int, size int) (Mmio, error) { return open(path, offset, size, os.O_RDWR) } diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio/mock.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio/mock.go index 57151b3f..da3074c1 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio/mock.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio/mock.go @@ -48,18 +48,21 @@ func mockOpen(source *[]byte, offset int, size int, rw bool) (Mmio, error) { return m, nil } -// MockOpenRO open read only +// MockOpenRO open read only. func MockOpenRO(source *[]byte, offset int, size int) (Mmio, error) { return mockOpen(source, offset, size, false) } -// MockOpenRW open read write +// MockOpenRW open read write. func MockOpenRW(source *[]byte, offset int, size int) (Mmio, error) { return mockOpen(source, offset, size, true) } func (m *mockMmio) Close() error { - m = &mockMmio{} + m.Bytes = nil + m.source = nil + m.offset = 0 + m.rw = false return nil } diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mock.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mock.go index e4227121..7c1b69dd 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mock.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/mock.go @@ -24,14 +24,14 @@ import ( "github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes" ) -// MockNvpci mock pci device +// MockNvpci mock pci device. type MockNvpci struct { *nvpci } var _ Interface = (*MockNvpci)(nil) -// NewMockNvpci create new mock PCI and remove old devices +// NewMockNvpci create new mock PCI and remove old devices. func NewMockNvpci() (mock *MockNvpci, rerr error) { rootDir, err := os.MkdirTemp(os.TempDir(), "") if err != nil { @@ -50,12 +50,12 @@ func NewMockNvpci() (mock *MockNvpci, rerr error) { return mock, nil } -// Cleanup remove the mocked PCI devices root folder +// Cleanup remove the mocked PCI devices root folder. func (m *MockNvpci) Cleanup() { os.RemoveAll(m.pciDevicesRoot) } -// AddMockA100 Create an A100 like GPU mock device +// AddMockA100 Create an A100 like GPU mock device. func (m *MockNvpci) AddMockA100(address string, numaNode int) error { deviceDir := filepath.Join(m.pciDevicesRoot, address) err := os.MkdirAll(deviceDir, 0755) diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/nvpci.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/nvpci.go index 5210ff50..6d83a577 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/nvpci.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/nvpci.go @@ -29,23 +29,23 @@ import ( ) const ( - // PCIDevicesRoot represents base path for all pci devices under sysfs + // PCIDevicesRoot represents base path for all pci devices under sysfs. PCIDevicesRoot = "/sys/bus/pci/devices" - // PCINvidiaVendorID represents PCI vendor id for NVIDIA + // PCINvidiaVendorID represents PCI vendor id for NVIDIA. PCINvidiaVendorID uint16 = 0x10de - // PCIVgaControllerClass represents the PCI class for VGA Controllers + // PCIVgaControllerClass represents the PCI class for VGA Controllers. PCIVgaControllerClass uint32 = 0x030000 - // PCI3dControllerClass represents the PCI class for 3D Graphics accellerators + // PCI3dControllerClass represents the PCI class for 3D Graphics accellerators. PCI3dControllerClass uint32 = 0x030200 - // PCINvSwitchClass represents the PCI class for NVSwitches + // PCINvSwitchClass represents the PCI class for NVSwitches. PCINvSwitchClass uint32 = 0x068000 - // UnknownDeviceString is the device name to set for devices not found in the PCI database + // UnknownDeviceString is the device name to set for devices not found in the PCI database. UnknownDeviceString = "UNKNOWN_DEVICE" - // UnknownClassString is the class name to set for devices not found in the PCI database + // UnknownClassString is the class name to set for devices not found in the PCI database. UnknownClassString = "UNKNOWN_CLASS" ) -// Interface allows us to get a list of all NVIDIA PCI devices +// Interface allows us to get a list of all NVIDIA PCI devices. type Interface interface { GetAllDevices() ([]*NvidiaPCIDevice, error) Get3DControllers() ([]*NvidiaPCIDevice, error) @@ -59,10 +59,10 @@ type Interface interface { GetDPUs() ([]*NvidiaPCIDevice, error) } -// MemoryResources a more human readable handle +// MemoryResources a more human readable handle. type MemoryResources map[int]*MemoryResource -// ResourceInterface exposes some higher level functions of resources +// ResourceInterface exposes some higher level functions of resources. type ResourceInterface interface { GetTotalAddressableMemory(bool) (uint64, uint64) } @@ -76,7 +76,7 @@ type nvpci struct { var _ Interface = (*nvpci)(nil) var _ ResourceInterface = (*MemoryResources)(nil) -// NvidiaPCIDevice represents a PCI device for an NVIDIA product +// NvidiaPCIDevice represents a PCI device for an NVIDIA product. type NvidiaPCIDevice struct { Path string Address string @@ -93,34 +93,34 @@ type NvidiaPCIDevice struct { IsVF bool } -// IsVGAController if class == 0x300 +// IsVGAController if class == 0x300. func (d *NvidiaPCIDevice) IsVGAController() bool { return d.Class == PCIVgaControllerClass } -// Is3DController if class == 0x302 +// Is3DController if class == 0x302. func (d *NvidiaPCIDevice) Is3DController() bool { return d.Class == PCI3dControllerClass } -// IsNVSwitch if class == 0x068 +// IsNVSwitch if class == 0x068. func (d *NvidiaPCIDevice) IsNVSwitch() bool { return d.Class == PCINvSwitchClass } -// IsGPU either VGA for older cards or 3D for newer +// IsGPU either VGA for older cards or 3D for newer. func (d *NvidiaPCIDevice) IsGPU() bool { return d.IsVGAController() || d.Is3DController() } // IsResetAvailable some devices can be reset without rebooting, -// check if applicable +// check if applicable. func (d *NvidiaPCIDevice) IsResetAvailable() bool { _, err := os.Stat(path.Join(d.Path, "reset")) return err == nil } -// Reset perform a reset to apply a new configuration at HW level +// Reset perform a reset to apply a new configuration at HW level. func (d *NvidiaPCIDevice) Reset() error { err := os.WriteFile(path.Join(d.Path, "reset"), []byte("1"), 0) if err != nil { @@ -129,7 +129,7 @@ func (d *NvidiaPCIDevice) Reset() error { return nil } -// New interface that allows us to get a list of all NVIDIA PCI devices +// New interface that allows us to get a list of all NVIDIA PCI devices. func New(opts ...Option) Interface { n := &nvpci{} for _, opt := range opts { @@ -144,10 +144,10 @@ func New(opts ...Option) Interface { return n } -// Option defines a function for passing options to the New() call +// Option defines a function for passing options to the New() call. type Option func(*nvpci) -// WithLogger provides an Option to set the logger for the library +// WithLogger provides an Option to set the logger for the library. func WithLogger(logger logger) Option { return func(n *nvpci) { n.logger = logger @@ -170,7 +170,7 @@ func WithPCIDatabasePath(path string) Option { } } -// GetAllDevices returns all Nvidia PCI devices on the system +// GetAllDevices returns all Nvidia PCI devices on the system. func (p *nvpci) GetAllDevices() ([]*NvidiaPCIDevice, error) { deviceDirs, err := os.ReadDir(p.pciDevicesRoot) if err != nil { @@ -204,7 +204,7 @@ func (p *nvpci) GetAllDevices() ([]*NvidiaPCIDevice, error) { return nvdevices, nil } -// GetGPUByPciBusID constructs an NvidiaPCIDevice for the specified address (PCI Bus ID) +// GetGPUByPciBusID constructs an NvidiaPCIDevice for the specified address (PCI Bus ID). func (p *nvpci) GetGPUByPciBusID(address string) (*NvidiaPCIDevice, error) { devicePath := filepath.Join(p.pciDevicesRoot, address) @@ -265,7 +265,7 @@ func (p *nvpci) GetGPUByPciBusID(address string) (*NvidiaPCIDevice, error) { return nil, fmt.Errorf("unable to detect iommu_group for %s: %v", address, err) } - // device is a virtual function (VF) if "physfn" symlink exists + // device is a virtual function (VF) if "physfn" symlink exists. var isVF bool _, err = filepath.EvalSymlinks(path.Join(devicePath, "physfn")) if err == nil { @@ -347,7 +347,7 @@ func (p *nvpci) GetGPUByPciBusID(address string) (*NvidiaPCIDevice, error) { return nvdevice, nil } -// Get3DControllers returns all NVIDIA 3D Controller PCI devices on the system +// Get3DControllers returns all NVIDIA 3D Controller PCI devices on the system. func (p *nvpci) Get3DControllers() ([]*NvidiaPCIDevice, error) { devices, err := p.GetAllDevices() if err != nil { @@ -364,7 +364,7 @@ func (p *nvpci) Get3DControllers() ([]*NvidiaPCIDevice, error) { return filtered, nil } -// GetVGAControllers returns all NVIDIA VGA Controller PCI devices on the system +// GetVGAControllers returns all NVIDIA VGA Controller PCI devices on the system. func (p *nvpci) GetVGAControllers() ([]*NvidiaPCIDevice, error) { devices, err := p.GetAllDevices() if err != nil { @@ -381,7 +381,7 @@ func (p *nvpci) GetVGAControllers() ([]*NvidiaPCIDevice, error) { return filtered, nil } -// GetNVSwitches returns all NVIDIA NVSwitch PCI devices on the system +// GetNVSwitches returns all NVIDIA NVSwitch PCI devices on the system. func (p *nvpci) GetNVSwitches() ([]*NvidiaPCIDevice, error) { devices, err := p.GetAllDevices() if err != nil { @@ -398,7 +398,7 @@ func (p *nvpci) GetNVSwitches() ([]*NvidiaPCIDevice, error) { return filtered, nil } -// GetGPUs returns all NVIDIA GPU devices on the system +// GetGPUs returns all NVIDIA GPU devices on the system. func (p *nvpci) GetGPUs() ([]*NvidiaPCIDevice, error) { devices, err := p.GetAllDevices() if err != nil { @@ -415,7 +415,7 @@ func (p *nvpci) GetGPUs() ([]*NvidiaPCIDevice, error) { return filtered, nil } -// GetGPUByIndex returns an NVIDIA GPU device at a particular index +// GetGPUByIndex returns an NVIDIA GPU device at a particular index. func (p *nvpci) GetGPUByIndex(i int) (*NvidiaPCIDevice, error) { gpus, err := p.GetGPUs() if err != nil { diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/resources.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/resources.go index 6c6e53ee..b3b7d315 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/resources.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvpci/resources.go @@ -29,7 +29,7 @@ const ( pmcBigEndian = 0x01000001 ) -// MemoryResource represents a mmio region +// MemoryResource represents a mmio region. type MemoryResource struct { Start uintptr End uintptr @@ -37,7 +37,7 @@ type MemoryResource struct { Path string } -// OpenRW read write mmio region +// OpenRW read write mmio region. func (mr *MemoryResource) OpenRW() (mmio.Mmio, error) { rw, err := mmio.OpenRW(mr.Path, 0, int(mr.End-mr.Start+1)) if err != nil { @@ -52,7 +52,7 @@ func (mr *MemoryResource) OpenRW() (mmio.Mmio, error) { return nil, fmt.Errorf("unknown endianness for mmio: %v", err) } -// OpenRO read only mmio region +// OpenRO read only mmio region. func (mr *MemoryResource) OpenRO() (mmio.Mmio, error) { ro, err := mmio.OpenRO(mr.Path, 0, int(mr.End-mr.Start+1)) if err != nil { @@ -67,7 +67,7 @@ func (mr *MemoryResource) OpenRO() (mmio.Mmio, error) { return nil, fmt.Errorf("unknown endianness for mmio: %v", err) } -// From Bit Twiddling Hacks, great resource for all low level bit manipulations +// From Bit Twiddling Hacks, great resource for all low level bit manipulations. func calcNextPowerOf2(n uint64) uint64 { n-- n |= n >> 1 @@ -83,7 +83,7 @@ func calcNextPowerOf2(n uint64) uint64 { // GetTotalAddressableMemory will accumulate the 32bit and 64bit memory windows // of each BAR and round the value if needed to the next power of 2; first -// return value is the accumulated 32bit addresable memory size the second one +// return value is the accumulated 32bit addressable memory size the second one // is the accumulated 64bit addressable memory size in bytes. These values are // needed to configure virtualized environments. func (mrs MemoryResources) GetTotalAddressableMemory(roundUp bool) (uint64, uint64) { diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/pciids/pciids.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/pciids/pciids.go index 5f25c004..343df08d 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/pciids/pciids.go +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/pciids/pciids.go @@ -11,42 +11,42 @@ import ( "strings" ) -// token what the Lexer retruns +// token what the Lexer retruns. type token int const ( - // ILLEGAL a token which the Lexer does not understand + // ILLEGAL a token which the Lexer does not understand. ILLEGAL token = iota - // EOF end of file + // EOF end of file. EOF - // WS whitespace + // WS whitespace. WS - // NEWLINE '\n' + // NEWLINE '\n'. NEWLINE - // COMMENT '# something' + // COMMENT '# something'. COMMENT - // VENDOR PCI vendor + // VENDOR PCI vendor. VENDOR - // SUBVENDOR PCI subvendor + // SUBVENDOR PCI subvendor. SUBVENDOR - // DEVICE PCI device + // DEVICE PCI device. DEVICE - // CLASS PCI class + // CLASS PCI class. CLASS - // SUBCLASS PCI subclass + // SUBCLASS PCI subclass. SUBCLASS - // PROGIF PCI programming interface + // PROGIF PCI programming interface. PROGIF ) -// literal values from the Lexer +// literal values from the Lexer. type literal struct { ID string name string SubName string } -// scanner a lexical scanner +// scanner a lexical scanner. type scanner struct { r *bufio.Reader isVendor bool @@ -58,7 +58,7 @@ func newScanner(r io.Reader) *scanner { } // Since the pci.ids is line base we're consuming a whole line rather then only -// a single rune/char +// a single rune/char. func (s *scanner) readline() []byte { ln, err := s.r.ReadBytes('\n') if err == io.EOF { @@ -107,7 +107,7 @@ func isSubVendor(ln []byte) bool { return isLeadingTwoTabs(ln) } func isDevice(ln []byte) bool { return isLeadingOneTab(ln) } func isNewline(ln []byte) bool { return (ln[0] == '\n') } -// List of known device classes, subclasses and programming interfaces +// List of known device classes, subclasses and programming interfaces. func isClass(ln []byte) bool { return (ln[0] == 'C') } func isProgIf(ln []byte) bool { return isLeadingTwoTabs(ln) } func isSubClass(ln []byte) bool { return isLeadingOneTab(ln) } @@ -162,7 +162,7 @@ func (s *scanner) scan() (tok token, lit literal) { return ILLEGAL, literal{ID: string(line)} } -// parser reads the tokens returned by the Lexer and constructs the AST +// parser reads the tokens returned by the Lexer and constructs the AST. type parser struct { s *scanner buf struct { @@ -173,7 +173,7 @@ type parser struct { } // Various locations of pci.ids for different distributions. These may be more -// up to date then the embedded pci.ids db +// up to date then the embedded pci.ids db. var defaultPCIdbPaths = []string{ "/usr/share/misc/pci.ids", // Ubuntu "/usr/local/share/pci.ids", // RHEL like with manual update @@ -202,7 +202,7 @@ func NewDB(opts ...Option) Interface { return newParser(pcidbs).parse() } -// Option defines a function for passing options to the NewDB() call +// Option defines a function for passing options to the NewDB() call. type Option func(*pcidb) // WithFilePath provides an Option to set the file path @@ -216,7 +216,7 @@ func WithFilePath(path string) Option { } // newParser will attempt to read the db pci.ids from well known places or fall -// back to an internal db +// back to an internal db. func newParser(pcidbs []string) *parser { for _, db := range pcidbs { @@ -229,7 +229,7 @@ func newParser(pcidbs []string) *parser { } // We're using go embed above to have the byte array // correctly initialized with the internal shipped db - // if we cannot find an up to date in the filesystem + // if we cannot find an up to date in the filesystem. return newParserFromReader(bufio.NewReader(bytes.NewReader(defaultPCIdb))) } @@ -252,13 +252,13 @@ func (p *parser) unscan() { p.buf.n = 1 } var _ Interface = (*pcidb)(nil) -// Interface returns textual description of specific attributes of PCI devices +// Interface returns textual description of specific attributes of PCI devices. type Interface interface { GetDeviceName(uint16, uint16) (string, error) GetClassName(uint32) (string, error) } -// GetDeviceName return the textual description of the PCI device +// GetDeviceName return the textual description of the PCI device. func (d *pcidb) GetDeviceName(vendorID uint16, deviceID uint16) (string, error) { vendor, ok := d.vendors[vendorID] if !ok { @@ -273,7 +273,7 @@ func (d *pcidb) GetDeviceName(vendorID uint16, deviceID uint16) (string, error) return device.name, nil } -// GetClassName resturn the textual description of the PCI device class +// GetClassName resturn the textual description of the PCI device class. func (d *pcidb) GetClassName(classID uint32) (string, error) { class, ok := d.classes[classID] if !ok { @@ -282,53 +282,53 @@ func (d *pcidb) GetClassName(classID uint32) (string, error) { return class.name, nil } -// pcidb The complete set of PCI vendors and PCI classes +// pcidb The complete set of PCI vendors and PCI classes. type pcidb struct { vendors map[uint16]vendor classes map[uint32]class path string } -// vendor PCI vendors/devices/subVendors/SubDevices +// vendor PCI vendors/devices/subVendors/SubDevices. type vendor struct { name string devices map[uint16]device } -// subVendor PCI subVendor +// subVendor PCI subVendor. type subVendor struct { SubDevices map[uint16]SubDevice } -// SubDevice PCI SubDevice +// SubDevice PCI SubDevice. type SubDevice struct { name string } -// device PCI device +// device PCI device. type device struct { name string subVendors map[uint16]subVendor } -// class PCI classes/subClasses/Programming Interfaces +// class PCI classes/subClasses/Programming Interfaces. type class struct { name string subClasses map[uint32]subClass } -// subClass PCI subClass +// subClass PCI subClass. type subClass struct { name string progIfs map[uint8]progIf } -// progIf PCI Programming Interface +// progIf PCI Programming Interface. type progIf struct { name string } -// parse parses a PCI IDS entry +// parse parses a PCI IDS entry. func (p *parser) parse() Interface { db := &pcidb{ @@ -336,7 +336,7 @@ func (p *parser) parse() Interface { classes: map[uint32]class{}, } - // Used for housekeeping, breadcrumb for aggregated types + // Used for housekeeping, breadcrumb for aggregated types. var hkVendor vendor var hkDevice device @@ -349,8 +349,8 @@ func (p *parser) parse() Interface { for { tok, lit := p.scan() - // We're ignoring COMMENT, NEWLINE - // An EOF will break the loop + // We're ignoring COMMENT, NEWLINE. + // An EOF will break the loop. if tok == EOF { break } @@ -408,10 +408,10 @@ func (p *parser) parse() Interface { } hkSubClass = hkClass.subClasses[uint32(id)] - // Clear the last detected sub class + // Clear the last detected sub class. hkFullID = hkFullID & 0xFFFF0000 hkFullID = hkFullID | uint32(id)<<8 - // Clear the last detected prog iface + // Clear the last detected prog iface. hkFullID = hkFullID & 0xFFFFFF00 hkFullName[1] = fmt.Sprintf("%s (%02x)", lit.name, id) diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go index 4885e8e9..fdf27bda 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go @@ -16,22 +16,41 @@ package nvml -// Library defines a set of functions defined on the underlying dynamic library. -type Library interface { - Lookup(string) error +// ExtendedInterface defines a set of extensions to the core NVML API. +// +// TODO: For now the list of methods in this interface need to be kept in sync +// with the list of excluded methods for the Interface type in +// gen/nvml/generateapi.go. In the future we should automate this. +// +//go:generate moq -out mock/extendedinterface.go -pkg mock . ExtendedInterface:ExtendedInterface +type ExtendedInterface interface { + LookupSymbol(string) error } -// dynamicLibrary is an interface for abstacting the underlying library. -// This also allows for mocking and testing. +// libraryOptions hold the paramaters than can be set by a LibraryOption +type libraryOptions struct { + path string + flags int +} + +// LibraryOption represents a functional option to configure the underlying NVML library +type LibraryOption func(*libraryOptions) -//go:generate moq -stub -out dynamicLibrary_mock.go . dynamicLibrary -type dynamicLibrary interface { - Lookup(string) error - Open() error - Close() error +// WithLibraryPath provides an option to set the library name to be used by the NVML library. +func WithLibraryPath(path string) LibraryOption { + return func(o *libraryOptions) { + o.path = path + } } -// Interface represents the interface for the NVML library. -type Interface interface { - GetLibrary() Library +// SetLibraryOptions applies the specified options to the NVML library. +// If this is called when a library is already loaded, an error is raised. +func SetLibraryOptions(opts ...LibraryOption) error { + libnvml.Lock() + defer libnvml.Unlock() + if libnvml.refcount != 0 { + return errLibraryAlreadyLoaded + } + libnvml.init(opts...) + return nil } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers_static.go similarity index 89% rename from vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers.go rename to vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers_static.go index b04f3663..1f30eaae 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/cgo_helpers_static.go @@ -44,6 +44,17 @@ func uint32SliceToIntSlice(s []uint32) []int { return ret } +func convertSlice[T any, I any](input []T) []I { + output := make([]I, len(input)) + for i, obj := range input { + switch v := any(obj).(type) { + case I: + output[i] = v + } + } + return output +} + // packPCharString creates a Go string backed by *C.char and avoids copying. func packPCharString(p *C.char) (raw string) { if p != nil && *p != 0 { diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const_gen.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const_static.go similarity index 100% rename from vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const_gen.go rename to vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const_static.go diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go index 91a7baa9..7ee5e551 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go @@ -21,2632 +21,2705 @@ import ( // EccBitType type EccBitType = MemoryErrorType +// GpuInstanceInfo includes an interface type for Device instead of nvmlDevice +type GpuInstanceInfo struct { + Device Device + Id uint32 + ProfileId uint32 + Placement GpuInstancePlacement +} + +func (g GpuInstanceInfo) convert() nvmlGpuInstanceInfo { + out := nvmlGpuInstanceInfo{ + Device: g.Device.(nvmlDevice), + Id: g.Id, + ProfileId: g.ProfileId, + Placement: g.Placement, + } + return out +} + +func (g nvmlGpuInstanceInfo) convert() GpuInstanceInfo { + out := GpuInstanceInfo{ + Device: g.Device, + Id: g.Id, + ProfileId: g.ProfileId, + Placement: g.Placement, + } + return out +} + +// ComputeInstanceInfo includes an interface type for Device instead of nvmlDevice +type ComputeInstanceInfo struct { + Device Device + GpuInstance GpuInstance + Id uint32 + ProfileId uint32 + Placement ComputeInstancePlacement +} + +func (c ComputeInstanceInfo) convert() nvmlComputeInstanceInfo { + out := nvmlComputeInstanceInfo{ + Device: c.Device.(nvmlDevice), + GpuInstance: c.GpuInstance.(nvmlGpuInstance), + Id: c.Id, + ProfileId: c.ProfileId, + Placement: c.Placement, + } + return out +} + +func (c nvmlComputeInstanceInfo) convert() ComputeInstanceInfo { + out := ComputeInstanceInfo{ + Device: c.Device, + GpuInstance: c.GpuInstance, + Id: c.Id, + ProfileId: c.ProfileId, + Placement: c.Placement, + } + return out +} + // nvml.DeviceGetCount() -func DeviceGetCount() (int, Return) { - var DeviceCount uint32 - ret := nvmlDeviceGetCount(&DeviceCount) - return int(DeviceCount), ret +func (l *library) DeviceGetCount() (int, Return) { + var deviceCount uint32 + ret := nvmlDeviceGetCount(&deviceCount) + return int(deviceCount), ret } // nvml.DeviceGetHandleByIndex() -func DeviceGetHandleByIndex(Index int) (Device, Return) { - var Device Device - ret := nvmlDeviceGetHandleByIndex(uint32(Index), &Device) - return Device, ret +func (l *library) DeviceGetHandleByIndex(index int) (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetHandleByIndex(uint32(index), &device) + return device, ret } // nvml.DeviceGetHandleBySerial() -func DeviceGetHandleBySerial(Serial string) (Device, Return) { - var Device Device - ret := nvmlDeviceGetHandleBySerial(Serial+string(rune(0)), &Device) - return Device, ret +func (l *library) DeviceGetHandleBySerial(serial string) (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetHandleBySerial(serial+string(rune(0)), &device) + return device, ret } // nvml.DeviceGetHandleByUUID() -func DeviceGetHandleByUUID(Uuid string) (Device, Return) { - var Device Device - ret := nvmlDeviceGetHandleByUUID(Uuid+string(rune(0)), &Device) - return Device, ret +func (l *library) DeviceGetHandleByUUID(uuid string) (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetHandleByUUID(uuid+string(rune(0)), &device) + return device, ret } // nvml.DeviceGetHandleByPciBusId() -func DeviceGetHandleByPciBusId(PciBusId string) (Device, Return) { - var Device Device - ret := nvmlDeviceGetHandleByPciBusId(PciBusId+string(rune(0)), &Device) - return Device, ret +func (l *library) DeviceGetHandleByPciBusId(pciBusId string) (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetHandleByPciBusId(pciBusId+string(rune(0)), &device) + return device, ret } // nvml.DeviceGetName() -func DeviceGetName(Device Device) (string, Return) { - Name := make([]byte, DEVICE_NAME_V2_BUFFER_SIZE) - ret := nvmlDeviceGetName(Device, &Name[0], DEVICE_NAME_V2_BUFFER_SIZE) - return string(Name[:clen(Name)]), ret +func (l *library) DeviceGetName(device Device) (string, Return) { + return device.GetName() } -func (Device Device) GetName() (string, Return) { - return DeviceGetName(Device) +func (device nvmlDevice) GetName() (string, Return) { + name := make([]byte, DEVICE_NAME_V2_BUFFER_SIZE) + ret := nvmlDeviceGetName(device, &name[0], DEVICE_NAME_V2_BUFFER_SIZE) + return string(name[:clen(name)]), ret } // nvml.DeviceGetBrand() -func DeviceGetBrand(Device Device) (BrandType, Return) { - var _type BrandType - ret := nvmlDeviceGetBrand(Device, &_type) - return _type, ret +func (l *library) DeviceGetBrand(device Device) (BrandType, Return) { + return device.GetBrand() } -func (Device Device) GetBrand() (BrandType, Return) { - return DeviceGetBrand(Device) +func (device nvmlDevice) GetBrand() (BrandType, Return) { + var brandType BrandType + ret := nvmlDeviceGetBrand(device, &brandType) + return brandType, ret } // nvml.DeviceGetIndex() -func DeviceGetIndex(Device Device) (int, Return) { - var Index uint32 - ret := nvmlDeviceGetIndex(Device, &Index) - return int(Index), ret +func (l *library) DeviceGetIndex(device Device) (int, Return) { + return device.GetIndex() } -func (Device Device) GetIndex() (int, Return) { - return DeviceGetIndex(Device) +func (device nvmlDevice) GetIndex() (int, Return) { + var index uint32 + ret := nvmlDeviceGetIndex(device, &index) + return int(index), ret } // nvml.DeviceGetSerial() -func DeviceGetSerial(Device Device) (string, Return) { - Serial := make([]byte, DEVICE_SERIAL_BUFFER_SIZE) - ret := nvmlDeviceGetSerial(Device, &Serial[0], DEVICE_SERIAL_BUFFER_SIZE) - return string(Serial[:clen(Serial)]), ret +func (l *library) DeviceGetSerial(device Device) (string, Return) { + return device.GetSerial() } -func (Device Device) GetSerial() (string, Return) { - return DeviceGetSerial(Device) +func (device nvmlDevice) GetSerial() (string, Return) { + serial := make([]byte, DEVICE_SERIAL_BUFFER_SIZE) + ret := nvmlDeviceGetSerial(device, &serial[0], DEVICE_SERIAL_BUFFER_SIZE) + return string(serial[:clen(serial)]), ret } // nvml.DeviceGetCpuAffinity() -func DeviceGetCpuAffinity(Device Device, NumCPUs int) ([]uint, Return) { - CpuSetSize := uint32((NumCPUs-1)/int(unsafe.Sizeof(uint(0))) + 1) - CpuSet := make([]uint, CpuSetSize) - ret := nvmlDeviceGetCpuAffinity(Device, CpuSetSize, &CpuSet[0]) - return CpuSet, ret +func (l *library) DeviceGetCpuAffinity(device Device, numCPUs int) ([]uint, Return) { + return device.GetCpuAffinity(numCPUs) } -func (Device Device) GetCpuAffinity(NumCPUs int) ([]uint, Return) { - return DeviceGetCpuAffinity(Device, NumCPUs) +func (device nvmlDevice) GetCpuAffinity(numCPUs int) ([]uint, Return) { + cpuSetSize := uint32((numCPUs-1)/int(unsafe.Sizeof(uint(0))) + 1) + cpuSet := make([]uint, cpuSetSize) + ret := nvmlDeviceGetCpuAffinity(device, cpuSetSize, &cpuSet[0]) + return cpuSet, ret } // nvml.DeviceSetCpuAffinity() -func DeviceSetCpuAffinity(Device Device) Return { - return nvmlDeviceSetCpuAffinity(Device) +func (l *library) DeviceSetCpuAffinity(device Device) Return { + return device.SetCpuAffinity() } -func (Device Device) SetCpuAffinity() Return { - return DeviceSetCpuAffinity(Device) +func (device nvmlDevice) SetCpuAffinity() Return { + return nvmlDeviceSetCpuAffinity(device) } // nvml.DeviceClearCpuAffinity() -func DeviceClearCpuAffinity(Device Device) Return { - return nvmlDeviceClearCpuAffinity(Device) +func (l *library) DeviceClearCpuAffinity(device Device) Return { + return device.ClearCpuAffinity() } -func (Device Device) ClearCpuAffinity() Return { - return DeviceClearCpuAffinity(Device) +func (device nvmlDevice) ClearCpuAffinity() Return { + return nvmlDeviceClearCpuAffinity(device) } // nvml.DeviceGetMemoryAffinity() -func DeviceGetMemoryAffinity(Device Device, NumNodes int, Scope AffinityScope) ([]uint, Return) { - NodeSetSize := uint32((NumNodes-1)/int(unsafe.Sizeof(uint(0))) + 1) - NodeSet := make([]uint, NodeSetSize) - ret := nvmlDeviceGetMemoryAffinity(Device, NodeSetSize, &NodeSet[0], Scope) - return NodeSet, ret +func (l *library) DeviceGetMemoryAffinity(device Device, numNodes int, scope AffinityScope) ([]uint, Return) { + return device.GetMemoryAffinity(numNodes, scope) } -func (Device Device) GetMemoryAffinity(NumNodes int, Scope AffinityScope) ([]uint, Return) { - return DeviceGetMemoryAffinity(Device, NumNodes, Scope) +func (device nvmlDevice) GetMemoryAffinity(numNodes int, scope AffinityScope) ([]uint, Return) { + nodeSetSize := uint32((numNodes-1)/int(unsafe.Sizeof(uint(0))) + 1) + nodeSet := make([]uint, nodeSetSize) + ret := nvmlDeviceGetMemoryAffinity(device, nodeSetSize, &nodeSet[0], scope) + return nodeSet, ret } // nvml.DeviceGetCpuAffinityWithinScope() -func DeviceGetCpuAffinityWithinScope(Device Device, NumCPUs int, Scope AffinityScope) ([]uint, Return) { - CpuSetSize := uint32((NumCPUs-1)/int(unsafe.Sizeof(uint(0))) + 1) - CpuSet := make([]uint, CpuSetSize) - ret := nvmlDeviceGetCpuAffinityWithinScope(Device, CpuSetSize, &CpuSet[0], Scope) - return CpuSet, ret +func (l *library) DeviceGetCpuAffinityWithinScope(device Device, numCPUs int, scope AffinityScope) ([]uint, Return) { + return device.GetCpuAffinityWithinScope(numCPUs, scope) } -func (Device Device) GetCpuAffinityWithinScope(NumCPUs int, Scope AffinityScope) ([]uint, Return) { - return DeviceGetCpuAffinityWithinScope(Device, NumCPUs, Scope) +func (device nvmlDevice) GetCpuAffinityWithinScope(numCPUs int, scope AffinityScope) ([]uint, Return) { + cpuSetSize := uint32((numCPUs-1)/int(unsafe.Sizeof(uint(0))) + 1) + cpuSet := make([]uint, cpuSetSize) + ret := nvmlDeviceGetCpuAffinityWithinScope(device, cpuSetSize, &cpuSet[0], scope) + return cpuSet, ret } // nvml.DeviceGetTopologyCommonAncestor() -func DeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device) (GpuTopologyLevel, Return) { - var PathInfo GpuTopologyLevel - ret := nvmlDeviceGetTopologyCommonAncestor(Device1, Device2, &PathInfo) - return PathInfo, ret +func (l *library) DeviceGetTopologyCommonAncestor(device1 Device, device2 Device) (GpuTopologyLevel, Return) { + return device1.GetTopologyCommonAncestor(device2) } -func (Device1 Device) GetTopologyCommonAncestor(Device2 Device) (GpuTopologyLevel, Return) { - return DeviceGetTopologyCommonAncestor(Device1, Device2) +func (device1 nvmlDevice) GetTopologyCommonAncestor(device2 Device) (GpuTopologyLevel, Return) { + var pathInfo GpuTopologyLevel + ret := nvmlDeviceGetTopologyCommonAncestor(device1, device2.(nvmlDevice), &pathInfo) + return pathInfo, ret } // nvml.DeviceGetTopologyNearestGpus() -func DeviceGetTopologyNearestGpus(device Device, Level GpuTopologyLevel) ([]Device, Return) { - var Count uint32 - ret := nvmlDeviceGetTopologyNearestGpus(device, Level, &Count, nil) +func (l *library) DeviceGetTopologyNearestGpus(device Device, level GpuTopologyLevel) ([]Device, Return) { + return device.GetTopologyNearestGpus(level) +} + +func (device nvmlDevice) GetTopologyNearestGpus(level GpuTopologyLevel) ([]Device, Return) { + var count uint32 + ret := nvmlDeviceGetTopologyNearestGpus(device, level, &count, nil) if ret != SUCCESS { return nil, ret } - if Count == 0 { + if count == 0 { return []Device{}, ret } - DeviceArray := make([]Device, Count) - ret = nvmlDeviceGetTopologyNearestGpus(device, Level, &Count, &DeviceArray[0]) - return DeviceArray, ret -} - -func (Device Device) GetTopologyNearestGpus(Level GpuTopologyLevel) ([]Device, Return) { - return DeviceGetTopologyNearestGpus(Device, Level) + deviceArray := make([]nvmlDevice, count) + ret = nvmlDeviceGetTopologyNearestGpus(device, level, &count, &deviceArray[0]) + return convertSlice[nvmlDevice, Device](deviceArray), ret } // nvml.DeviceGetP2PStatus() -func DeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { - var P2pStatus GpuP2PStatus - ret := nvmlDeviceGetP2PStatus(Device1, Device2, P2pIndex, &P2pStatus) - return P2pStatus, ret +func (l *library) DeviceGetP2PStatus(device1 Device, device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { + return device1.GetP2PStatus(device2, p2pIndex) } -func (Device1 Device) GetP2PStatus(Device2 Device, P2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { - return DeviceGetP2PStatus(Device1, Device2, P2pIndex) +func (device1 nvmlDevice) GetP2PStatus(device2 Device, p2pIndex GpuP2PCapsIndex) (GpuP2PStatus, Return) { + var p2pStatus GpuP2PStatus + ret := nvmlDeviceGetP2PStatus(device1, device2.(nvmlDevice), p2pIndex, &p2pStatus) + return p2pStatus, ret } // nvml.DeviceGetUUID() -func DeviceGetUUID(Device Device) (string, Return) { - Uuid := make([]byte, DEVICE_UUID_V2_BUFFER_SIZE) - ret := nvmlDeviceGetUUID(Device, &Uuid[0], DEVICE_UUID_V2_BUFFER_SIZE) - return string(Uuid[:clen(Uuid)]), ret +func (l *library) DeviceGetUUID(device Device) (string, Return) { + return device.GetUUID() } -func (Device Device) GetUUID() (string, Return) { - return DeviceGetUUID(Device) +func (device nvmlDevice) GetUUID() (string, Return) { + uuid := make([]byte, DEVICE_UUID_V2_BUFFER_SIZE) + ret := nvmlDeviceGetUUID(device, &uuid[0], DEVICE_UUID_V2_BUFFER_SIZE) + return string(uuid[:clen(uuid)]), ret } // nvml.DeviceGetMinorNumber() -func DeviceGetMinorNumber(Device Device) (int, Return) { - var MinorNumber uint32 - ret := nvmlDeviceGetMinorNumber(Device, &MinorNumber) - return int(MinorNumber), ret +func (l *library) DeviceGetMinorNumber(device Device) (int, Return) { + return device.GetMinorNumber() } -func (Device Device) GetMinorNumber() (int, Return) { - return DeviceGetMinorNumber(Device) +func (device nvmlDevice) GetMinorNumber() (int, Return) { + var minorNumber uint32 + ret := nvmlDeviceGetMinorNumber(device, &minorNumber) + return int(minorNumber), ret } // nvml.DeviceGetBoardPartNumber() -func DeviceGetBoardPartNumber(Device Device) (string, Return) { - PartNumber := make([]byte, DEVICE_PART_NUMBER_BUFFER_SIZE) - ret := nvmlDeviceGetBoardPartNumber(Device, &PartNumber[0], DEVICE_PART_NUMBER_BUFFER_SIZE) - return string(PartNumber[:clen(PartNumber)]), ret +func (l *library) DeviceGetBoardPartNumber(device Device) (string, Return) { + return device.GetBoardPartNumber() } -func (Device Device) GetBoardPartNumber() (string, Return) { - return DeviceGetBoardPartNumber(Device) +func (device nvmlDevice) GetBoardPartNumber() (string, Return) { + partNumber := make([]byte, DEVICE_PART_NUMBER_BUFFER_SIZE) + ret := nvmlDeviceGetBoardPartNumber(device, &partNumber[0], DEVICE_PART_NUMBER_BUFFER_SIZE) + return string(partNumber[:clen(partNumber)]), ret } // nvml.DeviceGetInforomVersion() -func DeviceGetInforomVersion(Device Device, Object InforomObject) (string, Return) { - Version := make([]byte, DEVICE_INFOROM_VERSION_BUFFER_SIZE) - ret := nvmlDeviceGetInforomVersion(Device, Object, &Version[0], DEVICE_INFOROM_VERSION_BUFFER_SIZE) - return string(Version[:clen(Version)]), ret +func (l *library) DeviceGetInforomVersion(device Device, object InforomObject) (string, Return) { + return device.GetInforomVersion(object) } -func (Device Device) GetInforomVersion(Object InforomObject) (string, Return) { - return DeviceGetInforomVersion(Device, Object) +func (device nvmlDevice) GetInforomVersion(object InforomObject) (string, Return) { + version := make([]byte, DEVICE_INFOROM_VERSION_BUFFER_SIZE) + ret := nvmlDeviceGetInforomVersion(device, object, &version[0], DEVICE_INFOROM_VERSION_BUFFER_SIZE) + return string(version[:clen(version)]), ret } // nvml.DeviceGetInforomImageVersion() -func DeviceGetInforomImageVersion(Device Device) (string, Return) { - Version := make([]byte, DEVICE_INFOROM_VERSION_BUFFER_SIZE) - ret := nvmlDeviceGetInforomImageVersion(Device, &Version[0], DEVICE_INFOROM_VERSION_BUFFER_SIZE) - return string(Version[:clen(Version)]), ret +func (l *library) DeviceGetInforomImageVersion(device Device) (string, Return) { + return device.GetInforomImageVersion() } -func (Device Device) GetInforomImageVersion() (string, Return) { - return DeviceGetInforomImageVersion(Device) +func (device nvmlDevice) GetInforomImageVersion() (string, Return) { + version := make([]byte, DEVICE_INFOROM_VERSION_BUFFER_SIZE) + ret := nvmlDeviceGetInforomImageVersion(device, &version[0], DEVICE_INFOROM_VERSION_BUFFER_SIZE) + return string(version[:clen(version)]), ret } // nvml.DeviceGetInforomConfigurationChecksum() -func DeviceGetInforomConfigurationChecksum(Device Device) (uint32, Return) { - var Checksum uint32 - ret := nvmlDeviceGetInforomConfigurationChecksum(Device, &Checksum) - return Checksum, ret +func (l *library) DeviceGetInforomConfigurationChecksum(device Device) (uint32, Return) { + return device.GetInforomConfigurationChecksum() } -func (Device Device) GetInforomConfigurationChecksum() (uint32, Return) { - return DeviceGetInforomConfigurationChecksum(Device) +func (device nvmlDevice) GetInforomConfigurationChecksum() (uint32, Return) { + var checksum uint32 + ret := nvmlDeviceGetInforomConfigurationChecksum(device, &checksum) + return checksum, ret } // nvml.DeviceValidateInforom() -func DeviceValidateInforom(Device Device) Return { - return nvmlDeviceValidateInforom(Device) +func (l *library) DeviceValidateInforom(device Device) Return { + return device.ValidateInforom() } -func (Device Device) ValidateInforom() Return { - return DeviceValidateInforom(Device) +func (device nvmlDevice) ValidateInforom() Return { + return nvmlDeviceValidateInforom(device) } // nvml.DeviceGetDisplayMode() -func DeviceGetDisplayMode(Device Device) (EnableState, Return) { - var Display EnableState - ret := nvmlDeviceGetDisplayMode(Device, &Display) - return Display, ret +func (l *library) DeviceGetDisplayMode(device Device) (EnableState, Return) { + return device.GetDisplayMode() } -func (Device Device) GetDisplayMode() (EnableState, Return) { - return DeviceGetDisplayMode(Device) +func (device nvmlDevice) GetDisplayMode() (EnableState, Return) { + var display EnableState + ret := nvmlDeviceGetDisplayMode(device, &display) + return display, ret } // nvml.DeviceGetDisplayActive() -func DeviceGetDisplayActive(Device Device) (EnableState, Return) { - var IsActive EnableState - ret := nvmlDeviceGetDisplayActive(Device, &IsActive) - return IsActive, ret +func (l *library) DeviceGetDisplayActive(device Device) (EnableState, Return) { + return device.GetDisplayActive() } -func (Device Device) GetDisplayActive() (EnableState, Return) { - return DeviceGetDisplayActive(Device) +func (device nvmlDevice) GetDisplayActive() (EnableState, Return) { + var isActive EnableState + ret := nvmlDeviceGetDisplayActive(device, &isActive) + return isActive, ret } // nvml.DeviceGetPersistenceMode() -func DeviceGetPersistenceMode(Device Device) (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetPersistenceMode(Device, &Mode) - return Mode, ret +func (l *library) DeviceGetPersistenceMode(device Device) (EnableState, Return) { + return device.GetPersistenceMode() } -func (Device Device) GetPersistenceMode() (EnableState, Return) { - return DeviceGetPersistenceMode(Device) +func (device nvmlDevice) GetPersistenceMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetPersistenceMode(device, &mode) + return mode, ret } // nvml.DeviceGetPciInfo() -func DeviceGetPciInfo(Device Device) (PciInfo, Return) { - var Pci PciInfo - ret := nvmlDeviceGetPciInfo(Device, &Pci) - return Pci, ret +func (l *library) DeviceGetPciInfo(device Device) (PciInfo, Return) { + return device.GetPciInfo() } -func (Device Device) GetPciInfo() (PciInfo, Return) { - return DeviceGetPciInfo(Device) +func (device nvmlDevice) GetPciInfo() (PciInfo, Return) { + var pci PciInfo + ret := nvmlDeviceGetPciInfo(device, &pci) + return pci, ret } // nvml.DeviceGetMaxPcieLinkGeneration() -func DeviceGetMaxPcieLinkGeneration(Device Device) (int, Return) { - var MaxLinkGen uint32 - ret := nvmlDeviceGetMaxPcieLinkGeneration(Device, &MaxLinkGen) - return int(MaxLinkGen), ret +func (l *library) DeviceGetMaxPcieLinkGeneration(device Device) (int, Return) { + return device.GetMaxPcieLinkGeneration() } -func (Device Device) GetMaxPcieLinkGeneration() (int, Return) { - return DeviceGetMaxPcieLinkGeneration(Device) +func (device nvmlDevice) GetMaxPcieLinkGeneration() (int, Return) { + var maxLinkGen uint32 + ret := nvmlDeviceGetMaxPcieLinkGeneration(device, &maxLinkGen) + return int(maxLinkGen), ret } // nvml.DeviceGetMaxPcieLinkWidth() -func DeviceGetMaxPcieLinkWidth(Device Device) (int, Return) { - var MaxLinkWidth uint32 - ret := nvmlDeviceGetMaxPcieLinkWidth(Device, &MaxLinkWidth) - return int(MaxLinkWidth), ret +func (l *library) DeviceGetMaxPcieLinkWidth(device Device) (int, Return) { + return device.GetMaxPcieLinkWidth() } -func (Device Device) GetMaxPcieLinkWidth() (int, Return) { - return DeviceGetMaxPcieLinkWidth(Device) +func (device nvmlDevice) GetMaxPcieLinkWidth() (int, Return) { + var maxLinkWidth uint32 + ret := nvmlDeviceGetMaxPcieLinkWidth(device, &maxLinkWidth) + return int(maxLinkWidth), ret } // nvml.DeviceGetCurrPcieLinkGeneration() -func DeviceGetCurrPcieLinkGeneration(Device Device) (int, Return) { - var CurrLinkGen uint32 - ret := nvmlDeviceGetCurrPcieLinkGeneration(Device, &CurrLinkGen) - return int(CurrLinkGen), ret +func (l *library) DeviceGetCurrPcieLinkGeneration(device Device) (int, Return) { + return device.GetCurrPcieLinkGeneration() } -func (Device Device) GetCurrPcieLinkGeneration() (int, Return) { - return DeviceGetCurrPcieLinkGeneration(Device) +func (device nvmlDevice) GetCurrPcieLinkGeneration() (int, Return) { + var currLinkGen uint32 + ret := nvmlDeviceGetCurrPcieLinkGeneration(device, &currLinkGen) + return int(currLinkGen), ret } // nvml.DeviceGetCurrPcieLinkWidth() -func DeviceGetCurrPcieLinkWidth(Device Device) (int, Return) { - var CurrLinkWidth uint32 - ret := nvmlDeviceGetCurrPcieLinkWidth(Device, &CurrLinkWidth) - return int(CurrLinkWidth), ret +func (l *library) DeviceGetCurrPcieLinkWidth(device Device) (int, Return) { + return device.GetCurrPcieLinkWidth() } -func (Device Device) GetCurrPcieLinkWidth() (int, Return) { - return DeviceGetCurrPcieLinkWidth(Device) +func (device nvmlDevice) GetCurrPcieLinkWidth() (int, Return) { + var currLinkWidth uint32 + ret := nvmlDeviceGetCurrPcieLinkWidth(device, &currLinkWidth) + return int(currLinkWidth), ret } // nvml.DeviceGetPcieThroughput() -func DeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter) (uint32, Return) { - var Value uint32 - ret := nvmlDeviceGetPcieThroughput(Device, Counter, &Value) - return Value, ret +func (l *library) DeviceGetPcieThroughput(device Device, counter PcieUtilCounter) (uint32, Return) { + return device.GetPcieThroughput(counter) } -func (Device Device) GetPcieThroughput(Counter PcieUtilCounter) (uint32, Return) { - return DeviceGetPcieThroughput(Device, Counter) +func (device nvmlDevice) GetPcieThroughput(counter PcieUtilCounter) (uint32, Return) { + var value uint32 + ret := nvmlDeviceGetPcieThroughput(device, counter, &value) + return value, ret } // nvml.DeviceGetPcieReplayCounter() -func DeviceGetPcieReplayCounter(Device Device) (int, Return) { - var Value uint32 - ret := nvmlDeviceGetPcieReplayCounter(Device, &Value) - return int(Value), ret +func (l *library) DeviceGetPcieReplayCounter(device Device) (int, Return) { + return device.GetPcieReplayCounter() } -func (Device Device) GetPcieReplayCounter() (int, Return) { - return DeviceGetPcieReplayCounter(Device) +func (device nvmlDevice) GetPcieReplayCounter() (int, Return) { + var value uint32 + ret := nvmlDeviceGetPcieReplayCounter(device, &value) + return int(value), ret } // nvml.nvmlDeviceGetClockInfo() -func DeviceGetClockInfo(Device Device, _type ClockType) (uint32, Return) { - var Clock uint32 - ret := nvmlDeviceGetClockInfo(Device, _type, &Clock) - return Clock, ret +func (l *library) DeviceGetClockInfo(device Device, clockType ClockType) (uint32, Return) { + return device.GetClockInfo(clockType) } -func (Device Device) GetClockInfo(_type ClockType) (uint32, Return) { - return DeviceGetClockInfo(Device, _type) +func (device nvmlDevice) GetClockInfo(clockType ClockType) (uint32, Return) { + var clock uint32 + ret := nvmlDeviceGetClockInfo(device, clockType, &clock) + return clock, ret } // nvml.DeviceGetMaxClockInfo() -func DeviceGetMaxClockInfo(Device Device, _type ClockType) (uint32, Return) { - var Clock uint32 - ret := nvmlDeviceGetMaxClockInfo(Device, _type, &Clock) - return Clock, ret +func (l *library) DeviceGetMaxClockInfo(device Device, clockType ClockType) (uint32, Return) { + return device.GetMaxClockInfo(clockType) } -func (Device Device) GetMaxClockInfo(_type ClockType) (uint32, Return) { - return DeviceGetMaxClockInfo(Device, _type) +func (device nvmlDevice) GetMaxClockInfo(clockType ClockType) (uint32, Return) { + var clock uint32 + ret := nvmlDeviceGetMaxClockInfo(device, clockType, &clock) + return clock, ret } // nvml.DeviceGetApplicationsClock() -func DeviceGetApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetApplicationsClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (l *library) DeviceGetApplicationsClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetApplicationsClock(clockType) } -func (Device Device) GetApplicationsClock(ClockType ClockType) (uint32, Return) { - return DeviceGetApplicationsClock(Device, ClockType) +func (device nvmlDevice) GetApplicationsClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetApplicationsClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceGetDefaultApplicationsClock() -func DeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetDefaultApplicationsClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (l *library) DeviceGetDefaultApplicationsClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetDefaultApplicationsClock(clockType) } -func (Device Device) GetDefaultApplicationsClock(ClockType ClockType) (uint32, Return) { - return DeviceGetDefaultApplicationsClock(Device, ClockType) +func (device nvmlDevice) GetDefaultApplicationsClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetDefaultApplicationsClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceResetApplicationsClocks() -func DeviceResetApplicationsClocks(Device Device) Return { - return nvmlDeviceResetApplicationsClocks(Device) +func (l *library) DeviceResetApplicationsClocks(device Device) Return { + return device.ResetApplicationsClocks() } -func (Device Device) ResetApplicationsClocks() Return { - return DeviceResetApplicationsClocks(Device) +func (device nvmlDevice) ResetApplicationsClocks() Return { + return nvmlDeviceResetApplicationsClocks(device) } // nvml.DeviceGetClock() -func DeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetClock(Device, ClockType, ClockId, &ClockMHz) - return ClockMHz, ret +func (l *library) DeviceGetClock(device Device, clockType ClockType, clockId ClockId) (uint32, Return) { + return device.GetClock(clockType, clockId) } -func (Device Device) GetClock(ClockType ClockType, ClockId ClockId) (uint32, Return) { - return DeviceGetClock(Device, ClockType, ClockId) +func (device nvmlDevice) GetClock(clockType ClockType, clockId ClockId) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetClock(device, clockType, clockId, &clockMHz) + return clockMHz, ret } // nvml.DeviceGetMaxCustomerBoostClock() -func DeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType) (uint32, Return) { - var ClockMHz uint32 - ret := nvmlDeviceGetMaxCustomerBoostClock(Device, ClockType, &ClockMHz) - return ClockMHz, ret +func (l *library) DeviceGetMaxCustomerBoostClock(device Device, clockType ClockType) (uint32, Return) { + return device.GetMaxCustomerBoostClock(clockType) } -func (Device Device) GetMaxCustomerBoostClock(ClockType ClockType) (uint32, Return) { - return DeviceGetMaxCustomerBoostClock(Device, ClockType) +func (device nvmlDevice) GetMaxCustomerBoostClock(clockType ClockType) (uint32, Return) { + var clockMHz uint32 + ret := nvmlDeviceGetMaxCustomerBoostClock(device, clockType, &clockMHz) + return clockMHz, ret } // nvml.DeviceGetSupportedMemoryClocks() -func DeviceGetSupportedMemoryClocks(Device Device) (int, uint32, Return) { - var Count, ClocksMHz uint32 - ret := nvmlDeviceGetSupportedMemoryClocks(Device, &Count, &ClocksMHz) - return int(Count), ClocksMHz, ret +func (l *library) DeviceGetSupportedMemoryClocks(device Device) (int, uint32, Return) { + return device.GetSupportedMemoryClocks() } -func (Device Device) GetSupportedMemoryClocks() (int, uint32, Return) { - return DeviceGetSupportedMemoryClocks(Device) +func (device nvmlDevice) GetSupportedMemoryClocks() (int, uint32, Return) { + var count, clocksMHz uint32 + ret := nvmlDeviceGetSupportedMemoryClocks(device, &count, &clocksMHz) + return int(count), clocksMHz, ret } // nvml.DeviceGetSupportedGraphicsClocks() -func DeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz int) (int, uint32, Return) { - var Count, ClocksMHz uint32 - ret := nvmlDeviceGetSupportedGraphicsClocks(Device, uint32(MemoryClockMHz), &Count, &ClocksMHz) - return int(Count), ClocksMHz, ret +func (l *library) DeviceGetSupportedGraphicsClocks(device Device, memoryClockMHz int) (int, uint32, Return) { + return device.GetSupportedGraphicsClocks(memoryClockMHz) } -func (Device Device) GetSupportedGraphicsClocks(MemoryClockMHz int) (int, uint32, Return) { - return DeviceGetSupportedGraphicsClocks(Device, MemoryClockMHz) +func (device nvmlDevice) GetSupportedGraphicsClocks(memoryClockMHz int) (int, uint32, Return) { + var count, clocksMHz uint32 + ret := nvmlDeviceGetSupportedGraphicsClocks(device, uint32(memoryClockMHz), &count, &clocksMHz) + return int(count), clocksMHz, ret } // nvml.DeviceGetAutoBoostedClocksEnabled() -func DeviceGetAutoBoostedClocksEnabled(Device Device) (EnableState, EnableState, Return) { - var IsEnabled, DefaultIsEnabled EnableState - ret := nvmlDeviceGetAutoBoostedClocksEnabled(Device, &IsEnabled, &DefaultIsEnabled) - return IsEnabled, DefaultIsEnabled, ret +func (l *library) DeviceGetAutoBoostedClocksEnabled(device Device) (EnableState, EnableState, Return) { + return device.GetAutoBoostedClocksEnabled() } -func (Device Device) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) { - return DeviceGetAutoBoostedClocksEnabled(Device) +func (device nvmlDevice) GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) { + var isEnabled, defaultIsEnabled EnableState + ret := nvmlDeviceGetAutoBoostedClocksEnabled(device, &isEnabled, &defaultIsEnabled) + return isEnabled, defaultIsEnabled, ret } // nvml.DeviceSetAutoBoostedClocksEnabled() -func DeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return { - return nvmlDeviceSetAutoBoostedClocksEnabled(Device, Enabled) +func (l *library) DeviceSetAutoBoostedClocksEnabled(device Device, enabled EnableState) Return { + return device.SetAutoBoostedClocksEnabled(enabled) } -func (Device Device) SetAutoBoostedClocksEnabled(Enabled EnableState) Return { - return DeviceSetAutoBoostedClocksEnabled(Device, Enabled) +func (device nvmlDevice) SetAutoBoostedClocksEnabled(enabled EnableState) Return { + return nvmlDeviceSetAutoBoostedClocksEnabled(device, enabled) } // nvml.DeviceSetDefaultAutoBoostedClocksEnabled() -func DeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return { - return nvmlDeviceSetDefaultAutoBoostedClocksEnabled(Device, Enabled, Flags) +func (l *library) DeviceSetDefaultAutoBoostedClocksEnabled(device Device, enabled EnableState, flags uint32) Return { + return device.SetDefaultAutoBoostedClocksEnabled(enabled, flags) } -func (Device Device) SetDefaultAutoBoostedClocksEnabled(Enabled EnableState, Flags uint32) Return { - return DeviceSetDefaultAutoBoostedClocksEnabled(Device, Enabled, Flags) +func (device nvmlDevice) SetDefaultAutoBoostedClocksEnabled(enabled EnableState, flags uint32) Return { + return nvmlDeviceSetDefaultAutoBoostedClocksEnabled(device, enabled, flags) } // nvml.DeviceGetFanSpeed() -func DeviceGetFanSpeed(Device Device) (uint32, Return) { - var Speed uint32 - ret := nvmlDeviceGetFanSpeed(Device, &Speed) - return Speed, ret +func (l *library) DeviceGetFanSpeed(device Device) (uint32, Return) { + return device.GetFanSpeed() } -func (Device Device) GetFanSpeed() (uint32, Return) { - return DeviceGetFanSpeed(Device) +func (device nvmlDevice) GetFanSpeed() (uint32, Return) { + var speed uint32 + ret := nvmlDeviceGetFanSpeed(device, &speed) + return speed, ret } // nvml.DeviceGetFanSpeed_v2() -func DeviceGetFanSpeed_v2(Device Device, Fan int) (uint32, Return) { - var Speed uint32 - ret := nvmlDeviceGetFanSpeed_v2(Device, uint32(Fan), &Speed) - return Speed, ret +func (l *library) DeviceGetFanSpeed_v2(device Device, fan int) (uint32, Return) { + return device.GetFanSpeed_v2(fan) } -func (Device Device) GetFanSpeed_v2(Fan int) (uint32, Return) { - return DeviceGetFanSpeed_v2(Device, Fan) +func (device nvmlDevice) GetFanSpeed_v2(fan int) (uint32, Return) { + var speed uint32 + ret := nvmlDeviceGetFanSpeed_v2(device, uint32(fan), &speed) + return speed, ret } // nvml.DeviceGetNumFans() -func DeviceGetNumFans(Device Device) (int, Return) { - var NumFans uint32 - ret := nvmlDeviceGetNumFans(Device, &NumFans) - return int(NumFans), ret +func (l *library) DeviceGetNumFans(device Device) (int, Return) { + return device.GetNumFans() } -func (Device Device) GetNumFans() (int, Return) { - return DeviceGetNumFans(Device) +func (device nvmlDevice) GetNumFans() (int, Return) { + var numFans uint32 + ret := nvmlDeviceGetNumFans(device, &numFans) + return int(numFans), ret } // nvml.DeviceGetTemperature() -func DeviceGetTemperature(Device Device, SensorType TemperatureSensors) (uint32, Return) { - var Temp uint32 - ret := nvmlDeviceGetTemperature(Device, SensorType, &Temp) - return Temp, ret +func (l *library) DeviceGetTemperature(device Device, sensorType TemperatureSensors) (uint32, Return) { + return device.GetTemperature(sensorType) } -func (Device Device) GetTemperature(SensorType TemperatureSensors) (uint32, Return) { - return DeviceGetTemperature(Device, SensorType) +func (device nvmlDevice) GetTemperature(sensorType TemperatureSensors) (uint32, Return) { + var temp uint32 + ret := nvmlDeviceGetTemperature(device, sensorType, &temp) + return temp, ret } // nvml.DeviceGetTemperatureThreshold() -func DeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds) (uint32, Return) { - var Temp uint32 - ret := nvmlDeviceGetTemperatureThreshold(Device, ThresholdType, &Temp) - return Temp, ret +func (l *library) DeviceGetTemperatureThreshold(device Device, thresholdType TemperatureThresholds) (uint32, Return) { + return device.GetTemperatureThreshold(thresholdType) } -func (Device Device) GetTemperatureThreshold(ThresholdType TemperatureThresholds) (uint32, Return) { - return DeviceGetTemperatureThreshold(Device, ThresholdType) +func (device nvmlDevice) GetTemperatureThreshold(thresholdType TemperatureThresholds) (uint32, Return) { + var temp uint32 + ret := nvmlDeviceGetTemperatureThreshold(device, thresholdType, &temp) + return temp, ret } // nvml.DeviceSetTemperatureThreshold() -func DeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp int) Return { - t := int32(Temp) - ret := nvmlDeviceSetTemperatureThreshold(Device, ThresholdType, &t) - return ret +func (l *library) DeviceSetTemperatureThreshold(device Device, thresholdType TemperatureThresholds, temp int) Return { + return device.SetTemperatureThreshold(thresholdType, temp) } -func (Device Device) SetTemperatureThreshold(ThresholdType TemperatureThresholds, Temp int) Return { - return DeviceSetTemperatureThreshold(Device, ThresholdType, Temp) +func (device nvmlDevice) SetTemperatureThreshold(thresholdType TemperatureThresholds, temp int) Return { + t := int32(temp) + ret := nvmlDeviceSetTemperatureThreshold(device, thresholdType, &t) + return ret } // nvml.DeviceGetPerformanceState() -func DeviceGetPerformanceState(Device Device) (Pstates, Return) { - var PState Pstates - ret := nvmlDeviceGetPerformanceState(Device, &PState) - return PState, ret +func (l *library) DeviceGetPerformanceState(device Device) (Pstates, Return) { + return device.GetPerformanceState() } -func (Device Device) GetPerformanceState() (Pstates, Return) { - return DeviceGetPerformanceState(Device) +func (device nvmlDevice) GetPerformanceState() (Pstates, Return) { + var pState Pstates + ret := nvmlDeviceGetPerformanceState(device, &pState) + return pState, ret } // nvml.DeviceGetCurrentClocksThrottleReasons() -func DeviceGetCurrentClocksThrottleReasons(Device Device) (uint64, Return) { - var ClocksThrottleReasons uint64 - ret := nvmlDeviceGetCurrentClocksThrottleReasons(Device, &ClocksThrottleReasons) - return ClocksThrottleReasons, ret +func (l *library) DeviceGetCurrentClocksThrottleReasons(device Device) (uint64, Return) { + return device.GetCurrentClocksThrottleReasons() } -func (Device Device) GetCurrentClocksThrottleReasons() (uint64, Return) { - return DeviceGetCurrentClocksThrottleReasons(Device) +func (device nvmlDevice) GetCurrentClocksThrottleReasons() (uint64, Return) { + var clocksThrottleReasons uint64 + ret := nvmlDeviceGetCurrentClocksThrottleReasons(device, &clocksThrottleReasons) + return clocksThrottleReasons, ret } // nvml.DeviceGetSupportedClocksThrottleReasons() -func DeviceGetSupportedClocksThrottleReasons(Device Device) (uint64, Return) { - var SupportedClocksThrottleReasons uint64 - ret := nvmlDeviceGetSupportedClocksThrottleReasons(Device, &SupportedClocksThrottleReasons) - return SupportedClocksThrottleReasons, ret +func (l *library) DeviceGetSupportedClocksThrottleReasons(device Device) (uint64, Return) { + return device.GetSupportedClocksThrottleReasons() } -func (Device Device) GetSupportedClocksThrottleReasons() (uint64, Return) { - return DeviceGetSupportedClocksThrottleReasons(Device) +func (device nvmlDevice) GetSupportedClocksThrottleReasons() (uint64, Return) { + var supportedClocksThrottleReasons uint64 + ret := nvmlDeviceGetSupportedClocksThrottleReasons(device, &supportedClocksThrottleReasons) + return supportedClocksThrottleReasons, ret } // nvml.DeviceGetPowerState() -func DeviceGetPowerState(Device Device) (Pstates, Return) { - var PState Pstates - ret := nvmlDeviceGetPowerState(Device, &PState) - return PState, ret +func (l *library) DeviceGetPowerState(device Device) (Pstates, Return) { + return device.GetPowerState() } -func (Device Device) GetPowerState() (Pstates, Return) { - return DeviceGetPowerState(Device) +func (device nvmlDevice) GetPowerState() (Pstates, Return) { + var pState Pstates + ret := nvmlDeviceGetPowerState(device, &pState) + return pState, ret } // nvml.DeviceGetPowerManagementMode() -func DeviceGetPowerManagementMode(Device Device) (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetPowerManagementMode(Device, &Mode) - return Mode, ret +func (l *library) DeviceGetPowerManagementMode(device Device) (EnableState, Return) { + return device.GetPowerManagementMode() } -func (Device Device) GetPowerManagementMode() (EnableState, Return) { - return DeviceGetPowerManagementMode(Device) +func (device nvmlDevice) GetPowerManagementMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetPowerManagementMode(device, &mode) + return mode, ret } // nvml.DeviceGetPowerManagementLimit() -func DeviceGetPowerManagementLimit(Device Device) (uint32, Return) { - var Limit uint32 - ret := nvmlDeviceGetPowerManagementLimit(Device, &Limit) - return Limit, ret +func (l *library) DeviceGetPowerManagementLimit(device Device) (uint32, Return) { + return device.GetPowerManagementLimit() } -func (Device Device) GetPowerManagementLimit() (uint32, Return) { - return DeviceGetPowerManagementLimit(Device) +func (device nvmlDevice) GetPowerManagementLimit() (uint32, Return) { + var limit uint32 + ret := nvmlDeviceGetPowerManagementLimit(device, &limit) + return limit, ret } // nvml.DeviceGetPowerManagementLimitConstraints() -func DeviceGetPowerManagementLimitConstraints(Device Device) (uint32, uint32, Return) { - var MinLimit, MaxLimit uint32 - ret := nvmlDeviceGetPowerManagementLimitConstraints(Device, &MinLimit, &MaxLimit) - return MinLimit, MaxLimit, ret +func (l *library) DeviceGetPowerManagementLimitConstraints(device Device) (uint32, uint32, Return) { + return device.GetPowerManagementLimitConstraints() } -func (Device Device) GetPowerManagementLimitConstraints() (uint32, uint32, Return) { - return DeviceGetPowerManagementLimitConstraints(Device) +func (device nvmlDevice) GetPowerManagementLimitConstraints() (uint32, uint32, Return) { + var minLimit, maxLimit uint32 + ret := nvmlDeviceGetPowerManagementLimitConstraints(device, &minLimit, &maxLimit) + return minLimit, maxLimit, ret } // nvml.DeviceGetPowerManagementDefaultLimit() -func DeviceGetPowerManagementDefaultLimit(Device Device) (uint32, Return) { - var DefaultLimit uint32 - ret := nvmlDeviceGetPowerManagementDefaultLimit(Device, &DefaultLimit) - return DefaultLimit, ret +func (l *library) DeviceGetPowerManagementDefaultLimit(device Device) (uint32, Return) { + return device.GetPowerManagementDefaultLimit() } -func (Device Device) GetPowerManagementDefaultLimit() (uint32, Return) { - return DeviceGetPowerManagementDefaultLimit(Device) +func (device nvmlDevice) GetPowerManagementDefaultLimit() (uint32, Return) { + var defaultLimit uint32 + ret := nvmlDeviceGetPowerManagementDefaultLimit(device, &defaultLimit) + return defaultLimit, ret } // nvml.DeviceGetPowerUsage() -func DeviceGetPowerUsage(Device Device) (uint32, Return) { - var Power uint32 - ret := nvmlDeviceGetPowerUsage(Device, &Power) - return Power, ret +func (l *library) DeviceGetPowerUsage(device Device) (uint32, Return) { + return device.GetPowerUsage() } -func (Device Device) GetPowerUsage() (uint32, Return) { - return DeviceGetPowerUsage(Device) +func (device nvmlDevice) GetPowerUsage() (uint32, Return) { + var power uint32 + ret := nvmlDeviceGetPowerUsage(device, &power) + return power, ret } // nvml.DeviceGetTotalEnergyConsumption() -func DeviceGetTotalEnergyConsumption(Device Device) (uint64, Return) { - var Energy uint64 - ret := nvmlDeviceGetTotalEnergyConsumption(Device, &Energy) - return Energy, ret +func (l *library) DeviceGetTotalEnergyConsumption(device Device) (uint64, Return) { + return device.GetTotalEnergyConsumption() } -func (Device Device) GetTotalEnergyConsumption() (uint64, Return) { - return DeviceGetTotalEnergyConsumption(Device) +func (device nvmlDevice) GetTotalEnergyConsumption() (uint64, Return) { + var energy uint64 + ret := nvmlDeviceGetTotalEnergyConsumption(device, &energy) + return energy, ret } // nvml.DeviceGetEnforcedPowerLimit() -func DeviceGetEnforcedPowerLimit(Device Device) (uint32, Return) { - var Limit uint32 - ret := nvmlDeviceGetEnforcedPowerLimit(Device, &Limit) - return Limit, ret +func (l *library) DeviceGetEnforcedPowerLimit(device Device) (uint32, Return) { + return device.GetEnforcedPowerLimit() } -func (Device Device) GetEnforcedPowerLimit() (uint32, Return) { - return DeviceGetEnforcedPowerLimit(Device) +func (device nvmlDevice) GetEnforcedPowerLimit() (uint32, Return) { + var limit uint32 + ret := nvmlDeviceGetEnforcedPowerLimit(device, &limit) + return limit, ret } // nvml.DeviceGetGpuOperationMode() -func DeviceGetGpuOperationMode(Device Device) (GpuOperationMode, GpuOperationMode, Return) { - var Current, Pending GpuOperationMode - ret := nvmlDeviceGetGpuOperationMode(Device, &Current, &Pending) - return Current, Pending, ret +func (l *library) DeviceGetGpuOperationMode(device Device) (GpuOperationMode, GpuOperationMode, Return) { + return device.GetGpuOperationMode() } -func (Device Device) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) { - return DeviceGetGpuOperationMode(Device) +func (device nvmlDevice) GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) { + var current, pending GpuOperationMode + ret := nvmlDeviceGetGpuOperationMode(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetMemoryInfo() -func DeviceGetMemoryInfo(Device Device) (Memory, Return) { - var Memory Memory - ret := nvmlDeviceGetMemoryInfo(Device, &Memory) - return Memory, ret +func (l *library) DeviceGetMemoryInfo(device Device) (Memory, Return) { + return device.GetMemoryInfo() } -func (Device Device) GetMemoryInfo() (Memory, Return) { - return DeviceGetMemoryInfo(Device) +func (device nvmlDevice) GetMemoryInfo() (Memory, Return) { + var memory Memory + ret := nvmlDeviceGetMemoryInfo(device, &memory) + return memory, ret } // nvml.DeviceGetMemoryInfo_v2() -func DeviceGetMemoryInfo_v2(Device Device) (Memory_v2, Return) { - var Memory Memory_v2 - Memory.Version = STRUCT_VERSION(Memory, 2) - ret := nvmlDeviceGetMemoryInfo_v2(Device, &Memory) - return Memory, ret +func (l *library) DeviceGetMemoryInfo_v2(device Device) (Memory_v2, Return) { + return device.GetMemoryInfo_v2() } -func (Device Device) GetMemoryInfo_v2() (Memory_v2, Return) { - return DeviceGetMemoryInfo_v2(Device) +func (device nvmlDevice) GetMemoryInfo_v2() (Memory_v2, Return) { + var memory Memory_v2 + memory.Version = STRUCT_VERSION(memory, 2) + ret := nvmlDeviceGetMemoryInfo_v2(device, &memory) + return memory, ret } // nvml.DeviceGetComputeMode() -func DeviceGetComputeMode(Device Device) (ComputeMode, Return) { - var Mode ComputeMode - ret := nvmlDeviceGetComputeMode(Device, &Mode) - return Mode, ret +func (l *library) DeviceGetComputeMode(device Device) (ComputeMode, Return) { + return device.GetComputeMode() } -func (Device Device) GetComputeMode() (ComputeMode, Return) { - return DeviceGetComputeMode(Device) +func (device nvmlDevice) GetComputeMode() (ComputeMode, Return) { + var mode ComputeMode + ret := nvmlDeviceGetComputeMode(device, &mode) + return mode, ret } // nvml.DeviceGetCudaComputeCapability() -func DeviceGetCudaComputeCapability(Device Device) (int, int, Return) { - var Major, Minor int32 - ret := nvmlDeviceGetCudaComputeCapability(Device, &Major, &Minor) - return int(Major), int(Minor), ret +func (l *library) DeviceGetCudaComputeCapability(device Device) (int, int, Return) { + return device.GetCudaComputeCapability() } -func (Device Device) GetCudaComputeCapability() (int, int, Return) { - return DeviceGetCudaComputeCapability(Device) +func (device nvmlDevice) GetCudaComputeCapability() (int, int, Return) { + var major, minor int32 + ret := nvmlDeviceGetCudaComputeCapability(device, &major, &minor) + return int(major), int(minor), ret } // nvml.DeviceGetEccMode() -func DeviceGetEccMode(Device Device) (EnableState, EnableState, Return) { - var Current, Pending EnableState - ret := nvmlDeviceGetEccMode(Device, &Current, &Pending) - return Current, Pending, ret +func (l *library) DeviceGetEccMode(device Device) (EnableState, EnableState, Return) { + return device.GetEccMode() } -func (Device Device) GetEccMode() (EnableState, EnableState, Return) { - return DeviceGetEccMode(Device) +func (device nvmlDevice) GetEccMode() (EnableState, EnableState, Return) { + var current, pending EnableState + ret := nvmlDeviceGetEccMode(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetBoardId() -func DeviceGetBoardId(Device Device) (uint32, Return) { - var BoardId uint32 - ret := nvmlDeviceGetBoardId(Device, &BoardId) - return BoardId, ret +func (l *library) DeviceGetBoardId(device Device) (uint32, Return) { + return device.GetBoardId() } -func (Device Device) GetBoardId() (uint32, Return) { - return DeviceGetBoardId(Device) +func (device nvmlDevice) GetBoardId() (uint32, Return) { + var boardId uint32 + ret := nvmlDeviceGetBoardId(device, &boardId) + return boardId, ret } // nvml.DeviceGetMultiGpuBoard() -func DeviceGetMultiGpuBoard(Device Device) (int, Return) { - var MultiGpuBool uint32 - ret := nvmlDeviceGetMultiGpuBoard(Device, &MultiGpuBool) - return int(MultiGpuBool), ret +func (l *library) DeviceGetMultiGpuBoard(device Device) (int, Return) { + return device.GetMultiGpuBoard() } -func (Device Device) GetMultiGpuBoard() (int, Return) { - return DeviceGetMultiGpuBoard(Device) +func (device nvmlDevice) GetMultiGpuBoard() (int, Return) { + var multiGpuBool uint32 + ret := nvmlDeviceGetMultiGpuBoard(device, &multiGpuBool) + return int(multiGpuBool), ret } // nvml.DeviceGetTotalEccErrors() -func DeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { - var EccCounts uint64 - ret := nvmlDeviceGetTotalEccErrors(Device, ErrorType, CounterType, &EccCounts) - return EccCounts, ret +func (l *library) DeviceGetTotalEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) { + return device.GetTotalEccErrors(errorType, counterType) } -func (Device Device) GetTotalEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (uint64, Return) { - return DeviceGetTotalEccErrors(Device, ErrorType, CounterType) +func (device nvmlDevice) GetTotalEccErrors(errorType MemoryErrorType, counterType EccCounterType) (uint64, Return) { + var eccCounts uint64 + ret := nvmlDeviceGetTotalEccErrors(device, errorType, counterType, &eccCounts) + return eccCounts, ret } // nvml.DeviceGetDetailedEccErrors() -func DeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { - var EccCounts EccErrorCounts - ret := nvmlDeviceGetDetailedEccErrors(Device, ErrorType, CounterType, &EccCounts) - return EccCounts, ret +func (l *library) DeviceGetDetailedEccErrors(device Device, errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) { + return device.GetDetailedEccErrors(errorType, counterType) } -func (Device Device) GetDetailedEccErrors(ErrorType MemoryErrorType, CounterType EccCounterType) (EccErrorCounts, Return) { - return DeviceGetDetailedEccErrors(Device, ErrorType, CounterType) +func (device nvmlDevice) GetDetailedEccErrors(errorType MemoryErrorType, counterType EccCounterType) (EccErrorCounts, Return) { + var eccCounts EccErrorCounts + ret := nvmlDeviceGetDetailedEccErrors(device, errorType, counterType, &eccCounts) + return eccCounts, ret } // nvml.DeviceGetMemoryErrorCounter() -func DeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { - var Count uint64 - ret := nvmlDeviceGetMemoryErrorCounter(Device, ErrorType, CounterType, LocationType, &Count) - return Count, ret +func (l *library) DeviceGetMemoryErrorCounter(device Device, errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) { + return device.GetMemoryErrorCounter(errorType, counterType, locationType) } -func (Device Device) GetMemoryErrorCounter(ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation) (uint64, Return) { - return DeviceGetMemoryErrorCounter(Device, ErrorType, CounterType, LocationType) +func (device nvmlDevice) GetMemoryErrorCounter(errorType MemoryErrorType, counterType EccCounterType, locationType MemoryLocation) (uint64, Return) { + var count uint64 + ret := nvmlDeviceGetMemoryErrorCounter(device, errorType, counterType, locationType, &count) + return count, ret } // nvml.DeviceGetUtilizationRates() -func DeviceGetUtilizationRates(Device Device) (Utilization, Return) { - var Utilization Utilization - ret := nvmlDeviceGetUtilizationRates(Device, &Utilization) - return Utilization, ret +func (l *library) DeviceGetUtilizationRates(device Device) (Utilization, Return) { + return device.GetUtilizationRates() } -func (Device Device) GetUtilizationRates() (Utilization, Return) { - return DeviceGetUtilizationRates(Device) +func (device nvmlDevice) GetUtilizationRates() (Utilization, Return) { + var utilization Utilization + ret := nvmlDeviceGetUtilizationRates(device, &utilization) + return utilization, ret } // nvml.DeviceGetEncoderUtilization() -func DeviceGetEncoderUtilization(Device Device) (uint32, uint32, Return) { - var Utilization, SamplingPeriodUs uint32 - ret := nvmlDeviceGetEncoderUtilization(Device, &Utilization, &SamplingPeriodUs) - return Utilization, SamplingPeriodUs, ret +func (l *library) DeviceGetEncoderUtilization(device Device) (uint32, uint32, Return) { + return device.GetEncoderUtilization() } -func (Device Device) GetEncoderUtilization() (uint32, uint32, Return) { - return DeviceGetEncoderUtilization(Device) +func (device nvmlDevice) GetEncoderUtilization() (uint32, uint32, Return) { + var utilization, samplingPeriodUs uint32 + ret := nvmlDeviceGetEncoderUtilization(device, &utilization, &samplingPeriodUs) + return utilization, samplingPeriodUs, ret } // nvml.DeviceGetEncoderCapacity() -func DeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType) (int, Return) { - var EncoderCapacity uint32 - ret := nvmlDeviceGetEncoderCapacity(Device, EncoderQueryType, &EncoderCapacity) - return int(EncoderCapacity), ret +func (l *library) DeviceGetEncoderCapacity(device Device, encoderQueryType EncoderType) (int, Return) { + return device.GetEncoderCapacity(encoderQueryType) } -func (Device Device) GetEncoderCapacity(EncoderQueryType EncoderType) (int, Return) { - return DeviceGetEncoderCapacity(Device, EncoderQueryType) +func (device nvmlDevice) GetEncoderCapacity(encoderQueryType EncoderType) (int, Return) { + var encoderCapacity uint32 + ret := nvmlDeviceGetEncoderCapacity(device, encoderQueryType, &encoderCapacity) + return int(encoderCapacity), ret } // nvml.DeviceGetEncoderStats() -func DeviceGetEncoderStats(Device Device) (int, uint32, uint32, Return) { - var SessionCount, AverageFps, AverageLatency uint32 - ret := nvmlDeviceGetEncoderStats(Device, &SessionCount, &AverageFps, &AverageLatency) - return int(SessionCount), AverageFps, AverageLatency, ret +func (l *library) DeviceGetEncoderStats(device Device) (int, uint32, uint32, Return) { + return device.GetEncoderStats() } -func (Device Device) GetEncoderStats() (int, uint32, uint32, Return) { - return DeviceGetEncoderStats(Device) +func (device nvmlDevice) GetEncoderStats() (int, uint32, uint32, Return) { + var sessionCount, averageFps, averageLatency uint32 + ret := nvmlDeviceGetEncoderStats(device, &sessionCount, &averageFps, &averageLatency) + return int(sessionCount), averageFps, averageLatency, ret } // nvml.DeviceGetEncoderSessions() -func DeviceGetEncoderSessions(Device Device) ([]EncoderSessionInfo, Return) { - var SessionCount uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetEncoderSessions(device Device) ([]EncoderSessionInfo, Return) { + return device.GetEncoderSessions() +} + +func (device nvmlDevice) GetEncoderSessions() ([]EncoderSessionInfo, Return) { + var sessionCount uint32 = 1 // Will be reduced upon returning for { - SessionInfos := make([]EncoderSessionInfo, SessionCount) - ret := nvmlDeviceGetEncoderSessions(Device, &SessionCount, &SessionInfos[0]) + sessionInfos := make([]EncoderSessionInfo, sessionCount) + ret := nvmlDeviceGetEncoderSessions(device, &sessionCount, &sessionInfos[0]) if ret == SUCCESS { - return SessionInfos[:SessionCount], ret + return sessionInfos[:sessionCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - SessionCount *= 2 + sessionCount *= 2 } } -func (Device Device) GetEncoderSessions() ([]EncoderSessionInfo, Return) { - return DeviceGetEncoderSessions(Device) -} - // nvml.DeviceGetDecoderUtilization() -func DeviceGetDecoderUtilization(Device Device) (uint32, uint32, Return) { - var Utilization, SamplingPeriodUs uint32 - ret := nvmlDeviceGetDecoderUtilization(Device, &Utilization, &SamplingPeriodUs) - return Utilization, SamplingPeriodUs, ret +func (l *library) DeviceGetDecoderUtilization(device Device) (uint32, uint32, Return) { + return device.GetDecoderUtilization() } -func (Device Device) GetDecoderUtilization() (uint32, uint32, Return) { - return DeviceGetDecoderUtilization(Device) +func (device nvmlDevice) GetDecoderUtilization() (uint32, uint32, Return) { + var utilization, samplingPeriodUs uint32 + ret := nvmlDeviceGetDecoderUtilization(device, &utilization, &samplingPeriodUs) + return utilization, samplingPeriodUs, ret } // nvml.DeviceGetFBCStats() -func DeviceGetFBCStats(Device Device) (FBCStats, Return) { - var FbcStats FBCStats - ret := nvmlDeviceGetFBCStats(Device, &FbcStats) - return FbcStats, ret +func (l *library) DeviceGetFBCStats(device Device) (FBCStats, Return) { + return device.GetFBCStats() } -func (Device Device) GetFBCStats() (FBCStats, Return) { - return DeviceGetFBCStats(Device) +func (device nvmlDevice) GetFBCStats() (FBCStats, Return) { + var fbcStats FBCStats + ret := nvmlDeviceGetFBCStats(device, &fbcStats) + return fbcStats, ret } // nvml.DeviceGetFBCSessions() -func DeviceGetFBCSessions(Device Device) ([]FBCSessionInfo, Return) { - var SessionCount uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetFBCSessions(device Device) ([]FBCSessionInfo, Return) { + return device.GetFBCSessions() +} + +func (device nvmlDevice) GetFBCSessions() ([]FBCSessionInfo, Return) { + var sessionCount uint32 = 1 // Will be reduced upon returning for { - SessionInfo := make([]FBCSessionInfo, SessionCount) - ret := nvmlDeviceGetFBCSessions(Device, &SessionCount, &SessionInfo[0]) + sessionInfo := make([]FBCSessionInfo, sessionCount) + ret := nvmlDeviceGetFBCSessions(device, &sessionCount, &sessionInfo[0]) if ret == SUCCESS { - return SessionInfo[:SessionCount], ret + return sessionInfo[:sessionCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - SessionCount *= 2 + sessionCount *= 2 } } -func (Device Device) GetFBCSessions() ([]FBCSessionInfo, Return) { - return DeviceGetFBCSessions(Device) -} - // nvml.DeviceGetDriverModel() -func DeviceGetDriverModel(Device Device) (DriverModel, DriverModel, Return) { - var Current, Pending DriverModel - ret := nvmlDeviceGetDriverModel(Device, &Current, &Pending) - return Current, Pending, ret +func (l *library) DeviceGetDriverModel(device Device) (DriverModel, DriverModel, Return) { + return device.GetDriverModel() } -func (Device Device) GetDriverModel() (DriverModel, DriverModel, Return) { - return DeviceGetDriverModel(Device) +func (device nvmlDevice) GetDriverModel() (DriverModel, DriverModel, Return) { + var current, pending DriverModel + ret := nvmlDeviceGetDriverModel(device, ¤t, &pending) + return current, pending, ret } // nvml.DeviceGetVbiosVersion() -func DeviceGetVbiosVersion(Device Device) (string, Return) { - Version := make([]byte, DEVICE_VBIOS_VERSION_BUFFER_SIZE) - ret := nvmlDeviceGetVbiosVersion(Device, &Version[0], DEVICE_VBIOS_VERSION_BUFFER_SIZE) - return string(Version[:clen(Version)]), ret +func (l *library) DeviceGetVbiosVersion(device Device) (string, Return) { + return device.GetVbiosVersion() } -func (Device Device) GetVbiosVersion() (string, Return) { - return DeviceGetVbiosVersion(Device) +func (device nvmlDevice) GetVbiosVersion() (string, Return) { + version := make([]byte, DEVICE_VBIOS_VERSION_BUFFER_SIZE) + ret := nvmlDeviceGetVbiosVersion(device, &version[0], DEVICE_VBIOS_VERSION_BUFFER_SIZE) + return string(version[:clen(version)]), ret } // nvml.DeviceGetBridgeChipInfo() -func DeviceGetBridgeChipInfo(Device Device) (BridgeChipHierarchy, Return) { - var BridgeHierarchy BridgeChipHierarchy - ret := nvmlDeviceGetBridgeChipInfo(Device, &BridgeHierarchy) - return BridgeHierarchy, ret +func (l *library) DeviceGetBridgeChipInfo(device Device) (BridgeChipHierarchy, Return) { + return device.GetBridgeChipInfo() } -func (Device Device) GetBridgeChipInfo() (BridgeChipHierarchy, Return) { - return DeviceGetBridgeChipInfo(Device) +func (device nvmlDevice) GetBridgeChipInfo() (BridgeChipHierarchy, Return) { + var bridgeHierarchy BridgeChipHierarchy + ret := nvmlDeviceGetBridgeChipInfo(device, &bridgeHierarchy) + return bridgeHierarchy, ret } // nvml.DeviceGetComputeRunningProcesses() -func deviceGetComputeRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetComputeRunningProcesses_v1(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v1, InfoCount) - ret := nvmlDeviceGetComputeRunningProcesses_v1(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v1, infoCount) + ret := nvmlDeviceGetComputeRunningProcesses_v1(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v1Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v1Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetComputeRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetComputeRunningProcesses_v2(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v2, InfoCount) - ret := nvmlDeviceGetComputeRunningProcesses_v2(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v2, infoCount) + ret := nvmlDeviceGetComputeRunningProcesses_v2(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v2Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v2Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetComputeRunningProcesses_v3(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo, InfoCount) - ret := nvmlDeviceGetComputeRunningProcesses_v3(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo, infoCount) + ret := nvmlDeviceGetComputeRunningProcesses_v3(device, &infoCount, &infos[0]) if ret == SUCCESS { - return Infos[:InfoCount], ret + return infos[:infoCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func (Device Device) GetComputeRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetComputeRunningProcesses(Device) +func (l *library) DeviceGetComputeRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetComputeRunningProcesses() +} + +func (device nvmlDevice) GetComputeRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetComputeRunningProcesses(device) } // nvml.DeviceGetGraphicsRunningProcesses() -func deviceGetGraphicsRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetGraphicsRunningProcesses_v1(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v1, InfoCount) - ret := nvmlDeviceGetGraphicsRunningProcesses_v1(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v1, infoCount) + ret := nvmlDeviceGetGraphicsRunningProcesses_v1(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v1Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v1Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetGraphicsRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetGraphicsRunningProcesses_v2(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v2, InfoCount) - ret := nvmlDeviceGetGraphicsRunningProcesses_v2(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v2, infoCount) + ret := nvmlDeviceGetGraphicsRunningProcesses_v2(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v2Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v2Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetGraphicsRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetGraphicsRunningProcesses_v3(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo, InfoCount) - ret := nvmlDeviceGetGraphicsRunningProcesses_v3(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo, infoCount) + ret := nvmlDeviceGetGraphicsRunningProcesses_v3(device, &infoCount, &infos[0]) if ret == SUCCESS { - return Infos[:InfoCount], ret + return infos[:infoCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func (Device Device) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetGraphicsRunningProcesses(Device) +func (l *library) DeviceGetGraphicsRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetGraphicsRunningProcesses() +} + +func (device nvmlDevice) GetGraphicsRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetGraphicsRunningProcesses(device) } // nvml.DeviceGetMPSComputeRunningProcesses() -func deviceGetMPSComputeRunningProcesses_v1(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetMPSComputeRunningProcesses_v1(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v1, InfoCount) - ret := nvmlDeviceGetMPSComputeRunningProcesses_v1(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v1, infoCount) + ret := nvmlDeviceGetMPSComputeRunningProcesses_v1(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v1Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v1Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetMPSComputeRunningProcesses_v2(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetMPSComputeRunningProcesses_v2(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo_v2, InfoCount) - ret := nvmlDeviceGetMPSComputeRunningProcesses_v2(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo_v2, infoCount) + ret := nvmlDeviceGetMPSComputeRunningProcesses_v2(device, &infoCount, &infos[0]) if ret == SUCCESS { - return ProcessInfo_v2Slice(Infos[:InfoCount]).ToProcessInfoSlice(), ret + return ProcessInfo_v2Slice(infos[:infoCount]).ToProcessInfoSlice(), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func deviceGetMPSComputeRunningProcesses_v3(Device Device) ([]ProcessInfo, Return) { - var InfoCount uint32 = 1 // Will be reduced upon returning +func deviceGetMPSComputeRunningProcesses_v3(device nvmlDevice) ([]ProcessInfo, Return) { + var infoCount uint32 = 1 // Will be reduced upon returning for { - Infos := make([]ProcessInfo, InfoCount) - ret := nvmlDeviceGetMPSComputeRunningProcesses_v3(Device, &InfoCount, &Infos[0]) + infos := make([]ProcessInfo, infoCount) + ret := nvmlDeviceGetMPSComputeRunningProcesses_v3(device, &infoCount, &infos[0]) if ret == SUCCESS { - return Infos[:InfoCount], ret + return infos[:infoCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - InfoCount *= 2 + infoCount *= 2 } } -func (Device Device) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { - return DeviceGetMPSComputeRunningProcesses(Device) +func (l *library) DeviceGetMPSComputeRunningProcesses(device Device) ([]ProcessInfo, Return) { + return device.GetMPSComputeRunningProcesses() +} + +func (device nvmlDevice) GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) { + return deviceGetMPSComputeRunningProcesses(device) } // nvml.DeviceOnSameBoard() -func DeviceOnSameBoard(Device1 Device, Device2 Device) (int, Return) { - var OnSameBoard int32 - ret := nvmlDeviceOnSameBoard(Device1, Device2, &OnSameBoard) - return int(OnSameBoard), ret +func (l *library) DeviceOnSameBoard(device1 Device, device2 Device) (int, Return) { + return device1.OnSameBoard(device2) } -func (Device1 Device) OnSameBoard(Device2 Device) (int, Return) { - return DeviceOnSameBoard(Device1, Device2) +func (device1 nvmlDevice) OnSameBoard(device2 Device) (int, Return) { + var onSameBoard int32 + ret := nvmlDeviceOnSameBoard(device1, device2.(nvmlDevice), &onSameBoard) + return int(onSameBoard), ret } // nvml.DeviceGetAPIRestriction() -func DeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI) (EnableState, Return) { - var IsRestricted EnableState - ret := nvmlDeviceGetAPIRestriction(Device, ApiType, &IsRestricted) - return IsRestricted, ret +func (l *library) DeviceGetAPIRestriction(device Device, apiType RestrictedAPI) (EnableState, Return) { + return device.GetAPIRestriction(apiType) } -func (Device Device) GetAPIRestriction(ApiType RestrictedAPI) (EnableState, Return) { - return DeviceGetAPIRestriction(Device, ApiType) +func (device nvmlDevice) GetAPIRestriction(apiType RestrictedAPI) (EnableState, Return) { + var isRestricted EnableState + ret := nvmlDeviceGetAPIRestriction(device, apiType, &isRestricted) + return isRestricted, ret } // nvml.DeviceGetSamples() -func DeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { - var SampleValType ValueType - var SampleCount uint32 - ret := nvmlDeviceGetSamples(Device, _type, LastSeenTimeStamp, &SampleValType, &SampleCount, nil) +func (l *library) DeviceGetSamples(device Device, samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) { + return device.GetSamples(samplingType, lastSeenTimestamp) +} + +func (device nvmlDevice) GetSamples(samplingType SamplingType, lastSeenTimestamp uint64) (ValueType, []Sample, Return) { + var sampleValType ValueType + var sampleCount uint32 + ret := nvmlDeviceGetSamples(device, samplingType, lastSeenTimestamp, &sampleValType, &sampleCount, nil) if ret != SUCCESS { - return SampleValType, nil, ret + return sampleValType, nil, ret } - if SampleCount == 0 { - return SampleValType, []Sample{}, ret + if sampleCount == 0 { + return sampleValType, []Sample{}, ret } - Samples := make([]Sample, SampleCount) - ret = nvmlDeviceGetSamples(Device, _type, LastSeenTimeStamp, &SampleValType, &SampleCount, &Samples[0]) - return SampleValType, Samples, ret -} - -func (Device Device) GetSamples(_type SamplingType, LastSeenTimeStamp uint64) (ValueType, []Sample, Return) { - return DeviceGetSamples(Device, _type, LastSeenTimeStamp) + samples := make([]Sample, sampleCount) + ret = nvmlDeviceGetSamples(device, samplingType, lastSeenTimestamp, &sampleValType, &sampleCount, &samples[0]) + return sampleValType, samples, ret } // nvml.DeviceGetBAR1MemoryInfo() -func DeviceGetBAR1MemoryInfo(Device Device) (BAR1Memory, Return) { - var Bar1Memory BAR1Memory - ret := nvmlDeviceGetBAR1MemoryInfo(Device, &Bar1Memory) - return Bar1Memory, ret +func (l *library) DeviceGetBAR1MemoryInfo(device Device) (BAR1Memory, Return) { + return device.GetBAR1MemoryInfo() } -func (Device Device) GetBAR1MemoryInfo() (BAR1Memory, Return) { - return DeviceGetBAR1MemoryInfo(Device) +func (device nvmlDevice) GetBAR1MemoryInfo() (BAR1Memory, Return) { + var bar1Memory BAR1Memory + ret := nvmlDeviceGetBAR1MemoryInfo(device, &bar1Memory) + return bar1Memory, ret } // nvml.DeviceGetViolationStatus() -func DeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType) (ViolationTime, Return) { - var ViolTime ViolationTime - ret := nvmlDeviceGetViolationStatus(Device, PerfPolicyType, &ViolTime) - return ViolTime, ret +func (l *library) DeviceGetViolationStatus(device Device, perfPolicyType PerfPolicyType) (ViolationTime, Return) { + return device.GetViolationStatus(perfPolicyType) } -func (Device Device) GetViolationStatus(PerfPolicyType PerfPolicyType) (ViolationTime, Return) { - return DeviceGetViolationStatus(Device, PerfPolicyType) +func (device nvmlDevice) GetViolationStatus(perfPolicyType PerfPolicyType) (ViolationTime, Return) { + var violTime ViolationTime + ret := nvmlDeviceGetViolationStatus(device, perfPolicyType, &violTime) + return violTime, ret } // nvml.DeviceGetIrqNum() -func DeviceGetIrqNum(Device Device) (int, Return) { - var IrqNum uint32 - ret := nvmlDeviceGetIrqNum(Device, &IrqNum) - return int(IrqNum), ret +func (l *library) DeviceGetIrqNum(device Device) (int, Return) { + return device.GetIrqNum() } -func (Device Device) GetIrqNum() (int, Return) { - return DeviceGetIrqNum(Device) +func (device nvmlDevice) GetIrqNum() (int, Return) { + var irqNum uint32 + ret := nvmlDeviceGetIrqNum(device, &irqNum) + return int(irqNum), ret } // nvml.DeviceGetNumGpuCores() -func DeviceGetNumGpuCores(Device Device) (int, Return) { - var NumCores uint32 - ret := nvmlDeviceGetNumGpuCores(Device, &NumCores) - return int(NumCores), ret +func (l *library) DeviceGetNumGpuCores(device Device) (int, Return) { + return device.GetNumGpuCores() } -func (Device Device) GetNumGpuCores() (int, Return) { - return DeviceGetNumGpuCores(Device) +func (device nvmlDevice) GetNumGpuCores() (int, Return) { + var numCores uint32 + ret := nvmlDeviceGetNumGpuCores(device, &numCores) + return int(numCores), ret } // nvml.DeviceGetPowerSource() -func DeviceGetPowerSource(Device Device) (PowerSource, Return) { - var PowerSource PowerSource - ret := nvmlDeviceGetPowerSource(Device, &PowerSource) - return PowerSource, ret +func (l *library) DeviceGetPowerSource(device Device) (PowerSource, Return) { + return device.GetPowerSource() } -func (Device Device) GetPowerSource() (PowerSource, Return) { - return DeviceGetPowerSource(Device) +func (device nvmlDevice) GetPowerSource() (PowerSource, Return) { + var powerSource PowerSource + ret := nvmlDeviceGetPowerSource(device, &powerSource) + return powerSource, ret } // nvml.DeviceGetMemoryBusWidth() -func DeviceGetMemoryBusWidth(Device Device) (uint32, Return) { - var BusWidth uint32 - ret := nvmlDeviceGetMemoryBusWidth(Device, &BusWidth) - return BusWidth, ret +func (l *library) DeviceGetMemoryBusWidth(device Device) (uint32, Return) { + return device.GetMemoryBusWidth() } -func (Device Device) GetMemoryBusWidth() (uint32, Return) { - return DeviceGetMemoryBusWidth(Device) +func (device nvmlDevice) GetMemoryBusWidth() (uint32, Return) { + var busWidth uint32 + ret := nvmlDeviceGetMemoryBusWidth(device, &busWidth) + return busWidth, ret } // nvml.DeviceGetPcieLinkMaxSpeed() -func DeviceGetPcieLinkMaxSpeed(Device Device) (uint32, Return) { - var MaxSpeed uint32 - ret := nvmlDeviceGetPcieLinkMaxSpeed(Device, &MaxSpeed) - return MaxSpeed, ret +func (l *library) DeviceGetPcieLinkMaxSpeed(device Device) (uint32, Return) { + return device.GetPcieLinkMaxSpeed() } -func (Device Device) GetPcieLinkMaxSpeed() (uint32, Return) { - return DeviceGetPcieLinkMaxSpeed(Device) +func (device nvmlDevice) GetPcieLinkMaxSpeed() (uint32, Return) { + var maxSpeed uint32 + ret := nvmlDeviceGetPcieLinkMaxSpeed(device, &maxSpeed) + return maxSpeed, ret } // nvml.DeviceGetAdaptiveClockInfoStatus() -func DeviceGetAdaptiveClockInfoStatus(Device Device) (uint32, Return) { - var AdaptiveClockStatus uint32 - ret := nvmlDeviceGetAdaptiveClockInfoStatus(Device, &AdaptiveClockStatus) - return AdaptiveClockStatus, ret +func (l *library) DeviceGetAdaptiveClockInfoStatus(device Device) (uint32, Return) { + return device.GetAdaptiveClockInfoStatus() } -func (Device Device) GetAdaptiveClockInfoStatus() (uint32, Return) { - return DeviceGetAdaptiveClockInfoStatus(Device) +func (device nvmlDevice) GetAdaptiveClockInfoStatus() (uint32, Return) { + var adaptiveClockStatus uint32 + ret := nvmlDeviceGetAdaptiveClockInfoStatus(device, &adaptiveClockStatus) + return adaptiveClockStatus, ret } // nvml.DeviceGetAccountingMode() -func DeviceGetAccountingMode(Device Device) (EnableState, Return) { - var Mode EnableState - ret := nvmlDeviceGetAccountingMode(Device, &Mode) - return Mode, ret +func (l *library) DeviceGetAccountingMode(device Device) (EnableState, Return) { + return device.GetAccountingMode() } -func (Device Device) GetAccountingMode() (EnableState, Return) { - return DeviceGetAccountingMode(Device) +func (device nvmlDevice) GetAccountingMode() (EnableState, Return) { + var mode EnableState + ret := nvmlDeviceGetAccountingMode(device, &mode) + return mode, ret } // nvml.DeviceGetAccountingStats() -func DeviceGetAccountingStats(Device Device, Pid uint32) (AccountingStats, Return) { - var Stats AccountingStats - ret := nvmlDeviceGetAccountingStats(Device, Pid, &Stats) - return Stats, ret +func (l *library) DeviceGetAccountingStats(device Device, pid uint32) (AccountingStats, Return) { + return device.GetAccountingStats(pid) } -func (Device Device) GetAccountingStats(Pid uint32) (AccountingStats, Return) { - return DeviceGetAccountingStats(Device, Pid) +func (device nvmlDevice) GetAccountingStats(pid uint32) (AccountingStats, Return) { + var stats AccountingStats + ret := nvmlDeviceGetAccountingStats(device, pid, &stats) + return stats, ret } // nvml.DeviceGetAccountingPids() -func DeviceGetAccountingPids(Device Device) ([]int, Return) { - var Count uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetAccountingPids(device Device) ([]int, Return) { + return device.GetAccountingPids() +} + +func (device nvmlDevice) GetAccountingPids() ([]int, Return) { + var count uint32 = 1 // Will be reduced upon returning for { - Pids := make([]uint32, Count) - ret := nvmlDeviceGetAccountingPids(Device, &Count, &Pids[0]) + pids := make([]uint32, count) + ret := nvmlDeviceGetAccountingPids(device, &count, &pids[0]) if ret == SUCCESS { - return uint32SliceToIntSlice(Pids[:Count]), ret + return uint32SliceToIntSlice(pids[:count]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - Count *= 2 + count *= 2 } } -func (Device Device) GetAccountingPids() ([]int, Return) { - return DeviceGetAccountingPids(Device) -} - // nvml.DeviceGetAccountingBufferSize() -func DeviceGetAccountingBufferSize(Device Device) (int, Return) { - var BufferSize uint32 - ret := nvmlDeviceGetAccountingBufferSize(Device, &BufferSize) - return int(BufferSize), ret +func (l *library) DeviceGetAccountingBufferSize(device Device) (int, Return) { + return device.GetAccountingBufferSize() } -func (Device Device) GetAccountingBufferSize() (int, Return) { - return DeviceGetAccountingBufferSize(Device) +func (device nvmlDevice) GetAccountingBufferSize() (int, Return) { + var bufferSize uint32 + ret := nvmlDeviceGetAccountingBufferSize(device, &bufferSize) + return int(bufferSize), ret } // nvml.DeviceGetRetiredPages() -func DeviceGetRetiredPages(Device Device, Cause PageRetirementCause) ([]uint64, Return) { - var PageCount uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetRetiredPages(device Device, cause PageRetirementCause) ([]uint64, Return) { + return device.GetRetiredPages(cause) +} + +func (device nvmlDevice) GetRetiredPages(cause PageRetirementCause) ([]uint64, Return) { + var pageCount uint32 = 1 // Will be reduced upon returning for { - Addresses := make([]uint64, PageCount) - ret := nvmlDeviceGetRetiredPages(Device, Cause, &PageCount, &Addresses[0]) + addresses := make([]uint64, pageCount) + ret := nvmlDeviceGetRetiredPages(device, cause, &pageCount, &addresses[0]) if ret == SUCCESS { - return Addresses[:PageCount], ret + return addresses[:pageCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - PageCount *= 2 + pageCount *= 2 } } -func (Device Device) GetRetiredPages(Cause PageRetirementCause) ([]uint64, Return) { - return DeviceGetRetiredPages(Device, Cause) +// nvml.DeviceGetRetiredPages_v2() +func (l *library) DeviceGetRetiredPages_v2(device Device, cause PageRetirementCause) ([]uint64, []uint64, Return) { + return device.GetRetiredPages_v2(cause) } -// nvml.DeviceGetRetiredPages_v2() -func DeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause) ([]uint64, []uint64, Return) { - var PageCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetRetiredPages_v2(cause PageRetirementCause) ([]uint64, []uint64, Return) { + var pageCount uint32 = 1 // Will be reduced upon returning for { - Addresses := make([]uint64, PageCount) - Timestamps := make([]uint64, PageCount) - ret := nvmlDeviceGetRetiredPages_v2(Device, Cause, &PageCount, &Addresses[0], &Timestamps[0]) + addresses := make([]uint64, pageCount) + timestamps := make([]uint64, pageCount) + ret := nvmlDeviceGetRetiredPages_v2(device, cause, &pageCount, &addresses[0], ×tamps[0]) if ret == SUCCESS { - return Addresses[:PageCount], Timestamps[:PageCount], ret + return addresses[:pageCount], timestamps[:pageCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, nil, ret } - PageCount *= 2 + pageCount *= 2 } } -func (Device Device) GetRetiredPages_v2(Cause PageRetirementCause) ([]uint64, []uint64, Return) { - return DeviceGetRetiredPages_v2(Device, Cause) -} - // nvml.DeviceGetRetiredPagesPendingStatus() -func DeviceGetRetiredPagesPendingStatus(Device Device) (EnableState, Return) { - var IsPending EnableState - ret := nvmlDeviceGetRetiredPagesPendingStatus(Device, &IsPending) - return IsPending, ret +func (l *library) DeviceGetRetiredPagesPendingStatus(device Device) (EnableState, Return) { + return device.GetRetiredPagesPendingStatus() } -func (Device Device) GetRetiredPagesPendingStatus() (EnableState, Return) { - return DeviceGetRetiredPagesPendingStatus(Device) +func (device nvmlDevice) GetRetiredPagesPendingStatus() (EnableState, Return) { + var isPending EnableState + ret := nvmlDeviceGetRetiredPagesPendingStatus(device, &isPending) + return isPending, ret } // nvml.DeviceSetPersistenceMode() -func DeviceSetPersistenceMode(Device Device, Mode EnableState) Return { - return nvmlDeviceSetPersistenceMode(Device, Mode) +func (l *library) DeviceSetPersistenceMode(device Device, mode EnableState) Return { + return device.SetPersistenceMode(mode) } -func (Device Device) SetPersistenceMode(Mode EnableState) Return { - return DeviceSetPersistenceMode(Device, Mode) +func (device nvmlDevice) SetPersistenceMode(mode EnableState) Return { + return nvmlDeviceSetPersistenceMode(device, mode) } // nvml.DeviceSetComputeMode() -func DeviceSetComputeMode(Device Device, Mode ComputeMode) Return { - return nvmlDeviceSetComputeMode(Device, Mode) +func (l *library) DeviceSetComputeMode(device Device, mode ComputeMode) Return { + return device.SetComputeMode(mode) } -func (Device Device) SetComputeMode(Mode ComputeMode) Return { - return DeviceSetComputeMode(Device, Mode) +func (device nvmlDevice) SetComputeMode(mode ComputeMode) Return { + return nvmlDeviceSetComputeMode(device, mode) } // nvml.DeviceSetEccMode() -func DeviceSetEccMode(Device Device, Ecc EnableState) Return { - return nvmlDeviceSetEccMode(Device, Ecc) +func (l *library) DeviceSetEccMode(device Device, ecc EnableState) Return { + return device.SetEccMode(ecc) } -func (Device Device) SetEccMode(Ecc EnableState) Return { - return DeviceSetEccMode(Device, Ecc) +func (device nvmlDevice) SetEccMode(ecc EnableState) Return { + return nvmlDeviceSetEccMode(device, ecc) } // nvml.DeviceClearEccErrorCounts() -func DeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return { - return nvmlDeviceClearEccErrorCounts(Device, CounterType) +func (l *library) DeviceClearEccErrorCounts(device Device, counterType EccCounterType) Return { + return device.ClearEccErrorCounts(counterType) } -func (Device Device) ClearEccErrorCounts(CounterType EccCounterType) Return { - return DeviceClearEccErrorCounts(Device, CounterType) +func (device nvmlDevice) ClearEccErrorCounts(counterType EccCounterType) Return { + return nvmlDeviceClearEccErrorCounts(device, counterType) } // nvml.DeviceSetDriverModel() -func DeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return { - return nvmlDeviceSetDriverModel(Device, DriverModel, Flags) +func (l *library) DeviceSetDriverModel(device Device, driverModel DriverModel, flags uint32) Return { + return device.SetDriverModel(driverModel, flags) } -func (Device Device) SetDriverModel(DriverModel DriverModel, Flags uint32) Return { - return DeviceSetDriverModel(Device, DriverModel, Flags) +func (device nvmlDevice) SetDriverModel(driverModel DriverModel, flags uint32) Return { + return nvmlDeviceSetDriverModel(device, driverModel, flags) } // nvml.DeviceSetGpuLockedClocks() -func DeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - return nvmlDeviceSetGpuLockedClocks(Device, MinGpuClockMHz, MaxGpuClockMHz) +func (l *library) DeviceSetGpuLockedClocks(device Device, minGpuClockMHz uint32, maxGpuClockMHz uint32) Return { + return device.SetGpuLockedClocks(minGpuClockMHz, maxGpuClockMHz) } -func (Device Device) SetGpuLockedClocks(MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - return DeviceSetGpuLockedClocks(Device, MinGpuClockMHz, MaxGpuClockMHz) +func (device nvmlDevice) SetGpuLockedClocks(minGpuClockMHz uint32, maxGpuClockMHz uint32) Return { + return nvmlDeviceSetGpuLockedClocks(device, minGpuClockMHz, maxGpuClockMHz) } // nvml.DeviceResetGpuLockedClocks() -func DeviceResetGpuLockedClocks(Device Device) Return { - return nvmlDeviceResetGpuLockedClocks(Device) +func (l *library) DeviceResetGpuLockedClocks(device Device) Return { + return device.ResetGpuLockedClocks() } -func (Device Device) ResetGpuLockedClocks() Return { - return DeviceResetGpuLockedClocks(Device) +func (device nvmlDevice) ResetGpuLockedClocks() Return { + return nvmlDeviceResetGpuLockedClocks(device) } // nvmlDeviceSetMemoryLockedClocks() -func DeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - return nvmlDeviceSetMemoryLockedClocks(Device, MinMemClockMHz, MaxMemClockMHz) +func (l *library) DeviceSetMemoryLockedClocks(device Device, minMemClockMHz uint32, maxMemClockMHz uint32) Return { + return device.SetMemoryLockedClocks(minMemClockMHz, maxMemClockMHz) } -func (Device Device) SetMemoryLockedClocks(NinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - return DeviceSetMemoryLockedClocks(Device, NinMemClockMHz, MaxMemClockMHz) +func (device nvmlDevice) SetMemoryLockedClocks(minMemClockMHz uint32, maxMemClockMHz uint32) Return { + return nvmlDeviceSetMemoryLockedClocks(device, minMemClockMHz, maxMemClockMHz) } // nvmlDeviceResetMemoryLockedClocks() -func DeviceResetMemoryLockedClocks(Device Device) Return { - return nvmlDeviceResetMemoryLockedClocks(Device) +func (l *library) DeviceResetMemoryLockedClocks(device Device) Return { + return device.ResetMemoryLockedClocks() } -func (Device Device) ResetMemoryLockedClocks() Return { - return DeviceResetMemoryLockedClocks(Device) +func (device nvmlDevice) ResetMemoryLockedClocks() Return { + return nvmlDeviceResetMemoryLockedClocks(device) } // nvml.DeviceGetClkMonStatus() -func DeviceGetClkMonStatus(Device Device) (ClkMonStatus, Return) { - var Status ClkMonStatus - ret := nvmlDeviceGetClkMonStatus(Device, &Status) - return Status, ret +func (l *library) DeviceGetClkMonStatus(device Device) (ClkMonStatus, Return) { + return device.GetClkMonStatus() } -func (Device Device) GetClkMonStatus() (ClkMonStatus, Return) { - return DeviceGetClkMonStatus(Device) +func (device nvmlDevice) GetClkMonStatus() (ClkMonStatus, Return) { + var status ClkMonStatus + ret := nvmlDeviceGetClkMonStatus(device, &status) + return status, ret } // nvml.DeviceSetApplicationsClocks() -func DeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return { - return nvmlDeviceSetApplicationsClocks(Device, MemClockMHz, GraphicsClockMHz) +func (l *library) DeviceSetApplicationsClocks(device Device, memClockMHz uint32, graphicsClockMHz uint32) Return { + return device.SetApplicationsClocks(memClockMHz, graphicsClockMHz) } -func (Device Device) SetApplicationsClocks(MemClockMHz uint32, GraphicsClockMHz uint32) Return { - return DeviceSetApplicationsClocks(Device, MemClockMHz, GraphicsClockMHz) +func (device nvmlDevice) SetApplicationsClocks(memClockMHz uint32, graphicsClockMHz uint32) Return { + return nvmlDeviceSetApplicationsClocks(device, memClockMHz, graphicsClockMHz) } // nvml.DeviceSetPowerManagementLimit() -func DeviceSetPowerManagementLimit(Device Device, Limit uint32) Return { - return nvmlDeviceSetPowerManagementLimit(Device, Limit) +func (l *library) DeviceSetPowerManagementLimit(device Device, limit uint32) Return { + return device.SetPowerManagementLimit(limit) } -func (Device Device) SetPowerManagementLimit(Limit uint32) Return { - return DeviceSetPowerManagementLimit(Device, Limit) +func (device nvmlDevice) SetPowerManagementLimit(limit uint32) Return { + return nvmlDeviceSetPowerManagementLimit(device, limit) } // nvml.DeviceSetGpuOperationMode() -func DeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return { - return nvmlDeviceSetGpuOperationMode(Device, Mode) +func (l *library) DeviceSetGpuOperationMode(device Device, mode GpuOperationMode) Return { + return device.SetGpuOperationMode(mode) } -func (Device Device) SetGpuOperationMode(Mode GpuOperationMode) Return { - return DeviceSetGpuOperationMode(Device, Mode) +func (device nvmlDevice) SetGpuOperationMode(mode GpuOperationMode) Return { + return nvmlDeviceSetGpuOperationMode(device, mode) } // nvml.DeviceSetAPIRestriction() -func DeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return { - return nvmlDeviceSetAPIRestriction(Device, ApiType, IsRestricted) +func (l *library) DeviceSetAPIRestriction(device Device, apiType RestrictedAPI, isRestricted EnableState) Return { + return device.SetAPIRestriction(apiType, isRestricted) } -func (Device Device) SetAPIRestriction(ApiType RestrictedAPI, IsRestricted EnableState) Return { - return DeviceSetAPIRestriction(Device, ApiType, IsRestricted) +func (device nvmlDevice) SetAPIRestriction(apiType RestrictedAPI, isRestricted EnableState) Return { + return nvmlDeviceSetAPIRestriction(device, apiType, isRestricted) } // nvml.DeviceSetAccountingMode() -func DeviceSetAccountingMode(Device Device, Mode EnableState) Return { - return nvmlDeviceSetAccountingMode(Device, Mode) +func (l *library) DeviceSetAccountingMode(device Device, mode EnableState) Return { + return device.SetAccountingMode(mode) } -func (Device Device) SetAccountingMode(Mode EnableState) Return { - return DeviceSetAccountingMode(Device, Mode) +func (device nvmlDevice) SetAccountingMode(mode EnableState) Return { + return nvmlDeviceSetAccountingMode(device, mode) } // nvml.DeviceClearAccountingPids() -func DeviceClearAccountingPids(Device Device) Return { - return nvmlDeviceClearAccountingPids(Device) +func (l *library) DeviceClearAccountingPids(device Device) Return { + return device.ClearAccountingPids() } -func (Device Device) ClearAccountingPids() Return { - return DeviceClearAccountingPids(Device) +func (device nvmlDevice) ClearAccountingPids() Return { + return nvmlDeviceClearAccountingPids(device) } // nvml.DeviceGetNvLinkState() -func DeviceGetNvLinkState(Device Device, Link int) (EnableState, Return) { - var IsActive EnableState - ret := nvmlDeviceGetNvLinkState(Device, uint32(Link), &IsActive) - return IsActive, ret +func (l *library) DeviceGetNvLinkState(device Device, link int) (EnableState, Return) { + return device.GetNvLinkState(link) } -func (Device Device) GetNvLinkState(Link int) (EnableState, Return) { - return DeviceGetNvLinkState(Device, Link) +func (device nvmlDevice) GetNvLinkState(link int) (EnableState, Return) { + var isActive EnableState + ret := nvmlDeviceGetNvLinkState(device, uint32(link), &isActive) + return isActive, ret } // nvml.DeviceGetNvLinkVersion() -func DeviceGetNvLinkVersion(Device Device, Link int) (uint32, Return) { - var Version uint32 - ret := nvmlDeviceGetNvLinkVersion(Device, uint32(Link), &Version) - return Version, ret +func (l *library) DeviceGetNvLinkVersion(device Device, link int) (uint32, Return) { + return device.GetNvLinkVersion(link) } -func (Device Device) GetNvLinkVersion(Link int) (uint32, Return) { - return DeviceGetNvLinkVersion(Device, Link) +func (device nvmlDevice) GetNvLinkVersion(link int) (uint32, Return) { + var version uint32 + ret := nvmlDeviceGetNvLinkVersion(device, uint32(link), &version) + return version, ret } // nvml.DeviceGetNvLinkCapability() -func DeviceGetNvLinkCapability(Device Device, Link int, Capability NvLinkCapability) (uint32, Return) { - var CapResult uint32 - ret := nvmlDeviceGetNvLinkCapability(Device, uint32(Link), Capability, &CapResult) - return CapResult, ret +func (l *library) DeviceGetNvLinkCapability(device Device, link int, capability NvLinkCapability) (uint32, Return) { + return device.GetNvLinkCapability(link, capability) } -func (Device Device) GetNvLinkCapability(Link int, Capability NvLinkCapability) (uint32, Return) { - return DeviceGetNvLinkCapability(Device, Link, Capability) +func (device nvmlDevice) GetNvLinkCapability(link int, capability NvLinkCapability) (uint32, Return) { + var capResult uint32 + ret := nvmlDeviceGetNvLinkCapability(device, uint32(link), capability, &capResult) + return capResult, ret } // nvml.DeviceGetNvLinkRemotePciInfo() -func DeviceGetNvLinkRemotePciInfo(Device Device, Link int) (PciInfo, Return) { - var Pci PciInfo - ret := nvmlDeviceGetNvLinkRemotePciInfo(Device, uint32(Link), &Pci) - return Pci, ret +func (l *library) DeviceGetNvLinkRemotePciInfo(device Device, link int) (PciInfo, Return) { + return device.GetNvLinkRemotePciInfo(link) } -func (Device Device) GetNvLinkRemotePciInfo(Link int) (PciInfo, Return) { - return DeviceGetNvLinkRemotePciInfo(Device, Link) +func (device nvmlDevice) GetNvLinkRemotePciInfo(link int) (PciInfo, Return) { + var pci PciInfo + ret := nvmlDeviceGetNvLinkRemotePciInfo(device, uint32(link), &pci) + return pci, ret } // nvml.DeviceGetNvLinkErrorCounter() -func DeviceGetNvLinkErrorCounter(Device Device, Link int, Counter NvLinkErrorCounter) (uint64, Return) { - var CounterValue uint64 - ret := nvmlDeviceGetNvLinkErrorCounter(Device, uint32(Link), Counter, &CounterValue) - return CounterValue, ret +func (l *library) DeviceGetNvLinkErrorCounter(device Device, link int, counter NvLinkErrorCounter) (uint64, Return) { + return device.GetNvLinkErrorCounter(link, counter) } -func (Device Device) GetNvLinkErrorCounter(Link int, Counter NvLinkErrorCounter) (uint64, Return) { - return DeviceGetNvLinkErrorCounter(Device, Link, Counter) +func (device nvmlDevice) GetNvLinkErrorCounter(link int, counter NvLinkErrorCounter) (uint64, Return) { + var counterValue uint64 + ret := nvmlDeviceGetNvLinkErrorCounter(device, uint32(link), counter, &counterValue) + return counterValue, ret } // nvml.DeviceResetNvLinkErrorCounters() -func DeviceResetNvLinkErrorCounters(Device Device, Link int) Return { - return nvmlDeviceResetNvLinkErrorCounters(Device, uint32(Link)) +func (l *library) DeviceResetNvLinkErrorCounters(device Device, link int) Return { + return device.ResetNvLinkErrorCounters(link) } -func (Device Device) ResetNvLinkErrorCounters(Link int) Return { - return DeviceResetNvLinkErrorCounters(Device, Link) +func (device nvmlDevice) ResetNvLinkErrorCounters(link int) Return { + return nvmlDeviceResetNvLinkErrorCounters(device, uint32(link)) } // nvml.DeviceSetNvLinkUtilizationControl() -func DeviceSetNvLinkUtilizationControl(Device Device, Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { - reset := uint32(0) - if Reset { - reset = 1 - } - return nvmlDeviceSetNvLinkUtilizationControl(Device, uint32(Link), uint32(Counter), Control, reset) +func (l *library) DeviceSetNvLinkUtilizationControl(device Device, link int, counter int, control *NvLinkUtilizationControl, reset bool) Return { + return device.SetNvLinkUtilizationControl(link, counter, control, reset) } -func (Device Device) SetNvLinkUtilizationControl(Link int, Counter int, Control *NvLinkUtilizationControl, Reset bool) Return { - return DeviceSetNvLinkUtilizationControl(Device, Link, Counter, Control, Reset) +func (device nvmlDevice) SetNvLinkUtilizationControl(link int, counter int, control *NvLinkUtilizationControl, reset bool) Return { + resetValue := uint32(0) + if reset { + resetValue = 1 + } + return nvmlDeviceSetNvLinkUtilizationControl(device, uint32(link), uint32(counter), control, resetValue) } // nvml.DeviceGetNvLinkUtilizationControl() -func DeviceGetNvLinkUtilizationControl(Device Device, Link int, Counter int) (NvLinkUtilizationControl, Return) { - var Control NvLinkUtilizationControl - ret := nvmlDeviceGetNvLinkUtilizationControl(Device, uint32(Link), uint32(Counter), &Control) - return Control, ret +func (l *library) DeviceGetNvLinkUtilizationControl(device Device, link int, counter int) (NvLinkUtilizationControl, Return) { + return device.GetNvLinkUtilizationControl(link, counter) } -func (Device Device) GetNvLinkUtilizationControl(Link int, Counter int) (NvLinkUtilizationControl, Return) { - return DeviceGetNvLinkUtilizationControl(Device, Link, Counter) +func (device nvmlDevice) GetNvLinkUtilizationControl(link int, counter int) (NvLinkUtilizationControl, Return) { + var control NvLinkUtilizationControl + ret := nvmlDeviceGetNvLinkUtilizationControl(device, uint32(link), uint32(counter), &control) + return control, ret } // nvml.DeviceGetNvLinkUtilizationCounter() -func DeviceGetNvLinkUtilizationCounter(Device Device, Link int, Counter int) (uint64, uint64, Return) { - var Rxcounter, Txcounter uint64 - ret := nvmlDeviceGetNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter), &Rxcounter, &Txcounter) - return Rxcounter, Txcounter, ret +func (l *library) DeviceGetNvLinkUtilizationCounter(device Device, link int, counter int) (uint64, uint64, Return) { + return device.GetNvLinkUtilizationCounter(link, counter) } -func (Device Device) GetNvLinkUtilizationCounter(Link int, Counter int) (uint64, uint64, Return) { - return DeviceGetNvLinkUtilizationCounter(Device, Link, Counter) +func (device nvmlDevice) GetNvLinkUtilizationCounter(link int, counter int) (uint64, uint64, Return) { + var rxCounter, txCounter uint64 + ret := nvmlDeviceGetNvLinkUtilizationCounter(device, uint32(link), uint32(counter), &rxCounter, &txCounter) + return rxCounter, txCounter, ret } // nvml.DeviceFreezeNvLinkUtilizationCounter() -func DeviceFreezeNvLinkUtilizationCounter(Device Device, Link int, Counter int, Freeze EnableState) Return { - return nvmlDeviceFreezeNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter), Freeze) +func (l *library) DeviceFreezeNvLinkUtilizationCounter(device Device, link int, counter int, freeze EnableState) Return { + return device.FreezeNvLinkUtilizationCounter(link, counter, freeze) } -func (Device Device) FreezeNvLinkUtilizationCounter(Link int, Counter int, Freeze EnableState) Return { - return DeviceFreezeNvLinkUtilizationCounter(Device, Link, Counter, Freeze) +func (device nvmlDevice) FreezeNvLinkUtilizationCounter(link int, counter int, freeze EnableState) Return { + return nvmlDeviceFreezeNvLinkUtilizationCounter(device, uint32(link), uint32(counter), freeze) } // nvml.DeviceResetNvLinkUtilizationCounter() -func DeviceResetNvLinkUtilizationCounter(Device Device, Link int, Counter int) Return { - return nvmlDeviceResetNvLinkUtilizationCounter(Device, uint32(Link), uint32(Counter)) +func (l *library) DeviceResetNvLinkUtilizationCounter(device Device, link int, counter int) Return { + return device.ResetNvLinkUtilizationCounter(link, counter) } -func (Device Device) ResetNvLinkUtilizationCounter(Link int, Counter int) Return { - return DeviceResetNvLinkUtilizationCounter(Device, Link, Counter) +func (device nvmlDevice) ResetNvLinkUtilizationCounter(link int, counter int) Return { + return nvmlDeviceResetNvLinkUtilizationCounter(device, uint32(link), uint32(counter)) } // nvml.DeviceGetNvLinkRemoteDeviceType() -func DeviceGetNvLinkRemoteDeviceType(Device Device, Link int) (IntNvLinkDeviceType, Return) { - var NvLinkDeviceType IntNvLinkDeviceType - ret := nvmlDeviceGetNvLinkRemoteDeviceType(Device, uint32(Link), &NvLinkDeviceType) - return NvLinkDeviceType, ret +func (l *library) DeviceGetNvLinkRemoteDeviceType(device Device, link int) (IntNvLinkDeviceType, Return) { + return device.GetNvLinkRemoteDeviceType(link) } -func (Device Device) GetNvLinkRemoteDeviceType(Link int) (IntNvLinkDeviceType, Return) { - return DeviceGetNvLinkRemoteDeviceType(Device, Link) +func (device nvmlDevice) GetNvLinkRemoteDeviceType(link int) (IntNvLinkDeviceType, Return) { + var nvLinkDeviceType IntNvLinkDeviceType + ret := nvmlDeviceGetNvLinkRemoteDeviceType(device, uint32(link), &nvLinkDeviceType) + return nvLinkDeviceType, ret } // nvml.DeviceRegisterEvents() -func DeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return { - return nvmlDeviceRegisterEvents(Device, EventTypes, Set) +func (l *library) DeviceRegisterEvents(device Device, eventTypes uint64, set EventSet) Return { + return device.RegisterEvents(eventTypes, set) } -func (Device Device) RegisterEvents(EventTypes uint64, Set EventSet) Return { - return DeviceRegisterEvents(Device, EventTypes, Set) +func (device nvmlDevice) RegisterEvents(eventTypes uint64, set EventSet) Return { + return nvmlDeviceRegisterEvents(device, eventTypes, set.(nvmlEventSet)) } // nvmlDeviceGetSupportedEventTypes() -func DeviceGetSupportedEventTypes(Device Device) (uint64, Return) { - var EventTypes uint64 - ret := nvmlDeviceGetSupportedEventTypes(Device, &EventTypes) - return EventTypes, ret +func (l *library) DeviceGetSupportedEventTypes(device Device) (uint64, Return) { + return device.GetSupportedEventTypes() } -func (Device Device) GetSupportedEventTypes() (uint64, Return) { - return DeviceGetSupportedEventTypes(Device) +func (device nvmlDevice) GetSupportedEventTypes() (uint64, Return) { + var eventTypes uint64 + ret := nvmlDeviceGetSupportedEventTypes(device, &eventTypes) + return eventTypes, ret } // nvml.DeviceModifyDrainState() -func DeviceModifyDrainState(PciInfo *PciInfo, NewState EnableState) Return { - return nvmlDeviceModifyDrainState(PciInfo, NewState) +func (l *library) DeviceModifyDrainState(pciInfo *PciInfo, newState EnableState) Return { + return nvmlDeviceModifyDrainState(pciInfo, newState) } // nvml.DeviceQueryDrainState() -func DeviceQueryDrainState(PciInfo *PciInfo) (EnableState, Return) { - var CurrentState EnableState - ret := nvmlDeviceQueryDrainState(PciInfo, &CurrentState) - return CurrentState, ret +func (l *library) DeviceQueryDrainState(pciInfo *PciInfo) (EnableState, Return) { + var currentState EnableState + ret := nvmlDeviceQueryDrainState(pciInfo, ¤tState) + return currentState, ret } // nvml.DeviceRemoveGpu() -func DeviceRemoveGpu(PciInfo *PciInfo) Return { - return nvmlDeviceRemoveGpu(PciInfo) +func (l *library) DeviceRemoveGpu(pciInfo *PciInfo) Return { + return nvmlDeviceRemoveGpu(pciInfo) } // nvml.DeviceRemoveGpu_v2() -func DeviceRemoveGpu_v2(PciInfo *PciInfo, GpuState DetachGpuState, LinkState PcieLinkState) Return { - return nvmlDeviceRemoveGpu_v2(PciInfo, GpuState, LinkState) +func (l *library) DeviceRemoveGpu_v2(pciInfo *PciInfo, gpuState DetachGpuState, linkState PcieLinkState) Return { + return nvmlDeviceRemoveGpu_v2(pciInfo, gpuState, linkState) } // nvml.DeviceDiscoverGpus() -func DeviceDiscoverGpus() (PciInfo, Return) { - var PciInfo PciInfo - ret := nvmlDeviceDiscoverGpus(&PciInfo) - return PciInfo, ret +func (l *library) DeviceDiscoverGpus() (PciInfo, Return) { + var pciInfo PciInfo + ret := nvmlDeviceDiscoverGpus(&pciInfo) + return pciInfo, ret } // nvml.DeviceGetFieldValues() -func DeviceGetFieldValues(Device Device, Values []FieldValue) Return { - ValuesCount := len(Values) - return nvmlDeviceGetFieldValues(Device, int32(ValuesCount), &Values[0]) +func (l *library) DeviceGetFieldValues(device Device, values []FieldValue) Return { + return device.GetFieldValues(values) } -func (Device Device) GetFieldValues(Values []FieldValue) Return { - return DeviceGetFieldValues(Device, Values) +func (device nvmlDevice) GetFieldValues(values []FieldValue) Return { + valuesCount := len(values) + return nvmlDeviceGetFieldValues(device, int32(valuesCount), &values[0]) } // nvml.DeviceGetVirtualizationMode() -func DeviceGetVirtualizationMode(Device Device) (GpuVirtualizationMode, Return) { - var PVirtualMode GpuVirtualizationMode - ret := nvmlDeviceGetVirtualizationMode(Device, &PVirtualMode) - return PVirtualMode, ret +func (l *library) DeviceGetVirtualizationMode(device Device) (GpuVirtualizationMode, Return) { + return device.GetVirtualizationMode() } -func (Device Device) GetVirtualizationMode() (GpuVirtualizationMode, Return) { - return DeviceGetVirtualizationMode(Device) +func (device nvmlDevice) GetVirtualizationMode() (GpuVirtualizationMode, Return) { + var pVirtualMode GpuVirtualizationMode + ret := nvmlDeviceGetVirtualizationMode(device, &pVirtualMode) + return pVirtualMode, ret } // nvml.DeviceGetHostVgpuMode() -func DeviceGetHostVgpuMode(Device Device) (HostVgpuMode, Return) { - var PHostVgpuMode HostVgpuMode - ret := nvmlDeviceGetHostVgpuMode(Device, &PHostVgpuMode) - return PHostVgpuMode, ret +func (l *library) DeviceGetHostVgpuMode(device Device) (HostVgpuMode, Return) { + return device.GetHostVgpuMode() } -func (Device Device) GetHostVgpuMode() (HostVgpuMode, Return) { - return DeviceGetHostVgpuMode(Device) +func (device nvmlDevice) GetHostVgpuMode() (HostVgpuMode, Return) { + var pHostVgpuMode HostVgpuMode + ret := nvmlDeviceGetHostVgpuMode(device, &pHostVgpuMode) + return pHostVgpuMode, ret } // nvml.DeviceSetVirtualizationMode() -func DeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return { - return nvmlDeviceSetVirtualizationMode(Device, VirtualMode) +func (l *library) DeviceSetVirtualizationMode(device Device, virtualMode GpuVirtualizationMode) Return { + return device.SetVirtualizationMode(virtualMode) } -func (Device Device) SetVirtualizationMode(VirtualMode GpuVirtualizationMode) Return { - return DeviceSetVirtualizationMode(Device, VirtualMode) +func (device nvmlDevice) SetVirtualizationMode(virtualMode GpuVirtualizationMode) Return { + return nvmlDeviceSetVirtualizationMode(device, virtualMode) } // nvml.DeviceGetGridLicensableFeatures() -func DeviceGetGridLicensableFeatures(Device Device) (GridLicensableFeatures, Return) { - var PGridLicensableFeatures GridLicensableFeatures - ret := nvmlDeviceGetGridLicensableFeatures(Device, &PGridLicensableFeatures) - return PGridLicensableFeatures, ret +func (l *library) DeviceGetGridLicensableFeatures(device Device) (GridLicensableFeatures, Return) { + return device.GetGridLicensableFeatures() } -func (Device Device) GetGridLicensableFeatures() (GridLicensableFeatures, Return) { - return DeviceGetGridLicensableFeatures(Device) +func (device nvmlDevice) GetGridLicensableFeatures() (GridLicensableFeatures, Return) { + var pGridLicensableFeatures GridLicensableFeatures + ret := nvmlDeviceGetGridLicensableFeatures(device, &pGridLicensableFeatures) + return pGridLicensableFeatures, ret } // nvml.DeviceGetProcessUtilization() -func DeviceGetProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) { - var ProcessSamplesCount uint32 - ret := nvmlDeviceGetProcessUtilization(Device, nil, &ProcessSamplesCount, LastSeenTimeStamp) +func (l *library) DeviceGetProcessUtilization(device Device, lastSeenTimestamp uint64) ([]ProcessUtilizationSample, Return) { + return device.GetProcessUtilization(lastSeenTimestamp) +} + +func (device nvmlDevice) GetProcessUtilization(lastSeenTimestamp uint64) ([]ProcessUtilizationSample, Return) { + var processSamplesCount uint32 + ret := nvmlDeviceGetProcessUtilization(device, nil, &processSamplesCount, lastSeenTimestamp) if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - if ProcessSamplesCount == 0 { + if processSamplesCount == 0 { return []ProcessUtilizationSample{}, ret } - Utilization := make([]ProcessUtilizationSample, ProcessSamplesCount) - ret = nvmlDeviceGetProcessUtilization(Device, &Utilization[0], &ProcessSamplesCount, LastSeenTimeStamp) - return Utilization[:ProcessSamplesCount], ret + utilization := make([]ProcessUtilizationSample, processSamplesCount) + ret = nvmlDeviceGetProcessUtilization(device, &utilization[0], &processSamplesCount, lastSeenTimestamp) + return utilization[:processSamplesCount], ret } -func (Device Device) GetProcessUtilization(LastSeenTimeStamp uint64) ([]ProcessUtilizationSample, Return) { - return DeviceGetProcessUtilization(Device, LastSeenTimeStamp) +// nvml.DeviceGetSupportedVgpus() +func (l *library) DeviceGetSupportedVgpus(device Device) ([]VgpuTypeId, Return) { + return device.GetSupportedVgpus() } -// nvml.DeviceGetSupportedVgpus() -func DeviceGetSupportedVgpus(Device Device) ([]VgpuTypeId, Return) { - var VgpuCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetSupportedVgpus() ([]VgpuTypeId, Return) { + var vgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuTypeIds := make([]VgpuTypeId, VgpuCount) - ret := nvmlDeviceGetSupportedVgpus(Device, &VgpuCount, &VgpuTypeIds[0]) + vgpuTypeIds := make([]nvmlVgpuTypeId, vgpuCount) + ret := nvmlDeviceGetSupportedVgpus(device, &vgpuCount, &vgpuTypeIds[0]) if ret == SUCCESS { - return VgpuTypeIds[:VgpuCount], ret + return convertSlice[nvmlVgpuTypeId, VgpuTypeId](vgpuTypeIds[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } -func (Device Device) GetSupportedVgpus() ([]VgpuTypeId, Return) { - return DeviceGetSupportedVgpus(Device) +// nvml.DeviceGetCreatableVgpus() +func (l *library) DeviceGetCreatableVgpus(device Device) ([]VgpuTypeId, Return) { + return device.GetCreatableVgpus() } -// nvml.DeviceGetCreatableVgpus() -func DeviceGetCreatableVgpus(Device Device) ([]VgpuTypeId, Return) { - var VgpuCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetCreatableVgpus() ([]VgpuTypeId, Return) { + var vgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuTypeIds := make([]VgpuTypeId, VgpuCount) - ret := nvmlDeviceGetCreatableVgpus(Device, &VgpuCount, &VgpuTypeIds[0]) + vgpuTypeIds := make([]nvmlVgpuTypeId, vgpuCount) + ret := nvmlDeviceGetCreatableVgpus(device, &vgpuCount, &vgpuTypeIds[0]) if ret == SUCCESS { - return VgpuTypeIds[:VgpuCount], ret + return convertSlice[nvmlVgpuTypeId, VgpuTypeId](vgpuTypeIds[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } -func (Device Device) GetCreatableVgpus() ([]VgpuTypeId, Return) { - return DeviceGetCreatableVgpus(Device) +// nvml.DeviceGetActiveVgpus() +func (l *library) DeviceGetActiveVgpus(device Device) ([]VgpuInstance, Return) { + return device.GetActiveVgpus() } -// nvml.DeviceGetActiveVgpus() -func DeviceGetActiveVgpus(Device Device) ([]VgpuInstance, Return) { - var VgpuCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetActiveVgpus() ([]VgpuInstance, Return) { + var vgpuCount uint32 = 1 // Will be reduced upon returning for { - VgpuInstances := make([]VgpuInstance, VgpuCount) - ret := nvmlDeviceGetActiveVgpus(Device, &VgpuCount, &VgpuInstances[0]) + vgpuInstances := make([]nvmlVgpuInstance, vgpuCount) + ret := nvmlDeviceGetActiveVgpus(device, &vgpuCount, &vgpuInstances[0]) if ret == SUCCESS { - return VgpuInstances[:VgpuCount], ret + return convertSlice[nvmlVgpuInstance, VgpuInstance](vgpuInstances[:vgpuCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuCount *= 2 + vgpuCount *= 2 } } -func (Device Device) GetActiveVgpus() ([]VgpuInstance, Return) { - return DeviceGetActiveVgpus(Device) +// nvml.DeviceGetVgpuMetadata() +func (l *library) DeviceGetVgpuMetadata(device Device) (VgpuPgpuMetadata, Return) { + return device.GetVgpuMetadata() } -// nvml.DeviceGetVgpuMetadata() -func DeviceGetVgpuMetadata(Device Device) (VgpuPgpuMetadata, Return) { - var VgpuPgpuMetadata VgpuPgpuMetadata - OpaqueDataSize := unsafe.Sizeof(VgpuPgpuMetadata.nvmlVgpuPgpuMetadata.OpaqueData) - VgpuPgpuMetadataSize := unsafe.Sizeof(VgpuPgpuMetadata.nvmlVgpuPgpuMetadata) - OpaqueDataSize +func (device nvmlDevice) GetVgpuMetadata() (VgpuPgpuMetadata, Return) { + var vgpuPgpuMetadata VgpuPgpuMetadata + opaqueDataSize := unsafe.Sizeof(vgpuPgpuMetadata.nvmlVgpuPgpuMetadata.OpaqueData) + vgpuPgpuMetadataSize := unsafe.Sizeof(vgpuPgpuMetadata.nvmlVgpuPgpuMetadata) - opaqueDataSize for { - BufferSize := uint32(VgpuPgpuMetadataSize + OpaqueDataSize) - Buffer := make([]byte, BufferSize) - nvmlVgpuPgpuMetadataPtr := (*nvmlVgpuPgpuMetadata)(unsafe.Pointer(&Buffer[0])) - ret := nvmlDeviceGetVgpuMetadata(Device, nvmlVgpuPgpuMetadataPtr, &BufferSize) + bufferSize := uint32(vgpuPgpuMetadataSize + opaqueDataSize) + buffer := make([]byte, bufferSize) + nvmlVgpuPgpuMetadataPtr := (*nvmlVgpuPgpuMetadata)(unsafe.Pointer(&buffer[0])) + ret := nvmlDeviceGetVgpuMetadata(device, nvmlVgpuPgpuMetadataPtr, &bufferSize) if ret == SUCCESS { - VgpuPgpuMetadata.nvmlVgpuPgpuMetadata = *nvmlVgpuPgpuMetadataPtr - VgpuPgpuMetadata.OpaqueData = Buffer[VgpuPgpuMetadataSize:BufferSize] - return VgpuPgpuMetadata, ret + vgpuPgpuMetadata.nvmlVgpuPgpuMetadata = *nvmlVgpuPgpuMetadataPtr + vgpuPgpuMetadata.OpaqueData = buffer[vgpuPgpuMetadataSize:bufferSize] + return vgpuPgpuMetadata, ret } if ret != ERROR_INSUFFICIENT_SIZE { - return VgpuPgpuMetadata, ret + return vgpuPgpuMetadata, ret } - OpaqueDataSize = 2 * OpaqueDataSize + opaqueDataSize = 2 * opaqueDataSize } } -func (Device Device) GetVgpuMetadata() (VgpuPgpuMetadata, Return) { - return DeviceGetVgpuMetadata(Device) +// nvml.DeviceGetPgpuMetadataString() +func (l *library) DeviceGetPgpuMetadataString(device Device) (string, Return) { + return device.GetPgpuMetadataString() } -// nvml.DeviceGetPgpuMetadataString() -func DeviceGetPgpuMetadataString(Device Device) (string, Return) { - var BufferSize uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetPgpuMetadataString() (string, Return) { + var bufferSize uint32 = 1 // Will be reduced upon returning for { - PgpuMetadata := make([]byte, BufferSize) - ret := nvmlDeviceGetPgpuMetadataString(Device, &PgpuMetadata[0], &BufferSize) + pgpuMetadata := make([]byte, bufferSize) + ret := nvmlDeviceGetPgpuMetadataString(device, &pgpuMetadata[0], &bufferSize) if ret == SUCCESS { - return string(PgpuMetadata[:clen(PgpuMetadata)]), ret + return string(pgpuMetadata[:clen(pgpuMetadata)]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return "", ret } - BufferSize *= 2 + bufferSize *= 2 } } -func (Device Device) GetPgpuMetadataString() (string, Return) { - return DeviceGetPgpuMetadataString(Device) +// nvml.DeviceGetVgpuUtilization() +func (l *library) DeviceGetVgpuUtilization(device Device, lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { + return device.GetVgpuUtilization(lastSeenTimestamp) } -// nvml.DeviceGetVgpuUtilization() -func DeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { - var SampleValType ValueType - var VgpuInstanceSamplesCount uint32 = 1 // Will be reduced upon returning +func (device nvmlDevice) GetVgpuUtilization(lastSeenTimestamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { + var sampleValType ValueType + var vgpuInstanceSamplesCount uint32 = 1 // Will be reduced upon returning for { - UtilizationSamples := make([]VgpuInstanceUtilizationSample, VgpuInstanceSamplesCount) - ret := nvmlDeviceGetVgpuUtilization(Device, LastSeenTimeStamp, &SampleValType, &VgpuInstanceSamplesCount, &UtilizationSamples[0]) + utilizationSamples := make([]VgpuInstanceUtilizationSample, vgpuInstanceSamplesCount) + ret := nvmlDeviceGetVgpuUtilization(device, lastSeenTimestamp, &sampleValType, &vgpuInstanceSamplesCount, &utilizationSamples[0]) if ret == SUCCESS { - return SampleValType, UtilizationSamples[:VgpuInstanceSamplesCount], ret + return sampleValType, utilizationSamples[:vgpuInstanceSamplesCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { - return SampleValType, nil, ret + return sampleValType, nil, ret } - VgpuInstanceSamplesCount *= 2 + vgpuInstanceSamplesCount *= 2 } } -func (Device Device) GetVgpuUtilization(LastSeenTimeStamp uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) { - return DeviceGetVgpuUtilization(Device, LastSeenTimeStamp) -} - // nvml.DeviceGetAttributes() -func DeviceGetAttributes(Device Device) (DeviceAttributes, Return) { - var Attributes DeviceAttributes - ret := nvmlDeviceGetAttributes(Device, &Attributes) - return Attributes, ret +func (l *library) DeviceGetAttributes(device Device) (DeviceAttributes, Return) { + return device.GetAttributes() } -func (Device Device) GetAttributes() (DeviceAttributes, Return) { - return DeviceGetAttributes(Device) +func (device nvmlDevice) GetAttributes() (DeviceAttributes, Return) { + var attributes DeviceAttributes + ret := nvmlDeviceGetAttributes(device, &attributes) + return attributes, ret } // nvml.DeviceGetRemappedRows() -func DeviceGetRemappedRows(Device Device) (int, int, bool, bool, Return) { - var CorrRows, UncRows, IsPending, FailureOccured uint32 - ret := nvmlDeviceGetRemappedRows(Device, &CorrRows, &UncRows, &IsPending, &FailureOccured) - return int(CorrRows), int(UncRows), (IsPending != 0), (FailureOccured != 0), ret +func (l *library) DeviceGetRemappedRows(device Device) (int, int, bool, bool, Return) { + return device.GetRemappedRows() } -func (Device Device) GetRemappedRows() (int, int, bool, bool, Return) { - return DeviceGetRemappedRows(Device) +func (device nvmlDevice) GetRemappedRows() (int, int, bool, bool, Return) { + var corrRows, uncRows, isPending, failureOccured uint32 + ret := nvmlDeviceGetRemappedRows(device, &corrRows, &uncRows, &isPending, &failureOccured) + return int(corrRows), int(uncRows), (isPending != 0), (failureOccured != 0), ret } // nvml.DeviceGetRowRemapperHistogram() -func DeviceGetRowRemapperHistogram(Device Device) (RowRemapperHistogramValues, Return) { - var Values RowRemapperHistogramValues - ret := nvmlDeviceGetRowRemapperHistogram(Device, &Values) - return Values, ret +func (l *library) DeviceGetRowRemapperHistogram(device Device) (RowRemapperHistogramValues, Return) { + return device.GetRowRemapperHistogram() } -func (Device Device) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) { - return DeviceGetRowRemapperHistogram(Device) +func (device nvmlDevice) GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) { + var values RowRemapperHistogramValues + ret := nvmlDeviceGetRowRemapperHistogram(device, &values) + return values, ret } // nvml.DeviceGetArchitecture() -func DeviceGetArchitecture(Device Device) (DeviceArchitecture, Return) { - var Arch DeviceArchitecture - ret := nvmlDeviceGetArchitecture(Device, &Arch) - return Arch, ret +func (l *library) DeviceGetArchitecture(device Device) (DeviceArchitecture, Return) { + return device.GetArchitecture() } -func (Device Device) GetArchitecture() (DeviceArchitecture, Return) { - return DeviceGetArchitecture(Device) +func (device nvmlDevice) GetArchitecture() (DeviceArchitecture, Return) { + var arch DeviceArchitecture + ret := nvmlDeviceGetArchitecture(device, &arch) + return arch, ret } // nvml.DeviceGetVgpuProcessUtilization() -func DeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) { - var VgpuProcessSamplesCount uint32 = 1 // Will be reduced upon returning +func (l *library) DeviceGetVgpuProcessUtilization(device Device, lastSeenTimestamp uint64) ([]VgpuProcessUtilizationSample, Return) { + return device.GetVgpuProcessUtilization(lastSeenTimestamp) +} + +func (device nvmlDevice) GetVgpuProcessUtilization(lastSeenTimestamp uint64) ([]VgpuProcessUtilizationSample, Return) { + var vgpuProcessSamplesCount uint32 = 1 // Will be reduced upon returning for { - UtilizationSamples := make([]VgpuProcessUtilizationSample, VgpuProcessSamplesCount) - ret := nvmlDeviceGetVgpuProcessUtilization(Device, LastSeenTimeStamp, &VgpuProcessSamplesCount, &UtilizationSamples[0]) + utilizationSamples := make([]VgpuProcessUtilizationSample, vgpuProcessSamplesCount) + ret := nvmlDeviceGetVgpuProcessUtilization(device, lastSeenTimestamp, &vgpuProcessSamplesCount, &utilizationSamples[0]) if ret == SUCCESS { - return UtilizationSamples[:VgpuProcessSamplesCount], ret + return utilizationSamples[:vgpuProcessSamplesCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - VgpuProcessSamplesCount *= 2 + vgpuProcessSamplesCount *= 2 } } -func (Device Device) GetVgpuProcessUtilization(LastSeenTimeStamp uint64) ([]VgpuProcessUtilizationSample, Return) { - return DeviceGetVgpuProcessUtilization(Device, LastSeenTimeStamp) -} - // nvml.GetExcludedDeviceCount() -func GetExcludedDeviceCount() (int, Return) { - var DeviceCount uint32 - ret := nvmlGetExcludedDeviceCount(&DeviceCount) - return int(DeviceCount), ret +func (l *library) GetExcludedDeviceCount() (int, Return) { + var deviceCount uint32 + ret := nvmlGetExcludedDeviceCount(&deviceCount) + return int(deviceCount), ret } // nvml.GetExcludedDeviceInfoByIndex() -func GetExcludedDeviceInfoByIndex(Index int) (ExcludedDeviceInfo, Return) { - var Info ExcludedDeviceInfo - ret := nvmlGetExcludedDeviceInfoByIndex(uint32(Index), &Info) - return Info, ret +func (l *library) GetExcludedDeviceInfoByIndex(index int) (ExcludedDeviceInfo, Return) { + var info ExcludedDeviceInfo + ret := nvmlGetExcludedDeviceInfoByIndex(uint32(index), &info) + return info, ret } // nvml.DeviceSetMigMode() -func DeviceSetMigMode(Device Device, Mode int) (Return, Return) { - var ActivationStatus Return - ret := nvmlDeviceSetMigMode(Device, uint32(Mode), &ActivationStatus) - return ActivationStatus, ret +func (l *library) DeviceSetMigMode(device Device, mode int) (Return, Return) { + return device.SetMigMode(mode) } -func (Device Device) SetMigMode(Mode int) (Return, Return) { - return DeviceSetMigMode(Device, Mode) +func (device nvmlDevice) SetMigMode(mode int) (Return, Return) { + var activationStatus Return + ret := nvmlDeviceSetMigMode(device, uint32(mode), &activationStatus) + return activationStatus, ret } // nvml.DeviceGetMigMode() -func DeviceGetMigMode(Device Device) (int, int, Return) { - var CurrentMode, PendingMode uint32 - ret := nvmlDeviceGetMigMode(Device, &CurrentMode, &PendingMode) - return int(CurrentMode), int(PendingMode), ret +func (l *library) DeviceGetMigMode(device Device) (int, int, Return) { + return device.GetMigMode() } -func (Device Device) GetMigMode() (int, int, Return) { - return DeviceGetMigMode(Device) +func (device nvmlDevice) GetMigMode() (int, int, Return) { + var currentMode, pendingMode uint32 + ret := nvmlDeviceGetMigMode(device, ¤tMode, &pendingMode) + return int(currentMode), int(pendingMode), ret } // nvml.DeviceGetGpuInstanceProfileInfo() -func DeviceGetGpuInstanceProfileInfo(Device Device, Profile int) (GpuInstanceProfileInfo, Return) { - var Info GpuInstanceProfileInfo - ret := nvmlDeviceGetGpuInstanceProfileInfo(Device, uint32(Profile), &Info) - return Info, ret +func (l *library) DeviceGetGpuInstanceProfileInfo(device Device, profile int) (GpuInstanceProfileInfo, Return) { + return device.GetGpuInstanceProfileInfo(profile) } -func (Device Device) GetGpuInstanceProfileInfo(Profile int) (GpuInstanceProfileInfo, Return) { - return DeviceGetGpuInstanceProfileInfo(Device, Profile) +func (device nvmlDevice) GetGpuInstanceProfileInfo(profile int) (GpuInstanceProfileInfo, Return) { + var info GpuInstanceProfileInfo + ret := nvmlDeviceGetGpuInstanceProfileInfo(device, uint32(profile), &info) + return info, ret } // nvml.DeviceGetGpuInstanceProfileInfoV() type GpuInstanceProfileInfoV struct { - device Device + device nvmlDevice profile int } -func (InfoV GpuInstanceProfileInfoV) V1() (GpuInstanceProfileInfo, Return) { - return DeviceGetGpuInstanceProfileInfo(InfoV.device, InfoV.profile) +func (infoV GpuInstanceProfileInfoV) V1() (GpuInstanceProfileInfo, Return) { + return DeviceGetGpuInstanceProfileInfo(infoV.device, infoV.profile) } -func (InfoV GpuInstanceProfileInfoV) V2() (GpuInstanceProfileInfo_v2, Return) { - var Info GpuInstanceProfileInfo_v2 - Info.Version = STRUCT_VERSION(Info, 2) - ret := nvmlDeviceGetGpuInstanceProfileInfoV(InfoV.device, uint32(InfoV.profile), &Info) - return Info, ret +func (infoV GpuInstanceProfileInfoV) V2() (GpuInstanceProfileInfo_v2, Return) { + var info GpuInstanceProfileInfo_v2 + info.Version = STRUCT_VERSION(info, 2) + ret := nvmlDeviceGetGpuInstanceProfileInfoV(infoV.device, uint32(infoV.profile), &info) + return info, ret } -func DeviceGetGpuInstanceProfileInfoV(Device Device, Profile int) GpuInstanceProfileInfoV { - return GpuInstanceProfileInfoV{Device, Profile} +func (l *library) DeviceGetGpuInstanceProfileInfoV(device Device, profile int) GpuInstanceProfileInfoV { + return device.GetGpuInstanceProfileInfoV(profile) } -func (Device Device) GetGpuInstanceProfileInfoV(Profile int) GpuInstanceProfileInfoV { - return DeviceGetGpuInstanceProfileInfoV(Device, Profile) +func (device nvmlDevice) GetGpuInstanceProfileInfoV(profile int) GpuInstanceProfileInfoV { + return GpuInstanceProfileInfoV{device, profile} } // nvml.DeviceGetGpuInstancePossiblePlacements() -func DeviceGetGpuInstancePossiblePlacements(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { - if Info == nil { +func (l *library) DeviceGetGpuInstancePossiblePlacements(device Device, info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { + return device.GetGpuInstancePossiblePlacements(info) +} + +func (device nvmlDevice) GetGpuInstancePossiblePlacements(info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { + if info == nil { return nil, ERROR_INVALID_ARGUMENT } - var Count uint32 - ret := nvmlDeviceGetGpuInstancePossiblePlacements(Device, Info.Id, nil, &Count) + var count uint32 + ret := nvmlDeviceGetGpuInstancePossiblePlacements(device, info.Id, nil, &count) if ret != SUCCESS { return nil, ret } - if Count == 0 { + if count == 0 { return []GpuInstancePlacement{}, ret } - Placements := make([]GpuInstancePlacement, Count) - ret = nvmlDeviceGetGpuInstancePossiblePlacements(Device, Info.Id, &Placements[0], &Count) - return Placements[:Count], ret + placements := make([]GpuInstancePlacement, count) + ret = nvmlDeviceGetGpuInstancePossiblePlacements(device, info.Id, &placements[0], &count) + return placements[:count], ret } -func (Device Device) GetGpuInstancePossiblePlacements(Info *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) { - return DeviceGetGpuInstancePossiblePlacements(Device, Info) +// nvml.DeviceGetGpuInstanceRemainingCapacity() +func (l *library) DeviceGetGpuInstanceRemainingCapacity(device Device, info *GpuInstanceProfileInfo) (int, Return) { + return device.GetGpuInstanceRemainingCapacity(info) } -// nvml.DeviceGetGpuInstanceRemainingCapacity() -func DeviceGetGpuInstanceRemainingCapacity(Device Device, Info *GpuInstanceProfileInfo) (int, Return) { - if Info == nil { +func (device nvmlDevice) GetGpuInstanceRemainingCapacity(info *GpuInstanceProfileInfo) (int, Return) { + if info == nil { return 0, ERROR_INVALID_ARGUMENT } - var Count uint32 - ret := nvmlDeviceGetGpuInstanceRemainingCapacity(Device, Info.Id, &Count) - return int(Count), ret -} - -func (Device Device) GetGpuInstanceRemainingCapacity(Info *GpuInstanceProfileInfo) (int, Return) { - return DeviceGetGpuInstanceRemainingCapacity(Device, Info) + var count uint32 + ret := nvmlDeviceGetGpuInstanceRemainingCapacity(device, info.Id, &count) + return int(count), ret } // nvml.DeviceCreateGpuInstance() -func DeviceCreateGpuInstance(Device Device, Info *GpuInstanceProfileInfo) (GpuInstance, Return) { - if Info == nil { - return GpuInstance{}, ERROR_INVALID_ARGUMENT - } - var GpuInstance GpuInstance - ret := nvmlDeviceCreateGpuInstance(Device, Info.Id, &GpuInstance) - return GpuInstance, ret +func (l *library) DeviceCreateGpuInstance(device Device, info *GpuInstanceProfileInfo) (GpuInstance, Return) { + return device.CreateGpuInstance(info) } -func (Device Device) CreateGpuInstance(Info *GpuInstanceProfileInfo) (GpuInstance, Return) { - return DeviceCreateGpuInstance(Device, Info) +func (device nvmlDevice) CreateGpuInstance(info *GpuInstanceProfileInfo) (GpuInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceCreateGpuInstance(device, info.Id, &gpuInstance) + return gpuInstance, ret } // nvml.DeviceCreateGpuInstanceWithPlacement() -func DeviceCreateGpuInstanceWithPlacement(Device Device, Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { - if Info == nil { - return GpuInstance{}, ERROR_INVALID_ARGUMENT - } - var GpuInstance GpuInstance - ret := nvmlDeviceCreateGpuInstanceWithPlacement(Device, Info.Id, Placement, &GpuInstance) - return GpuInstance, ret +func (l *library) DeviceCreateGpuInstanceWithPlacement(device Device, info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) { + return device.CreateGpuInstanceWithPlacement(info, placement) } -func (Device Device) CreateGpuInstanceWithPlacement(Info *GpuInstanceProfileInfo, Placement *GpuInstancePlacement) (GpuInstance, Return) { - return DeviceCreateGpuInstanceWithPlacement(Device, Info, Placement) +func (device nvmlDevice) CreateGpuInstanceWithPlacement(info *GpuInstanceProfileInfo, placement *GpuInstancePlacement) (GpuInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceCreateGpuInstanceWithPlacement(device, info.Id, placement, &gpuInstance) + return gpuInstance, ret } // nvml.GpuInstanceDestroy() -func GpuInstanceDestroy(GpuInstance GpuInstance) Return { - return nvmlGpuInstanceDestroy(GpuInstance) +func (l *library) GpuInstanceDestroy(gpuInstance GpuInstance) Return { + return gpuInstance.Destroy() } -func (GpuInstance GpuInstance) Destroy() Return { - return GpuInstanceDestroy(GpuInstance) +func (gpuInstance nvmlGpuInstance) Destroy() Return { + return nvmlGpuInstanceDestroy(gpuInstance) } // nvml.DeviceGetGpuInstances() -func DeviceGetGpuInstances(Device Device, Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - if Info == nil { - return nil, ERROR_INVALID_ARGUMENT - } - var Count uint32 = Info.InstanceCount - GpuInstances := make([]GpuInstance, Count) - ret := nvmlDeviceGetGpuInstances(Device, Info.Id, &GpuInstances[0], &Count) - return GpuInstances[:Count], ret +func (l *library) DeviceGetGpuInstances(device Device, info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { + return device.GetGpuInstances(info) } -func (Device Device) GetGpuInstances(Info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { - return DeviceGetGpuInstances(Device, Info) +func (device nvmlDevice) GetGpuInstances(info *GpuInstanceProfileInfo) ([]GpuInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var count uint32 = info.InstanceCount + gpuInstances := make([]nvmlGpuInstance, count) + ret := nvmlDeviceGetGpuInstances(device, info.Id, &gpuInstances[0], &count) + return convertSlice[nvmlGpuInstance, GpuInstance](gpuInstances[:count]), ret } // nvml.DeviceGetGpuInstanceById() -func DeviceGetGpuInstanceById(Device Device, Id int) (GpuInstance, Return) { - var GpuInstance GpuInstance - ret := nvmlDeviceGetGpuInstanceById(Device, uint32(Id), &GpuInstance) - return GpuInstance, ret +func (l *library) DeviceGetGpuInstanceById(device Device, id int) (GpuInstance, Return) { + return device.GetGpuInstanceById(id) } -func (Device Device) GetGpuInstanceById(Id int) (GpuInstance, Return) { - return DeviceGetGpuInstanceById(Device, Id) +func (device nvmlDevice) GetGpuInstanceById(id int) (GpuInstance, Return) { + var gpuInstance nvmlGpuInstance + ret := nvmlDeviceGetGpuInstanceById(device, uint32(id), &gpuInstance) + return gpuInstance, ret } // nvml.GpuInstanceGetInfo() -func GpuInstanceGetInfo(GpuInstance GpuInstance) (GpuInstanceInfo, Return) { - var Info GpuInstanceInfo - ret := nvmlGpuInstanceGetInfo(GpuInstance, &Info) - return Info, ret +func (l *library) GpuInstanceGetInfo(gpuInstance GpuInstance) (GpuInstanceInfo, Return) { + return gpuInstance.GetInfo() } -func (GpuInstance GpuInstance) GetInfo() (GpuInstanceInfo, Return) { - return GpuInstanceGetInfo(GpuInstance) +func (gpuInstance nvmlGpuInstance) GetInfo() (GpuInstanceInfo, Return) { + var info nvmlGpuInstanceInfo + ret := nvmlGpuInstanceGetInfo(gpuInstance, &info) + return info.convert(), ret } // nvml.GpuInstanceGetComputeInstanceProfileInfo() -func GpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { - var Info ComputeInstanceProfileInfo - ret := nvmlGpuInstanceGetComputeInstanceProfileInfo(GpuInstance, uint32(Profile), uint32(EngProfile), &Info) - return Info, ret +func (l *library) GpuInstanceGetComputeInstanceProfileInfo(gpuInstance GpuInstance, profile int, engProfile int) (ComputeInstanceProfileInfo, Return) { + return gpuInstance.GetComputeInstanceProfileInfo(profile, engProfile) } -func (GpuInstance GpuInstance) GetComputeInstanceProfileInfo(Profile int, EngProfile int) (ComputeInstanceProfileInfo, Return) { - return GpuInstanceGetComputeInstanceProfileInfo(GpuInstance, Profile, EngProfile) +func (gpuInstance nvmlGpuInstance) GetComputeInstanceProfileInfo(profile int, engProfile int) (ComputeInstanceProfileInfo, Return) { + var info ComputeInstanceProfileInfo + ret := nvmlGpuInstanceGetComputeInstanceProfileInfo(gpuInstance, uint32(profile), uint32(engProfile), &info) + return info, ret } // nvml.GpuInstanceGetComputeInstanceProfileInfoV() type ComputeInstanceProfileInfoV struct { - gpuInstance GpuInstance + gpuInstance nvmlGpuInstance profile int engProfile int } -func (InfoV ComputeInstanceProfileInfoV) V1() (ComputeInstanceProfileInfo, Return) { - return GpuInstanceGetComputeInstanceProfileInfo(InfoV.gpuInstance, InfoV.profile, InfoV.engProfile) +func (infoV ComputeInstanceProfileInfoV) V1() (ComputeInstanceProfileInfo, Return) { + return GpuInstanceGetComputeInstanceProfileInfo(infoV.gpuInstance, infoV.profile, infoV.engProfile) } -func (InfoV ComputeInstanceProfileInfoV) V2() (ComputeInstanceProfileInfo_v2, Return) { - var Info ComputeInstanceProfileInfo_v2 - Info.Version = STRUCT_VERSION(Info, 2) - ret := nvmlGpuInstanceGetComputeInstanceProfileInfoV(InfoV.gpuInstance, uint32(InfoV.profile), uint32(InfoV.engProfile), &Info) - return Info, ret +func (infoV ComputeInstanceProfileInfoV) V2() (ComputeInstanceProfileInfo_v2, Return) { + var info ComputeInstanceProfileInfo_v2 + info.Version = STRUCT_VERSION(info, 2) + ret := nvmlGpuInstanceGetComputeInstanceProfileInfoV(infoV.gpuInstance, uint32(infoV.profile), uint32(infoV.engProfile), &info) + return info, ret } -func GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile int, EngProfile int) ComputeInstanceProfileInfoV { - return ComputeInstanceProfileInfoV{GpuInstance, Profile, EngProfile} +func (l *library) GpuInstanceGetComputeInstanceProfileInfoV(gpuInstance GpuInstance, profile int, engProfile int) ComputeInstanceProfileInfoV { + return gpuInstance.GetComputeInstanceProfileInfoV(profile, engProfile) } -func (GpuInstance GpuInstance) GetComputeInstanceProfileInfoV(Profile int, EngProfile int) ComputeInstanceProfileInfoV { - return GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance, Profile, EngProfile) +func (gpuInstance nvmlGpuInstance) GetComputeInstanceProfileInfoV(profile int, engProfile int) ComputeInstanceProfileInfoV { + return ComputeInstanceProfileInfoV{gpuInstance, profile, engProfile} } // nvml.GpuInstanceGetComputeInstanceRemainingCapacity() -func GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (int, Return) { - if Info == nil { - return 0, ERROR_INVALID_ARGUMENT - } - var Count uint32 - ret := nvmlGpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance, Info.Id, &Count) - return int(Count), ret +func (l *library) GpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (int, Return) { + return gpuInstance.GetComputeInstanceRemainingCapacity(info) } -func (GpuInstance GpuInstance) GetComputeInstanceRemainingCapacity(Info *ComputeInstanceProfileInfo) (int, Return) { - return GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance, Info) +func (gpuInstance nvmlGpuInstance) GetComputeInstanceRemainingCapacity(info *ComputeInstanceProfileInfo) (int, Return) { + if info == nil { + return 0, ERROR_INVALID_ARGUMENT + } + var count uint32 + ret := nvmlGpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance, info.Id, &count) + return int(count), ret } // nvml.GpuInstanceCreateComputeInstance() -func GpuInstanceCreateComputeInstance(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - if Info == nil { - return ComputeInstance{}, ERROR_INVALID_ARGUMENT - } - var ComputeInstance ComputeInstance - ret := nvmlGpuInstanceCreateComputeInstance(GpuInstance, Info.Id, &ComputeInstance) - return ComputeInstance, ret +func (l *library) GpuInstanceCreateComputeInstance(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { + return gpuInstance.CreateComputeInstance(info) } -func (GpuInstance GpuInstance) CreateComputeInstance(Info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { - return GpuInstanceCreateComputeInstance(GpuInstance, Info) +func (gpuInstance nvmlGpuInstance) CreateComputeInstance(info *ComputeInstanceProfileInfo) (ComputeInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var computeInstance nvmlComputeInstance + ret := nvmlGpuInstanceCreateComputeInstance(gpuInstance, info.Id, &computeInstance) + return computeInstance, ret } // nvml.ComputeInstanceDestroy() -func ComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { - return nvmlComputeInstanceDestroy(ComputeInstance) +func (l *library) ComputeInstanceDestroy(computeInstance ComputeInstance) Return { + return computeInstance.Destroy() } -func (ComputeInstance ComputeInstance) Destroy() Return { - return ComputeInstanceDestroy(ComputeInstance) +func (computeInstance nvmlComputeInstance) Destroy() Return { + return nvmlComputeInstanceDestroy(computeInstance) } // nvml.GpuInstanceGetComputeInstances() -func GpuInstanceGetComputeInstances(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - if Info == nil { - return nil, ERROR_INVALID_ARGUMENT - } - var Count uint32 = Info.InstanceCount - ComputeInstances := make([]ComputeInstance, Count) - ret := nvmlGpuInstanceGetComputeInstances(GpuInstance, Info.Id, &ComputeInstances[0], &Count) - return ComputeInstances[:Count], ret +func (l *library) GpuInstanceGetComputeInstances(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { + return gpuInstance.GetComputeInstances(info) } -func (GpuInstance GpuInstance) GetComputeInstances(Info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { - return GpuInstanceGetComputeInstances(GpuInstance, Info) +func (gpuInstance nvmlGpuInstance) GetComputeInstances(info *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) { + if info == nil { + return nil, ERROR_INVALID_ARGUMENT + } + var count uint32 = info.InstanceCount + computeInstances := make([]nvmlComputeInstance, count) + ret := nvmlGpuInstanceGetComputeInstances(gpuInstance, info.Id, &computeInstances[0], &count) + return convertSlice[nvmlComputeInstance, ComputeInstance](computeInstances[:count]), ret } // nvml.GpuInstanceGetComputeInstanceById() -func GpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id int) (ComputeInstance, Return) { - var ComputeInstance ComputeInstance - ret := nvmlGpuInstanceGetComputeInstanceById(GpuInstance, uint32(Id), &ComputeInstance) - return ComputeInstance, ret +func (l *library) GpuInstanceGetComputeInstanceById(gpuInstance GpuInstance, id int) (ComputeInstance, Return) { + return gpuInstance.GetComputeInstanceById(id) } -func (GpuInstance GpuInstance) GetComputeInstanceById(Id int) (ComputeInstance, Return) { - return GpuInstanceGetComputeInstanceById(GpuInstance, Id) +func (gpuInstance nvmlGpuInstance) GetComputeInstanceById(id int) (ComputeInstance, Return) { + var computeInstance nvmlComputeInstance + ret := nvmlGpuInstanceGetComputeInstanceById(gpuInstance, uint32(id), &computeInstance) + return computeInstance, ret } // nvml.ComputeInstanceGetInfo() -func ComputeInstanceGetInfo(ComputeInstance ComputeInstance) (ComputeInstanceInfo, Return) { - var Info ComputeInstanceInfo - ret := nvmlComputeInstanceGetInfo(ComputeInstance, &Info) - return Info, ret +func (l *library) ComputeInstanceGetInfo(computeInstance ComputeInstance) (ComputeInstanceInfo, Return) { + return computeInstance.GetInfo() } -func (ComputeInstance ComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { - return ComputeInstanceGetInfo(ComputeInstance) +func (computeInstance nvmlComputeInstance) GetInfo() (ComputeInstanceInfo, Return) { + var info nvmlComputeInstanceInfo + ret := nvmlComputeInstanceGetInfo(computeInstance, &info) + return info.convert(), ret } // nvml.DeviceIsMigDeviceHandle() -func DeviceIsMigDeviceHandle(Device Device) (bool, Return) { - var IsMigDevice uint32 - ret := nvmlDeviceIsMigDeviceHandle(Device, &IsMigDevice) - return (IsMigDevice != 0), ret +func (l *library) DeviceIsMigDeviceHandle(device Device) (bool, Return) { + return device.IsMigDeviceHandle() } -func (Device Device) IsMigDeviceHandle() (bool, Return) { - return DeviceIsMigDeviceHandle(Device) +func (device nvmlDevice) IsMigDeviceHandle() (bool, Return) { + var isMigDevice uint32 + ret := nvmlDeviceIsMigDeviceHandle(device, &isMigDevice) + return (isMigDevice != 0), ret } // nvml DeviceGetGpuInstanceId() -func DeviceGetGpuInstanceId(Device Device) (int, Return) { - var Id uint32 - ret := nvmlDeviceGetGpuInstanceId(Device, &Id) - return int(Id), ret +func (l *library) DeviceGetGpuInstanceId(device Device) (int, Return) { + return device.GetGpuInstanceId() } -func (Device Device) GetGpuInstanceId() (int, Return) { - return DeviceGetGpuInstanceId(Device) +func (device nvmlDevice) GetGpuInstanceId() (int, Return) { + var id uint32 + ret := nvmlDeviceGetGpuInstanceId(device, &id) + return int(id), ret } // nvml.DeviceGetComputeInstanceId() -func DeviceGetComputeInstanceId(Device Device) (int, Return) { - var Id uint32 - ret := nvmlDeviceGetComputeInstanceId(Device, &Id) - return int(Id), ret +func (l *library) DeviceGetComputeInstanceId(device Device) (int, Return) { + return device.GetComputeInstanceId() } -func (Device Device) GetComputeInstanceId() (int, Return) { - return DeviceGetComputeInstanceId(Device) +func (device nvmlDevice) GetComputeInstanceId() (int, Return) { + var id uint32 + ret := nvmlDeviceGetComputeInstanceId(device, &id) + return int(id), ret } // nvml.DeviceGetMaxMigDeviceCount() -func DeviceGetMaxMigDeviceCount(Device Device) (int, Return) { - var Count uint32 - ret := nvmlDeviceGetMaxMigDeviceCount(Device, &Count) - return int(Count), ret +func (l *library) DeviceGetMaxMigDeviceCount(device Device) (int, Return) { + return device.GetMaxMigDeviceCount() } -func (Device Device) GetMaxMigDeviceCount() (int, Return) { - return DeviceGetMaxMigDeviceCount(Device) +func (device nvmlDevice) GetMaxMigDeviceCount() (int, Return) { + var count uint32 + ret := nvmlDeviceGetMaxMigDeviceCount(device, &count) + return int(count), ret } // nvml.DeviceGetMigDeviceHandleByIndex() -func DeviceGetMigDeviceHandleByIndex(device Device, Index int) (Device, Return) { - var MigDevice Device - ret := nvmlDeviceGetMigDeviceHandleByIndex(device, uint32(Index), &MigDevice) - return MigDevice, ret +func (l *library) DeviceGetMigDeviceHandleByIndex(device Device, index int) (Device, Return) { + return device.GetMigDeviceHandleByIndex(index) } -func (Device Device) GetMigDeviceHandleByIndex(Index int) (Device, Return) { - return DeviceGetMigDeviceHandleByIndex(Device, Index) +func (device nvmlDevice) GetMigDeviceHandleByIndex(index int) (Device, Return) { + var migDevice nvmlDevice + ret := nvmlDeviceGetMigDeviceHandleByIndex(device, uint32(index), &migDevice) + return migDevice, ret } // nvml.DeviceGetDeviceHandleFromMigDeviceHandle() -func DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device) (Device, Return) { - var Device Device - ret := nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice, &Device) - return Device, ret +func (l *library) DeviceGetDeviceHandleFromMigDeviceHandle(migdevice Device) (Device, Return) { + return migdevice.GetDeviceHandleFromMigDeviceHandle() } -func (MigDevice Device) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { - return DeviceGetDeviceHandleFromMigDeviceHandle(MigDevice) +func (migDevice nvmlDevice) GetDeviceHandleFromMigDeviceHandle() (Device, Return) { + var device nvmlDevice + ret := nvmlDeviceGetDeviceHandleFromMigDeviceHandle(migDevice, &device) + return device, ret } // nvml.DeviceGetBusType() -func DeviceGetBusType(Device Device) (BusType, Return) { - var Type BusType - ret := nvmlDeviceGetBusType(Device, &Type) - return Type, ret +func (l *library) DeviceGetBusType(device Device) (BusType, Return) { + return device.GetBusType() } -func (Device Device) GetBusType() (BusType, Return) { - return DeviceGetBusType(Device) +func (device nvmlDevice) GetBusType() (BusType, Return) { + var busType BusType + ret := nvmlDeviceGetBusType(device, &busType) + return busType, ret } // nvml.DeviceSetDefaultFanSpeed_v2() -func DeviceSetDefaultFanSpeed_v2(Device Device, Fan int) Return { - return nvmlDeviceSetDefaultFanSpeed_v2(Device, uint32(Fan)) +func (l *library) DeviceSetDefaultFanSpeed_v2(device Device, fan int) Return { + return device.SetDefaultFanSpeed_v2(fan) } -func (Device Device) SetDefaultFanSpeed_v2(Fan int) Return { - return DeviceSetDefaultFanSpeed_v2(Device, Fan) +func (device nvmlDevice) SetDefaultFanSpeed_v2(fan int) Return { + return nvmlDeviceSetDefaultFanSpeed_v2(device, uint32(fan)) } // nvml.DeviceGetMinMaxFanSpeed() -func DeviceGetMinMaxFanSpeed(Device Device) (int, int, Return) { - var MinSpeed, MaxSpeed uint32 - ret := nvmlDeviceGetMinMaxFanSpeed(Device, &MinSpeed, &MaxSpeed) - return int(MinSpeed), int(MaxSpeed), ret +func (l *library) DeviceGetMinMaxFanSpeed(device Device) (int, int, Return) { + return device.GetMinMaxFanSpeed() } -func (Device Device) GetMinMaxFanSpeed() (int, int, Return) { - return DeviceGetMinMaxFanSpeed(Device) +func (device nvmlDevice) GetMinMaxFanSpeed() (int, int, Return) { + var minSpeed, maxSpeed uint32 + ret := nvmlDeviceGetMinMaxFanSpeed(device, &minSpeed, &maxSpeed) + return int(minSpeed), int(maxSpeed), ret } // nvml.DeviceGetThermalSettings() -func DeviceGetThermalSettings(Device Device, SensorIndex uint32) (GpuThermalSettings, Return) { - var PThermalSettings GpuThermalSettings - ret := nvmlDeviceGetThermalSettings(Device, SensorIndex, &PThermalSettings) - return PThermalSettings, ret +func (l *library) DeviceGetThermalSettings(device Device, sensorIndex uint32) (GpuThermalSettings, Return) { + return device.GetThermalSettings(sensorIndex) } -func (Device Device) GetThermalSettings(SensorIndex uint32) (GpuThermalSettings, Return) { - return DeviceGetThermalSettings(Device, SensorIndex) +func (device nvmlDevice) GetThermalSettings(sensorIndex uint32) (GpuThermalSettings, Return) { + var pThermalSettings GpuThermalSettings + ret := nvmlDeviceGetThermalSettings(device, sensorIndex, &pThermalSettings) + return pThermalSettings, ret } // nvml.DeviceGetDefaultEccMode() -func DeviceGetDefaultEccMode(Device Device) (EnableState, Return) { - var DefaultMode EnableState - ret := nvmlDeviceGetDefaultEccMode(Device, &DefaultMode) - return DefaultMode, ret +func (l *library) DeviceGetDefaultEccMode(device Device) (EnableState, Return) { + return device.GetDefaultEccMode() } -func (Device Device) GetDefaultEccMode() (EnableState, Return) { - return DeviceGetDefaultEccMode(Device) +func (device nvmlDevice) GetDefaultEccMode() (EnableState, Return) { + var defaultMode EnableState + ret := nvmlDeviceGetDefaultEccMode(device, &defaultMode) + return defaultMode, ret } // nvml.DeviceGetPcieSpeed() -func DeviceGetPcieSpeed(Device Device) (int, Return) { - var PcieSpeed uint32 - ret := nvmlDeviceGetPcieSpeed(Device, &PcieSpeed) - return int(PcieSpeed), ret +func (l *library) DeviceGetPcieSpeed(device Device) (int, Return) { + return device.GetPcieSpeed() } -func (Device Device) GetPcieSpeed() (int, Return) { - return DeviceGetPcieSpeed(Device) +func (device nvmlDevice) GetPcieSpeed() (int, Return) { + var pcieSpeed uint32 + ret := nvmlDeviceGetPcieSpeed(device, &pcieSpeed) + return int(pcieSpeed), ret } // nvml.DeviceGetGspFirmwareVersion() -func DeviceGetGspFirmwareVersion(Device Device) (string, Return) { - Version := make([]byte, GSP_FIRMWARE_VERSION_BUF_SIZE) - ret := nvmlDeviceGetGspFirmwareVersion(Device, &Version[0]) - return string(Version[:clen(Version)]), ret +func (l *library) DeviceGetGspFirmwareVersion(device Device) (string, Return) { + return device.GetGspFirmwareVersion() } -func (Device Device) GetGspFirmwareVersion() (string, Return) { - return DeviceGetGspFirmwareVersion(Device) +func (device nvmlDevice) GetGspFirmwareVersion() (string, Return) { + version := make([]byte, GSP_FIRMWARE_VERSION_BUF_SIZE) + ret := nvmlDeviceGetGspFirmwareVersion(device, &version[0]) + return string(version[:clen(version)]), ret } // nvml.DeviceGetGspFirmwareMode() -func DeviceGetGspFirmwareMode(Device Device) (bool, bool, Return) { - var IsEnabled, DefaultMode uint32 - ret := nvmlDeviceGetGspFirmwareMode(Device, &IsEnabled, &DefaultMode) - return (IsEnabled != 0), (DefaultMode != 0), ret +func (l *library) DeviceGetGspFirmwareMode(device Device) (bool, bool, Return) { + return device.GetGspFirmwareMode() } -func (Device Device) GetGspFirmwareMode() (bool, bool, Return) { - return DeviceGetGspFirmwareMode(Device) +func (device nvmlDevice) GetGspFirmwareMode() (bool, bool, Return) { + var isEnabled, defaultMode uint32 + ret := nvmlDeviceGetGspFirmwareMode(device, &isEnabled, &defaultMode) + return (isEnabled != 0), (defaultMode != 0), ret } // nvml.DeviceGetDynamicPstatesInfo() -func DeviceGetDynamicPstatesInfo(Device Device) (GpuDynamicPstatesInfo, Return) { - var PDynamicPstatesInfo GpuDynamicPstatesInfo - ret := nvmlDeviceGetDynamicPstatesInfo(Device, &PDynamicPstatesInfo) - return PDynamicPstatesInfo, ret +func (l *library) DeviceGetDynamicPstatesInfo(device Device) (GpuDynamicPstatesInfo, Return) { + return device.GetDynamicPstatesInfo() } -func (Device Device) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { - return DeviceGetDynamicPstatesInfo(Device) +func (device nvmlDevice) GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) { + var pDynamicPstatesInfo GpuDynamicPstatesInfo + ret := nvmlDeviceGetDynamicPstatesInfo(device, &pDynamicPstatesInfo) + return pDynamicPstatesInfo, ret } // nvml.DeviceSetFanSpeed_v2() -func DeviceSetFanSpeed_v2(Device Device, Fan int, Speed int) Return { - return nvmlDeviceSetFanSpeed_v2(Device, uint32(Fan), uint32(Speed)) +func (l *library) DeviceSetFanSpeed_v2(device Device, fan int, speed int) Return { + return device.SetFanSpeed_v2(fan, speed) } -func (Device Device) SetFanSpeed_v2(Fan int, Speed int) Return { - return DeviceSetFanSpeed_v2(Device, Fan, Speed) +func (device nvmlDevice) SetFanSpeed_v2(fan int, speed int) Return { + return nvmlDeviceSetFanSpeed_v2(device, uint32(fan), uint32(speed)) } // nvml.DeviceGetGpcClkVfOffset() -func DeviceGetGpcClkVfOffset(Device Device) (int, Return) { - var Offset int32 - ret := nvmlDeviceGetGpcClkVfOffset(Device, &Offset) - return int(Offset), ret +func (l *library) DeviceGetGpcClkVfOffset(device Device) (int, Return) { + return device.GetGpcClkVfOffset() } -func (Device Device) GetGpcClkVfOffset() (int, Return) { - return DeviceGetGpcClkVfOffset(Device) +func (device nvmlDevice) GetGpcClkVfOffset() (int, Return) { + var offset int32 + ret := nvmlDeviceGetGpcClkVfOffset(device, &offset) + return int(offset), ret } // nvml.DeviceSetGpcClkVfOffset() -func DeviceSetGpcClkVfOffset(Device Device, Offset int) Return { - return nvmlDeviceSetGpcClkVfOffset(Device, int32(Offset)) +func (l *library) DeviceSetGpcClkVfOffset(device Device, offset int) Return { + return device.SetGpcClkVfOffset(offset) } -func (Device Device) SetGpcClkVfOffset(Offset int) Return { - return DeviceSetGpcClkVfOffset(Device, Offset) +func (device nvmlDevice) SetGpcClkVfOffset(offset int) Return { + return nvmlDeviceSetGpcClkVfOffset(device, int32(offset)) } // nvml.DeviceGetMinMaxClockOfPState() -func DeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates) (uint32, uint32, Return) { - var MinClockMHz, MaxClockMHz uint32 - ret := nvmlDeviceGetMinMaxClockOfPState(Device, _type, Pstate, &MinClockMHz, &MaxClockMHz) - return MinClockMHz, MaxClockMHz, ret +func (l *library) DeviceGetMinMaxClockOfPState(device Device, clockType ClockType, pstate Pstates) (uint32, uint32, Return) { + return device.GetMinMaxClockOfPState(clockType, pstate) } -func (Device Device) GetMinMaxClockOfPState(_type ClockType, Pstate Pstates) (uint32, uint32, Return) { - return DeviceGetMinMaxClockOfPState(Device, _type, Pstate) +func (device nvmlDevice) GetMinMaxClockOfPState(clockType ClockType, pstate Pstates) (uint32, uint32, Return) { + var minClockMHz, maxClockMHz uint32 + ret := nvmlDeviceGetMinMaxClockOfPState(device, clockType, pstate, &minClockMHz, &maxClockMHz) + return minClockMHz, maxClockMHz, ret } // nvml.DeviceGetSupportedPerformanceStates() -func DeviceGetSupportedPerformanceStates(Device Device) ([]Pstates, Return) { - Pstates := make([]Pstates, MAX_GPU_PERF_PSTATES) - ret := nvmlDeviceGetSupportedPerformanceStates(Device, &Pstates[0], MAX_GPU_PERF_PSTATES) +func (l *library) DeviceGetSupportedPerformanceStates(device Device) ([]Pstates, Return) { + return device.GetSupportedPerformanceStates() +} + +func (device nvmlDevice) GetSupportedPerformanceStates() ([]Pstates, Return) { + pstates := make([]Pstates, MAX_GPU_PERF_PSTATES) + ret := nvmlDeviceGetSupportedPerformanceStates(device, &pstates[0], MAX_GPU_PERF_PSTATES) for i := 0; i < MAX_GPU_PERF_PSTATES; i++ { - if Pstates[i] == PSTATE_UNKNOWN { - return Pstates[0:i], ret + if pstates[i] == PSTATE_UNKNOWN { + return pstates[0:i], ret } } - return Pstates, ret -} - -func (Device Device) GetSupportedPerformanceStates() ([]Pstates, Return) { - return DeviceGetSupportedPerformanceStates(Device) + return pstates, ret } // nvml.DeviceGetTargetFanSpeed() -func DeviceGetTargetFanSpeed(Device Device, Fan int) (int, Return) { - var TargetSpeed uint32 - ret := nvmlDeviceGetTargetFanSpeed(Device, uint32(Fan), &TargetSpeed) - return int(TargetSpeed), ret +func (l *library) DeviceGetTargetFanSpeed(device Device, fan int) (int, Return) { + return device.GetTargetFanSpeed(fan) } -func (Device Device) GetTargetFanSpeed(Fan int) (int, Return) { - return DeviceGetTargetFanSpeed(Device, Fan) +func (device nvmlDevice) GetTargetFanSpeed(fan int) (int, Return) { + var targetSpeed uint32 + ret := nvmlDeviceGetTargetFanSpeed(device, uint32(fan), &targetSpeed) + return int(targetSpeed), ret } // nvml.DeviceGetMemClkVfOffset() -func DeviceGetMemClkVfOffset(Device Device) (int, Return) { - var Offset int32 - ret := nvmlDeviceGetMemClkVfOffset(Device, &Offset) - return int(Offset), ret +func (l *library) DeviceGetMemClkVfOffset(device Device) (int, Return) { + return device.GetMemClkVfOffset() } -func (Device Device) GetMemClkVfOffset() (int, Return) { - return DeviceGetMemClkVfOffset(Device) +func (device nvmlDevice) GetMemClkVfOffset() (int, Return) { + var offset int32 + ret := nvmlDeviceGetMemClkVfOffset(device, &offset) + return int(offset), ret } // nvml.DeviceSetMemClkVfOffset() -func DeviceSetMemClkVfOffset(Device Device, Offset int) Return { - return nvmlDeviceSetMemClkVfOffset(Device, int32(Offset)) +func (l *library) DeviceSetMemClkVfOffset(device Device, offset int) Return { + return device.SetMemClkVfOffset(offset) } -func (Device Device) SetMemClkVfOffset(Offset int) Return { - return DeviceSetMemClkVfOffset(Device, Offset) +func (device nvmlDevice) SetMemClkVfOffset(offset int) Return { + return nvmlDeviceSetMemClkVfOffset(device, int32(offset)) } // nvml.DeviceGetGpcClkMinMaxVfOffset() -func DeviceGetGpcClkMinMaxVfOffset(Device Device) (int, int, Return) { - var MinOffset, MaxOffset int32 - ret := nvmlDeviceGetGpcClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) - return int(MinOffset), int(MaxOffset), ret +func (l *library) DeviceGetGpcClkMinMaxVfOffset(device Device) (int, int, Return) { + return device.GetGpcClkMinMaxVfOffset() } -func (Device Device) GetGpcClkMinMaxVfOffset() (int, int, Return) { - return DeviceGetGpcClkMinMaxVfOffset(Device) +func (device nvmlDevice) GetGpcClkMinMaxVfOffset() (int, int, Return) { + var minOffset, maxOffset int32 + ret := nvmlDeviceGetGpcClkMinMaxVfOffset(device, &minOffset, &maxOffset) + return int(minOffset), int(maxOffset), ret } // nvml.DeviceGetMemClkMinMaxVfOffset() -func DeviceGetMemClkMinMaxVfOffset(Device Device) (int, int, Return) { - var MinOffset, MaxOffset int32 - ret := nvmlDeviceGetMemClkMinMaxVfOffset(Device, &MinOffset, &MaxOffset) - return int(MinOffset), int(MaxOffset), ret +func (l *library) DeviceGetMemClkMinMaxVfOffset(device Device) (int, int, Return) { + return device.GetMemClkMinMaxVfOffset() } -func (Device Device) GetMemClkMinMaxVfOffset() (int, int, Return) { - return DeviceGetMemClkMinMaxVfOffset(Device) +func (device nvmlDevice) GetMemClkMinMaxVfOffset() (int, int, Return) { + var minOffset, maxOffset int32 + ret := nvmlDeviceGetMemClkMinMaxVfOffset(device, &minOffset, &maxOffset) + return int(minOffset), int(maxOffset), ret } // nvml.DeviceGetGpuMaxPcieLinkGeneration() -func DeviceGetGpuMaxPcieLinkGeneration(Device Device) (int, Return) { - var MaxLinkGenDevice uint32 - ret := nvmlDeviceGetGpuMaxPcieLinkGeneration(Device, &MaxLinkGenDevice) - return int(MaxLinkGenDevice), ret +func (l *library) DeviceGetGpuMaxPcieLinkGeneration(device Device) (int, Return) { + return device.GetGpuMaxPcieLinkGeneration() } -func (Device Device) GetGpuMaxPcieLinkGeneration() (int, Return) { - return DeviceGetGpuMaxPcieLinkGeneration(Device) +func (device nvmlDevice) GetGpuMaxPcieLinkGeneration() (int, Return) { + var maxLinkGenDevice uint32 + ret := nvmlDeviceGetGpuMaxPcieLinkGeneration(device, &maxLinkGenDevice) + return int(maxLinkGenDevice), ret } // nvml.DeviceGetFanControlPolicy_v2() -func DeviceGetFanControlPolicy_v2(Device Device, Fan int) (FanControlPolicy, Return) { - var Policy FanControlPolicy - ret := nvmlDeviceGetFanControlPolicy_v2(Device, uint32(Fan), &Policy) - return Policy, ret +func (l *library) DeviceGetFanControlPolicy_v2(device Device, fan int) (FanControlPolicy, Return) { + return device.GetFanControlPolicy_v2(fan) } -func (Device Device) GetFanControlPolicy_v2(Fan int) (FanControlPolicy, Return) { - return DeviceGetFanControlPolicy_v2(Device, Fan) +func (device nvmlDevice) GetFanControlPolicy_v2(fan int) (FanControlPolicy, Return) { + var policy FanControlPolicy + ret := nvmlDeviceGetFanControlPolicy_v2(device, uint32(fan), &policy) + return policy, ret } // nvml.DeviceSetFanControlPolicy() -func DeviceSetFanControlPolicy(Device Device, Fan int, Policy FanControlPolicy) Return { - return nvmlDeviceSetFanControlPolicy(Device, uint32(Fan), Policy) +func (l *library) DeviceSetFanControlPolicy(device Device, fan int, policy FanControlPolicy) Return { + return device.SetFanControlPolicy(fan, policy) } -func (Device Device) SetFanControlPolicy(Fan int, Policy FanControlPolicy) Return { - return DeviceSetFanControlPolicy(Device, Fan, Policy) +func (device nvmlDevice) SetFanControlPolicy(fan int, policy FanControlPolicy) Return { + return nvmlDeviceSetFanControlPolicy(device, uint32(fan), policy) } // nvml.DeviceClearFieldValues() -func DeviceClearFieldValues(Device Device, Values []FieldValue) Return { - ValuesCount := len(Values) - return nvmlDeviceClearFieldValues(Device, int32(ValuesCount), &Values[0]) +func (l *library) DeviceClearFieldValues(device Device, values []FieldValue) Return { + return device.ClearFieldValues(values) } -func (Device Device) ClearFieldValues(Values []FieldValue) Return { - return DeviceClearFieldValues(Device, Values) +func (device nvmlDevice) ClearFieldValues(values []FieldValue) Return { + valuesCount := len(values) + return nvmlDeviceClearFieldValues(device, int32(valuesCount), &values[0]) } // nvml.DeviceGetVgpuCapabilities() -func DeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability) (bool, Return) { - var CapResult uint32 - ret := nvmlDeviceGetVgpuCapabilities(Device, Capability, &CapResult) - return (CapResult != 0), ret +func (l *library) DeviceGetVgpuCapabilities(device Device, capability DeviceVgpuCapability) (bool, Return) { + return device.GetVgpuCapabilities(capability) } -func (Device Device) GetVgpuCapabilities(Capability DeviceVgpuCapability) (bool, Return) { - return DeviceGetVgpuCapabilities(Device, Capability) +func (device nvmlDevice) GetVgpuCapabilities(capability DeviceVgpuCapability) (bool, Return) { + var capResult uint32 + ret := nvmlDeviceGetVgpuCapabilities(device, capability, &capResult) + return (capResult != 0), ret } // nvml.DeviceGetVgpuSchedulerLog() -func DeviceGetVgpuSchedulerLog(Device Device) (VgpuSchedulerLog, Return) { - var PSchedulerLog VgpuSchedulerLog - ret := nvmlDeviceGetVgpuSchedulerLog(Device, &PSchedulerLog) - return PSchedulerLog, ret +func (l *library) DeviceGetVgpuSchedulerLog(device Device) (VgpuSchedulerLog, Return) { + return device.GetVgpuSchedulerLog() } -func (Device Device) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { - return DeviceGetVgpuSchedulerLog(Device) +func (device nvmlDevice) GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) { + var pSchedulerLog VgpuSchedulerLog + ret := nvmlDeviceGetVgpuSchedulerLog(device, &pSchedulerLog) + return pSchedulerLog, ret } // nvml.DeviceGetVgpuSchedulerState() -func DeviceGetVgpuSchedulerState(Device Device) (VgpuSchedulerGetState, Return) { - var PSchedulerState VgpuSchedulerGetState - ret := nvmlDeviceGetVgpuSchedulerState(Device, &PSchedulerState) - return PSchedulerState, ret +func (l *library) DeviceGetVgpuSchedulerState(device Device) (VgpuSchedulerGetState, Return) { + return device.GetVgpuSchedulerState() } -func (Device Device) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { - return DeviceGetVgpuSchedulerState(Device) +func (device nvmlDevice) GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) { + var pSchedulerState VgpuSchedulerGetState + ret := nvmlDeviceGetVgpuSchedulerState(device, &pSchedulerState) + return pSchedulerState, ret } // nvml.DeviceSetVgpuSchedulerState() -func DeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return { - return nvmlDeviceSetVgpuSchedulerState(Device, PSchedulerState) +func (l *library) DeviceSetVgpuSchedulerState(device Device, pSchedulerState *VgpuSchedulerSetState) Return { + return device.SetVgpuSchedulerState(pSchedulerState) } -func (Device Device) SetVgpuSchedulerState(PSchedulerState *VgpuSchedulerSetState) Return { - return DeviceSetVgpuSchedulerState(Device, PSchedulerState) +func (device nvmlDevice) SetVgpuSchedulerState(pSchedulerState *VgpuSchedulerSetState) Return { + return nvmlDeviceSetVgpuSchedulerState(device, pSchedulerState) } // nvml.DeviceGetVgpuSchedulerCapabilities() -func DeviceGetVgpuSchedulerCapabilities(Device Device) (VgpuSchedulerCapabilities, Return) { - var PCapabilities VgpuSchedulerCapabilities - ret := nvmlDeviceGetVgpuSchedulerCapabilities(Device, &PCapabilities) - return PCapabilities, ret +func (l *library) DeviceGetVgpuSchedulerCapabilities(device Device) (VgpuSchedulerCapabilities, Return) { + return device.GetVgpuSchedulerCapabilities() } -func (Device Device) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) { - return DeviceGetVgpuSchedulerCapabilities(Device) +func (device nvmlDevice) GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) { + var pCapabilities VgpuSchedulerCapabilities + ret := nvmlDeviceGetVgpuSchedulerCapabilities(device, &pCapabilities) + return pCapabilities, ret } // nvml.GpuInstanceGetComputeInstancePossiblePlacements() -func GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { - var Count uint32 - ret := nvmlGpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, Info.Id, nil, &Count) +func (l *library) GpuInstanceGetComputeInstancePossiblePlacements(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { + return gpuInstance.GetComputeInstancePossiblePlacements(info) +} + +func (gpuInstance nvmlGpuInstance) GetComputeInstancePossiblePlacements(info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { + var count uint32 + ret := nvmlGpuInstanceGetComputeInstancePossiblePlacements(gpuInstance, info.Id, nil, &count) if ret != SUCCESS { return nil, ret } - if Count == 0 { + if count == 0 { return []ComputeInstancePlacement{}, ret } - PlacementArray := make([]ComputeInstancePlacement, Count) - ret = nvmlGpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, Info.Id, &PlacementArray[0], &Count) - return PlacementArray, ret -} - -func (GpuInstance GpuInstance) GetComputeInstancePossiblePlacements(Info *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) { - return GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, Info) + placementArray := make([]ComputeInstancePlacement, count) + ret = nvmlGpuInstanceGetComputeInstancePossiblePlacements(gpuInstance, info.Id, &placementArray[0], &count) + return placementArray, ret } // nvml.GpuInstanceCreateComputeInstanceWithPlacement() -func GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - return nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info.Id, Placement, ComputeInstance) +func (l *library) GpuInstanceCreateComputeInstanceWithPlacement(gpuInstance GpuInstance, info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) { + return gpuInstance.CreateComputeInstanceWithPlacement(info, placement) } -func (GpuInstance GpuInstance) CreateComputeInstanceWithPlacement(Info *ComputeInstanceProfileInfo, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - return GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, Info, Placement, ComputeInstance) +func (gpuInstance nvmlGpuInstance) CreateComputeInstanceWithPlacement(info *ComputeInstanceProfileInfo, placement *ComputeInstancePlacement) (ComputeInstance, Return) { + var computeInstance nvmlComputeInstance + ret := nvmlGpuInstanceCreateComputeInstanceWithPlacement(gpuInstance, info.Id, placement, &computeInstance) + return computeInstance, ret } // nvml.DeviceGetGpuFabricInfo() -func DeviceGetGpuFabricInfo(Device Device) (GpuFabricInfo, Return) { - var GpuFabricInfo GpuFabricInfo - ret := nvmlDeviceGetGpuFabricInfo(Device, &GpuFabricInfo) - return GpuFabricInfo, ret +func (l *library) DeviceGetGpuFabricInfo(device Device) (GpuFabricInfo, Return) { + return device.GetGpuFabricInfo() } -func (Device Device) GetGpuFabricInfo() (GpuFabricInfo, Return) { - return DeviceGetGpuFabricInfo(Device) +func (device nvmlDevice) GetGpuFabricInfo() (GpuFabricInfo, Return) { + var gpuFabricInfo GpuFabricInfo + ret := nvmlDeviceGetGpuFabricInfo(device, &gpuFabricInfo) + return gpuFabricInfo, ret } // nvml.DeviceCcuGetStreamState() -func DeviceCcuGetStreamState(Device Device) (int, Return) { - var State uint32 - ret := nvmlDeviceCcuGetStreamState(Device, &State) - return int(State), ret +func (l *library) DeviceCcuGetStreamState(device Device) (int, Return) { + return device.CcuGetStreamState() } -func (Device Device) CcuGetStreamState() (int, Return) { - return DeviceCcuGetStreamState(Device) +func (device nvmlDevice) CcuGetStreamState() (int, Return) { + var state uint32 + ret := nvmlDeviceCcuGetStreamState(device, &state) + return int(state), ret } // nvml.DeviceCcuSetStreamState() -func DeviceCcuSetStreamState(Device Device, State int) Return { - return nvmlDeviceCcuSetStreamState(Device, uint32(State)) +func (l *library) DeviceCcuSetStreamState(device Device, state int) Return { + return device.CcuSetStreamState(state) } -func (Device Device) CcuSetStreamState(State int) Return { - return DeviceCcuSetStreamState(Device, State) +func (device nvmlDevice) CcuSetStreamState(state int) Return { + return nvmlDeviceCcuSetStreamState(device, uint32(state)) } // nvml.DeviceSetNvLinkDeviceLowPowerThreshold() -func DeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return { - return nvmlDeviceSetNvLinkDeviceLowPowerThreshold(Device, Info) +func (l *library) DeviceSetNvLinkDeviceLowPowerThreshold(device Device, info *NvLinkPowerThres) Return { + return device.SetNvLinkDeviceLowPowerThreshold(info) } -func (Device Device) SetNvLinkDeviceLowPowerThreshold(Info *NvLinkPowerThres) Return { - return DeviceSetNvLinkDeviceLowPowerThreshold(Device, Info) +func (device nvmlDevice) SetNvLinkDeviceLowPowerThreshold(info *NvLinkPowerThres) Return { + return nvmlDeviceSetNvLinkDeviceLowPowerThreshold(device, info) } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go index c6315f5e..933b4dea 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go @@ -14,29 +14,60 @@ package nvml +// EventData includes an interface type for Device instead of nvmlDevice +type EventData struct { + Device Device + EventType uint64 + EventData uint64 + GpuInstanceId uint32 + ComputeInstanceId uint32 +} + +func (e EventData) convert() nvmlEventData { + out := nvmlEventData{ + Device: e.Device.(nvmlDevice), + EventType: e.EventType, + EventData: e.EventData, + GpuInstanceId: e.GpuInstanceId, + ComputeInstanceId: e.ComputeInstanceId, + } + return out +} + +func (e nvmlEventData) convert() EventData { + out := EventData{ + Device: e.Device, + EventType: e.EventType, + EventData: e.EventData, + GpuInstanceId: e.GpuInstanceId, + ComputeInstanceId: e.ComputeInstanceId, + } + return out +} + // nvml.EventSetCreate() -func EventSetCreate() (EventSet, Return) { - var Set EventSet +func (l *library) EventSetCreate() (EventSet, Return) { + var Set nvmlEventSet ret := nvmlEventSetCreate(&Set) return Set, ret } // nvml.EventSetWait() -func EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) { - var Data EventData - ret := nvmlEventSetWait(Set, &Data, Timeoutms) - return Data, ret +func (l *library) EventSetWait(set EventSet, timeoutms uint32) (EventData, Return) { + return set.Wait(timeoutms) } -func (Set EventSet) Wait(Timeoutms uint32) (EventData, Return) { - return EventSetWait(Set, Timeoutms) +func (set nvmlEventSet) Wait(timeoutms uint32) (EventData, Return) { + var data nvmlEventData + ret := nvmlEventSetWait(set, &data, timeoutms) + return data.convert(), ret } // nvml.EventSetFree() -func EventSetFree(Set EventSet) Return { - return nvmlEventSetFree(Set) +func (l *library) EventSetFree(set EventSet) Return { + return set.Free() } -func (Set EventSet) Free() Return { - return EventSetFree(Set) +func (set nvmlEventSet) Free() Return { + return nvmlEventSetFree(set) } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go index c46c5d78..783514b1 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go @@ -14,80 +14,128 @@ package nvml +// GpmMetricsGetType includes interface types for GpmSample instead of nvmlGpmSample +type GpmMetricsGetType struct { + Version uint32 + NumMetrics uint32 + Sample1 GpmSample + Sample2 GpmSample + Metrics [98]GpmMetric +} + +func (g *GpmMetricsGetType) convert() *nvmlGpmMetricsGetType { + out := &nvmlGpmMetricsGetType{ + Version: g.Version, + NumMetrics: g.NumMetrics, + Sample1: g.Sample1.(nvmlGpmSample), + Sample2: g.Sample2.(nvmlGpmSample), + } + for i := range g.Metrics { + out.Metrics[i] = g.Metrics[i] + } + return out +} + +func (g *nvmlGpmMetricsGetType) convert() *GpmMetricsGetType { + out := &GpmMetricsGetType{ + Version: g.Version, + NumMetrics: g.NumMetrics, + Sample1: g.Sample1, + Sample2: g.Sample2, + } + for i := range g.Metrics { + out.Metrics[i] = g.Metrics[i] + } + return out +} + // nvml.GpmMetricsGet() type GpmMetricsGetVType struct { - metricsGet *GpmMetricsGetType + metricsGet *nvmlGpmMetricsGetType } -func GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType { - return GpmMetricsGetVType{MetricsGet} +func (l *library) GpmMetricsGetV(metricsGet *GpmMetricsGetType) GpmMetricsGetVType { + return GpmMetricsGetVType{metricsGet.convert()} } - -func (MetricsGetV GpmMetricsGetVType) V1() Return { - MetricsGetV.metricsGet.Version = 1 - return nvmlGpmMetricsGet(MetricsGetV.metricsGet) +func (metricsGetV GpmMetricsGetVType) V1() Return { + metricsGetV.metricsGet.Version = 1 + return nvmlGpmMetricsGet(metricsGetV.metricsGet) } -func GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { - MetricsGet.Version = GPM_METRICS_GET_VERSION - return nvmlGpmMetricsGet(MetricsGet) +func (l *library) GpmMetricsGet(metricsGet *GpmMetricsGetType) Return { + metricsGet.Version = GPM_METRICS_GET_VERSION + return nvmlGpmMetricsGet(metricsGet.convert()) } // nvml.GpmSampleFree() -func GpmSampleFree(GpmSample GpmSample) Return { - return nvmlGpmSampleFree(GpmSample) +func (l *library) GpmSampleFree(gpmSample GpmSample) Return { + return gpmSample.Free() +} + +func (gpmSample nvmlGpmSample) Free() Return { + return nvmlGpmSampleFree(gpmSample) } // nvml.GpmSampleAlloc() -func GpmSampleAlloc(GpmSample *GpmSample) Return { - return nvmlGpmSampleAlloc(GpmSample) +func (l *library) GpmSampleAlloc() (GpmSample, Return) { + var gpmSample nvmlGpmSample + ret := nvmlGpmSampleAlloc(&gpmSample) + return gpmSample, ret } // nvml.GpmSampleGet() -func GpmSampleGet(Device Device, GpmSample GpmSample) Return { - return nvmlGpmSampleGet(Device, GpmSample) +func (l *library) GpmSampleGet(device Device, gpmSample GpmSample) Return { + return gpmSample.Get(device) } -func (Device Device) GpmSampleGet(GpmSample GpmSample) Return { - return GpmSampleGet(Device, GpmSample) +func (device nvmlDevice) GpmSampleGet(gpmSample GpmSample) Return { + return gpmSample.Get(device) +} + +func (gpmSample nvmlGpmSample) Get(device Device) Return { + return nvmlGpmSampleGet(device.(nvmlDevice), gpmSample) } // nvml.GpmQueryDeviceSupport() type GpmSupportV struct { - device Device + device nvmlDevice } -func GpmQueryDeviceSupportV(Device Device) GpmSupportV { - return GpmSupportV{Device} +func (l *library) GpmQueryDeviceSupportV(device Device) GpmSupportV { + return device.GpmQueryDeviceSupportV() } -func (Device Device) GpmQueryDeviceSupportV() GpmSupportV { - return GpmSupportV{Device} +func (device nvmlDevice) GpmQueryDeviceSupportV() GpmSupportV { + return GpmSupportV{device} } -func (GpmSupportV GpmSupportV) V1() (GpmSupport, Return) { - var GpmSupport GpmSupport - GpmSupport.Version = 1 - ret := nvmlGpmQueryDeviceSupport(GpmSupportV.device, &GpmSupport) - return GpmSupport, ret +func (gpmSupportV GpmSupportV) V1() (GpmSupport, Return) { + var gpmSupport GpmSupport + gpmSupport.Version = 1 + ret := nvmlGpmQueryDeviceSupport(gpmSupportV.device, &gpmSupport) + return gpmSupport, ret } -func GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) { - var GpmSupport GpmSupport - GpmSupport.Version = GPM_SUPPORT_VERSION - ret := nvmlGpmQueryDeviceSupport(Device, &GpmSupport) - return GpmSupport, ret +func (l *library) GpmQueryDeviceSupport(device Device) (GpmSupport, Return) { + return device.GpmQueryDeviceSupport() } -func (Device Device) GpmQueryDeviceSupport() (GpmSupport, Return) { - return GpmQueryDeviceSupport(Device) +func (device nvmlDevice) GpmQueryDeviceSupport() (GpmSupport, Return) { + var gpmSupport GpmSupport + gpmSupport.Version = GPM_SUPPORT_VERSION + ret := nvmlGpmQueryDeviceSupport(device, &gpmSupport) + return gpmSupport, ret } // nvml.GpmMigSampleGet() -func GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return { - return nvmlGpmMigSampleGet(Device, uint32(GpuInstanceId), GpmSample) +func (l *library) GpmMigSampleGet(device Device, gpuInstanceId int, gpmSample GpmSample) Return { + return gpmSample.MigGet(device, gpuInstanceId) +} + +func (device nvmlDevice) GpmMigSampleGet(gpuInstanceId int, gpmSample GpmSample) Return { + return gpmSample.MigGet(device, gpuInstanceId) } -func (Device Device) GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) Return { - return GpmMigSampleGet(Device, GpuInstanceId, GpmSample) +func (gpmSample nvmlGpmSample) MigGet(device Device, gpuInstanceId int) Return { + return nvmlGpmMigSampleGet(device.(nvmlDevice), uint32(gpuInstanceId), gpmSample) } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go index e2bc943b..6c4bd58f 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go @@ -17,7 +17,7 @@ package nvml import "C" // nvml.Init() -func Init() Return { +func (l *library) Init() Return { if err := libnvml.load(); err != nil { return ERROR_LIBRARY_NOT_FOUND } @@ -25,15 +25,15 @@ func Init() Return { } // nvml.InitWithFlags() -func InitWithFlags(Flags uint32) Return { +func (l *library) InitWithFlags(flags uint32) Return { if err := libnvml.load(); err != nil { return ERROR_LIBRARY_NOT_FOUND } - return nvmlInitWithFlags(Flags) + return nvmlInitWithFlags(flags) } // nvml.Shutdown() -func Shutdown() Return { +func (l *library) Shutdown() Return { ret := nvmlShutdown() if ret != SUCCESS { return ret @@ -41,7 +41,7 @@ func Shutdown() Return { err := libnvml.close() if err != nil { - panic(err) + return ERROR_UNKNOWN } return ret diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go index be4b3fb7..4d265318 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go @@ -34,48 +34,70 @@ const ( var errLibraryNotLoaded = errors.New("library not loaded") var errLibraryAlreadyLoaded = errors.New("library already loaded") +// dynamicLibrary is an interface for abstacting the underlying library. +// This also allows for mocking and testing. + +//go:generate moq -stub -out dynamicLibrary_mock.go . dynamicLibrary +type dynamicLibrary interface { + Lookup(string) error + Open() error + Close() error +} + // library represents an nvml library. // This includes a reference to the underlying DynamicLibrary type library struct { sync.Mutex path string - flags int refcount refcount dl dynamicLibrary } +var _ Interface = (*library)(nil) + // libnvml is a global instance of the nvml library. -var libnvml = library{ - path: defaultNvmlLibraryName, - flags: defaultNvmlLibraryLoadFlags, -} +var libnvml = newLibrary() -var _ Interface = (*library)(nil) +func New(opts ...LibraryOption) Interface { + return newLibrary(opts...) +} -// GetLibrary returns a the library as a Library interface. -func (l *library) GetLibrary() Library { +func newLibrary(opts ...LibraryOption) *library { + l := &library{} + l.init(opts...) return l } -// GetLibrary returns a representation of the underlying library that implements the Library interface. -func GetLibrary() Library { - return libnvml.GetLibrary() +func (l *library) init(opts ...LibraryOption) { + o := libraryOptions{} + for _, opt := range opts { + opt(&o) + } + + if o.path == "" { + o.path = defaultNvmlLibraryName + } + if o.flags == 0 { + o.flags = defaultNvmlLibraryLoadFlags + } + + l.path = o.path + l.dl = dl.New(o.path, o.flags) } -// Lookup checks whether the specified library symbol exists in the library. +func (l *library) Extensions() ExtendedInterface { + return l +} + +// LookupSymbol checks whether the specified library symbol exists in the library. // Note that this requires that the library be loaded. -func (l *library) Lookup(name string) error { - if l == nil || l.dl == nil { +func (l *library) LookupSymbol(name string) error { + if l == nil || l.refcount == 0 { return fmt.Errorf("error looking up %s: %w", name, errLibraryNotLoaded) } return l.dl.Lookup(name) } -// newDynamicLibrary is a function variable that can be overridden for testing. -var newDynamicLibrary = func(path string, flags int) dynamicLibrary { - return dl.New(path, flags) -} - // load initializes the library and updates the versioned symbols. // Multiple calls to an already loaded library will return without error. func (l *library) load() (rerr error) { @@ -87,12 +109,14 @@ func (l *library) load() (rerr error) { return nil } - dl := newDynamicLibrary(l.path, l.flags) - if err := dl.Open(); err != nil { + if err := l.dl.Open(); err != nil { return fmt.Errorf("error opening %s: %w", l.path, err) } - l.dl = dl + // Update the errorStringFunc to point to nvml.ErrorString + errorStringFunc = nvmlErrorString + + // Update all versioned symbols l.updateVersionedSymbols() return nil @@ -114,7 +138,8 @@ func (l *library) close() (rerr error) { return fmt.Errorf("error closing %s: %w", l.path, err) } - l.dl = nil + // Update the errorStringFunc to point to defaultErrorStringFunc + errorStringFunc = defaultErrorStringFunc return nil } @@ -131,9 +156,9 @@ var nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v1 var nvmlEventSetWait = nvmlEventSetWait_v1 var nvmlDeviceGetAttributes = nvmlDeviceGetAttributes_v1 var nvmlComputeInstanceGetInfo = nvmlComputeInstanceGetInfo_v1 -var DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v1 -var DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v1 -var DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v1 +var deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v1 +var deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v1 +var deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v1 var GetBlacklistDeviceCount = GetExcludedDeviceCount var GetBlacklistDeviceInfoByIndex = GetExcludedDeviceInfoByIndex var nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v1 @@ -173,127 +198,94 @@ func (pis ProcessInfo_v2Slice) ToProcessInfoSlice() []ProcessInfo { // When new versioned symbols are added, these would have to be initialized above and have // corresponding checks and subsequent assignments added below. func (l *library) updateVersionedSymbols() { - err := l.Lookup("nvmlInit_v2") + err := l.LookupSymbol("nvmlInit_v2") if err == nil { nvmlInit = nvmlInit_v2 } - err = l.Lookup("nvmlDeviceGetPciInfo_v2") + err = l.LookupSymbol("nvmlDeviceGetPciInfo_v2") if err == nil { nvmlDeviceGetPciInfo = nvmlDeviceGetPciInfo_v2 } - err = l.Lookup("nvmlDeviceGetPciInfo_v3") + err = l.LookupSymbol("nvmlDeviceGetPciInfo_v3") if err == nil { nvmlDeviceGetPciInfo = nvmlDeviceGetPciInfo_v3 } - err = l.Lookup("nvmlDeviceGetCount_v2") + err = l.LookupSymbol("nvmlDeviceGetCount_v2") if err == nil { nvmlDeviceGetCount = nvmlDeviceGetCount_v2 } - err = l.Lookup("nvmlDeviceGetHandleByIndex_v2") + err = l.LookupSymbol("nvmlDeviceGetHandleByIndex_v2") if err == nil { nvmlDeviceGetHandleByIndex = nvmlDeviceGetHandleByIndex_v2 } - err = l.Lookup("nvmlDeviceGetHandleByPciBusId_v2") + err = l.LookupSymbol("nvmlDeviceGetHandleByPciBusId_v2") if err == nil { nvmlDeviceGetHandleByPciBusId = nvmlDeviceGetHandleByPciBusId_v2 } - err = l.Lookup("nvmlDeviceGetNvLinkRemotePciInfo_v2") + err = l.LookupSymbol("nvmlDeviceGetNvLinkRemotePciInfo_v2") if err == nil { nvmlDeviceGetNvLinkRemotePciInfo = nvmlDeviceGetNvLinkRemotePciInfo_v2 } // Unable to overwrite nvmlDeviceRemoveGpu() because the v2 function takes // a different set of parameters than the v1 function. - //err = l.Lookup("nvmlDeviceRemoveGpu_v2") + //err = l.LookupSymbol("nvmlDeviceRemoveGpu_v2") //if err == nil { // nvmlDeviceRemoveGpu = nvmlDeviceRemoveGpu_v2 //} - err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v2") + err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v2") if err == nil { nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v2 } - err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v3") + err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v3") if err == nil { nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v3 } - err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v4") + err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v4") if err == nil { nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v4 } - err = l.Lookup("nvmlEventSetWait_v2") + err = l.LookupSymbol("nvmlEventSetWait_v2") if err == nil { nvmlEventSetWait = nvmlEventSetWait_v2 } - err = l.Lookup("nvmlDeviceGetAttributes_v2") + err = l.LookupSymbol("nvmlDeviceGetAttributes_v2") if err == nil { nvmlDeviceGetAttributes = nvmlDeviceGetAttributes_v2 } - err = l.Lookup("nvmlComputeInstanceGetInfo_v2") + err = l.LookupSymbol("nvmlComputeInstanceGetInfo_v2") if err == nil { nvmlComputeInstanceGetInfo = nvmlComputeInstanceGetInfo_v2 } - err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v2") + err = l.LookupSymbol("nvmlDeviceGetComputeRunningProcesses_v2") if err == nil { - DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v2 + deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v2 } - err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetComputeRunningProcesses_v3") if err == nil { - DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3 + deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3 } - err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v2") + err = l.LookupSymbol("nvmlDeviceGetGraphicsRunningProcesses_v2") if err == nil { - DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2 + deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2 } - err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetGraphicsRunningProcesses_v3") if err == nil { - DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3 + deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3 } - err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v2") + err = l.LookupSymbol("nvmlDeviceGetMPSComputeRunningProcesses_v2") if err == nil { - DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2 + deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2 } - err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v3") + err = l.LookupSymbol("nvmlDeviceGetMPSComputeRunningProcesses_v3") if err == nil { - DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v3 + deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v3 } - err = l.Lookup("nvmlDeviceGetGpuInstancePossiblePlacements_v2") + err = l.LookupSymbol("nvmlDeviceGetGpuInstancePossiblePlacements_v2") if err == nil { nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v2 } - err = l.Lookup("nvmlVgpuInstanceGetLicenseInfo_v2") + err = l.LookupSymbol("nvmlVgpuInstanceGetLicenseInfo_v2") if err == nil { nvmlVgpuInstanceGetLicenseInfo = nvmlVgpuInstanceGetLicenseInfo_v2 } } - -// LibraryOption represents a functional option to configure the underlying NVML library -type LibraryOption func(*library) - -// WithLibraryPath provides an option to set the library name to be used by the NVML library. -func WithLibraryPath(path string) LibraryOption { - return func(l *library) { - l.path = path - } -} - -// SetLibraryOptions applies the specified options to the NVML library. -// If this is called when a library is already loaded, and error is raised. -func SetLibraryOptions(opts ...LibraryOption) error { - libnvml.Lock() - defer libnvml.Unlock() - if libnvml.dl != nil { - return errLibraryAlreadyLoaded - } - - for _, opt := range opts { - opt(&libnvml) - } - - if libnvml.path == "" { - libnvml.path = defaultNvmlLibraryName - } - if libnvml.flags == 0 { - libnvml.flags = defaultNvmlLibraryLoadFlags - } - - return nil -} diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/ci_mock.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/computeinstance.go similarity index 61% rename from vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/ci_mock.go rename to vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/computeinstance.go index e4e75a7a..784fa114 100644 --- a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvml/ci_mock.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/computeinstance.go @@ -1,40 +1,41 @@ // Code generated by moq; DO NOT EDIT. // github.com/matryer/moq -package nvml +package mock import ( + "github.com/NVIDIA/go-nvml/pkg/nvml" "sync" ) -// Ensure, that ComputeInstanceMock does implement ComputeInstance. +// Ensure, that ComputeInstance does implement nvml.ComputeInstance. // If this is not the case, regenerate this file with moq. -var _ ComputeInstance = &ComputeInstanceMock{} +var _ nvml.ComputeInstance = &ComputeInstance{} -// ComputeInstanceMock is a mock implementation of ComputeInstance. +// ComputeInstance is a mock implementation of nvml.ComputeInstance. // // func TestSomethingThatUsesComputeInstance(t *testing.T) { // -// // make and configure a mocked ComputeInstance -// mockedComputeInstance := &ComputeInstanceMock{ -// DestroyFunc: func() Return { +// // make and configure a mocked nvml.ComputeInstance +// mockedComputeInstance := &ComputeInstance{ +// DestroyFunc: func() nvml.Return { // panic("mock out the Destroy method") // }, -// GetInfoFunc: func() (ComputeInstanceInfo, Return) { +// GetInfoFunc: func() (nvml.ComputeInstanceInfo, nvml.Return) { // panic("mock out the GetInfo method") // }, // } // -// // use mockedComputeInstance in code that requires ComputeInstance +// // use mockedComputeInstance in code that requires nvml.ComputeInstance // // and then make assertions. // // } -type ComputeInstanceMock struct { +type ComputeInstance struct { // DestroyFunc mocks the Destroy method. - DestroyFunc func() Return + DestroyFunc func() nvml.Return // GetInfoFunc mocks the GetInfo method. - GetInfoFunc func() (ComputeInstanceInfo, Return) + GetInfoFunc func() (nvml.ComputeInstanceInfo, nvml.Return) // calls tracks calls to the methods. calls struct { @@ -50,9 +51,9 @@ type ComputeInstanceMock struct { } // Destroy calls DestroyFunc. -func (mock *ComputeInstanceMock) Destroy() Return { +func (mock *ComputeInstance) Destroy() nvml.Return { if mock.DestroyFunc == nil { - panic("ComputeInstanceMock.DestroyFunc: method is nil but ComputeInstance.Destroy was just called") + panic("ComputeInstance.DestroyFunc: method is nil but ComputeInstance.Destroy was just called") } callInfo := struct { }{} @@ -66,7 +67,7 @@ func (mock *ComputeInstanceMock) Destroy() Return { // Check the length with: // // len(mockedComputeInstance.DestroyCalls()) -func (mock *ComputeInstanceMock) DestroyCalls() []struct { +func (mock *ComputeInstance) DestroyCalls() []struct { } { var calls []struct { } @@ -77,9 +78,9 @@ func (mock *ComputeInstanceMock) DestroyCalls() []struct { } // GetInfo calls GetInfoFunc. -func (mock *ComputeInstanceMock) GetInfo() (ComputeInstanceInfo, Return) { +func (mock *ComputeInstance) GetInfo() (nvml.ComputeInstanceInfo, nvml.Return) { if mock.GetInfoFunc == nil { - panic("ComputeInstanceMock.GetInfoFunc: method is nil but ComputeInstance.GetInfo was just called") + panic("ComputeInstance.GetInfoFunc: method is nil but ComputeInstance.GetInfo was just called") } callInfo := struct { }{} @@ -93,7 +94,7 @@ func (mock *ComputeInstanceMock) GetInfo() (ComputeInstanceInfo, Return) { // Check the length with: // // len(mockedComputeInstance.GetInfoCalls()) -func (mock *ComputeInstanceMock) GetInfoCalls() []struct { +func (mock *ComputeInstance) GetInfoCalls() []struct { } { var calls []struct { } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/device.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/device.go new file mode 100644 index 00000000..cb8f0cf3 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100/dgxa100.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100/dgxa100.go new file mode 100644 index 00000000..0188a03d --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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 +} diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/eventset.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/eventset.go new file mode 100644 index 00000000..d452c4d4 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/extendedinterface.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/extendedinterface.go new file mode 100644 index 00000000..71634bfd --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/gpmsample.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/gpmsample.go new file mode 100644 index 00000000..1023c344 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/gpuinstance.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/gpuinstance.go new file mode 100644 index 00000000..e084df20 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/interface.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/interface.go new file mode 100644 index 00000000..96739dd6 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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") +// }, +// 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") +// }, +// 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) + + // 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) + + // 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 + } + // Extensions holds details about calls to the Extensions method. + Extensions []struct { + } + // 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 + } + // 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 + lockExtensions sync.RWMutex + lockGetExcludedDeviceCount sync.RWMutex + lockGetExcludedDeviceInfoByIndex 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 +} + +// 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 { + 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 +} + +// 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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/unit.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/unit.go new file mode 100644 index 00000000..64af542f --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/vgpuinstance.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/vgpuinstance.go new file mode 100644 index 00000000..e0af0138 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/vgputypeid.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/mock/vgputypeid.go new file mode 100644 index 00000000..c838c3b9 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/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/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go index 9bd6965d..65fcffac 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go @@ -111,66 +111,66 @@ func nvmlUnitGetCount(UnitCount *uint32) Return { } // nvmlUnitGetHandleByIndex function as declared in nvml/nvml.h -func nvmlUnitGetHandleByIndex(Index uint32, Unit *Unit) Return { +func nvmlUnitGetHandleByIndex(Index uint32, nvmlUnit *nvmlUnit) Return { cIndex, _ := (C.uint)(Index), cgoAllocsUnknown - cUnit, _ := (*C.nvmlUnit_t)(unsafe.Pointer(Unit)), cgoAllocsUnknown - __ret := C.nvmlUnitGetHandleByIndex(cIndex, cUnit) + cnvmlUnit, _ := (*C.nvmlUnit_t)(unsafe.Pointer(nvmlUnit)), cgoAllocsUnknown + __ret := C.nvmlUnitGetHandleByIndex(cIndex, cnvmlUnit) __v := (Return)(__ret) return __v } // nvmlUnitGetUnitInfo function as declared in nvml/nvml.h -func nvmlUnitGetUnitInfo(Unit Unit, Info *UnitInfo) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetUnitInfo(nvmlUnit nvmlUnit, Info *UnitInfo) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cInfo, _ := (*C.nvmlUnitInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlUnitGetUnitInfo(cUnit, cInfo) + __ret := C.nvmlUnitGetUnitInfo(cnvmlUnit, cInfo) __v := (Return)(__ret) return __v } // nvmlUnitGetLedState function as declared in nvml/nvml.h -func nvmlUnitGetLedState(Unit Unit, State *LedState) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetLedState(nvmlUnit nvmlUnit, State *LedState) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cState, _ := (*C.nvmlLedState_t)(unsafe.Pointer(State)), cgoAllocsUnknown - __ret := C.nvmlUnitGetLedState(cUnit, cState) + __ret := C.nvmlUnitGetLedState(cnvmlUnit, cState) __v := (Return)(__ret) return __v } // nvmlUnitGetPsuInfo function as declared in nvml/nvml.h -func nvmlUnitGetPsuInfo(Unit Unit, Psu *PSUInfo) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetPsuInfo(nvmlUnit nvmlUnit, Psu *PSUInfo) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cPsu, _ := (*C.nvmlPSUInfo_t)(unsafe.Pointer(Psu)), cgoAllocsUnknown - __ret := C.nvmlUnitGetPsuInfo(cUnit, cPsu) + __ret := C.nvmlUnitGetPsuInfo(cnvmlUnit, cPsu) __v := (Return)(__ret) return __v } // nvmlUnitGetTemperature function as declared in nvml/nvml.h -func nvmlUnitGetTemperature(Unit Unit, _type uint32, Temp *uint32) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetTemperature(nvmlUnit nvmlUnit, _type uint32, Temp *uint32) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown c_type, _ := (C.uint)(_type), cgoAllocsUnknown cTemp, _ := (*C.uint)(unsafe.Pointer(Temp)), cgoAllocsUnknown - __ret := C.nvmlUnitGetTemperature(cUnit, c_type, cTemp) + __ret := C.nvmlUnitGetTemperature(cnvmlUnit, c_type, cTemp) __v := (Return)(__ret) return __v } // nvmlUnitGetFanSpeedInfo function as declared in nvml/nvml.h -func nvmlUnitGetFanSpeedInfo(Unit Unit, FanSpeeds *UnitFanSpeeds) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetFanSpeedInfo(nvmlUnit nvmlUnit, FanSpeeds *UnitFanSpeeds) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cFanSpeeds, _ := (*C.nvmlUnitFanSpeeds_t)(unsafe.Pointer(FanSpeeds)), cgoAllocsUnknown - __ret := C.nvmlUnitGetFanSpeedInfo(cUnit, cFanSpeeds) + __ret := C.nvmlUnitGetFanSpeedInfo(cnvmlUnit, cFanSpeeds) __v := (Return)(__ret) return __v } // nvmlUnitGetDevices function as declared in nvml/nvml.h -func nvmlUnitGetDevices(Unit Unit, DeviceCount *uint32, Devices *Device) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitGetDevices(nvmlUnit nvmlUnit, DeviceCount *uint32, Devices *nvmlDevice) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cDeviceCount, _ := (*C.uint)(unsafe.Pointer(DeviceCount)), cgoAllocsUnknown cDevices, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Devices)), cgoAllocsUnknown - __ret := C.nvmlUnitGetDevices(cUnit, cDeviceCount, cDevices) + __ret := C.nvmlUnitGetDevices(cnvmlUnit, cDeviceCount, cDevices) __v := (Return)(__ret) return __v } @@ -193,138 +193,138 @@ func nvmlDeviceGetCount_v2(DeviceCount *uint32) Return { } // nvmlDeviceGetAttributes_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetAttributes_v2(Device Device, Attributes *DeviceAttributes) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAttributes_v2(nvmlDevice nvmlDevice, Attributes *DeviceAttributes) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cAttributes, _ := (*C.nvmlDeviceAttributes_t)(unsafe.Pointer(Attributes)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAttributes_v2(cDevice, cAttributes) + __ret := C.nvmlDeviceGetAttributes_v2(cnvmlDevice, cAttributes) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleByIndex_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByIndex_v2(Index uint32, Device *Device) Return { +func nvmlDeviceGetHandleByIndex_v2(Index uint32, nvmlDevice *nvmlDevice) Return { cIndex, _ := (C.uint)(Index), cgoAllocsUnknown - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByIndex_v2(cIndex, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByIndex_v2(cIndex, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleBySerial function as declared in nvml/nvml.h -func nvmlDeviceGetHandleBySerial(Serial string, Device *Device) Return { +func nvmlDeviceGetHandleBySerial(Serial string, nvmlDevice *nvmlDevice) Return { cSerial, _ := unpackPCharString(Serial) - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleBySerial(cSerial, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleBySerial(cSerial, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleByUUID function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByUUID(Uuid string, Device *Device) Return { +func nvmlDeviceGetHandleByUUID(Uuid string, nvmlDevice *nvmlDevice) Return { cUuid, _ := unpackPCharString(Uuid) - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByUUID(cUuid, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByUUID(cUuid, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleByPciBusId_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByPciBusId_v2(PciBusId string, Device *Device) Return { +func nvmlDeviceGetHandleByPciBusId_v2(PciBusId string, nvmlDevice *nvmlDevice) Return { cPciBusId, _ := unpackPCharString(PciBusId) - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByPciBusId_v2(cPciBusId, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByPciBusId_v2(cPciBusId, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetName function as declared in nvml/nvml.h -func nvmlDeviceGetName(Device Device, Name *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetName(nvmlDevice nvmlDevice, Name *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cName, _ := (*C.char)(unsafe.Pointer(Name)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetName(cDevice, cName, cLength) + __ret := C.nvmlDeviceGetName(cnvmlDevice, cName, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetBrand function as declared in nvml/nvml.h -func nvmlDeviceGetBrand(Device Device, _type *BrandType) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBrand(nvmlDevice nvmlDevice, _type *BrandType) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (*C.nvmlBrandType_t)(unsafe.Pointer(_type)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBrand(cDevice, c_type) + __ret := C.nvmlDeviceGetBrand(cnvmlDevice, c_type) __v := (Return)(__ret) return __v } // nvmlDeviceGetIndex function as declared in nvml/nvml.h -func nvmlDeviceGetIndex(Device Device, Index *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetIndex(nvmlDevice nvmlDevice, Index *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIndex, _ := (*C.uint)(unsafe.Pointer(Index)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetIndex(cDevice, cIndex) + __ret := C.nvmlDeviceGetIndex(cnvmlDevice, cIndex) __v := (Return)(__ret) return __v } // nvmlDeviceGetSerial function as declared in nvml/nvml.h -func nvmlDeviceGetSerial(Device Device, Serial *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSerial(nvmlDevice nvmlDevice, Serial *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSerial, _ := (*C.char)(unsafe.Pointer(Serial)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSerial(cDevice, cSerial, cLength) + __ret := C.nvmlDeviceGetSerial(cnvmlDevice, cSerial, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryAffinity function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryAffinity(Device Device, NodeSetSize uint32, NodeSet *uint, Scope AffinityScope) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryAffinity(nvmlDevice nvmlDevice, NodeSetSize uint32, NodeSet *uint, Scope AffinityScope) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cNodeSetSize, _ := (C.uint)(NodeSetSize), cgoAllocsUnknown cNodeSet, _ := (*C.ulong)(unsafe.Pointer(NodeSet)), cgoAllocsUnknown cScope, _ := (C.nvmlAffinityScope_t)(Scope), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryAffinity(cDevice, cNodeSetSize, cNodeSet, cScope) + __ret := C.nvmlDeviceGetMemoryAffinity(cnvmlDevice, cNodeSetSize, cNodeSet, cScope) __v := (Return)(__ret) return __v } // nvmlDeviceGetCpuAffinityWithinScope function as declared in nvml/nvml.h -func nvmlDeviceGetCpuAffinityWithinScope(Device Device, CpuSetSize uint32, CpuSet *uint, Scope AffinityScope) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice nvmlDevice, CpuSetSize uint32, CpuSet *uint, Scope AffinityScope) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCpuSetSize, _ := (C.uint)(CpuSetSize), cgoAllocsUnknown cCpuSet, _ := (*C.ulong)(unsafe.Pointer(CpuSet)), cgoAllocsUnknown cScope, _ := (C.nvmlAffinityScope_t)(Scope), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCpuAffinityWithinScope(cDevice, cCpuSetSize, cCpuSet, cScope) + __ret := C.nvmlDeviceGetCpuAffinityWithinScope(cnvmlDevice, cCpuSetSize, cCpuSet, cScope) __v := (Return)(__ret) return __v } // nvmlDeviceGetCpuAffinity function as declared in nvml/nvml.h -func nvmlDeviceGetCpuAffinity(Device Device, CpuSetSize uint32, CpuSet *uint) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCpuAffinity(nvmlDevice nvmlDevice, CpuSetSize uint32, CpuSet *uint) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCpuSetSize, _ := (C.uint)(CpuSetSize), cgoAllocsUnknown cCpuSet, _ := (*C.ulong)(unsafe.Pointer(CpuSet)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCpuAffinity(cDevice, cCpuSetSize, cCpuSet) + __ret := C.nvmlDeviceGetCpuAffinity(cnvmlDevice, cCpuSetSize, cCpuSet) __v := (Return)(__ret) return __v } // nvmlDeviceSetCpuAffinity function as declared in nvml/nvml.h -func nvmlDeviceSetCpuAffinity(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetCpuAffinity(cDevice) +func nvmlDeviceSetCpuAffinity(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceSetCpuAffinity(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceClearCpuAffinity function as declared in nvml/nvml.h -func nvmlDeviceClearCpuAffinity(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceClearCpuAffinity(cDevice) +func nvmlDeviceClearCpuAffinity(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceClearCpuAffinity(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetTopologyCommonAncestor function as declared in nvml/nvml.h -func nvmlDeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device, PathInfo *GpuTopologyLevel) Return { +func nvmlDeviceGetTopologyCommonAncestor(Device1 nvmlDevice, Device2 nvmlDevice, PathInfo *GpuTopologyLevel) Return { cDevice1, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device1)), cgoAllocsUnknown cDevice2, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device2)), cgoAllocsUnknown cPathInfo, _ := (*C.nvmlGpuTopologyLevel_t)(unsafe.Pointer(PathInfo)), cgoAllocsUnknown @@ -334,18 +334,18 @@ func nvmlDeviceGetTopologyCommonAncestor(Device1 Device, Device2 Device, PathInf } // nvmlDeviceGetTopologyNearestGpus function as declared in nvml/nvml.h -func nvmlDeviceGetTopologyNearestGpus(Device Device, Level GpuTopologyLevel, Count *uint32, DeviceArray *Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTopologyNearestGpus(nvmlDevice nvmlDevice, Level GpuTopologyLevel, Count *uint32, DeviceArray *nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLevel, _ := (C.nvmlGpuTopologyLevel_t)(Level), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cDeviceArray, _ := (*C.nvmlDevice_t)(unsafe.Pointer(DeviceArray)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTopologyNearestGpus(cDevice, cLevel, cCount, cDeviceArray) + __ret := C.nvmlDeviceGetTopologyNearestGpus(cnvmlDevice, cLevel, cCount, cDeviceArray) __v := (Return)(__ret) return __v } // nvmlSystemGetTopologyGpuSet function as declared in nvml/nvml.h -func nvmlSystemGetTopologyGpuSet(CpuNumber uint32, Count *uint32, DeviceArray *Device) Return { +func nvmlSystemGetTopologyGpuSet(CpuNumber uint32, Count *uint32, DeviceArray *nvmlDevice) Return { cCpuNumber, _ := (C.uint)(CpuNumber), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cDeviceArray, _ := (*C.nvmlDevice_t)(unsafe.Pointer(DeviceArray)), cgoAllocsUnknown @@ -355,7 +355,7 @@ func nvmlSystemGetTopologyGpuSet(CpuNumber uint32, Count *uint32, DeviceArray *D } // nvmlDeviceGetP2PStatus function as declared in nvml/nvml.h -func nvmlDeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsIndex, P2pStatus *GpuP2PStatus) Return { +func nvmlDeviceGetP2PStatus(Device1 nvmlDevice, Device2 nvmlDevice, P2pIndex GpuP2PCapsIndex, P2pStatus *GpuP2PStatus) Return { cDevice1, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device1)), cgoAllocsUnknown cDevice2, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device2)), cgoAllocsUnknown cP2pIndex, _ := (C.nvmlGpuP2PCapsIndex_t)(P2pIndex), cgoAllocsUnknown @@ -366,776 +366,776 @@ func nvmlDeviceGetP2PStatus(Device1 Device, Device2 Device, P2pIndex GpuP2PCapsI } // nvmlDeviceGetUUID function as declared in nvml/nvml.h -func nvmlDeviceGetUUID(Device Device, Uuid *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetUUID(nvmlDevice nvmlDevice, Uuid *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUuid, _ := (*C.char)(unsafe.Pointer(Uuid)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetUUID(cDevice, cUuid, cLength) + __ret := C.nvmlDeviceGetUUID(cnvmlDevice, cUuid, cLength) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetMdevUUID function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance, MdevUuid *byte, Size uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance nvmlVgpuInstance, MdevUuid *byte, Size uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cMdevUuid, _ := (*C.char)(unsafe.Pointer(MdevUuid)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetMdevUUID(cVgpuInstance, cMdevUuid, cSize) + __ret := C.nvmlVgpuInstanceGetMdevUUID(cnvmlVgpuInstance, cMdevUuid, cSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetMinorNumber function as declared in nvml/nvml.h -func nvmlDeviceGetMinorNumber(Device Device, MinorNumber *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMinorNumber(nvmlDevice nvmlDevice, MinorNumber *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinorNumber, _ := (*C.uint)(unsafe.Pointer(MinorNumber)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMinorNumber(cDevice, cMinorNumber) + __ret := C.nvmlDeviceGetMinorNumber(cnvmlDevice, cMinorNumber) __v := (Return)(__ret) return __v } // nvmlDeviceGetBoardPartNumber function as declared in nvml/nvml.h -func nvmlDeviceGetBoardPartNumber(Device Device, PartNumber *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBoardPartNumber(nvmlDevice nvmlDevice, PartNumber *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPartNumber, _ := (*C.char)(unsafe.Pointer(PartNumber)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBoardPartNumber(cDevice, cPartNumber, cLength) + __ret := C.nvmlDeviceGetBoardPartNumber(cnvmlDevice, cPartNumber, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetInforomVersion function as declared in nvml/nvml.h -func nvmlDeviceGetInforomVersion(Device Device, Object InforomObject, Version *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetInforomVersion(nvmlDevice nvmlDevice, Object InforomObject, Version *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cObject, _ := (C.nvmlInforomObject_t)(Object), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetInforomVersion(cDevice, cObject, cVersion, cLength) + __ret := C.nvmlDeviceGetInforomVersion(cnvmlDevice, cObject, cVersion, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetInforomImageVersion function as declared in nvml/nvml.h -func nvmlDeviceGetInforomImageVersion(Device Device, Version *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetInforomImageVersion(nvmlDevice nvmlDevice, Version *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetInforomImageVersion(cDevice, cVersion, cLength) + __ret := C.nvmlDeviceGetInforomImageVersion(cnvmlDevice, cVersion, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetInforomConfigurationChecksum function as declared in nvml/nvml.h -func nvmlDeviceGetInforomConfigurationChecksum(Device Device, Checksum *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice nvmlDevice, Checksum *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cChecksum, _ := (*C.uint)(unsafe.Pointer(Checksum)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetInforomConfigurationChecksum(cDevice, cChecksum) + __ret := C.nvmlDeviceGetInforomConfigurationChecksum(cnvmlDevice, cChecksum) __v := (Return)(__ret) return __v } // nvmlDeviceValidateInforom function as declared in nvml/nvml.h -func nvmlDeviceValidateInforom(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceValidateInforom(cDevice) +func nvmlDeviceValidateInforom(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceValidateInforom(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetDisplayMode function as declared in nvml/nvml.h -func nvmlDeviceGetDisplayMode(Device Device, Display *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDisplayMode(nvmlDevice nvmlDevice, Display *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cDisplay, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Display)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDisplayMode(cDevice, cDisplay) + __ret := C.nvmlDeviceGetDisplayMode(cnvmlDevice, cDisplay) __v := (Return)(__ret) return __v } // nvmlDeviceGetDisplayActive function as declared in nvml/nvml.h -func nvmlDeviceGetDisplayActive(Device Device, IsActive *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDisplayActive(nvmlDevice nvmlDevice, IsActive *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsActive, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsActive)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDisplayActive(cDevice, cIsActive) + __ret := C.nvmlDeviceGetDisplayActive(cnvmlDevice, cIsActive) __v := (Return)(__ret) return __v } // nvmlDeviceGetPersistenceMode function as declared in nvml/nvml.h -func nvmlDeviceGetPersistenceMode(Device Device, Mode *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPersistenceMode(nvmlDevice nvmlDevice, Mode *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPersistenceMode(cDevice, cMode) + __ret := C.nvmlDeviceGetPersistenceMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetPciInfo_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetPciInfo_v3(Device Device, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPciInfo_v3(nvmlDevice nvmlDevice, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPciInfo_v3(cDevice, cPci) + __ret := C.nvmlDeviceGetPciInfo_v3(cnvmlDevice, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxPcieLinkGeneration function as declared in nvml/nvml.h -func nvmlDeviceGetMaxPcieLinkGeneration(Device Device, MaxLinkGen *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice nvmlDevice, MaxLinkGen *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMaxLinkGen, _ := (*C.uint)(unsafe.Pointer(MaxLinkGen)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxPcieLinkGeneration(cDevice, cMaxLinkGen) + __ret := C.nvmlDeviceGetMaxPcieLinkGeneration(cnvmlDevice, cMaxLinkGen) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuMaxPcieLinkGeneration function as declared in nvml/nvml.h -func nvmlDeviceGetGpuMaxPcieLinkGeneration(Device Device, MaxLinkGenDevice *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice nvmlDevice, MaxLinkGenDevice *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMaxLinkGenDevice, _ := (*C.uint)(unsafe.Pointer(MaxLinkGenDevice)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuMaxPcieLinkGeneration(cDevice, cMaxLinkGenDevice) + __ret := C.nvmlDeviceGetGpuMaxPcieLinkGeneration(cnvmlDevice, cMaxLinkGenDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxPcieLinkWidth function as declared in nvml/nvml.h -func nvmlDeviceGetMaxPcieLinkWidth(Device Device, MaxLinkWidth *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice nvmlDevice, MaxLinkWidth *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMaxLinkWidth, _ := (*C.uint)(unsafe.Pointer(MaxLinkWidth)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxPcieLinkWidth(cDevice, cMaxLinkWidth) + __ret := C.nvmlDeviceGetMaxPcieLinkWidth(cnvmlDevice, cMaxLinkWidth) __v := (Return)(__ret) return __v } // nvmlDeviceGetCurrPcieLinkGeneration function as declared in nvml/nvml.h -func nvmlDeviceGetCurrPcieLinkGeneration(Device Device, CurrLinkGen *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice nvmlDevice, CurrLinkGen *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrLinkGen, _ := (*C.uint)(unsafe.Pointer(CurrLinkGen)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCurrPcieLinkGeneration(cDevice, cCurrLinkGen) + __ret := C.nvmlDeviceGetCurrPcieLinkGeneration(cnvmlDevice, cCurrLinkGen) __v := (Return)(__ret) return __v } // nvmlDeviceGetCurrPcieLinkWidth function as declared in nvml/nvml.h -func nvmlDeviceGetCurrPcieLinkWidth(Device Device, CurrLinkWidth *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice nvmlDevice, CurrLinkWidth *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrLinkWidth, _ := (*C.uint)(unsafe.Pointer(CurrLinkWidth)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCurrPcieLinkWidth(cDevice, cCurrLinkWidth) + __ret := C.nvmlDeviceGetCurrPcieLinkWidth(cnvmlDevice, cCurrLinkWidth) __v := (Return)(__ret) return __v } // nvmlDeviceGetPcieThroughput function as declared in nvml/nvml.h -func nvmlDeviceGetPcieThroughput(Device Device, Counter PcieUtilCounter, Value *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPcieThroughput(nvmlDevice nvmlDevice, Counter PcieUtilCounter, Value *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCounter, _ := (C.nvmlPcieUtilCounter_t)(Counter), cgoAllocsUnknown cValue, _ := (*C.uint)(unsafe.Pointer(Value)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPcieThroughput(cDevice, cCounter, cValue) + __ret := C.nvmlDeviceGetPcieThroughput(cnvmlDevice, cCounter, cValue) __v := (Return)(__ret) return __v } // nvmlDeviceGetPcieReplayCounter function as declared in nvml/nvml.h -func nvmlDeviceGetPcieReplayCounter(Device Device, Value *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPcieReplayCounter(nvmlDevice nvmlDevice, Value *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cValue, _ := (*C.uint)(unsafe.Pointer(Value)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPcieReplayCounter(cDevice, cValue) + __ret := C.nvmlDeviceGetPcieReplayCounter(cnvmlDevice, cValue) __v := (Return)(__ret) return __v } // nvmlDeviceGetClockInfo function as declared in nvml/nvml.h -func nvmlDeviceGetClockInfo(Device Device, _type ClockType, Clock *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetClockInfo(nvmlDevice nvmlDevice, _type ClockType, Clock *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (C.nvmlClockType_t)(_type), cgoAllocsUnknown cClock, _ := (*C.uint)(unsafe.Pointer(Clock)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetClockInfo(cDevice, c_type, cClock) + __ret := C.nvmlDeviceGetClockInfo(cnvmlDevice, c_type, cClock) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxClockInfo function as declared in nvml/nvml.h -func nvmlDeviceGetMaxClockInfo(Device Device, _type ClockType, Clock *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxClockInfo(nvmlDevice nvmlDevice, _type ClockType, Clock *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (C.nvmlClockType_t)(_type), cgoAllocsUnknown cClock, _ := (*C.uint)(unsafe.Pointer(Clock)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxClockInfo(cDevice, c_type, cClock) + __ret := C.nvmlDeviceGetMaxClockInfo(cnvmlDevice, c_type, cClock) __v := (Return)(__ret) return __v } // nvmlDeviceGetApplicationsClock function as declared in nvml/nvml.h -func nvmlDeviceGetApplicationsClock(Device Device, ClockType ClockType, ClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetApplicationsClock(nvmlDevice nvmlDevice, ClockType ClockType, ClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClockType, _ := (C.nvmlClockType_t)(ClockType), cgoAllocsUnknown cClockMHz, _ := (*C.uint)(unsafe.Pointer(ClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetApplicationsClock(cDevice, cClockType, cClockMHz) + __ret := C.nvmlDeviceGetApplicationsClock(cnvmlDevice, cClockType, cClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetDefaultApplicationsClock function as declared in nvml/nvml.h -func nvmlDeviceGetDefaultApplicationsClock(Device Device, ClockType ClockType, ClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDefaultApplicationsClock(nvmlDevice nvmlDevice, ClockType ClockType, ClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClockType, _ := (C.nvmlClockType_t)(ClockType), cgoAllocsUnknown cClockMHz, _ := (*C.uint)(unsafe.Pointer(ClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDefaultApplicationsClock(cDevice, cClockType, cClockMHz) + __ret := C.nvmlDeviceGetDefaultApplicationsClock(cnvmlDevice, cClockType, cClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceResetApplicationsClocks function as declared in nvml/nvml.h -func nvmlDeviceResetApplicationsClocks(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceResetApplicationsClocks(cDevice) +func nvmlDeviceResetApplicationsClocks(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceResetApplicationsClocks(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetClock function as declared in nvml/nvml.h -func nvmlDeviceGetClock(Device Device, ClockType ClockType, ClockId ClockId, ClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetClock(nvmlDevice nvmlDevice, ClockType ClockType, ClockId ClockId, ClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClockType, _ := (C.nvmlClockType_t)(ClockType), cgoAllocsUnknown cClockId, _ := (C.nvmlClockId_t)(ClockId), cgoAllocsUnknown cClockMHz, _ := (*C.uint)(unsafe.Pointer(ClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetClock(cDevice, cClockType, cClockId, cClockMHz) + __ret := C.nvmlDeviceGetClock(cnvmlDevice, cClockType, cClockId, cClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxCustomerBoostClock function as declared in nvml/nvml.h -func nvmlDeviceGetMaxCustomerBoostClock(Device Device, ClockType ClockType, ClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice nvmlDevice, ClockType ClockType, ClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClockType, _ := (C.nvmlClockType_t)(ClockType), cgoAllocsUnknown cClockMHz, _ := (*C.uint)(unsafe.Pointer(ClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxCustomerBoostClock(cDevice, cClockType, cClockMHz) + __ret := C.nvmlDeviceGetMaxCustomerBoostClock(cnvmlDevice, cClockType, cClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedMemoryClocks function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedMemoryClocks(Device Device, Count *uint32, ClocksMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedMemoryClocks(nvmlDevice nvmlDevice, Count *uint32, ClocksMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cClocksMHz, _ := (*C.uint)(unsafe.Pointer(ClocksMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedMemoryClocks(cDevice, cCount, cClocksMHz) + __ret := C.nvmlDeviceGetSupportedMemoryClocks(cnvmlDevice, cCount, cClocksMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedGraphicsClocks function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedGraphicsClocks(Device Device, MemoryClockMHz uint32, Count *uint32, ClocksMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice nvmlDevice, MemoryClockMHz uint32, Count *uint32, ClocksMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMemoryClockMHz, _ := (C.uint)(MemoryClockMHz), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cClocksMHz, _ := (*C.uint)(unsafe.Pointer(ClocksMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedGraphicsClocks(cDevice, cMemoryClockMHz, cCount, cClocksMHz) + __ret := C.nvmlDeviceGetSupportedGraphicsClocks(cnvmlDevice, cMemoryClockMHz, cCount, cClocksMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetAutoBoostedClocksEnabled function as declared in nvml/nvml.h -func nvmlDeviceGetAutoBoostedClocksEnabled(Device Device, IsEnabled *EnableState, DefaultIsEnabled *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice nvmlDevice, IsEnabled *EnableState, DefaultIsEnabled *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsEnabled, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsEnabled)), cgoAllocsUnknown cDefaultIsEnabled, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(DefaultIsEnabled)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAutoBoostedClocksEnabled(cDevice, cIsEnabled, cDefaultIsEnabled) + __ret := C.nvmlDeviceGetAutoBoostedClocksEnabled(cnvmlDevice, cIsEnabled, cDefaultIsEnabled) __v := (Return)(__ret) return __v } // nvmlDeviceSetAutoBoostedClocksEnabled function as declared in nvml/nvml.h -func nvmlDeviceSetAutoBoostedClocksEnabled(Device Device, Enabled EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice nvmlDevice, Enabled EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEnabled, _ := (C.nvmlEnableState_t)(Enabled), cgoAllocsUnknown - __ret := C.nvmlDeviceSetAutoBoostedClocksEnabled(cDevice, cEnabled) + __ret := C.nvmlDeviceSetAutoBoostedClocksEnabled(cnvmlDevice, cEnabled) __v := (Return)(__ret) return __v } // nvmlDeviceSetDefaultAutoBoostedClocksEnabled function as declared in nvml/nvml.h -func nvmlDeviceSetDefaultAutoBoostedClocksEnabled(Device Device, Enabled EnableState, Flags uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice nvmlDevice, Enabled EnableState, Flags uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEnabled, _ := (C.nvmlEnableState_t)(Enabled), cgoAllocsUnknown cFlags, _ := (C.uint)(Flags), cgoAllocsUnknown - __ret := C.nvmlDeviceSetDefaultAutoBoostedClocksEnabled(cDevice, cEnabled, cFlags) + __ret := C.nvmlDeviceSetDefaultAutoBoostedClocksEnabled(cnvmlDevice, cEnabled, cFlags) __v := (Return)(__ret) return __v } // nvmlDeviceGetFanSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetFanSpeed(Device Device, Speed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFanSpeed(nvmlDevice nvmlDevice, Speed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSpeed, _ := (*C.uint)(unsafe.Pointer(Speed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFanSpeed(cDevice, cSpeed) + __ret := C.nvmlDeviceGetFanSpeed(cnvmlDevice, cSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetFanSpeed_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetFanSpeed_v2(Device Device, Fan uint32, Speed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFanSpeed_v2(nvmlDevice nvmlDevice, Fan uint32, Speed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cSpeed, _ := (*C.uint)(unsafe.Pointer(Speed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFanSpeed_v2(cDevice, cFan, cSpeed) + __ret := C.nvmlDeviceGetFanSpeed_v2(cnvmlDevice, cFan, cSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetTargetFanSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetTargetFanSpeed(Device Device, Fan uint32, TargetSpeed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTargetFanSpeed(nvmlDevice nvmlDevice, Fan uint32, TargetSpeed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cTargetSpeed, _ := (*C.uint)(unsafe.Pointer(TargetSpeed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTargetFanSpeed(cDevice, cFan, cTargetSpeed) + __ret := C.nvmlDeviceGetTargetFanSpeed(cnvmlDevice, cFan, cTargetSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceSetDefaultFanSpeed_v2 function as declared in nvml/nvml.h -func nvmlDeviceSetDefaultFanSpeed_v2(Device Device, Fan uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice nvmlDevice, Fan uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown - __ret := C.nvmlDeviceSetDefaultFanSpeed_v2(cDevice, cFan) + __ret := C.nvmlDeviceSetDefaultFanSpeed_v2(cnvmlDevice, cFan) __v := (Return)(__ret) return __v } // nvmlDeviceGetMinMaxFanSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetMinMaxFanSpeed(Device Device, MinSpeed *uint32, MaxSpeed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMinMaxFanSpeed(nvmlDevice nvmlDevice, MinSpeed *uint32, MaxSpeed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinSpeed, _ := (*C.uint)(unsafe.Pointer(MinSpeed)), cgoAllocsUnknown cMaxSpeed, _ := (*C.uint)(unsafe.Pointer(MaxSpeed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMinMaxFanSpeed(cDevice, cMinSpeed, cMaxSpeed) + __ret := C.nvmlDeviceGetMinMaxFanSpeed(cnvmlDevice, cMinSpeed, cMaxSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetFanControlPolicy_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetFanControlPolicy_v2(Device Device, Fan uint32, Policy *FanControlPolicy) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFanControlPolicy_v2(nvmlDevice nvmlDevice, Fan uint32, Policy *FanControlPolicy) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cPolicy, _ := (*C.nvmlFanControlPolicy_t)(unsafe.Pointer(Policy)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFanControlPolicy_v2(cDevice, cFan, cPolicy) + __ret := C.nvmlDeviceGetFanControlPolicy_v2(cnvmlDevice, cFan, cPolicy) __v := (Return)(__ret) return __v } // nvmlDeviceSetFanControlPolicy function as declared in nvml/nvml.h -func nvmlDeviceSetFanControlPolicy(Device Device, Fan uint32, Policy FanControlPolicy) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetFanControlPolicy(nvmlDevice nvmlDevice, Fan uint32, Policy FanControlPolicy) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cPolicy, _ := (C.nvmlFanControlPolicy_t)(Policy), cgoAllocsUnknown - __ret := C.nvmlDeviceSetFanControlPolicy(cDevice, cFan, cPolicy) + __ret := C.nvmlDeviceSetFanControlPolicy(cnvmlDevice, cFan, cPolicy) __v := (Return)(__ret) return __v } // nvmlDeviceGetNumFans function as declared in nvml/nvml.h -func nvmlDeviceGetNumFans(Device Device, NumFans *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNumFans(nvmlDevice nvmlDevice, NumFans *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cNumFans, _ := (*C.uint)(unsafe.Pointer(NumFans)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNumFans(cDevice, cNumFans) + __ret := C.nvmlDeviceGetNumFans(cnvmlDevice, cNumFans) __v := (Return)(__ret) return __v } // nvmlDeviceGetTemperature function as declared in nvml/nvml.h -func nvmlDeviceGetTemperature(Device Device, SensorType TemperatureSensors, Temp *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTemperature(nvmlDevice nvmlDevice, SensorType TemperatureSensors, Temp *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSensorType, _ := (C.nvmlTemperatureSensors_t)(SensorType), cgoAllocsUnknown cTemp, _ := (*C.uint)(unsafe.Pointer(Temp)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTemperature(cDevice, cSensorType, cTemp) + __ret := C.nvmlDeviceGetTemperature(cnvmlDevice, cSensorType, cTemp) __v := (Return)(__ret) return __v } // nvmlDeviceGetTemperatureThreshold function as declared in nvml/nvml.h -func nvmlDeviceGetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTemperatureThreshold(nvmlDevice nvmlDevice, ThresholdType TemperatureThresholds, Temp *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cThresholdType, _ := (C.nvmlTemperatureThresholds_t)(ThresholdType), cgoAllocsUnknown cTemp, _ := (*C.uint)(unsafe.Pointer(Temp)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTemperatureThreshold(cDevice, cThresholdType, cTemp) + __ret := C.nvmlDeviceGetTemperatureThreshold(cnvmlDevice, cThresholdType, cTemp) __v := (Return)(__ret) return __v } // nvmlDeviceSetTemperatureThreshold function as declared in nvml/nvml.h -func nvmlDeviceSetTemperatureThreshold(Device Device, ThresholdType TemperatureThresholds, Temp *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetTemperatureThreshold(nvmlDevice nvmlDevice, ThresholdType TemperatureThresholds, Temp *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cThresholdType, _ := (C.nvmlTemperatureThresholds_t)(ThresholdType), cgoAllocsUnknown cTemp, _ := (*C.int)(unsafe.Pointer(Temp)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetTemperatureThreshold(cDevice, cThresholdType, cTemp) + __ret := C.nvmlDeviceSetTemperatureThreshold(cnvmlDevice, cThresholdType, cTemp) __v := (Return)(__ret) return __v } // nvmlDeviceGetThermalSettings function as declared in nvml/nvml.h -func nvmlDeviceGetThermalSettings(Device Device, SensorIndex uint32, PThermalSettings *GpuThermalSettings) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetThermalSettings(nvmlDevice nvmlDevice, SensorIndex uint32, PThermalSettings *GpuThermalSettings) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSensorIndex, _ := (C.uint)(SensorIndex), cgoAllocsUnknown cPThermalSettings, _ := (*C.nvmlGpuThermalSettings_t)(unsafe.Pointer(PThermalSettings)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetThermalSettings(cDevice, cSensorIndex, cPThermalSettings) + __ret := C.nvmlDeviceGetThermalSettings(cnvmlDevice, cSensorIndex, cPThermalSettings) __v := (Return)(__ret) return __v } // nvmlDeviceGetPerformanceState function as declared in nvml/nvml.h -func nvmlDeviceGetPerformanceState(Device Device, PState *Pstates) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPerformanceState(nvmlDevice nvmlDevice, PState *Pstates) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPState, _ := (*C.nvmlPstates_t)(unsafe.Pointer(PState)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPerformanceState(cDevice, cPState) + __ret := C.nvmlDeviceGetPerformanceState(cnvmlDevice, cPState) __v := (Return)(__ret) return __v } // nvmlDeviceGetCurrentClocksThrottleReasons function as declared in nvml/nvml.h -func nvmlDeviceGetCurrentClocksThrottleReasons(Device Device, ClocksThrottleReasons *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCurrentClocksThrottleReasons(nvmlDevice nvmlDevice, ClocksThrottleReasons *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cClocksThrottleReasons, _ := (*C.ulonglong)(unsafe.Pointer(ClocksThrottleReasons)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCurrentClocksThrottleReasons(cDevice, cClocksThrottleReasons) + __ret := C.nvmlDeviceGetCurrentClocksThrottleReasons(cnvmlDevice, cClocksThrottleReasons) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedClocksThrottleReasons function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedClocksThrottleReasons(Device Device, SupportedClocksThrottleReasons *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedClocksThrottleReasons(nvmlDevice nvmlDevice, SupportedClocksThrottleReasons *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSupportedClocksThrottleReasons, _ := (*C.ulonglong)(unsafe.Pointer(SupportedClocksThrottleReasons)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedClocksThrottleReasons(cDevice, cSupportedClocksThrottleReasons) + __ret := C.nvmlDeviceGetSupportedClocksThrottleReasons(cnvmlDevice, cSupportedClocksThrottleReasons) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerState function as declared in nvml/nvml.h -func nvmlDeviceGetPowerState(Device Device, PState *Pstates) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerState(nvmlDevice nvmlDevice, PState *Pstates) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPState, _ := (*C.nvmlPstates_t)(unsafe.Pointer(PState)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerState(cDevice, cPState) + __ret := C.nvmlDeviceGetPowerState(cnvmlDevice, cPState) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerManagementMode function as declared in nvml/nvml.h -func nvmlDeviceGetPowerManagementMode(Device Device, Mode *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerManagementMode(nvmlDevice nvmlDevice, Mode *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerManagementMode(cDevice, cMode) + __ret := C.nvmlDeviceGetPowerManagementMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerManagementLimit function as declared in nvml/nvml.h -func nvmlDeviceGetPowerManagementLimit(Device Device, Limit *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerManagementLimit(nvmlDevice nvmlDevice, Limit *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLimit, _ := (*C.uint)(unsafe.Pointer(Limit)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerManagementLimit(cDevice, cLimit) + __ret := C.nvmlDeviceGetPowerManagementLimit(cnvmlDevice, cLimit) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerManagementLimitConstraints function as declared in nvml/nvml.h -func nvmlDeviceGetPowerManagementLimitConstraints(Device Device, MinLimit *uint32, MaxLimit *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice nvmlDevice, MinLimit *uint32, MaxLimit *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinLimit, _ := (*C.uint)(unsafe.Pointer(MinLimit)), cgoAllocsUnknown cMaxLimit, _ := (*C.uint)(unsafe.Pointer(MaxLimit)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerManagementLimitConstraints(cDevice, cMinLimit, cMaxLimit) + __ret := C.nvmlDeviceGetPowerManagementLimitConstraints(cnvmlDevice, cMinLimit, cMaxLimit) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerManagementDefaultLimit function as declared in nvml/nvml.h -func nvmlDeviceGetPowerManagementDefaultLimit(Device Device, DefaultLimit *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice nvmlDevice, DefaultLimit *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cDefaultLimit, _ := (*C.uint)(unsafe.Pointer(DefaultLimit)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerManagementDefaultLimit(cDevice, cDefaultLimit) + __ret := C.nvmlDeviceGetPowerManagementDefaultLimit(cnvmlDevice, cDefaultLimit) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerUsage function as declared in nvml/nvml.h -func nvmlDeviceGetPowerUsage(Device Device, Power *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerUsage(nvmlDevice nvmlDevice, Power *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPower, _ := (*C.uint)(unsafe.Pointer(Power)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerUsage(cDevice, cPower) + __ret := C.nvmlDeviceGetPowerUsage(cnvmlDevice, cPower) __v := (Return)(__ret) return __v } // nvmlDeviceGetTotalEnergyConsumption function as declared in nvml/nvml.h -func nvmlDeviceGetTotalEnergyConsumption(Device Device, Energy *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTotalEnergyConsumption(nvmlDevice nvmlDevice, Energy *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEnergy, _ := (*C.ulonglong)(unsafe.Pointer(Energy)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTotalEnergyConsumption(cDevice, cEnergy) + __ret := C.nvmlDeviceGetTotalEnergyConsumption(cnvmlDevice, cEnergy) __v := (Return)(__ret) return __v } // nvmlDeviceGetEnforcedPowerLimit function as declared in nvml/nvml.h -func nvmlDeviceGetEnforcedPowerLimit(Device Device, Limit *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEnforcedPowerLimit(nvmlDevice nvmlDevice, Limit *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLimit, _ := (*C.uint)(unsafe.Pointer(Limit)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEnforcedPowerLimit(cDevice, cLimit) + __ret := C.nvmlDeviceGetEnforcedPowerLimit(cnvmlDevice, cLimit) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuOperationMode function as declared in nvml/nvml.h -func nvmlDeviceGetGpuOperationMode(Device Device, Current *GpuOperationMode, Pending *GpuOperationMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuOperationMode(nvmlDevice nvmlDevice, Current *GpuOperationMode, Pending *GpuOperationMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrent, _ := (*C.nvmlGpuOperationMode_t)(unsafe.Pointer(Current)), cgoAllocsUnknown cPending, _ := (*C.nvmlGpuOperationMode_t)(unsafe.Pointer(Pending)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuOperationMode(cDevice, cCurrent, cPending) + __ret := C.nvmlDeviceGetGpuOperationMode(cnvmlDevice, cCurrent, cPending) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryInfo function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryInfo(Device Device, Memory *Memory) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryInfo(nvmlDevice nvmlDevice, Memory *Memory) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMemory, _ := (*C.nvmlMemory_t)(unsafe.Pointer(Memory)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryInfo(cDevice, cMemory) + __ret := C.nvmlDeviceGetMemoryInfo(cnvmlDevice, cMemory) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryInfo_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryInfo_v2(Device Device, Memory *Memory_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryInfo_v2(nvmlDevice nvmlDevice, Memory *Memory_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMemory, _ := (*C.nvmlMemory_v2_t)(unsafe.Pointer(Memory)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryInfo_v2(cDevice, cMemory) + __ret := C.nvmlDeviceGetMemoryInfo_v2(cnvmlDevice, cMemory) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeMode function as declared in nvml/nvml.h -func nvmlDeviceGetComputeMode(Device Device, Mode *ComputeMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeMode(nvmlDevice nvmlDevice, Mode *ComputeMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (*C.nvmlComputeMode_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeMode(cDevice, cMode) + __ret := C.nvmlDeviceGetComputeMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetCudaComputeCapability function as declared in nvml/nvml.h -func nvmlDeviceGetCudaComputeCapability(Device Device, Major *int32, Minor *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCudaComputeCapability(nvmlDevice nvmlDevice, Major *int32, Minor *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMajor, _ := (*C.int)(unsafe.Pointer(Major)), cgoAllocsUnknown cMinor, _ := (*C.int)(unsafe.Pointer(Minor)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCudaComputeCapability(cDevice, cMajor, cMinor) + __ret := C.nvmlDeviceGetCudaComputeCapability(cnvmlDevice, cMajor, cMinor) __v := (Return)(__ret) return __v } // nvmlDeviceGetEccMode function as declared in nvml/nvml.h -func nvmlDeviceGetEccMode(Device Device, Current *EnableState, Pending *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEccMode(nvmlDevice nvmlDevice, Current *EnableState, Pending *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrent, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Current)), cgoAllocsUnknown cPending, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Pending)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEccMode(cDevice, cCurrent, cPending) + __ret := C.nvmlDeviceGetEccMode(cnvmlDevice, cCurrent, cPending) __v := (Return)(__ret) return __v } // nvmlDeviceGetDefaultEccMode function as declared in nvml/nvml.h -func nvmlDeviceGetDefaultEccMode(Device Device, DefaultMode *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDefaultEccMode(nvmlDevice nvmlDevice, DefaultMode *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cDefaultMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(DefaultMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDefaultEccMode(cDevice, cDefaultMode) + __ret := C.nvmlDeviceGetDefaultEccMode(cnvmlDevice, cDefaultMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetBoardId function as declared in nvml/nvml.h -func nvmlDeviceGetBoardId(Device Device, BoardId *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBoardId(nvmlDevice nvmlDevice, BoardId *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBoardId, _ := (*C.uint)(unsafe.Pointer(BoardId)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBoardId(cDevice, cBoardId) + __ret := C.nvmlDeviceGetBoardId(cnvmlDevice, cBoardId) __v := (Return)(__ret) return __v } // nvmlDeviceGetMultiGpuBoard function as declared in nvml/nvml.h -func nvmlDeviceGetMultiGpuBoard(Device Device, MultiGpuBool *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMultiGpuBoard(nvmlDevice nvmlDevice, MultiGpuBool *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMultiGpuBool, _ := (*C.uint)(unsafe.Pointer(MultiGpuBool)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMultiGpuBoard(cDevice, cMultiGpuBool) + __ret := C.nvmlDeviceGetMultiGpuBoard(cnvmlDevice, cMultiGpuBool) __v := (Return)(__ret) return __v } // nvmlDeviceGetTotalEccErrors function as declared in nvml/nvml.h -func nvmlDeviceGetTotalEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, EccCounts *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetTotalEccErrors(nvmlDevice nvmlDevice, ErrorType MemoryErrorType, CounterType EccCounterType, EccCounts *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cErrorType, _ := (C.nvmlMemoryErrorType_t)(ErrorType), cgoAllocsUnknown cCounterType, _ := (C.nvmlEccCounterType_t)(CounterType), cgoAllocsUnknown cEccCounts, _ := (*C.ulonglong)(unsafe.Pointer(EccCounts)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetTotalEccErrors(cDevice, cErrorType, cCounterType, cEccCounts) + __ret := C.nvmlDeviceGetTotalEccErrors(cnvmlDevice, cErrorType, cCounterType, cEccCounts) __v := (Return)(__ret) return __v } // nvmlDeviceGetDetailedEccErrors function as declared in nvml/nvml.h -func nvmlDeviceGetDetailedEccErrors(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, EccCounts *EccErrorCounts) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDetailedEccErrors(nvmlDevice nvmlDevice, ErrorType MemoryErrorType, CounterType EccCounterType, EccCounts *EccErrorCounts) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cErrorType, _ := (C.nvmlMemoryErrorType_t)(ErrorType), cgoAllocsUnknown cCounterType, _ := (C.nvmlEccCounterType_t)(CounterType), cgoAllocsUnknown cEccCounts, _ := (*C.nvmlEccErrorCounts_t)(unsafe.Pointer(EccCounts)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDetailedEccErrors(cDevice, cErrorType, cCounterType, cEccCounts) + __ret := C.nvmlDeviceGetDetailedEccErrors(cnvmlDevice, cErrorType, cCounterType, cEccCounts) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryErrorCounter function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryErrorCounter(Device Device, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation, Count *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryErrorCounter(nvmlDevice nvmlDevice, ErrorType MemoryErrorType, CounterType EccCounterType, LocationType MemoryLocation, Count *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cErrorType, _ := (C.nvmlMemoryErrorType_t)(ErrorType), cgoAllocsUnknown cCounterType, _ := (C.nvmlEccCounterType_t)(CounterType), cgoAllocsUnknown cLocationType, _ := (C.nvmlMemoryLocation_t)(LocationType), cgoAllocsUnknown cCount, _ := (*C.ulonglong)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryErrorCounter(cDevice, cErrorType, cCounterType, cLocationType, cCount) + __ret := C.nvmlDeviceGetMemoryErrorCounter(cnvmlDevice, cErrorType, cCounterType, cLocationType, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceGetUtilizationRates function as declared in nvml/nvml.h -func nvmlDeviceGetUtilizationRates(Device Device, Utilization *Utilization) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetUtilizationRates(nvmlDevice nvmlDevice, Utilization *Utilization) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUtilization, _ := (*C.nvmlUtilization_t)(unsafe.Pointer(Utilization)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetUtilizationRates(cDevice, cUtilization) + __ret := C.nvmlDeviceGetUtilizationRates(cnvmlDevice, cUtilization) __v := (Return)(__ret) return __v } // nvmlDeviceGetEncoderUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetEncoderUtilization(Device Device, Utilization *uint32, SamplingPeriodUs *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEncoderUtilization(nvmlDevice nvmlDevice, Utilization *uint32, SamplingPeriodUs *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUtilization, _ := (*C.uint)(unsafe.Pointer(Utilization)), cgoAllocsUnknown cSamplingPeriodUs, _ := (*C.uint)(unsafe.Pointer(SamplingPeriodUs)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEncoderUtilization(cDevice, cUtilization, cSamplingPeriodUs) + __ret := C.nvmlDeviceGetEncoderUtilization(cnvmlDevice, cUtilization, cSamplingPeriodUs) __v := (Return)(__ret) return __v } // nvmlDeviceGetEncoderCapacity function as declared in nvml/nvml.h -func nvmlDeviceGetEncoderCapacity(Device Device, EncoderQueryType EncoderType, EncoderCapacity *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEncoderCapacity(nvmlDevice nvmlDevice, EncoderQueryType EncoderType, EncoderCapacity *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEncoderQueryType, _ := (C.nvmlEncoderType_t)(EncoderQueryType), cgoAllocsUnknown cEncoderCapacity, _ := (*C.uint)(unsafe.Pointer(EncoderCapacity)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEncoderCapacity(cDevice, cEncoderQueryType, cEncoderCapacity) + __ret := C.nvmlDeviceGetEncoderCapacity(cnvmlDevice, cEncoderQueryType, cEncoderCapacity) __v := (Return)(__ret) return __v } // nvmlDeviceGetEncoderStats function as declared in nvml/nvml.h -func nvmlDeviceGetEncoderStats(Device Device, SessionCount *uint32, AverageFps *uint32, AverageLatency *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEncoderStats(nvmlDevice nvmlDevice, SessionCount *uint32, AverageFps *uint32, AverageLatency *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cAverageFps, _ := (*C.uint)(unsafe.Pointer(AverageFps)), cgoAllocsUnknown cAverageLatency, _ := (*C.uint)(unsafe.Pointer(AverageLatency)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEncoderStats(cDevice, cSessionCount, cAverageFps, cAverageLatency) + __ret := C.nvmlDeviceGetEncoderStats(cnvmlDevice, cSessionCount, cAverageFps, cAverageLatency) __v := (Return)(__ret) return __v } // nvmlDeviceGetEncoderSessions function as declared in nvml/nvml.h -func nvmlDeviceGetEncoderSessions(Device Device, SessionCount *uint32, SessionInfos *EncoderSessionInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetEncoderSessions(nvmlDevice nvmlDevice, SessionCount *uint32, SessionInfos *EncoderSessionInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cSessionInfos, _ := (*C.nvmlEncoderSessionInfo_t)(unsafe.Pointer(SessionInfos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetEncoderSessions(cDevice, cSessionCount, cSessionInfos) + __ret := C.nvmlDeviceGetEncoderSessions(cnvmlDevice, cSessionCount, cSessionInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetDecoderUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetDecoderUtilization(Device Device, Utilization *uint32, SamplingPeriodUs *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDecoderUtilization(nvmlDevice nvmlDevice, Utilization *uint32, SamplingPeriodUs *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUtilization, _ := (*C.uint)(unsafe.Pointer(Utilization)), cgoAllocsUnknown cSamplingPeriodUs, _ := (*C.uint)(unsafe.Pointer(SamplingPeriodUs)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDecoderUtilization(cDevice, cUtilization, cSamplingPeriodUs) + __ret := C.nvmlDeviceGetDecoderUtilization(cnvmlDevice, cUtilization, cSamplingPeriodUs) __v := (Return)(__ret) return __v } // nvmlDeviceGetFBCStats function as declared in nvml/nvml.h -func nvmlDeviceGetFBCStats(Device Device, FbcStats *FBCStats) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFBCStats(nvmlDevice nvmlDevice, FbcStats *FBCStats) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFbcStats, _ := (*C.nvmlFBCStats_t)(unsafe.Pointer(FbcStats)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFBCStats(cDevice, cFbcStats) + __ret := C.nvmlDeviceGetFBCStats(cnvmlDevice, cFbcStats) __v := (Return)(__ret) return __v } // nvmlDeviceGetFBCSessions function as declared in nvml/nvml.h -func nvmlDeviceGetFBCSessions(Device Device, SessionCount *uint32, SessionInfo *FBCSessionInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFBCSessions(nvmlDevice nvmlDevice, SessionCount *uint32, SessionInfo *FBCSessionInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cSessionInfo, _ := (*C.nvmlFBCSessionInfo_t)(unsafe.Pointer(SessionInfo)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFBCSessions(cDevice, cSessionCount, cSessionInfo) + __ret := C.nvmlDeviceGetFBCSessions(cnvmlDevice, cSessionCount, cSessionInfo) __v := (Return)(__ret) return __v } // nvmlDeviceGetDriverModel function as declared in nvml/nvml.h -func nvmlDeviceGetDriverModel(Device Device, Current *DriverModel, Pending *DriverModel) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDriverModel(nvmlDevice nvmlDevice, Current *DriverModel, Pending *DriverModel) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrent, _ := (*C.nvmlDriverModel_t)(unsafe.Pointer(Current)), cgoAllocsUnknown cPending, _ := (*C.nvmlDriverModel_t)(unsafe.Pointer(Pending)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDriverModel(cDevice, cCurrent, cPending) + __ret := C.nvmlDeviceGetDriverModel(cnvmlDevice, cCurrent, cPending) __v := (Return)(__ret) return __v } // nvmlDeviceGetVbiosVersion function as declared in nvml/nvml.h -func nvmlDeviceGetVbiosVersion(Device Device, Version *byte, Length uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVbiosVersion(nvmlDevice nvmlDevice, Version *byte, Length uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVbiosVersion(cDevice, cVersion, cLength) + __ret := C.nvmlDeviceGetVbiosVersion(cnvmlDevice, cVersion, cLength) __v := (Return)(__ret) return __v } // nvmlDeviceGetBridgeChipInfo function as declared in nvml/nvml.h -func nvmlDeviceGetBridgeChipInfo(Device Device, BridgeHierarchy *BridgeChipHierarchy) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBridgeChipInfo(nvmlDevice nvmlDevice, BridgeHierarchy *BridgeChipHierarchy) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBridgeHierarchy, _ := (*C.nvmlBridgeChipHierarchy_t)(unsafe.Pointer(BridgeHierarchy)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBridgeChipInfo(cDevice, cBridgeHierarchy) + __ret := C.nvmlDeviceGetBridgeChipInfo(cnvmlDevice, cBridgeHierarchy) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeRunningProcesses_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetComputeRunningProcesses_v3(Device Device, InfoCount *uint32, Infos *ProcessInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeRunningProcesses_v3(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetComputeRunningProcesses_v3(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetGraphicsRunningProcesses_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetGraphicsRunningProcesses_v3(Device Device, InfoCount *uint32, Infos *ProcessInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGraphicsRunningProcesses_v3(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetGraphicsRunningProcesses_v3(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetMPSComputeRunningProcesses_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetMPSComputeRunningProcesses_v3(Device Device, InfoCount *uint32, Infos *ProcessInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMPSComputeRunningProcesses_v3(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetMPSComputeRunningProcesses_v3(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceOnSameBoard function as declared in nvml/nvml.h -func nvmlDeviceOnSameBoard(Device1 Device, Device2 Device, OnSameBoard *int32) Return { +func nvmlDeviceOnSameBoard(Device1 nvmlDevice, Device2 nvmlDevice, OnSameBoard *int32) Return { cDevice1, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device1)), cgoAllocsUnknown cDevice2, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device2)), cgoAllocsUnknown cOnSameBoard, _ := (*C.int)(unsafe.Pointer(OnSameBoard)), cgoAllocsUnknown @@ -1145,494 +1145,494 @@ func nvmlDeviceOnSameBoard(Device1 Device, Device2 Device, OnSameBoard *int32) R } // nvmlDeviceGetAPIRestriction function as declared in nvml/nvml.h -func nvmlDeviceGetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAPIRestriction(nvmlDevice nvmlDevice, ApiType RestrictedAPI, IsRestricted *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cApiType, _ := (C.nvmlRestrictedAPI_t)(ApiType), cgoAllocsUnknown cIsRestricted, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsRestricted)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAPIRestriction(cDevice, cApiType, cIsRestricted) + __ret := C.nvmlDeviceGetAPIRestriction(cnvmlDevice, cApiType, cIsRestricted) __v := (Return)(__ret) return __v } // nvmlDeviceGetSamples function as declared in nvml/nvml.h -func nvmlDeviceGetSamples(Device Device, _type SamplingType, LastSeenTimeStamp uint64, SampleValType *ValueType, SampleCount *uint32, Samples *Sample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSamples(nvmlDevice nvmlDevice, _type SamplingType, LastSeenTimeStamp uint64, SampleValType *ValueType, SampleCount *uint32, Samples *Sample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (C.nvmlSamplingType_t)(_type), cgoAllocsUnknown cLastSeenTimeStamp, _ := (C.ulonglong)(LastSeenTimeStamp), cgoAllocsUnknown cSampleValType, _ := (*C.nvmlValueType_t)(unsafe.Pointer(SampleValType)), cgoAllocsUnknown cSampleCount, _ := (*C.uint)(unsafe.Pointer(SampleCount)), cgoAllocsUnknown cSamples, _ := (*C.nvmlSample_t)(unsafe.Pointer(Samples)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSamples(cDevice, c_type, cLastSeenTimeStamp, cSampleValType, cSampleCount, cSamples) + __ret := C.nvmlDeviceGetSamples(cnvmlDevice, c_type, cLastSeenTimeStamp, cSampleValType, cSampleCount, cSamples) __v := (Return)(__ret) return __v } // nvmlDeviceGetBAR1MemoryInfo function as declared in nvml/nvml.h -func nvmlDeviceGetBAR1MemoryInfo(Device Device, Bar1Memory *BAR1Memory) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBAR1MemoryInfo(nvmlDevice nvmlDevice, Bar1Memory *BAR1Memory) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBar1Memory, _ := (*C.nvmlBAR1Memory_t)(unsafe.Pointer(Bar1Memory)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBAR1MemoryInfo(cDevice, cBar1Memory) + __ret := C.nvmlDeviceGetBAR1MemoryInfo(cnvmlDevice, cBar1Memory) __v := (Return)(__ret) return __v } // nvmlDeviceGetViolationStatus function as declared in nvml/nvml.h -func nvmlDeviceGetViolationStatus(Device Device, PerfPolicyType PerfPolicyType, ViolTime *ViolationTime) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetViolationStatus(nvmlDevice nvmlDevice, PerfPolicyType PerfPolicyType, ViolTime *ViolationTime) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPerfPolicyType, _ := (C.nvmlPerfPolicyType_t)(PerfPolicyType), cgoAllocsUnknown cViolTime, _ := (*C.nvmlViolationTime_t)(unsafe.Pointer(ViolTime)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetViolationStatus(cDevice, cPerfPolicyType, cViolTime) + __ret := C.nvmlDeviceGetViolationStatus(cnvmlDevice, cPerfPolicyType, cViolTime) __v := (Return)(__ret) return __v } // nvmlDeviceGetIrqNum function as declared in nvml/nvml.h -func nvmlDeviceGetIrqNum(Device Device, IrqNum *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetIrqNum(nvmlDevice nvmlDevice, IrqNum *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIrqNum, _ := (*C.uint)(unsafe.Pointer(IrqNum)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetIrqNum(cDevice, cIrqNum) + __ret := C.nvmlDeviceGetIrqNum(cnvmlDevice, cIrqNum) __v := (Return)(__ret) return __v } // nvmlDeviceGetNumGpuCores function as declared in nvml/nvml.h -func nvmlDeviceGetNumGpuCores(Device Device, NumCores *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNumGpuCores(nvmlDevice nvmlDevice, NumCores *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cNumCores, _ := (*C.uint)(unsafe.Pointer(NumCores)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNumGpuCores(cDevice, cNumCores) + __ret := C.nvmlDeviceGetNumGpuCores(cnvmlDevice, cNumCores) __v := (Return)(__ret) return __v } // nvmlDeviceGetPowerSource function as declared in nvml/nvml.h -func nvmlDeviceGetPowerSource(Device Device, PowerSource *PowerSource) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPowerSource(nvmlDevice nvmlDevice, PowerSource *PowerSource) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPowerSource, _ := (*C.nvmlPowerSource_t)(unsafe.Pointer(PowerSource)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPowerSource(cDevice, cPowerSource) + __ret := C.nvmlDeviceGetPowerSource(cnvmlDevice, cPowerSource) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemoryBusWidth function as declared in nvml/nvml.h -func nvmlDeviceGetMemoryBusWidth(Device Device, BusWidth *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemoryBusWidth(nvmlDevice nvmlDevice, BusWidth *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBusWidth, _ := (*C.uint)(unsafe.Pointer(BusWidth)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemoryBusWidth(cDevice, cBusWidth) + __ret := C.nvmlDeviceGetMemoryBusWidth(cnvmlDevice, cBusWidth) __v := (Return)(__ret) return __v } // nvmlDeviceGetPcieLinkMaxSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetPcieLinkMaxSpeed(Device Device, MaxSpeed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice nvmlDevice, MaxSpeed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMaxSpeed, _ := (*C.uint)(unsafe.Pointer(MaxSpeed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPcieLinkMaxSpeed(cDevice, cMaxSpeed) + __ret := C.nvmlDeviceGetPcieLinkMaxSpeed(cnvmlDevice, cMaxSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetPcieSpeed function as declared in nvml/nvml.h -func nvmlDeviceGetPcieSpeed(Device Device, PcieSpeed *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPcieSpeed(nvmlDevice nvmlDevice, PcieSpeed *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPcieSpeed, _ := (*C.uint)(unsafe.Pointer(PcieSpeed)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPcieSpeed(cDevice, cPcieSpeed) + __ret := C.nvmlDeviceGetPcieSpeed(cnvmlDevice, cPcieSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetAdaptiveClockInfoStatus function as declared in nvml/nvml.h -func nvmlDeviceGetAdaptiveClockInfoStatus(Device Device, AdaptiveClockStatus *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice nvmlDevice, AdaptiveClockStatus *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cAdaptiveClockStatus, _ := (*C.uint)(unsafe.Pointer(AdaptiveClockStatus)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAdaptiveClockInfoStatus(cDevice, cAdaptiveClockStatus) + __ret := C.nvmlDeviceGetAdaptiveClockInfoStatus(cnvmlDevice, cAdaptiveClockStatus) __v := (Return)(__ret) return __v } // nvmlDeviceGetAccountingMode function as declared in nvml/nvml.h -func nvmlDeviceGetAccountingMode(Device Device, Mode *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAccountingMode(nvmlDevice nvmlDevice, Mode *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAccountingMode(cDevice, cMode) + __ret := C.nvmlDeviceGetAccountingMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetAccountingStats function as declared in nvml/nvml.h -func nvmlDeviceGetAccountingStats(Device Device, Pid uint32, Stats *AccountingStats) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAccountingStats(nvmlDevice nvmlDevice, Pid uint32, Stats *AccountingStats) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPid, _ := (C.uint)(Pid), cgoAllocsUnknown cStats, _ := (*C.nvmlAccountingStats_t)(unsafe.Pointer(Stats)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAccountingStats(cDevice, cPid, cStats) + __ret := C.nvmlDeviceGetAccountingStats(cnvmlDevice, cPid, cStats) __v := (Return)(__ret) return __v } // nvmlDeviceGetAccountingPids function as declared in nvml/nvml.h -func nvmlDeviceGetAccountingPids(Device Device, Count *uint32, Pids *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAccountingPids(nvmlDevice nvmlDevice, Count *uint32, Pids *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cPids, _ := (*C.uint)(unsafe.Pointer(Pids)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAccountingPids(cDevice, cCount, cPids) + __ret := C.nvmlDeviceGetAccountingPids(cnvmlDevice, cCount, cPids) __v := (Return)(__ret) return __v } // nvmlDeviceGetAccountingBufferSize function as declared in nvml/nvml.h -func nvmlDeviceGetAccountingBufferSize(Device Device, BufferSize *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAccountingBufferSize(nvmlDevice nvmlDevice, BufferSize *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cBufferSize, _ := (*C.uint)(unsafe.Pointer(BufferSize)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAccountingBufferSize(cDevice, cBufferSize) + __ret := C.nvmlDeviceGetAccountingBufferSize(cnvmlDevice, cBufferSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetRetiredPages function as declared in nvml/nvml.h -func nvmlDeviceGetRetiredPages(Device Device, Cause PageRetirementCause, PageCount *uint32, Addresses *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRetiredPages(nvmlDevice nvmlDevice, Cause PageRetirementCause, PageCount *uint32, Addresses *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCause, _ := (C.nvmlPageRetirementCause_t)(Cause), cgoAllocsUnknown cPageCount, _ := (*C.uint)(unsafe.Pointer(PageCount)), cgoAllocsUnknown cAddresses, _ := (*C.ulonglong)(unsafe.Pointer(Addresses)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRetiredPages(cDevice, cCause, cPageCount, cAddresses) + __ret := C.nvmlDeviceGetRetiredPages(cnvmlDevice, cCause, cPageCount, cAddresses) __v := (Return)(__ret) return __v } // nvmlDeviceGetRetiredPages_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetRetiredPages_v2(Device Device, Cause PageRetirementCause, PageCount *uint32, Addresses *uint64, Timestamps *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRetiredPages_v2(nvmlDevice nvmlDevice, Cause PageRetirementCause, PageCount *uint32, Addresses *uint64, Timestamps *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCause, _ := (C.nvmlPageRetirementCause_t)(Cause), cgoAllocsUnknown cPageCount, _ := (*C.uint)(unsafe.Pointer(PageCount)), cgoAllocsUnknown cAddresses, _ := (*C.ulonglong)(unsafe.Pointer(Addresses)), cgoAllocsUnknown cTimestamps, _ := (*C.ulonglong)(unsafe.Pointer(Timestamps)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRetiredPages_v2(cDevice, cCause, cPageCount, cAddresses, cTimestamps) + __ret := C.nvmlDeviceGetRetiredPages_v2(cnvmlDevice, cCause, cPageCount, cAddresses, cTimestamps) __v := (Return)(__ret) return __v } // nvmlDeviceGetRetiredPagesPendingStatus function as declared in nvml/nvml.h -func nvmlDeviceGetRetiredPagesPendingStatus(Device Device, IsPending *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice nvmlDevice, IsPending *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsPending, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsPending)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRetiredPagesPendingStatus(cDevice, cIsPending) + __ret := C.nvmlDeviceGetRetiredPagesPendingStatus(cnvmlDevice, cIsPending) __v := (Return)(__ret) return __v } // nvmlDeviceGetRemappedRows function as declared in nvml/nvml.h -func nvmlDeviceGetRemappedRows(Device Device, CorrRows *uint32, UncRows *uint32, IsPending *uint32, FailureOccurred *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRemappedRows(nvmlDevice nvmlDevice, CorrRows *uint32, UncRows *uint32, IsPending *uint32, FailureOccurred *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCorrRows, _ := (*C.uint)(unsafe.Pointer(CorrRows)), cgoAllocsUnknown cUncRows, _ := (*C.uint)(unsafe.Pointer(UncRows)), cgoAllocsUnknown cIsPending, _ := (*C.uint)(unsafe.Pointer(IsPending)), cgoAllocsUnknown cFailureOccurred, _ := (*C.uint)(unsafe.Pointer(FailureOccurred)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRemappedRows(cDevice, cCorrRows, cUncRows, cIsPending, cFailureOccurred) + __ret := C.nvmlDeviceGetRemappedRows(cnvmlDevice, cCorrRows, cUncRows, cIsPending, cFailureOccurred) __v := (Return)(__ret) return __v } // nvmlDeviceGetRowRemapperHistogram function as declared in nvml/nvml.h -func nvmlDeviceGetRowRemapperHistogram(Device Device, Values *RowRemapperHistogramValues) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetRowRemapperHistogram(nvmlDevice nvmlDevice, Values *RowRemapperHistogramValues) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cValues, _ := (*C.nvmlRowRemapperHistogramValues_t)(unsafe.Pointer(Values)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetRowRemapperHistogram(cDevice, cValues) + __ret := C.nvmlDeviceGetRowRemapperHistogram(cnvmlDevice, cValues) __v := (Return)(__ret) return __v } // nvmlDeviceGetArchitecture function as declared in nvml/nvml.h -func nvmlDeviceGetArchitecture(Device Device, Arch *DeviceArchitecture) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetArchitecture(nvmlDevice nvmlDevice, Arch *DeviceArchitecture) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cArch, _ := (*C.nvmlDeviceArchitecture_t)(unsafe.Pointer(Arch)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetArchitecture(cDevice, cArch) + __ret := C.nvmlDeviceGetArchitecture(cnvmlDevice, cArch) __v := (Return)(__ret) return __v } // nvmlUnitSetLedState function as declared in nvml/nvml.h -func nvmlUnitSetLedState(Unit Unit, Color LedColor) Return { - cUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&Unit)), cgoAllocsUnknown +func nvmlUnitSetLedState(nvmlUnit nvmlUnit, Color LedColor) Return { + cnvmlUnit, _ := *(*C.nvmlUnit_t)(unsafe.Pointer(&nvmlUnit)), cgoAllocsUnknown cColor, _ := (C.nvmlLedColor_t)(Color), cgoAllocsUnknown - __ret := C.nvmlUnitSetLedState(cUnit, cColor) + __ret := C.nvmlUnitSetLedState(cnvmlUnit, cColor) __v := (Return)(__ret) return __v } // nvmlDeviceSetPersistenceMode function as declared in nvml/nvml.h -func nvmlDeviceSetPersistenceMode(Device Device, Mode EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetPersistenceMode(nvmlDevice nvmlDevice, Mode EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.nvmlEnableState_t)(Mode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetPersistenceMode(cDevice, cMode) + __ret := C.nvmlDeviceSetPersistenceMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceSetComputeMode function as declared in nvml/nvml.h -func nvmlDeviceSetComputeMode(Device Device, Mode ComputeMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetComputeMode(nvmlDevice nvmlDevice, Mode ComputeMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.nvmlComputeMode_t)(Mode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetComputeMode(cDevice, cMode) + __ret := C.nvmlDeviceSetComputeMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceSetEccMode function as declared in nvml/nvml.h -func nvmlDeviceSetEccMode(Device Device, Ecc EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetEccMode(nvmlDevice nvmlDevice, Ecc EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEcc, _ := (C.nvmlEnableState_t)(Ecc), cgoAllocsUnknown - __ret := C.nvmlDeviceSetEccMode(cDevice, cEcc) + __ret := C.nvmlDeviceSetEccMode(cnvmlDevice, cEcc) __v := (Return)(__ret) return __v } // nvmlDeviceClearEccErrorCounts function as declared in nvml/nvml.h -func nvmlDeviceClearEccErrorCounts(Device Device, CounterType EccCounterType) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceClearEccErrorCounts(nvmlDevice nvmlDevice, CounterType EccCounterType) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCounterType, _ := (C.nvmlEccCounterType_t)(CounterType), cgoAllocsUnknown - __ret := C.nvmlDeviceClearEccErrorCounts(cDevice, cCounterType) + __ret := C.nvmlDeviceClearEccErrorCounts(cnvmlDevice, cCounterType) __v := (Return)(__ret) return __v } // nvmlDeviceSetDriverModel function as declared in nvml/nvml.h -func nvmlDeviceSetDriverModel(Device Device, DriverModel DriverModel, Flags uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetDriverModel(nvmlDevice nvmlDevice, DriverModel DriverModel, Flags uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cDriverModel, _ := (C.nvmlDriverModel_t)(DriverModel), cgoAllocsUnknown cFlags, _ := (C.uint)(Flags), cgoAllocsUnknown - __ret := C.nvmlDeviceSetDriverModel(cDevice, cDriverModel, cFlags) + __ret := C.nvmlDeviceSetDriverModel(cnvmlDevice, cDriverModel, cFlags) __v := (Return)(__ret) return __v } // nvmlDeviceSetGpuLockedClocks function as declared in nvml/nvml.h -func nvmlDeviceSetGpuLockedClocks(Device Device, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetGpuLockedClocks(nvmlDevice nvmlDevice, MinGpuClockMHz uint32, MaxGpuClockMHz uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinGpuClockMHz, _ := (C.uint)(MinGpuClockMHz), cgoAllocsUnknown cMaxGpuClockMHz, _ := (C.uint)(MaxGpuClockMHz), cgoAllocsUnknown - __ret := C.nvmlDeviceSetGpuLockedClocks(cDevice, cMinGpuClockMHz, cMaxGpuClockMHz) + __ret := C.nvmlDeviceSetGpuLockedClocks(cnvmlDevice, cMinGpuClockMHz, cMaxGpuClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceResetGpuLockedClocks function as declared in nvml/nvml.h -func nvmlDeviceResetGpuLockedClocks(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceResetGpuLockedClocks(cDevice) +func nvmlDeviceResetGpuLockedClocks(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceResetGpuLockedClocks(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceSetMemoryLockedClocks function as declared in nvml/nvml.h -func nvmlDeviceSetMemoryLockedClocks(Device Device, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetMemoryLockedClocks(nvmlDevice nvmlDevice, MinMemClockMHz uint32, MaxMemClockMHz uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinMemClockMHz, _ := (C.uint)(MinMemClockMHz), cgoAllocsUnknown cMaxMemClockMHz, _ := (C.uint)(MaxMemClockMHz), cgoAllocsUnknown - __ret := C.nvmlDeviceSetMemoryLockedClocks(cDevice, cMinMemClockMHz, cMaxMemClockMHz) + __ret := C.nvmlDeviceSetMemoryLockedClocks(cnvmlDevice, cMinMemClockMHz, cMaxMemClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceResetMemoryLockedClocks function as declared in nvml/nvml.h -func nvmlDeviceResetMemoryLockedClocks(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceResetMemoryLockedClocks(cDevice) +func nvmlDeviceResetMemoryLockedClocks(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceResetMemoryLockedClocks(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceSetApplicationsClocks function as declared in nvml/nvml.h -func nvmlDeviceSetApplicationsClocks(Device Device, MemClockMHz uint32, GraphicsClockMHz uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetApplicationsClocks(nvmlDevice nvmlDevice, MemClockMHz uint32, GraphicsClockMHz uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMemClockMHz, _ := (C.uint)(MemClockMHz), cgoAllocsUnknown cGraphicsClockMHz, _ := (C.uint)(GraphicsClockMHz), cgoAllocsUnknown - __ret := C.nvmlDeviceSetApplicationsClocks(cDevice, cMemClockMHz, cGraphicsClockMHz) + __ret := C.nvmlDeviceSetApplicationsClocks(cnvmlDevice, cMemClockMHz, cGraphicsClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetClkMonStatus function as declared in nvml/nvml.h -func nvmlDeviceGetClkMonStatus(Device Device, Status *ClkMonStatus) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetClkMonStatus(nvmlDevice nvmlDevice, Status *ClkMonStatus) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cStatus, _ := (*C.nvmlClkMonStatus_t)(unsafe.Pointer(Status)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetClkMonStatus(cDevice, cStatus) + __ret := C.nvmlDeviceGetClkMonStatus(cnvmlDevice, cStatus) __v := (Return)(__ret) return __v } // nvmlDeviceSetPowerManagementLimit function as declared in nvml/nvml.h -func nvmlDeviceSetPowerManagementLimit(Device Device, Limit uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetPowerManagementLimit(nvmlDevice nvmlDevice, Limit uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLimit, _ := (C.uint)(Limit), cgoAllocsUnknown - __ret := C.nvmlDeviceSetPowerManagementLimit(cDevice, cLimit) + __ret := C.nvmlDeviceSetPowerManagementLimit(cnvmlDevice, cLimit) __v := (Return)(__ret) return __v } // nvmlDeviceSetGpuOperationMode function as declared in nvml/nvml.h -func nvmlDeviceSetGpuOperationMode(Device Device, Mode GpuOperationMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetGpuOperationMode(nvmlDevice nvmlDevice, Mode GpuOperationMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.nvmlGpuOperationMode_t)(Mode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetGpuOperationMode(cDevice, cMode) + __ret := C.nvmlDeviceSetGpuOperationMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceSetAPIRestriction function as declared in nvml/nvml.h -func nvmlDeviceSetAPIRestriction(Device Device, ApiType RestrictedAPI, IsRestricted EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetAPIRestriction(nvmlDevice nvmlDevice, ApiType RestrictedAPI, IsRestricted EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cApiType, _ := (C.nvmlRestrictedAPI_t)(ApiType), cgoAllocsUnknown cIsRestricted, _ := (C.nvmlEnableState_t)(IsRestricted), cgoAllocsUnknown - __ret := C.nvmlDeviceSetAPIRestriction(cDevice, cApiType, cIsRestricted) + __ret := C.nvmlDeviceSetAPIRestriction(cnvmlDevice, cApiType, cIsRestricted) __v := (Return)(__ret) return __v } // nvmlDeviceSetAccountingMode function as declared in nvml/nvml.h -func nvmlDeviceSetAccountingMode(Device Device, Mode EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetAccountingMode(nvmlDevice nvmlDevice, Mode EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.nvmlEnableState_t)(Mode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetAccountingMode(cDevice, cMode) + __ret := C.nvmlDeviceSetAccountingMode(cnvmlDevice, cMode) __v := (Return)(__ret) return __v } // nvmlDeviceClearAccountingPids function as declared in nvml/nvml.h -func nvmlDeviceClearAccountingPids(Device Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceClearAccountingPids(cDevice) +func nvmlDeviceClearAccountingPids(nvmlDevice nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceClearAccountingPids(cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkState function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkState(Device Device, Link uint32, IsActive *EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkState(nvmlDevice nvmlDevice, Link uint32, IsActive *EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cIsActive, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(IsActive)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkState(cDevice, cLink, cIsActive) + __ret := C.nvmlDeviceGetNvLinkState(cnvmlDevice, cLink, cIsActive) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkVersion function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkVersion(Device Device, Link uint32, Version *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkVersion(nvmlDevice nvmlDevice, Link uint32, Version *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cVersion, _ := (*C.uint)(unsafe.Pointer(Version)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkVersion(cDevice, cLink, cVersion) + __ret := C.nvmlDeviceGetNvLinkVersion(cnvmlDevice, cLink, cVersion) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkCapability function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkCapability(Device Device, Link uint32, Capability NvLinkCapability, CapResult *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkCapability(nvmlDevice nvmlDevice, Link uint32, Capability NvLinkCapability, CapResult *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCapability, _ := (C.nvmlNvLinkCapability_t)(Capability), cgoAllocsUnknown cCapResult, _ := (*C.uint)(unsafe.Pointer(CapResult)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkCapability(cDevice, cLink, cCapability, cCapResult) + __ret := C.nvmlDeviceGetNvLinkCapability(cnvmlDevice, cLink, cCapability, cCapResult) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkRemotePciInfo_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkRemotePciInfo_v2(Device Device, Link uint32, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice nvmlDevice, Link uint32, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkRemotePciInfo_v2(cDevice, cLink, cPci) + __ret := C.nvmlDeviceGetNvLinkRemotePciInfo_v2(cnvmlDevice, cLink, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkErrorCounter function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkErrorCounter(Device Device, Link uint32, Counter NvLinkErrorCounter, CounterValue *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkErrorCounter(nvmlDevice nvmlDevice, Link uint32, Counter NvLinkErrorCounter, CounterValue *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.nvmlNvLinkErrorCounter_t)(Counter), cgoAllocsUnknown cCounterValue, _ := (*C.ulonglong)(unsafe.Pointer(CounterValue)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkErrorCounter(cDevice, cLink, cCounter, cCounterValue) + __ret := C.nvmlDeviceGetNvLinkErrorCounter(cnvmlDevice, cLink, cCounter, cCounterValue) __v := (Return)(__ret) return __v } // nvmlDeviceResetNvLinkErrorCounters function as declared in nvml/nvml.h -func nvmlDeviceResetNvLinkErrorCounters(Device Device, Link uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceResetNvLinkErrorCounters(nvmlDevice nvmlDevice, Link uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown - __ret := C.nvmlDeviceResetNvLinkErrorCounters(cDevice, cLink) + __ret := C.nvmlDeviceResetNvLinkErrorCounters(cnvmlDevice, cLink) __v := (Return)(__ret) return __v } // nvmlDeviceSetNvLinkUtilizationControl function as declared in nvml/nvml.h -func nvmlDeviceSetNvLinkUtilizationControl(Device Device, Link uint32, Counter uint32, Control *NvLinkUtilizationControl, Reset uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetNvLinkUtilizationControl(nvmlDevice nvmlDevice, Link uint32, Counter uint32, Control *NvLinkUtilizationControl, Reset uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown cControl, _ := (*C.nvmlNvLinkUtilizationControl_t)(unsafe.Pointer(Control)), cgoAllocsUnknown cReset, _ := (C.uint)(Reset), cgoAllocsUnknown - __ret := C.nvmlDeviceSetNvLinkUtilizationControl(cDevice, cLink, cCounter, cControl, cReset) + __ret := C.nvmlDeviceSetNvLinkUtilizationControl(cnvmlDevice, cLink, cCounter, cControl, cReset) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkUtilizationControl function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkUtilizationControl(Device Device, Link uint32, Counter uint32, Control *NvLinkUtilizationControl) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkUtilizationControl(nvmlDevice nvmlDevice, Link uint32, Counter uint32, Control *NvLinkUtilizationControl) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown cControl, _ := (*C.nvmlNvLinkUtilizationControl_t)(unsafe.Pointer(Control)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkUtilizationControl(cDevice, cLink, cCounter, cControl) + __ret := C.nvmlDeviceGetNvLinkUtilizationControl(cnvmlDevice, cLink, cCounter, cControl) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkUtilizationCounter function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkUtilizationCounter(Device Device, Link uint32, Counter uint32, Rxcounter *uint64, Txcounter *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkUtilizationCounter(nvmlDevice nvmlDevice, Link uint32, Counter uint32, Rxcounter *uint64, Txcounter *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown cRxcounter, _ := (*C.ulonglong)(unsafe.Pointer(Rxcounter)), cgoAllocsUnknown cTxcounter, _ := (*C.ulonglong)(unsafe.Pointer(Txcounter)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkUtilizationCounter(cDevice, cLink, cCounter, cRxcounter, cTxcounter) + __ret := C.nvmlDeviceGetNvLinkUtilizationCounter(cnvmlDevice, cLink, cCounter, cRxcounter, cTxcounter) __v := (Return)(__ret) return __v } // nvmlDeviceFreezeNvLinkUtilizationCounter function as declared in nvml/nvml.h -func nvmlDeviceFreezeNvLinkUtilizationCounter(Device Device, Link uint32, Counter uint32, Freeze EnableState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceFreezeNvLinkUtilizationCounter(nvmlDevice nvmlDevice, Link uint32, Counter uint32, Freeze EnableState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown cFreeze, _ := (C.nvmlEnableState_t)(Freeze), cgoAllocsUnknown - __ret := C.nvmlDeviceFreezeNvLinkUtilizationCounter(cDevice, cLink, cCounter, cFreeze) + __ret := C.nvmlDeviceFreezeNvLinkUtilizationCounter(cnvmlDevice, cLink, cCounter, cFreeze) __v := (Return)(__ret) return __v } // nvmlDeviceResetNvLinkUtilizationCounter function as declared in nvml/nvml.h -func nvmlDeviceResetNvLinkUtilizationCounter(Device Device, Link uint32, Counter uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceResetNvLinkUtilizationCounter(nvmlDevice nvmlDevice, Link uint32, Counter uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cCounter, _ := (C.uint)(Counter), cgoAllocsUnknown - __ret := C.nvmlDeviceResetNvLinkUtilizationCounter(cDevice, cLink, cCounter) + __ret := C.nvmlDeviceResetNvLinkUtilizationCounter(cnvmlDevice, cLink, cCounter) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkRemoteDeviceType function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkRemoteDeviceType(Device Device, Link uint32, PNvLinkDeviceType *IntNvLinkDeviceType) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice nvmlDevice, Link uint32, PNvLinkDeviceType *IntNvLinkDeviceType) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cPNvLinkDeviceType, _ := (*C.nvmlIntNvLinkDeviceType_t)(unsafe.Pointer(PNvLinkDeviceType)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkRemoteDeviceType(cDevice, cLink, cPNvLinkDeviceType) + __ret := C.nvmlDeviceGetNvLinkRemoteDeviceType(cnvmlDevice, cLink, cPNvLinkDeviceType) __v := (Return)(__ret) return __v } // nvmlEventSetCreate function as declared in nvml/nvml.h -func nvmlEventSetCreate(Set *EventSet) Return { +func nvmlEventSetCreate(Set *nvmlEventSet) Return { cSet, _ := (*C.nvmlEventSet_t)(unsafe.Pointer(Set)), cgoAllocsUnknown __ret := C.nvmlEventSetCreate(cSet) __v := (Return)(__ret) @@ -1640,26 +1640,26 @@ func nvmlEventSetCreate(Set *EventSet) Return { } // nvmlDeviceRegisterEvents function as declared in nvml/nvml.h -func nvmlDeviceRegisterEvents(Device Device, EventTypes uint64, Set EventSet) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceRegisterEvents(nvmlDevice nvmlDevice, EventTypes uint64, Set nvmlEventSet) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEventTypes, _ := (C.ulonglong)(EventTypes), cgoAllocsUnknown cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown - __ret := C.nvmlDeviceRegisterEvents(cDevice, cEventTypes, cSet) + __ret := C.nvmlDeviceRegisterEvents(cnvmlDevice, cEventTypes, cSet) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedEventTypes function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedEventTypes(Device Device, EventTypes *uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedEventTypes(nvmlDevice nvmlDevice, EventTypes *uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cEventTypes, _ := (*C.ulonglong)(unsafe.Pointer(EventTypes)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedEventTypes(cDevice, cEventTypes) + __ret := C.nvmlDeviceGetSupportedEventTypes(cnvmlDevice, cEventTypes) __v := (Return)(__ret) return __v } // nvmlEventSetWait_v2 function as declared in nvml/nvml.h -func nvmlEventSetWait_v2(Set EventSet, Data *EventData, Timeoutms uint32) Return { +func nvmlEventSetWait_v2(Set nvmlEventSet, Data *nvmlEventData, Timeoutms uint32) Return { cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown cData, _ := (*C.nvmlEventData_t)(unsafe.Pointer(Data)), cgoAllocsUnknown cTimeoutms, _ := (C.uint)(Timeoutms), cgoAllocsUnknown @@ -1669,7 +1669,7 @@ func nvmlEventSetWait_v2(Set EventSet, Data *EventData, Timeoutms uint32) Return } // nvmlEventSetFree function as declared in nvml/nvml.h -func nvmlEventSetFree(Set EventSet) Return { +func nvmlEventSetFree(Set nvmlEventSet) Return { cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown __ret := C.nvmlEventSetFree(cSet) __v := (Return)(__ret) @@ -1713,87 +1713,87 @@ func nvmlDeviceDiscoverGpus(PciInfo *PciInfo) Return { } // nvmlDeviceGetFieldValues function as declared in nvml/nvml.h -func nvmlDeviceGetFieldValues(Device Device, ValuesCount int32, Values *FieldValue) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetFieldValues(nvmlDevice nvmlDevice, ValuesCount int32, Values *FieldValue) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cValuesCount, _ := (C.int)(ValuesCount), cgoAllocsUnknown cValues, _ := (*C.nvmlFieldValue_t)(unsafe.Pointer(Values)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetFieldValues(cDevice, cValuesCount, cValues) + __ret := C.nvmlDeviceGetFieldValues(cnvmlDevice, cValuesCount, cValues) __v := (Return)(__ret) return __v } // nvmlDeviceClearFieldValues function as declared in nvml/nvml.h -func nvmlDeviceClearFieldValues(Device Device, ValuesCount int32, Values *FieldValue) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceClearFieldValues(nvmlDevice nvmlDevice, ValuesCount int32, Values *FieldValue) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cValuesCount, _ := (C.int)(ValuesCount), cgoAllocsUnknown cValues, _ := (*C.nvmlFieldValue_t)(unsafe.Pointer(Values)), cgoAllocsUnknown - __ret := C.nvmlDeviceClearFieldValues(cDevice, cValuesCount, cValues) + __ret := C.nvmlDeviceClearFieldValues(cnvmlDevice, cValuesCount, cValues) __v := (Return)(__ret) return __v } // nvmlDeviceGetVirtualizationMode function as declared in nvml/nvml.h -func nvmlDeviceGetVirtualizationMode(Device Device, PVirtualMode *GpuVirtualizationMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVirtualizationMode(nvmlDevice nvmlDevice, PVirtualMode *GpuVirtualizationMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPVirtualMode, _ := (*C.nvmlGpuVirtualizationMode_t)(unsafe.Pointer(PVirtualMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVirtualizationMode(cDevice, cPVirtualMode) + __ret := C.nvmlDeviceGetVirtualizationMode(cnvmlDevice, cPVirtualMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetHostVgpuMode function as declared in nvml/nvml.h -func nvmlDeviceGetHostVgpuMode(Device Device, PHostVgpuMode *HostVgpuMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetHostVgpuMode(nvmlDevice nvmlDevice, PHostVgpuMode *HostVgpuMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPHostVgpuMode, _ := (*C.nvmlHostVgpuMode_t)(unsafe.Pointer(PHostVgpuMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHostVgpuMode(cDevice, cPHostVgpuMode) + __ret := C.nvmlDeviceGetHostVgpuMode(cnvmlDevice, cPHostVgpuMode) __v := (Return)(__ret) return __v } // nvmlDeviceSetVirtualizationMode function as declared in nvml/nvml.h -func nvmlDeviceSetVirtualizationMode(Device Device, VirtualMode GpuVirtualizationMode) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetVirtualizationMode(nvmlDevice nvmlDevice, VirtualMode GpuVirtualizationMode) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVirtualMode, _ := (C.nvmlGpuVirtualizationMode_t)(VirtualMode), cgoAllocsUnknown - __ret := C.nvmlDeviceSetVirtualizationMode(cDevice, cVirtualMode) + __ret := C.nvmlDeviceSetVirtualizationMode(cnvmlDevice, cVirtualMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetGridLicensableFeatures_v4 function as declared in nvml/nvml.h -func nvmlDeviceGetGridLicensableFeatures_v4(Device Device, PGridLicensableFeatures *GridLicensableFeatures) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice nvmlDevice, PGridLicensableFeatures *GridLicensableFeatures) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPGridLicensableFeatures, _ := (*C.nvmlGridLicensableFeatures_t)(unsafe.Pointer(PGridLicensableFeatures)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGridLicensableFeatures_v4(cDevice, cPGridLicensableFeatures) + __ret := C.nvmlDeviceGetGridLicensableFeatures_v4(cnvmlDevice, cPGridLicensableFeatures) __v := (Return)(__ret) return __v } // nvmlDeviceGetProcessUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetProcessUtilization(Device Device, Utilization *ProcessUtilizationSample, ProcessSamplesCount *uint32, LastSeenTimeStamp uint64) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetProcessUtilization(nvmlDevice nvmlDevice, Utilization *ProcessUtilizationSample, ProcessSamplesCount *uint32, LastSeenTimeStamp uint64) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cUtilization, _ := (*C.nvmlProcessUtilizationSample_t)(unsafe.Pointer(Utilization)), cgoAllocsUnknown cProcessSamplesCount, _ := (*C.uint)(unsafe.Pointer(ProcessSamplesCount)), cgoAllocsUnknown cLastSeenTimeStamp, _ := (C.ulonglong)(LastSeenTimeStamp), cgoAllocsUnknown - __ret := C.nvmlDeviceGetProcessUtilization(cDevice, cUtilization, cProcessSamplesCount, cLastSeenTimeStamp) + __ret := C.nvmlDeviceGetProcessUtilization(cnvmlDevice, cUtilization, cProcessSamplesCount, cLastSeenTimeStamp) __v := (Return)(__ret) return __v } // nvmlDeviceGetGspFirmwareVersion function as declared in nvml/nvml.h -func nvmlDeviceGetGspFirmwareVersion(Device Device, Version *byte) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGspFirmwareVersion(nvmlDevice nvmlDevice, Version *byte) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGspFirmwareVersion(cDevice, cVersion) + __ret := C.nvmlDeviceGetGspFirmwareVersion(cnvmlDevice, cVersion) __v := (Return)(__ret) return __v } // nvmlDeviceGetGspFirmwareMode function as declared in nvml/nvml.h -func nvmlDeviceGetGspFirmwareMode(Device Device, IsEnabled *uint32, DefaultMode *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGspFirmwareMode(nvmlDevice nvmlDevice, IsEnabled *uint32, DefaultMode *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsEnabled, _ := (*C.uint)(unsafe.Pointer(IsEnabled)), cgoAllocsUnknown cDefaultMode, _ := (*C.uint)(unsafe.Pointer(DefaultMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGspFirmwareMode(cDevice, cIsEnabled, cDefaultMode) + __ret := C.nvmlDeviceGetGspFirmwareMode(cnvmlDevice, cIsEnabled, cDefaultMode) __v := (Return)(__ret) return __v } @@ -1808,330 +1808,330 @@ func nvmlGetVgpuDriverCapabilities(Capability VgpuDriverCapability, CapResult *u } // nvmlDeviceGetVgpuCapabilities function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuCapabilities(Device Device, Capability DeviceVgpuCapability, CapResult *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuCapabilities(nvmlDevice nvmlDevice, Capability DeviceVgpuCapability, CapResult *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCapability, _ := (C.nvmlDeviceVgpuCapability_t)(Capability), cgoAllocsUnknown cCapResult, _ := (*C.uint)(unsafe.Pointer(CapResult)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuCapabilities(cDevice, cCapability, cCapResult) + __ret := C.nvmlDeviceGetVgpuCapabilities(cnvmlDevice, cCapability, cCapResult) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedVgpus(Device Device, VgpuCount *uint32, VgpuTypeIds *VgpuTypeId) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuTypeIds *nvmlVgpuTypeId) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVgpuCount, _ := (*C.uint)(unsafe.Pointer(VgpuCount)), cgoAllocsUnknown cVgpuTypeIds, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(VgpuTypeIds)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedVgpus(cDevice, cVgpuCount, cVgpuTypeIds) + __ret := C.nvmlDeviceGetSupportedVgpus(cnvmlDevice, cVgpuCount, cVgpuTypeIds) __v := (Return)(__ret) return __v } // nvmlDeviceGetCreatableVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetCreatableVgpus(Device Device, VgpuCount *uint32, VgpuTypeIds *VgpuTypeId) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetCreatableVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuTypeIds *nvmlVgpuTypeId) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVgpuCount, _ := (*C.uint)(unsafe.Pointer(VgpuCount)), cgoAllocsUnknown cVgpuTypeIds, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(VgpuTypeIds)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetCreatableVgpus(cDevice, cVgpuCount, cVgpuTypeIds) + __ret := C.nvmlDeviceGetCreatableVgpus(cnvmlDevice, cVgpuCount, cVgpuTypeIds) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetClass function as declared in nvml/nvml.h -func nvmlVgpuTypeGetClass(VgpuTypeId VgpuTypeId, VgpuTypeClass *byte, Size *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetClass(nvmlVgpuTypeId nvmlVgpuTypeId, VgpuTypeClass *byte, Size *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuTypeClass, _ := (*C.char)(unsafe.Pointer(VgpuTypeClass)), cgoAllocsUnknown cSize, _ := (*C.uint)(unsafe.Pointer(Size)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetClass(cVgpuTypeId, cVgpuTypeClass, cSize) + __ret := C.nvmlVgpuTypeGetClass(cnvmlVgpuTypeId, cVgpuTypeClass, cSize) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetName function as declared in nvml/nvml.h -func nvmlVgpuTypeGetName(VgpuTypeId VgpuTypeId, VgpuTypeName *byte, Size *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetName(nvmlVgpuTypeId nvmlVgpuTypeId, VgpuTypeName *byte, Size *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuTypeName, _ := (*C.char)(unsafe.Pointer(VgpuTypeName)), cgoAllocsUnknown cSize, _ := (*C.uint)(unsafe.Pointer(Size)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetName(cVgpuTypeId, cVgpuTypeName, cSize) + __ret := C.nvmlVgpuTypeGetName(cnvmlVgpuTypeId, cVgpuTypeName, cSize) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetGpuInstanceProfileId function as declared in nvml/nvml.h -func nvmlVgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId, GpuInstanceProfileId *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId nvmlVgpuTypeId, GpuInstanceProfileId *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cGpuInstanceProfileId, _ := (*C.uint)(unsafe.Pointer(GpuInstanceProfileId)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetGpuInstanceProfileId(cVgpuTypeId, cGpuInstanceProfileId) + __ret := C.nvmlVgpuTypeGetGpuInstanceProfileId(cnvmlVgpuTypeId, cGpuInstanceProfileId) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetDeviceID function as declared in nvml/nvml.h -func nvmlVgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId, DeviceID *uint64, SubsystemID *uint64) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId nvmlVgpuTypeId, DeviceID *uint64, SubsystemID *uint64) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cDeviceID, _ := (*C.ulonglong)(unsafe.Pointer(DeviceID)), cgoAllocsUnknown cSubsystemID, _ := (*C.ulonglong)(unsafe.Pointer(SubsystemID)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetDeviceID(cVgpuTypeId, cDeviceID, cSubsystemID) + __ret := C.nvmlVgpuTypeGetDeviceID(cnvmlVgpuTypeId, cDeviceID, cSubsystemID) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetFramebufferSize function as declared in nvml/nvml.h -func nvmlVgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId, FbSize *uint64) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId nvmlVgpuTypeId, FbSize *uint64) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cFbSize, _ := (*C.ulonglong)(unsafe.Pointer(FbSize)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetFramebufferSize(cVgpuTypeId, cFbSize) + __ret := C.nvmlVgpuTypeGetFramebufferSize(cnvmlVgpuTypeId, cFbSize) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetNumDisplayHeads function as declared in nvml/nvml.h -func nvmlVgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId, NumDisplayHeads *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId nvmlVgpuTypeId, NumDisplayHeads *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cNumDisplayHeads, _ := (*C.uint)(unsafe.Pointer(NumDisplayHeads)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetNumDisplayHeads(cVgpuTypeId, cNumDisplayHeads) + __ret := C.nvmlVgpuTypeGetNumDisplayHeads(cnvmlVgpuTypeId, cNumDisplayHeads) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetResolution function as declared in nvml/nvml.h -func nvmlVgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex uint32, Xdim *uint32, Ydim *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetResolution(nvmlVgpuTypeId nvmlVgpuTypeId, DisplayIndex uint32, Xdim *uint32, Ydim *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cDisplayIndex, _ := (C.uint)(DisplayIndex), cgoAllocsUnknown cXdim, _ := (*C.uint)(unsafe.Pointer(Xdim)), cgoAllocsUnknown cYdim, _ := (*C.uint)(unsafe.Pointer(Ydim)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetResolution(cVgpuTypeId, cDisplayIndex, cXdim, cYdim) + __ret := C.nvmlVgpuTypeGetResolution(cnvmlVgpuTypeId, cDisplayIndex, cXdim, cYdim) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetLicense function as declared in nvml/nvml.h -func nvmlVgpuTypeGetLicense(VgpuTypeId VgpuTypeId, VgpuTypeLicenseString *byte, Size uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetLicense(nvmlVgpuTypeId nvmlVgpuTypeId, VgpuTypeLicenseString *byte, Size uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuTypeLicenseString, _ := (*C.char)(unsafe.Pointer(VgpuTypeLicenseString)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetLicense(cVgpuTypeId, cVgpuTypeLicenseString, cSize) + __ret := C.nvmlVgpuTypeGetLicense(cnvmlVgpuTypeId, cVgpuTypeLicenseString, cSize) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetFrameRateLimit function as declared in nvml/nvml.h -func nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId, FrameRateLimit *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId nvmlVgpuTypeId, FrameRateLimit *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cFrameRateLimit, _ := (*C.uint)(unsafe.Pointer(FrameRateLimit)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetFrameRateLimit(cVgpuTypeId, cFrameRateLimit) + __ret := C.nvmlVgpuTypeGetFrameRateLimit(cnvmlVgpuTypeId, cFrameRateLimit) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetMaxInstances function as declared in nvml/nvml.h -func nvmlVgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId, VgpuInstanceCount *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetMaxInstances(nvmlDevice nvmlDevice, nvmlVgpuTypeId nvmlVgpuTypeId, VgpuInstanceCount *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuInstanceCount, _ := (*C.uint)(unsafe.Pointer(VgpuInstanceCount)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetMaxInstances(cDevice, cVgpuTypeId, cVgpuInstanceCount) + __ret := C.nvmlVgpuTypeGetMaxInstances(cnvmlDevice, cnvmlVgpuTypeId, cVgpuInstanceCount) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetMaxInstancesPerVm function as declared in nvml/nvml.h -func nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId, VgpuInstanceCountPerVm *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId nvmlVgpuTypeId, VgpuInstanceCountPerVm *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cVgpuInstanceCountPerVm, _ := (*C.uint)(unsafe.Pointer(VgpuInstanceCountPerVm)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetMaxInstancesPerVm(cVgpuTypeId, cVgpuInstanceCountPerVm) + __ret := C.nvmlVgpuTypeGetMaxInstancesPerVm(cnvmlVgpuTypeId, cVgpuInstanceCountPerVm) __v := (Return)(__ret) return __v } // nvmlDeviceGetActiveVgpus function as declared in nvml/nvml.h -func nvmlDeviceGetActiveVgpus(Device Device, VgpuCount *uint32, VgpuInstances *VgpuInstance) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetActiveVgpus(nvmlDevice nvmlDevice, VgpuCount *uint32, VgpuInstances *nvmlVgpuInstance) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cVgpuCount, _ := (*C.uint)(unsafe.Pointer(VgpuCount)), cgoAllocsUnknown cVgpuInstances, _ := (*C.nvmlVgpuInstance_t)(unsafe.Pointer(VgpuInstances)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetActiveVgpus(cDevice, cVgpuCount, cVgpuInstances) + __ret := C.nvmlDeviceGetActiveVgpus(cnvmlDevice, cVgpuCount, cVgpuInstances) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetVmID function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetVmID(VgpuInstance VgpuInstance, VmId *byte, Size uint32, VmIdType *VgpuVmIdType) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetVmID(nvmlVgpuInstance nvmlVgpuInstance, VmId *byte, Size uint32, VmIdType *VgpuVmIdType) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cVmId, _ := (*C.char)(unsafe.Pointer(VmId)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown cVmIdType, _ := (*C.nvmlVgpuVmIdType_t)(unsafe.Pointer(VmIdType)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetVmID(cVgpuInstance, cVmId, cSize, cVmIdType) + __ret := C.nvmlVgpuInstanceGetVmID(cnvmlVgpuInstance, cVmId, cSize, cVmIdType) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetUUID function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetUUID(VgpuInstance VgpuInstance, Uuid *byte, Size uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetUUID(nvmlVgpuInstance nvmlVgpuInstance, Uuid *byte, Size uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cUuid, _ := (*C.char)(unsafe.Pointer(Uuid)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetUUID(cVgpuInstance, cUuid, cSize) + __ret := C.nvmlVgpuInstanceGetUUID(cnvmlVgpuInstance, cUuid, cSize) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetVmDriverVersion function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance, Version *byte, Length uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance nvmlVgpuInstance, Version *byte, Length uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown cLength, _ := (C.uint)(Length), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetVmDriverVersion(cVgpuInstance, cVersion, cLength) + __ret := C.nvmlVgpuInstanceGetVmDriverVersion(cnvmlVgpuInstance, cVersion, cLength) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetFbUsage function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetFbUsage(VgpuInstance VgpuInstance, FbUsage *uint64) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance nvmlVgpuInstance, FbUsage *uint64) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cFbUsage, _ := (*C.ulonglong)(unsafe.Pointer(FbUsage)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetFbUsage(cVgpuInstance, cFbUsage) + __ret := C.nvmlVgpuInstanceGetFbUsage(cnvmlVgpuInstance, cFbUsage) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetLicenseStatus function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance, Licensed *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance nvmlVgpuInstance, Licensed *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cLicensed, _ := (*C.uint)(unsafe.Pointer(Licensed)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetLicenseStatus(cVgpuInstance, cLicensed) + __ret := C.nvmlVgpuInstanceGetLicenseStatus(cnvmlVgpuInstance, cLicensed) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetType function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetType(VgpuInstance VgpuInstance, VgpuTypeId *VgpuTypeId) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown - cVgpuTypeId, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(VgpuTypeId)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetType(cVgpuInstance, cVgpuTypeId) +func nvmlVgpuInstanceGetType(nvmlVgpuInstance nvmlVgpuInstance, nvmlVgpuTypeId *nvmlVgpuTypeId) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown + cnvmlVgpuTypeId, _ := (*C.nvmlVgpuTypeId_t)(unsafe.Pointer(nvmlVgpuTypeId)), cgoAllocsUnknown + __ret := C.nvmlVgpuInstanceGetType(cnvmlVgpuInstance, cnvmlVgpuTypeId) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetFrameRateLimit function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance, FrameRateLimit *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance nvmlVgpuInstance, FrameRateLimit *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cFrameRateLimit, _ := (*C.uint)(unsafe.Pointer(FrameRateLimit)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetFrameRateLimit(cVgpuInstance, cFrameRateLimit) + __ret := C.nvmlVgpuInstanceGetFrameRateLimit(cnvmlVgpuInstance, cFrameRateLimit) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetEccMode function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetEccMode(VgpuInstance VgpuInstance, EccMode *EnableState) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance nvmlVgpuInstance, EccMode *EnableState) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cEccMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(EccMode)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetEccMode(cVgpuInstance, cEccMode) + __ret := C.nvmlVgpuInstanceGetEccMode(cnvmlVgpuInstance, cEccMode) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetEncoderCapacity function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance nvmlVgpuInstance, EncoderCapacity *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cEncoderCapacity, _ := (*C.uint)(unsafe.Pointer(EncoderCapacity)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetEncoderCapacity(cVgpuInstance, cEncoderCapacity) + __ret := C.nvmlVgpuInstanceGetEncoderCapacity(cnvmlVgpuInstance, cEncoderCapacity) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceSetEncoderCapacity function as declared in nvml/nvml.h -func nvmlVgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance nvmlVgpuInstance, EncoderCapacity uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cEncoderCapacity, _ := (C.uint)(EncoderCapacity), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceSetEncoderCapacity(cVgpuInstance, cEncoderCapacity) + __ret := C.nvmlVgpuInstanceSetEncoderCapacity(cnvmlVgpuInstance, cEncoderCapacity) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetEncoderStats function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance, SessionCount *uint32, AverageFps *uint32, AverageLatency *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance nvmlVgpuInstance, SessionCount *uint32, AverageFps *uint32, AverageLatency *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cAverageFps, _ := (*C.uint)(unsafe.Pointer(AverageFps)), cgoAllocsUnknown cAverageLatency, _ := (*C.uint)(unsafe.Pointer(AverageLatency)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetEncoderStats(cVgpuInstance, cSessionCount, cAverageFps, cAverageLatency) + __ret := C.nvmlVgpuInstanceGetEncoderStats(cnvmlVgpuInstance, cSessionCount, cAverageFps, cAverageLatency) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetEncoderSessions function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance, SessionCount *uint32, SessionInfo *EncoderSessionInfo) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance nvmlVgpuInstance, SessionCount *uint32, SessionInfo *EncoderSessionInfo) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cSessionInfo, _ := (*C.nvmlEncoderSessionInfo_t)(unsafe.Pointer(SessionInfo)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetEncoderSessions(cVgpuInstance, cSessionCount, cSessionInfo) + __ret := C.nvmlVgpuInstanceGetEncoderSessions(cnvmlVgpuInstance, cSessionCount, cSessionInfo) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetFBCStats function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetFBCStats(VgpuInstance VgpuInstance, FbcStats *FBCStats) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance nvmlVgpuInstance, FbcStats *FBCStats) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cFbcStats, _ := (*C.nvmlFBCStats_t)(unsafe.Pointer(FbcStats)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetFBCStats(cVgpuInstance, cFbcStats) + __ret := C.nvmlVgpuInstanceGetFBCStats(cnvmlVgpuInstance, cFbcStats) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetFBCSessions function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance, SessionCount *uint32, SessionInfo *FBCSessionInfo) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance nvmlVgpuInstance, SessionCount *uint32, SessionInfo *FBCSessionInfo) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cSessionCount, _ := (*C.uint)(unsafe.Pointer(SessionCount)), cgoAllocsUnknown cSessionInfo, _ := (*C.nvmlFBCSessionInfo_t)(unsafe.Pointer(SessionInfo)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetFBCSessions(cVgpuInstance, cSessionCount, cSessionInfo) + __ret := C.nvmlVgpuInstanceGetFBCSessions(cnvmlVgpuInstance, cSessionCount, cSessionInfo) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetGpuInstanceId function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance, GpuInstanceId *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance nvmlVgpuInstance, GpuInstanceId *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cGpuInstanceId, _ := (*C.uint)(unsafe.Pointer(GpuInstanceId)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetGpuInstanceId(cVgpuInstance, cGpuInstanceId) + __ret := C.nvmlVgpuInstanceGetGpuInstanceId(cnvmlVgpuInstance, cGpuInstanceId) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetGpuPciId function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance, VgpuPciId *byte, Length *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance nvmlVgpuInstance, VgpuPciId *byte, Length *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cVgpuPciId, _ := (*C.char)(unsafe.Pointer(VgpuPciId)), cgoAllocsUnknown cLength, _ := (*C.uint)(unsafe.Pointer(Length)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetGpuPciId(cVgpuInstance, cVgpuPciId, cLength) + __ret := C.nvmlVgpuInstanceGetGpuPciId(cnvmlVgpuInstance, cVgpuPciId, cLength) __v := (Return)(__ret) return __v } // nvmlVgpuTypeGetCapabilities function as declared in nvml/nvml.h -func nvmlVgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability, CapResult *uint32) Return { - cVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(VgpuTypeId), cgoAllocsUnknown +func nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId nvmlVgpuTypeId, Capability VgpuCapability, CapResult *uint32) Return { + cnvmlVgpuTypeId, _ := (C.nvmlVgpuTypeId_t)(nvmlVgpuTypeId), cgoAllocsUnknown cCapability, _ := (C.nvmlVgpuCapability_t)(Capability), cgoAllocsUnknown cCapResult, _ := (*C.uint)(unsafe.Pointer(CapResult)), cgoAllocsUnknown - __ret := C.nvmlVgpuTypeGetCapabilities(cVgpuTypeId, cCapability, cCapResult) + __ret := C.nvmlVgpuTypeGetCapabilities(cnvmlVgpuTypeId, cCapability, cCapResult) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetMetadata function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetMetadata(VgpuInstance VgpuInstance, nvmlVgpuMetadata *nvmlVgpuMetadata, BufferSize *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance nvmlVgpuInstance, nvmlVgpuMetadata *nvmlVgpuMetadata, BufferSize *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cnvmlVgpuMetadata, _ := (*C.nvmlVgpuMetadata_t)(unsafe.Pointer(nvmlVgpuMetadata)), cgoAllocsUnknown cBufferSize, _ := (*C.uint)(unsafe.Pointer(BufferSize)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetMetadata(cVgpuInstance, cnvmlVgpuMetadata, cBufferSize) + __ret := C.nvmlVgpuInstanceGetMetadata(cnvmlVgpuInstance, cnvmlVgpuMetadata, cBufferSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuMetadata function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuMetadata(Device Device, PgpuMetadata *nvmlVgpuPgpuMetadata, BufferSize *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuMetadata(nvmlDevice nvmlDevice, PgpuMetadata *nvmlVgpuPgpuMetadata, BufferSize *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPgpuMetadata, _ := (*C.nvmlVgpuPgpuMetadata_t)(unsafe.Pointer(PgpuMetadata)), cgoAllocsUnknown cBufferSize, _ := (*C.uint)(unsafe.Pointer(BufferSize)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuMetadata(cDevice, cPgpuMetadata, cBufferSize) + __ret := C.nvmlDeviceGetVgpuMetadata(cnvmlDevice, cPgpuMetadata, cBufferSize) __v := (Return)(__ret) return __v } @@ -2147,47 +2147,47 @@ func nvmlGetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata * } // nvmlDeviceGetPgpuMetadataString function as declared in nvml/nvml.h -func nvmlDeviceGetPgpuMetadataString(Device Device, PgpuMetadata *byte, BufferSize *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPgpuMetadataString(nvmlDevice nvmlDevice, PgpuMetadata *byte, BufferSize *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPgpuMetadata, _ := (*C.char)(unsafe.Pointer(PgpuMetadata)), cgoAllocsUnknown cBufferSize, _ := (*C.uint)(unsafe.Pointer(BufferSize)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPgpuMetadataString(cDevice, cPgpuMetadata, cBufferSize) + __ret := C.nvmlDeviceGetPgpuMetadataString(cnvmlDevice, cPgpuMetadata, cBufferSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuSchedulerLog function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuSchedulerLog(Device Device, PSchedulerLog *VgpuSchedulerLog) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuSchedulerLog(nvmlDevice nvmlDevice, PSchedulerLog *VgpuSchedulerLog) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPSchedulerLog, _ := (*C.nvmlVgpuSchedulerLog_t)(unsafe.Pointer(PSchedulerLog)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuSchedulerLog(cDevice, cPSchedulerLog) + __ret := C.nvmlDeviceGetVgpuSchedulerLog(cnvmlDevice, cPSchedulerLog) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuSchedulerState function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerGetState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuSchedulerState(nvmlDevice nvmlDevice, PSchedulerState *VgpuSchedulerGetState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPSchedulerState, _ := (*C.nvmlVgpuSchedulerGetState_t)(unsafe.Pointer(PSchedulerState)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuSchedulerState(cDevice, cPSchedulerState) + __ret := C.nvmlDeviceGetVgpuSchedulerState(cnvmlDevice, cPSchedulerState) __v := (Return)(__ret) return __v } // nvmlDeviceSetVgpuSchedulerState function as declared in nvml/nvml.h -func nvmlDeviceSetVgpuSchedulerState(Device Device, PSchedulerState *VgpuSchedulerSetState) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetVgpuSchedulerState(nvmlDevice nvmlDevice, PSchedulerState *VgpuSchedulerSetState) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPSchedulerState, _ := (*C.nvmlVgpuSchedulerSetState_t)(unsafe.Pointer(PSchedulerState)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetVgpuSchedulerState(cDevice, cPSchedulerState) + __ret := C.nvmlDeviceSetVgpuSchedulerState(cnvmlDevice, cPSchedulerState) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuSchedulerCapabilities function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuSchedulerCapabilities(Device Device, PCapabilities *VgpuSchedulerCapabilities) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice nvmlDevice, PCapabilities *VgpuSchedulerCapabilities) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPCapabilities, _ := (*C.nvmlVgpuSchedulerCapabilities_t)(unsafe.Pointer(PCapabilities)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuSchedulerCapabilities(cDevice, cPCapabilities) + __ret := C.nvmlDeviceGetVgpuSchedulerCapabilities(cnvmlDevice, cPCapabilities) __v := (Return)(__ret) return __v } @@ -2210,70 +2210,70 @@ func nvmlSetVgpuVersion(VgpuVersion *VgpuVersion) Return { } // nvmlDeviceGetVgpuUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuUtilization(Device Device, LastSeenTimeStamp uint64, SampleValType *ValueType, VgpuInstanceSamplesCount *uint32, UtilizationSamples *VgpuInstanceUtilizationSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuUtilization(nvmlDevice nvmlDevice, LastSeenTimeStamp uint64, SampleValType *ValueType, VgpuInstanceSamplesCount *uint32, UtilizationSamples *VgpuInstanceUtilizationSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLastSeenTimeStamp, _ := (C.ulonglong)(LastSeenTimeStamp), cgoAllocsUnknown cSampleValType, _ := (*C.nvmlValueType_t)(unsafe.Pointer(SampleValType)), cgoAllocsUnknown cVgpuInstanceSamplesCount, _ := (*C.uint)(unsafe.Pointer(VgpuInstanceSamplesCount)), cgoAllocsUnknown cUtilizationSamples, _ := (*C.nvmlVgpuInstanceUtilizationSample_t)(unsafe.Pointer(UtilizationSamples)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuUtilization(cDevice, cLastSeenTimeStamp, cSampleValType, cVgpuInstanceSamplesCount, cUtilizationSamples) + __ret := C.nvmlDeviceGetVgpuUtilization(cnvmlDevice, cLastSeenTimeStamp, cSampleValType, cVgpuInstanceSamplesCount, cUtilizationSamples) __v := (Return)(__ret) return __v } // nvmlDeviceGetVgpuProcessUtilization function as declared in nvml/nvml.h -func nvmlDeviceGetVgpuProcessUtilization(Device Device, LastSeenTimeStamp uint64, VgpuProcessSamplesCount *uint32, UtilizationSamples *VgpuProcessUtilizationSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetVgpuProcessUtilization(nvmlDevice nvmlDevice, LastSeenTimeStamp uint64, VgpuProcessSamplesCount *uint32, UtilizationSamples *VgpuProcessUtilizationSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLastSeenTimeStamp, _ := (C.ulonglong)(LastSeenTimeStamp), cgoAllocsUnknown cVgpuProcessSamplesCount, _ := (*C.uint)(unsafe.Pointer(VgpuProcessSamplesCount)), cgoAllocsUnknown cUtilizationSamples, _ := (*C.nvmlVgpuProcessUtilizationSample_t)(unsafe.Pointer(UtilizationSamples)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetVgpuProcessUtilization(cDevice, cLastSeenTimeStamp, cVgpuProcessSamplesCount, cUtilizationSamples) + __ret := C.nvmlDeviceGetVgpuProcessUtilization(cnvmlDevice, cLastSeenTimeStamp, cVgpuProcessSamplesCount, cUtilizationSamples) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetAccountingMode function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance, Mode *EnableState) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance nvmlVgpuInstance, Mode *EnableState) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cMode, _ := (*C.nvmlEnableState_t)(unsafe.Pointer(Mode)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetAccountingMode(cVgpuInstance, cMode) + __ret := C.nvmlVgpuInstanceGetAccountingMode(cnvmlVgpuInstance, cMode) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetAccountingPids function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance, Count *uint32, Pids *uint32) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance nvmlVgpuInstance, Count *uint32, Pids *uint32) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown cPids, _ := (*C.uint)(unsafe.Pointer(Pids)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetAccountingPids(cVgpuInstance, cCount, cPids) + __ret := C.nvmlVgpuInstanceGetAccountingPids(cnvmlVgpuInstance, cCount, cPids) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetAccountingStats function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid uint32, Stats *AccountingStats) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance nvmlVgpuInstance, Pid uint32, Stats *AccountingStats) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cPid, _ := (C.uint)(Pid), cgoAllocsUnknown cStats, _ := (*C.nvmlAccountingStats_t)(unsafe.Pointer(Stats)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetAccountingStats(cVgpuInstance, cPid, cStats) + __ret := C.nvmlVgpuInstanceGetAccountingStats(cnvmlVgpuInstance, cPid, cStats) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceClearAccountingPids function as declared in nvml/nvml.h -func nvmlVgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceClearAccountingPids(cVgpuInstance) +func nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance nvmlVgpuInstance) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown + __ret := C.nvmlVgpuInstanceClearAccountingPids(cnvmlVgpuInstance) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetLicenseInfo_v2 function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetLicenseInfo_v2(VgpuInstance VgpuInstance, LicenseInfo *VgpuLicenseInfo) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance nvmlVgpuInstance, LicenseInfo *VgpuLicenseInfo) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cLicenseInfo, _ := (*C.nvmlVgpuLicenseInfo_t)(unsafe.Pointer(LicenseInfo)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetLicenseInfo_v2(cVgpuInstance, cLicenseInfo) + __ret := C.nvmlVgpuInstanceGetLicenseInfo_v2(cnvmlVgpuInstance, cLicenseInfo) __v := (Return)(__ret) return __v } @@ -2296,399 +2296,399 @@ func nvmlGetExcludedDeviceInfoByIndex(Index uint32, Info *ExcludedDeviceInfo) Re } // nvmlDeviceSetMigMode function as declared in nvml/nvml.h -func nvmlDeviceSetMigMode(Device Device, Mode uint32, ActivationStatus *Return) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetMigMode(nvmlDevice nvmlDevice, Mode uint32, ActivationStatus *Return) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMode, _ := (C.uint)(Mode), cgoAllocsUnknown cActivationStatus, _ := (*C.nvmlReturn_t)(unsafe.Pointer(ActivationStatus)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetMigMode(cDevice, cMode, cActivationStatus) + __ret := C.nvmlDeviceSetMigMode(cnvmlDevice, cMode, cActivationStatus) __v := (Return)(__ret) return __v } // nvmlDeviceGetMigMode function as declared in nvml/nvml.h -func nvmlDeviceGetMigMode(Device Device, CurrentMode *uint32, PendingMode *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMigMode(nvmlDevice nvmlDevice, CurrentMode *uint32, PendingMode *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCurrentMode, _ := (*C.uint)(unsafe.Pointer(CurrentMode)), cgoAllocsUnknown cPendingMode, _ := (*C.uint)(unsafe.Pointer(PendingMode)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMigMode(cDevice, cCurrentMode, cPendingMode) + __ret := C.nvmlDeviceGetMigMode(cnvmlDevice, cCurrentMode, cPendingMode) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceProfileInfo function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceProfileInfo(Device Device, Profile uint32, Info *GpuInstanceProfileInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceProfileInfo(nvmlDevice nvmlDevice, Profile uint32, Info *GpuInstanceProfileInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfile, _ := (C.uint)(Profile), cgoAllocsUnknown cInfo, _ := (*C.nvmlGpuInstanceProfileInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceProfileInfo(cDevice, cProfile, cInfo) + __ret := C.nvmlDeviceGetGpuInstanceProfileInfo(cnvmlDevice, cProfile, cInfo) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceProfileInfoV function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceProfileInfoV(Device Device, Profile uint32, Info *GpuInstanceProfileInfo_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice nvmlDevice, Profile uint32, Info *GpuInstanceProfileInfo_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfile, _ := (C.uint)(Profile), cgoAllocsUnknown cInfo, _ := (*C.nvmlGpuInstanceProfileInfo_v2_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceProfileInfoV(cDevice, cProfile, cInfo) + __ret := C.nvmlDeviceGetGpuInstanceProfileInfoV(cnvmlDevice, cProfile, cInfo) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstancePossiblePlacements_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstancePossiblePlacements_v2(Device Device, ProfileId uint32, Placements *GpuInstancePlacement, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice nvmlDevice, ProfileId uint32, Placements *GpuInstancePlacement, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacements, _ := (*C.nvmlGpuInstancePlacement_t)(unsafe.Pointer(Placements)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstancePossiblePlacements_v2(cDevice, cProfileId, cPlacements, cCount) + __ret := C.nvmlDeviceGetGpuInstancePossiblePlacements_v2(cnvmlDevice, cProfileId, cPlacements, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceRemainingCapacity function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceRemainingCapacity(Device Device, ProfileId uint32, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice nvmlDevice, ProfileId uint32, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceRemainingCapacity(cDevice, cProfileId, cCount) + __ret := C.nvmlDeviceGetGpuInstanceRemainingCapacity(cnvmlDevice, cProfileId, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceCreateGpuInstance function as declared in nvml/nvml.h -func nvmlDeviceCreateGpuInstance(Device Device, ProfileId uint32, GpuInstance *GpuInstance) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceCreateGpuInstance(nvmlDevice nvmlDevice, ProfileId uint32, nvmlGpuInstance *nvmlGpuInstance) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown - cGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(GpuInstance)), cgoAllocsUnknown - __ret := C.nvmlDeviceCreateGpuInstance(cDevice, cProfileId, cGpuInstance) + cnvmlGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(nvmlGpuInstance)), cgoAllocsUnknown + __ret := C.nvmlDeviceCreateGpuInstance(cnvmlDevice, cProfileId, cnvmlGpuInstance) __v := (Return)(__ret) return __v } // nvmlDeviceCreateGpuInstanceWithPlacement function as declared in nvml/nvml.h -func nvmlDeviceCreateGpuInstanceWithPlacement(Device Device, ProfileId uint32, Placement *GpuInstancePlacement, GpuInstance *GpuInstance) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice nvmlDevice, ProfileId uint32, Placement *GpuInstancePlacement, nvmlGpuInstance *nvmlGpuInstance) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacement, _ := (*C.nvmlGpuInstancePlacement_t)(unsafe.Pointer(Placement)), cgoAllocsUnknown - cGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(GpuInstance)), cgoAllocsUnknown - __ret := C.nvmlDeviceCreateGpuInstanceWithPlacement(cDevice, cProfileId, cPlacement, cGpuInstance) + cnvmlGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(nvmlGpuInstance)), cgoAllocsUnknown + __ret := C.nvmlDeviceCreateGpuInstanceWithPlacement(cnvmlDevice, cProfileId, cPlacement, cnvmlGpuInstance) __v := (Return)(__ret) return __v } // nvmlGpuInstanceDestroy function as declared in nvml/nvml.h -func nvmlGpuInstanceDestroy(GpuInstance GpuInstance) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceDestroy(cGpuInstance) +func nvmlGpuInstanceDestroy(nvmlGpuInstance nvmlGpuInstance) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown + __ret := C.nvmlGpuInstanceDestroy(cnvmlGpuInstance) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstances function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstances(Device Device, ProfileId uint32, GpuInstances *GpuInstance, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstances(nvmlDevice nvmlDevice, ProfileId uint32, GpuInstances *nvmlGpuInstance, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cGpuInstances, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(GpuInstances)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstances(cDevice, cProfileId, cGpuInstances, cCount) + __ret := C.nvmlDeviceGetGpuInstances(cnvmlDevice, cProfileId, cGpuInstances, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceById function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceById(Device Device, Id uint32, GpuInstance *GpuInstance) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceById(nvmlDevice nvmlDevice, Id uint32, nvmlGpuInstance *nvmlGpuInstance) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cId, _ := (C.uint)(Id), cgoAllocsUnknown - cGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(GpuInstance)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceById(cDevice, cId, cGpuInstance) + cnvmlGpuInstance, _ := (*C.nvmlGpuInstance_t)(unsafe.Pointer(nvmlGpuInstance)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetGpuInstanceById(cnvmlDevice, cId, cnvmlGpuInstance) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetInfo function as declared in nvml/nvml.h -func nvmlGpuInstanceGetInfo(GpuInstance GpuInstance, Info *GpuInstanceInfo) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetInfo(nvmlGpuInstance nvmlGpuInstance, Info *nvmlGpuInstanceInfo) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cInfo, _ := (*C.nvmlGpuInstanceInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetInfo(cGpuInstance, cInfo) + __ret := C.nvmlGpuInstanceGetInfo(cnvmlGpuInstance, cInfo) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstanceProfileInfo function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceProfileInfo(GpuInstance GpuInstance, Profile uint32, EngProfile uint32, Info *ComputeInstanceProfileInfo) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstanceProfileInfo(nvmlGpuInstance nvmlGpuInstance, Profile uint32, EngProfile uint32, Info *ComputeInstanceProfileInfo) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfile, _ := (C.uint)(Profile), cgoAllocsUnknown cEngProfile, _ := (C.uint)(EngProfile), cgoAllocsUnknown cInfo, _ := (*C.nvmlComputeInstanceProfileInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstanceProfileInfo(cGpuInstance, cProfile, cEngProfile, cInfo) + __ret := C.nvmlGpuInstanceGetComputeInstanceProfileInfo(cnvmlGpuInstance, cProfile, cEngProfile, cInfo) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstanceProfileInfoV function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceProfileInfoV(GpuInstance GpuInstance, Profile uint32, EngProfile uint32, Info *ComputeInstanceProfileInfo_v2) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance nvmlGpuInstance, Profile uint32, EngProfile uint32, Info *ComputeInstanceProfileInfo_v2) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfile, _ := (C.uint)(Profile), cgoAllocsUnknown cEngProfile, _ := (C.uint)(EngProfile), cgoAllocsUnknown cInfo, _ := (*C.nvmlComputeInstanceProfileInfo_v2_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstanceProfileInfoV(cGpuInstance, cProfile, cEngProfile, cInfo) + __ret := C.nvmlGpuInstanceGetComputeInstanceProfileInfoV(cnvmlGpuInstance, cProfile, cEngProfile, cInfo) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstanceRemainingCapacity function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance GpuInstance, ProfileId uint32, Count *uint32) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, Count *uint32) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstanceRemainingCapacity(cGpuInstance, cProfileId, cCount) + __ret := C.nvmlGpuInstanceGetComputeInstanceRemainingCapacity(cnvmlGpuInstance, cProfileId, cCount) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstancePossiblePlacements function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstancePossiblePlacements(GpuInstance GpuInstance, ProfileId uint32, Placements *ComputeInstancePlacement, Count *uint32) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, Placements *ComputeInstancePlacement, Count *uint32) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacements, _ := (*C.nvmlComputeInstancePlacement_t)(unsafe.Pointer(Placements)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstancePossiblePlacements(cGpuInstance, cProfileId, cPlacements, cCount) + __ret := C.nvmlGpuInstanceGetComputeInstancePossiblePlacements(cnvmlGpuInstance, cProfileId, cPlacements, cCount) __v := (Return)(__ret) return __v } // nvmlGpuInstanceCreateComputeInstance function as declared in nvml/nvml.h -func nvmlGpuInstanceCreateComputeInstance(GpuInstance GpuInstance, ProfileId uint32, ComputeInstance *ComputeInstance) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, nvmlComputeInstance *nvmlComputeInstance) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown - cComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(ComputeInstance)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceCreateComputeInstance(cGpuInstance, cProfileId, cComputeInstance) + cnvmlComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(nvmlComputeInstance)), cgoAllocsUnknown + __ret := C.nvmlGpuInstanceCreateComputeInstance(cnvmlGpuInstance, cProfileId, cnvmlComputeInstance) __v := (Return)(__ret) return __v } // nvmlGpuInstanceCreateComputeInstanceWithPlacement function as declared in nvml/nvml.h -func nvmlGpuInstanceCreateComputeInstanceWithPlacement(GpuInstance GpuInstance, ProfileId uint32, Placement *ComputeInstancePlacement, ComputeInstance *ComputeInstance) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, Placement *ComputeInstancePlacement, nvmlComputeInstance *nvmlComputeInstance) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacement, _ := (*C.nvmlComputeInstancePlacement_t)(unsafe.Pointer(Placement)), cgoAllocsUnknown - cComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(ComputeInstance)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceCreateComputeInstanceWithPlacement(cGpuInstance, cProfileId, cPlacement, cComputeInstance) + cnvmlComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(nvmlComputeInstance)), cgoAllocsUnknown + __ret := C.nvmlGpuInstanceCreateComputeInstanceWithPlacement(cnvmlGpuInstance, cProfileId, cPlacement, cnvmlComputeInstance) __v := (Return)(__ret) return __v } // nvmlComputeInstanceDestroy function as declared in nvml/nvml.h -func nvmlComputeInstanceDestroy(ComputeInstance ComputeInstance) Return { - cComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&ComputeInstance)), cgoAllocsUnknown - __ret := C.nvmlComputeInstanceDestroy(cComputeInstance) +func nvmlComputeInstanceDestroy(nvmlComputeInstance nvmlComputeInstance) Return { + cnvmlComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&nvmlComputeInstance)), cgoAllocsUnknown + __ret := C.nvmlComputeInstanceDestroy(cnvmlComputeInstance) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstances function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstances(GpuInstance GpuInstance, ProfileId uint32, ComputeInstances *ComputeInstance, Count *uint32) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance nvmlGpuInstance, ProfileId uint32, ComputeInstances *nvmlComputeInstance, Count *uint32) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cComputeInstances, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(ComputeInstances)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstances(cGpuInstance, cProfileId, cComputeInstances, cCount) + __ret := C.nvmlGpuInstanceGetComputeInstances(cnvmlGpuInstance, cProfileId, cComputeInstances, cCount) __v := (Return)(__ret) return __v } // nvmlGpuInstanceGetComputeInstanceById function as declared in nvml/nvml.h -func nvmlGpuInstanceGetComputeInstanceById(GpuInstance GpuInstance, Id uint32, ComputeInstance *ComputeInstance) Return { - cGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&GpuInstance)), cgoAllocsUnknown +func nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance nvmlGpuInstance, Id uint32, nvmlComputeInstance *nvmlComputeInstance) Return { + cnvmlGpuInstance, _ := *(*C.nvmlGpuInstance_t)(unsafe.Pointer(&nvmlGpuInstance)), cgoAllocsUnknown cId, _ := (C.uint)(Id), cgoAllocsUnknown - cComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(ComputeInstance)), cgoAllocsUnknown - __ret := C.nvmlGpuInstanceGetComputeInstanceById(cGpuInstance, cId, cComputeInstance) + cnvmlComputeInstance, _ := (*C.nvmlComputeInstance_t)(unsafe.Pointer(nvmlComputeInstance)), cgoAllocsUnknown + __ret := C.nvmlGpuInstanceGetComputeInstanceById(cnvmlGpuInstance, cId, cnvmlComputeInstance) __v := (Return)(__ret) return __v } // nvmlComputeInstanceGetInfo_v2 function as declared in nvml/nvml.h -func nvmlComputeInstanceGetInfo_v2(ComputeInstance ComputeInstance, Info *ComputeInstanceInfo) Return { - cComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&ComputeInstance)), cgoAllocsUnknown +func nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance nvmlComputeInstance, Info *nvmlComputeInstanceInfo) Return { + cnvmlComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&nvmlComputeInstance)), cgoAllocsUnknown cInfo, _ := (*C.nvmlComputeInstanceInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlComputeInstanceGetInfo_v2(cComputeInstance, cInfo) + __ret := C.nvmlComputeInstanceGetInfo_v2(cnvmlComputeInstance, cInfo) __v := (Return)(__ret) return __v } // nvmlDeviceIsMigDeviceHandle function as declared in nvml/nvml.h -func nvmlDeviceIsMigDeviceHandle(Device Device, IsMigDevice *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceIsMigDeviceHandle(nvmlDevice nvmlDevice, IsMigDevice *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIsMigDevice, _ := (*C.uint)(unsafe.Pointer(IsMigDevice)), cgoAllocsUnknown - __ret := C.nvmlDeviceIsMigDeviceHandle(cDevice, cIsMigDevice) + __ret := C.nvmlDeviceIsMigDeviceHandle(cnvmlDevice, cIsMigDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstanceId function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstanceId(Device Device, Id *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstanceId(nvmlDevice nvmlDevice, Id *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cId, _ := (*C.uint)(unsafe.Pointer(Id)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstanceId(cDevice, cId) + __ret := C.nvmlDeviceGetGpuInstanceId(cnvmlDevice, cId) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeInstanceId function as declared in nvml/nvml.h -func nvmlDeviceGetComputeInstanceId(Device Device, Id *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeInstanceId(nvmlDevice nvmlDevice, Id *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cId, _ := (*C.uint)(unsafe.Pointer(Id)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeInstanceId(cDevice, cId) + __ret := C.nvmlDeviceGetComputeInstanceId(cnvmlDevice, cId) __v := (Return)(__ret) return __v } // nvmlDeviceGetMaxMigDeviceCount function as declared in nvml/nvml.h -func nvmlDeviceGetMaxMigDeviceCount(Device Device, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMaxMigDeviceCount(nvmlDevice nvmlDevice, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMaxMigDeviceCount(cDevice, cCount) + __ret := C.nvmlDeviceGetMaxMigDeviceCount(cnvmlDevice, cCount) __v := (Return)(__ret) return __v } // nvmlDeviceGetMigDeviceHandleByIndex function as declared in nvml/nvml.h -func nvmlDeviceGetMigDeviceHandleByIndex(Device Device, Index uint32, MigDevice *Device) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice nvmlDevice, Index uint32, MigDevice *nvmlDevice) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cIndex, _ := (C.uint)(Index), cgoAllocsUnknown cMigDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(MigDevice)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMigDeviceHandleByIndex(cDevice, cIndex, cMigDevice) + __ret := C.nvmlDeviceGetMigDeviceHandleByIndex(cnvmlDevice, cIndex, cMigDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetDeviceHandleFromMigDeviceHandle function as declared in nvml/nvml.h -func nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice Device, Device *Device) Return { +func nvmlDeviceGetDeviceHandleFromMigDeviceHandle(MigDevice nvmlDevice, nvmlDevice *nvmlDevice) Return { cMigDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&MigDevice)), cgoAllocsUnknown - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDeviceHandleFromMigDeviceHandle(cMigDevice, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetDeviceHandleFromMigDeviceHandle(cMigDevice, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetBusType function as declared in nvml/nvml.h -func nvmlDeviceGetBusType(Device Device, _type *BusType) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetBusType(nvmlDevice nvmlDevice, _type *BusType) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (*C.nvmlBusType_t)(unsafe.Pointer(_type)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetBusType(cDevice, c_type) + __ret := C.nvmlDeviceGetBusType(cnvmlDevice, c_type) __v := (Return)(__ret) return __v } // nvmlDeviceGetDynamicPstatesInfo function as declared in nvml/nvml.h -func nvmlDeviceGetDynamicPstatesInfo(Device Device, PDynamicPstatesInfo *GpuDynamicPstatesInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetDynamicPstatesInfo(nvmlDevice nvmlDevice, PDynamicPstatesInfo *GpuDynamicPstatesInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPDynamicPstatesInfo, _ := (*C.nvmlGpuDynamicPstatesInfo_t)(unsafe.Pointer(PDynamicPstatesInfo)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetDynamicPstatesInfo(cDevice, cPDynamicPstatesInfo) + __ret := C.nvmlDeviceGetDynamicPstatesInfo(cnvmlDevice, cPDynamicPstatesInfo) __v := (Return)(__ret) return __v } // nvmlDeviceSetFanSpeed_v2 function as declared in nvml/nvml.h -func nvmlDeviceSetFanSpeed_v2(Device Device, Fan uint32, Speed uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetFanSpeed_v2(nvmlDevice nvmlDevice, Fan uint32, Speed uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cFan, _ := (C.uint)(Fan), cgoAllocsUnknown cSpeed, _ := (C.uint)(Speed), cgoAllocsUnknown - __ret := C.nvmlDeviceSetFanSpeed_v2(cDevice, cFan, cSpeed) + __ret := C.nvmlDeviceSetFanSpeed_v2(cnvmlDevice, cFan, cSpeed) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpcClkVfOffset function as declared in nvml/nvml.h -func nvmlDeviceGetGpcClkVfOffset(Device Device, Offset *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpcClkVfOffset(nvmlDevice nvmlDevice, Offset *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cOffset, _ := (*C.int)(unsafe.Pointer(Offset)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpcClkVfOffset(cDevice, cOffset) + __ret := C.nvmlDeviceGetGpcClkVfOffset(cnvmlDevice, cOffset) __v := (Return)(__ret) return __v } // nvmlDeviceSetGpcClkVfOffset function as declared in nvml/nvml.h -func nvmlDeviceSetGpcClkVfOffset(Device Device, Offset int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetGpcClkVfOffset(nvmlDevice nvmlDevice, Offset int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cOffset, _ := (C.int)(Offset), cgoAllocsUnknown - __ret := C.nvmlDeviceSetGpcClkVfOffset(cDevice, cOffset) + __ret := C.nvmlDeviceSetGpcClkVfOffset(cnvmlDevice, cOffset) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemClkVfOffset function as declared in nvml/nvml.h -func nvmlDeviceGetMemClkVfOffset(Device Device, Offset *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemClkVfOffset(nvmlDevice nvmlDevice, Offset *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cOffset, _ := (*C.int)(unsafe.Pointer(Offset)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemClkVfOffset(cDevice, cOffset) + __ret := C.nvmlDeviceGetMemClkVfOffset(cnvmlDevice, cOffset) __v := (Return)(__ret) return __v } // nvmlDeviceSetMemClkVfOffset function as declared in nvml/nvml.h -func nvmlDeviceSetMemClkVfOffset(Device Device, Offset int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetMemClkVfOffset(nvmlDevice nvmlDevice, Offset int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cOffset, _ := (C.int)(Offset), cgoAllocsUnknown - __ret := C.nvmlDeviceSetMemClkVfOffset(cDevice, cOffset) + __ret := C.nvmlDeviceSetMemClkVfOffset(cnvmlDevice, cOffset) __v := (Return)(__ret) return __v } // nvmlDeviceGetMinMaxClockOfPState function as declared in nvml/nvml.h -func nvmlDeviceGetMinMaxClockOfPState(Device Device, _type ClockType, Pstate Pstates, MinClockMHz *uint32, MaxClockMHz *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMinMaxClockOfPState(nvmlDevice nvmlDevice, _type ClockType, Pstate Pstates, MinClockMHz *uint32, MaxClockMHz *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown c_type, _ := (C.nvmlClockType_t)(_type), cgoAllocsUnknown cPstate, _ := (C.nvmlPstates_t)(Pstate), cgoAllocsUnknown cMinClockMHz, _ := (*C.uint)(unsafe.Pointer(MinClockMHz)), cgoAllocsUnknown cMaxClockMHz, _ := (*C.uint)(unsafe.Pointer(MaxClockMHz)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMinMaxClockOfPState(cDevice, c_type, cPstate, cMinClockMHz, cMaxClockMHz) + __ret := C.nvmlDeviceGetMinMaxClockOfPState(cnvmlDevice, c_type, cPstate, cMinClockMHz, cMaxClockMHz) __v := (Return)(__ret) return __v } // nvmlDeviceGetSupportedPerformanceStates function as declared in nvml/nvml.h -func nvmlDeviceGetSupportedPerformanceStates(Device Device, Pstates *Pstates, Size uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetSupportedPerformanceStates(nvmlDevice nvmlDevice, Pstates *Pstates, Size uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPstates, _ := (*C.nvmlPstates_t)(unsafe.Pointer(Pstates)), cgoAllocsUnknown cSize, _ := (C.uint)(Size), cgoAllocsUnknown - __ret := C.nvmlDeviceGetSupportedPerformanceStates(cDevice, cPstates, cSize) + __ret := C.nvmlDeviceGetSupportedPerformanceStates(cnvmlDevice, cPstates, cSize) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpcClkMinMaxVfOffset function as declared in nvml/nvml.h -func nvmlDeviceGetGpcClkMinMaxVfOffset(Device Device, MinOffset *int32, MaxOffset *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice nvmlDevice, MinOffset *int32, MaxOffset *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinOffset, _ := (*C.int)(unsafe.Pointer(MinOffset)), cgoAllocsUnknown cMaxOffset, _ := (*C.int)(unsafe.Pointer(MaxOffset)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpcClkMinMaxVfOffset(cDevice, cMinOffset, cMaxOffset) + __ret := C.nvmlDeviceGetGpcClkMinMaxVfOffset(cnvmlDevice, cMinOffset, cMaxOffset) __v := (Return)(__ret) return __v } // nvmlDeviceGetMemClkMinMaxVfOffset function as declared in nvml/nvml.h -func nvmlDeviceGetMemClkMinMaxVfOffset(Device Device, MinOffset *int32, MaxOffset *int32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice nvmlDevice, MinOffset *int32, MaxOffset *int32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cMinOffset, _ := (*C.int)(unsafe.Pointer(MinOffset)), cgoAllocsUnknown cMaxOffset, _ := (*C.int)(unsafe.Pointer(MaxOffset)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMemClkMinMaxVfOffset(cDevice, cMinOffset, cMaxOffset) + __ret := C.nvmlDeviceGetMemClkMinMaxVfOffset(cnvmlDevice, cMinOffset, cMaxOffset) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuFabricInfo function as declared in nvml/nvml.h -func nvmlDeviceGetGpuFabricInfo(Device Device, GpuFabricInfo *GpuFabricInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuFabricInfo(nvmlDevice nvmlDevice, GpuFabricInfo *GpuFabricInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cGpuFabricInfo, _ := (*C.nvmlGpuFabricInfo_t)(unsafe.Pointer(GpuFabricInfo)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuFabricInfo(cDevice, cGpuFabricInfo) + __ret := C.nvmlDeviceGetGpuFabricInfo(cnvmlDevice, cGpuFabricInfo) __v := (Return)(__ret) return __v } // nvmlGpmMetricsGet function as declared in nvml/nvml.h -func nvmlGpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { +func nvmlGpmMetricsGet(MetricsGet *nvmlGpmMetricsGetType) Return { cMetricsGet, _ := (*C.nvmlGpmMetricsGet_t)(unsafe.Pointer(MetricsGet)), cgoAllocsUnknown __ret := C.nvmlGpmMetricsGet(cMetricsGet) __v := (Return)(__ret) @@ -2696,72 +2696,72 @@ func nvmlGpmMetricsGet(MetricsGet *GpmMetricsGetType) Return { } // nvmlGpmSampleFree function as declared in nvml/nvml.h -func nvmlGpmSampleFree(GpmSample GpmSample) Return { - cGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmSampleFree(cGpmSample) +func nvmlGpmSampleFree(nvmlGpmSample nvmlGpmSample) Return { + cnvmlGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmSampleFree(cnvmlGpmSample) __v := (Return)(__ret) return __v } // nvmlGpmSampleAlloc function as declared in nvml/nvml.h -func nvmlGpmSampleAlloc(GpmSample *GpmSample) Return { - cGpmSample, _ := (*C.nvmlGpmSample_t)(unsafe.Pointer(GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmSampleAlloc(cGpmSample) +func nvmlGpmSampleAlloc(nvmlGpmSample *nvmlGpmSample) Return { + cnvmlGpmSample, _ := (*C.nvmlGpmSample_t)(unsafe.Pointer(nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmSampleAlloc(cnvmlGpmSample) __v := (Return)(__ret) return __v } // nvmlGpmSampleGet function as declared in nvml/nvml.h -func nvmlGpmSampleGet(Device Device, GpmSample GpmSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown - cGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmSampleGet(cDevice, cGpmSample) +func nvmlGpmSampleGet(nvmlDevice nvmlDevice, nvmlGpmSample nvmlGpmSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown + cnvmlGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmSampleGet(cnvmlDevice, cnvmlGpmSample) __v := (Return)(__ret) return __v } // nvmlGpmMigSampleGet function as declared in nvml/nvml.h -func nvmlGpmMigSampleGet(Device Device, GpuInstanceId uint32, GpmSample GpmSample) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlGpmMigSampleGet(nvmlDevice nvmlDevice, GpuInstanceId uint32, nvmlGpmSample nvmlGpmSample) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cGpuInstanceId, _ := (C.uint)(GpuInstanceId), cgoAllocsUnknown - cGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&GpmSample)), cgoAllocsUnknown - __ret := C.nvmlGpmMigSampleGet(cDevice, cGpuInstanceId, cGpmSample) + cnvmlGpmSample, _ := *(*C.nvmlGpmSample_t)(unsafe.Pointer(&nvmlGpmSample)), cgoAllocsUnknown + __ret := C.nvmlGpmMigSampleGet(cnvmlDevice, cGpuInstanceId, cnvmlGpmSample) __v := (Return)(__ret) return __v } // nvmlGpmQueryDeviceSupport function as declared in nvml/nvml.h -func nvmlGpmQueryDeviceSupport(Device Device, GpmSupport *GpmSupport) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlGpmQueryDeviceSupport(nvmlDevice nvmlDevice, GpmSupport *GpmSupport) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cGpmSupport, _ := (*C.nvmlGpmSupport_t)(unsafe.Pointer(GpmSupport)), cgoAllocsUnknown - __ret := C.nvmlGpmQueryDeviceSupport(cDevice, cGpmSupport) + __ret := C.nvmlGpmQueryDeviceSupport(cnvmlDevice, cGpmSupport) __v := (Return)(__ret) return __v } // nvmlDeviceCcuGetStreamState function as declared in nvml/nvml.h -func nvmlDeviceCcuGetStreamState(Device Device, State *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceCcuGetStreamState(nvmlDevice nvmlDevice, State *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cState, _ := (*C.uint)(unsafe.Pointer(State)), cgoAllocsUnknown - __ret := C.nvmlDeviceCcuGetStreamState(cDevice, cState) + __ret := C.nvmlDeviceCcuGetStreamState(cnvmlDevice, cState) __v := (Return)(__ret) return __v } // nvmlDeviceCcuSetStreamState function as declared in nvml/nvml.h -func nvmlDeviceCcuSetStreamState(Device Device, State uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceCcuSetStreamState(nvmlDevice nvmlDevice, State uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cState, _ := (C.uint)(State), cgoAllocsUnknown - __ret := C.nvmlDeviceCcuSetStreamState(cDevice, cState) + __ret := C.nvmlDeviceCcuSetStreamState(cnvmlDevice, cState) __v := (Return)(__ret) return __v } // nvmlDeviceSetNvLinkDeviceLowPowerThreshold function as declared in nvml/nvml.h -func nvmlDeviceSetNvLinkDeviceLowPowerThreshold(Device Device, Info *NvLinkPowerThres) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice nvmlDevice, Info *NvLinkPowerThres) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfo, _ := (*C.nvmlNvLinkPowerThres_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlDeviceSetNvLinkDeviceLowPowerThreshold(cDevice, cInfo) + __ret := C.nvmlDeviceSetNvLinkDeviceLowPowerThreshold(cnvmlDevice, cInfo) __v := (Return)(__ret) return __v } @@ -2782,74 +2782,74 @@ func nvmlDeviceGetCount_v1(DeviceCount *uint32) Return { } // nvmlDeviceGetHandleByIndex_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByIndex_v1(Index uint32, Device *Device) Return { +func nvmlDeviceGetHandleByIndex_v1(Index uint32, nvmlDevice *nvmlDevice) Return { cIndex, _ := (C.uint)(Index), cgoAllocsUnknown - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByIndex(cIndex, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByIndex(cIndex, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetHandleByPciBusId_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetHandleByPciBusId_v1(PciBusId string, Device *Device) Return { +func nvmlDeviceGetHandleByPciBusId_v1(PciBusId string, nvmlDevice *nvmlDevice) Return { cPciBusId, _ := unpackPCharString(PciBusId) - cDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(Device)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetHandleByPciBusId(cPciBusId, cDevice) + cnvmlDevice, _ := (*C.nvmlDevice_t)(unsafe.Pointer(nvmlDevice)), cgoAllocsUnknown + __ret := C.nvmlDeviceGetHandleByPciBusId(cPciBusId, cnvmlDevice) __v := (Return)(__ret) return __v } // nvmlDeviceGetPciInfo_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetPciInfo_v1(Device Device, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPciInfo_v1(nvmlDevice nvmlDevice, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPciInfo(cDevice, cPci) + __ret := C.nvmlDeviceGetPciInfo(cnvmlDevice, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetPciInfo_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetPciInfo_v2(Device Device, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetPciInfo_v2(nvmlDevice nvmlDevice, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetPciInfo_v2(cDevice, cPci) + __ret := C.nvmlDeviceGetPciInfo_v2(cnvmlDevice, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetNvLinkRemotePciInfo_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetNvLinkRemotePciInfo_v1(Device Device, Link uint32, Pci *PciInfo) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetNvLinkRemotePciInfo_v1(nvmlDevice nvmlDevice, Link uint32, Pci *PciInfo) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cLink, _ := (C.uint)(Link), cgoAllocsUnknown cPci, _ := (*C.nvmlPciInfo_t)(unsafe.Pointer(Pci)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetNvLinkRemotePciInfo(cDevice, cLink, cPci) + __ret := C.nvmlDeviceGetNvLinkRemotePciInfo(cnvmlDevice, cLink, cPci) __v := (Return)(__ret) return __v } // nvmlDeviceGetGridLicensableFeatures_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetGridLicensableFeatures_v1(Device Device, PGridLicensableFeatures *GridLicensableFeatures) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGridLicensableFeatures_v1(nvmlDevice nvmlDevice, PGridLicensableFeatures *GridLicensableFeatures) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPGridLicensableFeatures, _ := (*C.nvmlGridLicensableFeatures_t)(unsafe.Pointer(PGridLicensableFeatures)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGridLicensableFeatures(cDevice, cPGridLicensableFeatures) + __ret := C.nvmlDeviceGetGridLicensableFeatures(cnvmlDevice, cPGridLicensableFeatures) __v := (Return)(__ret) return __v } // nvmlDeviceGetGridLicensableFeatures_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetGridLicensableFeatures_v2(Device Device, PGridLicensableFeatures *GridLicensableFeatures) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGridLicensableFeatures_v2(nvmlDevice nvmlDevice, PGridLicensableFeatures *GridLicensableFeatures) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPGridLicensableFeatures, _ := (*C.nvmlGridLicensableFeatures_t)(unsafe.Pointer(PGridLicensableFeatures)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGridLicensableFeatures_v2(cDevice, cPGridLicensableFeatures) + __ret := C.nvmlDeviceGetGridLicensableFeatures_v2(cnvmlDevice, cPGridLicensableFeatures) __v := (Return)(__ret) return __v } // nvmlDeviceGetGridLicensableFeatures_v3 function as declared in nvml/nvml.h -func nvmlDeviceGetGridLicensableFeatures_v3(Device Device, PGridLicensableFeatures *GridLicensableFeatures) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGridLicensableFeatures_v3(nvmlDevice nvmlDevice, PGridLicensableFeatures *GridLicensableFeatures) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cPGridLicensableFeatures, _ := (*C.nvmlGridLicensableFeatures_t)(unsafe.Pointer(PGridLicensableFeatures)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGridLicensableFeatures_v3(cDevice, cPGridLicensableFeatures) + __ret := C.nvmlDeviceGetGridLicensableFeatures_v3(cnvmlDevice, cPGridLicensableFeatures) __v := (Return)(__ret) return __v } @@ -2863,7 +2863,7 @@ func nvmlDeviceRemoveGpu_v1(PciInfo *PciInfo) Return { } // nvmlEventSetWait_v1 function as declared in nvml/nvml.h -func nvmlEventSetWait_v1(Set EventSet, Data *EventData, Timeoutms uint32) Return { +func nvmlEventSetWait_v1(Set nvmlEventSet, Data *nvmlEventData, Timeoutms uint32) Return { cSet, _ := *(*C.nvmlEventSet_t)(unsafe.Pointer(&Set)), cgoAllocsUnknown cData, _ := (*C.nvmlEventData_t)(unsafe.Pointer(Data)), cgoAllocsUnknown cTimeoutms, _ := (C.uint)(Timeoutms), cgoAllocsUnknown @@ -2873,99 +2873,99 @@ func nvmlEventSetWait_v1(Set EventSet, Data *EventData, Timeoutms uint32) Return } // nvmlDeviceGetAttributes_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetAttributes_v1(Device Device, Attributes *DeviceAttributes) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetAttributes_v1(nvmlDevice nvmlDevice, Attributes *DeviceAttributes) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cAttributes, _ := (*C.nvmlDeviceAttributes_t)(unsafe.Pointer(Attributes)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetAttributes(cDevice, cAttributes) + __ret := C.nvmlDeviceGetAttributes(cnvmlDevice, cAttributes) __v := (Return)(__ret) return __v } // nvmlComputeInstanceGetInfo_v1 function as declared in nvml/nvml.h -func nvmlComputeInstanceGetInfo_v1(ComputeInstance ComputeInstance, Info *ComputeInstanceInfo) Return { - cComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&ComputeInstance)), cgoAllocsUnknown +func nvmlComputeInstanceGetInfo_v1(nvmlComputeInstance nvmlComputeInstance, Info *nvmlComputeInstanceInfo) Return { + cnvmlComputeInstance, _ := *(*C.nvmlComputeInstance_t)(unsafe.Pointer(&nvmlComputeInstance)), cgoAllocsUnknown cInfo, _ := (*C.nvmlComputeInstanceInfo_t)(unsafe.Pointer(Info)), cgoAllocsUnknown - __ret := C.nvmlComputeInstanceGetInfo(cComputeInstance, cInfo) + __ret := C.nvmlComputeInstanceGetInfo(cnvmlComputeInstance, cInfo) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeRunningProcesses_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetComputeRunningProcesses_v1(Device Device, InfoCount *uint32, Infos *ProcessInfo_v1) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeRunningProcesses_v1(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v1) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v1_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeRunningProcesses(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetComputeRunningProcesses(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetComputeRunningProcesses_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetComputeRunningProcesses_v2(Device Device, InfoCount *uint32, Infos *ProcessInfo_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetComputeRunningProcesses_v2(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v2_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetComputeRunningProcesses_v2(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetComputeRunningProcesses_v2(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetGraphicsRunningProcesses_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetGraphicsRunningProcesses_v1(Device Device, InfoCount *uint32, Infos *ProcessInfo_v1) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGraphicsRunningProcesses_v1(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v1) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v1_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGraphicsRunningProcesses(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetGraphicsRunningProcesses(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetGraphicsRunningProcesses_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetGraphicsRunningProcesses_v2(Device Device, InfoCount *uint32, Infos *ProcessInfo_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGraphicsRunningProcesses_v2(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v2_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGraphicsRunningProcesses_v2(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetGraphicsRunningProcesses_v2(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetMPSComputeRunningProcesses_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetMPSComputeRunningProcesses_v1(Device Device, InfoCount *uint32, Infos *ProcessInfo_v1) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMPSComputeRunningProcesses_v1(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v1) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v1_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMPSComputeRunningProcesses(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetMPSComputeRunningProcesses(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetMPSComputeRunningProcesses_v2 function as declared in nvml/nvml.h -func nvmlDeviceGetMPSComputeRunningProcesses_v2(Device Device, InfoCount *uint32, Infos *ProcessInfo_v2) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetMPSComputeRunningProcesses_v2(nvmlDevice nvmlDevice, InfoCount *uint32, Infos *ProcessInfo_v2) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cInfoCount, _ := (*C.uint)(unsafe.Pointer(InfoCount)), cgoAllocsUnknown cInfos, _ := (*C.nvmlProcessInfo_v2_t)(unsafe.Pointer(Infos)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetMPSComputeRunningProcesses_v2(cDevice, cInfoCount, cInfos) + __ret := C.nvmlDeviceGetMPSComputeRunningProcesses_v2(cnvmlDevice, cInfoCount, cInfos) __v := (Return)(__ret) return __v } // nvmlDeviceGetGpuInstancePossiblePlacements_v1 function as declared in nvml/nvml.h -func nvmlDeviceGetGpuInstancePossiblePlacements_v1(Device Device, ProfileId uint32, Placements *GpuInstancePlacement, Count *uint32) Return { - cDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&Device)), cgoAllocsUnknown +func nvmlDeviceGetGpuInstancePossiblePlacements_v1(nvmlDevice nvmlDevice, ProfileId uint32, Placements *GpuInstancePlacement, Count *uint32) Return { + cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown cProfileId, _ := (C.uint)(ProfileId), cgoAllocsUnknown cPlacements, _ := (*C.nvmlGpuInstancePlacement_t)(unsafe.Pointer(Placements)), cgoAllocsUnknown cCount, _ := (*C.uint)(unsafe.Pointer(Count)), cgoAllocsUnknown - __ret := C.nvmlDeviceGetGpuInstancePossiblePlacements(cDevice, cProfileId, cPlacements, cCount) + __ret := C.nvmlDeviceGetGpuInstancePossiblePlacements(cnvmlDevice, cProfileId, cPlacements, cCount) __v := (Return)(__ret) return __v } // nvmlVgpuInstanceGetLicenseInfo_v1 function as declared in nvml/nvml.h -func nvmlVgpuInstanceGetLicenseInfo_v1(VgpuInstance VgpuInstance, LicenseInfo *VgpuLicenseInfo) Return { - cVgpuInstance, _ := (C.nvmlVgpuInstance_t)(VgpuInstance), cgoAllocsUnknown +func nvmlVgpuInstanceGetLicenseInfo_v1(nvmlVgpuInstance nvmlVgpuInstance, LicenseInfo *VgpuLicenseInfo) Return { + cnvmlVgpuInstance, _ := (C.nvmlVgpuInstance_t)(nvmlVgpuInstance), cgoAllocsUnknown cLicenseInfo, _ := (*C.nvmlVgpuLicenseInfo_t)(unsafe.Pointer(LicenseInfo)), cgoAllocsUnknown - __ret := C.nvmlVgpuInstanceGetLicenseInfo(cVgpuInstance, cLicenseInfo) + __ret := C.nvmlVgpuInstanceGetLicenseInfo(cnvmlVgpuInstance, cLicenseInfo) __v := (Return)(__ret) return __v } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go index 0a0cceee..1aec3ecc 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go @@ -19,17 +19,27 @@ import ( ) // nvml.ErrorString() -func ErrorString(r Return) string { - if err := GetLibrary().Lookup("nvmlErrorString"); err != nil { - return fallbackErrorStringFunc(r) - } - return nvmlErrorString(r) +func (l *library) ErrorString(r Return) string { + return r.Error() +} + +// String returns the string representation of a Return. +func (r Return) String() string { + return r.Error() } -// fallbackErrorStringFunc provides a basic nvmlErrorString implementation. +// Error returns the string representation of a Return. +func (r Return) Error() string { + return errorStringFunc(r) +} + +// Assigned to nvml.ErrorString if the system nvml library is in use. +var errorStringFunc = defaultErrorStringFunc + +// defaultErrorStringFunc provides a basic nvmlErrorString implementation. // This allows the nvml.ErrorString function to be used even if the NVML library // is not loaded. -var fallbackErrorStringFunc = func(r Return) string { +var defaultErrorStringFunc = func(r Return) string { switch r { case SUCCESS: return "SUCCESS" diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go index 424f99bd..03145b28 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go @@ -15,67 +15,67 @@ package nvml // nvml.SystemGetDriverVersion() -func SystemGetDriverVersion() (string, Return) { +func (l *library) SystemGetDriverVersion() (string, Return) { Version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE) ret := nvmlSystemGetDriverVersion(&Version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE) return string(Version[:clen(Version)]), ret } // nvml.SystemGetNVMLVersion() -func SystemGetNVMLVersion() (string, Return) { +func (l *library) SystemGetNVMLVersion() (string, Return) { Version := make([]byte, SYSTEM_NVML_VERSION_BUFFER_SIZE) ret := nvmlSystemGetNVMLVersion(&Version[0], SYSTEM_NVML_VERSION_BUFFER_SIZE) return string(Version[:clen(Version)]), ret } // nvml.SystemGetCudaDriverVersion() -func SystemGetCudaDriverVersion() (int, Return) { +func (l *library) SystemGetCudaDriverVersion() (int, Return) { var CudaDriverVersion int32 ret := nvmlSystemGetCudaDriverVersion(&CudaDriverVersion) return int(CudaDriverVersion), ret } // nvml.SystemGetCudaDriverVersion_v2() -func SystemGetCudaDriverVersion_v2() (int, Return) { +func (l *library) SystemGetCudaDriverVersion_v2() (int, Return) { var CudaDriverVersion int32 ret := nvmlSystemGetCudaDriverVersion_v2(&CudaDriverVersion) return int(CudaDriverVersion), ret } // nvml.SystemGetProcessName() -func SystemGetProcessName(Pid int) (string, Return) { - Name := make([]byte, SYSTEM_PROCESS_NAME_BUFFER_SIZE) - ret := nvmlSystemGetProcessName(uint32(Pid), &Name[0], SYSTEM_PROCESS_NAME_BUFFER_SIZE) - return string(Name[:clen(Name)]), ret +func (l *library) SystemGetProcessName(pid int) (string, Return) { + name := make([]byte, SYSTEM_PROCESS_NAME_BUFFER_SIZE) + ret := nvmlSystemGetProcessName(uint32(pid), &name[0], SYSTEM_PROCESS_NAME_BUFFER_SIZE) + return string(name[:clen(name)]), ret } // nvml.SystemGetHicVersion() -func SystemGetHicVersion() ([]HwbcEntry, Return) { - var HwbcCount uint32 = 1 // Will be reduced upon returning +func (l *library) SystemGetHicVersion() ([]HwbcEntry, Return) { + var hwbcCount uint32 = 1 // Will be reduced upon returning for { - HwbcEntries := make([]HwbcEntry, HwbcCount) - ret := nvmlSystemGetHicVersion(&HwbcCount, &HwbcEntries[0]) + hwbcEntries := make([]HwbcEntry, hwbcCount) + ret := nvmlSystemGetHicVersion(&hwbcCount, &hwbcEntries[0]) if ret == SUCCESS { - return HwbcEntries[:HwbcCount], ret + return hwbcEntries[:hwbcCount], ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - HwbcCount *= 2 + hwbcCount *= 2 } } // nvml.SystemGetTopologyGpuSet() -func SystemGetTopologyGpuSet(CpuNumber int) ([]Device, Return) { - var Count uint32 - ret := nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, nil) +func (l *library) SystemGetTopologyGpuSet(cpuNumber int) ([]Device, Return) { + var count uint32 + ret := nvmlSystemGetTopologyGpuSet(uint32(cpuNumber), &count, nil) if ret != SUCCESS { return nil, ret } - if Count == 0 { + if count == 0 { return []Device{}, ret } - DeviceArray := make([]Device, Count) - ret = nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, &DeviceArray[0]) - return DeviceArray, ret + deviceArray := make([]nvmlDevice, count) + ret = nvmlSystemGetTopologyGpuSet(uint32(cpuNumber), &count, &deviceArray[0]) + return convertSlice[nvmlDevice, Device](deviceArray), ret } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go index 396886d6..6a57bab3 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go @@ -5,7 +5,7 @@ package nvml import "unsafe" -type Device struct { +type nvmlDevice struct { Handle *_Ctype_struct_nvmlDevice_st } @@ -143,9 +143,9 @@ type ClkMonStatus struct { ClkMonList [32]ClkMonFaultInfo } -type VgpuTypeId uint32 +type nvmlVgpuTypeId uint32 -type VgpuInstance uint32 +type nvmlVgpuInstance uint32 type VgpuInstanceUtilizationSample struct { VgpuInstance uint32 @@ -316,7 +316,7 @@ type FieldValue struct { Value [8]byte } -type Unit struct { +type nvmlUnit struct { Handle *_Ctype_struct_nvmlUnit_st } @@ -354,12 +354,12 @@ type UnitFanSpeeds struct { Count uint32 } -type EventSet struct { +type nvmlEventSet struct { Handle *_Ctype_struct_nvmlEventSet_st } -type EventData struct { - Device Device +type nvmlEventData struct { + Device nvmlDevice EventType uint64 EventData uint64 GpuInstanceId uint32 @@ -494,14 +494,14 @@ type GpuInstanceProfileInfo_v2 struct { Name [96]int8 } -type GpuInstanceInfo struct { - Device Device +type nvmlGpuInstanceInfo struct { + Device nvmlDevice Id uint32 ProfileId uint32 Placement GpuInstancePlacement } -type GpuInstance struct { +type nvmlGpuInstance struct { Handle *_Ctype_struct_nvmlGpuInstance_st } @@ -536,19 +536,19 @@ type ComputeInstanceProfileInfo_v2 struct { Name [96]int8 } -type ComputeInstanceInfo struct { - Device Device - GpuInstance GpuInstance +type nvmlComputeInstanceInfo struct { + Device nvmlDevice + GpuInstance nvmlGpuInstance Id uint32 ProfileId uint32 Placement ComputeInstancePlacement } -type ComputeInstance struct { +type nvmlComputeInstance struct { Handle *_Ctype_struct_nvmlComputeInstance_st } -type GpmSample struct { +type nvmlGpmSample struct { Handle *_Ctype_struct_nvmlGpmSample_st } @@ -565,11 +565,11 @@ type GpmMetric struct { MetricInfo GpmMetricMetricInfo } -type GpmMetricsGetType struct { +type nvmlGpmMetricsGetType struct { Version uint32 NumMetrics uint32 - Sample1 GpmSample - Sample2 GpmSample + Sample1 nvmlGpmSample + Sample2 nvmlGpmSample Metrics [98]GpmMetric } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go index aba916ae..617ad546 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go @@ -15,99 +15,99 @@ package nvml // nvml.UnitGetCount() -func UnitGetCount() (int, Return) { +func (l *library) UnitGetCount() (int, Return) { var UnitCount uint32 ret := nvmlUnitGetCount(&UnitCount) return int(UnitCount), ret } // nvml.UnitGetHandleByIndex() -func UnitGetHandleByIndex(Index int) (Unit, Return) { - var Unit Unit - ret := nvmlUnitGetHandleByIndex(uint32(Index), &Unit) - return Unit, ret +func (l *library) UnitGetHandleByIndex(index int) (Unit, Return) { + var unit nvmlUnit + ret := nvmlUnitGetHandleByIndex(uint32(index), &unit) + return unit, ret } // nvml.UnitGetUnitInfo() -func UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) { - var Info UnitInfo - ret := nvmlUnitGetUnitInfo(Unit, &Info) - return Info, ret +func (l *library) UnitGetUnitInfo(unit Unit) (UnitInfo, Return) { + return unit.GetUnitInfo() } -func (Unit Unit) GetUnitInfo() (UnitInfo, Return) { - return UnitGetUnitInfo(Unit) +func (unit nvmlUnit) GetUnitInfo() (UnitInfo, Return) { + var info UnitInfo + ret := nvmlUnitGetUnitInfo(unit, &info) + return info, ret } // nvml.UnitGetLedState() -func UnitGetLedState(Unit Unit) (LedState, Return) { - var State LedState - ret := nvmlUnitGetLedState(Unit, &State) - return State, ret +func (l *library) UnitGetLedState(unit Unit) (LedState, Return) { + return unit.GetLedState() } -func (Unit Unit) GetLedState() (LedState, Return) { - return UnitGetLedState(Unit) +func (unit nvmlUnit) GetLedState() (LedState, Return) { + var state LedState + ret := nvmlUnitGetLedState(unit, &state) + return state, ret } // nvml.UnitGetPsuInfo() -func UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) { - var Psu PSUInfo - ret := nvmlUnitGetPsuInfo(Unit, &Psu) - return Psu, ret +func (l *library) UnitGetPsuInfo(unit Unit) (PSUInfo, Return) { + return unit.GetPsuInfo() } -func (Unit Unit) GetPsuInfo() (PSUInfo, Return) { - return UnitGetPsuInfo(Unit) +func (unit nvmlUnit) GetPsuInfo() (PSUInfo, Return) { + var psu PSUInfo + ret := nvmlUnitGetPsuInfo(unit, &psu) + return psu, ret } // nvml.UnitGetTemperature() -func UnitGetTemperature(Unit Unit, Type int) (uint32, Return) { - var Temp uint32 - ret := nvmlUnitGetTemperature(Unit, uint32(Type), &Temp) - return Temp, ret +func (l *library) UnitGetTemperature(unit Unit, ttype int) (uint32, Return) { + return unit.GetTemperature(ttype) } -func (Unit Unit) GetTemperature(Type int) (uint32, Return) { - return UnitGetTemperature(Unit, Type) +func (unit nvmlUnit) GetTemperature(ttype int) (uint32, Return) { + var temp uint32 + ret := nvmlUnitGetTemperature(unit, uint32(ttype), &temp) + return temp, ret } // nvml.UnitGetFanSpeedInfo() -func UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) { - var FanSpeeds UnitFanSpeeds - ret := nvmlUnitGetFanSpeedInfo(Unit, &FanSpeeds) - return FanSpeeds, ret +func (l *library) UnitGetFanSpeedInfo(unit Unit) (UnitFanSpeeds, Return) { + return unit.GetFanSpeedInfo() } -func (Unit Unit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { - return UnitGetFanSpeedInfo(Unit) +func (unit nvmlUnit) GetFanSpeedInfo() (UnitFanSpeeds, Return) { + var fanSpeeds UnitFanSpeeds + ret := nvmlUnitGetFanSpeedInfo(unit, &fanSpeeds) + return fanSpeeds, ret } // nvml.UnitGetDevices() -func UnitGetDevices(Unit Unit) ([]Device, Return) { - var DeviceCount uint32 = 1 // Will be reduced upon returning +func (l *library) UnitGetDevices(unit Unit) ([]Device, Return) { + return unit.GetDevices() +} + +func (unit nvmlUnit) GetDevices() ([]Device, Return) { + var deviceCount uint32 = 1 // Will be reduced upon returning for { - Devices := make([]Device, DeviceCount) - ret := nvmlUnitGetDevices(Unit, &DeviceCount, &Devices[0]) + devices := make([]nvmlDevice, deviceCount) + ret := nvmlUnitGetDevices(unit, &deviceCount, &devices[0]) if ret == SUCCESS { - return Devices[:DeviceCount], ret + return convertSlice[nvmlDevice, Device](devices[:deviceCount]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - DeviceCount *= 2 + deviceCount *= 2 } } -func (Unit Unit) GetDevices() ([]Device, Return) { - return UnitGetDevices(Unit) -} - // nvml.UnitSetLedState() -func UnitSetLedState(Unit Unit, Color LedColor) Return { - return nvmlUnitSetLedState(Unit, Color) +func (l *library) UnitSetLedState(unit Unit, color LedColor) Return { + return unit.SetLedState(color) } -func (Unit Unit) SetLedState(Color LedColor) Return { - return UnitSetLedState(Unit, Color) +func (unit nvmlUnit) SetLedState(color LedColor) Return { + return nvmlUnitSetLedState(unit, color) } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go index 2366fb70..bd800771 100644 --- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go @@ -31,450 +31,450 @@ type VgpuPgpuMetadata struct { } // nvml.VgpuTypeGetClass() -func VgpuTypeGetClass(VgpuTypeId VgpuTypeId) (string, Return) { - var Size uint32 = DEVICE_NAME_BUFFER_SIZE - VgpuTypeClass := make([]byte, DEVICE_NAME_BUFFER_SIZE) - ret := nvmlVgpuTypeGetClass(VgpuTypeId, &VgpuTypeClass[0], &Size) - return string(VgpuTypeClass[:clen(VgpuTypeClass)]), ret +func (l *library) VgpuTypeGetClass(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetClass() } -func (VgpuTypeId VgpuTypeId) GetClass() (string, Return) { - return VgpuTypeGetClass(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetClass() (string, Return) { + var size uint32 = DEVICE_NAME_BUFFER_SIZE + vgpuTypeClass := make([]byte, DEVICE_NAME_BUFFER_SIZE) + ret := nvmlVgpuTypeGetClass(vgpuTypeId, &vgpuTypeClass[0], &size) + return string(vgpuTypeClass[:clen(vgpuTypeClass)]), ret } // nvml.VgpuTypeGetName() -func VgpuTypeGetName(VgpuTypeId VgpuTypeId) (string, Return) { - var Size uint32 = DEVICE_NAME_BUFFER_SIZE - VgpuTypeName := make([]byte, DEVICE_NAME_BUFFER_SIZE) - ret := nvmlVgpuTypeGetName(VgpuTypeId, &VgpuTypeName[0], &Size) - return string(VgpuTypeName[:clen(VgpuTypeName)]), ret +func (l *library) VgpuTypeGetName(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetName() } -func (VgpuTypeId VgpuTypeId) GetName() (string, Return) { - return VgpuTypeGetName(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetName() (string, Return) { + var size uint32 = DEVICE_NAME_BUFFER_SIZE + vgpuTypeName := make([]byte, DEVICE_NAME_BUFFER_SIZE) + ret := nvmlVgpuTypeGetName(vgpuTypeId, &vgpuTypeName[0], &size) + return string(vgpuTypeName[:clen(vgpuTypeName)]), ret } // nvml.VgpuTypeGetGpuInstanceProfileId() -func VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) { - var Size uint32 - ret := nvmlVgpuTypeGetGpuInstanceProfileId(VgpuTypeId, &Size) - return Size, ret +func (l *library) VgpuTypeGetGpuInstanceProfileId(vgpuTypeId VgpuTypeId) (uint32, Return) { + return vgpuTypeId.GetGpuInstanceProfileId() } -func (VgpuTypeId VgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { - return VgpuTypeGetGpuInstanceProfileId(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) { + var size uint32 + ret := nvmlVgpuTypeGetGpuInstanceProfileId(vgpuTypeId, &size) + return size, ret } // nvml.VgpuTypeGetDeviceID() -func VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) { - var DeviceID, SubsystemID uint64 - ret := nvmlVgpuTypeGetDeviceID(VgpuTypeId, &DeviceID, &SubsystemID) - return DeviceID, SubsystemID, ret +func (l *library) VgpuTypeGetDeviceID(vgpuTypeId VgpuTypeId) (uint64, uint64, Return) { + return vgpuTypeId.GetDeviceID() } -func (VgpuTypeId VgpuTypeId) GetDeviceID() (uint64, uint64, Return) { - return VgpuTypeGetDeviceID(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetDeviceID() (uint64, uint64, Return) { + var deviceID, subsystemID uint64 + ret := nvmlVgpuTypeGetDeviceID(vgpuTypeId, &deviceID, &subsystemID) + return deviceID, subsystemID, ret } // nvml.VgpuTypeGetFramebufferSize() -func VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) { - var FbSize uint64 - ret := nvmlVgpuTypeGetFramebufferSize(VgpuTypeId, &FbSize) - return FbSize, ret +func (l *library) VgpuTypeGetFramebufferSize(vgpuTypeId VgpuTypeId) (uint64, Return) { + return vgpuTypeId.GetFramebufferSize() } -func (VgpuTypeId VgpuTypeId) GetFramebufferSize() (uint64, Return) { - return VgpuTypeGetFramebufferSize(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetFramebufferSize() (uint64, Return) { + var fbSize uint64 + ret := nvmlVgpuTypeGetFramebufferSize(vgpuTypeId, &fbSize) + return fbSize, ret } // nvml.VgpuTypeGetNumDisplayHeads() -func VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) { - var NumDisplayHeads uint32 - ret := nvmlVgpuTypeGetNumDisplayHeads(VgpuTypeId, &NumDisplayHeads) - return int(NumDisplayHeads), ret +func (l *library) VgpuTypeGetNumDisplayHeads(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetNumDisplayHeads() } -func (VgpuTypeId VgpuTypeId) GetNumDisplayHeads() (int, Return) { - return VgpuTypeGetNumDisplayHeads(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetNumDisplayHeads() (int, Return) { + var numDisplayHeads uint32 + ret := nvmlVgpuTypeGetNumDisplayHeads(vgpuTypeId, &numDisplayHeads) + return int(numDisplayHeads), ret } // nvml.VgpuTypeGetResolution() -func VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) { - var Xdim, Ydim uint32 - ret := nvmlVgpuTypeGetResolution(VgpuTypeId, uint32(DisplayIndex), &Xdim, &Ydim) - return Xdim, Ydim, ret +func (l *library) VgpuTypeGetResolution(vgpuTypeId VgpuTypeId, displayIndex int) (uint32, uint32, Return) { + return vgpuTypeId.GetResolution(displayIndex) } -func (VgpuTypeId VgpuTypeId) GetResolution(DisplayIndex int) (uint32, uint32, Return) { - return VgpuTypeGetResolution(VgpuTypeId, DisplayIndex) +func (vgpuTypeId nvmlVgpuTypeId) GetResolution(displayIndex int) (uint32, uint32, Return) { + var xdim, ydim uint32 + ret := nvmlVgpuTypeGetResolution(vgpuTypeId, uint32(displayIndex), &xdim, &ydim) + return xdim, ydim, ret } // nvml.VgpuTypeGetLicense() -func VgpuTypeGetLicense(VgpuTypeId VgpuTypeId) (string, Return) { - VgpuTypeLicenseString := make([]byte, GRID_LICENSE_BUFFER_SIZE) - ret := nvmlVgpuTypeGetLicense(VgpuTypeId, &VgpuTypeLicenseString[0], GRID_LICENSE_BUFFER_SIZE) - return string(VgpuTypeLicenseString[:clen(VgpuTypeLicenseString)]), ret +func (l *library) VgpuTypeGetLicense(vgpuTypeId VgpuTypeId) (string, Return) { + return vgpuTypeId.GetLicense() } -func (VgpuTypeId VgpuTypeId) GetLicense() (string, Return) { - return VgpuTypeGetLicense(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetLicense() (string, Return) { + vgpuTypeLicenseString := make([]byte, GRID_LICENSE_BUFFER_SIZE) + ret := nvmlVgpuTypeGetLicense(vgpuTypeId, &vgpuTypeLicenseString[0], GRID_LICENSE_BUFFER_SIZE) + return string(vgpuTypeLicenseString[:clen(vgpuTypeLicenseString)]), ret } // nvml.VgpuTypeGetFrameRateLimit() -func VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) { - var FrameRateLimit uint32 - ret := nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId, &FrameRateLimit) - return FrameRateLimit, ret +func (l *library) VgpuTypeGetFrameRateLimit(vgpuTypeId VgpuTypeId) (uint32, Return) { + return vgpuTypeId.GetFrameRateLimit() } -func (VgpuTypeId VgpuTypeId) GetFrameRateLimit() (uint32, Return) { - return VgpuTypeGetFrameRateLimit(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetFrameRateLimit() (uint32, Return) { + var frameRateLimit uint32 + ret := nvmlVgpuTypeGetFrameRateLimit(vgpuTypeId, &frameRateLimit) + return frameRateLimit, ret } // nvml.VgpuTypeGetMaxInstances() -func VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) { - var VgpuInstanceCount uint32 - ret := nvmlVgpuTypeGetMaxInstances(Device, VgpuTypeId, &VgpuInstanceCount) - return int(VgpuInstanceCount), ret +func (l *library) VgpuTypeGetMaxInstances(device Device, vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstances(device) } -func (Device Device) VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) { - return VgpuTypeGetMaxInstances(Device, VgpuTypeId) +func (device nvmlDevice) VgpuTypeGetMaxInstances(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstances(device) } -func (VgpuTypeId VgpuTypeId) GetMaxInstances(Device Device) (int, Return) { - return VgpuTypeGetMaxInstances(Device, VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetMaxInstances(device Device) (int, Return) { + var vgpuInstanceCount uint32 + ret := nvmlVgpuTypeGetMaxInstances(device.(nvmlDevice), vgpuTypeId, &vgpuInstanceCount) + return int(vgpuInstanceCount), ret } // nvml.VgpuTypeGetMaxInstancesPerVm() -func VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) { - var VgpuInstanceCountPerVm uint32 - ret := nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId, &VgpuInstanceCountPerVm) - return int(VgpuInstanceCountPerVm), ret +func (l *library) VgpuTypeGetMaxInstancesPerVm(vgpuTypeId VgpuTypeId) (int, Return) { + return vgpuTypeId.GetMaxInstancesPerVm() } -func (VgpuTypeId VgpuTypeId) GetMaxInstancesPerVm() (int, Return) { - return VgpuTypeGetMaxInstancesPerVm(VgpuTypeId) +func (vgpuTypeId nvmlVgpuTypeId) GetMaxInstancesPerVm() (int, Return) { + var vgpuInstanceCountPerVm uint32 + ret := nvmlVgpuTypeGetMaxInstancesPerVm(vgpuTypeId, &vgpuInstanceCountPerVm) + return int(vgpuInstanceCountPerVm), ret } // nvml.VgpuInstanceGetVmID() -func VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { - var VmIdType VgpuVmIdType - VmId := make([]byte, DEVICE_UUID_BUFFER_SIZE) - ret := nvmlVgpuInstanceGetVmID(VgpuInstance, &VmId[0], DEVICE_UUID_BUFFER_SIZE, &VmIdType) - return string(VmId[:clen(VmId)]), VmIdType, ret +func (l *library) VgpuInstanceGetVmID(vgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) { + return vgpuInstance.GetVmID() } -func (VgpuInstance VgpuInstance) GetVmID() (string, VgpuVmIdType, Return) { - return VgpuInstanceGetVmID(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetVmID() (string, VgpuVmIdType, Return) { + var vmIdType VgpuVmIdType + vmId := make([]byte, DEVICE_UUID_BUFFER_SIZE) + ret := nvmlVgpuInstanceGetVmID(vgpuInstance, &vmId[0], DEVICE_UUID_BUFFER_SIZE, &vmIdType) + return string(vmId[:clen(vmId)]), vmIdType, ret } // nvml.VgpuInstanceGetUUID() -func VgpuInstanceGetUUID(VgpuInstance VgpuInstance) (string, Return) { - Uuid := make([]byte, DEVICE_UUID_BUFFER_SIZE) - ret := nvmlVgpuInstanceGetUUID(VgpuInstance, &Uuid[0], DEVICE_UUID_BUFFER_SIZE) - return string(Uuid[:clen(Uuid)]), ret +func (l *library) VgpuInstanceGetUUID(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetUUID() } -func (VgpuInstance VgpuInstance) GetUUID() (string, Return) { - return VgpuInstanceGetUUID(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetUUID() (string, Return) { + uuid := make([]byte, DEVICE_UUID_BUFFER_SIZE) + ret := nvmlVgpuInstanceGetUUID(vgpuInstance, &uuid[0], DEVICE_UUID_BUFFER_SIZE) + return string(uuid[:clen(uuid)]), ret } // nvml.VgpuInstanceGetVmDriverVersion() -func VgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance) (string, Return) { - Version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE) - ret := nvmlVgpuInstanceGetVmDriverVersion(VgpuInstance, &Version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE) - return string(Version[:clen(Version)]), ret +func (l *library) VgpuInstanceGetVmDriverVersion(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetVmDriverVersion() } -func (VgpuInstance VgpuInstance) GetVmDriverVersion() (string, Return) { - return VgpuInstanceGetVmDriverVersion(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetVmDriverVersion() (string, Return) { + version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE) + ret := nvmlVgpuInstanceGetVmDriverVersion(vgpuInstance, &version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE) + return string(version[:clen(version)]), ret } // nvml.VgpuInstanceGetFbUsage() -func VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) { - var FbUsage uint64 - ret := nvmlVgpuInstanceGetFbUsage(VgpuInstance, &FbUsage) - return FbUsage, ret +func (l *library) VgpuInstanceGetFbUsage(vgpuInstance VgpuInstance) (uint64, Return) { + return vgpuInstance.GetFbUsage() } -func (VgpuInstance VgpuInstance) GetFbUsage() (uint64, Return) { - return VgpuInstanceGetFbUsage(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetFbUsage() (uint64, Return) { + var fbUsage uint64 + ret := nvmlVgpuInstanceGetFbUsage(vgpuInstance, &fbUsage) + return fbUsage, ret } // nvml.VgpuInstanceGetLicenseInfo() -func VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { - var LicenseInfo VgpuLicenseInfo - ret := nvmlVgpuInstanceGetLicenseInfo(VgpuInstance, &LicenseInfo) - return LicenseInfo, ret +func (l *library) VgpuInstanceGetLicenseInfo(vgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) { + return vgpuInstance.GetLicenseInfo() } -func (VgpuInstance VgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { - return VgpuInstanceGetLicenseInfo(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) { + var licenseInfo VgpuLicenseInfo + ret := nvmlVgpuInstanceGetLicenseInfo(vgpuInstance, &licenseInfo) + return licenseInfo, ret } // nvml.VgpuInstanceGetLicenseStatus() -func VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) { - var Licensed uint32 - ret := nvmlVgpuInstanceGetLicenseStatus(VgpuInstance, &Licensed) - return int(Licensed), ret +func (l *library) VgpuInstanceGetLicenseStatus(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetLicenseStatus() } -func (VgpuInstance VgpuInstance) GetLicenseStatus() (int, Return) { - return VgpuInstanceGetLicenseStatus(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetLicenseStatus() (int, Return) { + var licensed uint32 + ret := nvmlVgpuInstanceGetLicenseStatus(vgpuInstance, &licensed) + return int(licensed), ret } // nvml.VgpuInstanceGetType() -func VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) { - var VgpuTypeId VgpuTypeId - ret := nvmlVgpuInstanceGetType(VgpuInstance, &VgpuTypeId) - return VgpuTypeId, ret +func (l *library) VgpuInstanceGetType(vgpuInstance VgpuInstance) (VgpuTypeId, Return) { + return vgpuInstance.GetType() } -func (VgpuInstance VgpuInstance) GetType() (VgpuTypeId, Return) { - return VgpuInstanceGetType(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetType() (VgpuTypeId, Return) { + var vgpuTypeId nvmlVgpuTypeId + ret := nvmlVgpuInstanceGetType(vgpuInstance, &vgpuTypeId) + return vgpuTypeId, ret } // nvml.VgpuInstanceGetFrameRateLimit() -func VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) { - var FrameRateLimit uint32 - ret := nvmlVgpuInstanceGetFrameRateLimit(VgpuInstance, &FrameRateLimit) - return FrameRateLimit, ret +func (l *library) VgpuInstanceGetFrameRateLimit(vgpuInstance VgpuInstance) (uint32, Return) { + return vgpuInstance.GetFrameRateLimit() } -func (VgpuInstance VgpuInstance) GetFrameRateLimit() (uint32, Return) { - return VgpuInstanceGetFrameRateLimit(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetFrameRateLimit() (uint32, Return) { + var frameRateLimit uint32 + ret := nvmlVgpuInstanceGetFrameRateLimit(vgpuInstance, &frameRateLimit) + return frameRateLimit, ret } // nvml.VgpuInstanceGetEccMode() -func VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) { - var EccMode EnableState - ret := nvmlVgpuInstanceGetEccMode(VgpuInstance, &EccMode) - return EccMode, ret +func (l *library) VgpuInstanceGetEccMode(vgpuInstance VgpuInstance) (EnableState, Return) { + return vgpuInstance.GetEccMode() } -func (VgpuInstance VgpuInstance) GetEccMode() (EnableState, Return) { - return VgpuInstanceGetEccMode(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetEccMode() (EnableState, Return) { + var eccMode EnableState + ret := nvmlVgpuInstanceGetEccMode(vgpuInstance, &eccMode) + return eccMode, ret } // nvml.VgpuInstanceGetEncoderCapacity() -func VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) { - var EncoderCapacity uint32 - ret := nvmlVgpuInstanceGetEncoderCapacity(VgpuInstance, &EncoderCapacity) - return int(EncoderCapacity), ret +func (l *library) VgpuInstanceGetEncoderCapacity(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetEncoderCapacity() } -func (VgpuInstance VgpuInstance) GetEncoderCapacity() (int, Return) { - return VgpuInstanceGetEncoderCapacity(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetEncoderCapacity() (int, Return) { + var encoderCapacity uint32 + ret := nvmlVgpuInstanceGetEncoderCapacity(vgpuInstance, &encoderCapacity) + return int(encoderCapacity), ret } // nvml.VgpuInstanceSetEncoderCapacity() -func VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return { - return nvmlVgpuInstanceSetEncoderCapacity(VgpuInstance, uint32(EncoderCapacity)) +func (l *library) VgpuInstanceSetEncoderCapacity(vgpuInstance VgpuInstance, encoderCapacity int) Return { + return vgpuInstance.SetEncoderCapacity(encoderCapacity) } -func (VgpuInstance VgpuInstance) SetEncoderCapacity(EncoderCapacity int) Return { - return VgpuInstanceSetEncoderCapacity(VgpuInstance, EncoderCapacity) +func (vgpuInstance nvmlVgpuInstance) SetEncoderCapacity(encoderCapacity int) Return { + return nvmlVgpuInstanceSetEncoderCapacity(vgpuInstance, uint32(encoderCapacity)) } // nvml.VgpuInstanceGetEncoderStats() -func VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) { - var SessionCount, AverageFps, AverageLatency uint32 - ret := nvmlVgpuInstanceGetEncoderStats(VgpuInstance, &SessionCount, &AverageFps, &AverageLatency) - return int(SessionCount), AverageFps, AverageLatency, ret +func (l *library) VgpuInstanceGetEncoderStats(vgpuInstance VgpuInstance) (int, uint32, uint32, Return) { + return vgpuInstance.GetEncoderStats() } -func (VgpuInstance VgpuInstance) GetEncoderStats() (int, uint32, uint32, Return) { - return VgpuInstanceGetEncoderStats(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetEncoderStats() (int, uint32, uint32, Return) { + var sessionCount, averageFps, averageLatency uint32 + ret := nvmlVgpuInstanceGetEncoderStats(vgpuInstance, &sessionCount, &averageFps, &averageLatency) + return int(sessionCount), averageFps, averageLatency, ret } // nvml.VgpuInstanceGetEncoderSessions() -func VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { - var SessionCount uint32 - var SessionInfo EncoderSessionInfo - ret := nvmlVgpuInstanceGetEncoderSessions(VgpuInstance, &SessionCount, &SessionInfo) - return int(SessionCount), SessionInfo, ret +func (l *library) VgpuInstanceGetEncoderSessions(vgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) { + return vgpuInstance.GetEncoderSessions() } -func (VgpuInstance VgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) { - return VgpuInstanceGetEncoderSessions(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) { + var sessionCount uint32 + var sessionInfo EncoderSessionInfo + ret := nvmlVgpuInstanceGetEncoderSessions(vgpuInstance, &sessionCount, &sessionInfo) + return int(sessionCount), sessionInfo, ret } // nvml.VgpuInstanceGetFBCStats() -func VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) { - var FbcStats FBCStats - ret := nvmlVgpuInstanceGetFBCStats(VgpuInstance, &FbcStats) - return FbcStats, ret +func (l *library) VgpuInstanceGetFBCStats(vgpuInstance VgpuInstance) (FBCStats, Return) { + return vgpuInstance.GetFBCStats() } -func (VgpuInstance VgpuInstance) GetFBCStats() (FBCStats, Return) { - return VgpuInstanceGetFBCStats(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetFBCStats() (FBCStats, Return) { + var fbcStats FBCStats + ret := nvmlVgpuInstanceGetFBCStats(vgpuInstance, &fbcStats) + return fbcStats, ret } // nvml.VgpuInstanceGetFBCSessions() -func VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { - var SessionCount uint32 - var SessionInfo FBCSessionInfo - ret := nvmlVgpuInstanceGetFBCSessions(VgpuInstance, &SessionCount, &SessionInfo) - return int(SessionCount), SessionInfo, ret +func (l *library) VgpuInstanceGetFBCSessions(vgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) { + return vgpuInstance.GetFBCSessions() } -func (VgpuInstance VgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) { - return VgpuInstanceGetFBCSessions(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) { + var sessionCount uint32 + var sessionInfo FBCSessionInfo + ret := nvmlVgpuInstanceGetFBCSessions(vgpuInstance, &sessionCount, &sessionInfo) + return int(sessionCount), sessionInfo, ret } // nvml.VgpuInstanceGetGpuInstanceId() -func VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) { +func (l *library) VgpuInstanceGetGpuInstanceId(vgpuInstance VgpuInstance) (int, Return) { + return vgpuInstance.GetGpuInstanceId() +} + +func (vgpuInstance nvmlVgpuInstance) GetGpuInstanceId() (int, Return) { var gpuInstanceId uint32 - ret := nvmlVgpuInstanceGetGpuInstanceId(VgpuInstance, &gpuInstanceId) + ret := nvmlVgpuInstanceGetGpuInstanceId(vgpuInstance, &gpuInstanceId) return int(gpuInstanceId), ret } -func (VgpuInstance VgpuInstance) GetGpuInstanceId() (int, Return) { - return VgpuInstanceGetGpuInstanceId(VgpuInstance) +// nvml.VgpuInstanceGetGpuPciId() +func (l *library) VgpuInstanceGetGpuPciId(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetGpuPciId() } -// nvml.VgpuInstanceGetGpuPciId() -func VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Return) { - var Length uint32 = 1 // Will be reduced upon returning +func (vgpuInstance nvmlVgpuInstance) GetGpuPciId() (string, Return) { + var length uint32 = 1 // Will be reduced upon returning for { - VgpuPciId := make([]byte, Length) - ret := nvmlVgpuInstanceGetGpuPciId(VgpuInstance, &VgpuPciId[0], &Length) + vgpuPciId := make([]byte, length) + ret := nvmlVgpuInstanceGetGpuPciId(vgpuInstance, &vgpuPciId[0], &length) if ret == SUCCESS { - return string(VgpuPciId[:clen(VgpuPciId)]), ret + return string(vgpuPciId[:clen(vgpuPciId)]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return "", ret } - Length *= 2 + length *= 2 } } -func (VgpuInstance VgpuInstance) GetGpuPciId() (string, Return) { - return VgpuInstanceGetGpuPciId(VgpuInstance) +// nvml.VgpuInstanceGetMetadata() +func (l *library) VgpuInstanceGetMetadata(vgpuInstance VgpuInstance) (VgpuMetadata, Return) { + return vgpuInstance.GetMetadata() } -// nvml.VgpuInstanceGetMetadata() -func VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) { - var VgpuMetadata VgpuMetadata - OpaqueDataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata.OpaqueData) - VgpuMetadataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata) - OpaqueDataSize +func (vgpuInstance nvmlVgpuInstance) GetMetadata() (VgpuMetadata, Return) { + var vgpuMetadata VgpuMetadata + opaqueDataSize := unsafe.Sizeof(vgpuMetadata.nvmlVgpuMetadata.OpaqueData) + vgpuMetadataSize := unsafe.Sizeof(vgpuMetadata.nvmlVgpuMetadata) - opaqueDataSize for { - BufferSize := uint32(VgpuMetadataSize + OpaqueDataSize) - Buffer := make([]byte, BufferSize) - nvmlVgpuMetadataPtr := (*nvmlVgpuMetadata)(unsafe.Pointer(&Buffer[0])) - ret := nvmlVgpuInstanceGetMetadata(VgpuInstance, nvmlVgpuMetadataPtr, &BufferSize) + bufferSize := uint32(vgpuMetadataSize + opaqueDataSize) + buffer := make([]byte, bufferSize) + nvmlVgpuMetadataPtr := (*nvmlVgpuMetadata)(unsafe.Pointer(&buffer[0])) + ret := nvmlVgpuInstanceGetMetadata(vgpuInstance, nvmlVgpuMetadataPtr, &bufferSize) if ret == SUCCESS { - VgpuMetadata.nvmlVgpuMetadata = *nvmlVgpuMetadataPtr - VgpuMetadata.OpaqueData = Buffer[VgpuMetadataSize:BufferSize] - return VgpuMetadata, ret + vgpuMetadata.nvmlVgpuMetadata = *nvmlVgpuMetadataPtr + vgpuMetadata.OpaqueData = buffer[vgpuMetadataSize:bufferSize] + return vgpuMetadata, ret } if ret != ERROR_INSUFFICIENT_SIZE { - return VgpuMetadata, ret + return vgpuMetadata, ret } - OpaqueDataSize = 2 * OpaqueDataSize + opaqueDataSize = 2 * opaqueDataSize } } -func (VgpuInstance VgpuInstance) GetMetadata() (VgpuMetadata, Return) { - return VgpuInstanceGetMetadata(VgpuInstance) -} - // nvml.VgpuInstanceGetAccountingMode() -func VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) { - var Mode EnableState - ret := nvmlVgpuInstanceGetAccountingMode(VgpuInstance, &Mode) - return Mode, ret +func (l *library) VgpuInstanceGetAccountingMode(vgpuInstance VgpuInstance) (EnableState, Return) { + return vgpuInstance.GetAccountingMode() } -func (VgpuInstance VgpuInstance) GetAccountingMode() (EnableState, Return) { - return VgpuInstanceGetAccountingMode(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetAccountingMode() (EnableState, Return) { + var mode EnableState + ret := nvmlVgpuInstanceGetAccountingMode(vgpuInstance, &mode) + return mode, ret } // nvml.VgpuInstanceGetAccountingPids() -func VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]int, Return) { - var Count uint32 = 1 // Will be reduced upon returning +func (l *library) VgpuInstanceGetAccountingPids(vgpuInstance VgpuInstance) ([]int, Return) { + return vgpuInstance.GetAccountingPids() +} + +func (vgpuInstance nvmlVgpuInstance) GetAccountingPids() ([]int, Return) { + var count uint32 = 1 // Will be reduced upon returning for { - Pids := make([]uint32, Count) - ret := nvmlVgpuInstanceGetAccountingPids(VgpuInstance, &Count, &Pids[0]) + pids := make([]uint32, count) + ret := nvmlVgpuInstanceGetAccountingPids(vgpuInstance, &count, &pids[0]) if ret == SUCCESS { - return uint32SliceToIntSlice(Pids[:Count]), ret + return uint32SliceToIntSlice(pids[:count]), ret } if ret != ERROR_INSUFFICIENT_SIZE { return nil, ret } - Count *= 2 + count *= 2 } } -func (VgpuInstance VgpuInstance) GetAccountingPids() ([]int, Return) { - return VgpuInstanceGetAccountingPids(VgpuInstance) -} - // nvml.VgpuInstanceGetAccountingStats() -func VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) { - var Stats AccountingStats - ret := nvmlVgpuInstanceGetAccountingStats(VgpuInstance, uint32(Pid), &Stats) - return Stats, ret +func (l *library) VgpuInstanceGetAccountingStats(vgpuInstance VgpuInstance, pid int) (AccountingStats, Return) { + return vgpuInstance.GetAccountingStats(pid) } -func (VgpuInstance VgpuInstance) GetAccountingStats(Pid int) (AccountingStats, Return) { - return VgpuInstanceGetAccountingStats(VgpuInstance, Pid) +func (vgpuInstance nvmlVgpuInstance) GetAccountingStats(pid int) (AccountingStats, Return) { + var stats AccountingStats + ret := nvmlVgpuInstanceGetAccountingStats(vgpuInstance, uint32(pid), &stats) + return stats, ret } // nvml.GetVgpuCompatibility() -func GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { - var CompatibilityInfo VgpuPgpuCompatibility - ret := nvmlGetVgpuCompatibility(nvmlVgpuMetadata, PgpuMetadata, &CompatibilityInfo) - return CompatibilityInfo, ret +func (l *library) GetVgpuCompatibility(vgpuMetadata *VgpuMetadata, pgpuMetadata *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) { + var compatibilityInfo VgpuPgpuCompatibility + ret := nvmlGetVgpuCompatibility(&vgpuMetadata.nvmlVgpuMetadata, &pgpuMetadata.nvmlVgpuPgpuMetadata, &compatibilityInfo) + return compatibilityInfo, ret } // nvml.GetVgpuVersion() -func GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) { - var Supported, Current VgpuVersion - ret := nvmlGetVgpuVersion(&Supported, &Current) - return Supported, Current, ret +func (l *library) GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) { + var supported, current VgpuVersion + ret := nvmlGetVgpuVersion(&supported, ¤t) + return supported, current, ret } // nvml.SetVgpuVersion() -func SetVgpuVersion(VgpuVersion *VgpuVersion) Return { - return nvmlSetVgpuVersion(VgpuVersion) +func (l *library) SetVgpuVersion(vgpuVersion *VgpuVersion) Return { + return nvmlSetVgpuVersion(vgpuVersion) } // nvml.VgpuInstanceClearAccountingPids() -func VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return { - return nvmlVgpuInstanceClearAccountingPids(VgpuInstance) +func (l *library) VgpuInstanceClearAccountingPids(vgpuInstance VgpuInstance) Return { + return vgpuInstance.ClearAccountingPids() } -func (VgpuInstance VgpuInstance) ClearAccountingPids() Return { - return VgpuInstanceClearAccountingPids(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) ClearAccountingPids() Return { + return nvmlVgpuInstanceClearAccountingPids(vgpuInstance) } // nvml.VgpuInstanceGetMdevUUID() -func VgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance) (string, Return) { - MdevUuid := make([]byte, DEVICE_UUID_BUFFER_SIZE) - ret := nvmlVgpuInstanceGetMdevUUID(VgpuInstance, &MdevUuid[0], DEVICE_UUID_BUFFER_SIZE) - return string(MdevUuid[:clen(MdevUuid)]), ret +func (l *library) VgpuInstanceGetMdevUUID(vgpuInstance VgpuInstance) (string, Return) { + return vgpuInstance.GetMdevUUID() } -func (VgpuInstance VgpuInstance) GetMdevUUID() (string, Return) { - return VgpuInstanceGetMdevUUID(VgpuInstance) +func (vgpuInstance nvmlVgpuInstance) GetMdevUUID() (string, Return) { + mdevUUID := make([]byte, DEVICE_UUID_BUFFER_SIZE) + ret := nvmlVgpuInstanceGetMdevUUID(vgpuInstance, &mdevUUID[0], DEVICE_UUID_BUFFER_SIZE) + return string(mdevUUID[:clen(mdevUUID)]), ret } // nvml.VgpuTypeGetCapabilities() -func VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) { - var CapResult uint32 - ret := nvmlVgpuTypeGetCapabilities(VgpuTypeId, Capability, &CapResult) - return (CapResult != 0), ret +func (l *library) VgpuTypeGetCapabilities(vgpuTypeId VgpuTypeId, capability VgpuCapability) (bool, Return) { + return vgpuTypeId.GetCapabilities(capability) } -func (VgpuTypeId VgpuTypeId) GetCapabilities(Capability VgpuCapability) (bool, Return) { - return VgpuTypeGetCapabilities(VgpuTypeId, Capability) +func (vgpuTypeId nvmlVgpuTypeId) GetCapabilities(capability VgpuCapability) (bool, Return) { + var capResult uint32 + ret := nvmlVgpuTypeGetCapabilities(vgpuTypeId, capability, &capResult) + return (capResult != 0), ret } // nvml.GetVgpuDriverCapabilities() -func GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) { - var CapResult uint32 - ret := nvmlGetVgpuDriverCapabilities(Capability, &CapResult) - return (CapResult != 0), ret +func (l *library) GetVgpuDriverCapabilities(capability VgpuDriverCapability) (bool, Return) { + var capResult uint32 + ret := nvmlGetVgpuDriverCapabilities(capability, &capResult) + return (capResult != 0), ret } diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go new file mode 100644 index 00000000..9997a275 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go @@ -0,0 +1,919 @@ +/** +# Copyright 2024 NVIDIA CORPORATION +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +**/ + +// Generated Code; DO NOT EDIT. + +package nvml + +// The variables below represent package level methods from the library type. +var ( + ComputeInstanceDestroy = libnvml.ComputeInstanceDestroy + ComputeInstanceGetInfo = libnvml.ComputeInstanceGetInfo + DeviceCcuGetStreamState = libnvml.DeviceCcuGetStreamState + DeviceCcuSetStreamState = libnvml.DeviceCcuSetStreamState + DeviceClearAccountingPids = libnvml.DeviceClearAccountingPids + DeviceClearCpuAffinity = libnvml.DeviceClearCpuAffinity + DeviceClearEccErrorCounts = libnvml.DeviceClearEccErrorCounts + DeviceClearFieldValues = libnvml.DeviceClearFieldValues + DeviceCreateGpuInstance = libnvml.DeviceCreateGpuInstance + DeviceCreateGpuInstanceWithPlacement = libnvml.DeviceCreateGpuInstanceWithPlacement + DeviceDiscoverGpus = libnvml.DeviceDiscoverGpus + DeviceFreezeNvLinkUtilizationCounter = libnvml.DeviceFreezeNvLinkUtilizationCounter + DeviceGetAPIRestriction = libnvml.DeviceGetAPIRestriction + DeviceGetAccountingBufferSize = libnvml.DeviceGetAccountingBufferSize + DeviceGetAccountingMode = libnvml.DeviceGetAccountingMode + DeviceGetAccountingPids = libnvml.DeviceGetAccountingPids + DeviceGetAccountingStats = libnvml.DeviceGetAccountingStats + DeviceGetActiveVgpus = libnvml.DeviceGetActiveVgpus + DeviceGetAdaptiveClockInfoStatus = libnvml.DeviceGetAdaptiveClockInfoStatus + DeviceGetApplicationsClock = libnvml.DeviceGetApplicationsClock + DeviceGetArchitecture = libnvml.DeviceGetArchitecture + DeviceGetAttributes = libnvml.DeviceGetAttributes + DeviceGetAutoBoostedClocksEnabled = libnvml.DeviceGetAutoBoostedClocksEnabled + DeviceGetBAR1MemoryInfo = libnvml.DeviceGetBAR1MemoryInfo + DeviceGetBoardId = libnvml.DeviceGetBoardId + DeviceGetBoardPartNumber = libnvml.DeviceGetBoardPartNumber + DeviceGetBrand = libnvml.DeviceGetBrand + DeviceGetBridgeChipInfo = libnvml.DeviceGetBridgeChipInfo + DeviceGetBusType = libnvml.DeviceGetBusType + DeviceGetClkMonStatus = libnvml.DeviceGetClkMonStatus + DeviceGetClock = libnvml.DeviceGetClock + DeviceGetClockInfo = libnvml.DeviceGetClockInfo + DeviceGetComputeInstanceId = libnvml.DeviceGetComputeInstanceId + DeviceGetComputeMode = libnvml.DeviceGetComputeMode + DeviceGetComputeRunningProcesses = libnvml.DeviceGetComputeRunningProcesses + DeviceGetCount = libnvml.DeviceGetCount + DeviceGetCpuAffinity = libnvml.DeviceGetCpuAffinity + DeviceGetCpuAffinityWithinScope = libnvml.DeviceGetCpuAffinityWithinScope + DeviceGetCreatableVgpus = libnvml.DeviceGetCreatableVgpus + DeviceGetCudaComputeCapability = libnvml.DeviceGetCudaComputeCapability + DeviceGetCurrPcieLinkGeneration = libnvml.DeviceGetCurrPcieLinkGeneration + DeviceGetCurrPcieLinkWidth = libnvml.DeviceGetCurrPcieLinkWidth + DeviceGetCurrentClocksThrottleReasons = libnvml.DeviceGetCurrentClocksThrottleReasons + DeviceGetDecoderUtilization = libnvml.DeviceGetDecoderUtilization + DeviceGetDefaultApplicationsClock = libnvml.DeviceGetDefaultApplicationsClock + DeviceGetDefaultEccMode = libnvml.DeviceGetDefaultEccMode + DeviceGetDetailedEccErrors = libnvml.DeviceGetDetailedEccErrors + DeviceGetDeviceHandleFromMigDeviceHandle = libnvml.DeviceGetDeviceHandleFromMigDeviceHandle + DeviceGetDisplayActive = libnvml.DeviceGetDisplayActive + DeviceGetDisplayMode = libnvml.DeviceGetDisplayMode + DeviceGetDriverModel = libnvml.DeviceGetDriverModel + DeviceGetDynamicPstatesInfo = libnvml.DeviceGetDynamicPstatesInfo + DeviceGetEccMode = libnvml.DeviceGetEccMode + DeviceGetEncoderCapacity = libnvml.DeviceGetEncoderCapacity + DeviceGetEncoderSessions = libnvml.DeviceGetEncoderSessions + DeviceGetEncoderStats = libnvml.DeviceGetEncoderStats + DeviceGetEncoderUtilization = libnvml.DeviceGetEncoderUtilization + DeviceGetEnforcedPowerLimit = libnvml.DeviceGetEnforcedPowerLimit + DeviceGetFBCSessions = libnvml.DeviceGetFBCSessions + DeviceGetFBCStats = libnvml.DeviceGetFBCStats + DeviceGetFanControlPolicy_v2 = libnvml.DeviceGetFanControlPolicy_v2 + DeviceGetFanSpeed = libnvml.DeviceGetFanSpeed + DeviceGetFanSpeed_v2 = libnvml.DeviceGetFanSpeed_v2 + DeviceGetFieldValues = libnvml.DeviceGetFieldValues + DeviceGetGpcClkMinMaxVfOffset = libnvml.DeviceGetGpcClkMinMaxVfOffset + DeviceGetGpcClkVfOffset = libnvml.DeviceGetGpcClkVfOffset + DeviceGetGpuFabricInfo = libnvml.DeviceGetGpuFabricInfo + DeviceGetGpuInstanceById = libnvml.DeviceGetGpuInstanceById + DeviceGetGpuInstanceId = libnvml.DeviceGetGpuInstanceId + DeviceGetGpuInstancePossiblePlacements = libnvml.DeviceGetGpuInstancePossiblePlacements + DeviceGetGpuInstanceProfileInfo = libnvml.DeviceGetGpuInstanceProfileInfo + DeviceGetGpuInstanceProfileInfoV = libnvml.DeviceGetGpuInstanceProfileInfoV + DeviceGetGpuInstanceRemainingCapacity = libnvml.DeviceGetGpuInstanceRemainingCapacity + DeviceGetGpuInstances = libnvml.DeviceGetGpuInstances + DeviceGetGpuMaxPcieLinkGeneration = libnvml.DeviceGetGpuMaxPcieLinkGeneration + DeviceGetGpuOperationMode = libnvml.DeviceGetGpuOperationMode + DeviceGetGraphicsRunningProcesses = libnvml.DeviceGetGraphicsRunningProcesses + DeviceGetGridLicensableFeatures = libnvml.DeviceGetGridLicensableFeatures + DeviceGetGspFirmwareMode = libnvml.DeviceGetGspFirmwareMode + DeviceGetGspFirmwareVersion = libnvml.DeviceGetGspFirmwareVersion + DeviceGetHandleByIndex = libnvml.DeviceGetHandleByIndex + DeviceGetHandleByPciBusId = libnvml.DeviceGetHandleByPciBusId + DeviceGetHandleBySerial = libnvml.DeviceGetHandleBySerial + DeviceGetHandleByUUID = libnvml.DeviceGetHandleByUUID + DeviceGetHostVgpuMode = libnvml.DeviceGetHostVgpuMode + DeviceGetIndex = libnvml.DeviceGetIndex + DeviceGetInforomConfigurationChecksum = libnvml.DeviceGetInforomConfigurationChecksum + DeviceGetInforomImageVersion = libnvml.DeviceGetInforomImageVersion + DeviceGetInforomVersion = libnvml.DeviceGetInforomVersion + DeviceGetIrqNum = libnvml.DeviceGetIrqNum + DeviceGetMPSComputeRunningProcesses = libnvml.DeviceGetMPSComputeRunningProcesses + DeviceGetMaxClockInfo = libnvml.DeviceGetMaxClockInfo + DeviceGetMaxCustomerBoostClock = libnvml.DeviceGetMaxCustomerBoostClock + DeviceGetMaxMigDeviceCount = libnvml.DeviceGetMaxMigDeviceCount + DeviceGetMaxPcieLinkGeneration = libnvml.DeviceGetMaxPcieLinkGeneration + DeviceGetMaxPcieLinkWidth = libnvml.DeviceGetMaxPcieLinkWidth + DeviceGetMemClkMinMaxVfOffset = libnvml.DeviceGetMemClkMinMaxVfOffset + DeviceGetMemClkVfOffset = libnvml.DeviceGetMemClkVfOffset + DeviceGetMemoryAffinity = libnvml.DeviceGetMemoryAffinity + DeviceGetMemoryBusWidth = libnvml.DeviceGetMemoryBusWidth + DeviceGetMemoryErrorCounter = libnvml.DeviceGetMemoryErrorCounter + DeviceGetMemoryInfo = libnvml.DeviceGetMemoryInfo + DeviceGetMemoryInfo_v2 = libnvml.DeviceGetMemoryInfo_v2 + DeviceGetMigDeviceHandleByIndex = libnvml.DeviceGetMigDeviceHandleByIndex + DeviceGetMigMode = libnvml.DeviceGetMigMode + DeviceGetMinMaxClockOfPState = libnvml.DeviceGetMinMaxClockOfPState + DeviceGetMinMaxFanSpeed = libnvml.DeviceGetMinMaxFanSpeed + DeviceGetMinorNumber = libnvml.DeviceGetMinorNumber + DeviceGetMultiGpuBoard = libnvml.DeviceGetMultiGpuBoard + DeviceGetName = libnvml.DeviceGetName + DeviceGetNumFans = libnvml.DeviceGetNumFans + DeviceGetNumGpuCores = libnvml.DeviceGetNumGpuCores + DeviceGetNvLinkCapability = libnvml.DeviceGetNvLinkCapability + DeviceGetNvLinkErrorCounter = libnvml.DeviceGetNvLinkErrorCounter + DeviceGetNvLinkRemoteDeviceType = libnvml.DeviceGetNvLinkRemoteDeviceType + DeviceGetNvLinkRemotePciInfo = libnvml.DeviceGetNvLinkRemotePciInfo + DeviceGetNvLinkState = libnvml.DeviceGetNvLinkState + DeviceGetNvLinkUtilizationControl = libnvml.DeviceGetNvLinkUtilizationControl + DeviceGetNvLinkUtilizationCounter = libnvml.DeviceGetNvLinkUtilizationCounter + DeviceGetNvLinkVersion = libnvml.DeviceGetNvLinkVersion + DeviceGetP2PStatus = libnvml.DeviceGetP2PStatus + DeviceGetPciInfo = libnvml.DeviceGetPciInfo + DeviceGetPcieLinkMaxSpeed = libnvml.DeviceGetPcieLinkMaxSpeed + DeviceGetPcieReplayCounter = libnvml.DeviceGetPcieReplayCounter + DeviceGetPcieSpeed = libnvml.DeviceGetPcieSpeed + DeviceGetPcieThroughput = libnvml.DeviceGetPcieThroughput + DeviceGetPerformanceState = libnvml.DeviceGetPerformanceState + DeviceGetPersistenceMode = libnvml.DeviceGetPersistenceMode + DeviceGetPgpuMetadataString = libnvml.DeviceGetPgpuMetadataString + DeviceGetPowerManagementDefaultLimit = libnvml.DeviceGetPowerManagementDefaultLimit + DeviceGetPowerManagementLimit = libnvml.DeviceGetPowerManagementLimit + DeviceGetPowerManagementLimitConstraints = libnvml.DeviceGetPowerManagementLimitConstraints + DeviceGetPowerManagementMode = libnvml.DeviceGetPowerManagementMode + DeviceGetPowerSource = libnvml.DeviceGetPowerSource + DeviceGetPowerState = libnvml.DeviceGetPowerState + DeviceGetPowerUsage = libnvml.DeviceGetPowerUsage + DeviceGetProcessUtilization = libnvml.DeviceGetProcessUtilization + DeviceGetRemappedRows = libnvml.DeviceGetRemappedRows + DeviceGetRetiredPages = libnvml.DeviceGetRetiredPages + DeviceGetRetiredPagesPendingStatus = libnvml.DeviceGetRetiredPagesPendingStatus + DeviceGetRetiredPages_v2 = libnvml.DeviceGetRetiredPages_v2 + DeviceGetRowRemapperHistogram = libnvml.DeviceGetRowRemapperHistogram + DeviceGetSamples = libnvml.DeviceGetSamples + DeviceGetSerial = libnvml.DeviceGetSerial + DeviceGetSupportedClocksThrottleReasons = libnvml.DeviceGetSupportedClocksThrottleReasons + DeviceGetSupportedEventTypes = libnvml.DeviceGetSupportedEventTypes + DeviceGetSupportedGraphicsClocks = libnvml.DeviceGetSupportedGraphicsClocks + DeviceGetSupportedMemoryClocks = libnvml.DeviceGetSupportedMemoryClocks + DeviceGetSupportedPerformanceStates = libnvml.DeviceGetSupportedPerformanceStates + DeviceGetSupportedVgpus = libnvml.DeviceGetSupportedVgpus + DeviceGetTargetFanSpeed = libnvml.DeviceGetTargetFanSpeed + DeviceGetTemperature = libnvml.DeviceGetTemperature + DeviceGetTemperatureThreshold = libnvml.DeviceGetTemperatureThreshold + DeviceGetThermalSettings = libnvml.DeviceGetThermalSettings + DeviceGetTopologyCommonAncestor = libnvml.DeviceGetTopologyCommonAncestor + DeviceGetTopologyNearestGpus = libnvml.DeviceGetTopologyNearestGpus + DeviceGetTotalEccErrors = libnvml.DeviceGetTotalEccErrors + DeviceGetTotalEnergyConsumption = libnvml.DeviceGetTotalEnergyConsumption + DeviceGetUUID = libnvml.DeviceGetUUID + DeviceGetUtilizationRates = libnvml.DeviceGetUtilizationRates + DeviceGetVbiosVersion = libnvml.DeviceGetVbiosVersion + DeviceGetVgpuCapabilities = libnvml.DeviceGetVgpuCapabilities + DeviceGetVgpuMetadata = libnvml.DeviceGetVgpuMetadata + DeviceGetVgpuProcessUtilization = libnvml.DeviceGetVgpuProcessUtilization + DeviceGetVgpuSchedulerCapabilities = libnvml.DeviceGetVgpuSchedulerCapabilities + DeviceGetVgpuSchedulerLog = libnvml.DeviceGetVgpuSchedulerLog + DeviceGetVgpuSchedulerState = libnvml.DeviceGetVgpuSchedulerState + DeviceGetVgpuUtilization = libnvml.DeviceGetVgpuUtilization + DeviceGetViolationStatus = libnvml.DeviceGetViolationStatus + DeviceGetVirtualizationMode = libnvml.DeviceGetVirtualizationMode + DeviceIsMigDeviceHandle = libnvml.DeviceIsMigDeviceHandle + DeviceModifyDrainState = libnvml.DeviceModifyDrainState + DeviceOnSameBoard = libnvml.DeviceOnSameBoard + DeviceQueryDrainState = libnvml.DeviceQueryDrainState + DeviceRegisterEvents = libnvml.DeviceRegisterEvents + DeviceRemoveGpu = libnvml.DeviceRemoveGpu + DeviceRemoveGpu_v2 = libnvml.DeviceRemoveGpu_v2 + DeviceResetApplicationsClocks = libnvml.DeviceResetApplicationsClocks + DeviceResetGpuLockedClocks = libnvml.DeviceResetGpuLockedClocks + DeviceResetMemoryLockedClocks = libnvml.DeviceResetMemoryLockedClocks + DeviceResetNvLinkErrorCounters = libnvml.DeviceResetNvLinkErrorCounters + DeviceResetNvLinkUtilizationCounter = libnvml.DeviceResetNvLinkUtilizationCounter + DeviceSetAPIRestriction = libnvml.DeviceSetAPIRestriction + DeviceSetAccountingMode = libnvml.DeviceSetAccountingMode + DeviceSetApplicationsClocks = libnvml.DeviceSetApplicationsClocks + DeviceSetAutoBoostedClocksEnabled = libnvml.DeviceSetAutoBoostedClocksEnabled + DeviceSetComputeMode = libnvml.DeviceSetComputeMode + DeviceSetCpuAffinity = libnvml.DeviceSetCpuAffinity + DeviceSetDefaultAutoBoostedClocksEnabled = libnvml.DeviceSetDefaultAutoBoostedClocksEnabled + DeviceSetDefaultFanSpeed_v2 = libnvml.DeviceSetDefaultFanSpeed_v2 + DeviceSetDriverModel = libnvml.DeviceSetDriverModel + DeviceSetEccMode = libnvml.DeviceSetEccMode + DeviceSetFanControlPolicy = libnvml.DeviceSetFanControlPolicy + DeviceSetFanSpeed_v2 = libnvml.DeviceSetFanSpeed_v2 + DeviceSetGpcClkVfOffset = libnvml.DeviceSetGpcClkVfOffset + DeviceSetGpuLockedClocks = libnvml.DeviceSetGpuLockedClocks + DeviceSetGpuOperationMode = libnvml.DeviceSetGpuOperationMode + DeviceSetMemClkVfOffset = libnvml.DeviceSetMemClkVfOffset + DeviceSetMemoryLockedClocks = libnvml.DeviceSetMemoryLockedClocks + DeviceSetMigMode = libnvml.DeviceSetMigMode + DeviceSetNvLinkDeviceLowPowerThreshold = libnvml.DeviceSetNvLinkDeviceLowPowerThreshold + DeviceSetNvLinkUtilizationControl = libnvml.DeviceSetNvLinkUtilizationControl + DeviceSetPersistenceMode = libnvml.DeviceSetPersistenceMode + DeviceSetPowerManagementLimit = libnvml.DeviceSetPowerManagementLimit + DeviceSetTemperatureThreshold = libnvml.DeviceSetTemperatureThreshold + DeviceSetVgpuSchedulerState = libnvml.DeviceSetVgpuSchedulerState + DeviceSetVirtualizationMode = libnvml.DeviceSetVirtualizationMode + DeviceValidateInforom = libnvml.DeviceValidateInforom + ErrorString = libnvml.ErrorString + EventSetCreate = libnvml.EventSetCreate + EventSetFree = libnvml.EventSetFree + EventSetWait = libnvml.EventSetWait + Extensions = libnvml.Extensions + GetExcludedDeviceCount = libnvml.GetExcludedDeviceCount + GetExcludedDeviceInfoByIndex = libnvml.GetExcludedDeviceInfoByIndex + GetVgpuCompatibility = libnvml.GetVgpuCompatibility + GetVgpuDriverCapabilities = libnvml.GetVgpuDriverCapabilities + GetVgpuVersion = libnvml.GetVgpuVersion + GpmMetricsGet = libnvml.GpmMetricsGet + GpmMetricsGetV = libnvml.GpmMetricsGetV + GpmMigSampleGet = libnvml.GpmMigSampleGet + GpmQueryDeviceSupport = libnvml.GpmQueryDeviceSupport + GpmQueryDeviceSupportV = libnvml.GpmQueryDeviceSupportV + GpmSampleAlloc = libnvml.GpmSampleAlloc + GpmSampleFree = libnvml.GpmSampleFree + GpmSampleGet = libnvml.GpmSampleGet + GpuInstanceCreateComputeInstance = libnvml.GpuInstanceCreateComputeInstance + GpuInstanceCreateComputeInstanceWithPlacement = libnvml.GpuInstanceCreateComputeInstanceWithPlacement + GpuInstanceDestroy = libnvml.GpuInstanceDestroy + GpuInstanceGetComputeInstanceById = libnvml.GpuInstanceGetComputeInstanceById + GpuInstanceGetComputeInstancePossiblePlacements = libnvml.GpuInstanceGetComputeInstancePossiblePlacements + GpuInstanceGetComputeInstanceProfileInfo = libnvml.GpuInstanceGetComputeInstanceProfileInfo + GpuInstanceGetComputeInstanceProfileInfoV = libnvml.GpuInstanceGetComputeInstanceProfileInfoV + GpuInstanceGetComputeInstanceRemainingCapacity = libnvml.GpuInstanceGetComputeInstanceRemainingCapacity + GpuInstanceGetComputeInstances = libnvml.GpuInstanceGetComputeInstances + GpuInstanceGetInfo = libnvml.GpuInstanceGetInfo + Init = libnvml.Init + InitWithFlags = libnvml.InitWithFlags + SetVgpuVersion = libnvml.SetVgpuVersion + Shutdown = libnvml.Shutdown + SystemGetCudaDriverVersion = libnvml.SystemGetCudaDriverVersion + SystemGetCudaDriverVersion_v2 = libnvml.SystemGetCudaDriverVersion_v2 + SystemGetDriverVersion = libnvml.SystemGetDriverVersion + SystemGetHicVersion = libnvml.SystemGetHicVersion + SystemGetNVMLVersion = libnvml.SystemGetNVMLVersion + SystemGetProcessName = libnvml.SystemGetProcessName + SystemGetTopologyGpuSet = libnvml.SystemGetTopologyGpuSet + UnitGetCount = libnvml.UnitGetCount + UnitGetDevices = libnvml.UnitGetDevices + UnitGetFanSpeedInfo = libnvml.UnitGetFanSpeedInfo + UnitGetHandleByIndex = libnvml.UnitGetHandleByIndex + UnitGetLedState = libnvml.UnitGetLedState + UnitGetPsuInfo = libnvml.UnitGetPsuInfo + UnitGetTemperature = libnvml.UnitGetTemperature + UnitGetUnitInfo = libnvml.UnitGetUnitInfo + UnitSetLedState = libnvml.UnitSetLedState + VgpuInstanceClearAccountingPids = libnvml.VgpuInstanceClearAccountingPids + VgpuInstanceGetAccountingMode = libnvml.VgpuInstanceGetAccountingMode + VgpuInstanceGetAccountingPids = libnvml.VgpuInstanceGetAccountingPids + VgpuInstanceGetAccountingStats = libnvml.VgpuInstanceGetAccountingStats + VgpuInstanceGetEccMode = libnvml.VgpuInstanceGetEccMode + VgpuInstanceGetEncoderCapacity = libnvml.VgpuInstanceGetEncoderCapacity + VgpuInstanceGetEncoderSessions = libnvml.VgpuInstanceGetEncoderSessions + VgpuInstanceGetEncoderStats = libnvml.VgpuInstanceGetEncoderStats + VgpuInstanceGetFBCSessions = libnvml.VgpuInstanceGetFBCSessions + VgpuInstanceGetFBCStats = libnvml.VgpuInstanceGetFBCStats + VgpuInstanceGetFbUsage = libnvml.VgpuInstanceGetFbUsage + VgpuInstanceGetFrameRateLimit = libnvml.VgpuInstanceGetFrameRateLimit + VgpuInstanceGetGpuInstanceId = libnvml.VgpuInstanceGetGpuInstanceId + VgpuInstanceGetGpuPciId = libnvml.VgpuInstanceGetGpuPciId + VgpuInstanceGetLicenseInfo = libnvml.VgpuInstanceGetLicenseInfo + VgpuInstanceGetLicenseStatus = libnvml.VgpuInstanceGetLicenseStatus + VgpuInstanceGetMdevUUID = libnvml.VgpuInstanceGetMdevUUID + VgpuInstanceGetMetadata = libnvml.VgpuInstanceGetMetadata + VgpuInstanceGetType = libnvml.VgpuInstanceGetType + VgpuInstanceGetUUID = libnvml.VgpuInstanceGetUUID + VgpuInstanceGetVmDriverVersion = libnvml.VgpuInstanceGetVmDriverVersion + VgpuInstanceGetVmID = libnvml.VgpuInstanceGetVmID + VgpuInstanceSetEncoderCapacity = libnvml.VgpuInstanceSetEncoderCapacity + VgpuTypeGetCapabilities = libnvml.VgpuTypeGetCapabilities + VgpuTypeGetClass = libnvml.VgpuTypeGetClass + VgpuTypeGetDeviceID = libnvml.VgpuTypeGetDeviceID + VgpuTypeGetFrameRateLimit = libnvml.VgpuTypeGetFrameRateLimit + VgpuTypeGetFramebufferSize = libnvml.VgpuTypeGetFramebufferSize + VgpuTypeGetGpuInstanceProfileId = libnvml.VgpuTypeGetGpuInstanceProfileId + VgpuTypeGetLicense = libnvml.VgpuTypeGetLicense + VgpuTypeGetMaxInstances = libnvml.VgpuTypeGetMaxInstances + VgpuTypeGetMaxInstancesPerVm = libnvml.VgpuTypeGetMaxInstancesPerVm + VgpuTypeGetName = libnvml.VgpuTypeGetName + VgpuTypeGetNumDisplayHeads = libnvml.VgpuTypeGetNumDisplayHeads + VgpuTypeGetResolution = libnvml.VgpuTypeGetResolution +) + +// Interface represents the interface for the library type. +// +//go:generate moq -out mock/interface.go -pkg mock . Interface:Interface +type Interface interface { + ComputeInstanceDestroy(ComputeInstance) Return + ComputeInstanceGetInfo(ComputeInstance) (ComputeInstanceInfo, Return) + DeviceCcuGetStreamState(Device) (int, Return) + DeviceCcuSetStreamState(Device, int) Return + DeviceClearAccountingPids(Device) Return + DeviceClearCpuAffinity(Device) Return + DeviceClearEccErrorCounts(Device, EccCounterType) Return + DeviceClearFieldValues(Device, []FieldValue) Return + DeviceCreateGpuInstance(Device, *GpuInstanceProfileInfo) (GpuInstance, Return) + DeviceCreateGpuInstanceWithPlacement(Device, *GpuInstanceProfileInfo, *GpuInstancePlacement) (GpuInstance, Return) + DeviceDiscoverGpus() (PciInfo, Return) + DeviceFreezeNvLinkUtilizationCounter(Device, int, int, EnableState) Return + DeviceGetAPIRestriction(Device, RestrictedAPI) (EnableState, Return) + DeviceGetAccountingBufferSize(Device) (int, Return) + DeviceGetAccountingMode(Device) (EnableState, Return) + DeviceGetAccountingPids(Device) ([]int, Return) + DeviceGetAccountingStats(Device, uint32) (AccountingStats, Return) + DeviceGetActiveVgpus(Device) ([]VgpuInstance, Return) + DeviceGetAdaptiveClockInfoStatus(Device) (uint32, Return) + DeviceGetApplicationsClock(Device, ClockType) (uint32, Return) + DeviceGetArchitecture(Device) (DeviceArchitecture, Return) + DeviceGetAttributes(Device) (DeviceAttributes, Return) + DeviceGetAutoBoostedClocksEnabled(Device) (EnableState, EnableState, Return) + DeviceGetBAR1MemoryInfo(Device) (BAR1Memory, Return) + DeviceGetBoardId(Device) (uint32, Return) + DeviceGetBoardPartNumber(Device) (string, Return) + DeviceGetBrand(Device) (BrandType, Return) + DeviceGetBridgeChipInfo(Device) (BridgeChipHierarchy, Return) + DeviceGetBusType(Device) (BusType, Return) + DeviceGetClkMonStatus(Device) (ClkMonStatus, Return) + DeviceGetClock(Device, ClockType, ClockId) (uint32, Return) + DeviceGetClockInfo(Device, ClockType) (uint32, Return) + DeviceGetComputeInstanceId(Device) (int, Return) + DeviceGetComputeMode(Device) (ComputeMode, Return) + DeviceGetComputeRunningProcesses(Device) ([]ProcessInfo, Return) + DeviceGetCount() (int, Return) + DeviceGetCpuAffinity(Device, int) ([]uint, Return) + DeviceGetCpuAffinityWithinScope(Device, int, AffinityScope) ([]uint, Return) + DeviceGetCreatableVgpus(Device) ([]VgpuTypeId, Return) + DeviceGetCudaComputeCapability(Device) (int, int, Return) + DeviceGetCurrPcieLinkGeneration(Device) (int, Return) + DeviceGetCurrPcieLinkWidth(Device) (int, Return) + DeviceGetCurrentClocksThrottleReasons(Device) (uint64, Return) + DeviceGetDecoderUtilization(Device) (uint32, uint32, Return) + DeviceGetDefaultApplicationsClock(Device, ClockType) (uint32, Return) + DeviceGetDefaultEccMode(Device) (EnableState, Return) + DeviceGetDetailedEccErrors(Device, MemoryErrorType, EccCounterType) (EccErrorCounts, Return) + DeviceGetDeviceHandleFromMigDeviceHandle(Device) (Device, Return) + DeviceGetDisplayActive(Device) (EnableState, Return) + DeviceGetDisplayMode(Device) (EnableState, Return) + DeviceGetDriverModel(Device) (DriverModel, DriverModel, Return) + DeviceGetDynamicPstatesInfo(Device) (GpuDynamicPstatesInfo, Return) + DeviceGetEccMode(Device) (EnableState, EnableState, Return) + DeviceGetEncoderCapacity(Device, EncoderType) (int, Return) + DeviceGetEncoderSessions(Device) ([]EncoderSessionInfo, Return) + DeviceGetEncoderStats(Device) (int, uint32, uint32, Return) + DeviceGetEncoderUtilization(Device) (uint32, uint32, Return) + DeviceGetEnforcedPowerLimit(Device) (uint32, Return) + DeviceGetFBCSessions(Device) ([]FBCSessionInfo, Return) + DeviceGetFBCStats(Device) (FBCStats, Return) + DeviceGetFanControlPolicy_v2(Device, int) (FanControlPolicy, Return) + DeviceGetFanSpeed(Device) (uint32, Return) + DeviceGetFanSpeed_v2(Device, int) (uint32, Return) + DeviceGetFieldValues(Device, []FieldValue) Return + DeviceGetGpcClkMinMaxVfOffset(Device) (int, int, Return) + DeviceGetGpcClkVfOffset(Device) (int, Return) + DeviceGetGpuFabricInfo(Device) (GpuFabricInfo, Return) + DeviceGetGpuInstanceById(Device, int) (GpuInstance, Return) + DeviceGetGpuInstanceId(Device) (int, Return) + DeviceGetGpuInstancePossiblePlacements(Device, *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) + DeviceGetGpuInstanceProfileInfo(Device, int) (GpuInstanceProfileInfo, Return) + DeviceGetGpuInstanceProfileInfoV(Device, int) GpuInstanceProfileInfoV + DeviceGetGpuInstanceRemainingCapacity(Device, *GpuInstanceProfileInfo) (int, Return) + DeviceGetGpuInstances(Device, *GpuInstanceProfileInfo) ([]GpuInstance, Return) + DeviceGetGpuMaxPcieLinkGeneration(Device) (int, Return) + DeviceGetGpuOperationMode(Device) (GpuOperationMode, GpuOperationMode, Return) + DeviceGetGraphicsRunningProcesses(Device) ([]ProcessInfo, Return) + DeviceGetGridLicensableFeatures(Device) (GridLicensableFeatures, Return) + DeviceGetGspFirmwareMode(Device) (bool, bool, Return) + DeviceGetGspFirmwareVersion(Device) (string, Return) + DeviceGetHandleByIndex(int) (Device, Return) + DeviceGetHandleByPciBusId(string) (Device, Return) + DeviceGetHandleBySerial(string) (Device, Return) + DeviceGetHandleByUUID(string) (Device, Return) + DeviceGetHostVgpuMode(Device) (HostVgpuMode, Return) + DeviceGetIndex(Device) (int, Return) + DeviceGetInforomConfigurationChecksum(Device) (uint32, Return) + DeviceGetInforomImageVersion(Device) (string, Return) + DeviceGetInforomVersion(Device, InforomObject) (string, Return) + DeviceGetIrqNum(Device) (int, Return) + DeviceGetMPSComputeRunningProcesses(Device) ([]ProcessInfo, Return) + DeviceGetMaxClockInfo(Device, ClockType) (uint32, Return) + DeviceGetMaxCustomerBoostClock(Device, ClockType) (uint32, Return) + DeviceGetMaxMigDeviceCount(Device) (int, Return) + DeviceGetMaxPcieLinkGeneration(Device) (int, Return) + DeviceGetMaxPcieLinkWidth(Device) (int, Return) + DeviceGetMemClkMinMaxVfOffset(Device) (int, int, Return) + DeviceGetMemClkVfOffset(Device) (int, Return) + DeviceGetMemoryAffinity(Device, int, AffinityScope) ([]uint, Return) + DeviceGetMemoryBusWidth(Device) (uint32, Return) + DeviceGetMemoryErrorCounter(Device, MemoryErrorType, EccCounterType, MemoryLocation) (uint64, Return) + DeviceGetMemoryInfo(Device) (Memory, Return) + DeviceGetMemoryInfo_v2(Device) (Memory_v2, Return) + DeviceGetMigDeviceHandleByIndex(Device, int) (Device, Return) + DeviceGetMigMode(Device) (int, int, Return) + DeviceGetMinMaxClockOfPState(Device, ClockType, Pstates) (uint32, uint32, Return) + DeviceGetMinMaxFanSpeed(Device) (int, int, Return) + DeviceGetMinorNumber(Device) (int, Return) + DeviceGetMultiGpuBoard(Device) (int, Return) + DeviceGetName(Device) (string, Return) + DeviceGetNumFans(Device) (int, Return) + DeviceGetNumGpuCores(Device) (int, Return) + DeviceGetNvLinkCapability(Device, int, NvLinkCapability) (uint32, Return) + DeviceGetNvLinkErrorCounter(Device, int, NvLinkErrorCounter) (uint64, Return) + DeviceGetNvLinkRemoteDeviceType(Device, int) (IntNvLinkDeviceType, Return) + DeviceGetNvLinkRemotePciInfo(Device, int) (PciInfo, Return) + DeviceGetNvLinkState(Device, int) (EnableState, Return) + DeviceGetNvLinkUtilizationControl(Device, int, int) (NvLinkUtilizationControl, Return) + DeviceGetNvLinkUtilizationCounter(Device, int, int) (uint64, uint64, Return) + DeviceGetNvLinkVersion(Device, int) (uint32, Return) + DeviceGetP2PStatus(Device, Device, GpuP2PCapsIndex) (GpuP2PStatus, Return) + DeviceGetPciInfo(Device) (PciInfo, Return) + DeviceGetPcieLinkMaxSpeed(Device) (uint32, Return) + DeviceGetPcieReplayCounter(Device) (int, Return) + DeviceGetPcieSpeed(Device) (int, Return) + DeviceGetPcieThroughput(Device, PcieUtilCounter) (uint32, Return) + DeviceGetPerformanceState(Device) (Pstates, Return) + DeviceGetPersistenceMode(Device) (EnableState, Return) + DeviceGetPgpuMetadataString(Device) (string, Return) + DeviceGetPowerManagementDefaultLimit(Device) (uint32, Return) + DeviceGetPowerManagementLimit(Device) (uint32, Return) + DeviceGetPowerManagementLimitConstraints(Device) (uint32, uint32, Return) + DeviceGetPowerManagementMode(Device) (EnableState, Return) + DeviceGetPowerSource(Device) (PowerSource, Return) + DeviceGetPowerState(Device) (Pstates, Return) + DeviceGetPowerUsage(Device) (uint32, Return) + DeviceGetProcessUtilization(Device, uint64) ([]ProcessUtilizationSample, Return) + DeviceGetRemappedRows(Device) (int, int, bool, bool, Return) + DeviceGetRetiredPages(Device, PageRetirementCause) ([]uint64, Return) + DeviceGetRetiredPagesPendingStatus(Device) (EnableState, Return) + DeviceGetRetiredPages_v2(Device, PageRetirementCause) ([]uint64, []uint64, Return) + DeviceGetRowRemapperHistogram(Device) (RowRemapperHistogramValues, Return) + DeviceGetSamples(Device, SamplingType, uint64) (ValueType, []Sample, Return) + DeviceGetSerial(Device) (string, Return) + DeviceGetSupportedClocksThrottleReasons(Device) (uint64, Return) + DeviceGetSupportedEventTypes(Device) (uint64, Return) + DeviceGetSupportedGraphicsClocks(Device, int) (int, uint32, Return) + DeviceGetSupportedMemoryClocks(Device) (int, uint32, Return) + DeviceGetSupportedPerformanceStates(Device) ([]Pstates, Return) + DeviceGetSupportedVgpus(Device) ([]VgpuTypeId, Return) + DeviceGetTargetFanSpeed(Device, int) (int, Return) + DeviceGetTemperature(Device, TemperatureSensors) (uint32, Return) + DeviceGetTemperatureThreshold(Device, TemperatureThresholds) (uint32, Return) + DeviceGetThermalSettings(Device, uint32) (GpuThermalSettings, Return) + DeviceGetTopologyCommonAncestor(Device, Device) (GpuTopologyLevel, Return) + DeviceGetTopologyNearestGpus(Device, GpuTopologyLevel) ([]Device, Return) + DeviceGetTotalEccErrors(Device, MemoryErrorType, EccCounterType) (uint64, Return) + DeviceGetTotalEnergyConsumption(Device) (uint64, Return) + DeviceGetUUID(Device) (string, Return) + DeviceGetUtilizationRates(Device) (Utilization, Return) + DeviceGetVbiosVersion(Device) (string, Return) + DeviceGetVgpuCapabilities(Device, DeviceVgpuCapability) (bool, Return) + DeviceGetVgpuMetadata(Device) (VgpuPgpuMetadata, Return) + DeviceGetVgpuProcessUtilization(Device, uint64) ([]VgpuProcessUtilizationSample, Return) + DeviceGetVgpuSchedulerCapabilities(Device) (VgpuSchedulerCapabilities, Return) + DeviceGetVgpuSchedulerLog(Device) (VgpuSchedulerLog, Return) + DeviceGetVgpuSchedulerState(Device) (VgpuSchedulerGetState, Return) + DeviceGetVgpuUtilization(Device, uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) + DeviceGetViolationStatus(Device, PerfPolicyType) (ViolationTime, Return) + DeviceGetVirtualizationMode(Device) (GpuVirtualizationMode, Return) + DeviceIsMigDeviceHandle(Device) (bool, Return) + DeviceModifyDrainState(*PciInfo, EnableState) Return + DeviceOnSameBoard(Device, Device) (int, Return) + DeviceQueryDrainState(*PciInfo) (EnableState, Return) + DeviceRegisterEvents(Device, uint64, EventSet) Return + DeviceRemoveGpu(*PciInfo) Return + DeviceRemoveGpu_v2(*PciInfo, DetachGpuState, PcieLinkState) Return + DeviceResetApplicationsClocks(Device) Return + DeviceResetGpuLockedClocks(Device) Return + DeviceResetMemoryLockedClocks(Device) Return + DeviceResetNvLinkErrorCounters(Device, int) Return + DeviceResetNvLinkUtilizationCounter(Device, int, int) Return + DeviceSetAPIRestriction(Device, RestrictedAPI, EnableState) Return + DeviceSetAccountingMode(Device, EnableState) Return + DeviceSetApplicationsClocks(Device, uint32, uint32) Return + DeviceSetAutoBoostedClocksEnabled(Device, EnableState) Return + DeviceSetComputeMode(Device, ComputeMode) Return + DeviceSetCpuAffinity(Device) Return + DeviceSetDefaultAutoBoostedClocksEnabled(Device, EnableState, uint32) Return + DeviceSetDefaultFanSpeed_v2(Device, int) Return + DeviceSetDriverModel(Device, DriverModel, uint32) Return + DeviceSetEccMode(Device, EnableState) Return + DeviceSetFanControlPolicy(Device, int, FanControlPolicy) Return + DeviceSetFanSpeed_v2(Device, int, int) Return + DeviceSetGpcClkVfOffset(Device, int) Return + DeviceSetGpuLockedClocks(Device, uint32, uint32) Return + DeviceSetGpuOperationMode(Device, GpuOperationMode) Return + DeviceSetMemClkVfOffset(Device, int) Return + DeviceSetMemoryLockedClocks(Device, uint32, uint32) Return + DeviceSetMigMode(Device, int) (Return, Return) + DeviceSetNvLinkDeviceLowPowerThreshold(Device, *NvLinkPowerThres) Return + DeviceSetNvLinkUtilizationControl(Device, int, int, *NvLinkUtilizationControl, bool) Return + DeviceSetPersistenceMode(Device, EnableState) Return + DeviceSetPowerManagementLimit(Device, uint32) Return + DeviceSetTemperatureThreshold(Device, TemperatureThresholds, int) Return + DeviceSetVgpuSchedulerState(Device, *VgpuSchedulerSetState) Return + DeviceSetVirtualizationMode(Device, GpuVirtualizationMode) Return + DeviceValidateInforom(Device) Return + ErrorString(Return) string + EventSetCreate() (EventSet, Return) + EventSetFree(EventSet) Return + EventSetWait(EventSet, uint32) (EventData, Return) + Extensions() ExtendedInterface + GetExcludedDeviceCount() (int, Return) + GetExcludedDeviceInfoByIndex(int) (ExcludedDeviceInfo, Return) + GetVgpuCompatibility(*VgpuMetadata, *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) + GetVgpuDriverCapabilities(VgpuDriverCapability) (bool, Return) + GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) + GpmMetricsGet(*GpmMetricsGetType) Return + GpmMetricsGetV(*GpmMetricsGetType) GpmMetricsGetVType + GpmMigSampleGet(Device, int, GpmSample) Return + GpmQueryDeviceSupport(Device) (GpmSupport, Return) + GpmQueryDeviceSupportV(Device) GpmSupportV + GpmSampleAlloc() (GpmSample, Return) + GpmSampleFree(GpmSample) Return + GpmSampleGet(Device, GpmSample) Return + GpuInstanceCreateComputeInstance(GpuInstance, *ComputeInstanceProfileInfo) (ComputeInstance, Return) + GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, *ComputeInstanceProfileInfo, *ComputeInstancePlacement) (ComputeInstance, Return) + GpuInstanceDestroy(GpuInstance) Return + GpuInstanceGetComputeInstanceById(GpuInstance, int) (ComputeInstance, Return) + GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) + GpuInstanceGetComputeInstanceProfileInfo(GpuInstance, int, int) (ComputeInstanceProfileInfo, Return) + GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance, int, int) ComputeInstanceProfileInfoV + GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance, *ComputeInstanceProfileInfo) (int, Return) + GpuInstanceGetComputeInstances(GpuInstance, *ComputeInstanceProfileInfo) ([]ComputeInstance, Return) + GpuInstanceGetInfo(GpuInstance) (GpuInstanceInfo, Return) + Init() Return + InitWithFlags(uint32) Return + SetVgpuVersion(*VgpuVersion) Return + Shutdown() Return + SystemGetCudaDriverVersion() (int, Return) + SystemGetCudaDriverVersion_v2() (int, Return) + SystemGetDriverVersion() (string, Return) + SystemGetHicVersion() ([]HwbcEntry, Return) + SystemGetNVMLVersion() (string, Return) + SystemGetProcessName(int) (string, Return) + SystemGetTopologyGpuSet(int) ([]Device, Return) + UnitGetCount() (int, Return) + UnitGetDevices(Unit) ([]Device, Return) + UnitGetFanSpeedInfo(Unit) (UnitFanSpeeds, Return) + UnitGetHandleByIndex(int) (Unit, Return) + UnitGetLedState(Unit) (LedState, Return) + UnitGetPsuInfo(Unit) (PSUInfo, Return) + UnitGetTemperature(Unit, int) (uint32, Return) + UnitGetUnitInfo(Unit) (UnitInfo, Return) + UnitSetLedState(Unit, LedColor) Return + VgpuInstanceClearAccountingPids(VgpuInstance) Return + VgpuInstanceGetAccountingMode(VgpuInstance) (EnableState, Return) + VgpuInstanceGetAccountingPids(VgpuInstance) ([]int, Return) + VgpuInstanceGetAccountingStats(VgpuInstance, int) (AccountingStats, Return) + VgpuInstanceGetEccMode(VgpuInstance) (EnableState, Return) + VgpuInstanceGetEncoderCapacity(VgpuInstance) (int, Return) + VgpuInstanceGetEncoderSessions(VgpuInstance) (int, EncoderSessionInfo, Return) + VgpuInstanceGetEncoderStats(VgpuInstance) (int, uint32, uint32, Return) + VgpuInstanceGetFBCSessions(VgpuInstance) (int, FBCSessionInfo, Return) + VgpuInstanceGetFBCStats(VgpuInstance) (FBCStats, Return) + VgpuInstanceGetFbUsage(VgpuInstance) (uint64, Return) + VgpuInstanceGetFrameRateLimit(VgpuInstance) (uint32, Return) + VgpuInstanceGetGpuInstanceId(VgpuInstance) (int, Return) + VgpuInstanceGetGpuPciId(VgpuInstance) (string, Return) + VgpuInstanceGetLicenseInfo(VgpuInstance) (VgpuLicenseInfo, Return) + VgpuInstanceGetLicenseStatus(VgpuInstance) (int, Return) + VgpuInstanceGetMdevUUID(VgpuInstance) (string, Return) + VgpuInstanceGetMetadata(VgpuInstance) (VgpuMetadata, Return) + VgpuInstanceGetType(VgpuInstance) (VgpuTypeId, Return) + VgpuInstanceGetUUID(VgpuInstance) (string, Return) + VgpuInstanceGetVmDriverVersion(VgpuInstance) (string, Return) + VgpuInstanceGetVmID(VgpuInstance) (string, VgpuVmIdType, Return) + VgpuInstanceSetEncoderCapacity(VgpuInstance, int) Return + VgpuTypeGetCapabilities(VgpuTypeId, VgpuCapability) (bool, Return) + VgpuTypeGetClass(VgpuTypeId) (string, Return) + VgpuTypeGetDeviceID(VgpuTypeId) (uint64, uint64, Return) + VgpuTypeGetFrameRateLimit(VgpuTypeId) (uint32, Return) + VgpuTypeGetFramebufferSize(VgpuTypeId) (uint64, Return) + VgpuTypeGetGpuInstanceProfileId(VgpuTypeId) (uint32, Return) + VgpuTypeGetLicense(VgpuTypeId) (string, Return) + VgpuTypeGetMaxInstances(Device, VgpuTypeId) (int, Return) + VgpuTypeGetMaxInstancesPerVm(VgpuTypeId) (int, Return) + VgpuTypeGetName(VgpuTypeId) (string, Return) + VgpuTypeGetNumDisplayHeads(VgpuTypeId) (int, Return) + VgpuTypeGetResolution(VgpuTypeId, int) (uint32, uint32, Return) +} + +// Device represents the interface for the nvmlDevice type. +// +//go:generate moq -out mock/device.go -pkg mock . Device:Device +type Device interface { + CcuGetStreamState() (int, Return) + CcuSetStreamState(int) Return + ClearAccountingPids() Return + ClearCpuAffinity() Return + ClearEccErrorCounts(EccCounterType) Return + ClearFieldValues([]FieldValue) Return + CreateGpuInstance(*GpuInstanceProfileInfo) (GpuInstance, Return) + CreateGpuInstanceWithPlacement(*GpuInstanceProfileInfo, *GpuInstancePlacement) (GpuInstance, Return) + FreezeNvLinkUtilizationCounter(int, int, EnableState) Return + GetAPIRestriction(RestrictedAPI) (EnableState, Return) + GetAccountingBufferSize() (int, Return) + GetAccountingMode() (EnableState, Return) + GetAccountingPids() ([]int, Return) + GetAccountingStats(uint32) (AccountingStats, Return) + GetActiveVgpus() ([]VgpuInstance, Return) + GetAdaptiveClockInfoStatus() (uint32, Return) + GetApplicationsClock(ClockType) (uint32, Return) + GetArchitecture() (DeviceArchitecture, Return) + GetAttributes() (DeviceAttributes, Return) + GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return) + GetBAR1MemoryInfo() (BAR1Memory, Return) + GetBoardId() (uint32, Return) + GetBoardPartNumber() (string, Return) + GetBrand() (BrandType, Return) + GetBridgeChipInfo() (BridgeChipHierarchy, Return) + GetBusType() (BusType, Return) + GetClkMonStatus() (ClkMonStatus, Return) + GetClock(ClockType, ClockId) (uint32, Return) + GetClockInfo(ClockType) (uint32, Return) + GetComputeInstanceId() (int, Return) + GetComputeMode() (ComputeMode, Return) + GetComputeRunningProcesses() ([]ProcessInfo, Return) + GetCpuAffinity(int) ([]uint, Return) + GetCpuAffinityWithinScope(int, AffinityScope) ([]uint, Return) + GetCreatableVgpus() ([]VgpuTypeId, Return) + GetCudaComputeCapability() (int, int, Return) + GetCurrPcieLinkGeneration() (int, Return) + GetCurrPcieLinkWidth() (int, Return) + GetCurrentClocksThrottleReasons() (uint64, Return) + GetDecoderUtilization() (uint32, uint32, Return) + GetDefaultApplicationsClock(ClockType) (uint32, Return) + GetDefaultEccMode() (EnableState, Return) + GetDetailedEccErrors(MemoryErrorType, EccCounterType) (EccErrorCounts, Return) + GetDeviceHandleFromMigDeviceHandle() (Device, Return) + GetDisplayActive() (EnableState, Return) + GetDisplayMode() (EnableState, Return) + GetDriverModel() (DriverModel, DriverModel, Return) + GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return) + GetEccMode() (EnableState, EnableState, Return) + GetEncoderCapacity(EncoderType) (int, Return) + GetEncoderSessions() ([]EncoderSessionInfo, Return) + GetEncoderStats() (int, uint32, uint32, Return) + GetEncoderUtilization() (uint32, uint32, Return) + GetEnforcedPowerLimit() (uint32, Return) + GetFBCSessions() ([]FBCSessionInfo, Return) + GetFBCStats() (FBCStats, Return) + GetFanControlPolicy_v2(int) (FanControlPolicy, Return) + GetFanSpeed() (uint32, Return) + GetFanSpeed_v2(int) (uint32, Return) + GetFieldValues([]FieldValue) Return + GetGpcClkMinMaxVfOffset() (int, int, Return) + GetGpcClkVfOffset() (int, Return) + GetGpuFabricInfo() (GpuFabricInfo, Return) + GetGpuInstanceById(int) (GpuInstance, Return) + GetGpuInstanceId() (int, Return) + GetGpuInstancePossiblePlacements(*GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return) + GetGpuInstanceProfileInfo(int) (GpuInstanceProfileInfo, Return) + GetGpuInstanceProfileInfoV(int) GpuInstanceProfileInfoV + GetGpuInstanceRemainingCapacity(*GpuInstanceProfileInfo) (int, Return) + GetGpuInstances(*GpuInstanceProfileInfo) ([]GpuInstance, Return) + GetGpuMaxPcieLinkGeneration() (int, Return) + GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return) + GetGraphicsRunningProcesses() ([]ProcessInfo, Return) + GetGridLicensableFeatures() (GridLicensableFeatures, Return) + GetGspFirmwareMode() (bool, bool, Return) + GetGspFirmwareVersion() (string, Return) + GetHostVgpuMode() (HostVgpuMode, Return) + GetIndex() (int, Return) + GetInforomConfigurationChecksum() (uint32, Return) + GetInforomImageVersion() (string, Return) + GetInforomVersion(InforomObject) (string, Return) + GetIrqNum() (int, Return) + GetMPSComputeRunningProcesses() ([]ProcessInfo, Return) + GetMaxClockInfo(ClockType) (uint32, Return) + GetMaxCustomerBoostClock(ClockType) (uint32, Return) + GetMaxMigDeviceCount() (int, Return) + GetMaxPcieLinkGeneration() (int, Return) + GetMaxPcieLinkWidth() (int, Return) + GetMemClkMinMaxVfOffset() (int, int, Return) + GetMemClkVfOffset() (int, Return) + GetMemoryAffinity(int, AffinityScope) ([]uint, Return) + GetMemoryBusWidth() (uint32, Return) + GetMemoryErrorCounter(MemoryErrorType, EccCounterType, MemoryLocation) (uint64, Return) + GetMemoryInfo() (Memory, Return) + GetMemoryInfo_v2() (Memory_v2, Return) + GetMigDeviceHandleByIndex(int) (Device, Return) + GetMigMode() (int, int, Return) + GetMinMaxClockOfPState(ClockType, Pstates) (uint32, uint32, Return) + GetMinMaxFanSpeed() (int, int, Return) + GetMinorNumber() (int, Return) + GetMultiGpuBoard() (int, Return) + GetName() (string, Return) + GetNumFans() (int, Return) + GetNumGpuCores() (int, Return) + GetNvLinkCapability(int, NvLinkCapability) (uint32, Return) + GetNvLinkErrorCounter(int, NvLinkErrorCounter) (uint64, Return) + GetNvLinkRemoteDeviceType(int) (IntNvLinkDeviceType, Return) + GetNvLinkRemotePciInfo(int) (PciInfo, Return) + GetNvLinkState(int) (EnableState, Return) + GetNvLinkUtilizationControl(int, int) (NvLinkUtilizationControl, Return) + GetNvLinkUtilizationCounter(int, int) (uint64, uint64, Return) + GetNvLinkVersion(int) (uint32, Return) + GetP2PStatus(Device, GpuP2PCapsIndex) (GpuP2PStatus, Return) + GetPciInfo() (PciInfo, Return) + GetPcieLinkMaxSpeed() (uint32, Return) + GetPcieReplayCounter() (int, Return) + GetPcieSpeed() (int, Return) + GetPcieThroughput(PcieUtilCounter) (uint32, Return) + GetPerformanceState() (Pstates, Return) + GetPersistenceMode() (EnableState, Return) + GetPgpuMetadataString() (string, Return) + GetPowerManagementDefaultLimit() (uint32, Return) + GetPowerManagementLimit() (uint32, Return) + GetPowerManagementLimitConstraints() (uint32, uint32, Return) + GetPowerManagementMode() (EnableState, Return) + GetPowerSource() (PowerSource, Return) + GetPowerState() (Pstates, Return) + GetPowerUsage() (uint32, Return) + GetProcessUtilization(uint64) ([]ProcessUtilizationSample, Return) + GetRemappedRows() (int, int, bool, bool, Return) + GetRetiredPages(PageRetirementCause) ([]uint64, Return) + GetRetiredPagesPendingStatus() (EnableState, Return) + GetRetiredPages_v2(PageRetirementCause) ([]uint64, []uint64, Return) + GetRowRemapperHistogram() (RowRemapperHistogramValues, Return) + GetSamples(SamplingType, uint64) (ValueType, []Sample, Return) + GetSerial() (string, Return) + GetSupportedClocksThrottleReasons() (uint64, Return) + GetSupportedEventTypes() (uint64, Return) + GetSupportedGraphicsClocks(int) (int, uint32, Return) + GetSupportedMemoryClocks() (int, uint32, Return) + GetSupportedPerformanceStates() ([]Pstates, Return) + GetSupportedVgpus() ([]VgpuTypeId, Return) + GetTargetFanSpeed(int) (int, Return) + GetTemperature(TemperatureSensors) (uint32, Return) + GetTemperatureThreshold(TemperatureThresholds) (uint32, Return) + GetThermalSettings(uint32) (GpuThermalSettings, Return) + GetTopologyCommonAncestor(Device) (GpuTopologyLevel, Return) + GetTopologyNearestGpus(GpuTopologyLevel) ([]Device, Return) + GetTotalEccErrors(MemoryErrorType, EccCounterType) (uint64, Return) + GetTotalEnergyConsumption() (uint64, Return) + GetUUID() (string, Return) + GetUtilizationRates() (Utilization, Return) + GetVbiosVersion() (string, Return) + GetVgpuCapabilities(DeviceVgpuCapability) (bool, Return) + GetVgpuMetadata() (VgpuPgpuMetadata, Return) + GetVgpuProcessUtilization(uint64) ([]VgpuProcessUtilizationSample, Return) + GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return) + GetVgpuSchedulerLog() (VgpuSchedulerLog, Return) + GetVgpuSchedulerState() (VgpuSchedulerGetState, Return) + GetVgpuUtilization(uint64) (ValueType, []VgpuInstanceUtilizationSample, Return) + GetViolationStatus(PerfPolicyType) (ViolationTime, Return) + GetVirtualizationMode() (GpuVirtualizationMode, Return) + GpmMigSampleGet(int, GpmSample) Return + GpmQueryDeviceSupport() (GpmSupport, Return) + GpmQueryDeviceSupportV() GpmSupportV + GpmSampleGet(GpmSample) Return + IsMigDeviceHandle() (bool, Return) + OnSameBoard(Device) (int, Return) + RegisterEvents(uint64, EventSet) Return + ResetApplicationsClocks() Return + ResetGpuLockedClocks() Return + ResetMemoryLockedClocks() Return + ResetNvLinkErrorCounters(int) Return + ResetNvLinkUtilizationCounter(int, int) Return + SetAPIRestriction(RestrictedAPI, EnableState) Return + SetAccountingMode(EnableState) Return + SetApplicationsClocks(uint32, uint32) Return + SetAutoBoostedClocksEnabled(EnableState) Return + SetComputeMode(ComputeMode) Return + SetCpuAffinity() Return + SetDefaultAutoBoostedClocksEnabled(EnableState, uint32) Return + SetDefaultFanSpeed_v2(int) Return + SetDriverModel(DriverModel, uint32) Return + SetEccMode(EnableState) Return + SetFanControlPolicy(int, FanControlPolicy) Return + SetFanSpeed_v2(int, int) Return + SetGpcClkVfOffset(int) Return + SetGpuLockedClocks(uint32, uint32) Return + SetGpuOperationMode(GpuOperationMode) Return + SetMemClkVfOffset(int) Return + SetMemoryLockedClocks(uint32, uint32) Return + SetMigMode(int) (Return, Return) + SetNvLinkDeviceLowPowerThreshold(*NvLinkPowerThres) Return + SetNvLinkUtilizationControl(int, int, *NvLinkUtilizationControl, bool) Return + SetPersistenceMode(EnableState) Return + SetPowerManagementLimit(uint32) Return + SetTemperatureThreshold(TemperatureThresholds, int) Return + SetVgpuSchedulerState(*VgpuSchedulerSetState) Return + SetVirtualizationMode(GpuVirtualizationMode) Return + ValidateInforom() Return + VgpuTypeGetMaxInstances(VgpuTypeId) (int, Return) +} + +// GpuInstance represents the interface for the nvmlGpuInstance type. +// +//go:generate moq -out mock/gpuinstance.go -pkg mock . GpuInstance:GpuInstance +type GpuInstance interface { + CreateComputeInstance(*ComputeInstanceProfileInfo) (ComputeInstance, Return) + CreateComputeInstanceWithPlacement(*ComputeInstanceProfileInfo, *ComputeInstancePlacement) (ComputeInstance, Return) + Destroy() Return + GetComputeInstanceById(int) (ComputeInstance, Return) + GetComputeInstancePossiblePlacements(*ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return) + GetComputeInstanceProfileInfo(int, int) (ComputeInstanceProfileInfo, Return) + GetComputeInstanceProfileInfoV(int, int) ComputeInstanceProfileInfoV + GetComputeInstanceRemainingCapacity(*ComputeInstanceProfileInfo) (int, Return) + GetComputeInstances(*ComputeInstanceProfileInfo) ([]ComputeInstance, Return) + GetInfo() (GpuInstanceInfo, Return) +} + +// ComputeInstance represents the interface for the nvmlComputeInstance type. +// +//go:generate moq -out mock/computeinstance.go -pkg mock . ComputeInstance:ComputeInstance +type ComputeInstance interface { + Destroy() Return + GetInfo() (ComputeInstanceInfo, Return) +} + +// EventSet represents the interface for the nvmlEventSet type. +// +//go:generate moq -out mock/eventset.go -pkg mock . EventSet:EventSet +type EventSet interface { + Free() Return + Wait(uint32) (EventData, Return) +} + +// GpmSample represents the interface for the nvmlGpmSample type. +// +//go:generate moq -out mock/gpmsample.go -pkg mock . GpmSample:GpmSample +type GpmSample interface { + Free() Return + Get(Device) Return + MigGet(Device, int) Return +} + +// Unit represents the interface for the nvmlUnit type. +// +//go:generate moq -out mock/unit.go -pkg mock . Unit:Unit +type Unit interface { + GetDevices() ([]Device, Return) + GetFanSpeedInfo() (UnitFanSpeeds, Return) + GetLedState() (LedState, Return) + GetPsuInfo() (PSUInfo, Return) + GetTemperature(int) (uint32, Return) + GetUnitInfo() (UnitInfo, Return) + SetLedState(LedColor) Return +} + +// VgpuInstance represents the interface for the nvmlVgpuInstance type. +// +//go:generate moq -out mock/vgpuinstance.go -pkg mock . VgpuInstance:VgpuInstance +type VgpuInstance interface { + ClearAccountingPids() Return + GetAccountingMode() (EnableState, Return) + GetAccountingPids() ([]int, Return) + GetAccountingStats(int) (AccountingStats, Return) + GetEccMode() (EnableState, Return) + GetEncoderCapacity() (int, Return) + GetEncoderSessions() (int, EncoderSessionInfo, Return) + GetEncoderStats() (int, uint32, uint32, Return) + GetFBCSessions() (int, FBCSessionInfo, Return) + GetFBCStats() (FBCStats, Return) + GetFbUsage() (uint64, Return) + GetFrameRateLimit() (uint32, Return) + GetGpuInstanceId() (int, Return) + GetGpuPciId() (string, Return) + GetLicenseInfo() (VgpuLicenseInfo, Return) + GetLicenseStatus() (int, Return) + GetMdevUUID() (string, Return) + GetMetadata() (VgpuMetadata, Return) + GetType() (VgpuTypeId, Return) + GetUUID() (string, Return) + GetVmDriverVersion() (string, Return) + GetVmID() (string, VgpuVmIdType, Return) + SetEncoderCapacity(int) Return +} + +// VgpuTypeId represents the interface for the nvmlVgpuTypeId type. +// +//go:generate moq -out mock/vgputypeid.go -pkg mock . VgpuTypeId:VgpuTypeId +type VgpuTypeId interface { + GetCapabilities(VgpuCapability) (bool, Return) + GetClass() (string, Return) + GetDeviceID() (uint64, uint64, Return) + GetFrameRateLimit() (uint32, Return) + GetFramebufferSize() (uint64, Return) + GetGpuInstanceProfileId() (uint32, Return) + GetLicense() (string, Return) + GetMaxInstances(Device) (int, Return) + GetMaxInstancesPerVm() (int, Return) + GetName() (string, Return) + GetNumDisplayHeads() (int, Return) + GetResolution(int) (uint32, uint32, Return) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 41342d8e..48b10bdb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,15 +1,16 @@ -# github.com/NVIDIA/go-nvlib v0.2.0 +# github.com/NVIDIA/go-nvlib v0.2.0 => github.com/klueska/go-nvlib v0.0.0-20240412211930-153699bb9310 ## explicit; go 1.20 github.com/NVIDIA/go-nvlib/pkg/nvlib/device -github.com/NVIDIA/go-nvlib/pkg/nvml github.com/NVIDIA/go-nvlib/pkg/nvpci github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio github.com/NVIDIA/go-nvlib/pkg/pciids -# github.com/NVIDIA/go-nvml v0.12.0-3 +# github.com/NVIDIA/go-nvml v0.12.0-4 ## explicit; go 1.20 github.com/NVIDIA/go-nvml/pkg/dl github.com/NVIDIA/go-nvml/pkg/nvml +github.com/NVIDIA/go-nvml/pkg/nvml/mock +github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100 # github.com/cpuguy83/go-md2man/v2 v2.0.2 ## explicit; go 1.11 github.com/cpuguy83/go-md2man/v2/md2man @@ -468,3 +469,4 @@ sigs.k8s.io/structured-merge-diff/v4/value ## explicit; go 1.12 sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 +# github.com/NVIDIA/go-nvlib => github.com/klueska/go-nvlib v0.0.0-20240412211930-153699bb9310