Skip to main content

Module gpu_optimizer

Module gpu_optimizer 

Source
Expand description

GPU optimizer scaffolding

§Status: no GPU backend is wired up yet

This module defines the API surface for GPU-accelerated optimization, but no device backend is currently implemented. GpuUtils::detect_backends returns an empty list, GpuUtils::device_count returns 0, and consequently GpuOptimizer::is_gpu_available reports false and every optimization step executes on the CPU through the wrapped base optimizer.

The wrapper is still useful today: it lets calling code be written once against the GPU-aware API and keep working unchanged when a backend lands. It will not, however, make anything faster right now — treat it as a compatibility shim, not as an accelerator.

§What a real backend must provide

When SciRS2’s GPU abstractions become available, the integration points are:

  • scirs2_core::gpu::GpuContext for GPU context management
  • scirs2_core::gpu::GpuBuffer for GPU memory allocation
  • scirs2_core::gpu::GpuKernel for GPU kernel execution
  • scirs2_core::tensor_cores for mixed-precision optimization
  • scirs2_core::array_protocol::GPUArray for the GPU array interface

Wiring those up means implementing GpuUtils::detect_backends, GpuUtils::device_count and GpuOptimizer::step_gpu; the availability reporting below then becomes truthful automatically.

Structs§

GpuConfig
GPU optimizer configuration
GpuMemoryStats
GPU memory statistics
GpuOptimizer
GPU-accelerated optimizer wrapper
GpuUtils
GPU optimizer utilities