MCPcopy Create free account
hub / github.com/0hq/WebGPT / bufferSize

Method bufferSize

instructions.js:77–81  ·  view source on GitHub ↗
(dimA, dimB = 1)

Source from the content-addressed store, hash-verified

75 }
76
77 bufferSize(dimA, dimB = 1) {
78 const size = Math.ceil((dimA * dimB * Float32Array.BYTES_PER_ELEMENT) / 1) * 1;
79 if (size > this.device.limits.maxStorageBufferBindingSize) throw new Error("Buffer size exceeds GPU limit.");
80 return size;
81 }
82
83 // Could be removed with auto bind groups, currently initializing everytime so probably slowing things down.
84 initBindGroups() {

Callers 4

initBufferMethod · 0.95
staticLoadMethod · 0.45
newInstanceMethod · 0.45
newInstanceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected