Skip to main content

prime

Function prime 

Source
pub fn prime<R: Runtime>(
    client: &ComputeClient<R>,
    handle: &Handle,
    pool_lines: usize,
    config: LaunchConfig,
    dtype: ElemType,
)
Expand description

Writes every line of handle, once, before it is handed to a probe that only reads it.

A fresh allocation is backed by the same physical zero page until its first write, so every unwritten line a read-only probe visits is served from that one cached page rather than from DRAM, inflating its reported bandwidth well past the device’s real ceiling. Writing real data in first gives each line its own page, the way a buffer a real kernel reads already got one from whoever produced it.