Skip to main content

Crate tenferro_cpu

Crate tenferro_cpu 

Source
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§

affinity
backend
context
provider
Object-safe CPU contraction provider contracts.

Structs§

BufferPoolStats
Snapshot of typed host buffers retained by a BufferPool.
CpuAffinityInput
CPU affinity metadata for one logical operation input.
CpuAffinitySelection
Deterministic CPU affinity selection returned by the pure resolver.
CpuDomainExecutorCapabilities
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.
CpuProviderBundle
Immutable direct provider slots installed on a CPU backend.
CpuProviderBundleBuildError
Error returned when a custom CPU provider bundle omits mandatory slots.
CpuProviderBundleBuilder
Construction-time builder for immutable CPU provider slots.
CpuProviderExecutionCapabilities
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.
ExternalCpuDomain
Caller-supplied descriptor for one externally managed CPU resource domain.
IndexedPlanCacheLimits
Limits for the CPU indexed-plan cache.
NumaNodeId
An operating-system NUMA node identifier.

Enums§

CpuAffinityInputError
Failure to derive logical input bytes for CPU affinity resolution.
CpuAffinityPolicy
Policy used to select a CPU execution domain from input affinity metadata.
CpuAffinityResolutionError
Failure to resolve CPU affinity from input metadata.
CpuAffinitySelectionReason
Why the CPU affinity resolver selected a domain.
CpuDomainExecutorError
Failure at the CPU executor admission or scheduling boundary.
CpuDomainOwnership
Ownership class of a CPU resource domain.
CpuEngineConstructionError
Typed failure raised while constructing a CPU execution engine.
CpuExecutorAffinity
Affinity claim made by a CPU domain executor.
CpuExecutorReentrancy
Re-entry capability of one CPU domain executor.
CpuExecutorShutdown
Ownership of CPU executor shutdown.
CpuInnerParallelism
Inner parallel-region support offered by a CPU domain executor.
CpuPlacement
Requested CPU execution placement.
CpuPlacementControl
Per-call control over where a CPU provider executes.
CpuPlacementError
Failure to resolve a CPU placement for the selected public provider kind.
CpuPlacementGuarantee
Strength of a caller’s declared CPU placement for one resource domain.
CpuProviderBundleInstallError
Failure to install a CPU provider bundle for the backend’s domains.
CpuProviderDomainError
Typed incompatibility between a CPU provider and a selected CPU domain.
CpuProviderSlot
Provider slot that failed construction-time domain validation.
CpuSetError
Failure to construct a non-empty CPU set.
CpuThreadCountControl
Per-call control over the maximum number of threads used by a CPU provider.
CpuTopologyError
Failure to canonicalize discovered NUMA topology.
ExternalCpuDomainError
Typed failure to construct an externally managed CPU resource domain.
GeneralContractionPolicy
Policy applied when the configured general-contraction provider reports a typed capability miss.
ResolvedCpuPlacement
Concrete CPU placement resolved for a managed domain or declared by an external domain.

Traits§

CpuDomainExecutor
Object-safe synchronous executor for one CPU resource domain.
ScopedCpuJob
One borrowed job installed synchronously into a CPU domain executor.
ScopedCpuJobs
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 CpuBackend with a caller-selected engine identifier.
runtime_hardware_class
Return the canonical CPU runtime hardware class.