Skip to main content

Crate oxmera_ops

Crate oxmera_ops 

Source
Expand description

The operation vocabulary oxmera backends implement.

The trait and enums are defined in oxmera-tensor (they must live with Tensor so its methods and std::ops overloads can dispatch under the orphan rule); this crate re-exports them as the stable, documented vocabulary for backend authors.

Semantics every backend must honor:

  • Binary elementwise operations broadcast per oxmera_core::shape::broadcast_shapes.
  • Operands must share a device and dtype; violations are typed errors, never coercions.
  • The output of every operation is a fresh contiguous tensor on the operands’ device.
  • The CPU backend defines correct answers; every other backend is validated against it within floating-point tolerance.

Structs§

MatmulPlan
The shape contract of a matmul, resolved once so every backend agrees.

Enums§

BinaryOp
Elementwise binary operations with NumPy broadcasting. f32 only.
ReduceOp
Reductions along axes. f32 only.
UnaryOp
Elementwise unary operations. Float (f32) tensors only.

Traits§

Backend
A complete backend: every primitive the tensor method layer dispatches.

Functions§

backend_for
The backend serving device, or a typed error when none is registered.
plan_matmul
Resolve the matmul contract for two shapes, or the typed error a caller sees for incompatible operands.
register_backend
Register a backend for its device, replacing any previous registration.
registered_devices
Every registered device, sorted for stable reporting.