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 function

accumulate_wo_tile_2d

def accumulate_wo_tile_2d[micro_kernel_height: Int, micro_kernel_width: Int, simd_size: Int, partial_load_filter: Bool, effected_by_padding: Bool, input_dt: DType, filter_dt: DType](c_tile_size: Int, RS: IndexList[Int(2)], mut acc: _Accumulator, input: Pointer[Scalar[input_dt], address_space=input.address_space], input_stride: Int, input_stride_to_nbr: IndexList[Int(2)], filter: Pointer[Scalar[filter_dt], address_space=filter.address_space], filter_stride: Int, filter_stride_to_nbr: IndexList[Int(2)], partial_load_filter_size: Int, hw: IndexList[Int(2)], HW: IndexList[Int(2)], dilation: IndexList[Int(2)])

Accumulates one output row tile for a 2D convolution by iterating over the R and S filter-window dimensions and delegating each row to accumulate_wo_tile_1d.

Parameters:

  • micro_kernel_height (Int): Number of input rows covered by the micro tile in register tiling.
  • micro_kernel_width (Int): Number of SIMD registers assigned to the F dimension per row.
  • simd_size (Int): Number of elements in a SIMD register.
  • partial_load_filter (Bool): True when the final filter segment is smaller than a full SIMD vector and must be partially loaded.
  • effected_by_padding (Bool): True when the tile may touch padded input regions, requiring per-point bounds checks.
  • input_dt (DType): Element type of the input tensor.
  • filter_dt (DType): Element type of the filter tensor.

Args:

  • c_tile_size (Int): Number of input channels in the current C tile.
  • RS (IndexList[Int(2)]): Filter window extents as (R, S) with R the height and S the width.
  • acc (_Accumulator): Register-tile accumulator updated in place with the convolution products.
  • input (Pointer[Scalar[input_dt], address_space=input.address_space]): Pointer to the first input element of the WO tile.
  • input_stride (Int): Stride between consecutive output points along WO in the input, equal to C * stride_w in NHWC layout.
  • input_stride_to_nbr (IndexList[Int(2)]): Strides to the input neighbor for each spatial axis (R, S), i.e. (stride_to_R_neighbor, stride_to_S_neighbor).
  • filter (Pointer[Scalar[filter_dt], address_space=filter.address_space]): Pointer to the first filter coefficient in the filter window.
  • filter_stride (Int): Stride between consecutive filter segments of size micro_kernel_width * simd_size along the F dimension.
  • filter_stride_to_nbr (IndexList[Int(2)]): Strides to the filter neighbor for each spatial axis (R, S).
  • partial_load_filter_size (Int): Number of valid elements in the final partial filter SIMD vector when F is not a multiple of simd_size.
  • hw (IndexList[Int(2)]): Input spatial coordinate (h, w) of the tile's first output point before padding adjustment.
  • HW (IndexList[Int(2)]): Input spatial extents (H, W) used for padding bounds checks.
  • dilation (IndexList[Int(2)]): Dilation factors (dilation_h, dilation_w) applied to the filter window.