Skip to main content

conv1d_forward

Function conv1d_forward 

Source
pub fn conv1d_forward<T: Triton, D: Num, const KL: i32, const STRIDE: i32, const PAD: i32, const BLOCK_OL: i32>(
    x_ptr: T::Pointer<D>,
    w_ptr: T::Pointer<D>,
    y_ptr: T::Pointer<D>,
    _B: i32,
    C_IN: i32,
    C_OUT: i32,
    L: i32,
    OL: i32,
)
where T::I32Tensor: Tensor<i32, 1> + Comparison<i32, BoolTensor = T::BoolTensor>, T::BoolTensor: BitAnd<Output = T::BoolTensor>, T::Pointer<D>: AddOffsets<i32, 1, T::I32Tensor, Output = T::Tensor<T::Pointer<D>>>,
Expand description

1-D convolution forward pass.

Grid: one CTA per (b, c_out, ol-tile): pid = (b * C_OUT + c_out) * num_ol_tiles + ol_tile

Each CTA computes a BLOCK_OL-wide strip of output positions by iterating over all C_IN * KL combinations.

Zero-padding of PAD elements is applied on each side of the input. OL = (L + 2*PAD - KL) / STRIDE + 1.