pub trait ScalarArg:
Send
+ Sync
+ 'static {
// Required methods
fn push<'a>(&'a self, builder: &mut LaunchArgs<'a>);
fn dtype(&self) -> Option<DType>;
}Expand description
Type-erased typed-host-scalar argument for an NVRTC kernel launch.
Boxed as Box<dyn ScalarArg> inside KernelArg::Scalar. A blanket
impl impl<T: CudaDtype> ScalarArg for T covers every dtype the
runtime understands. usize and bool are not CudaDtype so
callers use the dedicated super::nvrtc::KernelArg::Usize
variant for sizes — the most common scalar arg by far.