Repository navigation
gh-216: add intersect - #245
Open
LuhTonkaYeat wants to merge 3 commits into
Open
LuhTonkaYeat wants to merge 3 commits into
LuhTonkaYeat wants to merge 3 commits into
Conversation
LuhTonkaYeat
force-pushed
the
feature/cl-intersect
branch
from
September 21, 2026 13:16
ef54e47 to
c176a88
Compare
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.
Adds
exec_intersect--- set intersection of two sorted key-value arrays with abinary operation applied to matched values.
Implementation
cpu_intersect.hpp(two-pointer merge).cl_intersect.hpp+ kernelintersect.cl(naive fallback);shared merge module
cl_merge.hpp+ kernelsmerge.cl/merge_union.cl.Public API, schedule task, registry entries (INT/UINT/FLOAT), C binding
spla_Exec_intersect.OpenCL notes
in B; per-tile counts are turned into output offsets with an exclusive scan,
so the result is deterministic, sorted and written without atomics.
cl_merge.hppfor otheralgorithms; input and output buffer offsets allow processing CSR row slices
without copying.
binary operation; uses diagonal merge-path partition (co-rank search) with
boundary snapping so an equal pair is never split between tiles.
which iterates the smaller array and is faster there.
not confused with empty entries.
Null-argument guard for parity with CPU.
Tests
CPU: test_intersect (7 cases).
OpenCL:
test_opencl_intersect(22 cases) — types, boundary keys/values, tileboundaries, exact tile multiples, asymmetric sizes in both directions, large
inputs, negative cases, deferred (scheduled) path, sorted deterministic output.
Merge module: test_merge_union (14 checks) — folding union, intersection,
buffer offsets, tile boundaries, large inputs.