pub unsafe trait KernelArg {
// Required method
fn as_kernel_arg_ptr(&self) -> *mut c_void;
}Expand description
A value that can be marshalled into the void** kernelParams slot of
cuLaunchKernel / cudaLaunchKernel.
§Safety
Implementors must uphold:
Self::as_kernel_arg_ptrreturns a pointer whose pointee is a validDeviceReprvalue of the correct type for the target kernel slot.- The returned pointer remains valid until the kernel launch has been submitted to the stream (not necessarily completed — the runtime copies argument bytes during submission).
- Concurrent kernel launches using the same argument value must tolerate
shared access; in practice this means the referent is either
Copyor borrowed immutably for the duration of submission.