Skip to content

Commit e090350

Browse files
committed
Reverted reordering of f32/f64 and gpu.
1 parent d40e589 commit e090350

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/simulation/SimulatorCore.jl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,15 @@ function simulate(obj::Phantom, seq::Sequence, sys::Scanner; simParams=Dict{Stri
194194
Nadc = sum(seq.ADC.N)
195195
Ncoils = 1 #This should consider the input Scanner type
196196
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
198206
if precision == "f32" #Default
199207
obj = obj |> f32 #Phantom
200208
seqd = seqd |> f32 #DiscreteSequence
@@ -206,15 +214,6 @@ function simulate(obj::Phantom, seq::Sequence, sys::Scanner; simParams=Dict{Stri
206214
Xt = Xt |> f64 #SpinStateRepresentation
207215
sig = sig |> f64 #Signal
208216
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
218217
# Simulation
219218
koma_version = VersionNumber(Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "..", "Project.toml"))["version"])
220219
@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

Comments
 (0)