ruda_tensor_dispatch/
lib.rs1#![cfg_attr(not(feature = "std"), no_std)]
2
3extern crate alloc;
4
5#[macro_use]
6mod macros;
7mod backend;
8#[cfg(feature = "distributed")]
9mod distributed;
10mod context;
11mod device;
12mod ops;
13mod tensor;
14mod transfer;
15#[cfg(feature = "remote-server")]
16mod ir;
17#[cfg(all(feature = "remote-server", not(target_family = "wasm")))]
18pub mod remote_server;
19
20pub use backend::Dispatch;
21pub use device::DispatchDevice;
22#[cfg(feature = "throughput")]
23pub use ruda_runtime::runtime::throughput::{
24 CmmaDims, ComputeCmmaConfig, MemoryAccess, MemoryCurve, MemoryPoint, MemorySpec,
25 ThroughputError, ThroughputKey, ThroughputMode, ThroughputValue,
26};
27pub use tensor::{BackendTensor, DispatchTensor};
28pub use ruda_core::ir::{DeviceIdentity, PhysicalDevice, PciAddress, PciAddressError, PciVendor, AdapterLuid, RegistryEntryId};
29#[cfg(feature = "capture")]
30pub use ruda_tensor_capture as capture;
31
32pub mod devices {
33 pub use ruda_tensor_host::HostDevice;
34 #[cfg(feature = "cuda")]
35 pub use ruda_tensor_device::cuda::CudaDevice;
36 #[cfg(feature = "cpu")]
37 pub use ruda_driver_cpu::CpuDevice;
38 #[cfg(feature = "rocm")]
39 pub use ruda_tensor_rocm::RocmDevice;
40 #[cfg(feature = "wgpu")]
41 pub use ruda_tensor_wgpu::{AutoCompiler, WgpuBackend, WgpuDevice, WgpuDeviceKind, init_setup_async};
42 #[cfg(feature = "wgpu")]
43 pub mod wgpu {
44 pub use ruda_tensor_wgpu::{MemoryConfiguration, RuntimeOptions, WgpuBackend, WgpuDevice,
45 WgpuDeviceKind, WgpuInitError, WgpuSetup, try_init_device, try_init_device_with_api,
46 try_init_setup, try_init_setup_async};
47 pub use ruda_tensor_wgpu::graphics::*;
48 }
49 #[cfg(feature = "tch")]
50 pub use ruda_tensor_tch::LibTorchDevice;
51 #[cfg(feature = "remote")]
52 pub use ruda_tensor_remote::RemoteDevice;
53 #[cfg(feature = "capture")]
54 pub use ruda_tensor_capture::CaptureDevice;
55}
56
57pub mod backends {
58pub type Host = ruda_tensor_host::Host;
59#[cfg(all(feature = "cuda", not(feature = "fusion")))]
60pub type Cuda = ruda_tensor_device::cuda::CudaNative;
61#[cfg(all(feature = "cuda", feature = "fusion"))]
62pub type Cuda = ruda_fusion::Fusion<ruda_tensor_device::cuda::CudaNative>;
63#[cfg(all(feature = "cpu", not(feature = "fusion")))]
64pub type Cpu = ruda_tensor_device::DeviceBackend<ruda_driver_cpu::CpuRuntime, f32, i32, u8>;
65#[cfg(all(feature = "cpu", feature = "fusion"))]
66pub type Cpu = ruda_fusion::Fusion<ruda_tensor_device::DeviceBackend<ruda_driver_cpu::CpuRuntime, f32, i32, u8>>;
67#[cfg(all(feature = "wgpu", not(feature = "fusion")))]
68pub type Wgpu = ruda_tensor_wgpu::DeviceBackend<ruda_tensor_wgpu::WgpuRuntime, f32, i32, u32>;
69#[cfg(all(feature = "wgpu", feature = "fusion"))]
70pub type Wgpu = ruda_fusion::Fusion<ruda_tensor_wgpu::DeviceBackend<ruda_tensor_wgpu::WgpuRuntime, f32, i32, u32>>;
71#[cfg(all(feature = "rocm", not(feature = "fusion")))]
72pub type Rocm = ruda_tensor_rocm::RocmNative;
73#[cfg(all(feature = "rocm", feature = "fusion"))]
74pub type Rocm = ruda_fusion::Fusion<ruda_tensor_rocm::RocmNative>;
75#[cfg(feature = "tch")]
76pub type LibTorch = ruda_tensor_tch::LibTorch;
77#[cfg(feature = "remote")]
78pub type Remote = ruda_tensor_remote::RemoteBackend;
79#[cfg(feature = "capture")]
80pub type Capture = ruda_tensor_capture::CaptureBackend;
81}