Skip to main content

PushKernelArg

Trait PushKernelArg 

Source
pub unsafe trait PushKernelArg<T> {
    // Required method
    fn arg(&mut self, arg: T) -> &mut Self;
}
Expand description

Something that can be copied to device memory and turned into a parameter for result::launch_kernel.

See the cuda docs on argument processing.

§Safety

This is unsafe you need to ensure that T can be represented in CUDA and also references to it can be properly passed to CUDA.

Most implementations will be required to use #[inline(always)] to ensure that references are handled properly.

Required Methods§

Source

fn arg(&mut self, arg: T) -> &mut Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, 'b, 'c, T> PushKernelArg<&'b CudaView<'c, T>> for LaunchArgs<'a>
where 'b: 'a, 'c: 'b,

Source§

impl<'a, 'b, 'c, T> PushKernelArg<&'b UnifiedView<'c, T>> for LaunchArgs<'a>
where 'b: 'a, 'c: 'b,

Source§

impl<'a, 'b, 'c, T> PushKernelArg<&'b UnifiedViewMut<'c, T>> for LaunchArgs<'a>
where 'b: 'a, 'c: 'b,

Source§

impl<'a, 'b, 'c, T> PushKernelArg<&'b mut CudaViewMut<'c, T>> for LaunchArgs<'a>
where 'b: 'a, 'c: 'b,

Source§

impl<'a, 'b, 'c, T> PushKernelArg<&'b mut UnifiedViewMut<'c, T>> for LaunchArgs<'a>
where 'b: 'a, 'c: 'b,

Source§

impl<'a, 'b, T> PushKernelArg<&'b CudaSlice<T>> for LaunchArgs<'a>
where 'b: 'a,

Source§

impl<'a, 'b, T> PushKernelArg<&'b UnifiedSlice<T>> for LaunchArgs<'a>
where 'b: 'a,

Source§

impl<'a, 'b, T> PushKernelArg<&'b mut CudaSlice<T>> for LaunchArgs<'a>
where 'b: 'a,

Source§

impl<'a, 'b, T> PushKernelArg<&'b mut UnifiedSlice<T>> for LaunchArgs<'a>
where 'b: 'a,

Source§

impl<'a, 'b, T> PushKernelArg<&'b T> for LaunchArgs<'a>
where 'b: 'a, T: DeviceRepr,