Skip to content

fix: stage direct NUDFT output in a contiguous buffer - #37

Open
DiamonDinoia wants to merge 1 commit into
TRIQS:unstablefrom
DiamonDinoia:fix/direct-nudft-strided-output
Open

fix: stage direct NUDFT output in a contiguous buffer#37
DiamonDinoia wants to merge 1 commit into
TRIQS:unstablefrom
DiamonDinoia:fix/direct-nudft-strided-output

Conversation

@DiamonDinoia

Copy link
Copy Markdown
Collaborator

do_direct_bitwise and do_direct_prime write through fiw_vec.data() and index that pointer contiguously. fiw_vec is an nda::array_view and may be a strided slice. On a strided view the kernels overwrite neighbouring elements and drop the accumulation. measures/M_iw.cpp builds exactly such a view, M_data(bl)(range::all, i, j).

Both kernels now write into fk_vec, the contiguous staging buffer the type3 path already uses. do_direct zeroes fk_vec, runs the kernel, then adds the result into fiw_vec stride-aware. The constructor sizes fk_vec for every non-uniform type instead of only for type3.

Direct_Strided_1D covers do_direct_bitwise and Direct_Strided_2D covers do_direct_prime, both through a stride-16 slice, against a contiguous type3 reference. Direct_Strided_1D also asserts that no element outside the slice changes.

Assisted-by: Claude Opus 5 noreply@anthropic.com

do_direct_bitwise and do_direct_prime write through fiw_vec.data() and index
that pointer contiguously. fiw_vec is an nda::array_view and may be a strided
slice. On a strided view the kernels overwrite neighbouring elements and drop
the accumulation. measures/M_iw.cpp builds exactly such a view,
M_data(bl)(range::all, i, j).

Both kernels now write into fk_vec, the contiguous staging buffer the type3
path already uses. do_direct zeroes fk_vec, runs the kernel, then adds the
result into fiw_vec stride-aware. The constructor sizes fk_vec for every
non-uniform type instead of only for type3.

Direct_Strided_1D covers do_direct_bitwise and Direct_Strided_2D covers
do_direct_prime, both through a stride-16 slice, against a contiguous type3
reference. Direct_Strided_1D also asserts that no element outside the slice
changes.

Assisted-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant