For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
apply_elementwise_epilogue
def apply_elementwise_epilogue[EpilogueFnType: ElementwiseEpilogueFn, dtype: DType, width: SIMDLength, //, elementwise_lambda_fn: Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None], *, alignment: Int = Int(1)](epilogue_fn: EpilogueFnType, idx: IndexList[Int(2)], val: SIMD[dtype, width])
Applies the legacy epilogue lambda if set, otherwise epilogue_fn.
Kernels that accept both epilogue forms call this under
comptime if elementwise_lambda_fn or has_epilogue_fn.
Parameters:
- EpilogueFnType (
ElementwiseEpilogueFn): Type ofepilogue_fn(inferred). - dtype (
DType): Element dtype ofval(inferred). - width (
SIMDLength): SIMD width ofval(inferred). - elementwise_lambda_fn (
Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None]): Legacy epilogue lambda; takes precedence when set. - alignment (
Int): Alignment ofvalin elements.
Args:
- epilogue_fn (
EpilogueFnType): Value epilogue, used whenelementwise_lambda_fnis unset. - idx (
IndexList[Int(2)]): Output coordinates. - val (
SIMD[dtype, width]): Output value.