wgblas
    Preparing search index...

    Function cleanup

    • Destroys devices created by init and releases their cached pipelines and buffers. Call when done (required in Node.js to prevent crash on exit).

      With no argument, releases every device at once. Pass a device to release just that one and leave the others usable — handy when driving several GPUs. Unknown or already-released devices are ignored, so this is safe to call more than once.

      Parameters

      • Optionaldevice: GPUDevice

        the device to release; omit to release all of them.

        import { init, cleanup, gpuName } from "wgblas";

        await init();
        console.log("GPU:", gpuName().description);
        if (typeof process !== "undefined") cleanup(); // Node.js only — browser cleanup is automatic

      Returns void