trueno 0.17.3

High-performance SIMD compute library with GPU support for matrix operations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod activations;
mod basic_ops;
mod matmul_and_convolve;
mod scalar_matching;
mod tiled_ops;

use super::*;
use std::sync::OnceLock;

/// Shared GPU backend for fast test execution (initialized once)
static SHARED_GPU: OnceLock<Option<GpuBackend>> = OnceLock::new();

/// Get shared GPU backend (fast) or None if unavailable
fn get_shared_gpu() -> Option<GpuBackend> {
    SHARED_GPU
        .get_or_init(|| if GpuBackend::is_available() { Some(GpuBackend::new()) } else { None })
        .clone()
}