wgblas 1.2.0 → 2.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.
Files changed (70) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -54
  3. package/dist/wgblas.browser.js +779 -34
  4. package/index.d.mts +13 -0
  5. package/index.mjs +8 -0
  6. package/package.json +56 -3
  7. package/src/dasum/dasum.d.mts +2 -2
  8. package/src/dasum/dasum.mjs +6 -4
  9. package/src/idamax/idamax.d.mts +51 -0
  10. package/src/idamax/idamax.mjs +128 -0
  11. package/src/init.mjs +9 -1
  12. package/src/isamax/isamax.d.mts +1 -1
  13. package/src/sasum/sasum.d.mts +1 -1
  14. package/src/saxpy/saxpy.d.mts +1 -1
  15. package/src/scopy/scopy.d.mts +1 -1
  16. package/src/sdot/sdot.d.mts +1 -1
  17. package/src/sgemm/sgemm.d.mts +102 -0
  18. package/src/sgemm/sgemm.mjs +195 -0
  19. package/src/sgemmtr/sgemmtr.d.mts +104 -0
  20. package/src/sgemmtr/sgemmtr.mjs +203 -0
  21. package/src/sgemv/sgemv.d.mts +1 -38
  22. package/src/sgemv/sgemv.mjs +4 -0
  23. package/src/sger/sger.d.mts +1 -34
  24. package/src/sger/sger.mjs +2 -0
  25. package/src/shaders/block_transfer.wgsl +42 -0
  26. package/src/shaders/browser-shaders.mjs +26 -0
  27. package/src/shaders/dasum.wgsl +3 -2
  28. package/src/shaders/f64/dekker.wgsl +4 -85
  29. package/src/shaders/f64/utils/abs.wgsl +10 -0
  30. package/src/shaders/f64/utils/add.wgsl +77 -0
  31. package/src/shaders/f64/utils/equal.wgsl +7 -0
  32. package/src/shaders/f64/utils/greater.wgsl +12 -0
  33. package/src/shaders/f64/utils/multiply.wgsl +81 -0
  34. package/src/shaders/idamax.wgsl +96 -0
  35. package/src/shaders/reduction/argmaxF64.wgsl +50 -0
  36. package/src/shaders/reduction/sumF64.wgsl +2 -2
  37. package/src/shaders/sgemm_large.wgsl +117 -0
  38. package/src/shaders/sgemm_small.wgsl +112 -0
  39. package/src/shaders/sgemmtr_large.wgsl +117 -0
  40. package/src/shaders/sgemmtr_small.wgsl +110 -0
  41. package/src/shaders/symmetrize.wgsl +31 -0
  42. package/src/shaders/triangularize.wgsl +44 -0
  43. package/src/snrm2/snrm2.d.mts +1 -1
  44. package/src/srot/srot.d.mts +1 -1
  45. package/src/srotm/srotm.d.mts +1 -1
  46. package/src/sscal/sscal.d.mts +1 -1
  47. package/src/sswap/sswap.d.mts +1 -1
  48. package/src/ssymm/ssymm.d.mts +103 -0
  49. package/src/ssymm/ssymm.mjs +209 -0
  50. package/src/ssymv/ssymv.d.mts +1 -36
  51. package/src/ssymv/ssymv.mjs +2 -0
  52. package/src/ssyr/ssyr.d.mts +1 -30
  53. package/src/ssyr/ssyr.mjs +2 -0
  54. package/src/ssyr2/ssyr2.d.mts +1 -34
  55. package/src/ssyr2/ssyr2.mjs +2 -0
  56. package/src/ssyr2k/ssyr2k.d.mts +100 -0
  57. package/src/ssyr2k/ssyr2k.mjs +201 -0
  58. package/src/ssyrk/ssyrk.d.mts +90 -0
  59. package/src/ssyrk/ssyrk.mjs +176 -0
  60. package/src/strmm/strmm.d.mts +100 -0
  61. package/src/strmm/strmm.mjs +211 -0
  62. package/src/strmv/strmv.d.mts +1 -36
  63. package/src/strmv/strmv.mjs +2 -0
  64. package/src/strsm/strsm.d.mts +99 -0
  65. package/src/strsm/strsm.mjs +342 -0
  66. package/src/strsv/strsv.d.mts +1 -32
  67. package/src/strsv/strsv.mjs +2 -0
  68. package/src/util/buffer.mjs +4 -2
  69. package/src/util/compute.mjs +6 -3
  70. package/src/util/f64.mjs +3 -3
package/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [2026] [manit2004]
189
+ Copyright [2026] [Manit Roy]
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,60 +1,8 @@
1
1
  # wgblas
2
2
 
