Skip to main content
Log in

Mojo function

naive_reduce_kernel

naive_reduce_kernel[type: DType](dst_buf: UnsafePointer[SIMD[type, 1]], src_buf: UnsafePointer[SIMD[type, 1]], num_elements: Int)

A simple reduction kernel that adds source buffer values to destination buffer.

Arguments: dst_buf: Destination buffer to accumulate results src_buf: Source buffer containing values to add num_elements: Number of elements to process

Each thread handles multiple elements with striding for coalesced memory access.

Parameters:

  • type (DType): DType - The data type of the values being reduced.