Repository navigation
Fix Siddon projection kernel missing return on missed rays (cone and parallel) - #791
Closed
hashimoto-koh wants to merge 1 commit into
Closed
hashimoto-koh wants to merge 1 commit into
hashimoto-koh wants to merge 1 commit into
Conversation
…parallel) Add early return after zeroing detector on missed rays (am >= aM) to avoid invalid index ranges and unnecessary computation in subsequent steps. Add regression test test_siddon_missed_rays.py covering cone and parallel modes.
Member
|
Ca you clarify how this PR is different to this one: #779? |
Author
|
Hi @AnderBiguri, Apologies for the oversight — I hadn't noticed #779 when opening this PR. You are completely right: the core fix (adding the missing The main differences are:
Next steps (up to your preference):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In
Siddon_projection.cuandSiddon_projection_parallel.cu, when a ray does not intersect the bounding box of the voxel volume (am >= aM),detector[idx]is set to 0, but the kernel forgets toreturn.Consequently, GPU threads for missed rays continue executing subsequent index computations, texture fetches, and loop iterations with invalid index ranges (such as
imin > imax), causing unnecessary GPU instruction overhead and potential undefined behaviors.This PR adds an early
return;immediately after zeroing the detector pixel on missed rays in both cone-beam and parallel-beam Siddon projection kernels.Changes
Common/CUDA/Siddon_projection.cu: early return whenam >= aMCommon/CUDA/Siddon_projection_parallel.cu: early return whenam >= aMPython/tests/test_siddon_missed_rays.py: regression test for missed rays in both cone and parallel modes