Skip to main content

Module types

Module types 

Source
Expand description

C type mapping and constant rendering for the C codegen backend.

Functionsยง

c_cast
Get the C cast expression for converting between types.
c_const
Render a constant value as a C literal.
c_dtype
Convert a DType to its C type string.
c_math_fn
Get the C math function name for the given unary op suffix and dtype. Returns function name with type suffix (e.g. sqrtf for float, sqrt for double).
c_reduce_identity
Get the identity element for a reduce operation as a C literal.
c_scalar
Convert a DType to its C scalar type string.
c_vconst
Render a vector constant as a C initializer.
collect_vector_typedefs
Collect all vector types used in the linearized instruction stream and return the necessary typedef declarations.