Skip to main content

Crate cubecl_common

Crate cubecl_common 

Source
Expand description

§CubeCL Common Library

This library contains common types used by other crates that must be shared.

Environment shims (sync primitives, futures, streams, config, persistence) live in the cubecl-environment crate.

Modules§

arena
A circular, allocation-free arena for reusable memory blocks.
benchmark
Module for benchmark timings
bytes
Utilities module to manipulate bytes.
device
Device module.
device_handle
Device handle module.
format
Format utilities.
pool
A dynamically-growing pool that leases exclusive, reusable single-cell items. A dynamically-growing pool of single-cell items handed out as exclusive, non-cloneable handles.
profile
Module for profiling any executable part
quant
Quantization primitives required outside of cubecl-quant
work
The work a benchmark or a kernel performs, for scoring against measured peaks.

Macros§

obfuscate
Generate a type-erased, inline wrapper for a single value.

Structs§

ComptimeFloat
A finite float usable as a comptime kernel parameter.
InvalidComptimeFloat
A float value that cannot be used as a ComptimeFloat because it is infinite or NaN.
Ratio
An exact ratio of two integers, reduced to lowest terms on construction.
e2m1
A 4-bit floating point type with 2 exponent bits and 1 mantissa bit.
e2m3
A 6-bit floating point type with 2 exponent bits and 3 mantissa bits.
e2m1x2
A 4-bit floating point type with 2 exponent bits and 1 mantissa bit. Packed with two elements per value, to allow for conversion to/from bytes. Care must be taken to ensure the shape is adjusted appropriately.
e3m2
A 6-bit floating point type with 3 exponent bits and 2 mantissa bits.
flex32
A floating point type with relaxed precision, minimum f16, max f32.
tf32
A 19-bit floating point type implementing the tfloat32 format.
ue8m0
An 8-bit unsigned floating point type with 8 exponent bits and no mantissa bits. Used for scaling factors.

Traits§

FloatBits
A float type whose bit representation can stand in for PartialEq/Eq/Hash.

Functions§

powi_portable
Rust’s powi returns mathematically incorrect results on Windows for large negative exponents. This is an implementation of the standard exponentiation by squaring algorithm used by compilers on most platforms to implement accurate powi. Should be bit-identical to the one in LLVM’s compiler-rt.