Skip to content

Commit 5888c19

Browse files
committed
docs(tools): clarify generate_precooked_rng vs QCurandStateMonolithicTest
Expand the file's leading docblock to make the distinction explicit: QCurandStateMonolithicTest produces curand internal STATE structs used to initialise the GPU kernel; generate_precooked_rng produces pre- evaluated random SAMPLES that U4Random reads in --aligned mode so each G4 draw matches the corresponding GPU draw byte-for-byte. Different artifacts, different consumers; both needed for the validation workflow.
1 parent b9cf990 commit 5888c19

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

tools/generate_precooked_rng.cu

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,34 @@
22
generate_precooked_rng.cu
33
==========================
44
5-
Generates precooked curand Philox sequences for U4Random aligned mode.
6-
Each photon gets its own random stream matching the GPU simulation.
5+
Generates precooked curand Philox sample arrays for U4Random aligned mode.
6+
Each photon gets its own pre-evaluated random-number stream matching what
7+
the GPU simulation would draw at the same step.
8+
9+
Relation to QCurandStateMonolithicTest
10+
---------------------------------------
11+
This tool is NOT a replacement for QCurandStateMonolithicTest — they
12+
produce different artifacts for different consumers:
13+
14+
QCurandStateMonolithicTest (qudarap/tests/)
15+
- Output: curand internal STATE structs (Philox4_32_10_t)
16+
~/.opticks/rngcache/RNG/QCurandState_<N>_0_0.bin
17+
- Consumer: GPU simulation initialisation. The kernel picks up a
18+
state and starts drawing from it.
19+
- Purpose: pre-seeded RNG state for reproducible GPU runs.
20+
21+
generate_precooked_rng (this tool)
22+
- Output: pre-evaluated random SAMPLES (float32 NumPy array)
23+
~/.opticks/precooked/QSimTest/rng_sequence/.../
24+
rng_sequence_f_ni<NI>_nj<NJ>_nk<NK>_ioffset000000.npy
25+
- Consumer: U4Random in --aligned mode (CPU-side G4). G4 reads
26+
sample i from the array on its i-th draw, byte-for-byte
27+
matching whatever the GPU kernel would have drawn at
28+
that step.
29+
- Purpose: photon-by-photon GPU<->G4 alignment.
30+
31+
States vs samples; GPU init vs G4 alignment. Both are needed for the
32+
full validation workflow.
733
834
Build:
935
nvcc -o generate_precooked_rng tools/generate_precooked_rng.cu \

0 commit comments

Comments
 (0)