跳转到内容
查看源码

entelechy-rules自动生成

层:核心层 · 代码行数:2,699 · 集成测试文件:0

所有后端共同遵守的执行规则:调用、地址、合并、矩阵公式、光栅化契约。

The rules of Kernel execution every backend keeps: invocations, addresses, combines, the matrix formulas, the rasterizer’s contract

The rules of Kernel execution every backend keeps: invocation checks, scan and scatter sizing, scatter placement and combining, the reduction tree, float ordering, the rasterizer’s contract, the machine’s clock, and the Backend trait. The backends execute; this crate rules.

内部依赖 entelechy-abi, entelechy-ir
外部依赖 —
源码 crates/core/rules
名称 简述
backend The contract every backend implements. The interpreter, the JIT and the GPU each implement Backend in their own crate; the Kernel Runtime holds whichever it is given. This crate is independent of the runtime.
clock The machine’s clock, which every layer times by. wasm32-unknown-unknown has none of its own: there the host gives one (give), and until it does nothing is timed or dated.
placement Where a picture lands in a window: fitted whole, aspect kept, centered. Presenters, CPU blits and pointer mapping share this rule.
raster The native rasterize operation’s contract, and the CPU rasterizer the interpreter and the JIT each run. It is the fast path of the render package’s rule and gives its surface bit for bit. It is device emulation; shading, projection and geometry live in Kernels.
reduce The tree every backend folds a reduction in, so a float sum is the same wherever it runs.
prefix The grouping a prefix fold takes on a backend that blocks it. A prefix’s rule is order-free, so grouping changes no word; a block of about the square root of the count balances the two walks.
名称 简述
backend::ClockedFrame A frame the device has done, by its clock (Backend::clocked_frame): its number, and how long each of its runs kept the device busy, from its submission or the run before’s end, whichever is later, to its own end; the runs in the order they were given.
clock::Moment A moment on the machine’s clock, from the clock’s first reading.
placement::Placement The image’s rectangle inside the window, in window pixels.
raster::Cutout What a cutout tests a fragment against.
Run A run’s total of loop iterations, shared by every thread that runs its elements. Elements hand in full blocks of entelechy_ir::WORK_BLOCK iterations as they go, so a run past the Host’s bound stops early; remainders are summed per thread and handed in at the end. The run fails when the exact total passes the bound, whatever the schedule.
Held The Host words a run holds beyond its Fields (a scatter’s pairs while applied, a reduction’s or a prefix’s values), against the room the Host had when the run began (entelechy_abi::Scope::room). Shared by every thread of the run.
Sums A scatter’s sum, the rule every backend’s scatter keeps. An integer element becomes the exact total of what it held and every value scattered to it, failing only when that total overflows its scalar; the first element that overflows is the one reported, in any arrival order. A float is added in element order.
名称 简述
backend::NativeOp An operation a backend performs natively: device access, not a Kernel. The runtime publishes these under generation zero; they are fixed.
ArithmeticError Integer arithmetic without a result.
ExecutionError Why an execution failed. The Kernel version stays valid; the run produced nothing.
Extent Where a module’s outputs take their domain from.
名称 简述
backend::Prepared Backend-owned state built from a module at preparation time.
backend::Check A deferred verdict on a run already handed back. Waiting on it waits for the run.
backend::Downloading Words on their way from a device: the copy is queued behind the work before it, and taking them waits for that work alone.
backend::Backend An execution backend. prepare does all expensive work so that publishing is a pointer swap. A backend wrapping another writes every method, passing it through where it changes nothing: a default answers as a backend with no device would.
函数 简述
fn give(seconds: fn() -> f64) Gives the clock for a machine without one (a page’s performance.now()), in seconds. Once: a later clock is not taken.
fn now() -> Option<Moment> The moment now; None where there is no clock.
fn since(started: Option<Moment>) -> Duration How long since started; zero where there is no clock.
fn wall() -> Option<u64> Seconds since the Unix epoch; None where the machine keeps no date.
fn placement(width: u32, height: u32, target_width: u32, target_height: u32) -> Placement Fits width x height into target_width x target_height, centered.
fn vertex_schema() -> Schema The vertex layout: clip: Vec4, normal: Vec3, uv: Vec2.
fn triangle_schema() -> Schema The triangle layout: three Int indices.
fn mask_schema() -> Schema The mask layout: an Image, whose alpha a cutout tests.
fn mask_alpha(words: &[u32], width: u32, height: u32, uv: [f32; 2]) -> f32 The alpha of a mask at a position in its own texels, as at_linear reads it: the four around it, blended, clamped at the edges. Every backend samples it this way.
fn canvas_schema() -> Schema The layout of a canvas: one Long key a pixel, as the raster package’s empty canvas holds.
fn surface_schema() -> Schema The surface layout: depth: Float, normal: Vec3, uv: Vec2, id: Int.
fn check_rasterize(invocation: &Invocation, scope: &Scope<'_>) -> Result<(Handle, Handle), ExecutionError> Checks the invocation against the contract, returning the vertex and triangle handles and the output grid. Every backend applies it.
fn check_rasterize_canvas(invocation: &Invocation, scope: &Scope<'_>) -> Result<(Handle, Handle), ExecutionError> The same for the canvas form: the surface is the canvas’s extent.
fn check_cover(invocation: &Invocation, scope: &Scope<'_>) -> Result<(Handle, Handle, Handle), ExecutionError> The same for the cover: the keys are the keys grid’s extent, which is returned too.
fn check_rasterize_cutout(invocation: &Invocation, scope: &Scope<'_>) -> Result<(Handle, Handle, Handle, f32), ExecutionError> The same for the cutout form, also returning the mask and the alpha a fragment must reach.
fn rasterize(invocation: &Invocation, scope: &mut Scope<'_>) -> Result<Vec<Handle>, ExecutionError> Rasterizes on the CPU into a new surface grid owned by the scope’s Host.
fn rasterize_canvas(invocation: &Invocation, scope: &mut Scope<'_>) -> Result<Vec<Handle>, ExecutionError> Rasterizes onto a canvas: as rasterize, over the canvas’s extent.
fn cover(invocation: &Invocation, scope: &mut Scope<'_>) -> Result<Vec<Handle>, ExecutionError> Covers keys: each pixel’s least of its key and the key of the fragment rasterize would leave there, the bits of its depth above and its triangle’s row below; raster.cover@4’s keys, bit for bit, as the surface is the package’s.
fn cover_words(surface: &[u32], before: &[u32]) -> Vec<u32> The keys a surface leaves over the keys before it, two words each, low word first: where a fragment landed, the least of its key and the one before.
fn rasterize_cutout(invocation: &Invocation, scope: &mut Scope<'_>) -> Result<Vec<Handle>, ExecutionError> Rasterizes with a cutout: a fragment whose mask alpha is below the parameter is dropped.
fn rasterize_words(vertices: &[u32], triangles: &[u32], width: u32, height: u32) -> Vec<u32> The pure rasterization: the surface words for the given vertices and triangles over a width by height grid.
fn rasterize_masked(vertices: &[u32], triangles: &[u32], width: u32, height: u32, cutout: Option<Cutout<'_>>) -> Vec<u32> The same, with a cutout when one is given.
fn after_fold(count: usize) -> usize How many elements are left after folding count of them by FOLD.
fn block(count: usize) -> usize How many elements a block holds, for count of them.
fn held_values(reduction: bool, count: usize, stride: usize) -> usize The words a reduction or a prefix over count elements of stride words holds at once, every backend alike: every element’s value, and for a reduction the level above it, half as many, for a prefix the output it then fills, as many.
fn check_scan(invocation: &Invocation, scope: &Scope<'_>) -> Result<Domain, ExecutionError> Checks a scan’s invocation: its domain is its first input’s rows.
fn check_scatter(invocation: &Invocation, scope: &Scope<'_>, base: usize) -> Result<Domain, ExecutionError> Checks a scatter’s invocation: its body runs once per domain element (the first input’s extent by default). Returns the extent of the input it scatters into, which it writes.
fn extent(mode: Mode) -> Extent Where a module’s outputs take their domain from, by mode: a map’s and a scan’s the invocation’s, a reduction’s one row, a prefix’s its first input’s extent, a scatter’s its target’s. The invocation’s domain is the elements the entry runs over; an output’s is what its readers see.
fn output_domain(mode: Mode, domain: Domain, inputs: &[Domain]) -> Domain The domain a module’s outputs have (extent). Known before the run, so its storage can be reserved.
fn cores() -> usize The threads this machine runs at once, asked of the system once.
fn workers(items: usize) -> usize How many of the processor’s threads items pieces of work are worth: every core, but no fewer than PARALLEL_THRESHOLD pieces a thread.
fn address_words(domain: Domain) -> usize Words an address into a domain takes in a scatter’s pair.
fn clamp_axis(value: f32, limit: u32) -> u32 The element one axis of a float address picks: floored, NaN as zero, and clamped into 0..limit as an integer, so no rounding of limit to a float moves it past the last element.
fn linear_axis(value: f32, limit: u32) -> (u32, u32, f32) One axis of a linear read at value: element centers sit at half-integers, so the position less a half gives the lower neighbor, the upper one, each clamped as clamp_axis clamps, and the upper one’s weight, none before the first element.
fn scatter_index(domain: Domain, address: &[u32]) -> Option<usize> The linear index a scattered address names, or None when it falls outside the target (NaN included): the write is dropped, never clamped.
fn max_f32(a: f32, b: f32) -> f32 max of two floats as every backend computes it (IEEE 754-2019 maximumNumber): a NaN gives way to the other operand, and max(-0.0, 0.0) is 0.0 in either order.
fn min_f32(a: f32, b: f32) -> f32 min of two floats: max_f32’s rule the other way, so of two equal values the one with a sign, min(-0.0, 0.0) is -0.0.
fn max_f64(a: f64, b: f64) -> f64 max_f32 for doubles.
fn min_f64(a: f64, b: f64) -> f64 min_f32 for doubles.
fn float_order_key(word: u32) -> i32 The total order min and max use over floats, as a key: negatives below positives, negative zero below positive zero, NaN beyond the infinities by its bits. Every backend compares by it.
fn combine_words(combine: Combine, scalars: &[Scalar], element: &mut [u32], value: &[u32]) -> Result<(), ArithmeticError> Combines a scattered value into the element already there, scalar by scalar.
fn double_order_key(bits: u64) -> i64 The order float_order_key is, for doubles.
fn outputs_fit_words(module: &Validated, domain: Domain, scope: &Scope<'_>) -> Result<(), ExecutionError> Asks the scope for room for what a run on the Host holds while it computes: each output’s elements in whole words, before a narrow output is packed. Asked before any words are computed.
fn check_invocation(module: &Validated, invocation: &Invocation, scope: &Scope<'_>) -> Result<(), ExecutionError> Checks that an invocation matches the manifest: input and parameter counts, each input’s shape and element layout, parameter types, and a non-empty domain. Every backend applies it, so reading an input by its port’s layout is safe for any caller.
fn check_input_types(manifest: &Manifest, inputs: &[Option<(Shape, Option<&Schema>)>]) -> Result<(), ExecutionError> What a binding’s types alone decide of its inputs: each one bound (Some) is of its port’s shape, and of its port’s element layout where that is known (Some too). A check holds a scene to it unrun, as check_invocation holds every run.
fn input_type_fault(port: &PortType, shape: Shape, schema: Option<&Schema>) -> Option<String> How a Field of shape (and of schema, where it is known) differs from a port of type port, however either is spelled; None for one it takes.
fn check_domain_shape(manifest: &Manifest, domain: Shape) -> Result<(), ExecutionError> What a run’s domain must be of its shape: a scatter’s its first input’s (the one element(), coord() and domain() read; its output has the target’s), any other its output’s. A reduction is held to its one element apart.
名称 类型 取值 简述
raster::VERTEX_WORDS usize 9 Words per vertex.
raster::TRIANGLE_WORDS usize 3 Words per triangle.
raster::SURFACE_WORDS usize 7 Words per surface element.
reduce::LEVELS_AT_ONCE u32 4 How many levels of the tree a backend may fold in one pass.
reduce::FOLD usize _ The run of elements one pass of LEVELS_AT_ONCE levels folds into one.
prefix::LEAST usize 64 The fewest elements a block holds.
名称 类型 简述
backend::Checked (Vec<Handle>, Option<Box<dyn Check>>) A run’s outputs and its deferred check, if any.

Backend, Check, ClockedFrame, Downloading, NativeOp, Prepared

crates/core/rules/src/backend.rs#L262

A frame the device has done, by its clock (Backend::clocked_frame): its number, and how long each of its runs kept the device busy, from its submission or the run before’s end, whichever is later, to its own end; the runs in the order they were given.

属性

名称 类型 说明
frame u64 The frame’s number (Backend::end_frame).
runs Vec<Duration> Each run’s busy time, in order.

方法

函数 说明
fn busy(&self) -> Duration The frame’s whole busy time.

实现的 Trait: Clone, Debug, Default, Eq, PartialEq, StructuralPartialEq


crates/core/rules/src/clock.rs#L13

A moment on the machine’s clock, from the clock’s first reading.

方法

函数 说明
fn elapsed(self) -> Duration How long since this moment.
fn since(self, earlier: Moment) -> Duration How long from earlier to this moment; zero when it is later.

实现的 Trait: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq


crates/core/rules/src/placement.rs#L6

The image’s rectangle inside the window, in window pixels.

属性

名称 类型 说明
x u32 Left edge.
y u32 Top edge.
width u32 Shown width.
height u32 Shown height.

实现的 Trait: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq


crates/core/rules/src/raster.rs#L249

What a cutout tests a fragment against.

属性

名称 类型 说明
words &'m [u32] The mask’s words, four per pixel.
width u32 Its width in pixels.
height u32 Its height in pixels.
alpha f32 The alpha a fragment must reach.

crates/core/rules/src/lib.rs#L133

A run’s total of loop iterations, shared by every thread that runs its elements. Elements hand in full blocks of entelechy_ir::WORK_BLOCK iterations as they go, so a run past the Host’s bound stops early; remainders are summed per thread and handed in at the end. The run fails when the exact total passes the bound, whatever the schedule.

方法

函数 说明
fn new(work: u64) -> Self A run that may take work iterations (entelechy_abi::Scope::work).
fn spend(&self, blocks: u32) -> bool Hands the run blocks full blocks; true once the run has passed its bound and the element should stop.
fn settle(&self, left: u64) -> bool Hands the run a thread’s summed remainders. true once the run has passed its bound.
fn outcome(&self) -> Result<(), ExecutionError> The run’s verdict once every element has handed in: the failure when the total passes the bound.
fn judge(work: u64, blocks: u64, left: u64) -> Result<(), ExecutionError> The verdict for blocks and remainder counted elsewhere (a device’s record read back).
fn work(&self) -> u64 The iterations the run may take.
fn limit(&self) -> u32 The blocks a run may take, as a device is told.
fn blocks(&self) -> &AtomicU32 The count of blocks handed, for generated code that adds to it: the run has passed once the count exceeds Run::limit.
fn overrun(&self) -> ExecutionError The failure of a run that passed its bound.

crates/core/rules/src/lib.rs#L226

The Host words a run holds beyond its Fields (a scatter’s pairs while applied, a reduction’s or a prefix’s values), against the room the Host had when the run began (entelechy_abi::Scope::room). Shared by every thread of the run.

方法

函数 说明
fn new(room: usize) -> Self Nothing held yet, against room words.
fn take(&self, words: usize) -> bool Holds words more; false, holding nothing, when that would pass the room.
fn over(&self) -> ExecutionError The failure of a run whose held words passed the room.

crates/core/rules/src/lib.rs#L584

A scatter’s sum, the rule every backend’s scatter keeps. An integer element becomes the exact total of what it held and every value scattered to it, failing only when that total overflows its scalar; the first element that overflows is the one reported, in any arrival order. A float is added in element order.

方法

函数 说明
fn held_words(scalars: &[Scalar], elements: usize) -> usize The Host words the sums of elements elements of scalars hold, four per total, to be held (Held) before they are made.
fn new(scalars: &[Scalar], words: &[u32]) -> Self The sums of a scatter into words, the target’s elements of scalars in order: its totals start at what each element holds.
fn add(&mut self, words: &mut [u32], element: usize, value: &[u32]) Adds value into element: its integers to their totals, its floats to the words in words, in the order they are added.
fn finish(self, words: &mut [u32]) -> Result<(), (usize, ArithmeticError)> Writes every total into words, or fails at the first element whose total overflows its scalar.

crates/core/rules/src/backend.rs#L16

An operation a backend performs natively: device access, not a Kernel. The runtime publishes these under generation zero; they are fixed.

变体

名称 说明
Rasterize Rasterizes vertices and triangles into a surface grid; see crate::raster for the contract.
RasterizeCutout The same, dropping each fragment whose mask alpha is below cutout.
RasterizeCanvas The same onto a canvas, whose extent the surface takes, as the raster package’s Kernels take theirs.
Cover Each pixel’s least key of keys and the triangles’ fragments: the raster package’s raster.cover@4, fast, for what needs only the nearest depth (a shadow map).

方法

函数 说明
fn id(self) -> KernelId The id a graph binds to.
fn structs(self) -> Vec<StructDef> The structs the manifest’s ports name, by index: a vertex, a triangle, a surface texel and, for the cutout, a mask pixel.
fn manifest(self) -> Manifest The manifest: ports by layout and shape, capabilities as a Kernel would declare them. Element types are anonymous structs.
fn source(self) -> &'static str The contract as text, shown where a Kernel shows its source.

实现的 Trait: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq


crates/core/rules/src/lib.rs#L22

Integer arithmetic without a result.

变体

名称 说明
DivisionByZero Integer division or remainder by zero.
Overflow Integer result does not fit in 32 bits.

实现的 Trait: Clone, Debug, Display, Eq, PartialEq, StructuralPartialEq


crates/core/rules/src/lib.rs#L41

Why an execution failed. The Kernel version stays valid; the run produced nothing.

变体

名称 说明
InputCount { expected: usize, actual: usize } The invocation supplied the wrong number of inputs.
ParamCount { expected: usize, actual: usize } The invocation supplied the wrong number of parameters.
ParamType { name: String, expected: String, actual: String } A parameter’s value is not of its type’s layout.
InputType { name: String, message: String } An input’s Field differs from its port in shape or element layout.
EmptyDomain The output domain has no elements.
DomainShape { expected: Shape, actual: Shape } The output domain’s shape is not the output port’s.
ScatterDomain { input: String, expected: Shape, actual: Shape } A scatter’s domain is not its first input’s shape, which element(), coord() and domain() read.
Abi(AbiError) A Host call was denied or rejected.
Device(String) The backend device failed; the message is backend specific.
Arithmetic { x: u32, y: u32, error: ArithmeticError } Integer arithmetic failed at the given element.
Exhausted { x: u32, y: u32, budget: u32 } The element at the given place passed the Kernel’s loop budget and stopped there.
Overrun { work: u64 } The run’s elements together passed the Host’s loop bound for a run.
OverRoom { room: usize } What a run held in Host memory beyond its Fields (a scatter’s pairs, a reduction’s partial values) passed the room the Host had when the run began.

实现的 Trait: Clone, Debug, Display, Eq, Error, From, PartialEq, StructuralPartialEq


crates/core/rules/src/lib.rs#L348

Where a module’s outputs take their domain from.

变体

名称 说明
Invocation The invocation’s domain: the elements the entry runs over.
OneRow One row.
Input(usize) The extent of the input at this index.

实现的 Trait: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq


crates/core/rules/src/backend.rs#L277

Backend-owned state built from a module at preparation time.

方法

函数 说明
fn as_any(&self) -> &dyn Any For downcasting by the backend that built it.

crates/core/rules/src/backend.rs#L284

A deferred verdict on a run already handed back. Waiting on it waits for the run.

方法

函数 说明
fn wait(self: Box<Self>) -> Result<(), ExecutionError> The run’s first failure, as the reference names it, if any.

crates/core/rules/src/backend.rs#L291

Words on their way from a device: the copy is queued behind the work before it, and taking them waits for that work alone.

方法

函数 说明
fn take(self: Box<Self>) -> Result<Vec<u32>, String> The words, once the copy has run.

crates/core/rules/src/backend.rs#L313

An execution backend. prepare does all expensive work so that publishing is a pointer swap. A backend wrapping another writes every method, passing it through where it changes nothing: a default answers as a backend with no device would.

方法

函数 说明
fn name(&self) -> &'static str Short backend name for diagnostics, e.g. cpu.
fn declines(&self, module: &Validated) -> Option<String> Why this backend leaves module to another (one it cannot run, or runs badly), or None when it takes it. A runtime with a second backend prepares the module there and reports the reason beside the node; otherwise it runs here and Backend::prepare reports what it cannot do.
fn repeats_exactly(&self) -> bool Whether a run of a module this backend prepared, given the same inputs, params, domain and context, writes the same words every time in this process. A graph that remembers a run trusts a run made again under the same key to be the run it remembered only when this holds.
fn uploaded(&self) -> u64 Bytes this backend has uploaded from Host memory to its device since it was made. Zero for a backend that computes in Host memory.
fn upload(&self, handle: Handle, scope: &mut Scope<'_>) -> Result<bool, ExecutionError> Gives a Field a copy on this backend’s device ahead of the runs that read it, as the first of them would, so the Host’s copy can be let go before they run. Answers whether the Field is on the device; a backend that computes in Host memory has nowhere to put it.
fn join(&self, parts: &[(Handle, Range<usize>)], schema: &Schema, domain: Domain, scope: &mut Scope<'_>) -> Result<Option<Handle>, ExecutionError> A new Field on this backend’s device holding the elements of parts, each a Field’s range of elements kept as schema keeps them (whole words an element), one part’s after another’s, over domain; each Field is put on the device first where it is not, and no Host copy is made. None for a backend that computes in Host memory, which has nowhere to join them.
fn prepare(&self, module: &Validated) -> Result<Box<dyn Prepared>, String> Builds backend state for a validated module.
fn finish(&self, prepared: &dyn Prepared) Finishes what Backend::prepare left for a run to do (a device’s pipelines, built when first needed), so the first run does not wait for it. The default has nothing left.
fn finished(&self, prepared: &dyn Prepared) -> bool Whether what Backend::prepare left is done, so a run would wait for nothing; asked without waiting. The default left nothing.
fn execute(&self, prepared: &dyn Prepared, module: &Validated, invocation: &Invocation, scope: &mut Scope<'_>) -> Result<Vec<Handle>, ExecutionError> Executes a prepared module over the invocation’s domain, returning one image handle per manifest output, owned by the scope’s Host. Outputs may be left resident on the backend’s device.
fn execute_checked(&self, prepared: &dyn Prepared, module: &Validated, invocation: &Invocation, scope: &mut Scope<'_>) -> Result<Checked, ExecutionError> Executes as Backend::execute does, adding the check for a failure the backend learns of later (a device). A caller that waits for the check before committing matches the reference’s failures exactly. The default has no check.
fn execute_native(&self, op: NativeOp, invocation: &Invocation, scope: &mut Scope<'_>) -> Result<Vec<Handle>, ExecutionError> Executes a native operation. The default fails.
fn last_device_time(&self) -> Option<Duration> The last execution’s time by the device’s own clock, when the backend measures it.
fn measurement_floor(&self) -> Duration The overhead a measured run adds to every node (submission and wait). Zero for a backend whose work is done when execute returns.
fn set_measured(&self, on: bool) Makes every execution wait for the device before it returns, so a profile measures the work. It stalls per node; it is for measuring.
fn measures_the_device(&self) -> bool Whether a measured run’s times come from the device’s own clock.
fn set_clocked(&self, on: bool) Whether frames are clocked on the device as they run: each run the device is given, work or copy, timed by when the device tells it done, nothing waited for; see Backend::clocked_frame.
fn clock_mark(&self) -> usize How many runs the clocked frame open now has been given: a caller marks what it runs between two marks as its own.
fn end_frame(&self) -> Option<u64> Ends a clocked frame, the runs since the last end its runs: its number, counted from the first frame clocked; None unclocked.
fn clocked_frame(&self) -> Option<ClockedFrame> The latest clocked frame the device has done: its number and each of its runs’ busy time, in the order they were given; None before one is done, or where the device keeps no clock. Asking waits for nothing.
fn evaluation_begun(&self) An evaluation begins: a backend that keeps memory between runs may let go what the evaluations before went without. Nothing by default.
fn memory(&self) -> Vec<(&'static str, u64)> What the backend holds of its own between runs, apart from the Fields it keeps resident: each part by name, in bytes, for a map of where memory is. None by default.
fn execute_repeated(&self, prepared: &dyn Prepared, module: &Validated, invocation: &Invocation, scope: &mut Scope<'_>, repeat: u32, chain: (usize, usize)) -> Option<Result<Vec<Handle>, ExecutionError>> Runs a map repeat times, feeding input chain.0 from output chain.1 each time, and answers with the last outputs. None (the default) leaves the caller to run the times one by one.
fn settle_device(&self) Waits for everything this backend has submitted to finish.
fn submitted(&self) -> Option<Box<dyn Check>> A mark of every run submitted so far: waiting on it waits until they have finished on the device, not for what is submitted after, and fails nothing. None where a run is done when it returns.
fn has_device(&self) -> bool Whether a device of its own finishes this backend’s work, so Backend::settle_device is what waits for it.
fn download(&self, device: &dyn Any + Send + Sync, byte_len: usize) -> Result<Vec<u32>, String> Downloads the words in the first byte_len bytes of a resource this backend left resident.
fn download_later(&self, device: &dyn Any + Send + Sync, byte_len: usize) -> Result<Box<dyn Downloading>, String> Queues a download of byte_len bytes of a resource this backend left resident behind the work submitted so far, taken later without waiting for what is submitted since. The default downloads now.
fn same_resident(&self, a: &dyn Any + Send + Sync, b: &dyn Any + Send + Sync, byte_len: usize) -> Result<bool, String> Whether two resources this backend left resident hold the same first byte_len bytes. The default downloads both.
fn waited(&self) -> Duration How long callers of this backend have been blocked waiting for its device’s work, in all, since it was made: every wait for a run, a download, a comparison or a mark counts where it happens. Zero where no device keeps work after a call returns.