Skip to main content

Module module

Module module 

Source
Expand description

ModuleActor — load prebuilt cubin/PTX from disk (or memory) and launch its kernels.

Distinct from crate::kernel::nvrtc / NvrtcActor, which JIT-compiles CUDA C++ at runtime. This actor is for the “ahead-of-time-compiled, ship-the-bytes” workflow.

Lifecycle:

  1. LoadCubin { bytes } or LoadPtx { src } → returns a ModuleHandle.
  2. GetFunction { handle, name } → returns a FunctionHandle.
  3. Launch { function, cfg, args } → enqueues a kernel call on the actor’s stream and replies after stream completion.
  4. LaunchCooperative { function, cfg, args } → same but goes through cuLaunchCooperativeKernel. Required for cluster / grid-sync kernels (Hopper SM90+).
  5. Unload { handle } → frees the CUmodule.

KernelArg is re-exported from crate::kernel::nvrtc so this actor and NvrtcActor share one launch-arg type.

Re-exports§

pub use crate::kernel::nvrtc::KernelArg;

Structs§

FunctionHandle
ModuleActor
ModuleHandle
Opaque module handle. Carries an internal id used by the actor’s internal HashMap.

Enums§

ModuleMsg