Expand description
CPU backend, kernels, provider selection, and CPU resource pools.
§Examples
use tenferro_cpu::CpuBackend;
use tenferro_tensor::{Tensor, TensorBackend, TensorElementwise};
let mut backend = CpuBackend::new();
let a = Tensor::from_vec_col_major(vec![2], vec![1.0_f64, 2.0])?;
let b = Tensor::from_vec_col_major(vec![2], vec![3.0_f64, 4.0])?;
let c = backend.add(&a, &b)?;
assert_eq!(c.as_slice::<f64>().unwrap(), &[4.0, 6.0]);Re-exports§
pub use affinity::available_parallelism;pub use affinity::process_cpu_affinity;pub use affinity::process_cpu_affinity_count;pub use affinity::CpuAffinityError;pub use backend::CpuBackend;pub use backend::CpuBackendError;pub use backend::CpuBackendKind;pub use backend::CpuExecutionInfo;pub use backend::CpuExecutionMode;pub use backend::CpuRuntimeIdentity;pub use backend::ExternalCpuDomainRegistryError;pub use context::CpuContext;pub use context::CpuContextError;pub use provider::CpuExecutionContext;pub use provider::ParallelMode;
Modules§
Structs§
- Buffer
Pool Stats - Snapshot of typed host buffers retained by a
BufferPool. - CpuAffinity
Input - CPU affinity metadata for one logical operation input.
- CpuAffinity
Selection - Deterministic CPU affinity selection returned by the pure resolver.
- CpuDomain
Executor Capabilities - Immutable construction-time capabilities of a CPU domain executor.
- CpuId
- An operating-system logical CPU identifier.
- CpuNode
- One usable OS NUMA node and its process-allowed logical CPUs.
- CpuProvider
Bundle - Immutable direct provider slots installed on a CPU backend.
- CpuProvider
Bundle Build Error - Error returned when a custom CPU provider bundle omits mandatory slots.
- CpuProvider
Bundle Builder - Construction-time builder for immutable CPU provider slots.
- CpuProvider
Execution Capabilities - Immutable execution capabilities declared by one CPU provider.
- CpuSet
- A sorted, deduplicated, non-empty set of logical CPUs.
- CpuTopology
- Process-visible CPU topology used for execution placement.
- External
CpuDomain - Caller-supplied descriptor for one externally managed CPU resource domain.
- Indexed
Plan Cache Limits - Limits for the CPU indexed-plan cache.
- Numa
Node Id - An operating-system NUMA node identifier.
Enums§
- CpuAffinity
Input Error - Failure to derive logical input bytes for CPU affinity resolution.
- CpuAffinity
Policy - Policy used to select a CPU execution domain from input affinity metadata.
- CpuAffinity
Resolution Error - Failure to resolve CPU affinity from input metadata.
- CpuAffinity
Selection Reason - Why the CPU affinity resolver selected a domain.
- CpuDomain
Executor Error - Failure at the CPU executor admission or scheduling boundary.
- CpuDomain
Ownership - Ownership class of a CPU resource domain.
- CpuEngine
Construction Error - Typed failure raised while constructing a CPU execution engine.
- CpuExecutor
Affinity - Affinity claim made by a CPU domain executor.
- CpuExecutor
Reentrancy - Re-entry capability of one CPU domain executor.
- CpuExecutor
Shutdown - Ownership of CPU executor shutdown.
- CpuInner
Parallelism - Inner parallel-region support offered by a CPU domain executor.
- CpuPlacement
- Requested CPU execution placement.
- CpuPlacement
Control - Per-call control over where a CPU provider executes.
- CpuPlacement
Error - Failure to resolve a CPU placement for the selected public provider kind.
- CpuPlacement
Guarantee - Strength of a caller’s declared CPU placement for one resource domain.
- CpuProvider
Bundle Install Error - Failure to install a CPU provider bundle for the backend’s domains.
- CpuProvider
Domain Error - Typed incompatibility between a CPU provider and a selected CPU domain.
- CpuProvider
Slot - Provider slot that failed construction-time domain validation.
- CpuSet
Error - Failure to construct a non-empty CPU set.
- CpuThread
Count Control - Per-call control over the maximum number of threads used by a CPU provider.
- CpuTopology
Error - Failure to canonicalize discovered NUMA topology.
- External
CpuDomain Error - Typed failure to construct an externally managed CPU resource domain.
- General
Contraction Policy - Policy applied when the configured general-contraction provider reports a typed capability miss.
- Resolved
CpuPlacement - Concrete CPU placement resolved for a managed domain or declared by an external domain.
Traits§
- CpuDomain
Executor - Object-safe synchronous executor for one CPU resource domain.
- Scoped
CpuJob - One borrowed job installed synchronously into a CPU domain executor.
- Scoped
CpuJobs - Synchronously submitted indexed jobs for engine-owned outer scheduling.
Functions§
- cpu_
capabilities - Return the CPU backend operation capability descriptor table.
- discover_
cpu_ topology - Discover the process-visible CPU and NUMA topology.
- resolve_
cpu_ affinity - Resolve a CPU execution domain from input affinity metadata.
- resolve_
cpu_ affinity_ with_ override - Resolve CPU affinity with an optional operation-local explicit override.
- runtime_
engine_ id - Return the canonical CPU runtime engine identifier.
- runtime_
engine_ registration - Build a runtime engine registration for a
CpuBackend. - runtime_
engine_ registration_ with_ id - Build a runtime engine registration for a
CpuBackendwith a caller-selected engine identifier. - runtime_
hardware_ class - Return the canonical CPU runtime hardware class.