CooperativeKernel

Trait CooperativeKernel 

Source
pub trait CooperativeKernel {
    type Args: KernelArgs;

    const FUNC_PTR: *const c_void;

    // Provided methods
    fn launch(
        &mut self,
        grid_dim: dim3,
        block_dim: dim3,
        args: &mut Self::Args,
        shared_mem: usize,
    ) -> Result<(), CudaRuntimeError> { ... }
    fn device_synchronize(&self) -> Result<(), CudaRuntimeError> { ... }
}
Expand description

Trait defining cuda cooperative kernel functions

Required Associated Constants§

Source

const FUNC_PTR: *const c_void

Pointer to cuda kernel function

Required Associated Types§

Source

type Args: KernelArgs

Object to be converted into a list of arguments to be passed to the cuda kernel function

Provided Methods§

Source

fn launch( &mut self, grid_dim: dim3, block_dim: dim3, args: &mut Self::Args, shared_mem: usize, ) -> Result<(), CudaRuntimeError>

cuda kernel startup function Launches a device function where thread blocks can cooperate and synchronize as they execute.

§Arguments
  • grid_dim - Number of dims in grid
  • block_dim - Number of blocks in grid
  • args - List of arguments passed to cuda kernel functions
  • shared_mem - Size (in bytes) of shared memory to allocate for use within cuda kernel functions.
§Errors

This function may return the following errors

Source

fn device_synchronize(&self) -> Result<(), CudaRuntimeError>

Function that waits for the completion of the execution of the process passed to the Cuda kernel

§Errors

This function may return the following errors

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§