@graphty/webgpu-graph-algorithms 0.6.8 → 0.6.9
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/dist/browser.js +1 -1
- package/dist/chunks/{context-Cezi7qpi.js → context-Bi6AhScG.js} +16 -6
- package/dist/chunks/context-Bi6AhScG.js.map +1 -0
- package/dist/node.js +1 -1
- package/dist/src/kernel/kernel.d.ts +10 -1
- package/dist/src/kernel/kernel.d.ts.map +1 -1
- package/dist/src/kernel/kernel.js +16 -1
- package/dist/src/kernel/kernel.js.map +1 -1
- package/dist/webgpu-graph-algorithms.js +2 -2
- package/package.json +5 -5
- package/src/kernel/kernel.ts +31 -7
- package/dist/chunks/context-Cezi7qpi.js.map +0 -1
package/dist/browser.js
CHANGED
|
@@ -565,6 +565,7 @@ function deviceLostError(info) {
|
|
|
565
565
|
});
|
|
566
566
|
}
|
|
567
567
|
const INDIRECT_ARGS_STRIDE = 16;
|
|
568
|
+
const BIND_GROUP_CACHE_LIMIT = 32;
|
|
568
569
|
const bufferIds = /* @__PURE__ */ new WeakMap();
|
|
569
570
|
let nextBufferId = 1;
|
|
570
571
|
function bufferId(buffer) {
|
|
@@ -711,6 +712,8 @@ class Kernel {
|
|
|
711
712
|
const key = resolved.map(({ binding }) => `${bufferId(binding.buffer)}:${binding.offset}:${binding.size}`).join("|");
|
|
712
713
|
const cached = this.cache.get(key);
|
|
713
714
|
if (cached !== void 0) {
|
|
715
|
+
this.cache.delete(key);
|
|
716
|
+
this.cache.set(key, cached);
|
|
714
717
|
return cached;
|
|
715
718
|
}
|
|
716
719
|
const byName = new Map(resolved.map(({ decl, binding }) => [decl.name, binding]));
|
|
@@ -739,6 +742,9 @@ class Kernel {
|
|
|
739
742
|
dynamicGroups: Object.freeze(dynamicGroups)
|
|
740
743
|
});
|
|
741
744
|
this.cache.set(key, bound);
|
|
745
|
+
if (this.cache.size > BIND_GROUP_CACHE_LIMIT) {
|
|
746
|
+
this.cache.delete(this.cache.keys().next().value);
|
|
747
|
+
}
|
|
742
748
|
return bound;
|
|
743
749
|
}
|
|
744
750
|
/**
|
|
@@ -775,11 +781,15 @@ class Kernel {
|
|
|
775
781
|
dispatchIndirect(pass, bound, args, slot, dynamicOffsets) {
|
|
776
782
|
this.check(bound, dynamicOffsets);
|
|
777
783
|
if (!Number.isInteger(slot) || slot < 0 || (slot + 1) * INDIRECT_ARGS_STRIDE > args.size) {
|
|
778
|
-
throw new WebGpuGraphError(
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
784
|
+
throw new WebGpuGraphError(
|
|
785
|
+
"E_INVALID_ARGUMENT",
|
|
786
|
+
`${this.spec.id}: args slot ${slot} is outside the binding`,
|
|
787
|
+
{
|
|
788
|
+
argument: "slot",
|
|
789
|
+
value: slot,
|
|
790
|
+
expected: `0 <= slot < ${Math.floor(args.size / INDIRECT_ARGS_STRIDE)}`
|
|
791
|
+
}
|
|
792
|
+
);
|
|
783
793
|
}
|
|
784
794
|
this.setUp(pass, bound, dynamicOffsets);
|
|
785
795
|
pass.dispatchWorkgroupsIndirect(args.buffer, args.offset + INDIRECT_ARGS_STRIDE * slot);
|
|
@@ -3552,4 +3562,4 @@ export {
|
|
|
3552
3562
|
SETTLE_FLOOR_FRACTION as y,
|
|
3553
3563
|
FR_REHEAT_FRACTION as z
|
|
3554
3564
|
};
|
|
3555
|
-
//# sourceMappingURL=context-
|
|
3565
|
+
//# sourceMappingURL=context-Bi6AhScG.js.map
|