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§
Required Associated Types§
Sourcetype Args: KernelArgs
type Args: KernelArgs
Object to be converted into a list of arguments to be passed to the cuda kernel function
Provided Methods§
Sourcefn launch(
&mut self,
grid_dim: dim3,
block_dim: dim3,
args: &mut Self::Args,
shared_mem: usize,
) -> Result<(), CudaRuntimeError>
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 gridblock_dim- Number of blocks in gridargs- List of arguments passed to cuda kernel functionsshared_mem- Size (in bytes) of shared memory to allocate for use within cuda kernel functions.
§Errors
This function may return the following errors
Sourcefn device_synchronize(&self) -> Result<(), CudaRuntimeError>
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.