wgblas 0.1.1 → 1.0.0
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 +11 -12
- package/dist/wgblas.browser.js +1078 -37
- package/index.d.mts +6 -0
- package/index.mjs +6 -0
- package/package.json +32 -1
- package/src/classes/GpuMatrix.d.mts +85 -0
- package/src/classes/GpuMatrix.mjs +91 -0
- package/src/classes/GpuVector.d.mts +11 -7
- package/src/classes/GpuVector.mjs +31 -5
- package/src/dasum/dasum.d.mts +48 -0
- package/src/dasum/dasum.mjs +121 -0
- package/src/init.mjs +3 -1
- package/src/isamax/isamax.mjs +66 -67
- package/src/random/random.d.mts +37 -0
- package/src/random/random.mjs +17 -0
- package/src/sasum/sasum.mjs +55 -51
- package/src/saxpy/saxpy.mjs +48 -35
- package/src/scopy/scopy.mjs +43 -32
- package/src/sdot/sdot.mjs +60 -55
- package/src/sgemv/sgemv.d.mts +118 -0
- package/src/sgemv/sgemv.mjs +141 -0
- package/src/shaders/browser-shaders.mjs +20 -0
- package/src/shaders/dasum.wgsl +98 -0
- package/src/shaders/f64add.wgsl +281 -0
- package/src/shaders/isamax.wgsl +32 -9
- package/src/shaders/reduction/sumF64.wgsl +49 -0
- package/src/shaders/sasum.wgsl +18 -4
- package/src/shaders/sdot.wgsl +18 -4
- package/src/shaders/sgemv_n.wgsl +75 -0
- package/src/shaders/sgemv_t.wgsl +65 -0
- package/src/shaders/snrm2.wgsl +22 -4
- package/src/shaders/ssymv.wgsl +69 -0
- package/src/shaders/strmv.wgsl +103 -0
- package/src/shaders/strsv_apply_inverse.wgsl +47 -0
- package/src/shaders/strsv_invert_block.wgsl +109 -0
- package/src/shaders/strsv_update.wgsl +75 -0
- package/src/snrm2/snrm2.mjs +56 -52
- package/src/srot/srot.mjs +57 -41
- package/src/srotm/srotm.mjs +54 -38
- package/src/sscal/sscal.mjs +43 -32
- package/src/sswap/sswap.mjs +49 -34
- package/src/ssymv/ssymv.d.mts +109 -0
- package/src/ssymv/ssymv.mjs +130 -0
- package/src/strmv/strmv.d.mts +109 -0
- package/src/strmv/strmv.mjs +132 -0
- package/src/strsv/strsv.d.mts +98 -0
- package/src/strsv/strsv.mjs +212 -0
- package/src/util/benchmark.mjs +1 -1
- package/src/util/bindgroup.mjs +14 -10
- package/src/util/buffer.mjs +7 -2
- package/src/util/compute.mjs +41 -15
- package/src/util/f64pack.mjs +152 -0
- package/src/util/pipeline.mjs +32 -17
- package/src/util/result.mjs +8 -4
- package/src/util/workgroup.mjs +10 -10
package/README.md
CHANGED
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
- [isamax](https://manit2004.github.io/wgblas/functions/docs.isamax.html)
|
|
15
15
|
- [srot](https://manit2004.github.io/wgblas/functions/docs.srot.html)
|
|
16
16
|
- [srotm](https://manit2004.github.io/wgblas/functions/docs.srotm.html)
|
|
17
|
+
- [sgemv](https://manit2004.github.io/wgblas/functions/docs.sgemv.html)
|
|
18
|
+
- [ssymv](https://manit2004.github.io/wgblas/functions/docs.ssymv.html)
|
|
19
|
+
- [strmv](https://manit2004.github.io/wgblas/functions/docs.strmv.html)
|
|
17
20
|
|
|
18
21
|
## Browser Support
|
|
19
22
|
|
|
@@ -51,24 +54,21 @@ Restart Firefox after making changes.
|
|
|
51
54
|
|
|
52
55
|
## Requirements
|
|
53
56
|
|
|
54
|
-
- Node.js
|
|
57
|
+
- Node.js 22+
|
|
55
58
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
This package is not yet published to npm. Clone the repo and install it locally in your project:
|
|
59
|
+
## Installation
|
|
59
60
|
|
|
60
61
|
```sh
|
|
61
|
-
|
|
62
|
-
cd your-project
|
|
63
|
-
npm install /path/to/wgblas
|
|
62
|
+
npm install wgblas
|
|
64
63
|
```
|
|
65
64
|
|
|
65
|
+
## Example usage
|
|
66
|
+
|
|
66
67
|
### Example Code Snippet
|
|
67
68
|
|
|
68
69
|
```js
|
|
69
|
-
import { init, cleanup } from "wgblas";
|
|
70
|
+
import { init, cleanup, randomFloat32Array } from "wgblas";
|
|
70
71
|
import { sscal } from "wgblas/sscal";
|
|
71
|
-
import { randomFloat32Array } from "wgblas/util/random";
|
|
72
72
|
|
|
73
73
|
const device = await init();
|
|
74
74
|
|
|
@@ -92,7 +92,7 @@ No bundler needed. Load the pre-built browser bundle from the CDN and use `windo
|
|
|
92
92
|
<head>
|
|
93
93
|
<meta charset="UTF-8" />
|
|
94
94
|
<title>sscal — wgblas browser example</title>
|
|
95
|
-
<script src="https://
|
|
95
|
+
<script src="https://unpkg.com/wgblas/dist/wgblas.browser.js"></script>
|
|
96
96
|
</head>
|
|
97
97
|
<body>
|
|
98
98
|
<pre id="out">Running…</pre>
|
|
@@ -126,11 +126,10 @@ No bundler needed. Load the pre-built browser bundle from the CDN and use `windo
|
|
|
126
126
|
`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
127
|
|
|
128
128
|
```js
|
|
129
|
-
import { init, cleanup } from "wgblas";
|
|
129
|
+
import { init, cleanup, randomFloat32Array } from "wgblas";
|
|
130
130
|
import { saxpy } from "wgblas/saxpy";
|
|
131
131
|
import { sscal } from "wgblas/sscal";
|
|
132
132
|
import { GpuVector } from "wgblas/classes/GpuVector";
|
|
133
|
-
import { randomFloat32Array } from "wgblas/util/random";
|
|
134
133
|
|
|
135
134
|
const device = await init();
|
|
136
135
|
|