3
- `wgblas` is an initiative to implement all the standard level 1, 2, 3 BLAS functions on the top of webgpu.
4
-
5
- ## Available Functions
6
-
7
- - [sscal](https://manit2004.github.io/wgblas/functions/docs.sscal.html)
8
- - [sswap](https://manit2004.github.io/wgblas/functions/docs.sswap.html)
9
- - [saxpy](https://manit2004.github.io/wgblas/functions/docs.saxpy.html)
10
- - [scopy](https://manit2004.github.io/wgblas/functions/docs.scopy.html)
11
- - [sdot](https://manit2004.github.io/wgblas/functions/docs.sdot.html)
12
- - [sasum](https://manit2004.github.io/wgblas/functions/docs.sasum.html)
13
- - [snrm2](https://manit2004.github.io/wgblas/functions/docs.snrm2.html)
14
- - [isamax](https://manit2004.github.io/wgblas/functions/docs.isamax.html)
15
- - [srot](https://manit2004.github.io/wgblas/functions/docs.srot.html)
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)
20
- - [strsv](https://manit2004.github.io/wgblas/functions/docs.strsv.html)
21
- - [sger](https://manit2004.github.io/wgblas/functions/docs.sger.html)
22
- - [ssyr](https://manit2004.github.io/wgblas/functions/docs.ssyr.html)
23
- - [ssyr2](https://manit2004.github.io/wgblas/functions/docs.ssyr2.html)
24
-
25
- ## Browser Support
3
+ [![Tests](https://github.com/manit2004/wgblas/actions/workflows/test-gpu.yml/badge.svg)](https://github.com/manit2004/wgblas/actions/workflows/test-gpu.yml)
26
4
 
27
- wgblas runs in any browser with WebGPU enabled. Check if it's working in your browser at [webgpureport.org](https://webgpureport.org).
28
-
29
- ### Chrome (recommended)
30
-
31
- For full WebGPU control, enable all three flags at `chrome://flags` and relaunch:
32
-
33
- | Flag | What it does |
34
- |------|--------------|
35
- | `#enable-unsafe-webgpu` | Enables WebGPU |
36
- | `#force-enable-webgpu-interop` | Uses the real GPU via Vulkan (Linux) — without this Chrome may fall back to SwiftShader, a CPU-based software renderer |
37
- | `#enable-webgpu-developer-features` | Unlocks additional GPU features |
38
-
39
- You can verify which GPU is being used at [webgpureport.org](https://webgpureport.org) — if the adapter name shows **SwiftShader**, the real GPU is not being used.
40
-
41
- ### Firefox
42
-
43
- WebGPU must be enabled manually via `about:config`. Search for each preference and set it:
44
-
45
- | Preference | Value | What it does |
46
- |------------|-------|--------------|
47
- | `dom.webgpu.enabled` | `true` | Enables WebGPU |
48
- | `dom.webgpu.wgpu-backend` | `vulkan` | Forces the real GPU via Vulkan — without this Firefox may use a software renderer |
49
- | `gfx.webgpu.ignore-blocklist` | `true` | Bypasses the GPU blocklist |
50
-
51
- Note: `dom.webgpu.wgpu-backend` is a **string** preference — click the pencil icon to edit it and type `vulkan`.
52
-
53
- Restart Firefox after making changes.
54
-
55
- > **Note:** Firefox's WebGPU implementation is incomplete and some routines may not work correctly. Chrome is recommended.
56
- >
57
- > **Multi-GPU:** Firefox only exposes one WebGPU adapter (the display GPU, typically integrated) even on dual-GPU systems — verified via `about:support` → Graphics → WebGPU Default Adapter. Chrome picks the discrete GPU via `powerPreference: "high-performance"`; Firefox does not.
5
+ `wgblas` implements all the standard single-precision level 1, 2, and 3 BLAS routines on top of WebGPU. Next up: double-precision routines, and single- and double-precision complex routines.
58
6
 
59
7
  ## Requirements
60
8
 
@@ -162,3 +110,37 @@ yGpu.destroy();
162
110
 
163
111
  cleanup();
164
112
  ```
113
+
114
+ ## Browser Support
115
+
116
+ wgblas runs in any browser with WebGPU enabled. Check if it's working in your browser at [webgpureport.org](https://webgpureport.org).
117
+
118
+ ### Chrome (recommended)
119
+
120
+ For full WebGPU control, enable all three flags at `chrome://flags` and relaunch:
121
+
122
+ | Flag | What it does |
123
+ |------|--------------|
124
+ | `#enable-unsafe-webgpu` | Enables WebGPU |
125
+ | `#force-enable-webgpu-interop` | Uses the real GPU via Vulkan (Linux) — without this Chrome may fall back to SwiftShader, a CPU-based software renderer |
126
+ | `#enable-webgpu-developer-features` | Unlocks additional GPU features |
127
+
128
+ You can verify which GPU is being used at [webgpureport.org](https://webgpureport.org) — if the adapter name shows **SwiftShader**, the real GPU is not being used.
129
+
130
+ ### Firefox
131
+
132
+ WebGPU must be enabled manually via `about:config`. Search for each preference and set it:
133
+
134
+ | Preference | Value | What it does |
135
+ |------------|-------|--------------|
136
+ | `dom.webgpu.enabled` | `true` | Enables WebGPU |
137
+ | `dom.webgpu.wgpu-backend` | `vulkan` | Forces the real GPU via Vulkan — without this Firefox may use a software renderer |
138
+ | `gfx.webgpu.ignore-blocklist` | `true` | Bypasses the GPU blocklist |
139
+
140
+ Note: `dom.webgpu.wgpu-backend` is a **string** preference — click the pencil icon to edit it and type `vulkan`.
141
+
142
+ Restart Firefox after making changes.
143
+
144
+ > **Note:** Firefox's WebGPU implementation is incomplete and some routines may not work correctly. Chrome is recommended.
145
+ >
146
+ > **Multi-GPU:** Firefox only exposes one WebGPU adapter (the display GPU, typically integrated) even on dual-GPU systems — verified via `about:support` → Graphics → WebGPU Default Adapter. Chrome picks the discrete GPU via `powerPreference: "high-performance"`; Firefox does not.