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.
sqrtffor float,sqrtfor 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.