}
});
}
- static reset(loss) {
- if (loss) console.dir(loss);
+ static reset() {
console.warn(`GPU device lost. Reinitializing...`);
_NanoPowGpu.#cpuBuffer?.destroy();
_NanoPowGpu.#gpuBuffer?.destroy();
this.#cpuBuffer.unmap();
} catch (err) {
console.warn(`Error getting data from GPU. ${err}`);
- this.reset();
return this.search(hash2, threshold);
}
if (data == null) throw new Error(`Failed to get data from buffer.`);