Skip to content

Commit 1799ec3

Browse files
committed
refactor(gpu): remove legacy CDI all helper
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 97e8a7a commit 1799ec3

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

  • crates/openshell-core/src

‎crates/openshell-core/src/gpu.rs‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,6 @@ pub fn cdi_gpu_device_ids(
219219
Ok(Some(vec![device.to_string()]))
220220
}
221221

222-
/// Resolve a GPU request with the legacy all-GPU default.
223-
#[must_use]
224-
pub fn cdi_gpu_device_ids_or_all(
225-
gpu: Option<&DriverGpuResourceRequirements>,
226-
cdi_devices: &[String],
227-
) -> Option<Vec<String>> {
228-
gpu.map(|_| {
229-
if cdi_devices.is_empty() {
230-
vec![CDI_GPU_DEVICE_ALL.to_string()]
231-
} else {
232-
cdi_devices.to_vec()
233-
}
234-
})
235-
}
236-
237222
fn cdi_nvidia_gpu_suffix(id: &str) -> Option<&str> {
238223
id.strip_prefix(CDI_NVIDIA_GPU_PREFIX)
239224
}
@@ -328,16 +313,6 @@ mod tests {
328313
);
329314
}
330315

331-
#[test]
332-
fn cdi_gpu_device_ids_or_all_uses_all_when_no_devices_are_configured() {
333-
let gpu = DriverGpuResourceRequirements { count: None };
334-
335-
assert_eq!(
336-
cdi_gpu_device_ids_or_all(Some(&gpu), &[]),
337-
Some(vec![CDI_GPU_DEVICE_ALL.to_string()])
338-
);
339-
}
340-
341316
#[test]
342317
fn inventory_filters_and_deduplicates_nvidia_gpu_ids() {
343318
let inventory = CdiGpuInventory::new([

0 commit comments

Comments
 (0)