NVIDIA GPU loadable plugin
Source
163
163
count, ok := res.out[0].(uint)
164
164
if !ok {
165
165
m.t.Fatalf("expected uint in GetDeviceCountV2, got %T", res.out[0])
166
166
}
167
167
168
168
return count, err
169
169
}
170
170
171
171
// GetDeviceByIndexV2 is mock function.
172
172
//
173
-
//nolint:ireturn
173
+
//nolint:ireturn,nolintlint
174
174
func (m *MockRunner) GetDeviceByIndexV2(index uint) (nvml.Device, error) {
175
175
m.t.Helper()
176
176
res, err := m.handleFunctionCall("GetDeviceByIndexV2", index)
177
177
178
178
if res.out[0] == nil {
179
179
return nil, err
180
180
}
181
181
182
182
device, ok := res.out[0].(*MockDevice)
183
183
if !ok {
184
184
m.t.Fatalf("expected *MockRunner in GetDeviceByIndexV2, got %T", res.out[0])
185
185
}
186
186
187
187
device.t = m.t
188
188
189
189
return device, err
190
190
}
191
191
192
192
// GetDeviceByUUID is mock function.
193
193
//
194
-
//nolint:ireturn
194
+
//nolint:ireturn,nolintlint
195
195
func (m *MockRunner) GetDeviceByUUID(uuid string) (nvml.Device, error) {
196
196
m.t.Helper()
197
197
res, err := m.handleFunctionCall("GetDeviceByUUID", uuid)
198
198
199
199
if res.out[0] == nil {
200
200
return nil, err
201
201
}
202
202
203
203
mockDevice, ok := res.out[0].(*MockDevice)
204
204
if ok {