Skip to main content

Crate strided_perm

Crate strided_perm 

Source
Expand description

Cache-efficient tensor permutation / transpose.

This crate provides optimized copy and permutation operations for strided multidimensional arrays. It is designed as a single-responsibility crate sitting between strided-view (data structures) and strided-kernel (general map/reduce/broadcast operations).

§Dependency graph

strided-view -> strided-perm -> strided-kernel

§Threading

Every copy takes a threadteam::Exec placement token as its last parameter and splits the permutation within that budget. The width is decided by the token: the serial time of the copy (copy_ns_per_element times its elements) against the dispatch cost of one section (Exec::width_for), so a copy too small to repay a fan-out runs on the calling thread whatever the budget. The crate never reaches a global pool; pass Exec::serial() for a copy on the calling thread.

Structs§

BilateralFusionPlan
Validated result of fusing adjacent dimensions that are contiguous in both source and destination layouts.

Enums§

FusionPlanError
Failure while validating or constructing a bilateral fusion plan.
HostClass
The class of the machine, keyed by the kernel dispatch it will take.

Constants§

BLOCK_MEMORY_SIZE
CACHE_LINE_SIZE

Functions§

copy_into
Copy elements from source to destination: dest[i] = src[i].
copy_into_col_major
Copy elements to a col-major destination.
copy_into_uninit
Copy elements into an uninitialized destination: dest[i] = src[i].
copy_ns_per_element
Serial throughput of a copy in nanoseconds per element on this host (copy_ns_per_element_of of HostClass::detect).
copy_ns_per_element_of
Serial throughput of a copy in nanoseconds per element, of a host class.
plan_bilateral_fusion
Plan bilateral dimension fusion for source and destination layouts.