File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,3 +108,26 @@ raw = Distributed.@distributed (+) for i=1:nworkers()
108108 simulate (obj[parts[i]], seq, sys)
109109end
110110```
111+
112+ ## Sequential Phantom Chunks on One GPU
113+
114+ If the phantom is too large to fit in GPU memory, it can also be split into
115+ chunks and simulated sequentially on a single device. This uses the same
116+ independent spin property as distributed simulations, but does not need extra
117+ workers.
118+
119+ ``` julia
120+ using KomaMRI
121+
122+ sys = Scanner ()
123+ seq = PulseDesigner. EPI_example ()
124+ obj = brain_phantom2D ()
125+
126+ max_spins_per_chunk = 200_000
127+ nchunks = cld (length (obj), max_spins_per_chunk)
128+ parts = kfoldperm (length (obj), nchunks)
129+
130+ raw = mapreduce (+ , parts) do part
131+ simulate (obj[part], seq, sys)
132+ end
133+ ```
You can’t perform that action at this time.
0 commit comments