Skip to content

Commit

Permalink
Try again to test cpu multi-thread error
Browse files Browse the repository at this point in the history
  • Loading branch information
pvillacorta committed Aug 24, 2024
1 parent ee24363 commit 725e68a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions KomaMRIBase/src/motion/motionlist/MotionList.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ function get_spin_coords(
# Buffers for positions:
xt, yt, zt = x .+ 0*t, y .+ 0*t, z .+ 0*t
# Buffers for displacements:
ux, uy, uz = xt .* 0, yt .* 0, zt .* 0
# Composable motions: they need to be run sequentially. Note that they depend on xt, yt , and zt
ux, uy, uz = xt .* zero(T), yt .* zero(T), zt .* zero(T)
# Composable motions: they need to be run sequentially. Note that they depend on xt, yt, and zt
for m in Iterators.filter(is_composable, ml.motions)
t_unit = unit_time(t, m.time)
idx = get_idx(m.spins)
displacement_x!(@view(ux[idx, :]), m.action, @view(xt[idx, :]), @view(yt[idx, :]), @view(zt[idx, :]), t_unit)
displacement_y!(@view(uy[idx, :]), m.action, @view(xt[idx, :]), @view(yt[idx, :]), @view(zt[idx, :]), t_unit)
displacement_z!(@view(uz[idx, :]), m.action, @view(xt[idx, :]), @view(yt[idx, :]), @view(zt[idx, :]), t_unit)
xt .+= ux; yt .+= uy; zt .+= uz
ux .*= 0; uy .*= 0; uz .*= 0
ux .*= zero(T); uy .*= zero(T); uz .*= zero(T)
end
# Additive motions: these motions can be run in parallel
for m in Iterators.filter(!is_composable, ml.motions)
Expand All @@ -95,7 +95,7 @@ function get_spin_coords(
displacement_y!(@view(uy[idx, :]), m.action, @view(x[idx]), @view(y[idx]), @view(z[idx]), t_unit)
displacement_z!(@view(uz[idx, :]), m.action, @view(x[idx]), @view(y[idx]), @view(z[idx]), t_unit)
xt .+= ux; yt .+= uy; zt .+= uz
ux .*= 0; uy .*= 0; uz .*= 0
ux .*= zero(T); uy .*= zero(T); uz .*= zero(T)
end
return xt, yt, zt
end
Expand Down

0 comments on commit 725e68a

Please sign in to comment.