Repository navigation
Share finite field linear algebra code between 8, 16 and 32 bit - #389
Merged
Merged
Conversation
The linear algebra in la_ff_8.c, la_ff_16.c and la_ff_32.c consisted largely of copies of the same functions which had drifted apart over time. The field independent parts (echelon forms, dense and sparse-dense linear algebra, interreduction and the drivers) now live in the template la_ff_common.c, which each la_ff_N.c includes after defining a small set of macros for coefficient type, coefficient array name and function suffix. The scalar reduction kernels valid for primes < 2^18, formerly copied in the 8 bit, 16 bit and 17 bit code, are shared via the template la_ff_small_prime.c. The la_ff_N.c files now only contain the code that is specific to the coefficient size, i.e. normalization and the SIMD reduction kernels, plus the SBA and saturation code for 32 bit. The shared code is based on the 32 bit version, so the 8 and 16 bit linear algebra now also gets its fixes, e.g. bad prime detection when applying a tracer and correct coefficient handling in the 16 bit tracer code. The 17 bit trace kernel now returns NULL for rows reduced to zero, and the 16 bit sparse kernel stores basis index and multiplier in new rows like the other kernels. The 8 and 16 bit sparse kernels take md_t as argument like the 32 bit ones. probabilistic_sparse_dense_linear_ algebra_ff_N_2 is renamed to probabilistic_sparse_dense_linear_algebra_ 2_ff_N to fit the naming scheme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Looks good to me, thanks! |
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.
The linear algebra in la_ff_8.c, la_ff_16.c and la_ff_32.c consisted largely of copies of the same functions which had drifted apart over time. The field independent parts (echelon forms, dense and sparse-dense linear algebra, interreduction and the drivers) now live in the template la_ff_common.c, which each la_ff_N.c includes after defining a small set of macros for coefficient type, coefficient array name and function suffix. The scalar reduction kernels valid for primes < 2^18, formerly copied in the 8 bit, 16 bit and 17 bit code, are shared via the template la_ff_small_prime.c. The la_ff_N.c files now only contain the code that is specific to the coefficient size, i.e. normalization and the SIMD reduction kernels, plus the SBA and saturation code for 32 bit.
The shared code is based on the 32 bit version, so the 8 and 16 bit linear algebra now also gets its fixes, e.g. bad prime detection when applying a tracer and correct coefficient handling in the 16 bit tracer code. The 17 bit trace kernel now returns NULL for rows reduced to zero, and the 16 bit sparse kernel stores basis index and multiplier in new rows like the other kernels. The 8 and 16 bit sparse kernels take md_t as argument like the 32 bit ones. probabilistic_sparse_dense_linear_ algebra_ff_N_2 is renamed to probabilistic_sparse_dense_linear_algebra_ 2_ff_N to fit the naming scheme.
Done with the help of claude.