Skip to main content

Module backends

Module backends 

Source
Expand description

GPU backend identifiers and capability data.

This module used to also define a Backend trait with five implementations (CudaBackend, RocmBackend, MetalBackend, WgpuBackend, CpuBackend) that were pure fabrication: every allocate/copy_to_device/copy_to_host/launch_kernel was a bare Ok(()) regardless of backend availability, DeviceCapabilities numbers were hardcoded fiction ("CUDA Device", 8 GB, compute capability (8, 6), …) on every machine, and copy_to_host left its destination untouched while reporting success. Nothing outside this file ever called any of it — it was dead, misleading public API surface.

Real GPU access in this crate goes through scirs2_core::gpu exclusively (see crate::optimizers, crate::multi_gpu). What remains here is the parts of the old surface that are still load-bearing: the GpuBackend identifier enum and the DeviceCapabilities data struct crate::occupancy uses to model launch-configuration limits — neither of those fabricates anything by existing.

Structs§

DeviceCapabilities
GPU device capabilities.
LaunchConfig
Kernel launch geometry: grid/block dimensions, shared-memory footprint and (optionally) the stream to launch on.

Enums§

BackendError
Errors that can occur with GPU backends
GpuBackend
GPU backend types supported by the optimizer