numr 0.11.0

High-performance numerical computing with multi-backend GPU acceleration (CPU/CUDA/WebGPU)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Shared test helpers for CUDA linalg unit tests.
#![cfg(test)]

use super::super::CudaRuntime;
use super::super::client::CudaClient;
use crate::runtime::Runtime;
use crate::runtime::cuda::{CudaDevice, is_cuda_available};

pub(super) fn create_client() -> Option<CudaClient> {
    if !is_cuda_available() {
        return None;
    }
    let device = CudaDevice::new(0);
    Some(CudaRuntime::default_client(&device))
}