pub struct NllLossForward {
pub name: &'static str,
pub id: String,
pub kernel_source: String,
pub entry_point_source: String,
pub source: String,
}Expand description
NLL loss forward: out[n] = -log_prob[n, target[n]].
Grid: [n_rows, 1, 1] — one CTA per batch element.
The flat index pid * n_cols + target is computed entirely in
T::Tensor<i32> space (from T::full + T::load arithmetic), avoiding any
conversion to T::I32Tensor. A separate AddOffsets bound on
T::Pointer<_> for T::Tensor<i32> covers the indexed load and store.
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 “__”.
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 Kernel for NllLossForward
impl Kernel for NllLossForward
Source§type Args<'__a> = (*mut f32, *mut i32, *mut f32, i32, i32)
type Args<'__a> = (*mut f32, *mut i32, *mut f32, i32, i32)
This kernel’s launch-argument tuple type.
Source§fn kernel_source(&self) -> &str
fn kernel_source(&self) -> &str
This kernel’s body source, without the entry-point wrapper.
Source§fn entry_point_source(&self) -> &str
fn entry_point_source(&self) -> &str
Returns the Rust source of the generated C-ABI entry-point wrapper function.
Source§fn entry_point_name(&self) -> String
fn entry_point_name(&self) -> String
Returns the PTX symbol name for this kernel:
"{name}_entry_point".Auto Trait Implementations§
impl Freeze for NllLossForward
impl RefUnwindSafe for NllLossForward
impl Send for NllLossForward
impl Sync for NllLossForward
impl Unpin for NllLossForward
impl UnsafeUnpin for NllLossForward
impl UnwindSafe for NllLossForward
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more