wgblas 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,24 +51,21 @@ Restart Firefox after making changes.
|
|
|
51
51
|
|
|
52
52
|
## Requirements
|
|
53
53
|
|
|
54
|
-
- Node.js
|
|
54
|
+
- Node.js 22+
|
|
55
55
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
This package is not yet published to npm. Clone the repo and install it locally in your project:
|
|
56
|
+
## Installation
|
|
59
57
|
|
|
60
58
|
```sh
|
|
61
|
-
|
|
62
|
-
cd your-project
|
|
63
|
-
npm install /path/to/wgblas
|
|
59
|
+
npm install wgblas
|
|
64
60
|
```
|
|
65
61
|
|
|
62
|
+
## Example usage
|
|
63
|
+
|
|
66
64
|
### Example Code Snippet
|
|
67
65
|
|
|
68
66
|
```js
|
|
69
|
-
import { init, cleanup } from "wgblas";
|
|
67
|
+
import { init, cleanup, randomFloat32Array } from "wgblas";
|
|
70
68
|
import { sscal } from "wgblas/sscal";
|
|
71
|
-
import { randomFloat32Array } from "wgblas/util/random";
|
|
72
69
|
|
|
73
70
|
const device = await init();
|
|
74
71
|
|
|
@@ -92,7 +89,7 @@ No bundler needed. Load the pre-built browser bundle from the CDN and use `windo
|
|
|
92
89
|
<head>
|
|
93
90
|
<meta charset="UTF-8" />
|
|
94
91
|
<title>sscal — wgblas browser example</title>
|
|
95
|
-
<script src="https://
|
|
92
|
+
<script src="https://unpkg.com/wgblas/dist/wgblas.browser.js"></script>
|
|
96
93
|
</head>
|
|
97
94
|
<body>
|
|
98
95
|
<pre id="out">Running…</pre>
|
|
@@ -126,11 +123,10 @@ No bundler needed. Load the pre-built browser bundle from the CDN and use `windo
|
|
|
126
123
|
`GpuVector` keeps data resident on the GPU between operations — upload once, chain any number of operations, read back once. This eliminates the redundant uploads and readbacks between steps, which are often more expensive than the compute itself.
|
|
127
124
|
|
|
128
125
|
```js
|
|
129
|
-
import { init, cleanup } from "wgblas";
|
|
126
|
+
import { init, cleanup, randomFloat32Array } from "wgblas";
|
|
130
127
|
import { saxpy } from "wgblas/saxpy";
|
|
131
128
|
import { sscal } from "wgblas/sscal";
|
|
132
129
|
import { GpuVector } from "wgblas/classes/GpuVector";
|
|
133
|
-
import { randomFloat32Array } from "wgblas/util/random";
|
|
134
130
|
|
|
135
131
|
const device = await init();
|
|
136
132
|
|