Skip to documentation
SLOP

tiny.gpu.BackendMathTier

Reference tiny.gpu BackendMathTier

Defined in contract.

A caller picks the math tier, the arithmetic contract compiled code follows, before compiling for a device.

API (3)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callscontractBackendMathTier
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/gpu/src/contract.zig:79

zig
/// A caller picks the math tier, the arithmetic contract compiled code follows, before compiling/// for a device. Two choices exist: `exact`, the default, and `tf32_tensor`, which uses the/// reduced-precision TF32 format on NVIDIA tensor cores. The option `tf32_tensor` is accepted only/// for a CUDA backend, one device runtime behind the common interface, emitting PTX on a device/// with tensor cores. Compiling fails with an error when a kernel cannot be compiled under/// `tf32_tensor`, and the code never falls back to another tier on its own. The chosen tier is/// hashed into the identity of the compiled artifact, so code compiled under one tier remains/// distinct from code compiled under the other. A tier chooses arithmetic precision alone, and it/// gives no license for algebraic rewrites that change which values are NaN, infinities or the sign/// of zero.pub const BackendMathTier = enum(u8) {    exact = 0,    tf32_tensor = 1,    pub fn parse(text: []const u8) ?BackendMathTier {        inline for (            @typeInfo(BackendMathTier).@"enum".field_names,            @typeInfo(BackendMathTier).@"enum".field_values,        ) |field_name, field_name_value| {            const field = .{ .name = field_name, .value = field_name_value };            const value: BackendMathTier = @fromBackingInt(@intCast(field.value));            if (std.mem.eql(u8, text, @tagName(value))) return value;        }        return null;    }};

Source: lib/gpu/src/root.zig:38

zig
pub const BackendMathTier = contract.BackendMathTier;

Audit

Definitions2
Public names4
Members2
Version26.7.0
Revisiondaab053ee433