pub struct KernelProfile {
pub kernel: Arc<CachedKernel>,
pub device: DeviceSpec,
pub num_buffers: usize,
pub elapsed: Duration,
}Expand description
Per-kernel timing from a profiled execution.
Holds an Arc<CachedKernel> for zero-copy access to kernel metadata
(entry point, generated code, global/local size, variable names).
§Example
ⓘ
let plan = tensor.prepare()?;
let profiles = plan.execute_profiled()?;
for (i, p) in profiles.iter().enumerate() {
println!("{:4} {:>8.3}ms {} ({} bufs, {:?})",
i, p.elapsed.as_secs_f64() * 1000.0,
p.kernel.entry_point, p.num_buffers, p.device);
}Fields§
§kernel: Arc<CachedKernel>Compiled kernel (entry_point, code, global_size, local_size, var_names).
device: DeviceSpecDevice this kernel executed on.
num_buffers: usizeNumber of buffer arguments.
elapsed: DurationWall-clock execution time.
Auto Trait Implementations§
impl Freeze for KernelProfile
impl !RefUnwindSafe for KernelProfile
impl Send for KernelProfile
impl Sync for KernelProfile
impl Unpin for KernelProfile
impl UnsafeUnpin for KernelProfile
impl !UnwindSafe for KernelProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more