Skip to main content

Kernels

Struct Kernels 

Source
pub struct Kernels { /* private fields */ }

Implementations§

Source§

impl Kernels

Source

pub fn new(device: Device) -> Result<Self, String>

Starts the compile threads and builds tier 0 (blocking): every op’s kernel, so a new structure renders op by op at once (the live player, the render service).

Source

pub fn on_demand(device: Device) -> Result<Self, String>

Starts the compile threads and builds the utility kernels only; an op’s tier-0 kernel compiles when something first needs it (Kernels::tier0_kernel). For one render that waits for its fused kernels anyway (an export, a frame): the first run after an install or an upgrade doesn’t compile ~30 kernels it never uses (about 0.9 s on 8 threads).

Source

pub fn tier0(&self, func: &str) -> Option<&Tier0>

Source

pub fn tier0_kernel(&self, func: &str) -> Result<Kernel, String>

The tier-0 kernel for op function func, compiled now if it hasn’t been (blocks until it is).

Source

pub fn request(&self, kernels: Vec<(String, String)>) -> usize

Queues kernels that are not known yet. Returns how many were queued.

Source

pub fn get(&self, key: &str) -> Option<KernelState>

Source

pub fn ready(&self, key: &str) -> Option<Kernel>

Ready kernel for key, if any.

Source

pub fn wait(&self, key: &str) -> KernelState

Blocks until key is no longer pending.

Source

pub fn utility(&self, name: &str) -> Kernel

Source

pub fn pending(&self) -> usize

Source

pub fn stats(&self) -> CompileStats

Trait Implementations§

Source§

impl Drop for Kernels

Source§

fn drop(&mut self)

Ends the compile threads and waits for them: each holds the device, which must be let go here, not on a thread still running while the process exits (the GPU driver tears down under it).

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.