-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move KomaCore to use KernelAbstractions.jl (to support CUDA, AMD, Metal, etc) #179
Conversation
…AMD, Metal, etc) At the same time, I started changing how the GPU drivers are loaded using Package extensions.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #179 +/- ##
==========================================
- Coverage 92.45% 91.66% -0.80%
==========================================
Files 39 40 +1
Lines 2135 2160 +25
==========================================
+ Hits 1974 1980 +6
- Misses 161 180 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I think the way that We could take this refactoring as an opportunity to remove the difference between RFs and GRs. This implies various things:
Maybe it would be better to do: perform_step!(p::Phantom{T}, seq::DiscreteSequence{T}, sig::AbstractArray{Complex{T}}, M::Mag{T}, sim_method::Bloch) where {T<:Real}
#Motion
xt = p.x .+ p.ux(p.x, p.y, p.z, s.t)
yt = p.y .+ p.uy(p.x, p.y, p.z, s.t)
zt = p.z .+ p.uz(p.x, p.y, p.z, s.t)
#Effective field
Bxy = s.B1 # <---- TODO: $B{xy} = (B_{xy}(t_i) + B_{xy}(t_{i+1}) )/2$
ΔBz = p.Δw ./ T(2π * γ) .- s.Δf ./ T(γ) # Off-resonance ΔB_0 = (B_0 - ω_rf/γ)
Bz = (s.Gx .* xt .+ s.Gy .* yt .+ s.Gz .* zt) .+ ΔBz # <---- TODO: $B{z} = (B_{z}(t_i) + B_{z}(t_{i+1}) )/2$
#Spinor Rotation
B = sqrt.(abs.(Bxy) .^ 2 .+ abs.(Bz) .^ 2)
φ = T(-2π * γ) * (B .* s.Δt)
mul!( Q(φ, s.B1 ./ B, Bz ./ B), M )
#Relaxation
M.xy .= M.xy .* exp.(-s.Δt ./ p.T2)
M.z .= M.z .* exp.(-s.Δt ./ p.T1) .+ p.ρ .* (1 .- exp.(-s.Δt ./ p.T1))
#Saving results
if s.ADC || sim_method.save_everystep
signal .= sum(M.xy)
end
return nothing
end |
This was done in #351. |
I started doing the first changes to support KernelAbstractions.jl.
At the same time, I also changed how the GPU drivers are loaded using Package extensions, to increase the loading speed.
These changes need CUDA 4.4. I included it in the compat, but while testing I saw that KomaMRI loads CUDA 3.0 sometimes. Maybe KomaMRI also needs an extension for the compat.