Skip to main content

NvrtcLaunchDispatch

Trait NvrtcLaunchDispatch 

Source
pub trait NvrtcLaunchDispatch: Send + 'static {
    // Required methods
    fn op_name(&self) -> &'static str;
    fn dtype(&self) -> Option<DType>;
    fn dispatch(self: Box<Self>, ctx: &NvrtcDispatchCtx<'_>);
}
Expand description

Boxed-dispatch trait for an NVRTC kernel launch request.

NvrtcMsg::Launch carries an args: Vec<KernelArg>; each arg implements either DevSliceArg (typed device buffers) or ScalarArg (typed host scalars). The Launch variant itself does not need a Box<dyn NvrtcLaunchDispatch> payload because KernelHandle already carries the typed CudaFunctionNvrtcLaunchDispatch is a marker for the request as a whole so cross-actor tooling (NVTX naming, KernelTrace, future graph recording) sees a uniform interface across all actors.

Required Methods§

Source

fn op_name(&self) -> &'static str

Static op identifier surfaced to NVTX / KernelTrace. NVRTC kernels are user-supplied so this returns "nvrtc_launch" by default; callers may override with the kernel name.

Source

fn dtype(&self) -> Option<DType>

Element dtype, when the request has a single-dtype identity. None for traceless / multi-dtype actors (NVRTC is multi-dtype because user kernels can mix arg types — implementors return None).

Source

fn dispatch(self: Box<Self>, ctx: &NvrtcDispatchCtx<'_>)

Run the dispatch: validate inputs, enqueue the kernel, deliver the reply via the completion strategy in ctx.

Implementors§