wgblas
    Preparing search index...

    Function warmClocks

    • Brings the GPU to its full-performance power state before a measurement.

      The benchmarks await every call, so with short kernels the GPU idles most of the time and the driver drops to a low-power state — on a GTX 1650, P5 (memory clock 810 MHz) or P8 (405 MHz) instead of P0 (6000 MHz). Memory- bound kernels then run up to ~16× slower at whichever configurations a sweep happens to reach while downclocked (e.g. sgemv 1024×2048 transposed: 0.975 ms at P8, 0.060 ms at P0). Locking clocks fixes it but needs root.

      This runs a memory-bound burst in timed batches until a batch is within 10% of the fastest batch seen so far, twice in a row — i.e. the memory clock is back at its peak. Promotion from idle takes up to ~200 ms, and the driver demotes again within about a second of light load, so it's called right before each configuration's warmup; once the GPU is already at full clocks it returns in ~12 ms. The first call per device runs at least 300 ms to establish the full-clock reference.

      Parameters

      • device: GPUDevice

        the device the benchmark will measure on

      • Optionaloptions: { maxMs?: number } = {}

        give up after this long (default 1000 ms)

      Returns Promise<void>

      resolves once clocks are at peak, or after maxMs