Skip to content

Codecov hack for @threads #55

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

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -27,16 +27,34 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4

# - name: "Set up Julia"
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}

- name: Cache artifacts
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-

# - name: "Unit Test"
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest

# - name: "Cover"
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
if: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' }}
with:
file: lcov.info
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8 changes: 4 additions & 4 deletions src/backproject.jl
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -56,7 +56,7 @@ function backproject!(
plan.viewangle[viewidx],
plan.planrot[thid],
)
end
end # COV_EXCL_LINE

return image
end
@@ -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])
6 changes: 3 additions & 3 deletions src/project.jl
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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)
2 changes: 1 addition & 1 deletion src/rotatez.jl
Original file line number Diff line number Diff line change
@@ -520,7 +520,7 @@ function _imrotate!(
θ,
plans[id],
)
end
end # COV_EXCL_LINE

return output
end
Loading