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 types;
62pub mod validate;
63
64pub use backend::{
65 default_backend_session, BackendCachedDot, BackendRuntimeCache, BackendSession,
66 BackendSessionHost, ContractionScalar, DotGeneralAccumulation, ElementwiseReadOp,
67 SessionCachedDot, TensorAnalytic, TensorBackend, TensorBackendOps, TensorBuffer,
68 TensorDeviceTransfer, TensorDot, TensorElementwise, TensorFusion, TensorIndexing,
69 TensorReduction, TensorStructural, TensorViewCanonicalization,
70};
71pub use cache::{CacheStats, RuntimeCacheControl};
72pub use capability::{
73 capability_output_dtype, BackendId, CapabilityAxis, CapabilityQuery, OperationCapability,
74 SupportLevel, TensorBackendCapability,
75};
76pub use config::{
77 CompareDir, DotGeneralConfig, GatherConfig, PadConfig, ScatterConfig, SliceConfig,
78};
79pub use error::{BoxError, Error, Result};
80pub use types::{
81 col_major_strides, AllocationDomainId, AllocationId, BackendBuffer, Buffer, BufferHandle,
82 CpuDomainId, DType, DeviceId, DeviceKind, DynRank, GpuBackendKind, HostAccessError,
83 HostReadGuard, HostWriteGuard, MemoryKind, Placement, Rank, SharedTensorAllocationDomain,
84 StridedSliceSpec, Tensor, TensorBufferRef, TensorBufferRefMut, TensorLayout, TensorOwnedView,
85 TensorRank, TensorRead, TensorScalar, TensorValue, TensorView, TensorViewMut, TensorWrite,
86 TypedTensor, TypedTensorView, TypedTensorViewMut, TypedTensorViewMutPair, TypedTensorWrite,
87};
88
89pub(crate) fn core_dtype(dtype: DType) -> tenferro_tensor_core::DType {
90 match dtype {
91 DType::F32 => tenferro_tensor_core::DType::F32,
92 DType::F64 => tenferro_tensor_core::DType::F64,
93 DType::I32 => tenferro_tensor_core::DType::I32,
94 DType::I64 => tenferro_tensor_core::DType::I64,
95 DType::Bool => tenferro_tensor_core::DType::Bool,
96 DType::C32 => tenferro_tensor_core::DType::C32,
97 DType::C64 => tenferro_tensor_core::DType::C64,
98 }
99}
100
101#[cfg(test)]
102mod tests;