Documentation
¶
Index ¶
Constants ¶
View Source
const ( NVIDIAUVMMinor = 0 NVIDIAUVMToolsMinor = 1 NVIDIACTLMinor = 255 NVIDIAModesetMinor = 254 NVIDIAFrontend = Name("nvidia-frontend") NVIDIAGPU = Name("nvidia") NVIDIACaps = Name("nvidia-caps") NVIDIAUVM = Name("nvidia-uvm") )
Device major numbers and device names for NVIDIA devices
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Devices ¶
Devices represents the set of devices under /proc/devices
func GetNVIDIADevices ¶
GetNVIDIADevices returns the set of NVIDIA Devices on the machine
type DevicesMock ¶
type DevicesMock struct {
// CountFunc mocks the Count method.
CountFunc func() int
// ExistsFunc mocks the Exists method.
ExistsFunc func(name Name) bool
// GetFunc mocks the Get method.
GetFunc func(name Name) (Major, bool)
// contains filtered or unexported fields
}
DevicesMock is a mock implementation of Devices.
func TestSomethingThatUsesDevices(t *testing.T) {
// make and configure a mocked Devices
mockedDevices := &DevicesMock{
CountFunc: func() int {
panic("mock out the Count method")
},
ExistsFunc: func(name Name) bool {
panic("mock out the Exists method")
},
GetFunc: func(name Name) (Major, bool) {
panic("mock out the Get method")
},
}
// use mockedDevices in code that requires Devices
// and then make assertions.
}
func (*DevicesMock) Count ¶ added in v1.14.6
func (mock *DevicesMock) Count() int
Count calls CountFunc.
func (*DevicesMock) CountCalls ¶ added in v1.14.6
func (mock *DevicesMock) CountCalls() []struct { }
CountCalls gets all the calls that were made to Count. Check the length with:
len(mockedDevices.CountCalls())
func (*DevicesMock) Exists ¶
func (mock *DevicesMock) Exists(name Name) bool
Exists calls ExistsFunc.
func (*DevicesMock) ExistsCalls ¶
func (mock *DevicesMock) ExistsCalls() []struct { Name Name }
ExistsCalls gets all the calls that were made to Exists. Check the length with:
len(mockedDevices.ExistsCalls())
func (*DevicesMock) GetCalls ¶
func (mock *DevicesMock) GetCalls() []struct { Name Name }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedDevices.GetCalls())
type Option ¶ added in v1.14.6
type Option func(*builder)
func WithDeviceToMajor ¶ added in v1.14.6
WithDeviceToMajor specifies an explicit device name to major number map.
func WithFilter ¶ added in v1.14.6
WithFilter specifies a filter to exclude devices.
Click to show internal directories.
Click to hide internal directories.