Skip to content

Commit

Permalink
Codecov hack for @threads
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffFessler committed Jan 7, 2025
1 parent b14c280 commit 70f4973
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/backproject.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function backproject!(
plan.planrot[thid],
)

end
end # COV_EXCL_LINE

# adjoint of convolving img with psf and applying attenuation map
Threads.@threads for y in 1:plan.imgsize[2] # 1:ny
Expand All @@ -45,7 +45,7 @@ function backproject!(
)

mul3dj!(plan.imgr, plan.exp_mumapr[thid], y)
end
end # COV_EXCL_LINE

# adjoint of rotating image
Threads.@threads for z in 1:plan.imgsize[3] # 1:nz
Expand All @@ -56,7 +56,7 @@ function backproject!(
plan.viewangle[viewidx],
plan.planrot[thid],
)
end
end # COV_EXCL_LINE

return image
end
Expand Down Expand Up @@ -142,7 +142,7 @@ function backproject!(
Threads.@threads for (i, viewidx) in collect(enumerate(index))
thid = Threads.threadid()
backproject!(plan.add_img[thid], (@view views[:, :, i]), plan, thid, viewidx)
end
end # COV_EXCL_LINE

for i in 1:plan.nthread
broadcast!(+, image, image, plan.add_img[i])
Expand Down
6 changes: 3 additions & 3 deletions src/project.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function project!(
plan.viewangle[viewidx],
plan.planrot[thid],
)
end
end # COV_EXCL_LINE

Threads.@threads for y in 1:plan.imgsize[2] # 1:ny
thid = Threads.threadid() # thread id
Expand All @@ -55,7 +55,7 @@ function project!(
(@view plan.psfs[:, :, y, viewidx]),
plan.planpsf[thid],
)
end
end # COV_EXCL_LINE

copy3dj!(view, plan.add_img, 1) # initialize accumulator
for y in 2:plan.imgsize[2] # accumulate to get total view
Expand Down Expand Up @@ -151,7 +151,7 @@ function project!(
Threads.@threads for (i, viewidx) in collect(enumerate(index))
thid = Threads.threadid()
project!((@view views[:,:,i]), image, plan, thid, viewidx)
end
end # COV_EXCL_LINE
else
for (i, viewidx) in collect(enumerate(index))
project!((@view views[:,:,i]), image, plan, viewidx)
Expand Down
2 changes: 1 addition & 1 deletion src/rotatez.jl
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ function _imrotate!(
θ,
plans[id],
)
end
end # COV_EXCL_LINE

return output
end
Expand Down

0 comments on commit 70f4973

Please sign in to comment.