@@ -194,7 +194,15 @@ function simulate(obj::Phantom, seq::Sequence, sys::Scanner; simParams=Dict{Stri
194
194
Nadc = sum (seq. ADC. N)
195
195
Ncoils = 1 # This should consider the input Scanner type
196
196
sig = zeros (ComplexF64, Nadc, Ncoils, Nthreads)
197
- # Change precision: Only for CPU simulations
197
+ # Objects to GPU
198
+ if enable_gpu # Default
199
+ device! (gpu_device)
200
+ gpu_name = name .(devices ())[gpu_device+ 1 ]
201
+ obj = obj |> gpu # Phantom
202
+ seqd = seqd |> gpu # DiscreteSequence
203
+ Xt = Xt |> gpu # SpinStateRepresentation
204
+ sig = sig |> gpu # Signal
205
+ end
198
206
if precision == " f32" # Default
199
207
obj = obj |> f32 # Phantom
200
208
seqd = seqd |> f32 # DiscreteSequence
@@ -206,15 +214,6 @@ function simulate(obj::Phantom, seq::Sequence, sys::Scanner; simParams=Dict{Stri
206
214
Xt = Xt |> f64 # SpinStateRepresentation
207
215
sig = sig |> f64 # Signal
208
216
end
209
- # Objects to GPU
210
- if enable_gpu # Default
211
- device! (gpu_device)
212
- gpu_name = name .(devices ())[gpu_device+ 1 ]
213
- obj = obj |> gpu # Phantom
214
- seqd = seqd |> gpu # DiscreteSequence
215
- Xt = Xt |> gpu # SpinStateRepresentation
216
- sig = sig |> gpu # Signal
217
- end
218
217
# Simulation
219
218
koma_version = VersionNumber (Pkg. TOML. parsefile (joinpath (@__DIR__ , " .." , " .." , " Project.toml" ))[" version" ])
220
219
@info " Running simulation in the $(enable_gpu ? " GPU ($gpu_name )" : " CPU with $Nthreads thread(s)" ) " koma_version= koma_version sim_method = sim_method spins = length (obj) time_points = length (t) adc_points= Nadc
0 commit comments