Get started with gpu.js CDN

MIT licensed

GPU.js: Lightweight library for WebGL computing, bypassing browsers GPUs.

Tags:
  • gpgpu
  • GPU
  • webgl
  • accelerate

Stable version

Copied!

How to start using gpu.js CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with gpu.js CDN - cdnhub.io</title>
    <script src="https://cdn.cdnhub.io/gpu.js/2.16.0/gpu.min.js"></script>
</head>
<body>
    <script>
        async function main() {
            const gpu = new GPU();
            const mat1 = gpu.createMatrix(16, 16, () => Math.random());
            const mat2 = gpu.createMatrix(16, 16, () => Math.random());

            const result = gpu.createMatrix(16, 16, () => new Float32Array(16 * 16));

            gpu.gemmNchw(mat1, mat2, 1, 1, 1, 1, result);

            console.log("GPU Multiplication Result:");
            console.log(result.toArray());

            await gpu.destroy();
        }

        main();
    </script>
</body>
</html>

All versions