IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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 module

conv_utils

Utilities for direct convolution kernels on CPU.

Provides convolution shape description, L2 tiling heuristics, micro-kernel shape selection, and work partitioning helpers used by the direct and im2col convolution implementations.

comptime values​

ConvEpilogueFn​

comptime ConvEpilogueFn = def(Coord[*?], Int) -> None & RegisterPassable & ImplicitlyCopyable

Fused epilogue applied over a whole f_size-long run at coords.

Distinct from ConvSimdEpilogueFn, which receives the value; this one receives only the coordinate and the run length. Rank-N in the output's own space; the Coord carries its rank, so there is no rank parameter.

ConvSimdEpilogueFn​

comptime ConvSimdEpilogueFn = def[dtype: DType, width: SIMDLength, alignment: Int = Int(1)](Coord[*?], SIMD[dtype, width]) -> None & RegisterPassable & ImplicitlyCopyable

Value-taking counterpart of elementwise_simd_epilogue_type.

A unified closure passed as a runtime value carries the origins of its captures, so the buffers it writes stay alive until the convolution that calls it returns.

elementwise_simd_epilogue_type​

comptime elementwise_simd_epilogue_type = def[dtype: DType, width: SIMDLength, alignment: Int = Int(1)](Coord[*?], SIMD[dtype, width]) capturing thin -> None

Fused elementwise epilogue for convolution: (coord, value) -> None.

The coordinate is rank-N in the output's own space (NHWC / NDHWC), unlike linalg.utils.elementwise_epilogue_type, which is always rank 2. The Coord carries its own rank.

Structs​

  • ​ConvAlgorithm: Tags the convolution algorithm selected for a given operation.
  • ​ConvInfoStatic: Holds statically known convolution attributes (padding, stride, dilation, groups).
  • ​ConvPartition: Work range for a partition.
  • ​ConvShape: A shape struct describing the convolution dimensions.
  • ​NoConvEpilogue: Stands in for a ConvEpilogueFn argument on code paths that apply no epilogue.

Functions​

Was this page helpful?