Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
尚未收集儲存庫資訊。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
Gridwise: WebGPU Compute Primitives in JavaScript
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗High-performance WebGPU parallel compute primitives in JavaScript.
Gridwise provides high-throughput GPU compute primitives — scan (prefix sum), reduce, and radix sort — built on WebGPU. It runs directly in modern browsers and in Node.js (via webgpu / Dawn) with zero native build dependencies.
u32, i32, and f32 data types with configurable binary operators (BinOpAdd, BinOpMin, BinOpMax, BinOpMultiply).index.d.ts).npm install gridwise
DLDFScan)import { DLDFScan, BinOpAdd } from "gridwise";
// 1. Initialize WebGPU
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice({
requiredFeatures: adapter.features.has("subgroups") ? ["subgroups"] : [],
requiredLimits: { maxComputeWorkgroupStorageSize: 32768 }, // needed by sort only
});
// 2. Create input and output GPU buffers
const count = 1000000;
const inputData = new Uint32Array(count).fill(1);
const inputBuffer = device.createBuffer({
size: inputData.byteLength,
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
mappedAtCreation: true,
});
new Uint32Array(inputBuffer.getMappedRange()).set(inputData);
inputBuffer.unmap();
const outputBuffer = device.createBuffer({
size: inputData.byteLength,
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC,
});
// 3. Instantiate and run DLDFScan
const scan = new DLDFScan({
device,
type: "exclusive",
datatype: "u32",
binop: new BinOpAdd({ datatype: "u32" }),
});
scan.registerBuffer({ label: "inputBuffer", buffer: inputBuffer });
scan.registerBuffer({ label: "outputBuffer", buffer: outputBuffer });
// The input length comes from the registered input buffer.
await scan.execute();
OneSweepSort)import { OneSweepSort } from "gridwise";
const sort = new OneSweepSort({
device,
type: "keysonly",
datatype: "u32",
direction: "ascending",
});
// keysBuffer holds the keys (STORAGE usage); keysTempBuffer is the same size.
sort.registerBuffer({ label: "keysInOut", buffer: keysBuffer });
sort.registerBuffer({ label: "keysTemp", buffer: keysTempBuffer });
await sort.execute();
// Radix sort ping-pongs between the two buffers, so both may be overwritten,
// and the sorted keys are in whichever the last pass wrote. The sort reports
// which (also as sort.outputKeysBufferName, "keysInOut" or "keysTemp").
// Or construct it with copyOutputToTemp: true to always find them in keysTemp.
const sortedBuffer = sort.outputIsInTemp ? keysTempBuffer : keysBuffer;
Licensed under the Apache License, Version 2.0.