Skip to main content

Crate tenferro_gpu

Crate tenferro_gpu 

Source
Expand description

GPU backend implementations for tenferro tensors.

§Examples

#[cfg(feature = "cuda")]
use tenferro_gpu::{cuda::cuda_devices, cuda::CudaBackend, cuda::CudaDeviceError};

#[cfg(feature = "cuda")]
fn first_cuda_backend() -> Result<Option<CudaBackend>, CudaDeviceError> {
    let devices = cuda_devices()?;
    let Some(device) = devices.first() else {
        return Ok(None);
    };
    Ok(Some(CudaBackend::new(device.id())?))
}

// This ordinary doctest checks the discovery-based selection API without
// requiring CUDA hardware at test time.
#[cfg(feature = "cuda")]
let _example: fn() -> Result<Option<CudaBackend>, CudaDeviceError> = first_cuda_backend;

Modules§

apple
Apple shared-allocation provider namespace.
cuda
CUDA provider namespace.
webgpu
CubeCL WebGPU provider runtime and backend skeleton.