1pub mod core {
43 pub use tenferro_tensor_core::{
44 col_major_strides, DType, DynRank, ErrorKind, HostTensor, HostTensorView, IntoShapeVec,
45 Rank, Result, ShapeMismatch, ShapeVec, SliceSpec, StrideVec, Tensor, TensorLayout,
46 TensorRank, TensorRef, TensorScalar, TensorView, ValidationError, ValidationKind,
47 };
48}
49
50pub use tenferro_tensor_core::{
51 ErrorKind, IntoShapeVec, ShapeMismatch, ShapeVec, SliceSpec, StrideVec, TensorRef,
52 ValidationError, ValidationKind,
53};
54
55pub mod backend;
56pub mod cache;
57pub mod capability;
58pub mod config;
59pub mod dispatch;
60pub mod error;
61pub mod prelude;
62pub mod types;
63pub mod validate;
64
65pub use backend::{
66 default_backend_session, BackendCachedDot, BackendRuntimeCache, BackendSession,
67 BackendSessionHost, ContractionScalar, DotGeneralAccumulation, ElementwiseReadOp,
68 SessionCachedDot, TensorAnalytic, TensorBackend, TensorBackendOps, TensorBuffer,
69 TensorDeviceTransfer, TensorDot, TensorElementwise, TensorFusion, TensorIndexing,
70 TensorReduction, TensorStructural, TensorViewCanonicalization,
71};
72pub use cache::{CacheStats, RuntimeCacheControl};
73pub use capability::{
74 capability_output_dtype, BackendId, CapabilityAxis, CapabilityQuery, OperationCapability,
75 SupportLevel, TensorBackendCapability,
76};
77pub use config::{
78 CompareDir, DotGeneralConfig, GatherConfig, PadConfig, ScatterConfig, SliceConfig,
79};
80pub use error::{BoxError, Error, ReinterpretError, Result};
81pub use types::{
82 col_major_strides, AllocationDomainId, AllocationId, BackendStorage, BackendStorageHandle,
83 CpuDomainId, DType, DeviceAccessError, DeviceAccessRequest, DeviceId, DeviceKind, DynRank,
84 GpuBackendKind, HostAccessError, HostReadGuard, HostWriteGuard, MemoryKind, Placement,
85 PreparedDeviceAccess, Rank, SharedTensorAllocationDomain, StorageBuffer, StridedSliceSpec,
86 Tensor, TensorLayout, TensorRank, TensorRead, TensorScalar, TensorStorageRef,
87 TensorStorageRefMut, TensorValue, TensorView, TensorViewMut, TensorWrite, TypedTensor,
88 TypedTensorView, TypedTensorViewMut, TypedTensorViewMutSplit, TypedTensorWrite,
89};
90
91mod storage;
92
93#[doc(hidden)]
94pub use storage::{
95 AccessError, AllocationKey, BackendAllocation, ProviderCapabilities, ProviderKind,
96 ProviderReadMapping, ProviderWriteMapping, RootBoundSpan, RootResourceExtent, RootResourceId,
97 SpanValidationError,
98};
99pub use storage::{AllocationGroup, DescriptorSlot, GroupError};
100
101pub(crate) fn core_dtype(dtype: DType) -> tenferro_tensor_core::DType {
102 match dtype {
103 DType::F32 => tenferro_tensor_core::DType::F32,
104 DType::F64 => tenferro_tensor_core::DType::F64,
105 DType::I32 => tenferro_tensor_core::DType::I32,
106 DType::I64 => tenferro_tensor_core::DType::I64,
107 DType::Bool => tenferro_tensor_core::DType::Bool,
108 DType::C32 => tenferro_tensor_core::DType::C32,
109 DType::C64 => tenferro_tensor_core::DType::C64,
110 }
111}
112
113#[cfg(test)]
114mod tests;