pub struct AsyncKernel { /* private fields */ }Expand description
Implementations§
Source§impl AsyncKernel
impl AsyncKernel
Sourcepub fn with_config(kernel: Kernel, config: AsyncLaunchConfig) -> Self
pub fn with_config(kernel: Kernel, config: AsyncLaunchConfig) -> Self
Creates a new AsyncKernel with the given configuration.
Sourcepub fn config(&self) -> &AsyncLaunchConfig
pub fn config(&self) -> &AsyncLaunchConfig
Returns a reference to the current AsyncLaunchConfig.
Sourcepub fn set_config(&mut self, config: AsyncLaunchConfig)
pub fn set_config(&mut self, config: AsyncLaunchConfig)
Updates the async configuration.
Sourcepub fn launch_async<A: KernelArgs>(
&self,
params: &LaunchParams,
stream: &Stream,
args: &A,
) -> CudaResult<LaunchCompletion>
pub fn launch_async<A: KernelArgs>( &self, params: &LaunchParams, stream: &Stream, args: &A, ) -> CudaResult<LaunchCompletion>
Launches the kernel and returns a LaunchCompletion future.
The kernel is launched asynchronously on the given stream, then a CUDA event is recorded. The returned future polls that event until it completes.
§Errors
Returns a CudaError if the kernel launch or event operations
fail. The future itself can also resolve to an error if the event
query fails later.
Sourcepub fn launch_and_time_async<A: KernelArgs>(
&self,
params: &LaunchParams,
stream: &Stream,
args: &A,
) -> CudaResult<TimedLaunchCompletion>
pub fn launch_and_time_async<A: KernelArgs>( &self, params: &LaunchParams, stream: &Stream, args: &A, ) -> CudaResult<TimedLaunchCompletion>
Launches the kernel and returns a TimedLaunchCompletion future
that resolves to LaunchTiming with elapsed GPU time.
Two events are recorded: one before and one after the kernel launch. When the future resolves, the elapsed time between the two events is computed.
§Errors
Returns a CudaError if the launch or event operations fail.