pub struct Conv2dBackward<D: Num> {}Expand description
2-D convolution combined backward pass — computes both dx and dw in one
kernel launch, using the same grid as the forward pass.
Grid: pid = ((b * C_OUT + c_out) * OH + oh) * num_ow_tiles + ow_tile
For each (c_in_local, kh, kw) combination:
dx:atomic_add(dx_ptr[b, c_in, ih, iw], dy * w)dw:atomic_add(dw_ptr[c_out, c_in_local, kh, kw], sum(dy * x))
Both dx_ptr and dw_ptr must be zero-initialised before launch.
Fields§
§name: &'static strThe kernel function’s name (e.g. "flash_attention2_forward").
id: StringUnique kernel identifier: fn_name + dtype(s) + const values joined by “__”.
kh: i32Compile-time kernel constant, from the annotated fn’s const generics.
kw: i32Compile-time kernel constant, from the annotated fn’s const generics.
stride_h: i32Compile-time kernel constant, from the annotated fn’s const generics.
stride_w: i32Compile-time kernel constant, from the annotated fn’s const generics.
pad_h: i32Compile-time kernel constant, from the annotated fn’s const generics.
pad_w: i32Compile-time kernel constant, from the annotated fn’s const generics.
g: i32Compile-time kernel constant, from the annotated fn’s const generics.
block_ow: i32Compile-time kernel constant, from the annotated fn’s const generics.
kernel_source: StringThe original kernel function source.
entry_point_source: StringThe Rust source of the generated C-ABI entry-point wrapper function.
source: StringCombined source (kernel_source + "\n\n" + entry_point_source); used by the Kernel trait.
Implementations§
Trait Implementations§
Source§impl<D: Num> Kernel for Conv2dBackward<D>
impl<D: Num> Kernel for Conv2dBackward<D>
Source§type Args<'__a> = (*mut D, *mut D, *mut D, *mut D, *mut D, i32, i32, i32, i32, i32, i32, i32)
type Args<'__a> = (*mut D, *mut D, *mut D, *mut D, *mut D, i32, i32, i32, i32, i32, i32, i32)
Source§fn kernel_source(&self) -> &str
fn kernel_source(&self) -> &str
Source§fn entry_point_source(&self) -> &str
fn entry_point_source(&self) -> &str
Source§fn entry_point_name(&self) -> String
fn entry_point_name(&self) -> String
"{name}_entry_point".