nu_plugin_vulkan_matrix 0.1.2

GPU matrix operations for Nushell using Vulkan
1
2
3
4
5
6
7
8
use crate::gpu::{Gpu, open_device};
use cubecl::wgpu::WgpuDeviceKind;
use std::sync::{Arc, OnceLock};

pub fn gpu() -> &'static Arc<Gpu> {
    static GPU: OnceLock<Arc<Gpu>> = OnceLock::new();
    GPU.get_or_init(|| Arc::new(open_device(WgpuDeviceKind::DiscreteGpu(0)).unwrap()))
}