Repository navigation
Clean up the spotfinder's kernel launch geometry - #163
Open
dimitrivlachos wants to merge 6 commits into
Open
dimitrivlachos wants to merge 6 commits into
dimitrivlachos wants to merge 6 commits into
Conversation
dimitrivlachos
force-pushed
the
spotfinder-launch-geometry
branch
3 times, most recently
from
November 12, 2026 17:30
ce0473a to
c4354fa
Compare
dimitrivlachos
force-pushed
the
spotfinder-launch-geometry
branch
from
November 12, 2026 17:57
c4354fa to
ff1946d
Compare
dimitrivlachos
marked this pull request as ready for review
November 16, 2026 17:17
This branch has not been deployed
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.
Building on #159, this PR tidies up how the spotfinder launches its
thresholding kernels. The block size was a bare
{32, 16}, and eachkernel worked out its own shared memory split by hand, separately from
the size the launch asked for, so changing one without the other would
have gone unnoticed. The image tile also only lined up for 32-bit
pixels because the mask tiles in front of it happened to come out a
multiple of 4 bytes.
While in there I removed the image batching path. The original
spotfinder could load several images into one buffer and launch over
all of them, with each block picking out its image by
blockIdx.z,but the host side of that was taken out in March 2023 and only the
kernel offsets were left. They still cost about 80 instructions, and
the extended second pass, written since, never offsets its dispersion
mask, so a batch would not have worked as the code stands. Bringing
batching back would need batch-sized buffers, offsets on every
per-image pointer, and a decode step that stages several images per
upload.
I also swept six block shapes to see whether 32x16 was worth keeping.
32x8 was about 6% faster on the dispersion algorithm, however, it
began producing non deterministic results which is beyond the scope
of this PR. Thus it remains at 32x16 where results appear
deterministic and an investigation of this will come next.
Changes
include/spotfinder/launch_geometry.hpp: new, naming both blockshapes and holding the shared memory arithmetic in one place.
spotfinder/kernels/thresholding.cu: the batching offsets are gone,and static asserts check each kernel's shared memory split against
the launch and the image tile's alignment.
spotfinder/spotfinder.cu: the erosion launch no longer asks forshared memory it never uses, and
check_launch_geometryrejects ablock too small for the halo or too big for the device's shared
memory.
spotfinder/spotfinder.cc:--dminand--dmaxare checked, sincea negative value was quietly ignored and a reversed range masked the
whole image.